@cgi-learning-hub/ui 0.0.1-dev.1708974808 → 0.0.1-dev.1709023966

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 (134) hide show
  1. package/dist/Box-7uR7JZiM.cjs +1 -0
  2. package/dist/Box-CPGTKTgx.js +56 -0
  3. package/dist/ButtonBase-B0tkJ9zf.js +831 -0
  4. package/dist/ButtonBase-DCL6Xlnm.cjs +75 -0
  5. package/dist/CircularProgress-CZX5SfKt.cjs +28 -0
  6. package/dist/CircularProgress-CguDBnxV.js +215 -0
  7. package/dist/IconButton-CJ1Nt-jf.js +182 -0
  8. package/dist/IconButton-De7ZdW2q.cjs +2 -0
  9. package/dist/{InputBase-B13Nzzhk.js → InputBase-C_yPRkam.js} +193 -215
  10. package/dist/InputBase-Dvr5GnwD.cjs +4 -0
  11. package/dist/Tab-Bhm9hCrX.cjs +1 -0
  12. package/dist/Tab-C4l6V01S.js +237 -0
  13. package/dist/TransitionGroupContext-C7wWJ6l7.js +14 -0
  14. package/dist/TransitionGroupContext-g4tmk10h.cjs +1 -0
  15. package/dist/Typography-CyFLZjnE.js +202 -0
  16. package/dist/Typography-DwsN2Ttm.cjs +1 -0
  17. package/dist/assets/index.css +1 -1
  18. package/dist/components/Dropzone/Dropzone.cjs.js +5 -0
  19. package/dist/components/Dropzone/Dropzone.d.ts +9 -0
  20. package/dist/components/Dropzone/Dropzone.es.js +1210 -0
  21. package/dist/components/Dropzone/Dropzone.stories.cjs.js +1 -0
  22. package/dist/components/{AnotherComponent/AnotherComponent.stories.d.ts → Dropzone/Dropzone.stories.d.ts} +1 -2
  23. package/dist/components/Dropzone/Dropzone.stories.es.js +17 -0
  24. package/dist/components/Dropzone/index.cjs.js +1 -0
  25. package/dist/components/Dropzone/index.d.ts +2 -0
  26. package/dist/components/Dropzone/index.es.js +4 -0
  27. package/dist/components/buttons/DefaultButton/DefaultButton.cjs.js +1 -28
  28. package/dist/components/buttons/DefaultButton/DefaultButton.es.js +408 -267
  29. package/dist/components/buttons/DefaultButton/DefaultButtonIcon.cjs.js +1 -1
  30. package/dist/components/buttons/DefaultButton/DefaultButtonIcon.es.js +5 -5
  31. package/dist/components/buttons/IconButton.stories.cjs.js +1 -0
  32. package/dist/components/buttons/IconButton.stories.d.ts +4 -0
  33. package/dist/components/buttons/IconButton.stories.es.js +27 -0
  34. package/dist/components/buttons/PrimaryButton/PrimaryButton.cjs.js +1 -1
  35. package/dist/components/buttons/PrimaryButton/PrimaryButton.es.js +1 -1
  36. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.cjs.js +1 -1
  37. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.d.ts +1 -1
  38. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.es.js +8 -7
  39. package/dist/components/buttons/SecondaryButton/SecondaryButton.cjs.js +1 -1
  40. package/dist/components/buttons/SecondaryButton/SecondaryButton.es.js +1 -1
  41. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.cjs.js +1 -1
  42. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.d.ts +1 -1
  43. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.es.js +10 -9
  44. package/dist/components/index.cjs.js +1 -1
  45. package/dist/components/index.d.ts +4 -2
  46. package/dist/components/index.es.js +18 -14
  47. package/dist/components/inputs/SearchInput/SearchInput.cjs.js +1 -1
  48. package/dist/components/inputs/SearchInput/SearchInput.es.js +77 -247
  49. package/dist/components/inputs/SearchInput/SearchInput.stories.cjs.js +1 -0
  50. package/dist/components/inputs/SearchInput/SearchInput.stories.d.ts +4 -0
  51. package/dist/components/inputs/SearchInput/SearchInput.stories.es.js +16 -0
  52. package/dist/components/inputs/TextInput/TextInput.cjs.js +11 -13
  53. package/dist/components/inputs/TextInput/TextInput.es.js +1844 -1631
  54. package/dist/components/inputs/TextInput/TextInput.stories.cjs.js +1 -0
  55. package/dist/components/inputs/TextInput/TextInput.stories.d.ts +4 -0
  56. package/dist/components/inputs/TextInput/TextInput.stories.es.js +17 -0
  57. package/dist/components/lists/FileList/FileList.cjs.js +1 -0
  58. package/dist/components/lists/FileList/FileList.d.ts +7 -0
  59. package/dist/components/lists/FileList/FileList.es.js +19 -0
  60. package/dist/components/lists/FileList/FileList.stories.cjs.js +1 -0
  61. package/dist/components/lists/FileList/FileList.stories.d.ts +4 -0
  62. package/dist/components/lists/FileList/FileList.stories.es.js +28 -0
  63. package/dist/components/lists/FileList/FileListItem.cjs.js +1 -0
  64. package/dist/components/lists/FileList/FileListItem.d.ts +13 -0
  65. package/dist/components/lists/FileList/FileListItem.es.js +41 -0
  66. package/dist/components/lists/FileList/index.cjs.js +1 -0
  67. package/dist/components/lists/FileList/index.d.ts +4 -0
  68. package/dist/components/lists/FileList/index.es.js +6 -0
  69. package/dist/components/lists/TabList.stories.cjs.js +4 -0
  70. package/dist/components/lists/TabList.stories.d.ts +4 -0
  71. package/dist/components/lists/TabList.stories.es.js +1027 -0
  72. package/dist/components/lists/index.cjs.js +1 -0
  73. package/dist/components/lists/index.d.ts +1 -0
  74. package/dist/components/lists/index.es.js +6 -0
  75. package/dist/{createSvgIcon-jvI3LIfI.cjs → createSvgIcon-B6bZPuto.cjs} +1 -1
  76. package/dist/createSvgIcon-BX8WQ5r-.cjs +2 -0
  77. package/dist/{createSvgIcon-qXNZi4k1.js → createSvgIcon-KaSN8JhZ.js} +8 -8
  78. package/dist/createSvgIcon-m_wsenOJ.js +84 -0
  79. package/dist/index.cjs.js +1 -1
  80. package/dist/index.es.js +16 -12
  81. package/dist/isHostComponent-PydJW4A4.cjs +1 -0
  82. package/dist/isHostComponent-kiaBvYVo.js +6 -0
  83. package/dist/ownerWindow-C7EH1lr6.js +23 -0
  84. package/dist/ownerWindow-Dk_4aaak.cjs +1 -0
  85. package/dist/refType-CHSN6ysS.cjs +1 -0
  86. package/dist/refType-Hh9tfnoF.js +29 -0
  87. package/dist/unsupportedProp-Bn6XWqwH.cjs +1 -0
  88. package/dist/unsupportedProp-BuVD30Gh.js +9 -0
  89. package/dist/useControlled-BsLcOmhe.js +48 -0
  90. package/dist/useControlled-jN3fqFfv.cjs +3 -0
  91. package/dist/useForkRef-CGd3Nhyb.cjs +1 -0
  92. package/dist/useForkRef-DwN_Iz9R.js +17 -0
  93. package/dist/useIsFocusVisible-BF0lT08B.cjs +1 -0
  94. package/dist/useIsFocusVisible-D8ksiuhS.js +69 -0
  95. package/dist/useSlotProps-MoAYME1z.js +70 -0
  96. package/dist/useSlotProps-R4s13HHI.cjs +1 -0
  97. package/dist/useTheme-BDPYLOoP.cjs +1 -0
  98. package/dist/useTheme-DJEDOopE.js +9 -0
  99. package/dist/{useThemeProps-B6yTTpAe.js → useThemeProps-Dg9Uoq7q.js} +1018 -1024
  100. package/dist/useThemeProps-jkB5q9ie.cjs +65 -0
  101. package/dist/useTimeout-KN97abZR.js +47 -0
  102. package/dist/useTimeout-qjxkiZZn.cjs +1 -0
  103. package/package.json +2 -1
  104. package/dist/Button-Tkz5NkF_.cjs +0 -1
  105. package/dist/Button-X7eWZQfX.js +0 -356
  106. package/dist/ButtonBase-CKfcGhaU.js +0 -892
  107. package/dist/ButtonBase-Cg8cBMzO.cjs +0 -75
  108. package/dist/Input-CAb0EFzc.cjs +0 -1
  109. package/dist/Input-CbYjsRHK.js +0 -322
  110. package/dist/InputBase-CKlCw9fj.cjs +0 -4
  111. package/dist/components/AnotherComponent/AnotherComponent.cjs.js +0 -1
  112. package/dist/components/AnotherComponent/AnotherComponent.d.ts +0 -2
  113. package/dist/components/AnotherComponent/AnotherComponent.es.js +0 -15
  114. package/dist/components/AnotherComponent/AnotherComponent.stories.cjs.js +0 -1
  115. package/dist/components/AnotherComponent/AnotherComponent.stories.es.js +0 -22
  116. package/dist/components/AnotherComponent/index.cjs.js +0 -1
  117. package/dist/components/AnotherComponent/index.d.ts +0 -2
  118. package/dist/components/AnotherComponent/index.es.js +0 -4
  119. package/dist/components/BasicButtons/BasicButtons.cjs.js +0 -1
  120. package/dist/components/BasicButtons/BasicButtons.d.ts +0 -2
  121. package/dist/components/BasicButtons/BasicButtons.es.js +0 -189
  122. package/dist/components/BasicButtons/BasicButtons.stories.cjs.js +0 -1
  123. package/dist/components/BasicButtons/BasicButtons.stories.d.ts +0 -5
  124. package/dist/components/BasicButtons/BasicButtons.stories.es.js +0 -22
  125. package/dist/components/BasicButtons/index.cjs.js +0 -1
  126. package/dist/components/BasicButtons/index.d.ts +0 -2
  127. package/dist/components/BasicButtons/index.es.js +0 -4
  128. package/dist/extendSxProp-BRHiEwyk.js +0 -29
  129. package/dist/extendSxProp-CvhhU9Vb.cjs +0 -1
  130. package/dist/useForkRef-82uiK71d.cjs +0 -1
  131. package/dist/useForkRef-CLcOhrzI.js +0 -44
  132. package/dist/useTheme-BWRyHzdn.js +0 -65
  133. package/dist/useTheme-BpLcDNG1.cjs +0 -1
  134. package/dist/useThemeProps-CDriK9TK.cjs +0 -65
