welcome-ui 9.0.0-alpha.1 → 9.0.0-alpha.2

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.
package/dist/FileDrop.js CHANGED
@@ -1,17 +1,17 @@
1
1
  "use client";
2
- import { jsxs as V, Fragment as ri, jsx as x } from "react/jsx-runtime";
3
- import Oi, { useMemo as Y, useRef as va, useReducer as Fi, useEffect as ia, useCallback as z, forwardRef as si, useImperativeHandle as Pi, Fragment as Ii, useState as Ya } from "react";
2
+ import { jsxs as V, Fragment as ui, jsx as x } from "react/jsx-runtime";
3
+ import Pi, { useMemo as Y, useRef as va, useReducer as qi, useEffect as ia, useCallback as z, forwardRef as vi, useImperativeHandle as Ii, Fragment as Ri, useState as Ja } from "react";
4
4
  import { P as s } from "./index--0U5Rubs.js";
5
- import { g as Ri, c as di } from "./index-PAaZGbyz.js";
5
+ import { g as Si, c as ja } from "./index-PAaZGbyz.js";
6
6
  import { Button as ba } from "./Button.js";
7
7
  import "./Icon-BisRi8B3.js";
8
- import { P as Si, N as qi, E as Ti, T as Ci } from "./index-C1jjVTAc.js";
9
- import { c as Va } from "./create-event-rXDe5aCQ.js";
10
- import { g as Li, a as Mi, b as mi } from "./index-lbUBMgHp.js";
11
- import { E as Ni } from "./index-CnxSNAPH.js";
8
+ import { P as Ti, N as Li, E as Ci, T as Mi } from "./index-C1jjVTAc.js";
9
+ import { c as Xa } from "./create-event-rXDe5aCQ.js";
10
+ import { g as $i, a as Ni, b as fi } from "./index-lbUBMgHp.js";
11
+ import { E as Ki } from "./index-CnxSNAPH.js";
12
12
  import { Text as ha } from "./Text.js";
