@burdenoff/microfe-files 2026.626.1 → 2026.713.1

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.
@@ -6,42 +6,42 @@ import { useRecentFiles as i } from "../hooks/useRecentFiles.js";
6
6
  import { useStarredItems as ee } from "../hooks/useStarredItems.js";
7
7
  import { useBinItems as te } from "../hooks/useBinItems.js";
8
8
  import { useCreateFolder as ne } from "../hooks/useCreateFolder.js";
9
- import { useUploadFile as re } from "../hooks/useUploadFile.js";
10
- import { useDeleteFile as ie } from "../hooks/useDeleteFile.js";
11
- import { useDeleteFolder as ae } from "../hooks/useDeleteFolder.js";
12
- import { useRestoreFile as oe } from "../hooks/useRestoreFile.js";
13
- import { useRestoreFolder as se } from "../hooks/useRestoreFolder.js";
14
- import { usePermanentlyDeleteFile as ce } from "../hooks/usePermanentlyDeleteFile.js";
15
- import { usePermanentlyDeleteFolder as le } from "../hooks/usePermanentlyDeleteFolder.js";
16
- import { useToggleStar as ue } from "../hooks/useToggleStar.js";
17
- import { useRenameFile as de } from "../hooks/useRenameFile.js";
18
- import { useRenameFolder as fe } from "../hooks/useRenameFolder.js";
19
- import { useCreateShare as pe } from "../hooks/useCreateShare.js";
20
- import { useCreateFolderShare as me } from "../hooks/useCreateFolderShare.js";
21
- import { useCopyFile as he } from "../hooks/useCopyFile.js";
22
- import { useMoveFile as ge } from "../hooks/useMoveFile.js";
23
- import { useMoveFolder as _e } from "../hooks/useMoveFolder.js";
24
- import { useBulkDelete as ve } from "../hooks/useBatchOperations.js";
25
- import { useSearch as ye } from "../hooks/useSearch.js";
26
- import { useToast as be } from "../hooks/useToast.js";
27
- import { generateThumbnail as xe } from "../utils/thumbnail.js";
9
+ import { isQuotaExhaustedError as re } from "../utils/quotaUtils.js";
10
+ import { useUploadFile as ie } from "../hooks/useUploadFile.js";
11
+ import { useDeleteFile as ae } from "../hooks/useDeleteFile.js";
12
+ import { useDeleteFolder as oe } from "../hooks/useDeleteFolder.js";
13
+ import { useRestoreFile as se } from "../hooks/useRestoreFile.js";
14
+ import { useRestoreFolder as ce } from "../hooks/useRestoreFolder.js";
15
+ import { usePermanentlyDeleteFile as le } from "../hooks/usePermanentlyDeleteFile.js";
16
+ import { usePermanentlyDeleteFolder as ue } from "../hooks/usePermanentlyDeleteFolder.js";
17
+ import { useToggleStar as de } from "../hooks/useToggleStar.js";
18
+ import { useRenameFile as fe } from "../hooks/useRenameFile.js";
19
+ import { useRenameFolder as pe } from "../hooks/useRenameFolder.js";
20
+ import { useCreateShare as me } from "../hooks/useCreateShare.js";
21
+ import { useCreateFolderShare as he } from "../hooks/useCreateFolderShare.js";
22
+ import { useCopyFile as ge } from "../hooks/useCopyFile.js";
23
+ import { useMoveFile as _e } from "../hooks/useMoveFile.js";
24
+ import { useMoveFolder as ve } from "../hooks/useMoveFolder.js";
25
+ import { useBulkDelete as ye } from "../hooks/useBatchOperations.js";
26
+ import { useSearch as be } from "../hooks/useSearch.js";
27
+ import { useToast as xe } from "../hooks/useToast.js";
28
+ import { generateThumbnail as Se } from "../utils/thumbnail.js";
28
29
  import "../utils/index.js";
29
30
  import { tWithFallback as a } from "../utils/i18n.js";
30
- import { FileBrowser as Se } from "../components/FileBrowser.js";
31
- import { TabBar as Ce } from "../components/TabBar.js";
32
- import { ShareDialog as we } from "../components/ShareDialog.js";
33
- import { FilePreviewModal as Te } from "../components/FilePreviewModal.js";
34
- import { FileInfoPanel as Ee } from "../components/FileInfoPanel.js";
35
- import { EmptyState as De } from "../components/EmptyState.js";
36
- import { ToastContainer as Oe } from "../components/Toast.js";
37
- import { SearchBar as ke } from "../components/SearchBar.js";
38
- import { MoveDialog as Ae } from "../components/MoveDialog.js";
39
- import { CopyDialog as je } from "../components/CopyDialog.js";
40
- import { ConfirmDialog as Me } from "../components/ConfirmDialog.js";
41
- import { UploadQueue as Ne } from "../components/UploadQueue.js";
42
- import { StorageBanner as Pe } from "../components/StorageBanner.js";
43
- import { useStorageQuota as Fe } from "../hooks/useStorageQuota.js";
44
- import { isQuotaExhaustedError as Ie } from "../utils/quotaUtils.js";
31
+ import { FileBrowser as Ce } from "../components/FileBrowser.js";
32
+ import { TabBar as we } from "../components/TabBar.js";
33
+ import { ShareDialog as Te } from "../components/ShareDialog.js";
34
+ import { FilePreviewModal as Ee } from "../components/FilePreviewModal.js";
35
+ import { FileInfoPanel as De } from "../components/FileInfoPanel.js";
36
+ import { EmptyState as Oe } from "../components/EmptyState.js";
37
+ import { ToastContainer as ke } from "../components/Toast.js";
38
+ import { SearchBar as Ae } from "../components/SearchBar.js";
39
+ import { MoveDialog as je } from "../components/MoveDialog.js";
40
+ import { CopyDialog as Me } from "../components/CopyDialog.js";
41
+ import { ConfirmDialog as Ne } from "../components/ConfirmDialog.js";
42
+ import { UploadQueue as Pe } from "../components/UploadQueue.js";
43
+ import { StorageBanner as Fe } from "../components/StorageBanner.js";
44
+ import { useStorageQuota as Ie } from "../hooks/useStorageQuota.js";
45
45
  import { nativeImpact as Le, nativeNotify as Re, nativeOpenUrl as ze } from "../../utils/nativeBridge.js";
46
46
  import { emitFilesEvent as Be } from "../utils/events.js";
47
47
  import { useEffect as Ve, useMemo as He, useState as o } from "react";
@@ -52,23 +52,23 @@ import { useI18n as nt } from "@burdenoff/fe-libs/shared/providers/shell/I18nPro
52
52
  import { AuroraBackground as rt, Button as u, CTAOverflowMenu as it, EmphasisPanel as at, GradientText as ot, IllustratedEmptyState as st, Input as ct, NextSteps as lt, PagePurpose as ut, ResponsiveDialog as dt, ResponsiveDialogContent as ft, ResponsiveDialogFooter as pt, ResponsiveDialogHeader as mt, ResponsiveDialogTitle as ht } from "@burdenoff/fe-libs/ui";
53
53
  //#region src/files/pages/BrowserPage.tsx
