@rpcbase/ui 0.231.0 → 0.233.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FilesUploadField/index.d.ts +2 -1
- package/dist/components/FilesUploadField/index.d.ts.map +1 -1
- package/dist/components/I18nField/index.d.ts.map +1 -1
- package/dist/index11.js +291 -278
- package/dist/index11.js.map +1 -1
- package/dist/index151.js +4 -4
- package/dist/index156.js +1 -1
- package/dist/index157.js +1 -1
- package/dist/index164.js +1 -1
- package/dist/index165.js +6 -6
- package/dist/index167.js +1 -1
- package/dist/index169.js +1 -1
- package/dist/index172.js +3 -3
- package/dist/index175.js +1 -1
- package/dist/index176.js +4 -4
- package/dist/index182.js +1 -1
- package/dist/index184.js +12 -12
- package/dist/index187.js +5 -5
- package/dist/index189.js +3 -3
- package/dist/index190.js +1 -1
- package/dist/index193.js +3 -3
- package/dist/index194.js +5 -5
- package/dist/index256.js +14 -20
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +146 -58
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +30 -6
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +9 -11
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +44 -46
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +12 -4
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +43 -28
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +93 -14
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +86 -5
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +105 -21
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +51 -50
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +11 -25
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +37 -41
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +8 -39
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +117 -45
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +17 -20
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +14 -69
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +3 -17
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +36 -11
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +20 -27
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +9 -13
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +8 -18
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +20 -37
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +59 -255
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +6 -278
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +10 -67
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +47 -96
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +4 -84
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +29 -3
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +15 -28
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +5 -16
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +22 -35
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +51 -16
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +25 -3
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +41 -26
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +38 -27
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +45 -4
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +20 -78
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +65 -264
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +17 -11
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +11 -10
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +26 -24
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +13 -16
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +15 -122
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +36 -5
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +260 -38
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +275 -62
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +68 -13
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +99 -7
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +83 -5
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +3 -3
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +29 -10
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +15 -6
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +34 -133
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +15 -398
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +3 -52
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +26 -11
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +27 -10
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +4 -14
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +75 -151
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +267 -28
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +11 -9
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +11 -49
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +25 -11
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +15 -43
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +119 -89
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +5 -86
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +39 -104
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +60 -47
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +13 -11
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +7 -37
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +5 -8
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +3 -3
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +10 -9
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +7 -116
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +133 -17
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +398 -14
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +51 -35
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +11 -20
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +11 -8
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +3 -3
- package/dist/index346.js +2 -2
- package/dist/index348.js +8 -8
- package/dist/index349.js +3 -3
- package/dist/index350.js +2 -2
- package/dist/index351.js +5 -5
- package/dist/index353.js +1 -1
- package/dist/index362.js +21 -4
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +4 -12
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +11 -16
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +16 -5
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +5 -20
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +19 -43
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +40 -13
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +17 -4
- package/dist/index369.js.map +1 -1
- package/dist/index370.js +4 -200
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +197 -74
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +77 -20
- package/dist/index372.js.map +1 -1
- package/dist/index374.js +3 -3
- package/dist/index375.js +1 -1
- package/dist/index376.js +3 -3
- package/dist/index378.js +2 -2
- package/dist/index380.js +1 -1
- package/dist/index381.js +2 -2
- package/dist/index407.js +1 -1
- package/dist/index411.js +1 -1
- package/dist/index413.js +1 -1
- package/dist/index414.js +2 -2
- package/dist/index417.js +1 -1
- package/dist/index418.js +1 -1
- package/dist/index421.js +1 -1
- package/dist/index422.js +1 -1
- package/dist/index423.js +16 -2
- package/dist/index423.js.map +1 -1
- package/dist/index424.js +29 -2
- package/dist/index424.js.map +1 -1
- package/dist/index425.js +13 -2
- package/dist/index425.js.map +1 -1
- package/dist/index426.js +7 -2
- package/dist/index426.js.map +1 -1
- package/dist/index427.js +2 -16
- package/dist/index427.js.map +1 -1
- package/dist/index428.js +2 -29
- package/dist/index428.js.map +1 -1
- package/dist/index429.js +2 -13
- package/dist/index429.js.map +1 -1
- package/dist/index430.js +2 -7
- package/dist/index430.js.map +1 -1
- package/dist/index44.js +1 -1
- package/dist/index45.js +2 -2
- package/dist/index49.js +28 -28
- package/dist/index50.js +21 -21
- package/dist/index51.js +1 -1
- package/dist/index52.js +8 -8
- package/dist/index53.js +2 -2
- package/dist/index55.js +17 -17
- package/dist/index56.js +4 -4
- package/dist/index57.js +3 -3
- package/dist/index58.js +7 -7
- package/dist/index59.js +4 -4
- package/dist/index60.js +12 -12
- package/dist/index61.js +2 -2
- package/dist/index62.js +2 -2
- package/dist/index70.js +1 -1
- package/dist/index71.js +1 -1
- package/dist/index74.js +2 -6
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +2 -8
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +5 -5
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +8 -2
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +6 -2
- package/dist/index78.js.map +1 -1
- package/dist/index8.js +525 -517
- package/dist/index8.js.map +1 -1
- package/package.json +1 -1
package/dist/index8.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { j as n } from "./index30.js";
|
|
2
|
-
import { c as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { useSensors as
|
|
6
|
-
import { useSortable as
|
|
7
|
-
import { CSS as
|
|
8
|
-
import {
|
|
9
|
-
import { cn as
|
|
10
|
-
import { Image as
|
|
11
|
-
const
|
|
2
|
+
import { c as At } from "./index28.js";
|
|
3
|
+
import { useRef as T, useState as Pe, useEffect as Q } from "react";
|
|
4
|
+
import { createPortal as Pt } from "react-dom";
|
|
5
|
+
import { useSensors as Ot, useSensor as Et, PointerSensor as Bt, KeyboardSensor as Vt, DragOverlay as Wt, DndContext as Xt, closestCenter as _t } from "@dnd-kit/core";
|
|
6
|
+
import { useSortable as Jt, sortableKeyboardCoordinates as qt, arrayMove as Gt, SortableContext as Qt, rectSortingStrategy as Yt } from "@dnd-kit/sortable";
|
|
7
|
+
import { CSS as Zt } from "@dnd-kit/utilities";
|
|
8
|
+
import { Plus as Ct, X as Dt, Maximize2 as er, Loader2 as tr } from "lucide-react";
|
|
9
|
+
import { cn as gt } from "./index2.js";
|
|
10
|
+
import { Image as bt } from "./index12.js";
|
|
11
|
+
const rr = async (s) => {
|
|
12
12
|
if (typeof crypto > "u" || typeof crypto.subtle > "u") return null;
|
|
13
13
|
try {
|
|
14
14
|
const e = await crypto.subtle.digest("SHA-256", s);
|
|
@@ -16,7 +16,7 @@ const Zt = async (s) => {
|
|
|
16
16
|
} catch {
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, Mt = async (s, e, r) => {
|
|
20
20
|
const o = await fetch(s, {
|
|
21
21
|
method: "POST",
|
|
22
22
|
headers: {
|
|
@@ -26,13 +26,13 @@ const Zt = async (s) => {
|
|
|
26
26
|
credentials: "include",
|
|
27
27
|
body: JSON.stringify(e),
|
|
28
28
|
signal: r?.signal
|
|
29
|
-
}),
|
|
29
|
+
}), h = await o.json().catch(() => ({}));
|
|
30
30
|
return {
|
|
31
31
|
ok: o.ok,
|
|
32
32
|
status: o.status,
|
|
33
|
-
data:
|
|
33
|
+
data: h
|
|
34
34
|
};
|
|
35
|
-
},
|
|
35
|
+
}, sr = async (s, e) => {
|
|
36
36
|
const r = await fetch(s, {
|
|
37
37
|
credentials: "include",
|
|
38
38
|
headers: e?.headers,
|
|
@@ -43,30 +43,30 @@ const Zt = async (s) => {
|
|
|
43
43
|
status: r.status,
|
|
44
44
|
data: o
|
|
45
45
|
};
|
|
46
|
-
},
|
|
46
|
+
}, nr = async ({
|
|
47
47
|
url: s,
|
|
48
48
|
body: e,
|
|
49
49
|
sha256: r,
|
|
50
50
|
uploadKey: o,
|
|
51
|
-
signal:
|
|
51
|
+
signal: h
|
|
52
52
|
}) => {
|
|
53
|
-
const
|
|
53
|
+
const j = {
|
|
54
54
|
"Content-Type": "application/octet-stream"
|
|
55
55
|
};
|
|
56
|
-
r && (
|
|
57
|
-
const
|
|
56
|
+
r && (j["X-Chunk-SHA256"] = r), o && (j["X-Upload-Key"] = o);
|
|
57
|
+
const L = await fetch(s, {
|
|
58
58
|
method: "PUT",
|
|
59
59
|
credentials: "include",
|
|
60
|
-
headers:
|
|
60
|
+
headers: j,
|
|
61
61
|
body: e,
|
|
62
|
-
signal:
|
|
62
|
+
signal: h
|
|
63
63
|
});
|
|
64
64
|
return {
|
|
65
|
-
ok:
|
|
66
|
-
status:
|
|
65
|
+
ok: L.ok,
|
|
66
|
+
status: L.status
|
|
67
67
|
};
|
|
68
|
-
},
|
|
69
|
-
const o = await
|
|
68
|
+
}, lr = async (s, e, r) => {
|
|
69
|
+
const o = await Mt("/api/rb/file-uploads", {
|
|
70
70
|
filename: s.name,
|
|
71
71
|
mimeType: s.type || "application/octet-stream",
|
|
72
72
|
...typeof r?.isPublic == "boolean" ? {
|
|
@@ -78,139 +78,139 @@ const Zt = async (s) => {
|
|
|
78
78
|
});
|
|
79
79
|
if (!o.ok || !o.data?.ok)
|
|
80
80
|
throw new Error(o.data?.error ?? `Init failed (${o.status})`);
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
81
|
+
const h = String(o.data?.uploadId ?? ""), j = typeof o.data?.uploadKey == "string" ? String(o.data.uploadKey) : null, L = Number(o.data?.chunkSize ?? 0), C = Number(o.data?.chunksTotal ?? 0);
|
|
82
|
+
if (!h || !L || !C)
|
|
83
83
|
throw new Error("Upload init missing required fields");
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
url: `/api/rb/file-uploads/${encodeURIComponent(
|
|
87
|
-
body:
|
|
88
|
-
sha256:
|
|
89
|
-
uploadKey:
|
|
84
|
+
const F = async (x) => {
|
|
85
|
+
const u = x * L, p = Math.min(s.size, u + L), N = await s.slice(u, p).arrayBuffer(), c = await rr(N), b = await nr({
|
|
86
|
+
url: `/api/rb/file-uploads/${encodeURIComponent(h)}/chunks/${x}`,
|
|
87
|
+
body: N,
|
|
88
|
+
sha256: c ?? void 0,
|
|
89
|
+
uploadKey: j ?? void 0,
|
|
90
90
|
signal: r?.signal
|
|
91
91
|
});
|
|
92
|
-
if (
|
|
93
|
-
throw new Error(`Chunk ${
|
|
94
|
-
},
|
|
95
|
-
let
|
|
96
|
-
for (const
|
|
97
|
-
await
|
|
98
|
-
const
|
|
99
|
-
e(
|
|
92
|
+
if (b.status !== 204)
|
|
93
|
+
throw new Error(`Chunk ${x} failed (${b.status})`);
|
|
94
|
+
}, O = async (x, u = 0) => {
|
|
95
|
+
let p = u;
|
|
96
|
+
for (const E of x) {
|
|
97
|
+
await F(E), p += 1;
|
|
98
|
+
const N = Math.min(99, Math.floor(p / C * 99));
|
|
99
|
+
e(N);
|
|
100
100
|
}
|
|
101
|
-
},
|
|
102
|
-
length:
|
|
103
|
-
}, (
|
|
104
|
-
await
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
headers:
|
|
108
|
-
"X-Upload-Key":
|
|
101
|
+
}, k = Array.from({
|
|
102
|
+
length: C
|
|
103
|
+
}, (x, u) => u);
|
|
104
|
+
await O(k, 0);
|
|
105
|
+
const K = async () => {
|
|
106
|
+
const x = await Mt(`/api/rb/file-uploads/${encodeURIComponent(h)}/complete`, {}, {
|
|
107
|
+
headers: j ? {
|
|
108
|
+
"X-Upload-Key": j
|
|
109
109
|
} : void 0,
|
|
110
110
|
signal: r?.signal
|
|
111
111
|
});
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
115
|
-
return
|
|
112
|
+
if (x.ok && x.data?.ok) {
|
|
113
|
+
const b = String(x.data?.fileId ?? "");
|
|
114
|
+
if (!b) throw new Error("Upload completed without fileId");
|
|
115
|
+
return b;
|
|
116
116
|
}
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
throw new Error(
|
|
120
|
-
const
|
|
121
|
-
headers:
|
|
122
|
-
"X-Upload-Key":
|
|
117
|
+
const u = String(x.data?.error ?? "");
|
|
118
|
+
if (x.status !== 409 || u !== "missing_chunks")
|
|
119
|
+
throw new Error(u || `Complete failed (${x.status})`);
|
|
120
|
+
const p = await sr(`/api/rb/file-uploads/${encodeURIComponent(h)}/status`, {
|
|
121
|
+
headers: j ? {
|
|
122
|
+
"X-Upload-Key": j
|
|
123
123
|
} : void 0,
|
|
124
124
|
signal: r?.signal
|
|
125
125
|
});
|
|
126
|
-
if (!
|
|
127
|
-
throw new Error(
|
|
128
|
-
const
|
|
129
|
-
for (let
|
|
130
|
-
|
|
131
|
-
if (!
|
|
126
|
+
if (!p.ok || !p.data?.ok)
|
|
127
|
+
throw new Error(p.data?.error ?? `Status failed (${p.status})`);
|
|
128
|
+
const E = Array.isArray(p.data?.received) ? p.data.received : [], N = new Set(E), c = [];
|
|
129
|
+
for (let b = 0; b < C; b += 1)
|
|
130
|
+
N.has(b) || c.push(b);
|
|
131
|
+
if (!c.length)
|
|
132
132
|
throw new Error("missing_chunks");
|
|
133
|
-
return await
|
|
134
|
-
},
|
|
133
|
+
return await O(c, N.size), K();
|
|
134
|
+
}, H = await K();
|
|
135
135
|
return e(100), {
|
|
136
|
-
id:
|
|
137
|
-
url: `/api/rb/files/${encodeURIComponent(
|
|
136
|
+
id: H,
|
|
137
|
+
url: `/api/rb/files/${encodeURIComponent(H)}`,
|
|
138
138
|
alt: s.name,
|
|
139
|
-
...
|
|
140
|
-
uploadKey:
|
|
139
|
+
...j ? {
|
|
140
|
+
uploadKey: j
|
|
141
141
|
} : {}
|
|
142
142
|
};
|
|
143
143
|
};
|
|
144
|
-
function
|
|
145
|
-
const e =
|
|
144
|
+
function or(s) {
|
|
145
|
+
const e = At.c(80), {
|
|
146
146
|
item: r,
|
|
147
147
|
isHovered: o,
|
|
148
|
-
enableImagePreview:
|
|
149
|
-
renderItem:
|
|
150
|
-
onHoverEnter:
|
|
151
|
-
onHoverLeave:
|
|
152
|
-
onRemove:
|
|
153
|
-
onRetry:
|
|
154
|
-
startFullscreen:
|
|
155
|
-
isUploading:
|
|
156
|
-
isError:
|
|
157
|
-
tileClasses:
|
|
158
|
-
disabled:
|
|
159
|
-
isDraggingExternal:
|
|
160
|
-
removeButtonAriaLabel:
|
|
148
|
+
enableImagePreview: h,
|
|
149
|
+
renderItem: j,
|
|
150
|
+
onHoverEnter: L,
|
|
151
|
+
onHoverLeave: C,
|
|
152
|
+
onRemove: F,
|
|
153
|
+
onRetry: O,
|
|
154
|
+
startFullscreen: k,
|
|
155
|
+
isUploading: K,
|
|
156
|
+
isError: H,
|
|
157
|
+
tileClasses: x,
|
|
158
|
+
disabled: u,
|
|
159
|
+
isDraggingExternal: p,
|
|
160
|
+
removeButtonAriaLabel: E
|
|
161
161
|
} = s;
|
|
162
|
-
let
|
|
163
|
-
e[0] !==
|
|
162
|
+
let N;
|
|
163
|
+
e[0] !== u || e[1] !== r.id ? (N = {
|
|
164
164
|
id: r.id,
|
|
165
|
-
disabled:
|
|
166
|
-
}, e[0] =
|
|
165
|
+
disabled: u
|
|
166
|
+
}, e[0] = u, e[1] = r.id, e[2] = N) : N = e[2];
|
|
167
167
|
const {
|
|
168
|
-
setNodeRef:
|
|
169
|
-
attributes:
|
|
170
|
-
listeners:
|
|
171
|
-
transform:
|
|
172
|
-
transition:
|
|
173
|
-
isDragging:
|
|
174
|
-
} =
|
|
175
|
-
let
|
|
176
|
-
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
177
|
-
const g =
|
|
168
|
+
setNodeRef: c,
|
|
169
|
+
attributes: b,
|
|
170
|
+
listeners: de,
|
|
171
|
+
transform: J,
|
|
172
|
+
transition: be,
|
|
173
|
+
isDragging: ue
|
|
174
|
+
} = Jt(N), l = T(null), z = T(null), [fe, ve] = Pe(null);
|
|
175
|
+
let B;
|
|
176
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = () => {
|
|
177
|
+
const g = l.current;
|
|
178
178
|
if (!g)
|
|
179
179
|
return;
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
left:
|
|
183
|
-
top:
|
|
180
|
+
const S = g.getBoundingClientRect();
|
|
181
|
+
ve({
|
|
182
|
+
left: S.left + S.width / 2,
|
|
183
|
+
top: S.top - 10
|
|
184
184
|
});
|
|
185
|
-
}, e[3] =
|
|
186
|
-
const
|
|
187
|
-
let
|
|
188
|
-
e[4] !==
|
|
189
|
-
if (!
|
|
190
|
-
|
|
185
|
+
}, e[3] = B) : B = e[3];
|
|
186
|
+
const $ = B;
|
|
187
|
+
let ne, pe;
|
|
188
|
+
e[4] !== h || e[5] !== o ? (ne = () => {
|
|
189
|
+
if (!h || !o) {
|
|
190
|
+
ve(null);
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
$();
|
|
194
194
|
let g = 0;
|
|
195
|
-
const
|
|
195
|
+
const S = () => {
|
|
196
196
|
g && cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
197
|
-
g = 0,
|
|
197
|
+
g = 0, $();
|
|
198
198
|
});
|
|
199
199
|
};
|
|
200
|
-
return window.addEventListener("resize",
|
|
201
|
-
g && cancelAnimationFrame(g), window.removeEventListener("resize",
|
|
200
|
+
return window.addEventListener("resize", S), window.addEventListener("scroll", S, !0), () => {
|
|
201
|
+
g && cancelAnimationFrame(g), window.removeEventListener("resize", S), window.removeEventListener("scroll", S, !0);
|
|
202
202
|
};
|
|
203
|
-
},
|
|
204
|
-
let
|
|
205
|
-
e[8] !==
|
|
206
|
-
let
|
|
207
|
-
e[10] !==
|
|
208
|
-
transform:
|
|
209
|
-
transition:
|
|
210
|
-
}, e[10] =
|
|
211
|
-
const
|
|
212
|
-
let
|
|
213
|
-
e[13] !==
|
|
203
|
+
}, pe = [h, o], e[4] = h, e[5] = o, e[6] = ne, e[7] = pe) : (ne = e[6], pe = e[7]), Q(ne, pe);
|
|
204
|
+
let I;
|
|
205
|
+
e[8] !== J ? (I = Zt.Transform.toString(J), e[8] = J, e[9] = I) : I = e[9];
|
|
206
|
+
let Y;
|
|
207
|
+
e[10] !== I || e[11] !== be ? (Y = {
|
|
208
|
+
transform: I,
|
|
209
|
+
transition: be
|
|
210
|
+
}, e[10] = I, e[11] = be, e[12] = Y) : Y = e[12];
|
|
211
|
+
const Z = Y;
|
|
212
|
+
let le;
|
|
213
|
+
e[13] !== h || e[14] !== H || e[15] !== K || e[16] !== r.alt || e[17] !== r.fileName || e[18] !== r.id || e[19] !== r.previewUrl || e[20] !== r.progress || e[21] !== r.status || e[22] !== r.uploadKey || e[23] !== r.url || e[24] !== j ? (le = j ? j({
|
|
214
214
|
file: {
|
|
215
215
|
id: r.id,
|
|
216
216
|
url: r.url,
|
|
@@ -221,51 +221,51 @@ function sr(s) {
|
|
|
221
221
|
status: r.status,
|
|
222
222
|
progress: r.progress,
|
|
223
223
|
fileName: r.fileName
|
|
224
|
-
}) :
|
|
225
|
-
const
|
|
226
|
-
let
|
|
227
|
-
e[26] !==
|
|
228
|
-
|
|
229
|
-
}, e[26] =
|
|
230
|
-
const
|
|
231
|
-
let _;
|
|
232
|
-
e[28] !== ce || e[29] !== G || e[30] !== ue || e[31] !== $ || e[32] !== we || e[33] !== h ? (_ = mt(h, we, ce, G, ue, $), e[28] = ce, e[29] = G, e[30] = ue, e[31] = $, e[32] = we, e[33] = h, e[34] = _) : _ = e[34];
|
|
233
|
-
let b;
|
|
234
|
-
e[35] !== I ? (b = () => {
|
|
235
|
-
pe(), I();
|
|
236
|
-
}, e[35] = I, e[36] = b) : b = e[36];
|
|
224
|
+
}) : h ? /* @__PURE__ */ n.jsx(bt, { src: r.previewUrl, alt: r.alt ?? "Uploaded file", sizes: "96px", className: gt("size-full rounded-md object-cover", K && "opacity-75", H && "grayscale") }) : /* @__PURE__ */ n.jsx("div", { className: "flex size-full items-center justify-center rounded-md bg-slate-100 px-2 text-center text-[10px] font-medium text-slate-700 dark:bg-slate-800 dark:text-slate-200", children: /* @__PURE__ */ n.jsx("span", { className: "w-full truncate", children: r.fileName ?? r.alt ?? "Fichier" }) }), e[13] = h, e[14] = H, e[15] = K, e[16] = r.alt, e[17] = r.fileName, e[18] = r.id, e[19] = r.previewUrl, e[20] = r.progress, e[21] = r.status, e[22] = r.uploadKey, e[23] = r.url, e[24] = j, e[25] = le) : le = e[25];
|
|
225
|
+
const oe = le;
|
|
226
|
+
let q;
|
|
227
|
+
e[26] !== c ? (q = (g) => {
|
|
228
|
+
l.current = g, c(g);
|
|
229
|
+
}, e[26] = c, e[27] = q) : q = e[27];
|
|
230
|
+
const xe = ue && "z-20 ring-2 ring-primary shadow-xl", ye = p && "opacity-0", we = !u && "cursor-grab active:cursor-grabbing", ae = ue && "cursor-grabbing", G = u && "cursor-default";
|
|
237
231
|
let V;
|
|
238
|
-
e[
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
232
|
+
e[28] !== ye || e[29] !== we || e[30] !== ae || e[31] !== G || e[32] !== xe || e[33] !== x ? (V = gt(x, xe, ye, we, ae, G), e[28] = ye, e[29] = we, e[30] = ae, e[31] = G, e[32] = xe, e[33] = x, e[34] = V) : V = e[34];
|
|
233
|
+
let M;
|
|
234
|
+
e[35] !== L ? (M = () => {
|
|
235
|
+
$(), L();
|
|
236
|
+
}, e[35] = L, e[36] = M) : M = e[36];
|
|
237
|
+
let W;
|
|
238
|
+
e[37] !== C ? (W = (g) => {
|
|
239
|
+
const S = g.relatedTarget;
|
|
240
|
+
S instanceof Node && z.current?.contains(S) || C();
|
|
241
|
+
}, e[37] = C, e[38] = W) : W = e[38];
|
|
242
|
+
let v;
|
|
243
|
+
e[39] !== u || e[40] !== r.id || e[41] !== F ? (v = () => {
|
|
244
|
+
u || F(r.id);
|
|
245
|
+
}, e[39] = u, e[40] = r.id, e[41] = F, e[42] = v) : v = e[42];
|
|
246
246
|
let ee;
|
|
247
|
-
e[43] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = /* @__PURE__ */ n.jsx(
|
|
247
|
+
e[43] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = /* @__PURE__ */ n.jsx(Dt, { className: "h-4 w-4" }), e[43] = ee) : ee = e[43];
|
|
248
|
+
let y;
|
|
249
|
+
e[44] !== u || e[45] !== E || e[46] !== v ? (y = /* @__PURE__ */ n.jsx("button", { type: "button", onClick: v, disabled: u, className: "absolute right-1 top-1 inline-flex size-6 items-center justify-center rounded-full bg-white text-slate-700 shadow-sm transition hover:scale-105 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary dark:bg-slate-900 dark:text-slate-200", "aria-label": E, children: ee }), e[44] = u, e[45] = E, e[46] = v, e[47] = y) : y = e[47];
|
|
248
250
|
let X;
|
|
249
|
-
e[
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
left: H.left,
|
|
254
|
-
top: H.top
|
|
251
|
+
e[48] !== h || e[49] !== o || e[50] !== r.alt || e[51] !== r.id || e[52] !== r.url || e[53] !== L || e[54] !== C || e[55] !== fe || e[56] !== k ? (X = h && o && fe && (() => {
|
|
252
|
+
const g = /* @__PURE__ */ n.jsx(n.Fragment, { children: /* @__PURE__ */ n.jsx("div", { ref: z, className: "pointer-events-auto fixed z-[60] w-52 -translate-x-1/2 -translate-y-full rounded-xl border border-slate-200 bg-white/95 p-3 shadow-2xl backdrop-blur dark:border-slate-700 dark:bg-slate-900/95", style: {
|
|
253
|
+
left: fe.left,
|
|
254
|
+
top: fe.top
|
|
255
255
|
}, onMouseEnter: () => {
|
|
256
|
-
|
|
257
|
-
}, onMouseLeave: (
|
|
258
|
-
const me =
|
|
259
|
-
me instanceof Node &&
|
|
256
|
+
$(), L();
|
|
257
|
+
}, onMouseLeave: (S) => {
|
|
258
|
+
const me = S.relatedTarget;
|
|
259
|
+
me instanceof Node && l.current?.contains(me) || C();
|
|
260
260
|
}, children: /* @__PURE__ */ n.jsxs("div", { className: "relative overflow-hidden rounded-lg", children: [
|
|
261
|
-
/* @__PURE__ */ n.jsx(
|
|
262
|
-
/* @__PURE__ */ n.jsx("button", { type: "button", onClick: () =>
|
|
261
|
+
/* @__PURE__ */ n.jsx(bt, { src: r.url, alt: r.alt ?? "Preview", sizes: "208px", className: "h-40 w-full object-cover" }),
|
|
262
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", onClick: () => k(r.id), className: "absolute right-2 top-2 inline-flex items-center justify-center rounded-full bg-black/70 p-2 text-white transition hover:bg-black", "aria-label": "Plein écran", children: /* @__PURE__ */ n.jsx(er, { className: "h-3.5 w-3.5" }) })
|
|
263
263
|
] }) }) });
|
|
264
|
-
return typeof document > "u" ? g :
|
|
265
|
-
})(), e[48] =
|
|
266
|
-
let
|
|
267
|
-
e[58] !==
|
|
268
|
-
/* @__PURE__ */ n.jsx(
|
|
264
|
+
return typeof document > "u" ? g : Pt(g, document.body);
|
|
265
|
+
})(), e[48] = h, e[49] = o, e[50] = r.alt, e[51] = r.id, e[52] = r.url, e[53] = L, e[54] = C, e[55] = fe, e[56] = k, e[57] = X) : X = e[57];
|
|
266
|
+
let _;
|
|
267
|
+
e[58] !== K || e[59] !== r.progress ? (_ = K && /* @__PURE__ */ n.jsxs("div", { className: "absolute inset-0 z-20 flex flex-col items-center justify-center gap-2 rounded-lg bg-black/40 text-white", children: [
|
|
268
|
+
/* @__PURE__ */ n.jsx(tr, { className: "h-5 w-5 animate-spin" }),
|
|
269
269
|
/* @__PURE__ */ n.jsx("div", { className: "h-1.5 w-5/6 rounded-full bg-white/20", children: /* @__PURE__ */ n.jsx("div", { className: "h-full rounded-full bg-primary", style: {
|
|
270
270
|
width: `${r.progress}%`
|
|
271
271
|
} }) }),
|
|
@@ -273,79 +273,80 @@ function sr(s) {
|
|
|
273
273
|
r.progress,
|
|
274
274
|
"%"
|
|
275
275
|
] })
|
|
276
|
-
] }), e[58] =
|
|
277
|
-
let
|
|
278
|
-
e[61] !==
|
|
279
|
-
/* @__PURE__ */ n.jsx("div", { className: "max-w-[92%] break-words text-center text-[10px] font-semibold leading-tight", title: r.errorMessage, children:
|
|
280
|
-
/* @__PURE__ */ n.jsx("button", { type: "button", onClick: () =>
|
|
281
|
-
] }), e[61] =
|
|
276
|
+
] }), e[58] = K, e[59] = r.progress, e[60] = _) : _ = e[60];
|
|
277
|
+
let ie;
|
|
278
|
+
e[61] !== u || e[62] !== H || e[63] !== r.errorMessage || e[64] !== r.id || e[65] !== O ? (ie = H && /* @__PURE__ */ n.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 rounded-lg bg-red-600/70 text-white", children: [
|
|
279
|
+
/* @__PURE__ */ n.jsx("div", { className: "max-w-[92%] break-words text-center text-[10px] font-semibold leading-tight", title: r.errorMessage, children: ir(r.errorMessage) }),
|
|
280
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", onClick: () => O(r.id), disabled: u, className: "rounded-full bg-white/90 px-3 py-1 text-xs font-semibold text-red-700 shadow-sm transition hover:bg-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", children: "Réessayer" })
|
|
281
|
+
] }), e[61] = u, e[62] = H, e[63] = r.errorMessage, e[64] = r.id, e[65] = O, e[66] = ie) : ie = e[66];
|
|
282
282
|
let te;
|
|
283
|
-
return e[67] !==
|
|
284
|
-
|
|
283
|
+
return e[67] !== b || e[68] !== de || e[69] !== Z || e[70] !== V || e[71] !== M || e[72] !== W || e[73] !== y || e[74] !== X || e[75] !== _ || e[76] !== ie || e[77] !== q || e[78] !== oe ? (te = /* @__PURE__ */ n.jsxs("div", { ref: q, style: Z, className: V, onMouseEnter: M, onMouseLeave: W, ...b, ...de, children: [
|
|
284
|
+
oe,
|
|
285
|
+
y,
|
|
285
286
|
X,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
] }), e[67] = j, e[68] = be, e[69] = ae, e[70] = _, e[71] = b, e[72] = V, e[73] = X, e[74] = de, e[75] = W, e[76] = J, e[77] = Z, e[78] = ye, e[79] = te) : te = e[79], te;
|
|
287
|
+
_,
|
|
288
|
+
ie
|
|
289
|
+
] }), e[67] = b, e[68] = de, e[69] = Z, e[70] = V, e[71] = M, e[72] = W, e[73] = y, e[74] = X, e[75] = _, e[76] = ie, e[77] = q, e[78] = oe, e[79] = te) : te = e[79], te;
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function ar(s) {
|
|
292
292
|
return URL.createObjectURL(s);
|
|
293
293
|
}
|
|
294
|
-
const
|
|
295
|
-
function
|
|
296
|
-
const e =
|
|
294
|
+
const zt = (s) => s instanceof Error ? s.message : typeof s == "string" ? s : "Upload failed", ir = (s) => s ? s.startsWith("heif_decode_unsupported") ? "HEIC/HEVC non supporté" : s : "Échec", cr = /\.(png|jpe?g|gif|webp|avif|heic|heif|svg|bmp)$/i, dr = (s) => s.mimeType ? s.mimeType.startsWith("image/") : cr.test(s.fileName ?? s.alt ?? "");
|
|
295
|
+
function zr(s) {
|
|
296
|
+
const e = At.c(129), {
|
|
297
297
|
initialFiles: r,
|
|
298
298
|
onChange: o,
|
|
299
|
-
upload:
|
|
300
|
-
uploadIsPublic:
|
|
301
|
-
disabled:
|
|
302
|
-
onUploadingChange:
|
|
303
|
-
accept:
|
|
304
|
-
renderHeader:
|
|
305
|
-
renderItem:
|
|
306
|
-
addButtonAriaLabel:
|
|
307
|
-
removeButtonAriaLabel:
|
|
299
|
+
upload: h,
|
|
300
|
+
uploadIsPublic: j,
|
|
301
|
+
disabled: L,
|
|
302
|
+
onUploadingChange: C,
|
|
303
|
+
accept: F,
|
|
304
|
+
renderHeader: O,
|
|
305
|
+
renderItem: k,
|
|
306
|
+
addButtonAriaLabel: K,
|
|
307
|
+
removeButtonAriaLabel: H,
|
|
308
|
+
variant: x
|
|
308
309
|
} = s;
|
|
309
|
-
let
|
|
310
|
-
e[0] !== r ? (
|
|
311
|
-
const
|
|
312
|
-
let ne;
|
|
313
|
-
e[2] !== a ? (ne = () => a.map(br), e[2] = a, e[3] = ne) : ne = e[3];
|
|
314
|
-
const [l, E] = ze(ne), [Ae, ve] = ze(!1), [H, q] = ze(null), [le, pe] = ze(null), [C, Y] = ze(null), O = D(null), oe = D(!0);
|
|
315
|
-
let ae;
|
|
316
|
-
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ae = [], e[4] = ae) : ae = e[4];
|
|
317
|
-
const ie = D(ae), ye = D(a), Z = D(o), we = D(U);
|
|
318
|
-
let ce;
|
|
319
|
-
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = /* @__PURE__ */ new Map(), e[5] = ce) : ce = e[5];
|
|
320
|
-
const G = D(ce);
|
|
310
|
+
let u;
|
|
311
|
+
e[0] !== r ? (u = r === void 0 ? [] : r, e[0] = r, e[1] = u) : u = e[1];
|
|
312
|
+
const p = u, E = h === void 0 ? lr : h, N = j === void 0 ? !1 : j, c = L === void 0 ? !1 : L, b = K === void 0 ? "Ajouter un fichier" : K, de = H === void 0 ? "Supprimer le fichier" : H, J = x === void 0 ? "card" : x, be = T(null);
|
|
321
313
|
let ue;
|
|
322
|
-
e[
|
|
323
|
-
const
|
|
324
|
-
let
|
|
325
|
-
e[
|
|
326
|
-
const
|
|
314
|
+
e[2] !== p ? (ue = () => p.map(jr), e[2] = p, e[3] = ue) : ue = e[3];
|
|
315
|
+
const [l, z] = Pe(ue), [fe, ve] = Pe(!1), [B, $] = Pe(null), [ne, pe] = Pe(null), [I, Y] = Pe(null), Z = T(null), le = T(!0);
|
|
316
|
+
let oe;
|
|
317
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (oe = [], e[4] = oe) : oe = e[4];
|
|
318
|
+
const q = T(oe), xe = T(p), ye = T(o), we = T(C);
|
|
319
|
+
let ae;
|
|
320
|
+
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ae = /* @__PURE__ */ new Map(), e[5] = ae) : ae = e[5];
|
|
321
|
+
const G = T(ae);
|
|
327
322
|
let V;
|
|
328
|
-
e[
|
|
329
|
-
const
|
|
323
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ new Map(), e[6] = V) : V = e[6];
|
|
324
|
+
const M = T(V);
|
|
325
|
+
let W;
|
|
326
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ new Map(), e[7] = W) : W = e[7];
|
|
327
|
+
const v = T(W);
|
|
330
328
|
let ee;
|
|
331
|
-
e[
|
|
329
|
+
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = /* @__PURE__ */ new Map(), e[8] = ee) : ee = e[8];
|
|
330
|
+
const y = T(ee);
|
|
331
|
+
let X;
|
|
332
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = {
|
|
332
333
|
activationConstraint: {
|
|
333
334
|
distance: 6
|
|
334
335
|
}
|
|
335
|
-
}, e[9] =
|
|
336
|
-
let
|
|
337
|
-
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
338
|
-
coordinateGetter:
|
|
339
|
-
}, e[10] =
|
|
340
|
-
const
|
|
341
|
-
let
|
|
342
|
-
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
343
|
-
for (const t of
|
|
336
|
+
}, e[9] = X) : X = e[9];
|
|
337
|
+
let _;
|
|
338
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = {
|
|
339
|
+
coordinateGetter: qt
|
|
340
|
+
}, e[10] = _) : _ = e[10];
|
|
341
|
+
const ie = Ot(Et(Bt, X), Et(Vt, _));
|
|
342
|
+
let te, g;
|
|
343
|
+
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (te = () => () => {
|
|
344
|
+
for (const t of v.current.values())
|
|
344
345
|
try {
|
|
345
346
|
t.abort();
|
|
346
347
|
} catch {
|
|
347
348
|
}
|
|
348
|
-
|
|
349
|
+
v.current.clear(), M.current.clear(), G.current.clear();
|
|
349
350
|
for (const t of y.current.values())
|
|
350
351
|
if (typeof URL < "u")
|
|
351
352
|
try {
|
|
@@ -353,58 +354,58 @@ function Rr(s) {
|
|
|
353
354
|
} catch {
|
|
354
355
|
}
|
|
355
356
|
y.current.clear();
|
|
356
|
-
},
|
|
357
|
-
let
|
|
358
|
-
e[13] !==
|
|
357
|
+
}, g = [], e[11] = te, e[12] = g) : (te = e[11], g = e[12]), Q(te, g);
|
|
358
|
+
let S, me;
|
|
359
|
+
e[13] !== I ? (S = () => {
|
|
359
360
|
if (!(typeof document > "u")) {
|
|
360
|
-
if (
|
|
361
|
-
return document.body.style.cursor = "grabbing",
|
|
361
|
+
if (I)
|
|
362
|
+
return document.body.style.cursor = "grabbing", wr;
|
|
362
363
|
document.body.style.cursor = "";
|
|
363
364
|
}
|
|
364
|
-
},
|
|
365
|
-
let
|
|
366
|
-
e[16] !== l ? (
|
|
367
|
-
|
|
368
|
-
},
|
|
369
|
-
let
|
|
370
|
-
e[19] !== o ? (
|
|
371
|
-
|
|
372
|
-
},
|
|
373
|
-
let
|
|
374
|
-
e[22] !==
|
|
375
|
-
we.current =
|
|
376
|
-
},
|
|
377
|
-
let
|
|
378
|
-
e[25] !==
|
|
379
|
-
const t =
|
|
380
|
-
if (t.length ===
|
|
381
|
-
const w =
|
|
365
|
+
}, me = [I], e[13] = I, e[14] = S, e[15] = me) : (S = e[14], me = e[15]), Q(S, me);
|
|
366
|
+
let Ke, He;
|
|
367
|
+
e[16] !== l ? (Ke = () => {
|
|
368
|
+
q.current = l;
|
|
369
|
+
}, He = [l], e[16] = l, e[17] = Ke, e[18] = He) : (Ke = e[17], He = e[18]), Q(Ke, He);
|
|
370
|
+
let $e, Oe;
|
|
371
|
+
e[19] !== o ? ($e = () => {
|
|
372
|
+
ye.current = o;
|
|
373
|
+
}, Oe = [o], e[19] = o, e[20] = $e, e[21] = Oe) : ($e = e[20], Oe = e[21]), Q($e, Oe);
|
|
374
|
+
let Be, Ve;
|
|
375
|
+
e[22] !== C ? (Be = () => {
|
|
376
|
+
we.current = C;
|
|
377
|
+
}, Ve = [C], e[22] = C, e[23] = Be, e[24] = Ve) : (Be = e[23], Ve = e[24]), Q(Be, Ve);
|
|
378
|
+
let We, Xe;
|
|
379
|
+
e[25] !== p ? (We = () => {
|
|
380
|
+
const t = xe.current;
|
|
381
|
+
if (t.length === p.length && t.every((f, m) => {
|
|
382
|
+
const w = p[m];
|
|
382
383
|
return w && f.id === w.id && f.url === w.url && f.alt === w.alt;
|
|
383
384
|
}))
|
|
384
385
|
return;
|
|
385
|
-
|
|
386
|
-
const
|
|
387
|
-
for (const [f,
|
|
388
|
-
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
const
|
|
392
|
-
return
|
|
386
|
+
xe.current = p;
|
|
387
|
+
const a = p.map(yr), U = new Set(a.map(xr));
|
|
388
|
+
for (const [f, m] of G.current.entries())
|
|
389
|
+
U.has(m) && G.current.delete(f);
|
|
390
|
+
const A = new Set(q.current.map(vr));
|
|
391
|
+
if (a.some((f) => {
|
|
392
|
+
const m = G.current.get(f.id);
|
|
393
|
+
return m ? A.has(m) : !1;
|
|
393
394
|
}))
|
|
394
395
|
return;
|
|
395
|
-
const
|
|
396
|
-
for (const f of
|
|
397
|
-
if (
|
|
396
|
+
const R = new Set(a.map(br));
|
|
397
|
+
for (const f of q.current) {
|
|
398
|
+
if (R.has(f.id))
|
|
398
399
|
continue;
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
|
|
400
|
+
const m = v.current.get(f.id);
|
|
401
|
+
if (m) {
|
|
402
|
+
v.current.delete(f.id);
|
|
402
403
|
try {
|
|
403
|
-
|
|
404
|
+
m.abort();
|
|
404
405
|
} catch {
|
|
405
406
|
}
|
|
406
407
|
}
|
|
407
|
-
|
|
408
|
+
M.current.delete(f.id);
|
|
408
409
|
const w = y.current.get(f.id);
|
|
409
410
|
if (w) {
|
|
410
411
|
y.current.delete(f.id);
|
|
@@ -414,287 +415,288 @@ function Rr(s) {
|
|
|
414
415
|
}
|
|
415
416
|
}
|
|
416
417
|
}
|
|
417
|
-
|
|
418
|
-
const
|
|
419
|
-
return
|
|
420
|
-
}) ? f : (
|
|
421
|
-
},
|
|
422
|
-
let _e,
|
|
418
|
+
z((f) => f.length === a.length && f.every((P, se) => {
|
|
419
|
+
const D = a[se];
|
|
420
|
+
return D && P.id === D.id && P.url === D.url && P.alt === D.alt && P.uploadKey === D.uploadKey;
|
|
421
|
+
}) ? f : (le.current = !0, a));
|
|
422
|
+
}, Xe = [p], e[25] = p, e[26] = We, e[27] = Xe) : (We = e[26], Xe = e[27]), Q(We, Xe);
|
|
423
|
+
let _e, Je;
|
|
423
424
|
e[28] !== l ? (_e = () => {
|
|
424
|
-
if (
|
|
425
|
-
|
|
425
|
+
if (le.current) {
|
|
426
|
+
le.current = !1;
|
|
426
427
|
return;
|
|
427
428
|
}
|
|
428
|
-
|
|
429
|
-
},
|
|
430
|
-
let
|
|
431
|
-
e[31] !== l ? (
|
|
432
|
-
we.current?.(l.some(
|
|
433
|
-
},
|
|
434
|
-
let
|
|
435
|
-
e[34] !==
|
|
436
|
-
if (
|
|
429
|
+
ye.current?.(l.map(gr));
|
|
430
|
+
}, Je = [l], e[28] = l, e[29] = _e, e[30] = Je) : (_e = e[29], Je = e[30]), Q(_e, Je);
|
|
431
|
+
let qe, Ge;
|
|
432
|
+
e[31] !== l ? (qe = () => {
|
|
433
|
+
we.current?.(l.some(hr));
|
|
434
|
+
}, Ge = [l], e[31] = l, e[32] = qe, e[33] = Ge) : (qe = e[32], Ge = e[33]), Q(qe, Ge);
|
|
435
|
+
let Qe, Ye;
|
|
436
|
+
e[34] !== B || e[35] !== l.length ? (Qe = () => {
|
|
437
|
+
if (B === null)
|
|
437
438
|
return;
|
|
438
439
|
const t = (d) => {
|
|
439
440
|
if (d.key === "Escape") {
|
|
440
|
-
|
|
441
|
+
$(null);
|
|
441
442
|
return;
|
|
442
443
|
}
|
|
443
444
|
if (d.key === "ArrowRight") {
|
|
444
|
-
|
|
445
|
+
$((a) => a === null ? a : (a + 1) % l.length);
|
|
445
446
|
return;
|
|
446
447
|
}
|
|
447
|
-
d.key === "ArrowLeft" &&
|
|
448
|
+
d.key === "ArrowLeft" && $((a) => a === null ? a : (a - 1 + l.length) % l.length);
|
|
448
449
|
};
|
|
449
450
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
450
|
-
},
|
|
451
|
-
let
|
|
452
|
-
e[38] !== c || e[39] !==
|
|
451
|
+
}, Ye = [B, l.length], e[34] = B, e[35] = l.length, e[36] = Qe, e[37] = Ye) : (Qe = e[36], Ye = e[37]), Q(Qe, Ye);
|
|
452
|
+
let Ze;
|
|
453
|
+
e[38] !== c || e[39] !== E || e[40] !== N ? (Ze = async (t) => {
|
|
453
454
|
if (c)
|
|
454
455
|
return;
|
|
455
|
-
const
|
|
456
|
-
const
|
|
457
|
-
y.current.set(
|
|
458
|
-
const
|
|
459
|
-
id:
|
|
460
|
-
url:
|
|
461
|
-
previewUrl:
|
|
462
|
-
alt:
|
|
456
|
+
const a = Array.from(t).map((U) => {
|
|
457
|
+
const A = ar(U), i = crypto.randomUUID();
|
|
458
|
+
y.current.set(i, A), M.current.set(i, U);
|
|
459
|
+
const R = {
|
|
460
|
+
id: i,
|
|
461
|
+
url: A,
|
|
462
|
+
previewUrl: A,
|
|
463
|
+
alt: U.name,
|
|
463
464
|
status: "uploading",
|
|
464
465
|
progress: 0,
|
|
465
|
-
fileName:
|
|
466
|
+
fileName: U.name,
|
|
467
|
+
mimeType: U.type
|
|
466
468
|
};
|
|
467
|
-
|
|
469
|
+
z((w) => [...w, R]);
|
|
468
470
|
const f = (w) => {
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
...
|
|
472
|
-
progress:
|
|
471
|
+
const P = Math.max(0, Math.min(99, w));
|
|
472
|
+
z((se) => se.map((D) => D.id === i ? {
|
|
473
|
+
...D,
|
|
474
|
+
progress: P,
|
|
473
475
|
status: "uploading"
|
|
474
|
-
} :
|
|
476
|
+
} : D));
|
|
475
477
|
};
|
|
476
478
|
return (async () => {
|
|
477
479
|
const w = new AbortController();
|
|
478
|
-
|
|
480
|
+
v.current.set(i, w);
|
|
479
481
|
try {
|
|
480
|
-
const
|
|
482
|
+
const P = await E(U, f, {
|
|
481
483
|
signal: w.signal,
|
|
482
|
-
isPublic:
|
|
484
|
+
isPublic: N
|
|
483
485
|
});
|
|
484
|
-
G.current.set(
|
|
485
|
-
const se = y.current.get(
|
|
486
|
+
G.current.set(i, P.id);
|
|
487
|
+
const se = y.current.get(i);
|
|
486
488
|
if (se) {
|
|
487
|
-
y.current.delete(
|
|
489
|
+
y.current.delete(i);
|
|
488
490
|
try {
|
|
489
491
|
URL.revokeObjectURL(se);
|
|
490
492
|
} catch {
|
|
491
493
|
}
|
|
492
494
|
}
|
|
493
|
-
|
|
494
|
-
...
|
|
495
|
-
...
|
|
496
|
-
previewUrl:
|
|
497
|
-
url:
|
|
495
|
+
v.current.delete(i), M.current.delete(i), z((D) => D.map((ce) => ce.id === i ? {
|
|
496
|
+
...ce,
|
|
497
|
+
...P,
|
|
498
|
+
previewUrl: P.url,
|
|
499
|
+
url: P.url,
|
|
498
500
|
status: "uploaded",
|
|
499
501
|
progress: 100,
|
|
500
502
|
errorMessage: void 0
|
|
501
|
-
} :
|
|
502
|
-
} catch (
|
|
503
|
-
const se =
|
|
504
|
-
if (
|
|
505
|
-
|
|
506
|
-
const
|
|
507
|
-
if (
|
|
508
|
-
y.current.delete(
|
|
503
|
+
} : ce));
|
|
504
|
+
} catch (P) {
|
|
505
|
+
const se = P;
|
|
506
|
+
if (v.current.delete(i), w.signal.aborted) {
|
|
507
|
+
M.current.delete(i);
|
|
508
|
+
const ce = y.current.get(i);
|
|
509
|
+
if (ce) {
|
|
510
|
+
y.current.delete(i);
|
|
509
511
|
try {
|
|
510
|
-
URL.revokeObjectURL(
|
|
512
|
+
URL.revokeObjectURL(ce);
|
|
511
513
|
} catch {
|
|
512
514
|
}
|
|
513
515
|
}
|
|
514
516
|
return;
|
|
515
517
|
}
|
|
516
518
|
console.error("Upload failed", se);
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
...
|
|
519
|
+
const D = zt(se);
|
|
520
|
+
z((ce) => ce.map((ht) => ht.id === i ? {
|
|
521
|
+
...ht,
|
|
520
522
|
status: "error",
|
|
521
|
-
progress: Math.max(0, Math.min(99,
|
|
522
|
-
errorMessage:
|
|
523
|
-
} :
|
|
523
|
+
progress: Math.max(0, Math.min(99, ht.progress)),
|
|
524
|
+
errorMessage: D
|
|
525
|
+
} : ht));
|
|
524
526
|
}
|
|
525
527
|
})();
|
|
526
528
|
});
|
|
527
|
-
await Promise.allSettled(
|
|
528
|
-
}, e[38] = c, e[39] =
|
|
529
|
-
const
|
|
530
|
-
let
|
|
531
|
-
e[42] !==
|
|
532
|
-
t.target.files && (
|
|
533
|
-
}, e[42] =
|
|
534
|
-
const
|
|
535
|
-
let
|
|
536
|
-
e[44] !== c ? (
|
|
529
|
+
await Promise.allSettled(a);
|
|
530
|
+
}, e[38] = c, e[39] = E, e[40] = N, e[41] = Ze) : Ze = e[41];
|
|
531
|
+
const je = Ze;
|
|
532
|
+
let et;
|
|
533
|
+
e[42] !== je ? (et = (t) => {
|
|
534
|
+
t.target.files && (je(t.target.files), t.target.value = "");
|
|
535
|
+
}, e[42] = je, e[43] = et) : et = e[43];
|
|
536
|
+
const vt = et;
|
|
537
|
+
let tt;
|
|
538
|
+
e[44] !== c ? (tt = () => {
|
|
537
539
|
c || be.current?.click();
|
|
538
|
-
}, e[44] = c, e[45] =
|
|
539
|
-
const
|
|
540
|
-
let
|
|
541
|
-
e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
542
|
-
const d =
|
|
540
|
+
}, e[44] = c, e[45] = tt) : tt = e[45];
|
|
541
|
+
const De = tt;
|
|
542
|
+
let rt;
|
|
543
|
+
e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (rt = (t) => {
|
|
544
|
+
const d = v.current.get(t);
|
|
543
545
|
if (d) {
|
|
544
|
-
|
|
546
|
+
v.current.delete(t);
|
|
545
547
|
try {
|
|
546
548
|
d.abort();
|
|
547
549
|
} catch {
|
|
548
550
|
}
|
|
549
551
|
}
|
|
550
|
-
|
|
551
|
-
const
|
|
552
|
-
if (
|
|
552
|
+
M.current.delete(t);
|
|
553
|
+
const a = y.current.get(t);
|
|
554
|
+
if (a) {
|
|
553
555
|
y.current.delete(t);
|
|
554
556
|
try {
|
|
555
|
-
URL.revokeObjectURL(
|
|
557
|
+
URL.revokeObjectURL(a);
|
|
556
558
|
} catch {
|
|
557
559
|
}
|
|
558
560
|
}
|
|
559
|
-
|
|
560
|
-
}, e[46] =
|
|
561
|
-
const
|
|
562
|
-
let
|
|
563
|
-
e[47] !== c || e[48] !==
|
|
561
|
+
z((U) => U.filter((A) => A.id !== t));
|
|
562
|
+
}, e[46] = rt) : rt = e[46];
|
|
563
|
+
const Tt = rt;
|
|
564
|
+
let st;
|
|
565
|
+
e[47] !== c || e[48] !== E || e[49] !== N ? (st = (t) => {
|
|
564
566
|
if (c)
|
|
565
567
|
return;
|
|
566
|
-
const d =
|
|
568
|
+
const d = M.current.get(t);
|
|
567
569
|
if (!d)
|
|
568
570
|
return;
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
571
|
+
const a = v.current.get(t);
|
|
572
|
+
if (a) {
|
|
571
573
|
try {
|
|
572
|
-
|
|
574
|
+
a.abort();
|
|
573
575
|
} catch {
|
|
574
576
|
}
|
|
575
|
-
|
|
577
|
+
v.current.delete(t);
|
|
576
578
|
}
|
|
577
|
-
|
|
578
|
-
...
|
|
579
|
+
z((i) => i.map((R) => R.id === t ? {
|
|
580
|
+
...R,
|
|
579
581
|
status: "uploading",
|
|
580
582
|
progress: 0,
|
|
581
583
|
errorMessage: void 0
|
|
582
|
-
} :
|
|
583
|
-
const
|
|
584
|
-
const
|
|
585
|
-
|
|
586
|
-
...
|
|
587
|
-
progress:
|
|
584
|
+
} : R));
|
|
585
|
+
const U = (i) => {
|
|
586
|
+
const R = Math.max(0, Math.min(99, i));
|
|
587
|
+
z((f) => f.map((m) => m.id === t ? {
|
|
588
|
+
...m,
|
|
589
|
+
progress: R,
|
|
588
590
|
status: "uploading"
|
|
589
|
-
} :
|
|
590
|
-
},
|
|
591
|
-
|
|
591
|
+
} : m));
|
|
592
|
+
}, A = new AbortController();
|
|
593
|
+
v.current.set(t, A), (async () => {
|
|
592
594
|
try {
|
|
593
|
-
const
|
|
594
|
-
signal:
|
|
595
|
-
isPublic:
|
|
595
|
+
const i = await E(d, U, {
|
|
596
|
+
signal: A.signal,
|
|
597
|
+
isPublic: N
|
|
596
598
|
});
|
|
597
|
-
G.current.set(t,
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
599
|
+
G.current.set(t, i.id);
|
|
600
|
+
const R = y.current.get(t);
|
|
601
|
+
if (R) {
|
|
600
602
|
y.current.delete(t);
|
|
601
603
|
try {
|
|
602
|
-
URL.revokeObjectURL(
|
|
604
|
+
URL.revokeObjectURL(R);
|
|
603
605
|
} catch {
|
|
604
606
|
}
|
|
605
607
|
}
|
|
606
|
-
|
|
607
|
-
...
|
|
608
|
-
...
|
|
609
|
-
previewUrl:
|
|
610
|
-
url:
|
|
608
|
+
v.current.delete(t), M.current.delete(t), z((f) => f.map((m) => m.id === t ? {
|
|
609
|
+
...m,
|
|
610
|
+
...i,
|
|
611
|
+
previewUrl: i.url,
|
|
612
|
+
url: i.url,
|
|
611
613
|
status: "uploaded",
|
|
612
614
|
progress: 100,
|
|
613
615
|
errorMessage: void 0
|
|
614
|
-
} :
|
|
615
|
-
} catch (
|
|
616
|
-
const
|
|
617
|
-
if (
|
|
616
|
+
} : m));
|
|
617
|
+
} catch (i) {
|
|
618
|
+
const R = i;
|
|
619
|
+
if (v.current.delete(t), A.signal.aborted)
|
|
618
620
|
return;
|
|
619
|
-
console.error("Retry failed",
|
|
620
|
-
const f =
|
|
621
|
-
|
|
621
|
+
console.error("Retry failed", R);
|
|
622
|
+
const f = zt(R);
|
|
623
|
+
z((m) => m.map((w) => w.id === t ? {
|
|
622
624
|
...w,
|
|
623
625
|
status: "error",
|
|
624
626
|
errorMessage: f
|
|
625
627
|
} : w));
|
|
626
628
|
}
|
|
627
629
|
})();
|
|
628
|
-
}, e[47] = c, e[48] =
|
|
629
|
-
const
|
|
630
|
-
let
|
|
631
|
-
e[51] !== l ? (
|
|
632
|
-
const d = l.findIndex((
|
|
633
|
-
d !== -1 &&
|
|
634
|
-
}, e[51] = l, e[52] =
|
|
635
|
-
const yt =
|
|
636
|
-
let
|
|
637
|
-
e[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
630
|
+
}, e[47] = c, e[48] = E, e[49] = N, e[50] = st) : st = e[50];
|
|
631
|
+
const xt = st;
|
|
632
|
+
let nt;
|
|
633
|
+
e[51] !== l ? (nt = (t) => {
|
|
634
|
+
const d = l.findIndex((a) => a.id === t);
|
|
635
|
+
d !== -1 && $(d);
|
|
636
|
+
}, e[51] = l, e[52] = nt) : nt = e[52];
|
|
637
|
+
const yt = nt;
|
|
638
|
+
let lt;
|
|
639
|
+
e[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (lt = (t) => {
|
|
638
640
|
Y(String(t.active.id));
|
|
639
|
-
}, e[53] =
|
|
640
|
-
const
|
|
641
|
-
let
|
|
642
|
-
e[54] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
641
|
+
}, e[53] = lt) : lt = e[53];
|
|
642
|
+
const Ft = lt;
|
|
643
|
+
let ot;
|
|
644
|
+
e[54] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ot = (t) => {
|
|
643
645
|
const {
|
|
644
646
|
active: d,
|
|
645
|
-
over:
|
|
647
|
+
over: a
|
|
646
648
|
} = t;
|
|
647
|
-
if (!
|
|
649
|
+
if (!a) {
|
|
648
650
|
Y(null);
|
|
649
651
|
return;
|
|
650
652
|
}
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
return
|
|
653
|
+
const U = String(d.id), A = String(a.id);
|
|
654
|
+
U !== A && z((i) => {
|
|
655
|
+
const R = i.findIndex((m) => m.id === U), f = i.findIndex((m) => m.id === A);
|
|
656
|
+
return R === -1 || f === -1 ? i : Gt(i, R, f);
|
|
655
657
|
}), Y(null);
|
|
656
|
-
}, e[54] =
|
|
657
|
-
const
|
|
658
|
-
let
|
|
659
|
-
e[55] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
658
|
+
}, e[54] = ot) : ot = e[54];
|
|
659
|
+
const Kt = ot;
|
|
660
|
+
let at;
|
|
661
|
+
e[55] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (at = () => {
|
|
660
662
|
Y(null);
|
|
661
|
-
}, e[55] =
|
|
662
|
-
const
|
|
663
|
-
let
|
|
664
|
-
e[56] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
665
|
-
|
|
666
|
-
}, e[56] =
|
|
667
|
-
const
|
|
663
|
+
}, e[55] = at) : at = e[55];
|
|
664
|
+
const Ht = at;
|
|
665
|
+
let it;
|
|
666
|
+
e[56] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (it = () => {
|
|
667
|
+
Z.current !== null && (window.clearTimeout(Z.current), Z.current = null);
|
|
668
|
+
}, e[56] = it) : it = e[56];
|
|
669
|
+
const Lt = it;
|
|
668
670
|
let wt;
|
|
669
671
|
e: {
|
|
670
|
-
if (
|
|
672
|
+
if (B === null) {
|
|
671
673
|
wt = null;
|
|
672
674
|
break e;
|
|
673
675
|
}
|
|
674
|
-
wt = l[
|
|
676
|
+
wt = l[B] ?? null;
|
|
675
677
|
}
|
|
676
|
-
const
|
|
677
|
-
let
|
|
678
|
-
e[57] !==
|
|
679
|
-
const
|
|
680
|
-
let
|
|
678
|
+
const ke = wt, jt = J === "bare" ? "rounded-lg transition-colors" : "rounded-xl border border-dashed border-slate-300 bg-white/70 p-4 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/60", kt = fe && (J === "bare" ? "bg-primary/5 ring-2 ring-primary/50" : "border-primary ring-2 ring-primary/50"), Nt = c && "opacity-70";
|
|
679
|
+
let ct;
|
|
680
|
+
e[57] !== jt || e[58] !== kt || e[59] !== Nt ? (ct = gt(jt, kt, Nt), e[57] = jt, e[58] = kt, e[59] = Nt, e[60] = ct) : ct = e[60];
|
|
681
|
+
const It = ct;
|
|
682
|
+
let dt;
|
|
681
683
|
e: {
|
|
682
|
-
if (!
|
|
683
|
-
|
|
684
|
+
if (!F) {
|
|
685
|
+
dt = void 0;
|
|
684
686
|
break e;
|
|
685
687
|
}
|
|
686
|
-
if (Array.isArray(
|
|
688
|
+
if (Array.isArray(F)) {
|
|
687
689
|
let t;
|
|
688
|
-
e[
|
|
690
|
+
e[61] !== F ? (t = F.join(","), e[61] = F, e[62] = t) : t = e[62], dt = t;
|
|
689
691
|
break e;
|
|
690
692
|
}
|
|
691
|
-
|
|
693
|
+
dt = F;
|
|
692
694
|
}
|
|
693
|
-
const he =
|
|
695
|
+
const he = dt;
|
|
694
696
|
let ge;
|
|
695
|
-
if (e[
|
|
697
|
+
if (e[63] !== he || e[64] !== k) {
|
|
696
698
|
e: {
|
|
697
|
-
if (
|
|
699
|
+
if (k) {
|
|
698
700
|
ge = !1;
|
|
699
701
|
break e;
|
|
700
702
|
}
|
|
@@ -702,111 +704,117 @@ function Rr(s) {
|
|
|
702
704
|
ge = !1;
|
|
703
705
|
break e;
|
|
704
706
|
}
|
|
705
|
-
const t = he.split(",").map(
|
|
707
|
+
const t = he.split(",").map(mr).filter(Boolean);
|
|
706
708
|
if (!t.length) {
|
|
707
709
|
ge = !1;
|
|
708
710
|
break e;
|
|
709
711
|
}
|
|
710
|
-
ge = t.every(
|
|
712
|
+
ge = t.every(pr);
|
|
711
713
|
}
|
|
712
|
-
e[
|
|
714
|
+
e[63] = he, e[64] = k, e[65] = ge;
|
|
713
715
|
} else
|
|
714
|
-
ge = e[
|
|
715
|
-
const
|
|
716
|
-
let
|
|
717
|
-
e[
|
|
718
|
-
|
|
716
|
+
ge = e[65];
|
|
717
|
+
const St = ge;
|
|
718
|
+
let ut;
|
|
719
|
+
e[66] !== St || e[67] !== k ? (ut = (t) => St || !k && dr(t), e[66] = St, e[67] = k, e[68] = ut) : ut = e[68];
|
|
720
|
+
const re = ut, $t = fr;
|
|
721
|
+
let ft;
|
|
722
|
+
e[69] !== I || e[70] !== re || e[71] !== l || e[72] !== k ? (ft = I ? (() => {
|
|
723
|
+
const t = l.find((d) => d.id === I);
|
|
719
724
|
if (!t)
|
|
720
725
|
return null;
|
|
721
|
-
if (
|
|
722
|
-
const d =
|
|
726
|
+
if (k) {
|
|
727
|
+
const d = k($t(t));
|
|
723
728
|
return d == null || d === !1 ? null : /* @__PURE__ */ n.jsx("div", { className: "pointer-events-none", children: /* @__PURE__ */ n.jsx("div", { className: "h-24 w-24 overflow-hidden rounded-lg shadow-2xl", children: d }) });
|
|
724
729
|
}
|
|
725
|
-
return re ? /* @__PURE__ */ n.jsx("div", { className: "pointer-events-none", children: /* @__PURE__ */ n.jsx(
|
|
726
|
-
})() : null, e[
|
|
727
|
-
const
|
|
728
|
-
let
|
|
729
|
-
e[
|
|
730
|
+
return re(t) ? /* @__PURE__ */ n.jsx("div", { className: "pointer-events-none", children: /* @__PURE__ */ n.jsx(bt, { src: t.previewUrl, alt: t.alt ?? "Dragged image", sizes: "96px", className: "h-24 w-24 rounded-lg object-cover shadow-2xl" }) }) : null;
|
|
731
|
+
})() : null, e[69] = I, e[70] = re, e[71] = l, e[72] = k, e[73] = ft) : ft = e[73];
|
|
732
|
+
const Te = ft, Ut = Te != null;
|
|
733
|
+
let Ne;
|
|
734
|
+
e[74] !== c ? (Ne = (t) => {
|
|
730
735
|
t.preventDefault(), c || ve(!0);
|
|
731
|
-
}, e[
|
|
732
|
-
let
|
|
733
|
-
e[
|
|
734
|
-
let
|
|
735
|
-
e[
|
|
736
|
-
t.preventDefault(), ve(!1), t.dataTransfer.files?.length &&
|
|
737
|
-
}, e[
|
|
736
|
+
}, e[74] = c, e[75] = Ne) : Ne = e[75];
|
|
737
|
+
let pt;
|
|
738
|
+
e[76] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (pt = () => ve(!1), e[76] = pt) : pt = e[76];
|
|
739
|
+
let Ie;
|
|
740
|
+
e[77] !== je ? (Ie = (t) => {
|
|
741
|
+
t.preventDefault(), ve(!1), t.dataTransfer.files?.length && je(t.dataTransfer.files);
|
|
742
|
+
}, e[77] = je, e[78] = Ie) : Ie = e[78];
|
|
738
743
|
let Se;
|
|
739
|
-
e[
|
|
740
|
-
const
|
|
744
|
+
e[79] !== O ? (Se = O ? /* @__PURE__ */ n.jsx("div", { className: "mb-3", children: O() }) : null, e[79] = O, e[80] = Se) : Se = e[80];
|
|
745
|
+
const Rt = c ? void 0 : ie;
|
|
741
746
|
let Ue;
|
|
742
|
-
e[
|
|
743
|
-
let
|
|
744
|
-
e[
|
|
745
|
-
const d = t.status === "uploading",
|
|
746
|
-
return /* @__PURE__ */ n.jsx(
|
|
747
|
-
|
|
747
|
+
e[81] !== l ? (Ue = l.map(ur), e[81] = l, e[82] = Ue) : Ue = e[82];
|
|
748
|
+
let Re;
|
|
749
|
+
e[83] !== I || e[84] !== re || e[85] !== c || e[86] !== Ut || e[87] !== ne || e[88] !== l || e[89] !== de || e[90] !== k || e[91] !== xt || e[92] !== yt ? (Re = l.map((t) => {
|
|
750
|
+
const d = t.status === "uploading", a = t.status === "error";
|
|
751
|
+
return /* @__PURE__ */ n.jsx(or, { item: t, isHovered: ne === t.id, enableImagePreview: re(t), renderItem: k, onHoverEnter: () => {
|
|
752
|
+
Lt(), pe(t.id);
|
|
748
753
|
}, onHoverLeave: () => {
|
|
749
|
-
|
|
750
|
-
pe((
|
|
754
|
+
Lt(), Z.current = window.setTimeout(() => {
|
|
755
|
+
pe((U) => U === t.id ? null : U), Z.current = null;
|
|
751
756
|
}, 120);
|
|
752
|
-
}, onRemove:
|
|
753
|
-
}), e[
|
|
754
|
-
let ut;
|
|
755
|
-
e[90] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ut = mt("group relative size-20 overflow-visible rounded-lg border border-slate-200 bg-slate-50 shadow-inner transition hover:shadow md:size-24 dark:border-slate-700 dark:bg-slate-800", "flex items-center justify-center border-dashed bg-white text-slate-500 hover:border-slate-300 dark:bg-slate-900"), e[90] = ut) : ut = e[90];
|
|
756
|
-
let dt;
|
|
757
|
-
e[91] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (dt = /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
|
|
758
|
-
/* @__PURE__ */ n.jsx("div", { className: "flex size-9 items-center justify-center rounded-full border border-slate-300 bg-slate-100 text-slate-600 shadow-inner dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200", children: /* @__PURE__ */ n.jsx(Yt, { className: "h-5 w-5" }) }),
|
|
759
|
-
/* @__PURE__ */ n.jsx("span", { className: "text-xs font-medium", children: "Ajouter" })
|
|
760
|
-
] }), e[91] = dt) : dt = e[91];
|
|
761
|
-
let Ie;
|
|
762
|
-
e[92] !== z || e[93] !== c || e[94] !== bt ? (Ie = /* @__PURE__ */ n.jsx("button", { type: "button", onClick: bt, disabled: c, className: ut, "aria-label": z, children: dt }), e[92] = z, e[93] = c, e[94] = bt, e[95] = Ie) : Ie = e[95];
|
|
763
|
-
let Re;
|
|
764
|
-
e[96] !== Ne || e[97] !== Ie ? (Re = /* @__PURE__ */ n.jsxs("div", { className: "flex flex-wrap gap-3", children: [
|
|
765
|
-
Ne,
|
|
766
|
-
Ie
|
|
767
|
-
] }), e[96] = Ne, e[97] = Ie, e[98] = Re) : Re = e[98];
|
|
757
|
+
}, onRemove: Tt, onRetry: xt, startFullscreen: yt, isUploading: d, isError: a, tileClasses: "group relative size-20 overflow-visible rounded-lg border border-slate-200 bg-slate-50 shadow-inner transition hover:shadow md:size-24 dark:border-slate-700 dark:bg-slate-800", disabled: c, isDraggingExternal: Ut && I === t.id, removeButtonAriaLabel: de }, t.id);
|
|
758
|
+
}), e[83] = I, e[84] = re, e[85] = c, e[86] = Ut, e[87] = ne, e[88] = l, e[89] = de, e[90] = k, e[91] = xt, e[92] = yt, e[93] = Re) : Re = e[93];
|
|
768
759
|
let Ce;
|
|
769
|
-
e[
|
|
770
|
-
|
|
760
|
+
e[94] !== b || e[95] !== c || e[96] !== l.length || e[97] !== De || e[98] !== J ? (Ce = J === "bare" && l.length === 0 ? /* @__PURE__ */ n.jsxs("button", { type: "button", onClick: De, disabled: c, className: "flex w-full flex-col items-center justify-center gap-1 rounded-lg border border-dashed border-slate-300 px-4 py-6 text-slate-500 transition-colors hover:border-slate-400 hover:bg-slate-50 hover:text-slate-600 dark:border-slate-700 dark:hover:bg-slate-800/50", "aria-label": b, children: [
|
|
761
|
+
/* @__PURE__ */ n.jsx(Ct, { className: "h-5 w-5" }),
|
|
762
|
+
/* @__PURE__ */ n.jsx("span", { className: "text-xs font-medium", children: b }),
|
|
763
|
+
/* @__PURE__ */ n.jsx("span", { className: "text-[11px] text-slate-400 dark:text-slate-500", children: "ou glissez-déposez ici" })
|
|
764
|
+
] }) : J === "bare" ? /* @__PURE__ */ n.jsx("button", { type: "button", onClick: De, disabled: c, className: "flex size-20 items-center justify-center rounded-lg border border-dashed border-slate-300 text-slate-400 transition-colors hover:border-slate-400 hover:bg-slate-50 hover:text-slate-600 md:size-24 dark:border-slate-700 dark:hover:bg-slate-800/50 dark:hover:text-slate-300", "aria-label": b, children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
|
|
765
|
+
/* @__PURE__ */ n.jsx(Ct, { className: "h-4 w-4" }),
|
|
766
|
+
/* @__PURE__ */ n.jsx("span", { className: "text-[11px] font-medium", children: "Ajouter" })
|
|
767
|
+
] }) }) : /* @__PURE__ */ n.jsx("button", { type: "button", onClick: De, disabled: c, className: gt("group relative size-20 overflow-visible rounded-lg border border-slate-200 bg-slate-50 shadow-inner transition hover:shadow md:size-24 dark:border-slate-700 dark:bg-slate-800", "flex items-center justify-center border-dashed bg-white text-slate-500 hover:border-slate-300 dark:bg-slate-900"), "aria-label": b, children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
|
|
768
|
+
/* @__PURE__ */ n.jsx("div", { className: "flex size-9 items-center justify-center rounded-full border border-slate-300 bg-slate-100 text-slate-600 shadow-inner dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200", children: /* @__PURE__ */ n.jsx(Ct, { className: "h-5 w-5" }) }),
|
|
769
|
+
/* @__PURE__ */ n.jsx("span", { className: "text-xs font-medium", children: "Ajouter" })
|
|
770
|
+
] }) }), e[94] = b, e[95] = c, e[96] = l.length, e[97] = De, e[98] = J, e[99] = Ce) : Ce = e[99];
|
|
771
|
+
let Le;
|
|
772
|
+
e[100] !== Re || e[101] !== Ce ? (Le = /* @__PURE__ */ n.jsxs("div", { className: "flex flex-wrap gap-3", children: [
|
|
773
|
+
Re,
|
|
774
|
+
Ce
|
|
775
|
+
] }), e[100] = Re, e[101] = Ce, e[102] = Le) : Le = e[102];
|
|
776
|
+
let Ee;
|
|
777
|
+
e[103] !== Ue || e[104] !== Le ? (Ee = /* @__PURE__ */ n.jsx(Qt, { items: Ue, strategy: Yt, children: Le }), e[103] = Ue, e[104] = Le, e[105] = Ee) : Ee = e[105];
|
|
778
|
+
let Fe;
|
|
771
779
|
e: {
|
|
772
780
|
let t;
|
|
773
|
-
e[
|
|
781
|
+
e[106] !== Te ? (t = /* @__PURE__ */ n.jsx(Wt, { children: Te }), e[106] = Te, e[107] = t) : t = e[107];
|
|
774
782
|
const d = t;
|
|
775
783
|
if (typeof document > "u") {
|
|
776
|
-
|
|
784
|
+
Fe = d;
|
|
777
785
|
break e;
|
|
778
786
|
}
|
|
779
|
-
let
|
|
780
|
-
e[
|
|
787
|
+
let a;
|
|
788
|
+
e[108] !== d ? (a = Pt(d, document.body), e[108] = d, e[109] = a) : a = e[109], Fe = a;
|
|
781
789
|
}
|
|
782
|
-
let Le;
|
|
783
|
-
e[106] !== Ut || e[107] !== Ce || e[108] !== Ke ? (Le = /* @__PURE__ */ n.jsxs($t, { sensors: Ut, collisionDetection: Bt, onDragStart: At, onDragEnd: Pt, onDragCancel: Dt, children: [
|
|
784
|
-
Ce,
|
|
785
|
-
Ke
|
|
786
|
-
] }), e[106] = Ut, e[107] = Ce, e[108] = Ke, e[109] = Le) : Le = e[109];
|
|
787
|
-
let Ee;
|
|
788
|
-
e[110] !== he || e[111] !== gt ? (Ee = /* @__PURE__ */ n.jsx("input", { ref: be, type: "file", accept: he, multiple: !0, className: "hidden", onChange: gt, "aria-hidden": !0 }), e[110] = he, e[111] = gt, e[112] = Ee) : Ee = e[112];
|
|
789
790
|
let Me;
|
|
790
|
-
e[
|
|
791
|
-
|
|
791
|
+
e[110] !== Rt || e[111] !== Ee || e[112] !== Fe ? (Me = /* @__PURE__ */ n.jsxs(Xt, { sensors: Rt, collisionDetection: _t, onDragStart: Ft, onDragEnd: Kt, onDragCancel: Ht, children: [
|
|
792
|
+
Ee,
|
|
793
|
+
Fe
|
|
794
|
+
] }), e[110] = Rt, e[111] = Ee, e[112] = Fe, e[113] = Me) : Me = e[113];
|
|
795
|
+
let ze;
|
|
796
|
+
e[114] !== he || e[115] !== vt ? (ze = /* @__PURE__ */ n.jsx("input", { ref: be, type: "file", accept: he, multiple: !0, className: "hidden", onChange: vt, "aria-hidden": !0 }), e[114] = he, e[115] = vt, e[116] = ze) : ze = e[116];
|
|
797
|
+
let Ae;
|
|
798
|
+
e[117] !== re || e[118] !== ke || e[119] !== l.length ? (Ae = ke && re(ke) && /* @__PURE__ */ n.jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/90", children: [
|
|
799
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", className: "absolute left-6 top-1/2 -translate-y-1/2 rounded-full bg-white/10 p-3 text-white shadow-lg transition hover:bg-white/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", onClick: () => $((t) => t === null ? t : (t - 1 + l.length) % l.length), "aria-label": "Précédent", children: /* @__PURE__ */ n.jsx("svg", { viewBox: "0 0 24 24", className: "h-6 w-6", stroke: "currentColor", strokeWidth: 2, fill: "none", children: /* @__PURE__ */ n.jsx("path", { d: "M15 18l-6-6 6-6", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
792
800
|
/* @__PURE__ */ n.jsxs("div", { className: "relative max-h-[80vh] max-w-4xl", children: [
|
|
793
|
-
/* @__PURE__ */ n.jsx(
|
|
794
|
-
/* @__PURE__ */ n.jsx("button", { type: "button", className: "absolute right-3 top-3 inline-flex size-9 items-center justify-center rounded-full bg-black/70 text-white transition hover:bg-black focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", onClick: () =>
|
|
801
|
+
/* @__PURE__ */ n.jsx(bt, { src: ke.url, alt: ke.alt ?? "Fullscreen", sizes: "(max-width: 1024px) 100vw, 1024px", className: "max-h-[80vh] max-w-full rounded-lg object-contain shadow-2xl" }),
|
|
802
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", className: "absolute right-3 top-3 inline-flex size-9 items-center justify-center rounded-full bg-black/70 text-white transition hover:bg-black focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", onClick: () => $(null), "aria-label": "Fermer", children: /* @__PURE__ */ n.jsx(Dt, { className: "h-5 w-5" }) })
|
|
795
803
|
] }),
|
|
796
|
-
/* @__PURE__ */ n.jsx("button", { type: "button", className: "absolute right-6 top-1/2 -translate-y-1/2 rounded-full bg-white/10 p-3 text-white shadow-lg transition hover:bg-white/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", onClick: () =>
|
|
797
|
-
] }), e[
|
|
798
|
-
let
|
|
799
|
-
return e[
|
|
804
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", className: "absolute right-6 top-1/2 -translate-y-1/2 rounded-full bg-white/10 p-3 text-white shadow-lg transition hover:bg-white/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white", onClick: () => $((t) => t === null ? t : (t + 1) % l.length), "aria-label": "Suivant", children: /* @__PURE__ */ n.jsx("svg", { viewBox: "0 0 24 24", className: "h-6 w-6", stroke: "currentColor", strokeWidth: 2, fill: "none", children: /* @__PURE__ */ n.jsx("path", { d: "M9 6l6 6-6 6", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
|
|
805
|
+
] }), e[117] = re, e[118] = ke, e[119] = l.length, e[120] = Ae) : Ae = e[120];
|
|
806
|
+
let mt;
|
|
807
|
+
return e[121] !== It || e[122] !== Ne || e[123] !== Ie || e[124] !== Se || e[125] !== Me || e[126] !== ze || e[127] !== Ae ? (mt = /* @__PURE__ */ n.jsxs("div", { onDragOver: Ne, onDragLeave: pt, onDrop: Ie, className: It, children: [
|
|
800
808
|
Se,
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
] }), e[
|
|
809
|
+
Me,
|
|
810
|
+
ze,
|
|
811
|
+
Ae
|
|
812
|
+
] }), e[121] = It, e[122] = Ne, e[123] = Ie, e[124] = Se, e[125] = Me, e[126] = ze, e[127] = Ae, e[128] = mt) : mt = e[128], mt;
|
|
805
813
|
}
|
|
806
|
-
function
|
|
814
|
+
function ur(s) {
|
|
807
815
|
return s.id;
|
|
808
816
|
}
|
|
809
|
-
function
|
|
817
|
+
function fr(s) {
|
|
810
818
|
return {
|
|
811
819
|
file: {
|
|
812
820
|
id: s.id,
|
|
@@ -820,39 +828,39 @@ function ar(s) {
|
|
|
820
828
|
fileName: s.fileName
|
|
821
829
|
};
|
|
822
830
|
}
|
|
823
|
-
function
|
|
831
|
+
function pr(s) {
|
|
824
832
|
return s === "image/*" || s.startsWith("image/") || s === ".heic" || s === ".heif" || s === ".heics" || s === ".heifs";
|
|
825
833
|
}
|
|
826
|
-
function
|
|
834
|
+
function mr(s) {
|
|
827
835
|
return s.trim();
|
|
828
836
|
}
|
|
829
|
-
function
|
|
837
|
+
function hr(s) {
|
|
830
838
|
return s.status === "uploading";
|
|
831
839
|
}
|
|
832
|
-
function
|
|
840
|
+
function gr(s) {
|
|
833
841
|
const {
|
|
834
842
|
id: e,
|
|
835
843
|
url: r,
|
|
836
844
|
alt: o,
|
|
837
|
-
uploadKey:
|
|
845
|
+
uploadKey: h
|
|
838
846
|
} = s;
|
|
839
847
|
return {
|
|
840
848
|
id: e,
|
|
841
849
|
url: r,
|
|
842
850
|
alt: o,
|
|
843
|
-
uploadKey:
|
|
851
|
+
uploadKey: h
|
|
844
852
|
};
|
|
845
853
|
}
|
|
846
|
-
function
|
|
854
|
+
function br(s) {
|
|
847
855
|
return s.id;
|
|
848
856
|
}
|
|
849
|
-
function
|
|
857
|
+
function vr(s) {
|
|
850
858
|
return s.id;
|
|
851
859
|
}
|
|
852
|
-
function
|
|
860
|
+
function xr(s) {
|
|
853
861
|
return s.id;
|
|
854
862
|
}
|
|
855
|
-
function
|
|
863
|
+
function yr(s) {
|
|
856
864
|
return {
|
|
857
865
|
...s,
|
|
858
866
|
previewUrl: s.url,
|
|
@@ -860,10 +868,10 @@ function hr(s) {
|
|
|
860
868
|
progress: 100
|
|
861
869
|
};
|
|
862
870
|
}
|
|
863
|
-
function
|
|
871
|
+
function wr() {
|
|
864
872
|
document.body.style.cursor = "";
|
|
865
873
|
}
|
|
866
|
-
function
|
|
874
|
+
function jr(s) {
|
|
867
875
|
return {
|
|
868
876
|
...s,
|
|
869
877
|
previewUrl: s.url,
|
|
@@ -872,6 +880,6 @@ function br(s) {
|
|
|
872
880
|
};
|
|
873
881
|
}
|
|
874
882
|
export {
|
|
875
|
-
|
|
883
|
+
zr as FilesUploadField
|
|
876
884
|
};
|
|
877
885
|
//# sourceMappingURL=index8.js.map
|