13
- function $(a, i, t, n) {
14
- function e(o) {
13
+ function N(a, i, t, e) {
14
+ function n(o) {
15
15
  return o instanceof t ? o : new t(function(c) {
16
16
  c(o);
17
17
  });
@@ -19,25 +19,25 @@ function $(a, i, t, n) {
19
19
  return new (t || (t = Promise))(function(o, c) {
20
20
  function r(f) {
21
21
  try {
22
- h(n.next(f));
23
- } catch (k) {
24
- c(k);
22
+ h(e.next(f));
23
+ } catch (j) {
24
+ c(j);
25
25
  }
26
26
  }
27
27
  function u(f) {
28
28
  try {
29
- h(n.throw(f));
30
- } catch (k) {
31
- c(k);
29
+ h(e.throw(f));
30
+ } catch (j) {
31
+ c(j);
32
32
  }
33
33
  }
34
34
  function h(f) {
35
- f.done ? o(f.value) : e(f.value).then(r, u);
35
+ f.done ? o(f.value) : n(f.value).then(r, u);
36
36
  }
37
- h((n = n.apply(a, i || [])).next());
37
+ h((e = e.apply(a, i || [])).next());
38
38
  });
39
39
  }
40
- const $i = /* @__PURE__ */ new Map([
40
+ const Hi = /* @__PURE__ */ new Map([
41
41
  // https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php
42
42
  ["1km", "application/vnd.1000minds.decision-model+xml"],
43
43
  ["3dml", "text/vnd.in3d.3dml"],
@@ -1241,15 +1241,15 @@ const $i = /* @__PURE__ */ new Map([
1241
1241
  ["zsh", "text/x-scriptzsh"]
1242
1242
  ]);
1243
1243
  function G(a, i, t) {
1244
- const n = Ki(a), { webkitRelativePath: e } = a, o = typeof i == "string" ? i : typeof e == "string" && e.length > 0 ? e : `./${a.name}`;
1245
- return typeof n.path != "string" && Ga(n, "path", o), Ga(n, "relativePath", o), n;
1244
+ const e = Wi(a), { webkitRelativePath: n } = a, o = typeof i == "string" ? i : typeof n == "string" && n.length > 0 ? n : `./${a.name}`;
1245
+ return typeof e.path != "string" && Qa(e, "path", o), Qa(e, "relativePath", o), e;
1246
1246
  }
1247
- function Ki(a) {
1247
+ function Wi(a) {
1248
1248
  const { name: i } = a;
1249
1249
  if (i && i.lastIndexOf(".") !== -1 && !a.type) {
1250
- const n = i.split(".").pop().toLowerCase(), e = $i.get(n);
1251
- e && Object.defineProperty(a, "type", {
1252
- value: e,
1250
+ const e = i.split(".").pop().toLowerCase(), n = Hi.get(e);
1251
+ n && Object.defineProperty(a, "type", {
1252
+ value: n,
1253
1253
  writable: !1,
1254
1254
  configurable: !1,
1255
1255
  enumerable: !0
@@ -1257,7 +1257,7 @@ function Ki(a) {
1257
1257
  }
1258
1258
  return a;
1259
1259
  }
1260
- function Ga(a, i, t) {
1260
+ function Qa(a, i, t) {
1261
1261
  Object.defineProperty(a, i, {
1262
1262
  value: t,
1263
1263
  writable: !1,
@@ -1265,266 +1265,266 @@ function Ga(a, i, t) {
1265
1265
  enumerable: !0
1266
1266
  });
1267
1267
  }
1268
- const Hi = [
1268
+ const Ui = [
1269
1269
  // Thumbnail cache files for macOS and Windows
1270
1270
  ".DS_Store",
1271
1271
  // macOs
1272
1272
  "Thumbs.db"
1273
1273
  // Windows
1274
1274
  ];
1275
- function Wi(a) {
1276
- return $(this, void 0, void 0, function* () {
1277
- return ya(a) && Bi(a.dataTransfer) ? Gi(a.dataTransfer, a.type) : Ui(a) ? Yi(a) : Array.isArray(a) && a.every((i) => "getFile" in i && typeof i.getFile == "function") ? Vi(a) : [];
1275
+ function Bi(a) {
1276
+ return N(this, void 0, void 0, function* () {
1277
+ return ya(a) && Yi(a.dataTransfer) ? Ji(a.dataTransfer, a.type) : Vi(a) ? Gi(a) : Array.isArray(a) && a.every((i) => "getFile" in i && typeof i.getFile == "function") ? Zi(a) : [];
1278
1278
  });
1279
1279
  }
1280
- function Bi(a) {
1280
+ function Yi(a) {
1281
1281
  return ya(a);
1282
1282
  }
1283
- function Ui(a) {
1283
+ function Vi(a) {
1284
1284
  return ya(a) && ya(a.target);
1285
1285
  }
1286
1286
  function ya(a) {
1287
1287
  return typeof a == "object" && a !== null;
1288
1288
  }
1289
- function Yi(a) {
1290
- return Ra(a.target.files).map((i) => G(i));
1289
+ function Gi(a) {
1290
+ return La(a.target.files).map((i) => G(i));
1291
1291
  }
1292
- function Vi(a) {
1293
- return $(this, void 0, void 0, function* () {
1292
+ function Zi(a) {
1293
+ return N(this, void 0, void 0, function* () {
1294
1294
  return (yield Promise.all(a.map((t) => t.getFile()))).map((t) => G(t));
1295
1295
  });
1296
1296
  }
1297
- function Gi(a, i) {
1298
- return $(this, void 0, void 0, function* () {
1297
+ function Ji(a, i) {
1298
+ return N(this, void 0, void 0, function* () {
1299
1299
  if (a.items) {
1300
- const t = Ra(a.items).filter((e) => e.kind === "file");
1300
+ const t = La(a.items).filter((n) => n.kind === "file");
1301
1301
  if (i !== "drop")
1302
1302
  return t;
1303
- const n = yield Promise.all(t.map(Zi));
1304
- return Za(ui(n));
1303
+ const e = yield Promise.all(t.map(Xi));
1304
+ return ai(xi(e));
1305
1305
  }
1306
- return Za(Ra(a.files).map((t) => G(t)));
1306
+ return ai(La(a.files).map((t) => G(t)));
1307
1307
  });
1308
1308
  }
1309
- function Za(a) {
1310
- return a.filter((i) => Hi.indexOf(i.name) === -1);
1309
+ function ai(a) {
1310
+ return a.filter((i) => Ui.indexOf(i.name) === -1);
1311
1311
  }
1312
- function Ra(a) {
1312
+ function La(a) {
1313
1313
  if (a === null)
1314
1314
  return [];
1315
1315
  const i = [];
1316
1316
  for (let t = 0; t < a.length; t++) {
1317
- const n = a[t];
1318
- i.push(n);
1317
+ const e = a[t];
1318
+ i.push(e);
1319
1319
  }
1320
1320
  return i;
1321
1321
  }
1322
- function Zi(a) {
1322
+ function Xi(a) {
1323
1323
  if (typeof a.webkitGetAsEntry != "function")
1324
- return Ja(a);
1324
+ return ii(a);
1325
1325
  const i = a.webkitGetAsEntry();
1326
- return i && i.isDirectory ? vi(i) : Ja(a, i);
1326
+ return i && i.isDirectory ? gi(i) : ii(a, i);
1327
1327
  }
1328
- function ui(a) {
1328
+ function xi(a) {
1329
1329
  return a.reduce((i, t) => [
1330
1330
  ...i,
1331
- ...Array.isArray(t) ? ui(t) : [t]
1331
+ ...Array.isArray(t) ? xi(t) : [t]
1332
1332
  ], []);
1333
1333
  }
1334
- function Ja(a, i) {
1334
+ function ii(a, i) {
1335
1335
  var t;
1336
1336
  if (typeof a.getAsFileSystemHandle == "function")
1337
- return a.getAsFileSystemHandle().then((o) => $(this, void 0, void 0, function* () {
1337
+ return a.getAsFileSystemHandle().then((o) => N(this, void 0, void 0, function* () {
1338
1338
  const c = yield o.getFile();
1339
1339
  return c.handle = o, G(c);
1340
1340
  }));
1341
- const n = a.getAsFile();
1342
- if (!n)
1341
+ const e = a.getAsFile();
1342
+ if (!e)
1343
1343
  return Promise.reject(`${a} is not a File`);
1344
- const e = G(n, (t = i == null ? void 0 : i.fullPath) !== null && t !== void 0 ? t : void 0);
1345
- return Promise.resolve(e);
1344
+ const n = G(e, (t = i == null ? void 0 : i.fullPath) !== null && t !== void 0 ? t : void 0);
1345
+ return Promise.resolve(n);
1346
1346
  }
1347
- function Ji(a) {
1348
- return $(this, void 0, void 0, function* () {
1349
- return a.isDirectory ? vi(a) : Xi(a);
1347
+ function Qi(a) {
1348
+ return N(this, void 0, void 0, function* () {
1349
+ return a.isDirectory ? gi(a) : at(a);
1350
1350
  });
1351
1351
  }
1352
- function vi(a) {
1352
+ function gi(a) {
1353
1353
  const i = a.createReader();
1354
- return new Promise((t, n) => {
1355
- const e = [];
1354
+ return new Promise((t, e) => {
1355
+ const n = [];
1356
1356
  function o() {
1357
- i.readEntries((c) => $(this, void 0, void 0, function* () {
1357
+ i.readEntries((c) => N(this, void 0, void 0, function* () {
1358
1358
  if (c.length) {
1359
- const r = Promise.all(c.map(Ji));
1360
- e.push(r), o();
1359
+ const r = Promise.all(c.map(Qi));
1360
+ n.push(r), o();
1361
1361
  } else
1362
1362
  try {
1363
- const r = yield Promise.all(e);
1363
+ const r = yield Promise.all(n);
1364
1364
  t(r);
1365
1365
  } catch (r) {
1366
- n(r);
1366
+ e(r);
1367
1367
  }
1368
1368
  }), (c) => {
1369
- n(c);
1369
+ e(c);
1370
1370
  });
1371
1371
  }
1372
1372
  o();
1373
1373
  });
1374
1374
  }
1375
- function Xi(a) {
1376
- return $(this, void 0, void 0, function* () {
1375
+ function at(a) {
1376
+ return N(this, void 0, void 0, function* () {
1377
1377
  return new Promise((i, t) => {
1378
- a.file((n) => {
1379
- const e = G(n, a.fullPath);
1380
- i(e);
1381
- }, (n) => {
1382
- t(n);
1378
+ a.file((e) => {
1379
+ const n = G(e, a.fullPath);
1380
+ i(n);
1381
+ }, (e) => {
1382
+ t(e);
1383
1383
  });
1384
1384
  });
1385
1385
  });
1386
1386
  }
1387
- var fa = {}, Xa;
1388
- function Qi() {
1389
- return Xa || (Xa = 1, fa.__esModule = !0, fa.default = function(a, i) {
1387
+ var fa = {}, ti;
1388
+ function it() {
1389
+ return ti || (ti = 1, fa.__esModule = !0, fa.default = function(a, i) {
1390
1390
  if (a && i) {
1391
1391
  var t = Array.isArray(i) ? i : i.split(",");
1392
1392
  if (t.length === 0)
1393
1393
  return !0;
1394
- var n = a.name || "", e = (a.type || "").toLowerCase(), o = e.replace(/\/.*$/, "");
1394
+ var e = a.name || "", n = (a.type || "").toLowerCase(), o = n.replace(/\/.*$/, "");
1395
1395
  return t.some(function(c) {
1396
1396
  var r = c.trim().toLowerCase();
1397
- return r.charAt(0) === "." ? n.toLowerCase().endsWith(r) : r.endsWith("/*") ? o === r.replace(/\/.*$/, "") : e === r;
1397
+ return r.charAt(0) === "." ? e.toLowerCase().endsWith(r) : r.endsWith("/*") ? o === r.replace(/\/.*$/, "") : n === r;
1398
1398
  });
1399
1399
  }
1400
1400
  return !0;
1401
1401
  }), fa;
1402
1402
  }
1403
- var at = Qi();
1404
- const Pa = /* @__PURE__ */ Ri(at);
1405
- function Qa(a) {
1406
- return nt(a) || tt(a) || xi(a) || it();
1403
+ var tt = it();
1404
+ const Ia = /* @__PURE__ */ Si(tt);
1405
+ function ei(a) {
1406
+ return pt(a) || nt(a) || hi(a) || et();
1407
1407
  }
1408
- function it() {
1408
+ function et() {
1409
1409
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1410
1410
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1411
1411
  }
1412
- function tt(a) {
1412
+ function nt(a) {
1413
1413
  if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
1414
1414
  }
1415
- function nt(a) {
1416
- if (Array.isArray(a)) return Sa(a);
1415
+ function pt(a) {
1416
+ if (Array.isArray(a)) return Ca(a);
1417
1417
  }
1418
- function ai(a, i) {
1418
+ function ni(a, i) {
1419
1419
  var t = Object.keys(a);
1420
1420
  if (Object.getOwnPropertySymbols) {
1421
- var n = Object.getOwnPropertySymbols(a);
1422
- i && (n = n.filter(function(e) {
1423
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
1424
- })), t.push.apply(t, n);
1421
+ var e = Object.getOwnPropertySymbols(a);
1422
+ i && (e = e.filter(function(n) {
1423
+ return Object.getOwnPropertyDescriptor(a, n).enumerable;
1424
+ })), t.push.apply(t, e);
1425
1425
  }
1426
1426
  return t;
1427
1427
  }
1428
- function ii(a) {
1428
+ function pi(a) {
1429
1429
  for (var i = 1; i < arguments.length; i++) {
1430
1430
  var t = arguments[i] != null ? arguments[i] : {};
1431
- i % 2 ? ai(Object(t), !0).forEach(function(n) {
1432
- fi(a, n, t[n]);
1433
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : ai(Object(t)).forEach(function(n) {
1434
- Object.defineProperty(a, n, Object.getOwnPropertyDescriptor(t, n));
1431
+ i % 2 ? ni(Object(t), !0).forEach(function(e) {
1432
+ bi(a, e, t[e]);
1433
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : ni(Object(t)).forEach(function(e) {
1434
+ Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(t, e));
1435
1435
  });
1436
1436
  }
1437
1437
  return a;
1438
1438
  }
1439
- function fi(a, i, t) {
1439
+ function bi(a, i, t) {
1440
1440
  return i in a ? Object.defineProperty(a, i, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[i] = t, a;
1441
1441
  }
1442
1442
  function ta(a, i) {
1443
- return ot(a) || pt(a, i) || xi(a, i) || et();
1443
+ return lt(a) || ct(a, i) || hi(a, i) || ot();
1444
1444
  }
1445
- function et() {
1445
+ function ot() {
1446
1446
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1447
1447
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1448
1448
  }
1449
- function xi(a, i) {
1449
+ function hi(a, i) {
1450
1450
  if (a) {
1451
- if (typeof a == "string") return Sa(a, i);
1451
+ if (typeof a == "string") return Ca(a, i);
1452
1452
  var t = Object.prototype.toString.call(a).slice(8, -1);
1453
1453
  if (t === "Object" && a.constructor && (t = a.constructor.name), t === "Map" || t === "Set") return Array.from(a);
1454
- if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Sa(a, i);
1454
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Ca(a, i);
1455
1455
  }
1456
1456
  }
1457
- function Sa(a, i) {
1457
+ function Ca(a, i) {
1458
1458
  (i == null || i > a.length) && (i = a.length);
1459
- for (var t = 0, n = new Array(i); t < i; t++)
1460
- n[t] = a[t];
1461
- return n;
1459
+ for (var t = 0, e = new Array(i); t < i; t++)
1460
+ e[t] = a[t];
1461
+ return e;
1462
1462
  }
1463
- function pt(a, i) {
1463
+ function ct(a, i) {
1464
1464
  var t = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
1465
1465
  if (t != null) {
1466
- var n = [], e = !0, o = !1, c, r;
1466
+ var e = [], n = !0, o = !1, c, r;
1467
1467
  try {
1468
- for (t = t.call(a); !(e = (c = t.next()).done) && (n.push(c.value), !(i && n.length === i)); e = !0)
1468
+ for (t = t.call(a); !(n = (c = t.next()).done) && (e.push(c.value), !(i && e.length === i)); n = !0)
1469
1469
  ;
1470
1470
  } catch (u) {
1471
1471
  o = !0, r = u;
1472
1472
  } finally {
1473
1473
  try {
1474
- !e && t.return != null && t.return();
1474
+ !n && t.return != null && t.return();
1475
1475
  } finally {
1476
1476
  if (o) throw r;
1477
1477
  }
1478
1478
  }
1479
- return n;
1479
+ return e;
1480
1480
  }
1481
1481
  }
1482
- function ot(a) {
1482
+ function lt(a) {
1483
1483
  if (Array.isArray(a)) return a;
1484
1484
  }
1485
- var ct = typeof Pa == "function" ? Pa : Pa.default, lt = "file-invalid-type", rt = "file-too-large", st = "file-too-small", dt = "too-many-files", mt = function() {
1486
- var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", t = i.split(","), n = t.length > 1 ? "one of ".concat(t.join(", ")) : t[0];
1485
+ var rt = typeof Ia == "function" ? Ia : Ia.default, st = "file-invalid-type", dt = "file-too-large", mt = "file-too-small", ut = "too-many-files", vt = function() {
1486
+ var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", t = i.split(","), e = t.length > 1 ? "one of ".concat(t.join(", ")) : t[0];
1487
1487
  return {
1488
- code: lt,
1489
- message: "File type must be ".concat(n)
1488
+ code: st,
1489
+ message: "File type must be ".concat(e)
1490
1490
  };
1491
- }, ti = function(i) {
1491
+ }, oi = function(i) {
1492
1492
  return {
1493
- code: rt,
1493
+ code: dt,
1494
1494
  message: "File is larger than ".concat(i, " ").concat(i === 1 ? "byte" : "bytes")
1495
1495
  };
1496
- }, ni = function(i) {
1496
+ }, ci = function(i) {
1497
1497
  return {
1498
- code: st,
1498
+ code: mt,
1499
1499
  message: "File is smaller than ".concat(i, " ").concat(i === 1 ? "byte" : "bytes")
1500
1500
  };
1501
- }, ut = {
1502
- code: dt,
1501
+ }, ft = {
1502
+ code: ut,
1503
1503
  message: "Too many files"
1504
1504
  };
1505
- function gi(a, i) {
1506
- var t = a.type === "application/x-moz-file" || ct(a, i);
1507
- return [t, t ? null : mt(i)];
1508
- }
1509
- function bi(a, i, t) {
1510
- if (N(a.size))
1511
- if (N(i) && N(t)) {
1512
- if (a.size > t) return [!1, ti(t)];
1513
- if (a.size < i) return [!1, ni(i)];
1505
+ function yi(a, i) {
1506
+ var t = a.type === "application/x-moz-file" || rt(a, i);
1507
+ return [t, t ? null : vt(i)];
1508
+ }
1509
+ function wi(a, i, t) {
1510
+ if ($(a.size))
1511
+ if ($(i) && $(t)) {
1512
+ if (a.size > t) return [!1, oi(t)];
1513
+ if (a.size < i) return [!1, ci(i)];
1514
1514
  } else {
1515
- if (N(i) && a.size < i) return [!1, ni(i)];
1516
- if (N(t) && a.size > t) return [!1, ti(t)];
1515
+ if ($(i) && a.size < i) return [!1, ci(i)];
1516
+ if ($(t) && a.size > t) return [!1, oi(t)];
1517
1517
  }
1518
1518
  return [!0, null];
1519
1519
  }
1520
- function N(a) {
1520
+ function $(a) {
1521
1521
  return a != null;
1522
1522
  }
1523
- function vt(a) {
1524
- var i = a.files, t = a.accept, n = a.minSize, e = a.maxSize, o = a.multiple, c = a.maxFiles, r = a.validator;
1523
+ function xt(a) {
1524
+ var i = a.files, t = a.accept, e = a.minSize, n = a.maxSize, o = a.multiple, c = a.maxFiles, r = a.validator;
1525
1525
  return !o && i.length > 1 || o && c >= 1 && i.length > c ? !1 : i.every(function(u) {
1526
- var h = gi(u, t), f = ta(h, 1), k = f[0], F = bi(u, n, e), I = ta(F, 1), j = I[0], P = r ? r(u) : null;
1527
- return k && j && !P;
1526
+ var h = yi(u, t), f = ta(h, 1), j = f[0], P = wi(u, e, n), q = ta(P, 1), w = q[0], A = r ? r(u) : null;
1527
+ return j && w && !A;
1528
1528
  });
1529
1529
  }
1530
1530
  function wa(a) {
@@ -1535,41 +1535,41 @@ function xa(a) {
1535
1535
  return i === "Files" || i === "application/x-moz-file";
1536
1536
  }) : !!a.target && !!a.target.files;
1537
1537
  }
1538
- function ei(a) {
1538
+ function li(a) {
1539
1539
  a.preventDefault();
1540
1540
  }
1541
- function ft(a) {
1541
+ function gt(a) {
1542
1542
  return a.indexOf("MSIE") !== -1 || a.indexOf("Trident/") !== -1;
1543
1543
  }
1544
- function xt(a) {
1544
+ function bt(a) {
1545
1545
  return a.indexOf("Edge/") !== -1;
1546
1546
  }
1547
- function gt() {
1547
+ function ht() {
1548
1548
  var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
1549
- return ft(a) || xt(a);
1549
+ return gt(a) || bt(a);
1550
1550
  }
1551
- function O() {
1551
+ function F() {
1552
1552
  for (var a = arguments.length, i = new Array(a), t = 0; t < a; t++)
1553
1553
  i[t] = arguments[t];
1554
- return function(n) {
1555
- for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), c = 1; c < e; c++)
1554
+ return function(e) {
1555
+ for (var n = arguments.length, o = new Array(n > 1 ? n - 1 : 0), c = 1; c < n; c++)
1556
1556
  o[c - 1] = arguments[c];
1557
1557
  return i.some(function(r) {
1558
- return !wa(n) && r && r.apply(void 0, [n].concat(o)), wa(n);
1558
+ return !wa(e) && r && r.apply(void 0, [e].concat(o)), wa(e);
1559
1559
  });
1560
1560
  };
1561
1561
  }
1562
- function bt() {
1562
+ function yt() {
1563
1563
  return "showOpenFilePicker" in window;
1564
1564
  }
1565
- function ht(a) {
1566
- if (N(a)) {
1565
+ function wt(a) {
1566
+ if ($(a)) {
1567
1567
  var i = Object.entries(a).filter(function(t) {
1568
- var n = ta(t, 2), e = n[0], o = n[1], c = !0;
1569
- return hi(e) || (console.warn('Skipped "'.concat(e, '" 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(yi)) && (console.warn('Skipped "'.concat(e, '" because an invalid file extension was provided.')), c = !1), c;
1570
- }).reduce(function(t, n) {
1571
- var e = ta(n, 2), o = e[0], c = e[1];
1572
- return ii(ii({}, t), {}, fi({}, o, c));
1568
+ var e = ta(t, 2), n = e[0], o = e[1], c = !0;
1569
+ return ki(n) || (console.warn('Skipped "'.concat(n, '" 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(ji)) && (console.warn('Skipped "'.concat(n, '" because an invalid file extension was provided.')), c = !1), c;
1570
+ }).reduce(function(t, e) {
1571
+ var n = ta(e, 2), o = n[0], c = n[1];
1572
+ return pi(pi({}, t), {}, bi({}, o, c));
1573
1573
  }, {});
1574
1574
  return [{
1575
1575
  // description is required due to https://crbug.com/1264708
@@ -1579,139 +1579,139 @@ function ht(a) {
1579
1579
  }
1580
1580
  return a;
1581
1581
  }
1582
- function yt(a) {
1583
- if (N(a))
1582
+ function kt(a) {
1583
+ if ($(a))
1584
1584
  return Object.entries(a).reduce(function(i, t) {
1585
- var n = ta(t, 2), e = n[0], o = n[1];
1586
- return [].concat(Qa(i), [e], Qa(o));
1585
+ var e = ta(t, 2), n = e[0], o = e[1];
1586
+ return [].concat(ei(i), [n], ei(o));
1587
1587
  }, []).filter(function(i) {
1588
- return hi(i) || yi(i);
1588
+ return ki(i) || ji(i);
1589
1589
  }).join(",");
1590
1590
  }
1591
- function wt(a) {
1591
+ function jt(a) {
1592
1592
  return a instanceof DOMException && (a.name === "AbortError" || a.code === a.ABORT_ERR);
1593
1593
  }
1594
- function kt(a) {
1594
+ function Dt(a) {
1595
1595
  return a instanceof DOMException && (a.name === "SecurityError" || a.code === a.SECURITY_ERR);
1596
1596
  }
1597
- function hi(a) {
1597
+ function ki(a) {
1598
1598
  return a === "audio/*" || a === "video/*" || a === "image/*" || a === "text/*" || a === "application/*" || /\w+\/[-+.\w]+/g.test(a);
1599
1599
  }
1600
- function yi(a) {
1600
+ function ji(a) {
1601
1601
  return /^.*\.[\w]+$/.test(a);
1602
1602
  }
1603
- var jt = ["children"], Dt = ["open"], zt = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], Et = ["refKey", "onChange", "onClick"];
1604
- function At(a) {
1605
- return Ft(a) || Ot(a) || wi(a) || _t();
1603
+ var zt = ["children"], _t = ["open"], Et = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], At = ["refKey", "onChange", "onClick"];
1604
+ function Ot(a) {
1605
+ return qt(a) || Pt(a) || Di(a) || Ft();
1606
1606
  }
1607
- function _t() {
1607
+ function Ft() {
1608
1608
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1609
1609
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1610
1610
  }
1611
- function Ot(a) {
1611
+ function Pt(a) {
1612
1612
  if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
1613
1613
  }
1614
- function Ft(a) {
1615
- if (Array.isArray(a)) return qa(a);
1614
+ function qt(a) {
1615
+ if (Array.isArray(a)) return Ma(a);
1616
1616
  }
1617
- function Ia(a, i) {
1618
- return Rt(a) || It(a, i) || wi(a, i) || Pt();
1617
+ function Ra(a, i) {
1618
+ return St(a) || Rt(a, i) || Di(a, i) || It();
1619
1619
  }
1620
- function Pt() {
1620
+ function It() {
1621
1621
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1622
1622
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1623
1623
  }
1624
- function wi(a, i) {
1624
+ function Di(a, i) {
1625
1625
  if (a) {
1626
- if (typeof a == "string") return qa(a, i);
1626
+ if (typeof a == "string") return Ma(a, i);
1627
1627
  var t = Object.prototype.toString.call(a).slice(8, -1);
1628
1628
  if (t === "Object" && a.constructor && (t = a.constructor.name), t === "Map" || t === "Set") return Array.from(a);
1629
- if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return qa(a, i);
1629
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Ma(a, i);
1630
1630
  }
1631
1631
  }
1632
- function qa(a, i) {
1632
+ function Ma(a, i) {
1633
1633
  (i == null || i > a.length) && (i = a.length);
1634
- for (var t = 0, n = new Array(i); t < i; t++)
1635
- n[t] = a[t];
1636
- return n;
1634
+ for (var t = 0, e = new Array(i); t < i; t++)
1635
+ e[t] = a[t];
1636
+ return e;
1637
1637
  }
1638
- function It(a, i) {
1638
+ function Rt(a, i) {
1639
1639
  var t = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
1640
1640
  if (t != null) {
1641
- var n = [], e = !0, o = !1, c, r;
1641
+ var e = [], n = !0, o = !1, c, r;
1642
1642
  try {
1643
- for (t = t.call(a); !(e = (c = t.next()).done) && (n.push(c.value), !(i && n.length === i)); e = !0)
1643
+ for (t = t.call(a); !(n = (c = t.next()).done) && (e.push(c.value), !(i && e.length === i)); n = !0)
1644
1644
  ;
1645
1645
  } catch (u) {
1646
1646
  o = !0, r = u;
1647
1647
  } finally {
1648
1648
  try {
1649
- !e && t.return != null && t.return();
1649
+ !n && t.return != null && t.return();
1650
1650
  } finally {
1651
1651
  if (o) throw r;
1652
1652
  }
1653
1653
  }
1654
- return n;
1654
+ return e;
1655
1655
  }
1656
1656
  }
1657
- function Rt(a) {
1657
+ function St(a) {
1658
1658
  if (Array.isArray(a)) return a;
1659
1659
  }
1660
- function pi(a, i) {
1660
+ function ri(a, i) {
1661
1661
  var t = Object.keys(a);
1662
1662
  if (Object.getOwnPropertySymbols) {
1663
- var n = Object.getOwnPropertySymbols(a);
1664
- i && (n = n.filter(function(e) {
1665
- return Object.getOwnPropertyDescriptor(a, e).enumerable;
1666
- })), t.push.apply(t, n);
1663
+ var e = Object.getOwnPropertySymbols(a);
1664
+ i && (e = e.filter(function(n) {
1665
+ return Object.getOwnPropertyDescriptor(a, n).enumerable;
1666
+ })), t.push.apply(t, e);
1667
1667
  }
1668
1668
  return t;
1669
1669
  }
1670
1670
  function m(a) {
1671
1671
  for (var i = 1; i < arguments.length; i++) {
1672
1672
  var t = arguments[i] != null ? arguments[i] : {};
1673
- i % 2 ? pi(Object(t), !0).forEach(function(n) {
1674
- Ta(a, n, t[n]);
1675
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : pi(Object(t)).forEach(function(n) {
1676
- Object.defineProperty(a, n, Object.getOwnPropertyDescriptor(t, n));
1673
+ i % 2 ? ri(Object(t), !0).forEach(function(e) {
1674
+ $a(a, e, t[e]);
1675
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : ri(Object(t)).forEach(function(e) {
1676
+ Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(t, e));
1677
1677
  });
1678
1678
  }
1679
1679
  return a;
1680
1680
  }
1681
- function Ta(a, i, t) {
1681
+ function $a(a, i, t) {
1682
1682
  return i in a ? Object.defineProperty(a, i, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[i] = t, a;
1683
1683
  }
1684
1684
  function ka(a, i) {
1685
1685
  if (a == null) return {};
1686
- var t = St(a, i), n, e;
1686
+ var t = Tt(a, i), e, n;
1687
1687
  if (Object.getOwnPropertySymbols) {
1688
1688
  var o = Object.getOwnPropertySymbols(a);
1689
- for (e = 0; e < o.length; e++)
1690
- n = o[e], !(i.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(a, n) && (t[n] = a[n]);
1689
+ for (n = 0; n < o.length; n++)
1690
+ e = o[n], !(i.indexOf(e) >= 0) && Object.prototype.propertyIsEnumerable.call(a, e) && (t[e] = a[e]);
1691
1691
  }
1692
1692
  return t;
1693
1693
  }
1694
- function St(a, i) {
1694
+ function Tt(a, i) {
1695
1695
  if (a == null) return {};
1696
- var t = {}, n = Object.keys(a), e, o;
1697
- for (o = 0; o < n.length; o++)
1698
- e = n[o], !(i.indexOf(e) >= 0) && (t[e] = a[e]);
1696
+ var t = {}, e = Object.keys(a), n, o;
1697
+ for (o = 0; o < e.length; o++)
1698
+ n = e[o], !(i.indexOf(n) >= 0) && (t[n] = a[n]);
1699
1699
  return t;
1700
1700
  }
1701
- var La = /* @__PURE__ */ si(function(a, i) {
1702
- var t = a.children, n = ka(a, jt), e = ji(n), o = e.open, c = ka(e, Dt);
1703
- return Pi(i, function() {
1701
+ var Ka = /* @__PURE__ */ vi(function(a, i) {
1702
+ var t = a.children, e = ka(a, zt), n = _i(e), o = n.open, c = ka(n, _t);
1703
+ return Ii(i, function() {
1704
1704
  return {
1705
1705
  open: o
1706
1706
  };
1707
- }, [o]), /* @__PURE__ */ Oi.createElement(Ii, null, t(m(m({}, c), {}, {
1707
+ }, [o]), /* @__PURE__ */ Pi.createElement(Ri, null, t(m(m({}, c), {}, {
1708
1708
  open: o
1709
1709
  })));
1710
1710
  });
1711
- La.displayName = "Dropzone";
1712
- var ki = {
1711
+ Ka.displayName = "Dropzone";
1712
+ var zi = {
1713
1713
  disabled: !1,
1714
- getFilesFromEvent: Wi,
1714
+ getFilesFromEvent: Bi,
1715
1715
  maxSize: 1 / 0,
1716
1716
  minSize: 0,
1717
1717
  multiple: !0,
@@ -1725,8 +1725,8 @@ var ki = {
1725
1725
  useFsAccessApi: !1,
1726
1726
  autoFocus: !1
1727
1727
  };
1728
- La.defaultProps = ki;
1729
- La.propTypes = {
1728
+ Ka.defaultProps = zi;
1729
+ Ka.propTypes = {
1730
1730
  /**
1731
1731
  * Render function that exposes the dropzone state and prop getter fns
1732
1732
  *
@@ -1894,7 +1894,7 @@ La.propTypes = {
1894
1894
  */
1895
1895
  validator: s.func
1896
1896
  };
1897
- var Ca = {
1897
+ var Na = {
1898
1898
  isFocused: !1,
1899
1899
  isFileDialogActive: !1,
1900
1900
  isDragActive: !1,
@@ -1903,22 +1903,22 @@ var Ca = {
1903
1903
  acceptedFiles: [],
1904
1904
  fileRejections: []
1905
1905
  };
1906
- function ji() {
1907
- var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = m(m({}, ki), a), t = i.accept, n = i.disabled, e = i.getFilesFromEvent, o = i.maxSize, c = i.minSize, r = i.multiple, u = i.maxFiles, h = i.onDragEnter, f = i.onDragLeave, k = i.onDragOver, F = i.onDrop, I = i.onDropAccepted, j = i.onDropRejected, P = i.onFileDialogCancel, q = i.onFileDialogOpen, na = i.useFsAccessApi, ea = i.autoFocus, Z = i.preventDropOnDocument, D = i.noClick, R = i.noKeyboard, K = i.noDrag, E = i.noDragEventsBubbling, J = i.onError, T = i.validator, C = Y(function() {
1908
- return yt(t);
1906
+ function _i() {
1907
+ var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, i = m(m({}, zi), a), t = i.accept, e = i.disabled, n = i.getFilesFromEvent, o = i.maxSize, c = i.minSize, r = i.multiple, u = i.maxFiles, h = i.onDragEnter, f = i.onDragLeave, j = i.onDragOver, P = i.onDrop, q = i.onDropAccepted, w = i.onDropRejected, A = i.onFileDialogCancel, S = i.onFileDialogOpen, ea = i.useFsAccessApi, na = i.autoFocus, Z = i.preventDropOnDocument, D = i.noClick, I = i.noKeyboard, K = i.noDrag, _ = i.noDragEventsBubbling, J = i.onError, T = i.validator, L = Y(function() {
1908
+ return kt(t);
1909
1909
  }, [t]), pa = Y(function() {
1910
- return ht(t);
1910
+ return wt(t);
1911
1911
  }, [t]), X = Y(function() {
1912
- return typeof q == "function" ? q : oi;
1913
- }, [q]), L = Y(function() {
1914
- return typeof P == "function" ? P : oi;
1915
- }, [P]), b = va(null), y = va(null), oa = Fi(qt, Ca), ca = Ia(oa, 2), A = ca[0], d = ca[1], _ = A.isFocused, la = A.isFileDialogActive, H = va(typeof window < "u" && window.isSecureContext && na && bt()), Q = function() {
1912
+ return typeof S == "function" ? S : si;
1913
+ }, [S]), C = Y(function() {
1914
+ return typeof A == "function" ? A : si;
1915
+ }, [A]), b = va(null), y = va(null), oa = qi(Lt, Na), ca = Ra(oa, 2), E = ca[0], d = ca[1], O = E.isFocused, la = E.isFileDialogActive, H = va(typeof window < "u" && window.isSecureContext && ea && yt()), Q = function() {
1916
1916
  !H.current && la && setTimeout(function() {
1917
1917
  if (y.current) {
1918
1918
  var l = y.current.files;
1919
1919
  l.length || (d({
1920
1920
  type: "closeDialog"
1921
- }), L());
1921
+ }), C());
1922
1922
  }
1923
1923
  }, 300);
1924
1924
  };
@@ -1926,35 +1926,35 @@ function ji() {
1926
1926
  return window.addEventListener("focus", Q, !1), function() {
1927
1927
  window.removeEventListener("focus", Q, !1);
1928
1928
  };
1929
- }, [y, la, L, H]);
1930
- var S = va([]), Ma = function(l) {
1931
- b.current && b.current.contains(l.target) || (l.preventDefault(), S.current = []);
1929
+ }, [y, la, C, H]);
1930
+ var R = va([]), Ha = function(l) {
1931
+ b.current && b.current.contains(l.target) || (l.preventDefault(), R.current = []);
1932
1932
  };
1933
1933
  ia(function() {
1934
- return Z && (document.addEventListener("dragover", ei, !1), document.addEventListener("drop", Ma, !1)), function() {
1935
- Z && (document.removeEventListener("dragover", ei), document.removeEventListener("drop", Ma));
1934
+ return Z && (document.addEventListener("dragover", li, !1), document.addEventListener("drop", Ha, !1)), function() {
1935
+ Z && (document.removeEventListener("dragover", li), document.removeEventListener("drop", Ha));
1936
1936
  };
1937
1937
  }, [b, Z]), ia(function() {
1938
- return !n && ea && b.current && b.current.focus(), function() {
1938
+ return !e && na && b.current && b.current.focus(), function() {
1939
1939
  };
1940
- }, [b, ea, n]);
1940
+ }, [b, na, e]);
1941
1941
  var M = z(function(p) {
1942
1942
  J ? J(p) : console.error(p);
1943
- }, [J]), Na = z(function(p) {
1944
- p.preventDefault(), p.persist(), ma(p), S.current = [].concat(At(S.current), [p.target]), xa(p) && Promise.resolve(e(p)).then(function(l) {
1945
- if (!(wa(p) && !E)) {
1946
- var v = l.length, g = v > 0 && vt({
1943
+ }, [J]), Wa = z(function(p) {
1944
+ p.preventDefault(), p.persist(), ma(p), R.current = [].concat(Ot(R.current), [p.target]), xa(p) && Promise.resolve(n(p)).then(function(l) {
1945
+ if (!(wa(p) && !_)) {
1946
+ var v = l.length, g = v > 0 && xt({
1947
1947
  files: l,
1948
- accept: C,
1948
+ accept: L,
1949
1949
  minSize: c,
1950
1950
  maxSize: o,
1951
1951
  multiple: r,
1952
1952
  maxFiles: u,
1953
1953
  validator: T
1954
- }), w = v > 0 && !g;
1954
+ }), k = v > 0 && !g;
1955
1955
  d({
1956
1956
  isDragAccept: g,
1957
- isDragReject: w,
1957
+ isDragReject: k,
1958
1958
  isDragActive: !0,
1959
1959
  type: "setDraggedFiles"
1960
1960
  }), h && h(p);
@@ -1962,7 +1962,7 @@ function ji() {
1962
1962
  }).catch(function(l) {
1963
1963
  return M(l);
1964
1964
  });
1965
- }, [e, h, M, E, C, c, o, r, u, T]), $a = z(function(p) {
1965
+ }, [n, h, M, _, L, c, o, r, u, T]), Ua = z(function(p) {
1966
1966
  p.preventDefault(), p.persist(), ma(p);
1967
1967
  var l = xa(p);
1968
1968
  if (l && p.dataTransfer)
@@ -1970,53 +1970,53 @@ function ji() {
1970
1970
  p.dataTransfer.dropEffect = "copy";
1971
1971
  } catch {
1972
1972
  }
1973
- return l && k && k(p), !1;
1974
- }, [k, E]), Ka = z(function(p) {
1973
+ return l && j && j(p), !1;
1974
+ }, [j, _]), Ba = z(function(p) {
1975
1975
  p.preventDefault(), p.persist(), ma(p);
1976
- var l = S.current.filter(function(g) {
1976
+ var l = R.current.filter(function(g) {
1977
1977
  return b.current && b.current.contains(g);
1978
1978
  }), v = l.indexOf(p.target);
1979
- v !== -1 && l.splice(v, 1), S.current = l, !(l.length > 0) && (d({
1979
+ v !== -1 && l.splice(v, 1), R.current = l, !(l.length > 0) && (d({
1980
1980
  type: "setDraggedFiles",
1981
1981
  isDragActive: !1,
1982
1982
  isDragAccept: !1,
1983
1983
  isDragReject: !1
1984
1984
  }), xa(p) && f && f(p));
1985
- }, [b, f, E]), ra = z(function(p, l) {
1985
+ }, [b, f, _]), ra = z(function(p, l) {
1986
1986
  var v = [], g = [];
1987
- p.forEach(function(w) {
1988
- var aa = gi(w, C), U = Ia(aa, 2), Da = U[0], za = U[1], Ea = bi(w, c, o), ua = Ia(Ea, 2), Aa = ua[0], _a = ua[1], Oa = T ? T(w) : null;
1989
- if (Da && Aa && !Oa)
1990
- v.push(w);
1987
+ p.forEach(function(k) {
1988
+ var aa = yi(k, L), B = Ra(aa, 2), _a = B[0], Ea = B[1], Aa = wi(k, c, o), ua = Ra(Aa, 2), Oa = ua[0], Fa = ua[1], Pa = T ? T(k) : null;
1989
+ if (_a && Oa && !Pa)
1990
+ v.push(k);
1991
1991
  else {
1992
- var Fa = [za, _a];
1993
- Oa && (Fa = Fa.concat(Oa)), g.push({
1994
- file: w,
1995
- errors: Fa.filter(function(_i) {
1996
- return _i;
1992
+ var qa = [Ea, Fa];
1993
+ Pa && (qa = qa.concat(Pa)), g.push({
1994
+ file: k,
1995
+ errors: qa.filter(function(Fi) {
1996
+ return Fi;
1997
1997
  })
1998
1998
  });
1999
1999
  }
2000
- }), (!r && v.length > 1 || r && u >= 1 && v.length > u) && (v.forEach(function(w) {
2000
+ }), (!r && v.length > 1 || r && u >= 1 && v.length > u) && (v.forEach(function(k) {
2001
2001
  g.push({
2002
- file: w,
2003
- errors: [ut]
2002
+ file: k,
2003
+ errors: [ft]
2004
2004
  });
2005
2005
  }), v.splice(0)), d({
2006
2006
  acceptedFiles: v,
2007
2007
  fileRejections: g,
2008
2008
  isDragReject: g.length > 0,
2009
2009
  type: "setFiles"
2010
- }), F && F(v, g, l), g.length > 0 && j && j(g, l), v.length > 0 && I && I(v, l);
2011
- }, [d, r, C, c, o, u, F, I, j, T]), sa = z(function(p) {
2012
- p.preventDefault(), p.persist(), ma(p), S.current = [], xa(p) && Promise.resolve(e(p)).then(function(l) {
2013
- wa(p) && !E || ra(l, p);
2010
+ }), P && P(v, g, l), g.length > 0 && w && w(g, l), v.length > 0 && q && q(v, l);
2011
+ }, [d, r, L, c, o, u, P, q, w, T]), sa = z(function(p) {
2012
+ p.preventDefault(), p.persist(), ma(p), R.current = [], xa(p) && Promise.resolve(n(p)).then(function(l) {
2013
+ wa(p) && !_ || ra(l, p);
2014
2014
  }).catch(function(l) {
2015
2015
  return M(l);
2016
2016
  }), d({
2017
2017
  type: "reset"
2018
2018
  });
2019
- }, [e, ra, M, E]), W = z(function() {
2019
+ }, [n, ra, M, _]), W = z(function() {
2020
2020
  if (H.current) {
2021
2021
  d({
2022
2022
  type: "openDialog"
@@ -2026,64 +2026,64 @@ function ji() {
2026
2026
  types: pa
2027
2027
  };
2028
2028
  window.showOpenFilePicker(p).then(function(l) {
2029
- return e(l);
2029
+ return n(l);
2030
2030
  }).then(function(l) {
2031
2031
  ra(l, null), d({
2032
2032
  type: "closeDialog"
2033
2033
  });
2034
2034
  }).catch(function(l) {
2035
- wt(l) ? (L(l), d({
2035
+ jt(l) ? (C(l), d({
2036
2036
  type: "closeDialog"
2037
- })) : kt(l) ? (H.current = !1, y.current ? (y.current.value = null, y.current.click()) : M(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."))) : M(l);
2037
+ })) : Dt(l) ? (H.current = !1, y.current ? (y.current.value = null, y.current.click()) : M(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."))) : M(l);
2038
2038
  });
2039
2039
  return;
2040
2040
  }
2041
2041
  y.current && (d({
2042
2042
  type: "openDialog"
2043
2043
  }), X(), y.current.value = null, y.current.click());
2044
- }, [d, X, L, na, ra, M, pa, r]), Ha = z(function(p) {
2044
+ }, [d, X, C, ea, ra, M, pa, r]), Ya = z(function(p) {
2045
2045
  !b.current || !b.current.isEqualNode(p.target) || (p.key === " " || p.key === "Enter" || p.keyCode === 32 || p.keyCode === 13) && (p.preventDefault(), W());
2046
- }, [b, W]), Wa = z(function() {
2046
+ }, [b, W]), Va = z(function() {
2047
2047
  d({
2048
2048
  type: "focus"
2049
2049
  });
2050
- }, []), Ba = z(function() {
2050
+ }, []), Ga = z(function() {
2051
2051
  d({
2052
2052
  type: "blur"
2053
2053
  });
2054
- }, []), Ua = z(function() {
2055
- D || (gt() ? setTimeout(W, 0) : W());
2056
- }, [D, W]), B = function(l) {
2057
- return n ? null : l;
2058
- }, ja = function(l) {
2059
- return R ? null : B(l);
2054
+ }, []), Za = z(function() {
2055
+ D || (ht() ? setTimeout(W, 0) : W());
2056
+ }, [D, W]), U = function(l) {
2057
+ return e ? null : l;
2058
+ }, za = function(l) {
2059
+ return I ? null : U(l);
2060
2060
  }, da = function(l) {
2061
- return K ? null : B(l);
2061
+ return K ? null : U(l);
2062
2062
  }, ma = function(l) {
2063
- E && l.stopPropagation();
2064
- }, zi = Y(function() {
2063
+ _ && l.stopPropagation();
2064
+ }, Ei = Y(function() {
2065
2065
  return function() {
2066
- var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = p.refKey, v = l === void 0 ? "ref" : l, g = p.role, w = p.onKeyDown, aa = p.onFocus, U = p.onBlur, Da = p.onClick, za = p.onDragEnter, Ea = p.onDragOver, ua = p.onDragLeave, Aa = p.onDrop, _a = ka(p, zt);
2067
- return m(m(Ta({
2068
- onKeyDown: ja(O(w, Ha)),
2069
- onFocus: ja(O(aa, Wa)),
2070
- onBlur: ja(O(U, Ba)),
2071
- onClick: B(O(Da, Ua)),
2072
- onDragEnter: da(O(za, Na)),
2073
- onDragOver: da(O(Ea, $a)),
2074
- onDragLeave: da(O(ua, Ka)),
2075
- onDrop: da(O(Aa, sa)),
2066
+ var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = p.refKey, v = l === void 0 ? "ref" : l, g = p.role, k = p.onKeyDown, aa = p.onFocus, B = p.onBlur, _a = p.onClick, Ea = p.onDragEnter, Aa = p.onDragOver, ua = p.onDragLeave, Oa = p.onDrop, Fa = ka(p, Et);
2067
+ return m(m($a({
2068
+ onKeyDown: za(F(k, Ya)),
2069
+ onFocus: za(F(aa, Va)),
2070
+ onBlur: za(F(B, Ga)),
2071
+ onClick: U(F(_a, Za)),
2072
+ onDragEnter: da(F(Ea, Wa)),
2073
+ onDragOver: da(F(Aa, Ua)),
2074
+ onDragLeave: da(F(ua, Ba)),
2075
+ onDrop: da(F(Oa, sa)),
2076
2076
  role: typeof g == "string" && g !== "" ? g : "presentation"
2077
- }, v, b), !n && !R ? {
2077
+ }, v, b), !e && !I ? {
2078
2078
  tabIndex: 0
2079
- } : {}), _a);
2079
+ } : {}), Fa);
2080
2080
  };
2081
- }, [b, Ha, Wa, Ba, Ua, Na, $a, Ka, sa, R, K, n]), Ei = z(function(p) {
2081
+ }, [b, Ya, Va, Ga, Za, Wa, Ua, Ba, sa, I, K, e]), Ai = z(function(p) {
2082
2082
  p.stopPropagation();
2083
- }, []), Ai = Y(function() {
2083
+ }, []), Oi = Y(function() {
2084
2084
  return function() {
2085
- var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = p.refKey, v = l === void 0 ? "ref" : l, g = p.onChange, w = p.onClick, aa = ka(p, Et), U = Ta({
2086
- accept: C,
2085
+ var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = p.refKey, v = l === void 0 ? "ref" : l, g = p.onChange, k = p.onClick, aa = ka(p, At), B = $a({
2086
+ accept: L,
2087
2087
  multiple: r,
2088
2088
  type: "file",
2089
2089
  style: {
@@ -2098,23 +2098,23 @@ function ji() {
2098
2098
  width: "1px",
2099
2099
  whiteSpace: "nowrap"
2100
2100
  },
2101
- onChange: B(O(g, sa)),
2102
- onClick: B(O(w, Ei)),
2101
+ onChange: U(F(g, sa)),
2102
+ onClick: U(F(k, Ai)),
2103
2103
  tabIndex: -1
2104
2104
  }, v, y);
2105
- return m(m({}, U), aa);
2105
+ return m(m({}, B), aa);
2106
2106
  };
2107
- }, [y, t, r, sa, n]);
2108
- return m(m({}, A), {}, {
2109
- isFocused: _ && !n,
2110
- getRootProps: zi,
2111
- getInputProps: Ai,
2107
+ }, [y, t, r, sa, e]);
2108
+ return m(m({}, E), {}, {
2109
+ isFocused: O && !e,
2110
+ getRootProps: Ei,
2111
+ getInputProps: Oi,
2112
2112
  rootRef: b,
2113
2113
  inputRef: y,
2114
- open: B(W)
2114
+ open: U(W)
2115
2115
  });
2116
2116
  }
2117
- function qt(a, i) {
2117
+ function Lt(a, i) {
2118
2118
  switch (i.type) {
2119
2119
  case "focus":
2120
2120
  return m(m({}, a), {}, {
@@ -2125,7 +2125,7 @@ function qt(a, i) {
2125
2125
  isFocused: !1
2126
2126
  });
2127
2127
  case "openDialog":
2128
- return m(m({}, Ca), {}, {
2128
+ return m(m({}, Na), {}, {
2129
2129
  isFileDialogActive: !0
2130
2130
  });
2131
2131
  case "closeDialog":
@@ -2145,33 +2145,39 @@ function qt(a, i) {
2145
2145
  isDragReject: i.isDragReject
2146
2146
  });
2147
2147
  case "reset":
2148
- return m({}, Ca);
2148
+ return m({}, Na);
2149
2149
  default:
2150
2150
  return a;
2151
2151
  }
2152
2152
  }
2153
- function oi() {
2154
- }
2155
- const Tt = "_root_nh0uj_2", Ct = "_disabled_nh0uj_26", Lt = "_actions_nh0uj_54", Di = {
2156
- root: Tt,
2157
- disabled: Ct,
2158
- "drag-reject": "_drag-reject_nh0uj_32",
2159
- "file-input": "_file-input_nh0uj_35",
2160
- "file-preview": "_file-preview_nh0uj_41",
2161
- "image-preview": "_image-preview_nh0uj_49",
2162
- actions: Lt
2163
- }, Mt = ({
2153
+ function si() {
2154
+ }
2155
+ const Ct = "_root_1encq_2", Mt = "_disabled_1encq_26", $t = "_actions_1encq_65", Da = {
2156
+ root: Ct,
2157
+ disabled: Mt,
2158
+ "drag-reject": "_drag-reject_1encq_32",
2159
+ "file-input": "_file-input_1encq_35",
2160
+ "file-preview": "_file-preview_1encq_40",
2161
+ "file-preview-icon": "_file-preview-icon_1encq_48",
2162
+ "file-preview-name": "_file-preview-name_1encq_51",
2163
+ "file-preview-size": "_file-preview-size_1encq_55",
2164
+ "image-preview": "_image-preview_1encq_60",
2165
+ actions: $t,
2166
+ "message-title": "_message-title_1encq_72",
2167
+ "message-hint": "_message-hint_1encq_75",
2168
+ "message-file-button-text": "_message-file-button-text_1encq_80"
2169
+ }, Sa = ja(Da), Nt = ({
2164
2170
  file: a,
2165
2171
  fileName: i,
2166
2172
  forceFileType: t,
2167
- previewButtonText: n = "Preview"
2173
+ previewButtonText: e = "Preview"
2168
2174
  }) => {
2169
- const e = typeof a == "string", o = Li(a, t), c = a instanceof File ? Mi(a) : null, r = e && i ? i : mi(a);
2170
- return /* @__PURE__ */ V(ri, { children: [
2171
- /* @__PURE__ */ x(o, { className: "mb-lg", size: "xxl" }),
2172
- /* @__PURE__ */ x(ha, { className: "m-0 max-w-[600px]", lines: 1, variant: "h4", children: r }),
2173
- !e && /* @__PURE__ */ x(ha, { className: "font-medium m-0 text-beige-70", lines: 1, variant: "sm", children: c }),
2174
- e ? /* @__PURE__ */ V(
2175
+ const n = typeof a == "string", o = $i(a, t), c = a instanceof File ? Ni(a) : null, r = n && i ? i : fi(a);
2176
+ return /* @__PURE__ */ V(ui, { children: [
2177
+ /* @__PURE__ */ x(o, { className: Sa("file-preview-icon"), size: "xxl" }),
2178
+ /* @__PURE__ */ x(ha, { className: Sa("file-preview-name"), lines: 1, variant: "h4", children: r }),
2179
+ !n && /* @__PURE__ */ x(ha, { className: Sa("file-preview-size"), lines: 1, variant: "sm", children: c }),
2180
+ n ? /* @__PURE__ */ V(
2175
2181
  ba,
2176
2182
  {
2177
2183
  as: "a",
@@ -2181,35 +2187,44 @@ const Tt = "_root_nh0uj_2", Ct = "_disabled_nh0uj_26", Lt = "_actions_nh0uj_54",
2181
2187
  size: "sm",
2182
2188
  target: "_blank",
2183
2189
  children: [
2184
- /* @__PURE__ */ x("span", { children: n }),
2185
- /* @__PURE__ */ x(Ni, {})
2190
+ /* @__PURE__ */ x("span", { children: e }),
2191
+ /* @__PURE__ */ x(Ki, {})
2186
2192
  ]
2187
2193
  }
2188
2194
  ) : null
2189
2195
  ] });
2190
- }, ci = ({
2196
+ }, Ta = ja(Da), di = ({
2191
2197
  disabled: a,
2192
2198
  fileButtonText: i = "Browse file",
2193
2199
  hint: t = "Drag & drop a file here or",
2194
- openFile: n,
2195
- title: e = "Add file"
2196
- }) => /* @__PURE__ */ V(ri, { children: [
2197
- /* @__PURE__ */ x(ha, { className: "m-0", variant: "h4", children: e }),
2198
- /* @__PURE__ */ x(ha, { className: "m-0 mt-xs text-beige-70", variant: "sm", children: t }),
2199
- /* @__PURE__ */ x(ba, { className: "mt-lg", disabled: a, onClick: n, type: "button", children: i })
2200
- ] }), Nt = di(Di), $t = ({
2200
+ openFile: e,
2201
+ title: n = "Add file"
2202
+ }) => /* @__PURE__ */ V(ui, { children: [
2203
+ /* @__PURE__ */ x(ha, { className: Ta("message-title"), variant: "h4", children: n }),
2204
+ /* @__PURE__ */ x(ha, { className: Ta("message-hint"), variant: "sm", children: t }),
2205
+ /* @__PURE__ */ x(
2206
+ ba,
2207
+ {
2208
+ className: Ta("message-file-button-text"),
2209
+ disabled: a,
2210
+ onClick: e,
2211
+ type: "button",
2212
+ children: i
2213
+ }
2214
+ )
2215
+ ] }), Kt = ja(Da), Ht = ({
2201
2216
  disabled: a,
2202
2217
  error: i,
2203
2218
  file: t,
2204
- fileName: n,
2205
- fileUrl: e,
2219
+ fileName: e,
2220
+ fileUrl: n,
2206
2221
  forceFileType: o,
2207
2222
  isAnImage: c,
2208
2223
  isHoverAccept: r,
2209
2224
  isHoverReject: u,
2210
2225
  openFile: h,
2211
2226
  wordings: f
2212
- }) => r ? /* @__PURE__ */ x(Si, {}) : u ? /* @__PURE__ */ x(qi, {}) : i ? /* @__PURE__ */ x(ci, { openFile: h, ...f }) : e ? c ? /* @__PURE__ */ x("img", { className: Nt("image-preview"), src: e }) : /* @__PURE__ */ x(Mt, { file: t, fileName: n, forceFileType: o, ...f }) : /* @__PURE__ */ x(ci, { disabled: a, openFile: h, ...f }), li = /\.(jpeg|jpg|gif|png|webp)$/, Kt = (a) => a ? typeof a == "string" ? !!mi(a).match(li) : a.name ? !!a.name.match(li) : !1 : !1, Ht = (a) => {
2227
+ }) => r ? /* @__PURE__ */ x(Ti, {}) : u ? /* @__PURE__ */ x(Li, {}) : i ? /* @__PURE__ */ x(di, { openFile: h, ...f }) : n ? c ? /* @__PURE__ */ x("img", { className: Kt("image-preview"), src: n }) : /* @__PURE__ */ x(Nt, { file: t, fileName: e, forceFileType: o, ...f }) : /* @__PURE__ */ x(di, { disabled: a, openFile: h, ...f }), mi = /\.(jpeg|jpg|gif|png|webp)$/, Wt = (a) => a ? typeof a == "string" ? !!fi(a).match(mi) : a.name ? !!a.name.match(mi) : !1 : !1, Ut = (a) => {
2213
2228
  let i;
2214
2229
  if (a instanceof File ? i = a.preview : i = a, typeof i != "string" || i.startsWith("blob:"))
2215
2230
  return i;
@@ -2219,108 +2234,108 @@ const Tt = "_root_nh0uj_2", Ct = "_disabled_nh0uj_26", Lt = "_actions_nh0uj_54",
2219
2234
  } catch {
2220
2235
  return;
2221
2236
  }
2222
- }, Wt = 2e6, Bt = "ERROR_INVALID_TYPE", Ut = "ERROR_INVALID_SIZE", ga = di(Di), pn = si(
2237
+ }, Bt = 2e6, Yt = "ERROR_INVALID_TYPE", Vt = "ERROR_INVALID_SIZE", ga = ja(Da), oe = vi(
2223
2238
  ({
2224
2239
  accept: a = {
2225
2240
  "image/*": []
2226
2241
  },
2227
- children: i = $t,
2242
+ children: i = Ht,
2228
2243
  className: t,
2229
- disabled: n,
2230
- fileName: e,
2244
+ disabled: e,
2245
+ fileName: n,
2231
2246
  forceFileType: o,
2232
2247
  handleAddFile: c,
2233
2248
  handleRemoveFile: r,
2234
2249
  isClearable: u,
2235
2250
  isEditable: h,
2236
- maxSize: f = Wt,
2237
- multiple: k,
2238
- name: F,
2239
- onBlur: I,
2240
- onChange: j,
2241
- onError: P,
2242
- value: q,
2243
- wordings: na,
2244
- ...ea
2251
+ maxSize: f = Bt,
2252
+ multiple: j,
2253
+ name: P,
2254
+ onBlur: q,
2255
+ onChange: w,
2256
+ onError: A,
2257
+ value: S,
2258
+ wordings: ea,
2259
+ ...na
2245
2260
  }, Z) => {
2246
- const [D, R] = Ya(q), [K, E] = Ya(void 0);
2261
+ const [D, I] = Ja(S), [K, _] = Ja(void 0);
2247
2262
  ia(() => {
2248
- R(q);
2249
- }, [q]), ia(() => () => D && D instanceof File && URL.revokeObjectURL(D.preview), [D]);
2250
- const J = (A) => {
2251
- const [d] = A;
2252
- d instanceof File && (d.preview = URL.createObjectURL(d)), R(d), E(null);
2253
- const _ = Va({ name: F, value: d });
2254
- j && j(_), c && c(_);
2255
- }, T = (A, d) => {
2256
- let _;
2257
- A.map(({ errors: la }) => {
2263
+ I(S);
2264
+ }, [S]), ia(() => () => D && D instanceof File && URL.revokeObjectURL(D.preview), [D]);
2265
+ const J = (E) => {
2266
+ const [d] = E;
2267
+ d instanceof File && (d.preview = URL.createObjectURL(d)), I(d), _(null);
2268
+ const O = Xa({ name: P, value: d });
2269
+ w == null || w(O), c == null || c(O);
2270
+ }, T = (E, d) => {
2271
+ let O;
2272
+ E.map(({ errors: la }) => {
2258
2273
  la.map((H) => {
2259
- const { code: Q, message: S } = H;
2260
- Q === "file-invalid-type" ? _ = Bt : Q === "file-too-large" ? _ = Ut : _ = S;
2274
+ const { code: Q, message: R } = H;
2275
+ Q === "file-invalid-type" ? O = Yt : Q === "file-too-large" ? O = Vt : O = R;
2261
2276
  });
2262
- }), R(null), E(_), P && P(_), j && j(d), I && I();
2263
- }, C = (A) => {
2264
- A.preventDefault(), R(null), E(null);
2265
- const d = Va({ name: F, value: null });
2266
- j && j(d), r && r(d);
2267
- }, { getInputProps: pa, getRootProps: X, isDragAccept: L, isDragActive: b, isDragReject: y, open: oa } = ji({
2277
+ }), I(null), _(O), A == null || A(O), w == null || w(d), q == null || q();
2278
+ }, L = (E) => {
2279
+ E.preventDefault(), I(null), _(null);
2280
+ const d = Xa({ name: P, value: null });
2281
+ w == null || w(d), r == null || r(d);
2282
+ }, { getInputProps: pa, getRootProps: X, isDragAccept: C, isDragActive: b, isDragReject: y, open: oa } = _i({
2268
2283
  accept: a,
2269
- disabled: n,
2284
+ disabled: e,
2270
2285
  maxSize: f,
2271
- multiple: k,
2286
+ multiple: j,
2272
2287
  noClick: !0,
2273
2288
  onDropAccepted: J,
2274
2289
  onDropRejected: T
2275
- }), ca = (A) => P(A);
2290
+ }), ca = (E) => A(E);
2276
2291
  return /* @__PURE__ */ V(
2277
2292
  "div",
2278
2293
  {
2279
- className: ga("root", n && "disabled", y && "drag-reject", t),
2294
+ className: ga("root", e && "disabled", y && "drag-reject", t),
2280
2295
  ...X({
2281
- disabled: n,
2296
+ disabled: e,
2282
2297
  handleRemoveFile: r,
2283
2298
  isClearable: u,
2284
- isDragAccept: L,
2299
+ isDragAccept: C,
2285
2300
  isDragActive: b,
2286
2301
  isDragReject: y,
2287
2302
  isEditable: h,
2288
2303
  ref: Z
2289
2304
  }),
2290
- ...ea,
2305
+ ...na,
2291
2306
  children: [
2292
2307
  /* @__PURE__ */ x(
2293
2308
  "input",
2294
2309
  {
2295
2310
  className: ga("file-input"),
2296
- ...pa({ disabled: n, multiple: k, name: F, onError: ca })
2311
+ ...pa({ disabled: e, multiple: j, name: P, onError: ca })
2297
2312
  }
2298
2313
  ),
2299
2314
  /* @__PURE__ */ V("div", { className: ga("file-preview"), children: [
2300
2315
  i({
2301
- disabled: n,
2316
+ disabled: e,
2302
2317
  error: K,
2303
2318
  file: D,
2304
- fileName: e,
2305
- fileUrl: D && Ht(D),
2319
+ fileName: n,
2320
+ fileUrl: D && Ut(D),
2306
2321
  forceFileType: o,
2307
- isAnImage: o === "image" || Kt(D),
2308
- isHoverAccept: L,
2322
+ isAnImage: o === "image" || Wt(D),
2323
+ isHoverAccept: C,
2309
2324
  isHoverReject: y,
2310
2325
  openFile: oa,
2311
- wordings: na
2326
+ wordings: ea
2312
2327
  }),
2313
2328
  D && (K || h || u) ? /* @__PURE__ */ V("div", { className: ga("actions"), children: [
2314
- K || h ? /* @__PURE__ */ x(ba, { onClick: oa, shape: "circle", size: "sm", type: "button", variant: "tertiary", children: /* @__PURE__ */ x(Ti, {}) }) : null,
2329
+ K || h ? /* @__PURE__ */ x(ba, { onClick: oa, shape: "circle", size: "sm", type: "button", variant: "tertiary", children: /* @__PURE__ */ x(Ci, {}) }) : null,
2315
2330
  u ? /* @__PURE__ */ x(
2316
2331
  ba,
2317
2332
  {
2318
- onClick: C,
2333
+ onClick: L,
2319
2334
  shape: "circle",
2320
2335
  size: "sm",
2321
2336
  type: "button",
2322
2337
  variant: "primary-danger",
2323
- children: /* @__PURE__ */ x(Ci, {})
2338
+ children: /* @__PURE__ */ x(Mi, {})
2324
2339
  }
2325
2340
  ) : null
2326
2341
  ] }) : null
@@ -2331,5 +2346,5 @@ const Tt = "_root_nh0uj_2", Ct = "_disabled_nh0uj_26", Lt = "_actions_nh0uj_54",
2331
2346
  }
2332
2347
  );
2333
2348
  export {
2334
- pn as FileDrop
2349
+ oe as FileDrop
2335
2350
  };