54
54
  function d() {
55
- let { t: d } = nt(), { folderId: f } = tt(), gt = et(), _t = e(), { workspaceId: p } = _t, vt = Fe(p ?? ""), { viewMode: yt, setViewMode: bt, breadcrumbs: xt, selectedFiles: St, selectedFolders: m, clearSelection: h } = t(), [g, _] = o("all"), Ct = He(() => [
55
+ let { t: d } = nt(), { folderId: f } = tt(), p = et(), gt = e(), { workspaceId: m } = gt, _t = Ie(m ?? ""), { viewMode: vt, setViewMode: yt, breadcrumbs: bt, selectedFiles: h, selectedFolders: g, clearSelection: _ } = t(), [v, y] = o("all"), xt = He(() => [
56
56
  "all",
57
57
  "recent",
58
58
  "starred",
59
59
  "bin"
60
60
  ], []);
61
61
  Ve(() => {
62
- Ct.includes(g) || _("all");
63
- }, [Ct, g]);
64
- let [v, wt] = o(""), [Tt, Et] = o(), y = v.trim().length >= 2, [Dt, Ot] = o(null), [b, kt] = o(null), x = be(), S = r({
62
+ xt.includes(v) || y("all");
63
+ }, [xt, v]);
64
+ let [b, St] = o(""), [Ct, wt] = o(), x = b.trim().length >= 2, [Tt, Et] = o(null), [S, Dt] = o(null), C = xe(), w = r({
65
65
  folderId: f || void 0,
66
66
  pageSize: 100,
67
- skip: g !== "all" || y
68
- }), At = i({ skip: g !== "recent" || y }), jt = ee({ skip: g !== "starred" || y }), C = te({ skip: g !== "bin" || y }), w = ye(v, y, Tt);
67
+ skip: v !== "all" || x
68
+ }), T = i({ skip: v !== "recent" || x }), E = ee({ skip: v !== "starred" || x }), D = te({ skip: v !== "bin" || x }), O = be(b, x, Ct);
69
69
  Ve(() => {
70
- if (f && S.data?.folderPath && S.data?.currentFolder) {
71
- let e = S.data.folderPath.folders || [], n = S.data.currentFolder, r = [...e.map((e) => ({
70
+ if (f && w.data?.folderPath && w.data?.currentFolder) {
71
+ let e = w.data.folderPath.folders || [], n = w.data.currentFolder, r = [...e.map((e) => ({
72
72
  id: e.id,
73
73
  name: e.name
74
74
  })), {
@@ -77,26 +77,26 @@ function d() {
77
77
  }];
78
78
  t.getState().setBreadcrumbs(r);
79
79
  } else t.getState().setBreadcrumbs([]);
80
- }, [f, S.data]);
81
- let T = [], E = [], D = !1, O = null, k = !1;
82
- if (y && w.data) T = w.data.files || [], E = w.data.folders || [], D = w.isLoading, O = w.error;
83
- else switch (g) {
80
+ }, [f, w.data]);
81
+ let k = [], A = [], j = !1, M = null, N = !1;
82
+ if (x && O.data) k = O.data.files || [], A = O.data.folders || [], j = O.isLoading, M = O.error;
83
+ else switch (v) {
84
84
  case "all":
85
- T = S.data?.filesList?.files || [], E = S.data?.foldersList?.folders || [], D = S.loading, O = S.error || null, k = !1;
85
+ k = w.data?.filesList?.files || [], A = w.data?.foldersList?.folders || [], j = w.loading, M = w.error || null, N = !1;
86
86
  break;
87
87
  case "recent":
88
- T = At.files || [], E = At.folders || [], D = At.isLoading, O = At.error || null, k = !0;
88
+ k = T.files || [], A = T.folders || [], j = T.isLoading, M = T.error || null, N = !0;
89
89
  break;
90
90
  case "starred":
91
- T = jt.files, E = jt.folders, D = jt.isLoading, O = jt.error || null, k = !0;
91
+ k = E.files, A = E.folders, j = E.isLoading, M = E.error || null, N = !0;
92
92
  break;
93
93
  case "bin":
94
- T = C.files, E = C.folders, D = C.isLoading, O = C.error || null, k = !0;
94
+ k = D.files, A = D.folders, j = D.isLoading, M = D.error || null, N = !0;
95
95
  break;
96
96
  }
97
- let Mt = g === "all" ? (S.data?.filesList?.total ?? T.length) + (S.data?.foldersList?.total ?? E.length) : null, A = St.size + m.size, [Nt, j] = o(!1), [Pt, Ft] = o(!1), [It, M] = o(!1), [Lt, Rt] = o(!1), [zt, N] = o(!1), [Bt, Vt] = o(!1), [Ht, P] = o(null), [F, I] = o(null), [L, Ut] = o(null), [R, z] = o(null), [B, V] = o(""), [H, U] = o(""), [W, G] = o(!1), [Wt, K] = o([]), [Gt, q] = o(!1), [J, Y] = o(null), X = (e, t) => {
98
- Be(_t, e, t);
99
- }, Kt = async () => {
97
+ let Ot = v === "all" ? (w.data?.filesList?.total ?? k.length) + (w.data?.foldersList?.total ?? A.length) : null, P = h.size + g.size, [kt, F] = o(!1), [At, jt] = o(!1), [Mt, Nt] = o(!1), [Pt, I] = o(!1), [Ft, L] = o(!1), [It, Lt] = o(!1), [Rt, zt] = o(!1), [Bt, Vt] = o(null), [R, Ht] = o(null), [z, Ut] = o(null), [B, V] = o(null), [H, U] = o(""), [W, G] = o(""), [Wt, K] = o(!1), [Gt, q] = o([]), [Kt, qt] = o(!1), [J, Y] = o(null), X = (e, t) => {
98
+ Be(gt, e, t);
99
+ }, Jt = async () => {
100
100
  if (!J || J.loading) return;
101
101
  let e = J.onConfirm;
102
102
  Y({
@@ -114,13 +114,13 @@ function d() {
114
114
  loading: !1
115
115
  });
116
116
  }
117
- }, Z = ne(), qt = re(), Jt = ie(), Yt = ae(), Xt = oe(), Zt = se(), Qt = ce(), $t = le(), en = ue(), Q = de(), $ = fe(), tn = pe(), nn = me(), rn = he(), an = ge(), on = _e(), sn = ve(), cn = () => {
117
+ }, Z = ne(), Yt = ie(), Xt = ae(), Zt = oe(), Qt = se(), $t = ce(), en = le(), tn = ue(), nn = de(), Q = fe(), $ = pe(), rn = me(), an = he(), on = ge(), sn = _e(), cn = ve(), ln = ye(), un = () => {
118
118
  let e = document.createElement("input");
119
119
  e.type = "file", e.multiple = !0, e.onchange = async (e) => {
120
120
  let t = e.target.files;
121
121
  if (t && t.length > 0) {
122
122
  let e = await Promise.all(Array.from(t).map(async (e, t) => {
123
- let n = await xe(e);
123
+ let n = await Se(e);
124
124
  return {
125
125
  id: `${Date.now()}-${t}-${e.name}`,
126
126
  file: e,
@@ -130,21 +130,21 @@ function d() {
130
130
  thumbnailUrl: n ?? void 0
131
131
  };
132
132
  }));
133
- K((t) => [...t, ...e]), q(!0), G(!0);
134
- for (let t of e) await ln(t);
135
- G(!1);
133
+ q((t) => [...t, ...e]), qt(!0), K(!0);
134
+ for (let t of e) await dn(t);
135
+ K(!1);
136
136
  }
137
137
  }, e.click();
138
- }, ln = async (e) => {
138
+ }, dn = async (e) => {
139
139
  let t = (t) => {
140
- K((n) => n.map((n) => n.id === e.id ? {
140
+ q((n) => n.map((n) => n.id === e.id ? {
141
141
  ...n,
142
142
  ...t
143
143
  } : n));
144
144
  };
145
145
  t({ status: "uploading" });
146
146
  try {
147
- let n = await qt.mutateAsync({
147
+ let n = await Yt.mutateAsync({
148
148
  file: e.file,
149
149
  folderId: e.folderId,
150
150
  onProgress: (e) => {
@@ -161,10 +161,10 @@ function d() {
161
161
  });
162
162
  } catch (n) {
163
163
  let r = n instanceof Error ? n.message : a(d, "files.upload.errors.failed", "Upload failed");
164
- r === "Upload paused" ? t({ status: "paused" }) : r === "QUOTA_EXHAUSTED" ? (t({
164
+ r === "Upload paused" ? t({ status: "paused" }) : re(n) ? (t({
165
165
  status: "failed",
166
166
  error: a(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded")
167
- }), x.error(a(d, "files.upload.errors.quotaExceeded", "Storage quota exceeded. Please upgrade your plan or delete files."))) : (t({
167
+ }), Nt(!0)) : (t({
168
168
  status: "failed",
169
169
  error: r
170
170
  }), X("files.api.failed", {
@@ -173,30 +173,30 @@ function d() {
173
173
  message: r
174
174
  }));
175
175
  }
176
- }, un = (e) => {
177
- qt.pause(), K((t) => t.map((t) => t.id === e ? {
176
+ }, fn = (e) => {
177
+ Yt.pause(), q((t) => t.map((t) => t.id === e ? {
178
178
  ...t,
179
179
  status: "paused"
180
180
  } : t));
181
- }, dn = (e) => {
182
- let t = Wt.find((t) => t.id === e);
183
- t && ln(t);
184
- }, fn = (e) => {
185
- let t = Wt.find((t) => t.id === e);
186
- t && (K((t) => t.map((t) => t.id === e ? {
181
+ }, pn = (e) => {
182
+ let t = Gt.find((t) => t.id === e);
183
+ t && dn(t);
184
+ }, mn = (e) => {
185
+ let t = Gt.find((t) => t.id === e);
186
+ t && (q((t) => t.map((t) => t.id === e ? {
187
187
  ...t,
188
188
  status: "pending",
189
189
  progress: 0,
190
190
  error: void 0
191
- } : t)), ln(t));
192
- }, pn = (e) => {
193
- K((t) => {
191
+ } : t)), dn(t));
192
+ }, hn = (e) => {
193
+ q((t) => {
194
194
  let n = t.filter((t) => t.id !== e);
195
- return n.length === 0 && (q(!1), G(!1)), n;
195
+ return n.length === 0 && (qt(!1), K(!1)), n;
196
196
  });
197
- }, mn = () => {
198
- if (!p) {
199
- x.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
197
+ }, gn = () => {
198
+ if (!m) {
199
+ C.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
200
200
  return;
201
201
  }
202
202
  let e = document.createElement("input");
@@ -225,7 +225,7 @@ function d() {
225
225
  for (let [t, r] of e) {
226
226
  let e = t ? n.get(t) : f || void 0;
227
227
  for (let t of r) {
228
- let n = await xe(t);
228
+ let n = await Se(t);
229
229
  i.push({
230
230
  id: `${Date.now()}-${ee++}-${t.name}`,
231
231
  file: t,
@@ -236,41 +236,41 @@ function d() {
236
236
  });
237
237
  }
238
238
  }
239
- K((e) => [...e, ...i]), q(!0), G(!0);
240
- for (let e of i) await ln(e);
241
- G(!1), x.success(a(d, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
239
+ q((e) => [...e, ...i]), qt(!0), K(!0);
240
+ for (let e of i) await dn(e);
241
+ K(!1), C.success(a(d, "files.upload.folder.success", "Uploaded {{count}} file{{plural}} from folder", {
242
242
  count: i.length,
243
243
  plural: i.length > 1 ? "s" : ""
244
244
  }));
245
245
  }
246
246
  }, e.click();
247
- }, hn = () => {
248
- j(!0);
249
- }, gn = async () => {
250
- if (H.trim() && p) {
247
+ }, _n = () => {
248
+ F(!0);
249
+ }, vn = async () => {
250
+ if (W.trim() && m) {
251
251
  let { data: e, error: t } = await Z.mutateAsync({
252
- name: H,
252
+ name: W,
253
253
  parentFolderId: f
254
254
  });
255
255
  if (t) {
256
- Ie(t) ? (j(!1), U(""), Ft(!0)) : (x.error(t instanceof Error ? t.message : a(d, "files.folder.errors.createFailed", "Folder creation failed")), X("files.api.failed", {
256
+ re(t) ? (F(!1), G(""), jt(!0)) : (C.error(t instanceof Error ? t.message : a(d, "files.folder.errors.createFailed", "Folder creation failed")), X("files.api.failed", {
257
257
  action: "createFolder",
258
258
  message: t instanceof Error ? t.message : "Folder creation failed"
259
259
  }));
260
260
  return;
261
261
  }
262
- e && (U(""), j(!1), X("files.folder.created", {
263
- folderName: H,
262
+ e && (G(""), F(!1), X("files.folder.created", {
263
+ folderName: W,
264
264
  parentFolderId: f
265
265
  }));
266
266
  }
267
- }, _n = (e) => {
268
- kt(e);
269
- }, vn = (e) => {
270
- P(e), Rt(!0);
271
267
  }, yn = (e) => {
272
- P(e), Rt(!0);
273
- }, bn = async (e) => {
268
+ Dt(e);
269
+ }, bn = (e) => {
270
+ Vt(e), L(!0);
271
+ }, xn = (e) => {
272
+ Vt(e), L(!0);
273
+ }, Sn = async (e) => {
274
274
  if (!e.fileId && !e.folderId) throw Error(a(d, "files.share.errors.targetRequired", "Share requires a file id or folder id"));
275
275
  let t = e.invitedEmail ? "EMAIL_INVITE" : "PUBLIC_LINK", n = "";
276
276
  if (e.fileId) {
@@ -283,7 +283,7 @@ function d() {
283
283
  shareType: t,
284
284
  accessLevel: "DOWNLOAD"
285
285
  };
286
- n = (await tn.mutateAsync(r))?.token ?? "", X("files.share.created", {
286
+ n = (await rn.mutateAsync(r))?.token ?? "", X("files.share.created", {
287
287
  entityType: "file",
288
288
  fileId: e.fileId,
289
289
  shareType: t
@@ -298,7 +298,7 @@ function d() {
298
298
  shareType: t,
299
299
  accessLevel: "DOWNLOAD"
300
300
  };
301
- n = (await nn.mutateAsync(r))?.createFolderShare?.token ?? "", X("files.share.created", {
301
+ n = (await an.mutateAsync(r))?.createFolderShare?.token ?? "", X("files.share.created", {
302
302
  entityType: "folder",
303
303
  folderId: e.folderId,
304
304
  shareType: t
@@ -308,7 +308,7 @@ function d() {
308
308
  publicUrl: n ? `${window.location.origin}/files/share/${n}` : "",
309
309
  token: n
310
310
  };
311
- }, xn = async (e) => {
311
+ }, Cn = async (e) => {
312
312
  Le("medium"), Y({
313
313
  title: a(d, "files.confirm.deleteFile.title", "Delete file"),
314
314
  description: a(d, "files.confirm.deleteFile.description", "Move \"{{name}}\" to the bin?", { name: e.name }),
@@ -316,13 +316,13 @@ function d() {
316
316
  variant: "danger",
317
317
  onConfirm: async () => {
318
318
  try {
319
- await Jt.mutateAsync({ id: e.id }), Re("success"), x.success(a(d, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), X("files.file.deleted", {
319
+ await Xt.mutateAsync({ id: e.id }), Re("success"), C.success(a(d, "files.file.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), X("files.file.deleted", {
320
320
  fileId: e.id,
321
321
  fileName: e.name,
322
322
  permanent: !1
323
323
  });
324
324
  } catch (t) {
325
- x.error(t instanceof Error ? t.message : a(d, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Re("error"), X("files.api.failed", {
325
+ C.error(t instanceof Error ? t.message : a(d, "files.file.errors.deleteFailed", "Failed to delete \"{{name}}\"", { name: e.name })), Re("error"), X("files.api.failed", {
326
326
  action: "deleteFile",
327
327
  fileId: e.id,
328
328
  message: t instanceof Error ? t.message : "Failed to delete file"
@@ -330,16 +330,16 @@ function d() {
330
330
  }
331
331
  }
332
332
  });
333
- }, Sn = async (e) => {
333
+ }, wn = async (e) => {
334
334
  try {
335
- await Xt.mutateAsync({ id: e.id }), x.success(a(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.file.restored", {
335
+ await Qt.mutateAsync({ id: e.id }), C.success(a(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.file.restored", {
336
336
  fileId: e.id,
337
337
  fileName: e.name
338
338
  });
339
339
  } catch (e) {
340
- x.error(e instanceof Error ? e.message : a(d, "files.file.errors.restoreFailed", "Failed to restore file"));
340
+ C.error(e instanceof Error ? e.message : a(d, "files.file.errors.restoreFailed", "Failed to restore file"));
341
341
  }
342
- }, Cn = async (e) => {
342
+ }, Tn = async (e) => {
343
343
  Le("heavy"), Y({
344
344
  title: a(d, "files.confirm.permanentDeleteFile.title", "Permanently delete file"),
345
345
  description: a(d, "files.confirm.permanentDeleteFile.description", "Permanently delete \"{{name}}\"? This cannot be undone.", { name: e.name }),
@@ -347,19 +347,19 @@ function d() {
347
347
  variant: "danger",
348
348
  onConfirm: async () => {
349
349
  try {
350
- await Qt.mutateAsync({ id: e.id }), x.success(a(d, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), X("files.file.deleted", {
350
+ await en.mutateAsync({ id: e.id }), C.success(a(d, "files.file.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), X("files.file.deleted", {
351
351
  fileId: e.id,
352
352
  fileName: e.name,
353
353
  permanent: !0
354
354
  });
355
355
  } catch (e) {
356
- x.error(e instanceof Error ? e.message : a(d, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
356
+ C.error(e instanceof Error ? e.message : a(d, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
357
357
  }
358
358
  }
359
359
  });
360
- }, wn = async (e) => {
360
+ }, En = async (e) => {
361
361
  try {
362
- await en.mutateAsync({
362
+ await nn.mutateAsync({
363
363
  id: e.id,
364
364
  type: "file"
365
365
  }), X("files.file.starred", {
@@ -368,47 +368,47 @@ function d() {
368
368
  starred: !e.starred
369
369
  });
370
370
  } catch {
371
- x.error(a(d, "files.file.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
371
+ C.error(a(d, "files.file.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
372
372
  action: "toggleFileStar",
373
373
  fileId: e.id
374
374
  });
375
375
  }
376
- }, Tn = (e) => {
377
- z({
376
+ }, Dn = (e) => {
377
+ V({
378
378
  id: e.id,
379
379
  name: e.name,
380
380
  type: "file"
381
- }), V(e.name), M(!0);
382
- }, En = async (e) => {
381
+ }), U(e.name), I(!0);
382
+ }, On = async (e) => {
383
383
  try {
384
384
  let t = e.downloadUrl || e.url;
385
385
  if (!t) throw Error(a(d, "files.file.errors.downloadUrlUnavailable", "Download URL is unavailable"));
386
386
  let n = document.createElement("a");
387
- n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n), x.success(a(d, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), X("files.file.downloaded", {
387
+ n.style.display = "none", n.href = t, n.download = e.name, n.rel = "noopener noreferrer", document.body.appendChild(n), n.click(), document.body.removeChild(n), C.success(a(d, "files.file.download.success", "Downloaded {{name}}", { name: e.name })), X("files.file.downloaded", {
388
388
  fileId: e.id,
389
389
  fileName: e.name
390
390
  });
391
391
  } catch (e) {
392
- x.error(e instanceof Error ? e.message : a(d, "files.file.errors.downloadFailed", "Failed to download file"));
392
+ C.error(e instanceof Error ? e.message : a(d, "files.file.errors.downloadFailed", "Failed to download file"));
393
393
  }
394
- }, Dn = (e) => {
394
+ }, kn = (e) => {
395
395
  Ut({
396
396
  item: e,
397
397
  type: "file"
398
- }), Vt(!0);
399
- }, On = (e) => {
400
- I({
398
+ }), zt(!0);
399
+ }, An = (e) => {
400
+ Ht({
401
401
  item: e,
402
402
  type: "file"
403
- }), N(!0);
404
- }, kn = (e) => {
405
- Ot({
403
+ }), Lt(!0);
404
+ }, jn = (e) => {
405
+ Et({
406
406
  item: e,
407
407
  type: "file"
408
408
  });
409
- }, An = (e) => {
410
- gt(`/files/browse/${e.id}`);
411
- }, jn = async (e) => {
409
+ }, Mn = (e) => {
410
+ p(`/files/browse/${e.id}`);
411
+ }, Nn = async (e) => {
412
412
  Le("medium"), Y({
413
413
  title: a(d, "files.confirm.deleteFolder.title", "Delete folder"),
414
414
  description: a(d, "files.confirm.deleteFolder.description", "Move folder \"{{name}}\" and all its contents to the bin?", { name: e.name }),
@@ -416,29 +416,29 @@ function d() {
416
416
  variant: "danger",
417
417
  onConfirm: async () => {
418
418
  try {
419
- await Yt.mutateAsync({
419
+ await Zt.mutateAsync({
420
420
  id: e.id,
421
421
  recursive: !0
422
- }), x.success(a(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), X("files.folder.deleted", {
422
+ }), C.success(a(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), X("files.folder.deleted", {
423
423
  folderId: e.id,
424
424
  folderName: e.name,
425
425
  permanent: !1
426
426
  });
427
427
  } catch (e) {
428
- x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.deleteFailed", "Failed to delete folder"));
428
+ C.error(e instanceof Error ? e.message : a(d, "files.folder.errors.deleteFailed", "Failed to delete folder"));
429
429
  }
430
430
  }
431
431
  });
432
- }, Mn = async (e) => {
432
+ }, Pn = async (e) => {
433
433
  try {
434
- await Zt.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.folder.restored", {
434
+ await $t.mutateAsync({ id: e.id }), C.success(a(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.folder.restored", {
435
435
  folderId: e.id,
436
436
  folderName: e.name
437
437
  });
438
438
  } catch (e) {
439
- x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
439
+ C.error(e instanceof Error ? e.message : a(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
440
440
  }
441
- }, Nn = async (e) => {
441
+ }, Fn = async (e) => {
442
442
  Y({
443
443
  title: a(d, "files.confirm.permanentDeleteFolder.title", "Permanently delete folder"),
444
444
  description: a(d, "files.confirm.permanentDeleteFolder.description", "Permanently delete folder \"{{name}}\" and its contents? This cannot be undone.", { name: e.name }),
@@ -446,30 +446,30 @@ function d() {
446
446
  variant: "danger",
447
447
  onConfirm: async () => {
448
448
  try {
449
- await $t.mutateAsync({ id: e.id }), x.success(a(d, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), X("files.folder.deleted", {
449
+ await tn.mutateAsync({ id: e.id }), C.success(a(d, "files.folder.permanentDelete.success", "\"{{name}}\" deleted permanently", { name: e.name })), X("files.folder.deleted", {
450
450
  folderId: e.id,
451
451
  folderName: e.name,
452
452
  permanent: !0
453
453
  });
454
454
  } catch (e) {
455
- x.error(e instanceof Error ? e.message : a(d, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
455
+ C.error(e instanceof Error ? e.message : a(d, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
456
456
  }
457
457
  }
458
458
  });
459
- }, Pn = (e) => {
460
- z({
459
+ }, In = (e) => {
460
+ V({
461
461
  id: e.id,
462
462
  name: e.name,
463
463
  type: "folder"
464
- }), V(e.name), M(!0);
465
- }, Fn = (e) => {
466
- I({
464
+ }), U(e.name), I(!0);
465
+ }, Ln = (e) => {
466
+ Ht({
467
467
  item: e,
468
468
  type: "folder"
469
- }), N(!0);
470
- }, In = async (e) => {
469
+ }), Lt(!0);
470
+ }, Rn = async (e) => {
471
471
  try {
472
- await en.mutateAsync({
472
+ await nn.mutateAsync({
473
473
  id: e.id,
474
474
  type: "folder"
475
475
  }), X("files.folder.starred", {
@@ -478,102 +478,102 @@ function d() {
478
478
  starred: !e.starred
479
479
  });
480
480
  } catch {
481
- x.error(a(d, "files.folder.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
481
+ C.error(a(d, "files.folder.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
482
482
  action: "toggleFolderStar",
483
483
  folderId: e.id
484
484
  });
485
485
  }
486
- }, Ln = (e) => {
487
- Ot({
486
+ }, zn = (e) => {
487
+ Et({
488
488
  item: e,
489
489
  type: "folder"
490
490
  });
491
- }, Rn = async (e) => {
492
- if (F) try {
493
- F.type === "file" ? (await an.mutateAsync({
494
- fileId: F.item.id,
491
+ }, Bn = async (e) => {
492
+ if (R) try {
493
+ R.type === "file" ? (await sn.mutateAsync({
494
+ fileId: R.item.id,
495
495
  targetFolderId: e || null
496
- }), x.success(a(d, "files.file.move.success", "\"{{name}}\" moved", { name: F.item.name })), X("files.file.moved", {
497
- fileId: F.item.id,
498
- fileName: F.item.name,
496
+ }), C.success(a(d, "files.file.move.success", "\"{{name}}\" moved", { name: R.item.name })), X("files.file.moved", {
497
+ fileId: R.item.id,
498
+ fileName: R.item.name,
499
499
  destinationFolderId: e
500
- })) : (await on.mutateAsync({
501
- folderId: F.item.id,
500
+ })) : (await cn.mutateAsync({
501
+ folderId: R.item.id,
502
502
  targetParentFolderId: e
503
- }), x.success(a(d, "files.folder.move.success", "\"{{name}}\" moved", { name: F.item.name })), X("files.folder.moved", {
504
- folderId: F.item.id,
505
- folderName: F.item.name,
503
+ }), C.success(a(d, "files.folder.move.success", "\"{{name}}\" moved", { name: R.item.name })), X("files.folder.moved", {
504
+ folderId: R.item.id,
505
+ folderName: R.item.name,
506
506
  destinationFolderId: e
507
- })), N(!1), I(null);
507
+ })), Lt(!1), Ht(null);
508
508
  } catch (e) {
509
- x.error(e instanceof Error ? e.message : a(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: F.item.name })), X("files.api.failed", {
510
- action: F.type === "file" ? "moveFile" : "moveFolder",
511
- itemId: F.item.id,
512
- itemType: F.type,
509
+ C.error(e instanceof Error ? e.message : a(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: R.item.name })), X("files.api.failed", {
510
+ action: R.type === "file" ? "moveFile" : "moveFolder",
511
+ itemId: R.item.id,
512
+ itemType: R.type,
513
513
  message: e instanceof Error ? e.message : void 0
514
514
  });
515
515
  }
516
- }, zn = async (e, t) => {
517
- if (L) try {
518
- if (L.type !== "file") throw Error(a(d, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
519
- await rn.mutateAsync({
520
- id: L.item.id,
521
- newName: t || `Copy of ${L.item.name}`,
516
+ }, Vn = async (e, t) => {
517
+ if (z) try {
518
+ if (z.type !== "file") throw Error(a(d, "files.folder.errors.copyUnsupported", "Folder copy is not supported"));
519
+ await on.mutateAsync({
520
+ id: z.item.id,
521
+ newName: t || `Copy of ${z.item.name}`,
522
522
  targetFolderId: e || void 0
523
- }), x.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: L.item.name })), X("files.file.copied", {
524
- fileId: L.item.id,
525
- fileName: L.item.name,
523
+ }), C.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: z.item.name })), X("files.file.copied", {
524
+ fileId: z.item.id,
525
+ fileName: z.item.name,
526
526
  destinationFolderId: e
527
- }), Vt(!1), Ut(null);
527
+ }), zt(!1), Ut(null);
528
528
  } catch (e) {
529
- x.error(e instanceof Error ? e.message : a(d, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: L.item.name })), X("files.api.failed", {
529
+ C.error(e instanceof Error ? e.message : a(d, "files.file.errors.copyFailed", "Failed to copy \"{{name}}\"", { name: z.item.name })), X("files.api.failed", {
530
530
  action: "copyFile",
531
- fileId: L.item.id,
531
+ fileId: z.item.id,
532
532
  message: e instanceof Error ? e.message : void 0
533
533
  });
534
534
  }
535
- }, Bn = async () => {
536
- if (!(!R || !B.trim())) try {
537
- let e = R.name, t = B.trim();
538
- R.type === "file" ? (await Q.mutateAsync({
539
- fileId: R.id,
535
+ }, Hn = async () => {
536
+ if (!(!B || !H.trim())) try {
537
+ let e = B.name, t = H.trim();
538
+ B.type === "file" ? (await Q.mutateAsync({
539
+ fileId: B.id,
540
540
  newName: t
541
- }), x.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.file.renamed", {
542
- fileId: R.id,
541
+ }), C.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.file.renamed", {
542
+ fileId: B.id,
543
543
  previousName: e,
544
544
  name: t
545
545
  })) : (await $.mutateAsync({
546
- folderId: R.id,
546
+ folderId: B.id,
547
547
  newName: t
548
- }), x.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.folder.renamed", {
549
- folderId: R.id,
548
+ }), C.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.folder.renamed", {
549
+ folderId: B.id,
550
550
  previousName: e,
551
551
  name: t
552
- })), M(!1), z(null), V("");
552
+ })), I(!1), V(null), U("");
553
553
  } catch (e) {
554
- x.error(e instanceof Error ? e.message : a(d, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: R.type })), X("files.api.failed", {
555
- action: R.type === "file" ? "renameFile" : "renameFolder",
556
- itemId: R.id,
557
- itemType: R.type,
554
+ C.error(e instanceof Error ? e.message : a(d, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: B.type })), X("files.api.failed", {
555
+ action: B.type === "file" ? "renameFile" : "renameFolder",
556
+ itemId: B.id,
557
+ itemType: B.type,
558
558
  message: e instanceof Error ? e.message : void 0
559
559
  });
560
560
  }
561
561
  };
562
562
  return n({
563
- files: T,
564
- folders: E,
565
- onFilePreview: _n,
566
- onFileDelete: xn,
567
- onFolderOpen: An,
568
- onFolderDelete: jn,
569
- activeTab: g
570
- }), p === void 0 ? /* @__PURE__ */ l("div", {
563
+ files: k,
564
+ folders: A,
565
+ onFilePreview: yn,
566
+ onFileDelete: Cn,
567
+ onFolderOpen: Mn,
568
+ onFolderDelete: Nn,
569
+ activeTab: v
570
+ }), m === void 0 ? /* @__PURE__ */ l("div", {
571
571
  className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
572
572
  children: [/* @__PURE__ */ c(s, { className: "size-8 animate-spin text-text-tertiary" }), /* @__PURE__ */ c("p", {
573
573
  className: "text-sm text-text-secondary max-w-md",
574
574
  children: a(d, "files.browser.workspace.waiting", "Waiting for workspace context. If this persists, the app shell may not have provided a workspaceId to the Files module. Try reloading the page or switching workspaces.")
575
575
  })]
576
- }) : p === "" ? /* @__PURE__ */ l("div", {
576
+ }) : m === "" ? /* @__PURE__ */ l("div", {
577
577
  className: "flex flex-col items-center justify-center min-h-[60vh] gap-3 text-center px-6",
578
578
  children: [/* @__PURE__ */ c(Ge, { className: "size-8 text-text-tertiary" }), /* @__PURE__ */ c("p", {
579
579
  className: "text-sm text-text-secondary max-w-md",
@@ -597,22 +597,22 @@ function d() {
597
597
  className: "flex items-center gap-1 sm:gap-2 text-sm overflow-x-auto",
598
598
  children: [/* @__PURE__ */ l("button", {
599
599
  type: "button",
600
- onClick: () => gt("/files/browse"),
600
+ onClick: () => p("/files/browse"),
601
601
  className: "flex items-center gap-1 text-text-primary hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap",
602
602
  title: a(d, "files.browser.actions.goToRoot", "Go to root"),
603
603
  children: [/* @__PURE__ */ c(qe, { className: "size-4" }), /* @__PURE__ */ c("span", {
604
604
  className: "hidden sm:inline",
605
605
  children: a(d, "files.browser.rootLabel", "My Drive")
606
606
  })]
607
- }), xt.map((e, t) => /* @__PURE__ */ l("div", {
607
+ }), bt.map((e, t) => /* @__PURE__ */ l("div", {
608
608
  className: "flex items-center gap-1 sm:gap-2",
609
609
  children: [/* @__PURE__ */ c("span", {
610
610
  className: "text-text-tertiary",
611
611
  children: "/"
612
612
  }), /* @__PURE__ */ c("button", {
613
613
  type: "button",
614
- onClick: () => gt(`/files/browse/${e.id}`),
615
- className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === xt.length - 1 ? "text-text-primary font-medium" : "text-text-secondary"}`,
614
+ onClick: () => p(`/files/browse/${e.id}`),
615
+ className: `hover:bg-action-ghost-bg-hover px-2 py-1 rounded transition-colors duration-200 whitespace-nowrap ${t === bt.length - 1 ? "text-text-primary font-medium" : "text-text-secondary"}`,
616
616
  title: `Go to ${e.name}`,
617
617
  children: e.name
618
618
  })]
@@ -625,7 +625,7 @@ function d() {
625
625
  })
626
626
  ]
627
627
  }),
628
- !y && /* @__PURE__ */ c("div", {
628
+ !x && /* @__PURE__ */ c("div", {
629
629
  className: "px-4 pt-3 sm:px-6",
630
630
  children: /* @__PURE__ */ c(lt, {
631
631
  storageKey: "files-browser",
@@ -636,38 +636,38 @@ function d() {
636
636
  label: a(d, "files.browser.nextSteps.upload.label", "Upload your first files"),
637
637
  description: a(d, "files.browser.nextSteps.upload.description", "Add documents, images or videos to this drive."),
638
638
  icon: /* @__PURE__ */ c(Ze, { className: "size-4" }),
639
- onClick: cn
639
+ onClick: un
640
640
  },
641
641
  {
642
642
  id: "new-folder",
643
643
  label: a(d, "files.browser.nextSteps.newFolder.label", "Create a folder to organise"),
644
644
  description: a(d, "files.browser.nextSteps.newFolder.description", "Group related files so they are easy to find later."),
645
645
  icon: /* @__PURE__ */ c(Ue, { className: "size-4" }),
646
- onClick: hn
646
+ onClick: _n
647
647
  },
648
648
  {
649
649
  id: "starred",
650
650
  label: a(d, "files.browser.nextSteps.starred.label", "Star items you use often"),
651
651
  description: a(d, "files.browser.nextSteps.starred.description", "Starred files and folders show up under the Starred tab."),
652
652
  icon: /* @__PURE__ */ c(Ye, { className: "size-4" }),
653
- onClick: () => _("starred")
653
+ onClick: () => y("starred")
654
654
  },
655
655
  {
656
656
  id: "bin",
657
657
  label: a(d, "files.browser.nextSteps.bin.label", "Recover deleted items from the Bin"),
658
658
  description: a(d, "files.browser.nextSteps.bin.description", "Deleted files stay in the Bin so you can restore them."),
659
659
  icon: /* @__PURE__ */ c(Xe, { className: "size-4" }),
660
- onClick: () => _("bin")
660
+ onClick: () => y("bin")
661
661
  }
662
662
  ]
663
663
  })
664
664
  }),
665
665
  /* @__PURE__ */ c("div", {
666
666
  "data-tour": "files-tab-bar",
667
- children: /* @__PURE__ */ c(Ce, {
668
- activeTab: g,
669
- onTabChange: _,
670
- tabs: Ct
667
+ children: /* @__PURE__ */ c(we, {
668
+ activeTab: v,
669
+ onTabChange: y,
670
+ tabs: xt
671
671
  })
672
672
  }),
673
673
  /* @__PURE__ */ l("div", {
@@ -680,42 +680,42 @@ function d() {
680
680
  "data-tour": "files-search-bar",
681
681
  children: /* @__PURE__ */ c("div", {
682
682
  className: "relative w-full max-w-2xl",
683
- children: /* @__PURE__ */ c(ke, {
683
+ children: /* @__PURE__ */ c(Ae, {
684
684
  onSearch: (e, t) => {
685
- wt(e), Et(t);
685
+ St(e), wt(t);
686
686
  },
687
687
  placeholder: a(d, "files.search.input.placeholder", "Search files and folders..."),
688
- initialQuery: v,
688
+ initialQuery: b,
689
689
  showFilters: !0
690
690
  })
691
691
  })
692
692
  }), /* @__PURE__ */ l("div", {
693
693
  className: "flex items-center gap-2 order-1 sm:order-2 w-full sm:w-auto justify-between sm:justify-end",
694
- children: [!y && /* @__PURE__ */ c("div", {
694
+ children: [!x && /* @__PURE__ */ c("div", {
695
695
  "data-tour": "files-upload-files-button",
696
696
  children: /* @__PURE__ */ c(it, {
697
697
  primary: {
698
- label: W ? a(d, "files.browser.upload.uploading", "Uploading...") : a(d, "files.browser.actions.uploadFiles", "Upload Files"),
699
- onSelect: cn,
700
- disabled: W,
701
- icon: W ? /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }) : /* @__PURE__ */ c(Ze, { className: "size-4" })
698
+ label: Wt ? a(d, "files.browser.upload.uploading", "Uploading...") : a(d, "files.browser.actions.uploadFiles", "Upload Files"),
699
+ onSelect: un,
700
+ disabled: Wt,
701
+ icon: Wt ? /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }) : /* @__PURE__ */ c(Ze, { className: "size-4" })
702
702
  },
703
703
  actions: [
704
704
  {
705
705
  label: a(d, "files.browser.actions.newFolder", "New Folder"),
706
706
  icon: /* @__PURE__ */ c(Ue, { className: "size-4" }),
707
- onSelect: hn
707
+ onSelect: _n
708
708
  },
709
709
  {
710
710
  label: a(d, "files.browser.actions.uploadFolder", "Upload Folder"),
711
711
  icon: /* @__PURE__ */ c(We, { className: "size-4" }),
712
- onSelect: mn,
713
- disabled: W
712
+ onSelect: gn,
713
+ disabled: Wt
714
714
  },
715
- ...T.length > 0 || E.length > 0 ? [{
715
+ ...k.length > 0 || A.length > 0 ? [{
716
716
  label: a(d, "files.browser.actions.selectAll", "Select All"),
717
717
  onSelect: () => {
718
- let e = T.map((e) => e.id), n = E.map((e) => e.id);
718
+ let e = k.map((e) => e.id), n = A.map((e) => e.id);
719
719
  t.getState().selectAllFiles(e), n.forEach((e) => t.getState().selectFolder(e));
720
720
  }
721
721
  }] : []
@@ -726,51 +726,51 @@ function d() {
726
726
  "data-tour": "files-view-mode-toggle",
727
727
  children: [/* @__PURE__ */ c("button", {
728
728
  type: "button",
729
- onClick: () => bt("grid"),
730
- className: `p-2 transition-colors duration-200 ${yt === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
729
+ onClick: () => yt("grid"),
730
+ className: `p-2 transition-colors duration-200 ${vt === "grid" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
731
731
  "aria-label": a(d, "files.browser.view.grid", "Grid view"),
732
732
  children: /* @__PURE__ */ c(Ke, { className: "size-5" })
733
733
  }), /* @__PURE__ */ c("button", {
734
734
  type: "button",
735
- onClick: () => bt("list"),
736
- className: `p-2 transition-colors duration-200 ${yt === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
735
+ onClick: () => yt("list"),
736
+ className: `p-2 transition-colors duration-200 ${vt === "list" ? "bg-bg-accent text-text-link" : "text-text-secondary hover:bg-action-ghost-bg-hover"}`,
737
737
  "aria-label": a(d, "files.browser.view.list", "List view"),
738
738
  children: /* @__PURE__ */ c(Je, { className: "size-5" })
739
739
  })]
740
740
  })]
741
741
  })]
742
742
  }),
743
- y && /* @__PURE__ */ l("div", {
743
+ x && /* @__PURE__ */ l("div", {
744
744
  className: "mt-3 flex items-center justify-between p-3 bg-status-success-bg-subtle rounded-lg border border-status-success-border transition-all duration-200",
745
745
  children: [/* @__PURE__ */ l("span", {
746
746
  className: "text-sm font-medium text-status-success-text",
747
- children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: v }), w.data && ` (${(w.data.files?.length || 0) + (w.data.folders?.length || 0)} items)`]
747
+ children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: b }), O.data && ` (${(O.data.files?.length || 0) + (O.data.folders?.length || 0)} items)`]
748
748
  }), /* @__PURE__ */ l("button", {
749
749
  type: "button",
750
- onClick: () => wt(""),
750
+ onClick: () => St(""),
751
751
  className: "flex items-center gap-2 text-status-success-text hover:text-status-success-text/80 text-sm font-medium transition-colors duration-200",
752
752
  children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(d, "files.browser.search.clear", "Clear search")]
753
753
  })]
754
754
  }),
755
- A > 0 && /* @__PURE__ */ l(at, {
755
+ P > 0 && /* @__PURE__ */ l(at, {
756
756
  className: "mt-3 flex items-center justify-between p-3",
757
757
  children: [/* @__PURE__ */ l("div", {
758
758
  className: "flex items-center gap-4",
759
759
  children: [/* @__PURE__ */ c("span", {
760
760
  className: "text-sm font-medium text-text-primary",
761
761
  children: a(d, "files.browser.selection.selectedCount", "{{count}} item{{suffix}} selected", {
762
- count: A,
763
- suffix: A > 1 ? "s" : ""
762
+ count: P,
763
+ suffix: P > 1 ? "s" : ""
764
764
  })
765
765
  }), /* @__PURE__ */ c("div", {
766
766
  className: "flex items-center gap-2",
767
- children: g === "bin" ? /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c("button", {
767
+ children: v === "bin" ? /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c("button", {
768
768
  type: "button",
769
769
  onClick: async () => {
770
770
  try {
771
- await Promise.all([...Array.from(St).map((e) => Xt.mutateAsync({ id: e })), ...Array.from(m).map((e) => Zt.mutateAsync({ id: e }))]), h(), x.success(`${A} item${A > 1 ? "s" : ""} restored`);
771
+ await Promise.all([...Array.from(h).map((e) => Qt.mutateAsync({ id: e })), ...Array.from(g).map((e) => $t.mutateAsync({ id: e }))]), _(), C.success(`${P} item${P > 1 ? "s" : ""} restored`);
772
772
  } catch (e) {
773
- x.error(e instanceof Error ? e.message : "Failed to restore some items");
773
+ C.error(e instanceof Error ? e.message : "Failed to restore some items");
774
774
  }
775
775
  },
776
776
  className: "flex items-center gap-1.5 rounded-lg border border-status-success-border bg-bg-surface px-3 py-1.5 text-sm font-medium text-status-success-text transition-colors duration-200 hover:bg-status-success-bg-subtle",
@@ -781,19 +781,19 @@ function d() {
781
781
  Y({
782
782
  title: a(d, "files.confirm.bulkPermanentDelete.title", "Permanently delete selected items"),
783
783
  description: a(d, "files.confirm.bulkPermanentDelete.description", "Permanently delete {{count}} selected item{{plural}}? This cannot be undone.", {
784
- count: A,
785
- plural: A > 1 ? "s" : ""
784
+ count: P,
785
+ plural: P > 1 ? "s" : ""
786
786
  }),
787
787
  confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
788
788
  variant: "danger",
789
789
  onConfirm: async () => {
790
790
  try {
791
- await Promise.all([...Array.from(St).map((e) => Qt.mutateAsync({ id: e })), ...Array.from(m).map((e) => $t.mutateAsync({ id: e }))]), h(), x.success(a(d, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
792
- count: A,
793
- plural: A > 1 ? "s" : ""
791
+ await Promise.all([...Array.from(h).map((e) => en.mutateAsync({ id: e })), ...Array.from(g).map((e) => tn.mutateAsync({ id: e }))]), _(), C.success(a(d, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
792
+ count: P,
793
+ plural: P > 1 ? "s" : ""
794
794
  }));
795
795
  } catch (e) {
796
- x.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
796
+ C.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
797
797
  }
798
798
  }
799
799
  });
@@ -806,23 +806,23 @@ function d() {
806
806
  Y({
807
807
  title: a(d, "files.confirm.bulkDelete.title", "Delete selected items"),
808
808
  description: a(d, "files.confirm.bulkDelete.description", "Move {{count}} selected item{{plural}} to the bin?", {
809
- count: A,
810
- plural: A > 1 ? "s" : ""
809
+ count: P,
810
+ plural: P > 1 ? "s" : ""
811
811
  }),
812
812
  confirmLabel: a(d, "files.common.actions.delete", "Delete"),
813
813
  variant: "danger",
814
814
  onConfirm: async () => {
815
815
  try {
816
- let e = Array.from(St), t = Array.from(m);
817
- e.length > 0 && await sn.mutateAsync(e), await Promise.all(t.map((e) => Yt.mutateAsync({
816
+ let e = Array.from(h), t = Array.from(g);
817
+ e.length > 0 && await ln.mutateAsync(e), await Promise.all(t.map((e) => Zt.mutateAsync({
818
818
  id: e,
819
819
  recursive: !0
820
- }))), h(), x.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
821
- count: A,
822
- plural: A > 1 ? "s" : ""
820
+ }))), _(), C.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
821
+ count: P,
822
+ plural: P > 1 ? "s" : ""
823
823
  }));
824
824
  } catch (e) {
825
- x.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
825
+ C.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
826
826
  }
827
827
  }
828
828
  });
@@ -833,53 +833,53 @@ function d() {
833
833
  })]
834
834
  }), /* @__PURE__ */ l("button", {
835
835
  type: "button",
836
- onClick: h,
836
+ onClick: _,
837
837
  className: "flex items-center gap-2 text-text-link hover:text-action-primary-bg-hover text-sm font-medium transition-colors duration-200",
838
838
  children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(d, "files.common.actions.clear", "Clear")]
839
839
  })]
840
840
  })
841
841
  ]
842
842
  }),
843
- (vt.isExhausted || vt.isNearLimit) && /* @__PURE__ */ c("div", {
843
+ (_t.isExhausted || _t.isNearLimit) && /* @__PURE__ */ c("div", {
844
844
  className: "px-4 sm:px-6 pt-3",
845
- children: /* @__PURE__ */ c(Pe, { quota: vt })
845
+ children: /* @__PURE__ */ c(Fe, { quota: _t })
846
846
  }),
847
847
  /* @__PURE__ */ l("div", {
848
848
  className: "px-2 sm:px-4 md:px-6 py-3 sm:py-4",
849
849
  "data-tour": "files-browser-grid",
850
- children: [/* @__PURE__ */ c(Se, {
851
- files: T,
852
- folders: E,
853
- loading: D,
854
- error: O,
855
- preserveSortOrder: k,
856
- onFilePreview: _n,
857
- onFileShare: g === "bin" ? void 0 : vn,
858
- onFileDelete: g === "bin" ? Cn : xn,
859
- onFileRestore: g === "bin" ? Sn : void 0,
860
- onFileFavorite: g === "bin" ? void 0 : wn,
861
- onFileRename: g === "bin" ? void 0 : Tn,
862
- onFileDownload: En,
863
- onFileCopy: g === "bin" ? void 0 : Dn,
864
- onFileMove: g === "bin" ? void 0 : On,
865
- onFileInfo: kn,
866
- onFolderOpen: An,
867
- onFolderShare: g === "bin" ? void 0 : yn,
868
- onFolderDelete: g === "bin" ? Nn : jn,
869
- onFolderRestore: g === "bin" ? Mn : void 0,
870
- onFolderRename: g === "bin" ? void 0 : Pn,
871
- onFolderFavorite: g === "bin" ? void 0 : In,
872
- onFolderMove: g === "bin" ? void 0 : Fn,
873
- onFolderInfo: Ln
874
- }), !D && (T.length > 0 || E.length > 0) && /* @__PURE__ */ l("div", {
850
+ children: [/* @__PURE__ */ c(Ce, {
851
+ files: k,
852
+ folders: A,
853
+ loading: j,
854
+ error: M,
855
+ preserveSortOrder: N,
856
+ onFilePreview: yn,
857
+ onFileShare: v === "bin" ? void 0 : bn,
858
+ onFileDelete: v === "bin" ? Tn : Cn,
859
+ onFileRestore: v === "bin" ? wn : void 0,
860
+ onFileFavorite: v === "bin" ? void 0 : En,
861
+ onFileRename: v === "bin" ? void 0 : Dn,
862
+ onFileDownload: On,
863
+ onFileCopy: v === "bin" ? void 0 : kn,
864
+ onFileMove: v === "bin" ? void 0 : An,
865
+ onFileInfo: jn,
866
+ onFolderOpen: Mn,
867
+ onFolderShare: v === "bin" ? void 0 : xn,
868
+ onFolderDelete: v === "bin" ? Fn : Nn,
869
+ onFolderRestore: v === "bin" ? Pn : void 0,
870
+ onFolderRename: v === "bin" ? void 0 : In,
871
+ onFolderFavorite: v === "bin" ? void 0 : Rn,
872
+ onFolderMove: v === "bin" ? void 0 : Ln,
873
+ onFolderInfo: zn
874
+ }), !j && (k.length > 0 || A.length > 0) && /* @__PURE__ */ l("div", {
875
875
  className: "mt-4 px-2 text-sm text-text-secondary",
876
- children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: T.length + E.length }), !y && g === "all" && Mt !== null && ` ${a(d, "files.browser.results.ofItems", "of {{count}} items", { count: Mt })}`]
876
+ children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: k.length + A.length }), !x && v === "all" && Ot !== null && ` ${a(d, "files.browser.results.ofItems", "of {{count}} items", { count: Ot })}`]
877
877
  })]
878
878
  }),
879
- Nt && /* @__PURE__ */ c(dt, {
879
+ kt && /* @__PURE__ */ c(dt, {
880
880
  open: !0,
881
881
  onOpenChange: (e) => {
882
- !e && !Z.isPending && (j(!1), U(""));
882
+ !e && !Z.isPending && (F(!1), G(""));
883
883
  },
884
884
  children: /* @__PURE__ */ l(ft, {
885
885
  className: "w-full max-w-xs",
@@ -894,10 +894,10 @@ function d() {
894
894
  }),
895
895
  /* @__PURE__ */ c(ct, {
896
896
  type: "text",
897
- value: H,
898
- onChange: (e) => U(e.target.value),
897
+ value: W,
898
+ onChange: (e) => G(e.target.value),
899
899
  onKeyDown: (e) => {
900
- e.key === "Enter" && gn();
900
+ e.key === "Enter" && vn();
901
901
  },
902
902
  "aria-label": a(d, "files.browser.newFolderDialog.title", "New folder"),
903
903
  placeholder: a(d, "files.browser.newFolderDialog.placeholder", "Folder name")
@@ -906,22 +906,22 @@ function d() {
906
906
  type: "button",
907
907
  variant: "outline",
908
908
  onClick: () => {
909
- j(!1), U("");
909
+ F(!1), G("");
910
910
  },
911
911
  children: a(d, "files.common.actions.cancel", "Cancel")
912
912
  }), /* @__PURE__ */ l(u, {
913
913
  type: "button",
914
- onClick: gn,
915
- disabled: !H.trim() || Z.isPending,
914
+ onClick: vn,
915
+ disabled: !W.trim() || Z.isPending,
916
916
  children: [Z.isPending && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Z.isPending ? a(d, "files.browser.newFolderDialog.actions.creating", "Creating...") : a(d, "files.common.actions.create", "Create")]
917
917
  })] })
918
918
  ]
919
919
  })
920
920
  }),
921
- It && R && /* @__PURE__ */ c(dt, {
921
+ Pt && B && /* @__PURE__ */ c(dt, {
922
922
  open: !0,
923
923
  onOpenChange: (e) => {
924
- !e && !Q.isPending && !$.isPending && (M(!1), z(null), V(""));
924
+ !e && !Q.isPending && !$.isPending && (I(!1), V(null), U(""));
925
925
  },
926
926
  children: /* @__PURE__ */ l(ft, {
927
927
  className: "w-full max-w-xs",
@@ -931,15 +931,15 @@ function d() {
931
931
  children: /* @__PURE__ */ c(ht, {
932
932
  id: "files-rename-title",
933
933
  className: "text-base font-semibold text-text-primary",
934
- children: a(d, "files.browser.renameDialog.title", "Rename {{type}}", { type: R.type })
934
+ children: a(d, "files.browser.renameDialog.title", "Rename {{type}}", { type: B.type })
935
935
  })
936
936
  }),
937
937
  /* @__PURE__ */ c(ct, {
938
938
  type: "text",
939
- value: B,
940
- onChange: (e) => V(e.target.value),
939
+ value: H,
940
+ onChange: (e) => U(e.target.value),
941
941
  onKeyDown: (e) => {
942
- e.key === "Enter" && Bn();
942
+ e.key === "Enter" && Hn();
943
943
  },
944
944
  "aria-label": a(d, "files.browser.renameDialog.title", "Rename"),
945
945
  placeholder: a(d, "files.browser.renameDialog.placeholder", "New name")
@@ -948,114 +948,124 @@ function d() {
948
948
  type: "button",
949
949
  variant: "outline",
950
950
  onClick: () => {
951
- M(!1), z(null), V("");
951
+ I(!1), V(null), U("");
952
952
  },
953
953
  children: a(d, "files.common.actions.cancel", "Cancel")
954
954
  }), /* @__PURE__ */ l(u, {
955
955
  type: "button",
956
- onClick: Bn,
957
- disabled: !B.trim() || B.trim() === R.name || Q.isPending || $.isPending,
956
+ onClick: Hn,
957
+ disabled: !H.trim() || H.trim() === B.name || Q.isPending || $.isPending,
958
958
  children: [(Q.isPending || $.isPending) && /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }), Q.isPending || $.isPending ? a(d, "files.browser.renameDialog.actions.renaming", "Renaming...") : a(d, "files.common.actions.rename", "Rename")]
959
959
  })] })
960
960
  ]
961
961
  })
962
962
  }),
963
- Lt && Ht && /* @__PURE__ */ c(we, {
964
- item: Ht,
965
- itemType: "mimeType" in Ht ? "file" : "folder",
963
+ Ft && Bt && /* @__PURE__ */ c(Te, {
964
+ item: Bt,
965
+ itemType: "mimeType" in Bt ? "file" : "folder",
966
966
  onClose: () => {
967
- Rt(!1), P(null);
967
+ L(!1), Vt(null);
968
968
  },
969
- onCreateShare: bn,
970
- isLoading: tn.isPending
969
+ onCreateShare: Sn,
970
+ isLoading: rn.isPending
971
971
  }),
972
- J && /* @__PURE__ */ c(Me, {
972
+ J && /* @__PURE__ */ c(Ne, {
973
973
  title: J.title,
974
974
  description: J.description,
975
975
  confirmLabel: J.confirmLabel,
976
976
  cancelLabel: a(d, "files.common.actions.cancel", "Cancel"),
977
977
  variant: J.variant,
978
978
  loading: J.loading,
979
- onConfirm: Kt,
979
+ onConfirm: Jt,
980
980
  onCancel: () => {
981
981
  J.loading || Y(null);
982
982
  }
983
983
  }),
984
- Pt && /* @__PURE__ */ c(Me, {
984
+ At && /* @__PURE__ */ c(Ne, {
985
985
  title: a(d, "files.folder.quota.title", "Folder Limit Reached"),
986
986
  description: a(d, "files.folder.quota.description", "You've reached the folder limit for your plan. Upgrade your plan or purchase an add-on to create more folders."),
987
987
  confirmLabel: a(d, "files.folder.quota.upgrade", "View Billing"),
988
988
  cancelLabel: a(d, "files.common.actions.dismiss", "Dismiss"),
989
989
  onConfirm: () => {
990
- Ft(!1), gt("/billing");
990
+ jt(!1), p("/billing");
991
991
  },
992
- onCancel: () => Ft(!1)
992
+ onCancel: () => jt(!1)
993
993
  }),
994
- zt && F && /* @__PURE__ */ c(Ae, {
995
- item: F.item,
996
- type: F.type,
994
+ Mt && /* @__PURE__ */ c(Ne, {
995
+ title: a(d, "files.storage.quota.title", "Storage Limit Reached"),
996
+ description: a(d, "files.storage.quota.description", "You've reached the storage limit for your plan. Upgrade your plan or delete files to continue uploading."),
997
+ confirmLabel: a(d, "files.storage.quota.upgrade", "View Billing"),
998
+ cancelLabel: a(d, "files.common.actions.dismiss", "Dismiss"),
999
+ onConfirm: () => {
1000
+ Nt(!1), p("/billing");
1001
+ },
1002
+ onCancel: () => Nt(!1)
1003
+ }),
1004
+ It && R && /* @__PURE__ */ c(je, {
1005
+ item: R.item,
1006
+ type: R.type,
997
1007
  onClose: () => {
998
- N(!1), I(null);
1008
+ Lt(!1), Ht(null);
999
1009
  },
1000
- onMove: Rn,
1001
- isLoading: an.isPending || on.isPending
1010
+ onMove: Bn,
1011
+ isLoading: sn.isPending || cn.isPending
1002
1012
  }),
1003
- Bt && L && /* @__PURE__ */ c(je, {
1004
- item: L.item,
1005
- type: L.type,
1013
+ Rt && z && /* @__PURE__ */ c(Me, {
1014
+ item: z.item,
1015
+ type: z.type,
1006
1016
  onClose: () => {
1007
- Vt(!1), Ut(null);
1017
+ zt(!1), Ut(null);
1008
1018
  },
1009
- onCopy: zn,
1010
- isLoading: rn.isPending
1019
+ onCopy: Vn,
1020
+ isLoading: on.isPending
1011
1021
  }),
1012
- b && /* @__PURE__ */ c(Te, {
1013
- file: b,
1014
- onClose: () => kt(null),
1022
+ S && /* @__PURE__ */ c(Ee, {
1023
+ file: S,
1024
+ onClose: () => Dt(null),
1015
1025
  onDownload: () => {
1016
- ze(b.downloadUrl || b.url);
1026
+ ze(S.downloadUrl || S.url);
1017
1027
  },
1018
- onShare: g === "bin" ? void 0 : () => {
1019
- P(b), Rt(!0);
1028
+ onShare: v === "bin" ? void 0 : () => {
1029
+ Vt(S), L(!0);
1020
1030
  },
1021
- onStar: g === "bin" ? void 0 : () => wn(b),
1022
- onDelete: () => g === "bin" ? Cn(b) : xn(b)
1031
+ onStar: v === "bin" ? void 0 : () => En(S),
1032
+ onDelete: () => v === "bin" ? Tn(S) : Cn(S)
1023
1033
  }),
1024
- Dt && /* @__PURE__ */ c(Ee, {
1025
- item: Dt.item,
1026
- type: Dt.type,
1027
- onClose: () => Ot(null)
1034
+ Tt && /* @__PURE__ */ c(De, {
1035
+ item: Tt.item,
1036
+ type: Tt.type,
1037
+ onClose: () => Et(null)
1028
1038
  }),
1029
- /* @__PURE__ */ c(Ne, {
1030
- items: Wt,
1031
- isOpen: Gt,
1032
- onClose: () => q(!1),
1033
- onPause: un,
1034
- onResume: dn,
1035
- onRetry: fn,
1036
- onCancel: pn
1039
+ /* @__PURE__ */ c(Pe, {
1040
+ items: Gt,
1041
+ isOpen: Kt,
1042
+ onClose: () => qt(!1),
1043
+ onPause: fn,
1044
+ onResume: pn,
1045
+ onRetry: mn,
1046
+ onCancel: hn
1037
1047
  }),
1038
- /* @__PURE__ */ c(Oe, {
1039
- toasts: x.toasts,
1040
- onClose: x.removeToast
1048
+ /* @__PURE__ */ c(ke, {
1049
+ toasts: C.toasts,
1050
+ onClose: C.removeToast
1041
1051
  }),
1042
- !D && T.length === 0 && E.length === 0 && /* @__PURE__ */ c("div", {
1052
+ !j && k.length === 0 && A.length === 0 && /* @__PURE__ */ c("div", {
1043
1053
  className: "px-6 py-12",
1044
- children: y ? /* @__PURE__ */ c(st, {
1054
+ children: x ? /* @__PURE__ */ c(st, {
1045
1055
  illustration: "empty-search",
1046
1056
  title: a(d, "files.browser.empty.search.title", "No results found"),
1047
1057
  description: a(d, "files.browser.empty.search.description", "Try adjusting your search query or filters"),
1048
1058
  action: /* @__PURE__ */ c(u, {
1049
1059
  type: "button",
1050
1060
  onClick: () => {
1051
- wt(""), Et(void 0);
1061
+ St(""), wt(void 0);
1052
1062
  },
1053
1063
  children: a(d, "files.browser.search.clear", "Clear search")
1054
1064
  })
1055
- }) : /* @__PURE__ */ c(De, {
1056
- type: g,
1057
- onUpload: g === "all" ? cn : void 0,
1058
- onNewFolder: g === "all" ? hn : void 0
1065
+ }) : /* @__PURE__ */ c(Oe, {
1066
+ type: v,
1067
+ onUpload: v === "all" ? un : void 0,
1068
+ onNewFolder: v === "all" ? _n : void 0
1059
1069
  })
1060
1070
  })
1061
1071
  ]