@burdenoff/microfe-files 2026.1013.1 → 2026.1014.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.
@@ -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(), 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(() => [
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: xt } = t(), [_, St] = o("all"), Ct = He(() => [
56
56
  "all",
57
57
  "recent",
58
58
  "starred",
59
59
  "bin"
60
60
  ], []);
61
61
  Ve(() => {
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({
62
+ Ct.includes(_) || St("all");
63
+ }, [Ct, _]);
64
+ let [wt, Tt] = o(""), [Et, Dt] = o(), v = wt.trim().length >= 2, [Ot, kt] = o(null), [y, At] = o(null), b = xe(), x = r({
65
65
  folderId: f || void 0,
66
66
  pageSize: 100,
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);
67
+ skip: _ !== "all" || v
68
+ }), S = i({ skip: _ !== "recent" || v }), C = ee({ skip: _ !== "starred" || v }), w = te({ skip: _ !== "bin" || v }), T = be(wt, v, Et);
69
69
  Ve(() => {
70
- if (f && w.data?.folderPath && w.data?.currentFolder) {
71
- let e = w.data.folderPath.folders || [], n = w.data.currentFolder, r = [...e.map((e) => ({
70
+ if (f && x.data?.folderPath && x.data?.currentFolder) {
71
+ let e = x.data.folderPath.folders || [], n = x.data.currentFolder, r = [...e.map((e) => ({
72
72
  id: e.id,
73
73
  name: e.name
74
74
  })), {
@@ -77,24 +77,24 @@ function d() {
77
77
  }];
78
78
  t.getState().setBreadcrumbs(r);
79
79
  } else t.getState().setBreadcrumbs([]);
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) {
80
+ }, [f, x.data]);
81
+ let E = [], D = [], O = !1, k = null, A = !1;
82
+ if (v && T.data) E = T.data.files || [], D = T.data.folders || [], O = T.isLoading, k = T.error;
83
+ else switch (_) {
84
84
  case "all":
85
- k = w.data?.filesList?.files || [], A = w.data?.foldersList?.folders || [], j = w.loading, M = w.error || null, N = !1;
85
+ E = x.data?.filesList?.files || [], D = x.data?.foldersList?.folders || [], O = x.loading, k = x.error || null, A = !1;
86
86
  break;
87
87
  case "recent":
88
- k = T.files || [], A = T.folders || [], j = T.isLoading, M = T.error || null, N = !0;
88
+ E = S.files || [], D = S.folders || [], O = S.isLoading, k = S.error || null, A = !0;
89
89
  break;
90
90
  case "starred":
91
- k = E.files, A = E.folders, j = E.isLoading, M = E.error || null, N = !0;
91
+ E = C.files, D = C.folders, O = C.isLoading, k = C.error || null, A = !0;
92
92
  break;
93
93
  case "bin":
94
- k = D.files, A = D.folders, j = D.isLoading, M = D.error || null, N = !0;
94
+ E = w.files, D = w.folders, O = w.isLoading, k = w.error || null, A = !0;
95
95
  break;
96
96
  }
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) => {
97
+ let jt = _ === "all" ? (x.data?.filesList?.total ?? E.length) + (x.data?.foldersList?.total ?? D.length) : null, j = h.size + g.size, [Mt, M] = o(!1), [Nt, Pt] = o(!1), [Ft, It] = o(!1), [Lt, N] = o(!1), [Rt, P] = o(!1), [zt, F] = o(!1), [Bt, Vt] = o(!1), [Ht, I] = o(null), [L, R] = 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
98
  Be(gt, e, t);
99
99
  }, Jt = async () => {
100
100
  if (!J || J.loading) return;
@@ -164,7 +164,7 @@ function d() {
164
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
- }), Nt(!0)) : (t({
167
+ }), It(!0)) : (t({
168
168
  status: "failed",
169
169
  error: r
170
170
  }), X("files.api.failed", {
@@ -196,7 +196,7 @@ function d() {
196
196
  });
197
197
  }, gn = () => {
198
198
  if (!m) {
199
- C.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
199
+ b.error(a(d, "files.workspace.errors.notSelected", "Workspace not selected"));
200
200
  return;
201
201
  }
202
202
  let e = document.createElement("input");
@@ -238,14 +238,14 @@ function d() {
238
238
  }
239
239
  q((e) => [...e, ...i]), qt(!0), K(!0);
240
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", {
241
+ K(!1), b.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
247
  }, _n = () => {
248
- F(!0);
248
+ M(!0);
249
249
  }, vn = async () => {
250
250
  if (W.trim() && m) {
251
251
  let { data: e, error: t } = await Z.mutateAsync({
@@ -253,23 +253,23 @@ function d() {
253
253
  parentFolderId: f
254
254
  });
255
255
  if (t) {
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", {
256
+ re(t) ? (M(!1), G(""), Pt(!0)) : (b.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 && (G(""), F(!1), X("files.folder.created", {
262
+ e && (G(""), M(!1), X("files.folder.created", {
263
263
  folderName: W,
264
264
  parentFolderId: f
265
265
  }));
266
266
  }
267
267
  }, yn = (e) => {
268
- Dt(e);
268
+ At(e);
269
269
  }, bn = (e) => {
270
- Vt(e), L(!0);
270
+ I(e), P(!0);
271
271
  }, xn = (e) => {
272
- Vt(e), L(!0);
272
+ I(e), P(!0);
273
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 = "";
@@ -316,13 +316,13 @@ function d() {
316
316
  variant: "danger",
317
317
  onConfirm: async () => {
318
318
  try {
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", {
319
+ await Xt.mutateAsync({ id: e.id }), Re("success"), b.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
- 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", {
325
+ b.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"
@@ -332,12 +332,12 @@ function d() {
332
332
  });
333
333
  }, wn = async (e) => {
334
334
  try {
335
- await Qt.mutateAsync({ id: e.id }), C.success(a(d, "files.file.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.file.restored", {
335
+ await Qt.mutateAsync({ id: e.id }), b.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
- C.error(e instanceof Error ? e.message : a(d, "files.file.errors.restoreFailed", "Failed to restore file"));
340
+ b.error(e instanceof Error ? e.message : a(d, "files.file.errors.restoreFailed", "Failed to restore file"));
341
341
  }
342
342
  }, Tn = async (e) => {
343
343
  Le("heavy"), Y({
@@ -347,13 +347,13 @@ function d() {
347
347
  variant: "danger",
348
348
  onConfirm: async () => {
349
349
  try {
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", {
350
+ await en.mutateAsync({ id: e.id }), b.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
- C.error(e instanceof Error ? e.message : a(d, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
356
+ b.error(e instanceof Error ? e.message : a(d, "files.file.errors.permanentDeleteFailed", "Failed to permanently delete file"));
357
357
  }
358
358
  }
359
359
  });
@@ -368,7 +368,7 @@ function d() {
368
368
  starred: !e.starred
369
369
  });
370
370
  } catch {
371
- C.error(a(d, "files.file.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
371
+ b.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
  });
@@ -378,31 +378,31 @@ function d() {
378
378
  id: e.id,
379
379
  name: e.name,
380
380
  type: "file"
381
- }), U(e.name), I(!0);
381
+ }), U(e.name), N(!0);
382
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), C.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), b.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
- C.error(e instanceof Error ? e.message : a(d, "files.file.errors.downloadFailed", "Failed to download file"));
392
+ b.error(e instanceof Error ? e.message : a(d, "files.file.errors.downloadFailed", "Failed to download file"));
393
393
  }
394
394
  }, kn = (e) => {
395
395
  Ut({
396
396
  item: e,
397
397
  type: "file"
398
- }), zt(!0);
398
+ }), Vt(!0);
399
399
  }, An = (e) => {
400
- Ht({
400
+ R({
401
401
  item: e,
402
402
  type: "file"
403
- }), Lt(!0);
403
+ }), F(!0);
404
404
  }, jn = (e) => {
405
- Et({
405
+ kt({
406
406
  item: e,
407
407
  type: "file"
408
408
  });
@@ -419,24 +419,24 @@ function d() {
419
419
  await Zt.mutateAsync({
420
420
  id: e.id,
421
421
  recursive: !0
422
- }), C.success(a(d, "files.folder.delete.success", "\"{{name}}\" moved to bin", { name: e.name })), X("files.folder.deleted", {
422
+ }), b.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
- C.error(e instanceof Error ? e.message : a(d, "files.folder.errors.deleteFailed", "Failed to delete folder"));
428
+ b.error(e instanceof Error ? e.message : a(d, "files.folder.errors.deleteFailed", "Failed to delete folder"));
429
429
  }
430
430
  }
431
431
  });
432
432
  }, Pn = async (e) => {
433
433
  try {
434
- await $t.mutateAsync({ id: e.id }), C.success(a(d, "files.folder.restore.success", "\"{{name}}\" restored", { name: e.name })), X("files.folder.restored", {
434
+ await $t.mutateAsync({ id: e.id }), b.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
- C.error(e instanceof Error ? e.message : a(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
439
+ b.error(e instanceof Error ? e.message : a(d, "files.folder.errors.restoreFailed", "Failed to restore folder"));
440
440
  }
441
441
  }, Fn = async (e) => {
442
442
  Y({
@@ -446,13 +446,13 @@ function d() {
446
446
  variant: "danger",
447
447
  onConfirm: async () => {
448
448
  try {
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", {
449
+ await tn.mutateAsync({ id: e.id }), b.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
- C.error(e instanceof Error ? e.message : a(d, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
455
+ b.error(e instanceof Error ? e.message : a(d, "files.folder.errors.permanentDeleteFailed", "Failed to permanently delete folder"));
456
456
  }
457
457
  }
458
458
  });
@@ -461,12 +461,12 @@ function d() {
461
461
  id: e.id,
462
462
  name: e.name,
463
463
  type: "folder"
464
- }), U(e.name), I(!0);
464
+ }), U(e.name), N(!0);
465
465
  }, Ln = (e) => {
466
- Ht({
466
+ R({
467
467
  item: e,
468
468
  type: "folder"
469
- }), Lt(!0);
469
+ }), F(!0);
470
470
  }, Rn = async (e) => {
471
471
  try {
472
472
  await nn.mutateAsync({
@@ -478,38 +478,38 @@ function d() {
478
478
  starred: !e.starred
479
479
  });
480
480
  } catch {
481
- C.error(a(d, "files.folder.errors.starFailed", "Failed to update starred state")), X("files.api.failed", {
481
+ b.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
486
  }, zn = (e) => {
487
- Et({
487
+ kt({
488
488
  item: e,
489
489
  type: "folder"
490
490
  });
491
491
  }, Bn = async (e) => {
492
- if (R) try {
493
- R.type === "file" ? (await sn.mutateAsync({
494
- fileId: R.item.id,
492
+ if (L) try {
493
+ L.type === "file" ? (await sn.mutateAsync({
494
+ fileId: L.item.id,
495
495
  targetFolderId: e || null
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,
496
+ }), b.success(a(d, "files.file.move.success", "\"{{name}}\" moved", { name: L.item.name })), X("files.file.moved", {
497
+ fileId: L.item.id,
498
+ fileName: L.item.name,
499
499
  destinationFolderId: e
500
500
  })) : (await cn.mutateAsync({
501
- folderId: R.item.id,
501
+ folderId: L.item.id,
502
502
  targetParentFolderId: e
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,
503
+ }), b.success(a(d, "files.folder.move.success", "\"{{name}}\" moved", { name: L.item.name })), X("files.folder.moved", {
504
+ folderId: L.item.id,
505
+ folderName: L.item.name,
506
506
  destinationFolderId: e
507
- })), Lt(!1), Ht(null);
507
+ })), F(!1), R(null);
508
508
  } catch (e) {
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,
509
+ b.error(e instanceof Error ? e.message : a(d, "files.item.errors.moveFailed", "Failed to move \"{{name}}\"", { name: L.item.name })), X("files.api.failed", {
510
+ action: L.type === "file" ? "moveFile" : "moveFolder",
511
+ itemId: L.item.id,
512
+ itemType: L.type,
513
513
  message: e instanceof Error ? e.message : void 0
514
514
  });
515
515
  }
@@ -520,13 +520,13 @@ function d() {
520
520
  id: z.item.id,
521
521
  newName: t || `Copy of ${z.item.name}`,
522
522
  targetFolderId: e || void 0
523
- }), C.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: z.item.name })), X("files.file.copied", {
523
+ }), b.success(a(d, "files.file.copy.success", "\"{{name}}\" copied", { name: z.item.name })), X("files.file.copied", {
524
524
  fileId: z.item.id,
525
525
  fileName: z.item.name,
526
526
  destinationFolderId: e
527
- }), zt(!1), Ut(null);
527
+ }), Vt(!1), Ut(null);
528
528
  } catch (e) {
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", {
529
+ b.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
531
  fileId: z.item.id,
532
532
  message: e instanceof Error ? e.message : void 0
@@ -538,20 +538,20 @@ function d() {
538
538
  B.type === "file" ? (await Q.mutateAsync({
539
539
  fileId: B.id,
540
540
  newName: t
541
- }), C.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.file.renamed", {
541
+ }), b.success(a(d, "files.file.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.file.renamed", {
542
542
  fileId: B.id,
543
543
  previousName: e,
544
544
  name: t
545
545
  })) : (await $.mutateAsync({
546
546
  folderId: B.id,
547
547
  newName: t
548
- }), C.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.folder.renamed", {
548
+ }), b.success(a(d, "files.folder.rename.success", "Renamed \"{{name}}\"", { name: t })), X("files.folder.renamed", {
549
549
  folderId: B.id,
550
550
  previousName: e,
551
551
  name: t
552
- })), I(!1), V(null), U("");
552
+ })), N(!1), V(null), U("");
553
553
  } catch (e) {
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", {
554
+ b.error(e instanceof Error ? e.message : a(d, "files.item.errors.renameFailed", "Failed to rename {{type}}", { type: B.type })), X("files.api.failed", {
555
555
  action: B.type === "file" ? "renameFile" : "renameFolder",
556
556
  itemId: B.id,
557
557
  itemType: B.type,
@@ -560,13 +560,13 @@ function d() {
560
560
  }
561
561
  };
562
562
  return n({
563
- files: k,
564
- folders: A,
563
+ files: E,
564
+ folders: D,
565
565
  onFilePreview: yn,
566
566
  onFileDelete: Cn,
567
567
  onFolderOpen: Mn,
568
568
  onFolderDelete: Nn,
569
- activeTab: v
569
+ activeTab: _
570
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", {
@@ -625,7 +625,7 @@ function d() {
625
625
  })
626
626
  ]
627
627
  }),
628
- !x && /* @__PURE__ */ c("div", {
628
+ !v && /* @__PURE__ */ c("div", {
629
629
  className: "px-4 pt-3 sm:px-6",
630
630
  children: /* @__PURE__ */ c(lt, {
631
631
  storageKey: "files-browser",
@@ -650,14 +650,14 @@ function d() {
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: () => y("starred")
653
+ onClick: () => St("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: () => y("bin")
660
+ onClick: () => St("bin")
661
661
  }
662
662
  ]
663
663
  })
@@ -665,9 +665,9 @@ function d() {
665
665
  /* @__PURE__ */ c("div", {
666
666
  "data-tour": "files-tab-bar",
667
667
  children: /* @__PURE__ */ c(we, {
668
- activeTab: v,
669
- onTabChange: y,
670
- tabs: xt
668
+ activeTab: _,
669
+ onTabChange: St,
670
+ tabs: Ct
671
671
  })
672
672
  }),
673
673
  /* @__PURE__ */ l("div", {
@@ -682,29 +682,32 @@ function d() {
682
682
  className: "relative w-full max-w-2xl",
683
683
  children: /* @__PURE__ */ c(Ae, {
684
684
  onSearch: (e, t) => {
685
- St(e), wt(t);
685
+ Tt(e), Dt(t);
686
686
  },
687
687
  placeholder: a(d, "files.search.input.placeholder", "Search files and folders..."),
688
- initialQuery: b,
688
+ initialQuery: wt,
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: [!x && /* @__PURE__ */ c("div", {
694
+ children: [!v && /* @__PURE__ */ l("div", {
695
+ className: "flex items-center gap-2",
695
696
  "data-tour": "files-upload-files-button",
696
- children: /* @__PURE__ */ c(it, {
697
- primary: {
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
- },
703
- actions: [
697
+ children: [/* @__PURE__ */ l(u, {
698
+ type: "button",
699
+ variant: "default",
700
+ onClick: un,
701
+ disabled: Wt,
702
+ children: [Wt ? /* @__PURE__ */ c(s, { className: "size-4 animate-spin" }) : /* @__PURE__ */ c(Ze, { className: "size-4" }), Wt ? a(d, "files.browser.upload.uploading", "Uploading...") : a(d, "files.browser.actions.uploadFiles", "Upload Files")]
703
+ }), /* @__PURE__ */ c("div", {
704
+ "data-tour": "files-more-actions-trigger",
705
+ children: /* @__PURE__ */ c(it, { actions: [
704
706
  {
705
707
  label: a(d, "files.browser.actions.newFolder", "New Folder"),
706
708
  icon: /* @__PURE__ */ c(Ue, { className: "size-4" }),
707
- onSelect: _n
709
+ onSelect: _n,
710
+ dataTour: "files-new-folder-button"
708
711
  },
709
712
  {
710
713
  label: a(d, "files.browser.actions.uploadFolder", "Upload Folder"),
@@ -712,15 +715,15 @@ function d() {
712
715
  onSelect: gn,
713
716
  disabled: Wt
714
717
  },
715
- ...k.length > 0 || A.length > 0 ? [{
718
+ ...E.length > 0 || D.length > 0 ? [{
716
719
  label: a(d, "files.browser.actions.selectAll", "Select All"),
717
720
  onSelect: () => {
718
- let e = k.map((e) => e.id), n = A.map((e) => e.id);
721
+ let e = E.map((e) => e.id), n = D.map((e) => e.id);
719
722
  t.getState().selectAllFiles(e), n.forEach((e) => t.getState().selectFolder(e));
720
723
  }
721
724
  }] : []
722
- ]
723
- })
725
+ ] })
726
+ })]
724
727
  }), /* @__PURE__ */ l("div", {
725
728
  className: "flex items-center border border-border-seam rounded-lg overflow-hidden",
726
729
  "data-tour": "files-view-mode-toggle",
@@ -740,37 +743,37 @@ function d() {
740
743
  })]
741
744
  })]
742
745
  }),
743
- x && /* @__PURE__ */ l("div", {
746
+ v && /* @__PURE__ */ l("div", {
744
747
  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
748
  children: [/* @__PURE__ */ l("span", {
746
749
  className: "text-sm font-medium text-status-success-text",
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)`]
750
+ children: [a(d, "files.browser.search.showingResults", "Showing search results for \"{{query}}\"", { query: wt }), T.data && ` (${(T.data.files?.length || 0) + (T.data.folders?.length || 0)} items)`]
748
751
  }), /* @__PURE__ */ l("button", {
749
752
  type: "button",
750
- onClick: () => St(""),
753
+ onClick: () => Tt(""),
751
754
  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
755
  children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(d, "files.browser.search.clear", "Clear search")]
753
756
  })]
754
757
  }),
755
- P > 0 && /* @__PURE__ */ l(at, {
758
+ j > 0 && /* @__PURE__ */ l(at, {
756
759
  className: "mt-3 flex items-center justify-between p-3",
757
760
  children: [/* @__PURE__ */ l("div", {
758
761
  className: "flex items-center gap-4",
759
762
  children: [/* @__PURE__ */ c("span", {
760
763
  className: "text-sm font-medium text-text-primary",
761
764
  children: a(d, "files.browser.selection.selectedCount", "{{count}} item{{suffix}} selected", {
762
- count: P,
763
- suffix: P > 1 ? "s" : ""
765
+ count: j,
766
+ suffix: j > 1 ? "s" : ""
764
767
  })
765
768
  }), /* @__PURE__ */ c("div", {
766
769
  className: "flex items-center gap-2",
767
- children: v === "bin" ? /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c("button", {
770
+ children: _ === "bin" ? /* @__PURE__ */ l($e, { children: [/* @__PURE__ */ c("button", {
768
771
  type: "button",
769
772
  onClick: async () => {
770
773
  try {
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`);
774
+ await Promise.all([...Array.from(h).map((e) => Qt.mutateAsync({ id: e })), ...Array.from(g).map((e) => $t.mutateAsync({ id: e }))]), xt(), b.success(`${j} item${j > 1 ? "s" : ""} restored`);
772
775
  } catch (e) {
773
- C.error(e instanceof Error ? e.message : "Failed to restore some items");
776
+ b.error(e instanceof Error ? e.message : "Failed to restore some items");
774
777
  }
775
778
  },
776
779
  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 +784,19 @@ function d() {
781
784
  Y({
782
785
  title: a(d, "files.confirm.bulkPermanentDelete.title", "Permanently delete selected items"),
783
786
  description: a(d, "files.confirm.bulkPermanentDelete.description", "Permanently delete {{count}} selected item{{plural}}? This cannot be undone.", {
784
- count: P,
785
- plural: P > 1 ? "s" : ""
787
+ count: j,
788
+ plural: j > 1 ? "s" : ""
786
789
  }),
787
790
  confirmLabel: a(d, "files.common.actions.deletePermanently", "Delete permanently"),
788
791
  variant: "danger",
789
792
  onConfirm: async () => {
790
793
  try {
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
+ await Promise.all([...Array.from(h).map((e) => en.mutateAsync({ id: e })), ...Array.from(g).map((e) => tn.mutateAsync({ id: e }))]), xt(), b.success(a(d, "files.bulk.permanentDelete.success", "{{count}} item{{plural}} deleted permanently", {
795
+ count: j,
796
+ plural: j > 1 ? "s" : ""
794
797
  }));
795
798
  } catch (e) {
796
- C.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
799
+ b.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.permanentDeleteFailed", "Failed to permanently delete some items"));
797
800
  }
798
801
  }
799
802
  });
@@ -806,8 +809,8 @@ function d() {
806
809
  Y({
807
810
  title: a(d, "files.confirm.bulkDelete.title", "Delete selected items"),
808
811
  description: a(d, "files.confirm.bulkDelete.description", "Move {{count}} selected item{{plural}} to the bin?", {
809
- count: P,
810
- plural: P > 1 ? "s" : ""
812
+ count: j,
813
+ plural: j > 1 ? "s" : ""
811
814
  }),
812
815
  confirmLabel: a(d, "files.common.actions.delete", "Delete"),
813
816
  variant: "danger",
@@ -817,12 +820,12 @@ function d() {
817
820
  e.length > 0 && await ln.mutateAsync(e), await Promise.all(t.map((e) => Zt.mutateAsync({
818
821
  id: e,
819
822
  recursive: !0
820
- }))), _(), C.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
821
- count: P,
822
- plural: P > 1 ? "s" : ""
823
+ }))), xt(), b.success(a(d, "files.bulk.delete.success", "{{count}} item{{plural}} moved to bin", {
824
+ count: j,
825
+ plural: j > 1 ? "s" : ""
823
826
  }));
824
827
  } catch (e) {
825
- C.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
828
+ b.error(e instanceof Error ? e.message : a(d, "files.bulk.errors.deleteFailed", "Failed to delete some items"));
826
829
  }
827
830
  }
828
831
  });
@@ -833,7 +836,7 @@ function d() {
833
836
  })]
834
837
  }), /* @__PURE__ */ l("button", {
835
838
  type: "button",
836
- onClick: _,
839
+ onClick: xt,
837
840
  className: "flex items-center gap-2 text-text-link hover:text-action-primary-bg-hover text-sm font-medium transition-colors duration-200",
838
841
  children: [/* @__PURE__ */ c(Qe, { className: "size-4" }), a(d, "files.common.actions.clear", "Clear")]
839
842
  })]
@@ -848,38 +851,38 @@ function d() {
848
851
  className: "px-2 sm:px-4 md:px-6 py-3 sm:py-4",
849
852
  "data-tour": "files-browser-grid",
850
853
  children: [/* @__PURE__ */ c(Ce, {
851
- files: k,
852
- folders: A,
853
- loading: j,
854
- error: M,
855
- preserveSortOrder: N,
854
+ files: E,
855
+ folders: D,
856
+ loading: O,
857
+ error: k,
858
+ preserveSortOrder: A,
856
859
  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,
860
+ onFileShare: _ === "bin" ? void 0 : bn,
861
+ onFileDelete: _ === "bin" ? Tn : Cn,
862
+ onFileRestore: _ === "bin" ? wn : void 0,
863
+ onFileFavorite: _ === "bin" ? void 0 : En,
864
+ onFileRename: _ === "bin" ? void 0 : Dn,
862
865
  onFileDownload: On,
863
- onFileCopy: v === "bin" ? void 0 : kn,
864
- onFileMove: v === "bin" ? void 0 : An,
866
+ onFileCopy: _ === "bin" ? void 0 : kn,
867
+ onFileMove: _ === "bin" ? void 0 : An,
865
868
  onFileInfo: jn,
866
869
  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,
870
+ onFolderShare: _ === "bin" ? void 0 : xn,
871
+ onFolderDelete: _ === "bin" ? Fn : Nn,
872
+ onFolderRestore: _ === "bin" ? Pn : void 0,
873
+ onFolderRename: _ === "bin" ? void 0 : In,
874
+ onFolderFavorite: _ === "bin" ? void 0 : Rn,
875
+ onFolderMove: _ === "bin" ? void 0 : Ln,
873
876
  onFolderInfo: zn
874
- }), !j && (k.length > 0 || A.length > 0) && /* @__PURE__ */ l("div", {
877
+ }), !O && (E.length > 0 || D.length > 0) && /* @__PURE__ */ l("div", {
875
878
  className: "mt-4 px-2 text-sm text-text-secondary",
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 })}`]
879
+ children: [a(d, "files.browser.results.showingItems", "Showing {{count}} items", { count: E.length + D.length }), !v && _ === "all" && jt !== null && ` ${a(d, "files.browser.results.ofItems", "of {{count}} items", { count: jt })}`]
877
880
  })]
878
881
  }),
879
- kt && /* @__PURE__ */ c(dt, {
882
+ Mt && /* @__PURE__ */ c(dt, {
880
883
  open: !0,
881
884
  onOpenChange: (e) => {
882
- !e && !Z.isPending && (F(!1), G(""));
885
+ !e && !Z.isPending && (M(!1), G(""));
883
886
  },
884
887
  children: /* @__PURE__ */ l(ft, {
885
888
  className: "w-full max-w-xs",
@@ -906,7 +909,7 @@ function d() {
906
909
  type: "button",
907
910
  variant: "outline",
908
911
  onClick: () => {
909
- F(!1), G("");
912
+ M(!1), G("");
910
913
  },
911
914
  children: a(d, "files.common.actions.cancel", "Cancel")
912
915
  }), /* @__PURE__ */ l(u, {
@@ -918,10 +921,10 @@ function d() {
918
921
  ]
919
922
  })
920
923
  }),
921
- Pt && B && /* @__PURE__ */ c(dt, {
924
+ Lt && B && /* @__PURE__ */ c(dt, {
922
925
  open: !0,
923
926
  onOpenChange: (e) => {
924
- !e && !Q.isPending && !$.isPending && (I(!1), V(null), U(""));
927
+ !e && !Q.isPending && !$.isPending && (N(!1), V(null), U(""));
925
928
  },
926
929
  children: /* @__PURE__ */ l(ft, {
927
930
  className: "w-full max-w-xs",
@@ -948,7 +951,7 @@ function d() {
948
951
  type: "button",
949
952
  variant: "outline",
950
953
  onClick: () => {
951
- I(!1), V(null), U("");
954
+ N(!1), V(null), U("");
952
955
  },
953
956
  children: a(d, "files.common.actions.cancel", "Cancel")
954
957
  }), /* @__PURE__ */ l(u, {
@@ -960,11 +963,11 @@ function d() {
960
963
  ]
961
964
  })
962
965
  }),
963
- Ft && Bt && /* @__PURE__ */ c(Te, {
964
- item: Bt,
965
- itemType: "mimeType" in Bt ? "file" : "folder",
966
+ Rt && Ht && /* @__PURE__ */ c(Te, {
967
+ item: Ht,
968
+ itemType: "mimeType" in Ht ? "file" : "folder",
966
969
  onClose: () => {
967
- L(!1), Vt(null);
970
+ P(!1), I(null);
968
971
  },
969
972
  onCreateShare: Sn,
970
973
  isLoading: rn.isPending
@@ -981,60 +984,60 @@ function d() {
981
984
  J.loading || Y(null);
982
985
  }
983
986
  }),
984
- At && /* @__PURE__ */ c(Ne, {
987
+ Nt && /* @__PURE__ */ c(Ne, {
985
988
  title: a(d, "files.folder.quota.title", "Folder Limit Reached"),
986
989
  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
990
  confirmLabel: a(d, "files.folder.quota.upgrade", "View Billing"),
988
991
  cancelLabel: a(d, "files.common.actions.dismiss", "Dismiss"),
989
992
  onConfirm: () => {
990
- jt(!1), p("/billing");
993
+ Pt(!1), p("/billing");
991
994
  },
992
- onCancel: () => jt(!1)
995
+ onCancel: () => Pt(!1)
993
996
  }),
994
- Mt && /* @__PURE__ */ c(Ne, {
997
+ Ft && /* @__PURE__ */ c(Ne, {
995
998
  title: a(d, "files.storage.quota.title", "Storage Limit Reached"),
996
999
  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
1000
  confirmLabel: a(d, "files.storage.quota.upgrade", "View Billing"),
998
1001
  cancelLabel: a(d, "files.common.actions.dismiss", "Dismiss"),
999
1002
  onConfirm: () => {
1000
- Nt(!1), p("/billing");
1003
+ It(!1), p("/billing");
1001
1004
  },
1002
- onCancel: () => Nt(!1)
1005
+ onCancel: () => It(!1)
1003
1006
  }),
1004
- It && R && /* @__PURE__ */ c(je, {
1005
- item: R.item,
1006
- type: R.type,
1007
+ zt && L && /* @__PURE__ */ c(je, {
1008
+ item: L.item,
1009
+ type: L.type,
1007
1010
  onClose: () => {
1008
- Lt(!1), Ht(null);
1011
+ F(!1), R(null);
1009
1012
  },
1010
1013
  onMove: Bn,
1011
1014
  isLoading: sn.isPending || cn.isPending
1012
1015
  }),
1013
- Rt && z && /* @__PURE__ */ c(Me, {
1016
+ Bt && z && /* @__PURE__ */ c(Me, {
1014
1017
  item: z.item,
1015
1018
  type: z.type,
1016
1019
  onClose: () => {
1017
- zt(!1), Ut(null);
1020
+ Vt(!1), Ut(null);
1018
1021
  },
1019
1022
  onCopy: Vn,
1020
1023
  isLoading: on.isPending
1021
1024
  }),
1022
- S && /* @__PURE__ */ c(Ee, {
1023
- file: S,
1024
- onClose: () => Dt(null),
1025
+ y && /* @__PURE__ */ c(Ee, {
1026
+ file: y,
1027
+ onClose: () => At(null),
1025
1028
  onDownload: () => {
1026
- ze(S.downloadUrl || S.url);
1029
+ ze(y.downloadUrl || y.url);
1027
1030
  },
1028
- onShare: v === "bin" ? void 0 : () => {
1029
- Vt(S), L(!0);
1031
+ onShare: _ === "bin" ? void 0 : () => {
1032
+ I(y), P(!0);
1030
1033
  },
1031
- onStar: v === "bin" ? void 0 : () => En(S),
1032
- onDelete: () => v === "bin" ? Tn(S) : Cn(S)
1034
+ onStar: _ === "bin" ? void 0 : () => En(y),
1035
+ onDelete: () => _ === "bin" ? Tn(y) : Cn(y)
1033
1036
  }),
1034
- Tt && /* @__PURE__ */ c(De, {
1035
- item: Tt.item,
1036
- type: Tt.type,
1037
- onClose: () => Et(null)
1037
+ Ot && /* @__PURE__ */ c(De, {
1038
+ item: Ot.item,
1039
+ type: Ot.type,
1040
+ onClose: () => kt(null)
1038
1041
  }),
1039
1042
  /* @__PURE__ */ c(Pe, {
1040
1043
  items: Gt,
@@ -1046,26 +1049,26 @@ function d() {
1046
1049
  onCancel: hn
1047
1050
  }),
1048
1051
  /* @__PURE__ */ c(ke, {
1049
- toasts: C.toasts,
1050
- onClose: C.removeToast
1052
+ toasts: b.toasts,
1053
+ onClose: b.removeToast
1051
1054
  }),
1052
- !j && k.length === 0 && A.length === 0 && /* @__PURE__ */ c("div", {
1055
+ !O && E.length === 0 && D.length === 0 && /* @__PURE__ */ c("div", {
1053
1056
  className: "px-6 py-12",
1054
- children: x ? /* @__PURE__ */ c(st, {
1057
+ children: v ? /* @__PURE__ */ c(st, {
1055
1058
  illustration: "empty-search",
1056
1059
  title: a(d, "files.browser.empty.search.title", "No results found"),
1057
1060
  description: a(d, "files.browser.empty.search.description", "Try adjusting your search query or filters"),
1058
1061
  action: /* @__PURE__ */ c(u, {
1059
1062
  type: "button",
1060
1063
  onClick: () => {
1061
- St(""), wt(void 0);
1064
+ Tt(""), Dt(void 0);
1062
1065
  },
1063
1066
  children: a(d, "files.browser.search.clear", "Clear search")
1064
1067
  })
1065
1068
  }) : /* @__PURE__ */ c(Oe, {
1066
- type: v,
1067
- onUpload: v === "all" ? un : void 0,
1068
- onNewFolder: v === "all" ? _n : void 0
1069
+ type: _,
1070
+ onUpload: _ === "all" ? un : void 0,
1071
+ onNewFolder: _ === "all" ? _n : void 0
1069
1072
  })
1070
1073
  })
1071
1074
  ]