@@ -0,0 +1,1210 @@
1
+ import nr, { jsxs as ve, jsx as T, Fragment as Ue } from "react/jsx-runtime";
2
+ import { r as or, i as ir } from "../../createSvgIcon-m_wsenOJ.js";
3
+ import xr, { useMemo as I, useRef as Q, useReducer as Fr, useEffect as ye, useCallback as A, forwardRef as _r, useImperativeHandle as jr, Fragment as Sr } from "react";
4
+ import { P as f, s as Pr } from "../../useThemeProps-Dg9Uoq7q.js";
5
+ import { B as Tr } from "../../Box-CPGTKTgx.js";
6
+ import { T as be } from "../../Typography-CyFLZjnE.js";
7
+ var xe = {}, Ir = ir;
8
+ Object.defineProperty(xe, "__esModule", {
9
+ value: !0
10
+ });
11
+ var ar = xe.default = void 0, Cr = Ir(or()), Rr = nr;
12
+ ar = xe.default = (0, Cr.default)(/* @__PURE__ */ (0, Rr.jsx)("path", {
13
+ d: "M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"
14
+ }), "FileUpload");
15
+ var Fe = {}, zr = ir;
16
+ Object.defineProperty(Fe, "__esModule", {
17
+ value: !0
18
+ });
19
+ var ur = Fe.default = void 0, kr = zr(or()), Lr = nr;
20
+ ur = Fe.default = (0, kr.default)(/* @__PURE__ */ (0, Lr.jsx)("path", {
21
+ d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"
22
+ }), "UploadFile");
23
+ function C(e, r, t, n) {
24
+ function i(o) {
25
+ return o instanceof t ? o : new t(function(c) {
26
+ c(o);
27
+ });
28
+ }
29
+ return new (t || (t = Promise))(function(o, c) {
30
+ function s(m) {
31
+ try {
32
+ l(n.next(m));
33
+ } catch (y) {
34
+ c(y);
35
+ }
36
+ }
37
+ function d(m) {
38
+ try {
39
+ l(n.throw(m));
40
+ } catch (y) {
41
+ c(y);
42
+ }
43
+ }
44
+ function l(m) {
45
+ m.done ? o(m.value) : i(m.value).then(s, d);
46
+ }
47
+ l((n = n.apply(e, r || [])).next());
48
+ });
49
+ }
50
+ function R(e, r) {
51
+ var t = { label: 0, sent: function() {
52
+ if (o[0] & 1)
53
+ throw o[1];
54
+ return o[1];
55
+ }, trys: [], ops: [] }, n, i, o, c;
56
+ return c = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (c[Symbol.iterator] = function() {
57
+ return this;
58
+ }), c;
59
+ function s(l) {
60
+ return function(m) {
61
+ return d([l, m]);
62
+ };
63
+ }
64
+ function d(l) {
65
+ if (n)
66
+ throw new TypeError("Generator is already executing.");
67
+ for (; c && (c = 0, l[0] && (t = 0)), t; )
68
+ try {
69
+ if (n = 1, i && (o = l[0] & 2 ? i.return : l[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, l[1])).done)
70
+ return o;
71
+ switch (i = 0, o && (l = [l[0] & 2, o.value]), l[0]) {
72
+ case 0:
73
+ case 1:
74
+ o = l;
75
+ break;
76
+ case 4:
77
+ return t.label++, { value: l[1], done: !1 };
78
+ case 5:
79
+ t.label++, i = l[1], l = [0];
80
+ continue;
81
+ case 7:
82
+ l = t.ops.pop(), t.trys.pop();
83
+ continue;
84
+ default:
85
+ if (o = t.trys, !(o = o.length > 0 && o[o.length - 1]) && (l[0] === 6 || l[0] === 2)) {
86
+ t = 0;
87
+ continue;
88
+ }
89
+ if (l[0] === 3 && (!o || l[1] > o[0] && l[1] < o[3])) {
90
+ t.label = l[1];
91
+ break;
92
+ }
93
+ if (l[0] === 6 && t.label < o[1]) {
94
+ t.label = o[1], o = l;
95
+ break;
96
+ }
97
+ if (o && t.label < o[2]) {
98
+ t.label = o[2], t.ops.push(l);
99
+ break;
100
+ }
101
+ o[2] && t.ops.pop(), t.trys.pop();
102
+ continue;
103
+ }
104
+ l = r.call(e, t);
105
+ } catch (m) {
106
+ l = [6, m], i = 0;
107
+ } finally {
108
+ n = o = 0;
109
+ }
110
+ if (l[0] & 5)
111
+ throw l[1];
112
+ return { value: l[0] ? l[1] : void 0, done: !0 };
113
+ }
114
+ }
115
+ function qe(e, r) {
116
+ var t = typeof Symbol == "function" && e[Symbol.iterator];
117
+ if (!t)
118
+ return e;
119
+ var n = t.call(e), i, o = [], c;
120
+ try {
121
+ for (; (r === void 0 || r-- > 0) && !(i = n.next()).done; )
122
+ o.push(i.value);
123
+ } catch (s) {
124
+ c = { error: s };
125
+ } finally {
126
+ try {
127
+ i && !i.done && (t = n.return) && t.call(n);
128
+ } finally {
129
+ if (c)
130
+ throw c.error;
131
+ }
132
+ }
133
+ return o;
134
+ }
135
+ function Ne(e, r, t) {
136
+ if (t || arguments.length === 2)
137
+ for (var n = 0, i = r.length, o; n < i; n++)
138
+ (o || !(n in r)) && (o || (o = Array.prototype.slice.call(r, 0, n)), o[n] = r[n]);
139
+ return e.concat(o || Array.prototype.slice.call(r));
140
+ }
141
+ var Mr = /* @__PURE__ */ new Map([
142
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
143
+ ["aac", "audio/aac"],
144
+ ["abw", "application/x-abiword"],
145
+ ["arc", "application/x-freearc"],
146
+ ["avif", "image/avif"],
147
+ ["avi", "video/x-msvideo"],
148
+ ["azw", "application/vnd.amazon.ebook"],
149
+ ["bin", "application/octet-stream"],
150
+ ["bmp", "image/bmp"],
151
+ ["bz", "application/x-bzip"],
152
+ ["bz2", "application/x-bzip2"],
153
+ ["cda", "application/x-cdf"],
154
+ ["csh", "application/x-csh"],
155
+ ["css", "text/css"],
156
+ ["csv", "text/csv"],
157
+ ["doc", "application/msword"],
158
+ ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
159
+ ["eot", "application/vnd.ms-fontobject"],
160
+ ["epub", "application/epub+zip"],
161
+ ["gz", "application/gzip"],
162
+ ["gif", "image/gif"],
163
+ ["heic", "image/heic"],
164
+ ["heif", "image/heif"],
165
+ ["htm", "text/html"],
166
+ ["html", "text/html"],
167
+ ["ico", "image/vnd.microsoft.icon"],
168
+ ["ics", "text/calendar"],
169
+ ["jar", "application/java-archive"],
170
+ ["jpeg", "image/jpeg"],
171
+ ["jpg", "image/jpeg"],
172
+ ["js", "text/javascript"],
173
+ ["json", "application/json"],
174
+ ["jsonld", "application/ld+json"],
175
+ ["mid", "audio/midi"],
176
+ ["midi", "audio/midi"],
177
+ ["mjs", "text/javascript"],
178
+ ["mp3", "audio/mpeg"],
179
+ ["mp4", "video/mp4"],
180
+ ["mpeg", "video/mpeg"],
181
+ ["mpkg", "application/vnd.apple.installer+xml"],
182
+ ["odp", "application/vnd.oasis.opendocument.presentation"],
183
+ ["ods", "application/vnd.oasis.opendocument.spreadsheet"],
184
+ ["odt", "application/vnd.oasis.opendocument.text"],
185
+ ["oga", "audio/ogg"],
186
+ ["ogv", "video/ogg"],
187
+ ["ogx", "application/ogg"],
188
+ ["opus", "audio/opus"],
189
+ ["otf", "font/otf"],
190
+ ["png", "image/png"],
191
+ ["pdf", "application/pdf"],
192
+ ["php", "application/x-httpd-php"],
193
+ ["ppt", "application/vnd.ms-powerpoint"],
194
+ ["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"],
195
+ ["rar", "application/vnd.rar"],
196
+ ["rtf", "application/rtf"],
197
+ ["sh", "application/x-sh"],
198
+ ["svg", "image/svg+xml"],
199
+ ["swf", "application/x-shockwave-flash"],
200
+ ["tar", "application/x-tar"],
201
+ ["tif", "image/tiff"],
202
+ ["tiff", "image/tiff"],
203
+ ["ts", "video/mp2t"],
204
+ ["ttf", "font/ttf"],
205
+ ["txt", "text/plain"],
206
+ ["vsd", "application/vnd.visio"],
207
+ ["wav", "audio/wav"],
208
+ ["weba", "audio/webm"],
209
+ ["webm", "video/webm"],
210
+ ["webp", "image/webp"],
211
+ ["woff", "font/woff"],
212
+ ["woff2", "font/woff2"],
213
+ ["xhtml", "application/xhtml+xml"],
214
+ ["xls", "application/vnd.ms-excel"],
215
+ ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
216
+ ["xml", "application/xml"],
217
+ ["xul", "application/vnd.mozilla.xul+xml"],
218
+ ["zip", "application/zip"],
219
+ ["7z", "application/x-7z-compressed"],
220
+ // Others
221
+ ["mkv", "video/x-matroska"],
222
+ ["mov", "video/quicktime"],
223
+ ["msg", "application/vnd.ms-outlook"]
224
+ ]);
225
+ function W(e, r) {
226
+ var t = $r(e);
227
+ if (typeof t.path != "string") {
228
+ var n = e.webkitRelativePath;
229
+ Object.defineProperty(t, "path", {
230
+ value: typeof r == "string" ? r : typeof n == "string" && n.length > 0 ? n : e.name,
231
+ writable: !1,
232
+ configurable: !1,
233
+ enumerable: !0
234
+ });
235
+ }
236
+ return t;
237
+ }
238
+ function $r(e) {
239
+ var r = e.name, t = r && r.lastIndexOf(".") !== -1;
240
+ if (t && !e.type) {
241
+ var n = r.split(".").pop().toLowerCase(), i = Mr.get(n);
242
+ i && Object.defineProperty(e, "type", {
243
+ value: i,
244
+ writable: !1,
245
+ configurable: !1,
246
+ enumerable: !0
247
+ });
248
+ }
249
+ return e;
250
+ }
251
+ var Kr = [
252
+ // Thumbnail cache files for macOS and Windows
253
+ ".DS_Store",
254
+ "Thumbs.db"
255
+ // Windows
256
+ ];
257
+ function Hr(e) {
258
+ return C(this, void 0, void 0, function() {
259
+ return R(this, function(r) {
260
+ return Z(e) && Br(e.dataTransfer) ? [2, Nr(e.dataTransfer, e.type)] : Wr(e) ? [2, Ur(e)] : Array.isArray(e) && e.every(function(t) {
261
+ return "getFile" in t && typeof t.getFile == "function";
262
+ }) ? [2, qr(e)] : [2, []];
263
+ });
264
+ });
265
+ }
266
+ function Br(e) {
267
+ return Z(e);
268
+ }
269
+ function Wr(e) {
270
+ return Z(e) && Z(e.target);
271
+ }
272
+ function Z(e) {
273
+ return typeof e == "object" && e !== null;
274
+ }
275
+ function Ur(e) {
276
+ return De(e.target.files).map(function(r) {
277
+ return W(r);
278
+ });
279
+ }
280
+ function qr(e) {
281
+ return C(this, void 0, void 0, function() {
282
+ var r;
283
+ return R(this, function(t) {
284
+ switch (t.label) {
285
+ case 0:
286
+ return [4, Promise.all(e.map(function(n) {
287
+ return n.getFile();
288
+ }))];
289
+ case 1:
290
+ return r = t.sent(), [2, r.map(function(n) {
291
+ return W(n);
292
+ })];
293
+ }
294
+ });
295
+ });
296
+ }
297
+ function Nr(e, r) {
298
+ return C(this, void 0, void 0, function() {
299
+ var t, n;
300
+ return R(this, function(i) {
301
+ switch (i.label) {
302
+ case 0:
303
+ return e.items ? (t = De(e.items).filter(function(o) {
304
+ return o.kind === "file";
305
+ }), r !== "drop" ? [2, t] : [4, Promise.all(t.map(Gr))]) : [3, 2];
306
+ case 1:
307
+ return n = i.sent(), [2, Ge(cr(n))];
308
+ case 2:
309
+ return [2, Ge(De(e.files).map(function(o) {
310
+ return W(o);
311
+ }))];
312
+ }
313
+ });
314
+ });
315
+ }
316
+ function Ge(e) {
317
+ return e.filter(function(r) {
318
+ return Kr.indexOf(r.name) === -1;
319
+ });
320
+ }
321
+ function De(e) {
322
+ if (e === null)
323
+ return [];
324
+ for (var r = [], t = 0; t < e.length; t++) {
325
+ var n = e[t];
326
+ r.push(n);
327
+ }
328
+ return r;
329
+ }
330
+ function Gr(e) {
331
+ if (typeof e.webkitGetAsEntry != "function")
332
+ return Ye(e);
333
+ var r = e.webkitGetAsEntry();
334
+ return r && r.isDirectory ? lr(r) : Ye(e);
335
+ }
336
+ function cr(e) {
337
+ return e.reduce(function(r, t) {
338
+ return Ne(Ne([], qe(r), !1), qe(Array.isArray(t) ? cr(t) : [t]), !1);
339
+ }, []);
340
+ }
341
+ function Ye(e) {
342
+ var r = e.getAsFile();
343
+ if (!r)
344
+ return Promise.reject("".concat(e, " is not a File"));
345
+ var t = W(r);
346
+ return Promise.resolve(t);
347
+ }
348
+ function Yr(e) {
349
+ return C(this, void 0, void 0, function() {
350
+ return R(this, function(r) {
351
+ return [2, e.isDirectory ? lr(e) : Vr(e)];
352
+ });
353
+ });
354
+ }
355
+ function lr(e) {
356
+ var r = e.createReader();
357
+ return new Promise(function(t, n) {
358
+ var i = [];
359
+ function o() {
360
+ var c = this;
361
+ r.readEntries(function(s) {
362
+ return C(c, void 0, void 0, function() {
363
+ var d, l, m;
364
+ return R(this, function(y) {
365
+ switch (y.label) {
366
+ case 0:
367
+ if (s.length)
368
+ return [3, 5];
369
+ y.label = 1;
370
+ case 1:
371
+ return y.trys.push([1, 3, , 4]), [4, Promise.all(i)];
372
+ case 2:
373
+ return d = y.sent(), t(d), [3, 4];
374
+ case 3:
375
+ return l = y.sent(), n(l), [3, 4];
376
+ case 4:
377
+ return [3, 6];
378
+ case 5:
379
+ m = Promise.all(s.map(Yr)), i.push(m), o(), y.label = 6;
380
+ case 6:
381
+ return [
382
+ 2
383
+ /*return*/
384
+ ];
385
+ }
386
+ });
387
+ });
388
+ }, function(s) {
389
+ n(s);
390
+ });
391
+ }
392
+ o();
393
+ });
394
+ }
395
+ function Vr(e) {
396
+ return C(this, void 0, void 0, function() {
397
+ return R(this, function(r) {
398
+ return [2, new Promise(function(t, n) {
399
+ e.file(function(i) {
400
+ var o = W(i, e.fullPath);
401
+ t(o);
402
+ }, function(i) {
403
+ n(i);
404
+ });
405
+ })];
406
+ });
407
+ });
408
+ }
409
+ var Jr = function(e, r) {
410
+ if (e && r) {
411
+ var t = Array.isArray(r) ? r : r.split(","), n = e.name || "", i = (e.type || "").toLowerCase(), o = i.replace(/\/.*$/, "");
412
+ return t.some(function(c) {
413
+ var s = c.trim().toLowerCase();
414
+ return s.charAt(0) === "." ? n.toLowerCase().endsWith(s) : s.endsWith("/*") ? o === s.replace(/\/.*$/, "") : i === s;
415
+ });
416
+ }
417
+ return !0;
418
+ };
419
+ function Ve(e) {
420
+ return Zr(e) || Xr(e) || fr(e) || Qr();
421
+ }
422
+ function Qr() {
423
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
424
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
425
+ }
426
+ function Xr(e) {
427
+ if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null)
428
+ return Array.from(e);
429
+ }
430
+ function Zr(e) {
431
+ if (Array.isArray(e))
432
+ return we(e);
433
+ }
434
+ function Je(e, r) {
435
+ var t = Object.keys(e);
436
+ if (Object.getOwnPropertySymbols) {
437
+ var n = Object.getOwnPropertySymbols(e);
438
+ r && (n = n.filter(function(i) {
439
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
440
+ })), t.push.apply(t, n);
441
+ }
442
+ return t;
443
+ }
444
+ function Qe(e) {
445
+ for (var r = 1; r < arguments.length; r++) {
446
+ var t = arguments[r] != null ? arguments[r] : {};
447
+ r % 2 ? Je(Object(t), !0).forEach(function(n) {
448
+ sr(e, n, t[n]);
449
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Je(Object(t)).forEach(function(n) {
450
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
451
+ });
452
+ }
453
+ return e;
454
+ }
455
+ function sr(e, r, t) {
456
+ return r in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;
457
+ }
458
+ function B(e, r) {
459
+ return tt(e) || rt(e, r) || fr(e, r) || et();
460
+ }
461
+ function et() {
462
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
463
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
464
+ }
465
+ function fr(e, r) {
466
+ if (e) {
467
+ if (typeof e == "string")
468
+ return we(e, r);
469
+ var t = Object.prototype.toString.call(e).slice(8, -1);
470
+ if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set")
471
+ return Array.from(e);
472
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
473
+ return we(e, r);
474
+ }
475
+ }
476
+ function we(e, r) {
477
+ (r == null || r > e.length) && (r = e.length);
478
+ for (var t = 0, n = new Array(r); t < r; t++)
479
+ n[t] = e[t];
480
+ return n;
481
+ }
482
+ function rt(e, r) {
483
+ var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
484
+ if (t != null) {
485
+ var n = [], i = !0, o = !1, c, s;
486
+ try {
487
+ for (t = t.call(e); !(i = (c = t.next()).done) && (n.push(c.value), !(r && n.length === r)); i = !0)
488
+ ;
489
+ } catch (d) {
490
+ o = !0, s = d;
491
+ } finally {
492
+ try {
493
+ !i && t.return != null && t.return();
494
+ } finally {
495
+ if (o)
496
+ throw s;
497
+ }
498
+ }
499
+ return n;
500
+ }
501
+ }
502
+ function tt(e) {
503
+ if (Array.isArray(e))
504
+ return e;
505
+ }
506
+ var nt = "file-invalid-type", ot = "file-too-large", it = "file-too-small", at = "too-many-files", ut = function(r) {
507
+ r = Array.isArray(r) && r.length === 1 ? r[0] : r;
508
+ var t = Array.isArray(r) ? "one of ".concat(r.join(", ")) : r;
509
+ return {
510
+ code: nt,
511
+ message: "File type must be ".concat(t)
512
+ };
513
+ }, Xe = function(r) {
514
+ return {
515
+ code: ot,
516
+ message: "File is larger than ".concat(r, " ").concat(r === 1 ? "byte" : "bytes")
517
+ };
518
+ }, Ze = function(r) {
519
+ return {
520
+ code: it,
521
+ message: "File is smaller than ".concat(r, " ").concat(r === 1 ? "byte" : "bytes")
522
+ };
523
+ }, ct = {
524
+ code: at,
525
+ message: "Too many files"
526
+ };
527
+ function pr(e, r) {
528
+ var t = e.type === "application/x-moz-file" || Jr(e, r);
529
+ return [t, t ? null : ut(r)];
530
+ }
531
+ function dr(e, r, t) {
532
+ if (F(e.size))
533
+ if (F(r) && F(t)) {
534
+ if (e.size > t)
535
+ return [!1, Xe(t)];
536
+ if (e.size < r)
537
+ return [!1, Ze(r)];
538
+ } else {
539
+ if (F(r) && e.size < r)
540
+ return [!1, Ze(r)];
541
+ if (F(t) && e.size > t)
542
+ return [!1, Xe(t)];
543
+ }
544
+ return [!0, null];
545
+ }
546
+ function F(e) {
547
+ return e != null;
548
+ }
549
+ function lt(e) {
550
+ var r = e.files, t = e.accept, n = e.minSize, i = e.maxSize, o = e.multiple, c = e.maxFiles, s = e.validator;
551
+ return !o && r.length > 1 || o && c >= 1 && r.length > c ? !1 : r.every(function(d) {
552
+ var l = pr(d, t), m = B(l, 1), y = m[0], z = dr(d, n, i), k = B(z, 1), L = k[0], M = s ? s(d) : null;
553
+ return y && L && !M;
554
+ });
555
+ }
556
+ function ee(e) {
557
+ return typeof e.isPropagationStopped == "function" ? e.isPropagationStopped() : typeof e.cancelBubble < "u" ? e.cancelBubble : !1;
558
+ }
559
+ function X(e) {
560
+ return e.dataTransfer ? Array.prototype.some.call(e.dataTransfer.types, function(r) {
561
+ return r === "Files" || r === "application/x-moz-file";
562
+ }) : !!e.target && !!e.target.files;
563
+ }
564
+ function er(e) {
565
+ e.preventDefault();
566
+ }
567
+ function st(e) {
568
+ return e.indexOf("MSIE") !== -1 || e.indexOf("Trident/") !== -1;
569
+ }
570
+ function ft(e) {
571
+ return e.indexOf("Edge/") !== -1;
572
+ }
573
+ function pt() {
574
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
575
+ return st(e) || ft(e);
576
+ }
577
+ function E() {
578
+ for (var e = arguments.length, r = new Array(e), t = 0; t < e; t++)
579
+ r[t] = arguments[t];
580
+ return function(n) {
581
+ for (var i = arguments.length, o = new Array(i > 1 ? i - 1 : 0), c = 1; c < i; c++)
582
+ o[c - 1] = arguments[c];
583
+ return r.some(function(s) {
584
+ return !ee(n) && s && s.apply(void 0, [n].concat(o)), ee(n);
585
+ });
586
+ };
587
+ }
588
+ function dt() {
589
+ return "showOpenFilePicker" in window;
590
+ }
591
+ function mt(e) {
592
+ if (F(e)) {
593
+ var r = Object.entries(e).filter(function(t) {
594
+ var n = B(t, 2), i = n[0], o = n[1], c = !0;
595
+ return mr(i) || (console.warn('Skipped "'.concat(i, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')), c = !1), (!Array.isArray(o) || !o.every(gr)) && (console.warn('Skipped "'.concat(i, '" because an invalid file extension was provided.')), c = !1), c;
596
+ }).reduce(function(t, n) {
597
+ var i = B(n, 2), o = i[0], c = i[1];
598
+ return Qe(Qe({}, t), {}, sr({}, o, c));
599
+ }, {});
600
+ return [{
601
+ // description is required due to https://crbug.com/1264708
602
+ description: "Files",
603
+ accept: r
604
+ }];
605
+ }
606
+ return e;
607
+ }
608
+ function gt(e) {
609
+ if (F(e))
610
+ return Object.entries(e).reduce(function(r, t) {
611
+ var n = B(t, 2), i = n[0], o = n[1];
612
+ return [].concat(Ve(r), [i], Ve(o));
613
+ }, []).filter(function(r) {
614
+ return mr(r) || gr(r);
615
+ }).join(",");
616
+ }
617
+ function vt(e) {
618
+ return e instanceof DOMException && (e.name === "AbortError" || e.code === e.ABORT_ERR);
619
+ }
620
+ function yt(e) {
621
+ return e instanceof DOMException && (e.name === "SecurityError" || e.code === e.SECURITY_ERR);
622
+ }
623
+ function mr(e) {
624
+ return e === "audio/*" || e === "video/*" || e === "image/*" || e === "text/*" || /\w+\/[-+.\w]+/g.test(e);
625
+ }
626
+ function gr(e) {
627
+ return /^.*\.[\w]+$/.test(e);
628
+ }
629
+ var bt = ["children"], ht = ["open"], Dt = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], wt = ["refKey", "onChange", "onClick"];
630
+ function At(e) {
631
+ return xt(e) || Ot(e) || vr(e) || Et();
632
+ }
633
+ function Et() {
634
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
635
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
636
+ }
637
+ function Ot(e) {
638
+ if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null)
639
+ return Array.from(e);
640
+ }
641
+ function xt(e) {
642
+ if (Array.isArray(e))
643
+ return Ae(e);
644
+ }
645
+ function he(e, r) {
646
+ return jt(e) || _t(e, r) || vr(e, r) || Ft();
647
+ }
648
+ function Ft() {
649
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
650
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
651
+ }
652
+ function vr(e, r) {
653
+ if (e) {
654
+ if (typeof e == "string")
655
+ return Ae(e, r);
656
+ var t = Object.prototype.toString.call(e).slice(8, -1);
657
+ if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set")
658
+ return Array.from(e);
659
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
660
+ return Ae(e, r);
661
+ }
662
+ }
663
+ function Ae(e, r) {
664
+ (r == null || r > e.length) && (r = e.length);
665
+ for (var t = 0, n = new Array(r); t < r; t++)
666
+ n[t] = e[t];
667
+ return n;
668
+ }
669
+ function _t(e, r) {
670
+ var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
671
+ if (t != null) {
672
+ var n = [], i = !0, o = !1, c, s;
673
+ try {
674
+ for (t = t.call(e); !(i = (c = t.next()).done) && (n.push(c.value), !(r && n.length === r)); i = !0)
675
+ ;
676
+ } catch (d) {
677
+ o = !0, s = d;
678
+ } finally {
679
+ try {
680
+ !i && t.return != null && t.return();
681
+ } finally {
682
+ if (o)
683
+ throw s;
684
+ }
685
+ }
686
+ return n;
687
+ }
688
+ }
689
+ function jt(e) {
690
+ if (Array.isArray(e))
691
+ return e;
692
+ }
693
+ function rr(e, r) {
694
+ var t = Object.keys(e);
695
+ if (Object.getOwnPropertySymbols) {
696
+ var n = Object.getOwnPropertySymbols(e);
697
+ r && (n = n.filter(function(i) {
698
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
699
+ })), t.push.apply(t, n);
700
+ }
701
+ return t;
702
+ }
703
+ function p(e) {
704
+ for (var r = 1; r < arguments.length; r++) {
705
+ var t = arguments[r] != null ? arguments[r] : {};
706
+ r % 2 ? rr(Object(t), !0).forEach(function(n) {
707
+ Ee(e, n, t[n]);
708
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : rr(Object(t)).forEach(function(n) {
709
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
710
+ });
711
+ }
712
+ return e;
713
+ }
714
+ function Ee(e, r, t) {
715
+ return r in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;
716
+ }
717
+ function re(e, r) {
718
+ if (e == null)
719
+ return {};
720
+ var t = St(e, r), n, i;
721
+ if (Object.getOwnPropertySymbols) {
722
+ var o = Object.getOwnPropertySymbols(e);
723
+ for (i = 0; i < o.length; i++)
724
+ n = o[i], !(r.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (t[n] = e[n]);
725
+ }
726
+ return t;
727
+ }
728
+ function St(e, r) {
729
+ if (e == null)
730
+ return {};
731
+ var t = {}, n = Object.keys(e), i, o;
732
+ for (o = 0; o < n.length; o++)
733
+ i = n[o], !(r.indexOf(i) >= 0) && (t[i] = e[i]);
734
+ return t;
735
+ }
736
+ var _e = /* @__PURE__ */ _r(function(e, r) {
737
+ var t = e.children, n = re(e, bt), i = br(n), o = i.open, c = re(i, ht);
738
+ return jr(r, function() {
739
+ return {
740
+ open: o
741
+ };
742
+ }, [o]), /* @__PURE__ */ xr.createElement(Sr, null, t(p(p({}, c), {}, {
743
+ open: o
744
+ })));
745
+ });
746
+ _e.displayName = "Dropzone";
747
+ var yr = {
748
+ disabled: !1,
749
+ getFilesFromEvent: Hr,
750
+ maxSize: 1 / 0,
751
+ minSize: 0,
752
+ multiple: !0,
753
+ maxFiles: 0,
754
+ preventDropOnDocument: !0,
755
+ noClick: !1,
756
+ noKeyboard: !1,
757
+ noDrag: !1,
758
+ noDragEventsBubbling: !1,
759
+ validator: null,
760
+ useFsAccessApi: !0,
761
+ autoFocus: !1
762
+ };
763
+ _e.defaultProps = yr;
764
+ _e.propTypes = {
765
+ /**
766
+ * Render function that exposes the dropzone state and prop getter fns
767
+ *
768
+ * @param {object} params
769
+ * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render
770
+ * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render
771
+ * @param {Function} params.open Open the native file selection dialog
772
+ * @param {boolean} params.isFocused Dropzone area is in focus
773
+ * @param {boolean} params.isFileDialogActive File dialog is opened
774
+ * @param {boolean} params.isDragActive Active drag is in progress
775
+ * @param {boolean} params.isDragAccept Dragged files are accepted
776
+ * @param {boolean} params.isDragReject Some dragged files are rejected
777
+ * @param {File[]} params.acceptedFiles Accepted files
778
+ * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
779
+ */
780
+ children: f.func,
781
+ /**
782
+ * Set accepted file types.
783
+ * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
784
+ * Keep in mind that mime type determination is not reliable across platforms. CSV files,
785
+ * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
786
+ * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
787
+ */
788
+ accept: f.objectOf(f.arrayOf(f.string)),
789
+ /**
790
+ * Allow drag 'n' drop (or selection from the file dialog) of multiple files
791
+ */
792
+ multiple: f.bool,
793
+ /**
794
+ * If false, allow dropped items to take over the current browser window
795
+ */
796
+ preventDropOnDocument: f.bool,
797
+ /**
798
+ * If true, disables click to open the native file selection dialog
799
+ */
800
+ noClick: f.bool,
801
+ /**
802
+ * If true, disables SPACE/ENTER to open the native file selection dialog.
803
+ * Note that it also stops tracking the focus state.
804
+ */
805
+ noKeyboard: f.bool,
806
+ /**
807
+ * If true, disables drag 'n' drop
808
+ */
809
+ noDrag: f.bool,
810
+ /**
811
+ * If true, stops drag event propagation to parents
812
+ */
813
+ noDragEventsBubbling: f.bool,
814
+ /**
815
+ * Minimum file size (in bytes)
816
+ */
817
+ minSize: f.number,
818
+ /**
819
+ * Maximum file size (in bytes)
820
+ */
821
+ maxSize: f.number,
822
+ /**
823
+ * Maximum accepted number of files
824
+ * The default value is 0 which means there is no limitation to how many files are accepted.
825
+ */
826
+ maxFiles: f.number,
827
+ /**
828
+ * Enable/disable the dropzone
829
+ */
830
+ disabled: f.bool,
831
+ /**
832
+ * Use this to provide a custom file aggregator
833
+ *
834
+ * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
835
+ */
836
+ getFilesFromEvent: f.func,
837
+ /**
838
+ * Cb for when closing the file dialog with no selection
839
+ */
840
+ onFileDialogCancel: f.func,
841
+ /**
842
+ * Cb for when opening the file dialog
843
+ */
844
+ onFileDialogOpen: f.func,
845
+ /**
846
+ * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
847
+ * to open the file picker instead of using an `<input type="file">` click event.
848
+ */
849
+ useFsAccessApi: f.bool,
850
+ /**
851
+ * Set to true to focus the root element on render
852
+ */
853
+ autoFocus: f.bool,
854
+ /**
855
+ * Cb for when the `dragenter` event occurs.
856
+ *
857
+ * @param {DragEvent} event
858
+ */
859
+ onDragEnter: f.func,
860
+ /**
861
+ * Cb for when the `dragleave` event occurs
862
+ *
863
+ * @param {DragEvent} event
864
+ */
865
+ onDragLeave: f.func,
866
+ /**
867
+ * Cb for when the `dragover` event occurs
868
+ *
869
+ * @param {DragEvent} event
870
+ */
871
+ onDragOver: f.func,
872
+ /**
873
+ * Cb for when the `drop` event occurs.
874
+ * Note that this callback is invoked after the `getFilesFromEvent` callback is done.
875
+ *
876
+ * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
877
+ * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.
878
+ * If `multiple` is set to false and additional files are dropped,
879
+ * all files besides the first will be rejected.
880
+ * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
881
+ *
882
+ * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
883
+ * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.
884
+ *
885
+ * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
886
+ * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
887
+ *
888
+ * ```js
889
+ * function onDrop(acceptedFiles) {
890
+ * const req = request.post('/upload')
891
+ * acceptedFiles.forEach(file => {
892
+ * req.attach(file.name, file)
893
+ * })
894
+ * req.end(callback)
895
+ * }
896
+ * ```
897
+ *
898
+ * @param {File[]} acceptedFiles
899
+ * @param {FileRejection[]} fileRejections
900
+ * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
901
+ */
902
+ onDrop: f.func,
903
+ /**
904
+ * Cb for when the `drop` event occurs.
905
+ * Note that if no files are accepted, this callback is not invoked.
906
+ *
907
+ * @param {File[]} files
908
+ * @param {(DragEvent|Event)} event
909
+ */
910
+ onDropAccepted: f.func,
911
+ /**
912
+ * Cb for when the `drop` event occurs.
913
+ * Note that if no files are rejected, this callback is not invoked.
914
+ *
915
+ * @param {FileRejection[]} fileRejections
916
+ * @param {(DragEvent|Event)} event
917
+ */
918
+ onDropRejected: f.func,
919
+ /**
920
+ * Cb for when there's some error from any of the promises.
921
+ *
922
+ * @param {Error} error
923
+ */
924
+ onError: f.func,
925
+ /**
926
+ * Custom validation function. It must return null if there's no errors.
927
+ * @param {File} file
928
+ * @returns {FileError|FileError[]|null}
929
+ */
930
+ validator: f.func
931
+ };
932
+ var Oe = {
933
+ isFocused: !1,
934
+ isFileDialogActive: !1,
935
+ isDragActive: !1,
936
+ isDragAccept: !1,
937
+ isDragReject: !1,
938
+ acceptedFiles: [],
939
+ fileRejections: []
940
+ };
941
+ function br() {
942
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = p(p({}, yr), e), t = r.accept, n = r.disabled, i = r.getFilesFromEvent, o = r.maxSize, c = r.minSize, s = r.multiple, d = r.maxFiles, l = r.onDragEnter, m = r.onDragLeave, y = r.onDragOver, z = r.onDrop, k = r.onDropAccepted, L = r.onDropRejected, M = r.onFileDialogCancel, te = r.onFileDialogOpen, je = r.useFsAccessApi, Se = r.autoFocus, ne = r.preventDropOnDocument, Pe = r.noClick, oe = r.noKeyboard, Te = r.noDrag, O = r.noDragEventsBubbling, ie = r.onError, $ = r.validator, K = I(function() {
943
+ return gt(t);
944
+ }, [t]), Ie = I(function() {
945
+ return mt(t);
946
+ }, [t]), ae = I(function() {
947
+ return typeof te == "function" ? te : tr;
948
+ }, [te]), U = I(function() {
949
+ return typeof M == "function" ? M : tr;
950
+ }, [M]), b = Q(null), w = Q(null), hr = Fr(Pt, Oe), Ce = he(hr, 2), ue = Ce[0], h = Ce[1], Dr = ue.isFocused, Re = ue.isFileDialogActive, q = Q(typeof window < "u" && window.isSecureContext && je && dt()), ze = function() {
951
+ !q.current && Re && setTimeout(function() {
952
+ if (w.current) {
953
+ var u = w.current.files;
954
+ u.length || (h({
955
+ type: "closeDialog"
956
+ }), U());
957
+ }
958
+ }, 300);
959
+ };
960
+ ye(function() {
961
+ return window.addEventListener("focus", ze, !1), function() {
962
+ window.removeEventListener("focus", ze, !1);
963
+ };
964
+ }, [w, Re, U, q]);
965
+ var _ = Q([]), ke = function(u) {
966
+ b.current && b.current.contains(u.target) || (u.preventDefault(), _.current = []);
967
+ };
968
+ ye(function() {
969
+ return ne && (document.addEventListener("dragover", er, !1), document.addEventListener("drop", ke, !1)), function() {
970
+ ne && (document.removeEventListener("dragover", er), document.removeEventListener("drop", ke));
971
+ };
972
+ }, [b, ne]), ye(function() {
973
+ return !n && Se && b.current && b.current.focus(), function() {
974
+ };
975
+ }, [b, Se, n]);
976
+ var x = A(function(a) {
977
+ ie ? ie(a) : console.error(a);
978
+ }, [ie]), Le = A(function(a) {
979
+ a.preventDefault(), a.persist(), V(a), _.current = [].concat(At(_.current), [a.target]), X(a) && Promise.resolve(i(a)).then(function(u) {
980
+ if (!(ee(a) && !O)) {
981
+ var g = u.length, v = g > 0 && lt({
982
+ files: u,
983
+ accept: K,
984
+ minSize: c,
985
+ maxSize: o,
986
+ multiple: s,
987
+ maxFiles: d,
988
+ validator: $
989
+ }), D = g > 0 && !v;
990
+ h({
991
+ isDragAccept: v,
992
+ isDragReject: D,
993
+ isDragActive: !0,
994
+ type: "setDraggedFiles"
995
+ }), l && l(a);
996
+ }
997
+ }).catch(function(u) {
998
+ return x(u);
999
+ });
1000
+ }, [i, l, x, O, K, c, o, s, d, $]), Me = A(function(a) {
1001
+ a.preventDefault(), a.persist(), V(a);
1002
+ var u = X(a);
1003
+ if (u && a.dataTransfer)
1004
+ try {
1005
+ a.dataTransfer.dropEffect = "copy";
1006
+ } catch {
1007
+ }
1008
+ return u && y && y(a), !1;
1009
+ }, [y, O]), $e = A(function(a) {
1010
+ a.preventDefault(), a.persist(), V(a);
1011
+ var u = _.current.filter(function(v) {
1012
+ return b.current && b.current.contains(v);
1013
+ }), g = u.indexOf(a.target);
1014
+ g !== -1 && u.splice(g, 1), _.current = u, !(u.length > 0) && (h({
1015
+ type: "setDraggedFiles",
1016
+ isDragActive: !1,
1017
+ isDragAccept: !1,
1018
+ isDragReject: !1
1019
+ }), X(a) && m && m(a));
1020
+ }, [b, m, O]), N = A(function(a, u) {
1021
+ var g = [], v = [];
1022
+ a.forEach(function(D) {
1023
+ var H = pr(D, K), P = he(H, 2), le = P[0], se = P[1], fe = dr(D, c, o), J = he(fe, 2), pe = J[0], de = J[1], me = $ ? $(D) : null;
1024
+ if (le && pe && !me)
1025
+ g.push(D);
1026
+ else {
1027
+ var ge = [se, de];
1028
+ me && (ge = ge.concat(me)), v.push({
1029
+ file: D,
1030
+ errors: ge.filter(function(Or) {
1031
+ return Or;
1032
+ })
1033
+ });
1034
+ }
1035
+ }), (!s && g.length > 1 || s && d >= 1 && g.length > d) && (g.forEach(function(D) {
1036
+ v.push({
1037
+ file: D,
1038
+ errors: [ct]
1039
+ });
1040
+ }), g.splice(0)), h({
1041
+ acceptedFiles: g,
1042
+ fileRejections: v,
1043
+ type: "setFiles"
1044
+ }), z && z(g, v, u), v.length > 0 && L && L(v, u), g.length > 0 && k && k(g, u);
1045
+ }, [h, s, K, c, o, d, z, k, L, $]), G = A(function(a) {
1046
+ a.preventDefault(), a.persist(), V(a), _.current = [], X(a) && Promise.resolve(i(a)).then(function(u) {
1047
+ ee(a) && !O || N(u, a);
1048
+ }).catch(function(u) {
1049
+ return x(u);
1050
+ }), h({
1051
+ type: "reset"
1052
+ });
1053
+ }, [i, N, x, O]), j = A(function() {
1054
+ if (q.current) {
1055
+ h({
1056
+ type: "openDialog"
1057
+ }), ae();
1058
+ var a = {
1059
+ multiple: s,
1060
+ types: Ie
1061
+ };
1062
+ window.showOpenFilePicker(a).then(function(u) {
1063
+ return i(u);
1064
+ }).then(function(u) {
1065
+ N(u, null), h({
1066
+ type: "closeDialog"
1067
+ });
1068
+ }).catch(function(u) {
1069
+ vt(u) ? (U(u), h({
1070
+ type: "closeDialog"
1071
+ })) : yt(u) ? (q.current = !1, w.current ? (w.current.value = null, w.current.click()) : x(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : x(u);
1072
+ });
1073
+ return;
1074
+ }
1075
+ w.current && (h({
1076
+ type: "openDialog"
1077
+ }), ae(), w.current.value = null, w.current.click());
1078
+ }, [h, ae, U, je, N, x, Ie, s]), Ke = A(function(a) {
1079
+ !b.current || !b.current.isEqualNode(a.target) || (a.key === " " || a.key === "Enter" || a.keyCode === 32 || a.keyCode === 13) && (a.preventDefault(), j());
1080
+ }, [b, j]), He = A(function() {
1081
+ h({
1082
+ type: "focus"
1083
+ });
1084
+ }, []), Be = A(function() {
1085
+ h({
1086
+ type: "blur"
1087
+ });
1088
+ }, []), We = A(function() {
1089
+ Pe || (pt() ? setTimeout(j, 0) : j());
1090
+ }, [Pe, j]), S = function(u) {
1091
+ return n ? null : u;
1092
+ }, ce = function(u) {
1093
+ return oe ? null : S(u);
1094
+ }, Y = function(u) {
1095
+ return Te ? null : S(u);
1096
+ }, V = function(u) {
1097
+ O && u.stopPropagation();
1098
+ }, wr = I(function() {
1099
+ return function() {
1100
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, u = a.refKey, g = u === void 0 ? "ref" : u, v = a.role, D = a.onKeyDown, H = a.onFocus, P = a.onBlur, le = a.onClick, se = a.onDragEnter, fe = a.onDragOver, J = a.onDragLeave, pe = a.onDrop, de = re(a, Dt);
1101
+ return p(p(Ee({
1102
+ onKeyDown: ce(E(D, Ke)),
1103
+ onFocus: ce(E(H, He)),
1104
+ onBlur: ce(E(P, Be)),
1105
+ onClick: S(E(le, We)),
1106
+ onDragEnter: Y(E(se, Le)),
1107
+ onDragOver: Y(E(fe, Me)),
1108
+ onDragLeave: Y(E(J, $e)),
1109
+ onDrop: Y(E(pe, G)),
1110
+ role: typeof v == "string" && v !== "" ? v : "presentation"
1111
+ }, g, b), !n && !oe ? {
1112
+ tabIndex: 0
1113
+ } : {}), de);
1114
+ };
1115
+ }, [b, Ke, He, Be, We, Le, Me, $e, G, oe, Te, n]), Ar = A(function(a) {
1116
+ a.stopPropagation();
1117
+ }, []), Er = I(function() {
1118
+ return function() {
1119
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, u = a.refKey, g = u === void 0 ? "ref" : u, v = a.onChange, D = a.onClick, H = re(a, wt), P = Ee({
1120
+ accept: K,
1121
+ multiple: s,
1122
+ type: "file",
1123
+ style: {
1124
+ display: "none"
1125
+ },
1126
+ onChange: S(E(v, G)),
1127
+ onClick: S(E(D, Ar)),
1128
+ tabIndex: -1
1129
+ }, g, w);
1130
+ return p(p({}, P), H);
1131
+ };
1132
+ }, [w, t, s, G, n]);
1133
+ return p(p({}, ue), {}, {
1134
+ isFocused: Dr && !n,
1135
+ getRootProps: wr,
1136
+ getInputProps: Er,
1137
+ rootRef: b,
1138
+ inputRef: w,
1139
+ open: S(j)
1140
+ });
1141
+ }
1142
+ function Pt(e, r) {
1143
+ switch (r.type) {
1144
+ case "focus":
1145
+ return p(p({}, e), {}, {
1146
+ isFocused: !0
1147
+ });
1148
+ case "blur":
1149
+ return p(p({}, e), {}, {
1150
+ isFocused: !1
1151
+ });
1152
+ case "openDialog":
1153
+ return p(p({}, Oe), {}, {
1154
+ isFileDialogActive: !0
1155
+ });
1156
+ case "closeDialog":
1157
+ return p(p({}, e), {}, {
1158
+ isFileDialogActive: !1
1159
+ });
1160
+ case "setDraggedFiles":
1161
+ return p(p({}, e), {}, {
1162
+ isDragActive: r.isDragActive,
1163
+ isDragAccept: r.isDragAccept,
1164
+ isDragReject: r.isDragReject
1165
+ });
1166
+ case "setFiles":
1167
+ return p(p({}, e), {}, {
1168
+ acceptedFiles: r.acceptedFiles,
1169
+ fileRejections: r.fileRejections
1170
+ });
1171
+ case "reset":
1172
+ return p({}, Oe);
1173
+ default:
1174
+ return e;
1175
+ }
1176
+ }
1177
+ function tr() {
1178
+ }
1179
+ const Tt = Pr(Tr)(({ theme: e }) => ({
1180
+ display: "flex",
1181
+ flexDirection: "column",
1182
+ justifyContent: "center",
1183
+ alignItems: "center",
1184
+ gap: "0.5rem",
1185
+ padding: "0.5rem",
1186
+ width: "20rem",
1187
+ height: "10rem",
1188
+ border: "1px dashed",
1189
+ borderColor: e.palette.grey[500],
1190
+ borderRadius: 4,
1191
+ cursor: "pointer"
1192
+ })), Mt = (e) => {
1193
+ const { getRootProps: r, getInputProps: t, isDragActive: n } = br({
1194
+ onDrop: e.onDrop
1195
+ }), { information: i } = e;
1196
+ return /* @__PURE__ */ ve(Tt, { ...r(), children: [
1197
+ /* @__PURE__ */ T("input", { ...t() }),
1198
+ n ? /* @__PURE__ */ ve(Ue, { children: [
1199
+ /* @__PURE__ */ T(ar, { color: "primary" }),
1200
+ /* @__PURE__ */ T(be, { children: "Déposer les fichiers ici" })
1201
+ ] }) : /* @__PURE__ */ ve(Ue, { children: [
1202
+ /* @__PURE__ */ T(ur, { color: "primary" }),
1203
+ /* @__PURE__ */ T(be, { children: "Glisser et déposer des fichiers ici, ou cliquer pour sélectionner des fichiers" }),
1204
+ i ? /* @__PURE__ */ T(be, { fontSize: "0.875rem", color: "grey", children: i }) : null
1205
+ ] })
1206
+ ] });
1207
+ };
1208
+ export {
1209
+ Mt as default
1210
+ };