@w100n/documents 0.18.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4993,7 +4993,7 @@ var init_wiki = __esm({
4993
4993
  var version;
4994
4994
  var init_package = __esm({
4995
4995
  "package.json"() {
4996
- version = "0.18.1";
4996
+ version = "0.19.0";
4997
4997
  }
4998
4998
  });
4999
4999
 
@@ -11058,15 +11058,15 @@ function changes2(before, after) {
11058
11058
  }
11059
11059
  function Compare({ host, documentId, kind, older, t }) {
11060
11060
  const rows = useLoad(async (signal) => changes2(await textOf2(kind, older), await textOf2(kind, await host.content(documentId, null, { signal }))), [host, documentId, older]);
11061
- if (rows.error) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w100n-docs-empty", children: t.failed });
11062
- if (!rows.data) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
11061
+ if (rows.error) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-empty", children: t.failed });
11062
+ if (!rows.data) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
11063
11063
  const added = rows.data.filter((r) => r.op === "+").length, removed = rows.data.filter((r) => r.op === "-").length, edited = rows.data.filter((r) => r.op === "~").length;
11064
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "w100n-docs-page w100n-compare", children: [
11065
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "w100n-compare-sum", children: added + removed + edited ? t.changeCount.replace("{added}", String(added)).replace("{edited}", String(edited)).replace("{removed}", String(removed)) : t.noChanges }),
11066
- rows.data.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { "data-op": r.op, children: r.parts.map((p, k) => p.op === "=" ? p.text : p.op === "+" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ins", { children: p.text }, k) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("del", { children: p.text }, k)) }, i))
11064
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-page w100n-compare", children: [
11065
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-compare-sum", children: added + removed + edited ? t.changeCount.replace("{added}", String(added)).replace("{edited}", String(edited)).replace("{removed}", String(removed)) : t.noChanges }),
11066
+ rows.data.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { "data-op": r.op, children: r.parts.map((p, k) => p.op === "=" ? p.text : p.op === "+" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ins", { children: p.text }, k) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("del", { children: p.text }, k)) }, i))
11067
11067
  ] }) });
11068
11068
  }
11069
- var import_jsx_runtime16, words2, alike;
11069
+ var import_jsx_runtime17, words2, alike;
11070
11070
  var init_Compare = __esm({
11071
11071
  "src/Compare.tsx"() {
11072
11072
  "use strict";
@@ -11074,7 +11074,7 @@ var init_Compare = __esm({
11074
11074
  init_diff();
11075
11075
  init_markdown();
11076
11076
  init_useLoad();
11077
- import_jsx_runtime16 = require("react/jsx-runtime");
11077
+ import_jsx_runtime17 = require("react/jsx-runtime");
11078
11078
  words2 = (text) => text.split(/(\s+)/).filter(Boolean);
11079
11079
  alike = (a, b) => {
11080
11080
  const x = a.split(/\s+/).filter(Boolean), y = b.split(/\s+/).filter(Boolean);
@@ -11091,6 +11091,7 @@ __export(index_exports, {
11091
11091
  FilePreview: () => FilePreview,
11092
11092
  GuestDocument: () => GuestDocument,
11093
11093
  GuestRefused: () => GuestRefused,
11094
+ PreviewCard: () => PreviewCard,
11094
11095
  SlidesView: () => SlidesView,
11095
11096
  kindOf: () => kindOf,
11096
11097
  kinds: () => kinds,
@@ -14289,6 +14290,19 @@ function Sharing({ host, doc, t, language, team }) {
14289
14290
  // src/DocumentsWorkspace.tsx
14290
14291
  init_text();
14291
14292
 
14293
+ // src/PreviewCard.tsx
14294
+ var import_jsx_runtime14 = require("react/jsx-runtime");
14295
+ function PreviewCard({ thumb, icon, title, lines: lines2 }) {
14296
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-card", children: [
14297
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-card-thumb", children: thumb }),
14298
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-card-title", children: [
14299
+ icon,
14300
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: title })
14301
+ ] }),
14302
+ lines2.filter(Boolean).map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: line }, i))
14303
+ ] });
14304
+ }
14305
+
14292
14306
  // src/Thumb.tsx
14293
14307
  var import_react17 = require("react");
14294
14308
 
@@ -14343,7 +14357,7 @@ function preview(host, doc) {
14343
14357
  }
14344
14358
 
14345
14359
  // src/Thumb.tsx
14346
- var import_jsx_runtime14 = require("react/jsx-runtime");
14360
+ var import_jsx_runtime15 = require("react/jsx-runtime");
14347
14361
  function Thumb({ host, item, label }) {
14348
14362
  const box2 = (0, import_react17.useRef)(null);
14349
14363
  const [seen2, setSeen] = (0, import_react17.useState)(false);
@@ -14369,26 +14383,26 @@ function Thumb({ host, item, label }) {
14369
14383
  const text = item.excerpt ?? shot?.text ?? "";
14370
14384
  const lines2 = text.split("\n").filter((line) => !line.trim().startsWith("```")).map((line) => line.replace(/^#+\s*/, "").replace(/[*_`>|]/g, "").trim()).filter(Boolean);
14371
14385
  const image = item.thumbnailUrl ?? shot?.image;
14372
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { ref: box2, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
14373
- image ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: image, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines2.length ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
14374
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: lines2[0] }),
14386
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { ref: box2, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
14387
+ image ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: image, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines2.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
14388
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: lines2[0] }),
14375
14389
  lines2.slice(1, 14).join(" ")
14376
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
14377
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
14378
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
14379
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
14380
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
14381
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {})
14390
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
14391
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
14392
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
14393
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
14394
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
14395
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {})
14382
14396
  ] }) }),
14383
- label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
14397
+ label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
14384
14398
  ] });
14385
14399
  }
14386
14400
 
14387
14401
  // src/Tree.tsx
14388
14402
  var import_react18 = require("react");
14389
14403
  var import_lucide_react12 = require("lucide-react");
14390
- var import_jsx_runtime15 = require("react/jsx-runtime");
14391
- var icons3 = { docx: import_lucide_react12.FileText, markdown: import_lucide_react12.FileType, pdf: import_lucide_react12.Files, sheet: import_lucide_react12.FileSpreadsheet, slides: import_lucide_react12.Presentation };
14404
+ var import_jsx_runtime16 = require("react/jsx-runtime");
14405
+ var icons3 = { docx: import_lucide_react12.FileText, markdown: import_lucide_react12.FileType, pdf: import_lucide_react12.File, sheet: import_lucide_react12.FileSpreadsheet, slides: import_lucide_react12.Presentation };
14392
14406
  var dragged = "application/x-w100n-document";
14393
14407
  function grow(items, folders, names2, spaceId, other) {
14394
14408
  const root = { key: "", name: "", at: spaceId ? { spaceId, folder: "" } : null, folders: [], files: [], count: 0 };
@@ -14429,7 +14443,7 @@ var remembered = () => {
14429
14443
  return /* @__PURE__ */ new Set();
14430
14444
  }
14431
14445
  };
14432
- function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen, onMenu, onFolderMenu, onMove, onEdit, onEditDone, onWarm }) {
14446
+ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits, onOpen, onMenu, onFolderMenu, onMove, onEdit, onEditDone, onWarm }) {
14433
14447
  const [closed2, setClosed] = (0, import_react18.useState)(remembered);
14434
14448
  const [over, setOver] = (0, import_react18.useState)(null);
14435
14449
  const flip = (key2) => {
@@ -14438,7 +14452,7 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
14438
14452
  setClosed(next);
14439
14453
  localStorage.setItem("w100n-docs-closed", JSON.stringify([...next]));
14440
14454
  };
14441
- const field = (pad, label) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
14455
+ const field = (pad, label) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14442
14456
  "input",
14443
14457
  {
14444
14458
  className: "w100n-tree-row w100n-tree-input",
@@ -14475,12 +14489,12 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
14475
14489
  onMove(id, b.at);
14476
14490
  }
14477
14491
  } : {};
14478
- const branch = (b, depth) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
14492
+ const branch = (b, depth) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
14479
14493
  edit?.key === `new:${b.key}` && field(24 + depth * 16, t.folderName),
14480
14494
  b.folders.map((f) => {
14481
14495
  const open = !closed2.has(f.key) || edit?.key === `new:${f.key}`;
14482
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { role: "group", "aria-label": f.name, "data-over": over === f.key || void 0, ...target(f), children: [
14483
- edit?.key === `dir:${f.key}` ? field(24 + depth * 16, t.renameFolder) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
14496
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { role: "group", "aria-label": f.name, "data-over": over === f.key || void 0, ...target(f), children: [
14497
+ edit?.key === `dir:${f.key}` ? field(24 + depth * 16, t.renameFolder) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
14484
14498
  "button",
14485
14499
  {
14486
14500
  type: "button",
@@ -14494,10 +14508,10 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
14494
14508
  onFolderMenu(f.at, f.key, e);
14495
14509
  } : void 0,
14496
14510
  children: [
14497
- open ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react12.ChevronDown, { "aria-hidden": true, className: "w100n-tree-fold" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react12.ChevronRight, { "aria-hidden": true, className: "w100n-tree-fold" }),
14498
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react12.Folder, { "aria-hidden": true }),
14499
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: f.name }),
14500
- f.count > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: f.count })
14511
+ open ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react12.ChevronDown, { "aria-hidden": true, className: "w100n-tree-fold" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react12.ChevronRight, { "aria-hidden": true, className: "w100n-tree-fold" }),
14512
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react12.Folder, { "aria-hidden": true }),
14513
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: f.name }),
14514
+ f.count > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: f.count })
14501
14515
  ]
14502
14516
  }
14503
14517
  ),
@@ -14506,8 +14520,9 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
14506
14520
  }),
14507
14521
  b.files.map((item) => {
14508
14522
  const Icon = icons3[item.kind];
14509
- if (edit?.key === `file:${item.id}`) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: field(24 + depth * 16, t.rename) }, item.id);
14510
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
14523
+ if (edit?.key === `file:${item.id}`) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: field(24 + depth * 16, t.rename) }, item.id);
14524
+ const hit = hits?.get(item.id);
14525
+ const row2 = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
14511
14526
  "button",
14512
14527
  {
14513
14528
  type: "button",
@@ -14521,7 +14536,7 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
14521
14536
  e.dataTransfer.effectAllowed = "move";
14522
14537
  },
14523
14538
  onClick: () => onOpen(item),
14524
- onPointerEnter: () => onWarm(item),
14539
+ onPointerEnter: (e) => onWarm(item, e.pointerType === "mouse" ? e.currentTarget.getBoundingClientRect() : void 0),
14525
14540
  onPointerLeave: () => onWarm(null),
14526
14541
  onContextMenu: (e) => {
14527
14542
  e.preventDefault();
@@ -14529,17 +14544,21 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
14529
14544
  onMenu(item, e);
14530
14545
  },
14531
14546
  children: [
14532
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { "aria-hidden": true }),
14533
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: item.name.replace(/\.[^.]+$/, "") }),
14534
- item.kind !== "markdown" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { className: "w100n-tree-kind", children: t.kinds[item.kind] })
14547
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { "aria-hidden": true, "data-kind": item.kind }),
14548
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: item.name.replace(/\.[^.]+$/, "") }),
14549
+ item.kind !== "markdown" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { className: "w100n-tree-kind", children: t.kinds[item.kind] })
14535
14550
  ]
14536
14551
  },
14537
14552
  item.id
14538
14553
  );
14554
+ return hit ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
14555
+ row2,
14556
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { className: "w100n-tree-hit", style: { paddingLeft: 46 + depth * 16 }, children: hit.split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("mark", { children: part }, i) : part) })
14557
+ ] }, item.id) : row2;
14539
14558
  })
14540
14559
  ] });
14541
14560
  const root = grow(items, folders, names2, spaceId, t.elsewhere);
14542
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
14561
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14543
14562
  "nav",
14544
14563
  {
14545
14564
  className: "w100n-tree",
@@ -14557,11 +14576,10 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
14557
14576
 
14558
14577
  // src/DocumentsWorkspace.tsx
14559
14578
  init_useLoad();
14560
- var import_jsx_runtime17 = require("react/jsx-runtime");
14579
+ var import_jsx_runtime18 = require("react/jsx-runtime");
14561
14580
  var TextEditor3 = (0, import_react19.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
14562
14581
  var SheetView3 = (0, import_react19.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
14563
14582
  var Compare2 = (0, import_react19.lazy)(() => Promise.resolve().then(() => (init_Compare(), Compare_exports)));
14564
- var icons4 = { docx: import_lucide_react13.FileText, markdown: import_lucide_react13.FileType, pdf: import_lucide_react13.Files, sheet: import_lucide_react13.FileSpreadsheet, slides: import_lucide_react13.Presentation };
14565
14583
  function DocumentsWorkspace({ host, language = "en", theme = "light", place: place2, onPlace, start, end, aside, actions }) {
14566
14584
  const t = texts[language];
14567
14585
  const [own, setOwn] = (0, import_react19.useState)({ spaceId: null, documentId: null });
@@ -14578,7 +14596,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14578
14596
  const [renamed2, setRenamed] = (0, import_react19.useState)("idle");
14579
14597
  const [statusAt, setStatusAt] = (0, import_react19.useState)(null);
14580
14598
  const [listOpen, setListOpen] = (0, import_react19.useState)(true);
14581
- const [shape3, setShape] = (0, import_react19.useState)(() => typeof localStorage !== "undefined" && localStorage.getItem("w100n-docs-view") === "tree" ? "tree" : "cards");
14582
14599
  const [jump, setJump] = (0, import_react19.useState)(null);
14583
14600
  const finder = (0, import_react19.useRef)(null);
14584
14601
  const [panelOpen, setPanelOpen] = (0, import_react19.useState)(true);
@@ -14644,10 +14661,11 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14644
14661
  el.style.top = `${Math.max(8, Math.min(at2.y, innerHeight - el.offsetHeight - 8))}px`;
14645
14662
  el.style.left = `${Math.max(8, Math.min(at2.x, innerWidth - el.offsetWidth - 8))}px`;
14646
14663
  }, [menu, spot3]);
14647
- const [naming, setNaming] = (0, import_react19.useState)(null);
14648
14664
  const [notice, setNotice] = (0, import_react19.useState)(null);
14649
14665
  const early = (0, import_react19.useRef)(/* @__PURE__ */ new Map());
14650
14666
  const hover = (0, import_react19.useRef)(0);
14667
+ const peeking = (0, import_react19.useRef)(0);
14668
+ const [peek, setPeek] = (0, import_react19.useState)(null);
14651
14669
  (0, import_react19.useEffect)(() => {
14652
14670
  if (!menu && !spot3) return;
14653
14671
  const close = (e) => {
@@ -14735,7 +14753,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14735
14753
  const inside2 = new Map((deep.data ?? []).map((hit2) => [hit2.id, hit2.excerpt]));
14736
14754
  const shown = all.filter((item) => matches(item, query, picked) || inside2.has(item.id) && matches(item, "", picked));
14737
14755
  const present = kinds.filter((item) => all.some((doc2) => doc2.kind === item));
14738
- const folders = spaceId ? [.../* @__PURE__ */ new Set(["", ...shown.map((item) => item.folder ?? "")])].filter((folder2) => shown.some((item) => (item.folder ?? "") === folder2)) : [""];
14739
14756
  const names2 = new Map((spaces.data ?? []).map((item) => [item.id, item.name]));
14740
14757
  const counts = /* @__PURE__ */ new Map();
14741
14758
  for (const item of all) counts.set(item.spaceId, (counts.get(item.spaceId) ?? 0) + 1);
@@ -14750,9 +14767,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14750
14767
  return new Intl.DateTimeFormat(language, { day: "numeric", month: "short", year: "numeric" }).format(new Date(iso));
14751
14768
  };
14752
14769
  const size2 = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1048576 ? `${(bytes / 1024).toFixed(0)} KB` : `${(bytes / 1048576).toFixed(1)} MB`;
14753
- const failed = (retry) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-note", children: [
14770
+ const failed = (retry) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-note", children: [
14754
14771
  t.failed,
14755
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: retry, children: t.retry })
14772
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: retry, children: t.retry })
14756
14773
  ] });
14757
14774
  const { ask, dialog } = useUnsaved(guard, t);
14758
14775
  const side2 = (which, open2) => {
@@ -14861,7 +14878,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14861
14878
  setKept({ id: file.id, state: "failed" });
14862
14879
  }
14863
14880
  };
14864
- const warm = (item) => {
14881
+ const warm = (item, at2) => {
14882
+ clearTimeout(peeking.current);
14883
+ if (at2) peeking.current = window.setTimeout(() => setPeek({ item, x: Math.min(at2.right + 8, innerWidth - 300), y: Math.min(at2.top, innerHeight - 300) }), 500);
14865
14884
  clearTimeout(hover.current);
14866
14885
  hover.current = window.setTimeout(() => {
14867
14886
  if (item.id === here.documentId) return;
@@ -14877,6 +14896,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14877
14896
  early.current.set(item.id, next);
14878
14897
  }, 150);
14879
14898
  };
14899
+ const card = (item) => {
14900
+ const Icon = icons3[item.kind];
14901
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PreviewCard, { thumb: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }), icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { "aria-hidden": true, "data-kind": item.kind }), title: item.name, lines: [
14902
+ [t.kinds[item.kind], size2(item.size), names2.get(item.spaceId), item.folder].filter(Boolean).join(" \xB7 "),
14903
+ item.createdAt && [t.createdOn.replace("{when}", date(item.createdAt)), item.createdBy?.name].filter(Boolean).join(" \xB7 "),
14904
+ [t.updatedOn.replace("{when}", ago(item.updatedAt)), item.updatedBy?.name].filter(Boolean).join(" \xB7 "),
14905
+ inside2.get(item.id)?.split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("mark", { children: part }, i) : part)
14906
+ ] });
14907
+ };
14880
14908
  const act = async (run3, done) => {
14881
14909
  setMenu(null);
14882
14910
  setSpot(null);
@@ -14895,7 +14923,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
14895
14923
  setTimeout(() => URL.revokeObjectURL(url), 1e3);
14896
14924
  };
14897
14925
  const retitle = async (item, draft) => {
14898
- setNaming(null);
14899
14926
  const ext = /\.[^.]+$/.exec(item.name)?.[0] ?? "";
14900
14927
  const name = draft.trim() && (/\.[^.\s]+$/.test(draft.trim()) ? draft.trim() : draft.trim() + ext);
14901
14928
  if (!name || name === item.name) return;
@@ -15007,8 +15034,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15007
15034
  window.addEventListener("keydown", press, true);
15008
15035
  return () => window.removeEventListener("keydown", press, true);
15009
15036
  });
15010
- let stage = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-empty", children: [
15011
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FileText, { "aria-hidden": true }),
15037
+ let stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-empty", children: [
15038
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileText, { "aria-hidden": true }),
15012
15039
  t.pick
15013
15040
  ] });
15014
15041
  if (here.documentId) {
@@ -15016,9 +15043,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15016
15043
  doc.retry();
15017
15044
  content.retry();
15018
15045
  });
15019
- else if (!doc.data || !content.data) stage = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
15020
- else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Compare2, { host, documentId: doc.data.id, kind: doc.data.kind, older: content.data, t }, versionId) });
15021
- else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15046
+ else if (!doc.data || !content.data) stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
15047
+ else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Compare2, { host, documentId: doc.data.id, kind: doc.data.kind, older: content.data, t }, versionId) });
15048
+ else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15022
15049
  TextEditor3,
15023
15050
  {
15024
15051
  kind: doc.data.kind,
@@ -15055,7 +15082,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15055
15082
  },
15056
15083
  doc.data.id
15057
15084
  ) });
15058
- else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15085
+ else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15059
15086
  PdfView,
15060
15087
  {
15061
15088
  bytes: content.data,
@@ -15077,7 +15104,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15077
15104
  },
15078
15105
  `${doc.data.id}:${versionId ?? ""}`
15079
15106
  );
15080
- else if (doc.data.kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15107
+ else if (doc.data.kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15081
15108
  SlidesView,
15082
15109
  {
15083
15110
  html: new TextDecoder().decode(content.data),
@@ -15096,7 +15123,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15096
15123
  },
15097
15124
  doc.data.id
15098
15125
  );
15099
- else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15126
+ else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15100
15127
  SheetView3,
15101
15128
  {
15102
15129
  bytes: content.data,
@@ -15123,9 +15150,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15123
15150
  },
15124
15151
  `${doc.data.id}:${versionId ?? ""}`
15125
15152
  ) });
15126
- else stage = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
15153
+ else stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
15127
15154
  }
15128
- const Kind = doc.data ? icons4[doc.data.kind] : import_lucide_react13.FileText;
15155
+ const Kind = doc.data ? icons3[doc.data.kind] : import_lucide_react13.FileText;
15129
15156
  const top = Math.min(...outline2.map((h) => h.level));
15130
15157
  const chapters = outline2.reduce((all2, h) => {
15131
15158
  if (h.level === top || !all2.length) all2.push({ head: h, subs: [] });
@@ -15148,7 +15175,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15148
15175
  if (text && host.comments && !versionId) panelTabs.push(["comments", import_lucide_react13.MessagesSquare, t.comments]);
15149
15176
  const sharing = !!host.links && !!doc.data?.rights.edit && !versionId;
15150
15177
  if (sharing) panelTabs.push(["sharing", import_lucide_react13.Share2, t.sharing]);
15151
- const listToggle = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15178
+ const listToggle = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15152
15179
  "button",
15153
15180
  {
15154
15181
  ref: listButton,
@@ -15158,10 +15185,10 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15158
15185
  onClick: () => side2("list", !listOpen),
15159
15186
  "aria-label": listOpen ? t.closeList : t.openList,
15160
15187
  title: listOpen ? t.closeList : t.openList,
15161
- children: listOpen ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.PanelLeftOpen, { "aria-hidden": true })
15188
+ children: listOpen ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.PanelLeftOpen, { "aria-hidden": true })
15162
15189
  }
15163
15190
  );
15164
- const panelToggle = doc.data && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15191
+ const panelToggle = doc.data && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15165
15192
  "button",
15166
15193
  {
15167
15194
  ref: panelButton,
@@ -15171,16 +15198,16 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15171
15198
  onClick: () => side2("panel", !panelOpen),
15172
15199
  "aria-label": panelOpen ? t.closePanel : t.openPanel,
15173
15200
  title: panelOpen ? t.closePanel : t.openPanel,
15174
- children: panelOpen ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.PanelRightOpen, { "aria-hidden": true })
15201
+ children: panelOpen ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.PanelRightOpen, { "aria-hidden": true })
15175
15202
  }
15176
15203
  );
15177
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs", "data-theme": theme, children: [
15178
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { className: "w100n-docs-bar", children: [
15179
- start && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
15204
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs", "data-theme": theme, children: [
15205
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("header", { className: "w100n-docs-bar", children: [
15206
+ start && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
15180
15207
  narrow && listToggle,
15181
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Kind, { "aria-hidden": true }) }),
15182
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-heading", children: [
15183
- renaming !== null && doc.data ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15208
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Kind, { "aria-hidden": true }) }),
15209
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-heading", children: [
15210
+ renaming !== null && doc.data ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15184
15211
  "input",
15185
15212
  {
15186
15213
  className: "w100n-docs-title w100n-docs-rename",
@@ -15198,7 +15225,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15198
15225
  }
15199
15226
  }
15200
15227
  }
15201
- ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15228
+ ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15202
15229
  "strong",
15203
15230
  {
15204
15231
  className: "w100n-docs-title",
@@ -15207,31 +15234,31 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15207
15234
  children: doc.data?.name ?? t.documents
15208
15235
  }
15209
15236
  ),
15210
- docbar ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref: setMenusAt, className: "w100n-docs-menus" }) : crumbs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
15211
- i > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ChevronRight, { "aria-hidden": true }),
15237
+ docbar ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref: setMenusAt, className: "w100n-docs-menus" }) : crumbs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { children: [
15238
+ i > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronRight, { "aria-hidden": true }),
15212
15239
  item
15213
- ] }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-hint", children: t.hint })
15240
+ ] }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-hint", children: t.hint })
15214
15241
  ] }),
15215
- versionId && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
15216
- versionId && text && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", "aria-pressed": comparing, onClick: () => setComparing(!comparing), children: [
15217
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FileDiff, { "aria-hidden": true }),
15242
+ versionId && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
15243
+ versionId && text && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", "aria-pressed": comparing, onClick: () => setComparing(!comparing), children: [
15244
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileDiff, { "aria-hidden": true }),
15218
15245
  comparing ? t.hideChanges : t.showChanges
15219
15246
  ] }),
15220
- versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
15221
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.RotateCcw, { "aria-hidden": true }),
15247
+ versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
15248
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.RotateCcw, { "aria-hidden": true }),
15222
15249
  t.restore
15223
15250
  ] }),
15224
- restoring === "failed" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
15225
- doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
15226
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FileSpreadsheet, { "aria-hidden": true }),
15251
+ restoring === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
15252
+ doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
15253
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileSpreadsheet, { "aria-hidden": true }),
15227
15254
  t.copyAs
15228
15255
  ] }),
15229
- copying === "failed" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-muted", children: t.copyFailed }),
15230
- kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-muted", role: "status", children: t.templateSaved }),
15231
- kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
15232
- renamed2 === "failed" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-muted", children: t.renameFailed }),
15233
- docbar && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { ref: setStatusAt, className: "w100n-docs-status" }),
15234
- host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15256
+ copying === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", children: t.copyFailed }),
15257
+ kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", role: "status", children: t.templateSaved }),
15258
+ kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
15259
+ renamed2 === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", children: t.renameFailed }),
15260
+ docbar && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { ref: setStatusAt, className: "w100n-docs-status" }),
15261
+ host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15235
15262
  "button",
15236
15263
  {
15237
15264
  type: "button",
@@ -15240,145 +15267,138 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15240
15267
  "aria-label": t.sendChat,
15241
15268
  title: t.sendChat,
15242
15269
  onClick: () => host.send(doc.data.id),
15243
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Send, { "aria-hidden": true })
15270
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Send, { "aria-hidden": true })
15244
15271
  }
15245
15272
  ),
15246
- sharing && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "w100n-docs-action w100n-docs-square", "aria-label": t.share, title: t.share, onClick: () => {
15273
+ sharing && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "w100n-docs-action w100n-docs-square", "aria-label": t.share, title: t.share, onClick: () => {
15247
15274
  setTab("sharing");
15248
15275
  side2("panel", true);
15249
- }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Share2, { "aria-hidden": true }) }),
15276
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Share2, { "aria-hidden": true }) }),
15250
15277
  doc.data && !versionId && actions?.(doc.data),
15251
15278
  narrow && panelToggle,
15252
- end && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
15279
+ end && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
15253
15280
  ] }),
15254
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: body, className: "w100n-docs-body", children: [
15255
- listOpen && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
15256
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-head", children: [
15257
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-row", children: [
15258
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "w100n-docs-caption", children: [
15259
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Files, { "aria-hidden": true }),
15281
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: body, className: "w100n-docs-body", children: [
15282
+ listOpen && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
15283
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-head", children: [
15284
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-row", children: [
15285
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "w100n-docs-caption", children: [
15286
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Files, { "aria-hidden": true }),
15260
15287
  t.documents,
15261
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: all.length })
15288
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: all.length })
15262
15289
  ] }),
15263
- host.create && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-new", onKeyDown: (e) => {
15290
+ host.create && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-new", onKeyDown: (e) => {
15264
15291
  if (e.key === "Escape" && adding) {
15265
15292
  e.stopPropagation();
15266
15293
  setAdding(false);
15267
15294
  }
15268
15295
  }, children: [
15269
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-haspopup": "menu", "aria-expanded": adding, disabled: sending === "busy", onClick: () => setAdding(!adding), children: [
15270
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Plus, { "aria-hidden": true }),
15271
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: sending === "busy" ? t.uploading : t.create }),
15272
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true })
15296
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-haspopup": "menu", "aria-expanded": adding, disabled: sending === "busy", onClick: () => setAdding(!adding), children: [
15297
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Plus, { "aria-hidden": true }),
15298
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: sending === "busy" ? t.uploading : t.create }),
15299
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true })
15273
15300
  ] }),
15274
- adding && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { role: "menu", className: "w100n-docs-menu", children: [
15275
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15301
+ adding && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { role: "menu", className: "w100n-docs-menu", children: [
15302
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15276
15303
  setAdding(false);
15277
15304
  setMaking(true);
15278
15305
  }, children: [
15279
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FilePlus, { "aria-hidden": true }) }),
15280
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: t.newTitle })
15306
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FilePlus, { "aria-hidden": true }) }),
15307
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.newTitle })
15281
15308
  ] }),
15282
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15309
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15283
15310
  setAdding(false);
15284
15311
  upload.current.click();
15285
15312
  }, children: [
15286
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Upload, { "aria-hidden": true }) }),
15287
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: t.uploadFile })
15313
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Upload, { "aria-hidden": true }) }),
15314
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.uploadFile })
15288
15315
  ] })
15289
15316
  ] }),
15290
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("input", { ref: upload, type: "file", hidden: true, "aria-label": t.uploadFile, accept: ".docx,.md,.markdown,.pdf,.xlsx,.csv,.html,.htm", onChange: (e) => {
15317
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { ref: upload, type: "file", hidden: true, "aria-label": t.uploadFile, accept: ".docx,.md,.markdown,.pdf,.xlsx,.csv,.html,.htm", onChange: (e) => {
15291
15318
  const file = e.target.files?.[0];
15292
15319
  e.target.value = "";
15293
15320
  if (file) void send(file);
15294
15321
  } })
15295
15322
  ] }),
15296
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side2("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.X, { "aria-hidden": true }) })
15323
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side2("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.X, { "aria-hidden": true }) })
15297
15324
  ] }),
15298
- (spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
15325
+ (spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
15299
15326
  if (e.key !== "Escape" || !picking) return;
15300
15327
  e.stopPropagation();
15301
15328
  setPicking(false);
15302
15329
  e.currentTarget.querySelector("button").focus();
15303
15330
  }, children: [
15304
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
15305
- space ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.LayoutGrid, { "aria-hidden": true }) }),
15306
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: space?.name ?? t.allProjects }),
15307
- !space && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-count", children: all.length }),
15308
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true })
15331
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
15332
+ space ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.LayoutGrid, { "aria-hidden": true }) }),
15333
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: space?.name ?? t.allProjects }),
15334
+ !space && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-count", children: all.length }),
15335
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true })
15309
15336
  ] }),
15310
- picking && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { role: "listbox", className: "w100n-docs-menu", children: [
15311
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
15312
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.LayoutGrid, { "aria-hidden": true }) }),
15313
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: t.allProjects }),
15314
- !spaceId && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Check, { "aria-hidden": true })
15337
+ picking && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { role: "listbox", className: "w100n-docs-menu", children: [
15338
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
15339
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.LayoutGrid, { "aria-hidden": true }) }),
15340
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.allProjects }),
15341
+ !spaceId && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Check, { "aria-hidden": true })
15315
15342
  ] }),
15316
- groups2.map((group) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { role: "group", "aria-label": group || void 0, children: [
15317
- group && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-docs-menu-caption", children: group }),
15318
- (spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
15319
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
15320
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: item.name }),
15321
- !spaceId && counts.get(item.id) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
15322
- item.id === spaceId && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Check, { "aria-hidden": true })
15343
+ groups2.map((group) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { role: "group", "aria-label": group || void 0, children: [
15344
+ group && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-menu-caption", children: group }),
15345
+ (spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
15346
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
15347
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: item.name }),
15348
+ !spaceId && counts.get(item.id) ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
15349
+ item.id === spaceId && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Check, { "aria-hidden": true })
15323
15350
  ] }, item.id))
15324
15351
  ] }, group))
15325
15352
  ] })
15326
15353
  ] }),
15327
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-filters", children: [
15328
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
15329
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Search, { "aria-hidden": true }),
15330
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("input", { ref: finder, value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search }),
15331
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("kbd", { children: "\u2318O" })
15354
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-filters", children: [
15355
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
15356
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Search, { "aria-hidden": true }),
15357
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { ref: finder, value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search }),
15358
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("kbd", { children: "\u2318O" })
15332
15359
  ] }),
15333
- present.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-types", onKeyDown: (e) => {
15360
+ present.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-types", onKeyDown: (e) => {
15334
15361
  if (e.key !== "Escape" || !typing) return;
15335
15362
  e.stopPropagation();
15336
15363
  setTyping(false);
15337
15364
  e.currentTarget.querySelector("button").focus();
15338
15365
  }, children: [
15339
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": typing, "data-on": picked.length > 0, onClick: () => setTyping(!typing), children: [
15340
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ListFilter, { "aria-hidden": true }),
15341
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: t.typeFilter }),
15342
- picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-badge", children: picked.length }),
15343
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true })
15366
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": typing, "data-on": picked.length > 0, onClick: () => setTyping(!typing), children: [
15367
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ListFilter, { "aria-hidden": true }),
15368
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.typeFilter }),
15369
+ picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-badge", children: picked.length }),
15370
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true })
15344
15371
  ] }),
15345
- typing && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { role: "listbox", "aria-multiselectable": true, "aria-label": t.kind, className: "w100n-docs-menu", children: [
15372
+ typing && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { role: "listbox", "aria-multiselectable": true, "aria-label": t.kind, className: "w100n-docs-menu", children: [
15346
15373
  present.map((item) => {
15347
- const Icon = icons4[item];
15374
+ const Icon = icons3[item];
15348
15375
  const on2 = picked.includes(item);
15349
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "option", "aria-selected": on2, onClick: () => setPicked(on2 ? picked.filter((k) => k !== item) : [...picked, item]), children: [
15350
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-box", children: on2 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Check, { "aria-hidden": true }) }),
15351
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { "aria-hidden": true }) }),
15352
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: t.kinds[item] }),
15353
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-count", children: all.filter((doc2) => doc2.kind === item).length })
15376
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "option", "aria-selected": on2, onClick: () => setPicked(on2 ? picked.filter((k) => k !== item) : [...picked, item]), children: [
15377
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-box", children: on2 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Check, { "aria-hidden": true }) }),
15378
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { "aria-hidden": true }) }),
15379
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.kinds[item] }),
15380
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-count", children: all.filter((doc2) => doc2.kind === item).length })
15354
15381
  ] }, item);
15355
15382
  }),
15356
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-menu-foot", children: [
15357
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => setPicked(present), children: t.selectAll }),
15358
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => setPicked([]), children: t.clearPick })
15383
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-menu-foot", children: [
15384
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: () => setPicked(present), children: t.selectAll }),
15385
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: () => setPicked([]), children: t.clearPick })
15359
15386
  ] })
15360
15387
  ] })
15361
15388
  ] })
15362
15389
  ] }),
15363
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-shape", role: "radiogroup", "aria-label": t.tree, children: [["tree", import_lucide_react13.FolderTree, t.tree], ["cards", import_lucide_react13.LayoutGrid, t.cards]].map(([key2, Icon, label]) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "radio", "aria-checked": shape3 === key2, onClick: () => {
15364
- setShape(key2);
15365
- localStorage.setItem("w100n-docs-view", key2);
15366
- }, children: [
15367
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { "aria-hidden": true }),
15368
- label
15369
- ] }, key2)) }),
15370
- picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
15390
+ picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
15371
15391
  t.kinds[item],
15372
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.X, { "aria-hidden": true })
15392
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.X, { "aria-hidden": true })
15373
15393
  ] }, item)) })
15374
15394
  ] }),
15375
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-cards", children: [
15376
- sending === "failed" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
15395
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-cards", children: [
15396
+ sending === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
15377
15397
  list.error && failed(list.retry),
15378
- list.loading && !list.data && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-docs-muted", children: t.loading }),
15379
- notice && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-docs-muted", role: "status", children: notice }),
15380
- list.data && !shown.length && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
15381
- shape3 === "tree" && list.data && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15398
+ list.loading && !list.data && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: t.loading }),
15399
+ notice && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", role: "status", children: notice }),
15400
+ list.data && !shown.length && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
15401
+ list.data && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15382
15402
  Tree,
15383
15403
  {
15384
15404
  items: shown,
@@ -15388,11 +15408,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15388
15408
  current: here.documentId,
15389
15409
  t,
15390
15410
  edit,
15411
+ hits: query.trim() ? inside2 : void 0,
15391
15412
  onEdit: (text2) => setEdit(text2 === null ? null : edit && { ...edit, text: text2 }),
15392
15413
  onEditDone: commit,
15393
15414
  onOpen: open,
15394
15415
  onMenu: (item, e) => {
15395
15416
  setSpot(null);
15417
+ setPeek(null);
15396
15418
  setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
15397
15419
  },
15398
15420
  onFolderMenu: host.create || host.makeFolder ? (at2, key2, e) => {
@@ -15403,86 +15425,43 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15403
15425
  const item = all.find((x) => x.id === id);
15404
15426
  if (item) moveTo(item, to);
15405
15427
  } : void 0,
15406
- onWarm: (item) => item ? warm(item) : clearTimeout(hover.current)
15407
- }
15408
- ),
15409
- shape3 === "cards" && folders.map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
15410
- folders.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
15411
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => naming?.id === item.id ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-card", children: [
15412
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }),
15413
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-card-text", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15414
- "input",
15415
- {
15416
- className: "w100n-docs-field",
15417
- autoFocus: true,
15418
- value: naming.text,
15419
- "aria-label": t.rename,
15420
- onFocus: (e) => e.currentTarget.select(),
15421
- onChange: (e) => setNaming({ ...naming, text: e.target.value }),
15422
- onBlur: () => void retitle(item, naming.text),
15423
- onKeyDown: (e) => {
15424
- if (e.key === "Enter") e.currentTarget.blur();
15425
- if (e.key === "Escape") {
15426
- e.stopPropagation();
15427
- setNaming(null);
15428
- }
15429
- }
15428
+ onWarm: (item, at2) => {
15429
+ if (item) warm(item, at2);
15430
+ else {
15431
+ clearTimeout(hover.current);
15432
+ setPeek(null);
15430
15433
  }
15431
- ) })
15432
- ] }, item.id) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
15433
- "button",
15434
- {
15435
- type: "button",
15436
- className: "w100n-docs-card",
15437
- "aria-current": item.id === here.documentId,
15438
- onClick: () => open(item),
15439
- title: item.name,
15440
- onPointerEnter: () => warm(item),
15441
- onPointerLeave: () => clearTimeout(hover.current),
15442
- onContextMenu: (e) => {
15443
- e.preventDefault();
15444
- setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
15445
- },
15446
- children: [
15447
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }),
15448
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "w100n-docs-card-text", children: [
15449
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: item.name }),
15450
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") }),
15451
- inside2.get(item.id) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { className: "w100n-docs-hit", children: inside2.get(item.id).split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("mark", { children: part }, i) : part) })
15452
- ] })
15453
- ]
15454
- },
15455
- item.id
15456
- )) })
15457
- ] }, folder2))
15434
+ }
15435
+ }
15436
+ )
15458
15437
  ] })
15459
15438
  ] }),
15460
15439
  !narrow && !listOpen && listToggle,
15461
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("main", { className: "w100n-docs-stage", children: [
15440
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("main", { className: "w100n-docs-stage", children: [
15462
15441
  !narrow && !panelOpen && panelToggle,
15463
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-bare", children: stage })
15442
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-bare", children: stage })
15464
15443
  ] }),
15465
- doc.data && panelOpen && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
15466
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-head", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-row", children: [
15467
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-tabs", role: "tablist", "aria-label": t.details, "data-compact": panelTabs.length > 3, onKeyDown: rove, children: panelTabs.map(([key2, Icon, label]) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "tab", "aria-selected": tab === key2, tabIndex: tab === key2 ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key2), children: [
15468
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { "aria-hidden": true }),
15469
- (panelTabs.length < 4 || tab === key2 && panelTabs.length < 5) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: label })
15444
+ doc.data && panelOpen && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
15445
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-head", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-row", children: [
15446
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-tabs", role: "tablist", "aria-label": t.details, "data-compact": panelTabs.length > 3, onKeyDown: rove, children: panelTabs.map(([key2, Icon, label]) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "tab", "aria-selected": tab === key2, tabIndex: tab === key2 ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key2), children: [
15447
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { "aria-hidden": true }),
15448
+ (panelTabs.length < 4 || tab === key2 && panelTabs.length < 5) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: label })
15470
15449
  ] }, key2)) }),
15471
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => side2("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.X, { "aria-hidden": true }) })
15450
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => side2("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.X, { "aria-hidden": true }) })
15472
15451
  ] }) }),
15473
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key2]) => key2 === tab)?.[2], children: [
15474
- tab === "outline" && (outline2.length ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("nav", { className: "w100n-docs-outline", "aria-label": t.outline, children: [
15475
- now && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-reading", children: [
15476
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { style: { width: `${Math.round(now.progress * 100)}%` } }) }),
15477
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
15452
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key2]) => key2 === tab)?.[2], children: [
15453
+ tab === "outline" && (outline2.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("nav", { className: "w100n-docs-outline", "aria-label": t.outline, children: [
15454
+ now && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-reading", children: [
15455
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", { style: { width: `${Math.round(now.progress * 100)}%` } }) }),
15456
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("small", { children: [
15478
15457
  Math.round(now.progress * 100),
15479
15458
  "% ",
15480
15459
  t.read
15481
15460
  ] })
15482
15461
  ] }),
15483
- outline2.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
15484
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Search, { "aria-hidden": true }),
15485
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("input", { value: hunt, onChange: (e) => setHunt(e.target.value), placeholder: t.findHeading, "aria-label": t.findHeading })
15462
+ outline2.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
15463
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Search, { "aria-hidden": true }),
15464
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { value: hunt, onChange: (e) => setHunt(e.target.value), placeholder: t.findHeading, "aria-label": t.findHeading })
15486
15465
  ] }),
15487
15466
  chapters.map((c, i) => {
15488
15467
  const subs = words3.length ? c.subs.filter(hit) : c.subs;
@@ -15490,13 +15469,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15490
15469
  const opened3 = words3.length > 0 || (fold[c.head.id] ?? i === reached);
15491
15470
  const named3 = /^(\d+)[.)]?\s+(.+)$/.exec(c.head.text);
15492
15471
  const mark = c.subs.findIndex((s) => s.id === now?.id);
15493
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-chapter", "data-state": reached < 0 ? void 0 : i < reached ? "done" : i === reached ? "now" : void 0, children: [
15494
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-chapter-row", children: [
15495
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-chapter-go", "aria-label": c.head.text, "aria-current": now?.id === c.head.id ? "location" : void 0, onClick: () => reach(c.head), children: [
15496
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-chapter-num", children: named3 ? named3[1] : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Bookmark, { "aria-hidden": true }) }),
15497
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: named3 ? named3[2] : c.head.text })
15472
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-chapter", "data-state": reached < 0 ? void 0 : i < reached ? "done" : i === reached ? "now" : void 0, children: [
15473
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-chapter-row", children: [
15474
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-chapter-go", "aria-label": c.head.text, "aria-current": now?.id === c.head.id ? "location" : void 0, onClick: () => reach(c.head), children: [
15475
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-chapter-num", children: named3 ? named3[1] : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Bookmark, { "aria-hidden": true }) }),
15476
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: named3 ? named3[2] : c.head.text })
15498
15477
  ] }),
15499
- c.subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
15478
+ c.subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
15500
15479
  "button",
15501
15480
  {
15502
15481
  type: "button",
@@ -15506,13 +15485,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15506
15485
  title: opened3 ? t.hideSections : t.showSections,
15507
15486
  onClick: () => setFold({ ...fold, [c.head.id]: !opened3 }),
15508
15487
  children: [
15509
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: c.subs.length }),
15510
- opened3 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ChevronRight, { "aria-hidden": true })
15488
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: c.subs.length }),
15489
+ opened3 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronRight, { "aria-hidden": true })
15511
15490
  ]
15512
15491
  }
15513
15492
  )
15514
15493
  ] }),
15515
- opened3 && subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-sections", children: subs.map((s) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
15494
+ opened3 && subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-sections", children: subs.map((s) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
15516
15495
  "button",
15517
15496
  {
15518
15497
  type: "button",
@@ -15521,7 +15500,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15521
15500
  "data-state": i < reached || i === reached && c.subs.indexOf(s) < mark ? "done" : void 0,
15522
15501
  "aria-current": now?.id === s.id ? "location" : void 0,
15523
15502
  children: [
15524
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { "aria-hidden": true }),
15503
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", { "aria-hidden": true }),
15525
15504
  s.text
15526
15505
  ]
15527
15506
  },
@@ -15529,47 +15508,47 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15529
15508
  )) })
15530
15509
  ] }, c.head.id);
15531
15510
  })
15532
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-docs-muted", children: t.noOutline })),
15533
- tab === "links" && doc.data.kind === "markdown" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Backlinks, { host, current: doc.data, notes: notes3, t, onOpen: open }),
15534
- tab === "versions" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-versions", children: [
15511
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: t.noOutline })),
15512
+ tab === "links" && doc.data.kind === "markdown" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Backlinks, { host, current: doc.data, notes: notes3, t, onOpen: open }),
15513
+ tab === "versions" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-versions", children: [
15535
15514
  versions.error && failed(versions.retry),
15536
- (versions.data ?? []).map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
15515
+ (versions.data ?? []).map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
15537
15516
  "button",
15538
15517
  {
15539
15518
  type: "button",
15540
15519
  "aria-pressed": (versionId ?? "current") === item.id || !versionId && item.current,
15541
15520
  onClick: () => view(item.current ? null : item.id),
15542
15521
  children: [
15543
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("b", { children: [
15522
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("b", { children: [
15544
15523
  date(item.createdAt),
15545
- item.current && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-badge", children: t.current })
15524
+ item.current && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-badge", children: t.current })
15546
15525
  ] }),
15547
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [item.author?.name, size2(item.size), item.note].filter(Boolean).join(" \xB7 ") })
15526
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: [item.author?.name, size2(item.size), item.note].filter(Boolean).join(" \xB7 ") })
15548
15527
  ]
15549
15528
  },
15550
15529
  item.id
15551
15530
  ))
15552
15531
  ] }),
15553
- tab === "details" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("dl", { className: "w100n-docs-details", children: [
15554
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.kind }),
15555
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: t.kinds[doc.data.kind] }),
15556
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.size }),
15557
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: size2(doc.data.size) }),
15558
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.updated }),
15559
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: date(doc.data.updatedAt) }),
15560
- doc.data.updatedBy && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
15561
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.by }),
15562
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: doc.data.updatedBy.name })
15532
+ tab === "details" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("dl", { className: "w100n-docs-details", children: [
15533
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.kind }),
15534
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: t.kinds[doc.data.kind] }),
15535
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.size }),
15536
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: size2(doc.data.size) }),
15537
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.updated }),
15538
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: date(doc.data.updatedAt) }),
15539
+ doc.data.updatedBy && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
15540
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.by }),
15541
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: doc.data.updatedBy.name })
15563
15542
  ] }),
15564
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.rights }),
15565
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
15543
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.rights }),
15544
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
15566
15545
  ] }),
15567
- tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-about", children: [
15568
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "w100n-docs-caption", children: [
15569
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FileDown, { "aria-hidden": true }),
15546
+ tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-about", children: [
15547
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "w100n-docs-caption", children: [
15548
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileDown, { "aria-hidden": true }),
15570
15549
  t.exportAs
15571
15550
  ] }),
15572
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
15551
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
15573
15552
  "button",
15574
15553
  {
15575
15554
  type: "button",
@@ -15577,22 +15556,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15577
15556
  disabled: exporting === "busy",
15578
15557
  onClick: () => void exportAs(doc.data, format),
15579
15558
  children: [
15580
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FileDown, { "aria-hidden": true }),
15559
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileDown, { "aria-hidden": true }),
15581
15560
  format.toUpperCase()
15582
15561
  ]
15583
15562
  },
15584
15563
  format
15585
15564
  )) }),
15586
- exporting === "failed" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-docs-muted", children: t.exportFailed })
15565
+ exporting === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: t.exportFailed })
15587
15566
  ] }),
15588
- tab === "comments" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref: setBox }),
15589
- tab === "sharing" && sharing && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
15590
- tab === "signatures" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-versions", children: [
15567
+ tab === "comments" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref: setBox }),
15568
+ tab === "sharing" && sharing && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
15569
+ tab === "signatures" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-versions", children: [
15591
15570
  signatures.error && failed(signatures.retry),
15592
- signatures.data?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-docs-muted", children: t.noSignatures }),
15571
+ signatures.data?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: t.noSignatures }),
15593
15572
  (signatures.data ?? []).map((entry2) => {
15594
15573
  const signed = versions.data?.find((v) => v.id === entry2.versionId);
15595
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
15574
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
15596
15575
  "button",
15597
15576
  {
15598
15577
  type: "button",
@@ -15600,15 +15579,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15600
15579
  "aria-pressed": !!signed && (versionId ?? versions.data?.find((v) => v.current)?.id) === signed.id,
15601
15580
  onClick: () => view(signed.current ? null : signed.id),
15602
15581
  children: [
15603
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("b", { children: [
15582
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("b", { children: [
15604
15583
  entry2.signer.name,
15605
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "w100n-docs-badge", children: [
15584
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "w100n-docs-badge", children: [
15606
15585
  t.page,
15607
15586
  " ",
15608
15587
  entry2.page
15609
15588
  ] })
15610
15589
  ] }),
15611
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [date(entry2.signedAt), t.methods[entry2.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
15590
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: [date(entry2.signedAt), t.methods[entry2.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
15612
15591
  ]
15613
15592
  },
15614
15593
  entry2.id
@@ -15619,7 +15598,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15619
15598
  ] })
15620
15599
  ] })
15621
15600
  ] }),
15622
- jump && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15601
+ jump && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
15623
15602
  Jump,
15624
15603
  {
15625
15604
  mode: jump,
@@ -15632,18 +15611,14 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15632
15611
  place: (item) => [!spaceId && names2.get(item.spaceId), item.folder].filter(Boolean).join(" / ")
15633
15612
  }
15634
15613
  ),
15635
- making && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made2) => {
15614
+ making && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made2) => {
15636
15615
  setMaking(false);
15637
15616
  opened2(made2);
15638
15617
  } }),
15639
- menu && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
15640
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-context-head", children: [
15641
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: menu.item.name }),
15642
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [t.kinds[menu.item.kind], size2(menu.item.size), names2.get(menu.item.spaceId), menu.item.folder].filter(Boolean).join(" \xB7 ") }),
15643
- menu.item.createdAt && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [t.createdOn.replace("{when}", date(menu.item.createdAt)), menu.item.createdBy?.name].filter(Boolean).join(" \xB7 ") }),
15644
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [t.updatedOn.replace("{when}", ago(menu.item.updatedAt)), menu.item.updatedBy?.name].filter(Boolean).join(" \xB7 ") })
15645
- ] }),
15646
- menu.moving ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-context-list", children: ["", ...dirs.data.get(menu.item.spaceId)].map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
15618
+ peek && !menu && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-peek", role: "tooltip", style: { left: peek.x, top: peek.y }, children: card(peek.item) }),
15619
+ menu && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
15620
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-context-head", children: card(menu.item) }),
15621
+ menu.moving ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-context-list", children: ["", ...dirs.data.get(menu.item.spaceId)].map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
15647
15622
  "button",
15648
15623
  {
15649
15624
  type: "button",
@@ -15652,100 +15627,99 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15652
15627
  onClick: () => moveTo(menu.item, { spaceId: menu.item.spaceId, folder: folder2 }),
15653
15628
  style: { paddingLeft: 10 + 14 * (folder2 ? folder2.split("/").length : 0) },
15654
15629
  children: [
15655
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Folder, { "aria-hidden": true }),
15630
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Folder, { "aria-hidden": true }),
15656
15631
  folder2 ? folder2.split("/").pop() : names2.get(menu.item.spaceId) ?? t.topLevel
15657
15632
  ]
15658
15633
  },
15659
15634
  folder2
15660
- )) }) : menu.sure ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-context-ask", children: [
15661
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: t.trashAsk.replace("{name}", menu.item.name) }),
15662
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
15663
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setMenu({ ...menu, sure: false }), children: t.cancel }),
15664
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => void drop2(menu.item), children: [
15665
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
15635
+ )) }) : menu.sure ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-context-ask", children: [
15636
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: t.trashAsk.replace("{name}", menu.item.name) }),
15637
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
15638
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setMenu({ ...menu, sure: false }), children: t.cancel }),
15639
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => void drop2(menu.item), children: [
15640
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
15666
15641
  t.trash
15667
15642
  ] })
15668
15643
  ] })
15669
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
15670
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15644
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
15645
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15671
15646
  setMenu(null);
15672
15647
  open(menu.item);
15673
15648
  }, children: [
15674
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FileText, { "aria-hidden": true }),
15649
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileText, { "aria-hidden": true }),
15675
15650
  t.openFile
15676
15651
  ] }),
15677
- host.href && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15652
+ host.href && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15678
15653
  setMenu(null);
15679
15654
  window.open(host.href(menu.item.id), "_blank", "noopener");
15680
15655
  }, children: [
15681
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ExternalLink, { "aria-hidden": true }),
15656
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ExternalLink, { "aria-hidden": true }),
15682
15657
  t.openTab
15683
15658
  ] }),
15684
- host.href && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => navigator.clipboard.writeText(host.href(menu.item.id)), t.linkCopied), children: [
15685
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Link, { "aria-hidden": true }),
15659
+ host.href && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => navigator.clipboard.writeText(host.href(menu.item.id)), t.linkCopied), children: [
15660
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Link, { "aria-hidden": true }),
15686
15661
  t.copyLink
15687
15662
  ] }),
15688
- host.send && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15663
+ host.send && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15689
15664
  setMenu(null);
15690
15665
  host.send(menu.item.id);
15691
15666
  }, children: [
15692
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Send, { "aria-hidden": true }),
15667
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Send, { "aria-hidden": true }),
15693
15668
  t.sendChat
15694
15669
  ] }),
15695
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", {}),
15696
- host.rename && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15670
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", {}),
15671
+ host.rename && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15697
15672
  const item = menu.item;
15698
15673
  setMenu(null);
15699
- if (shape3 === "tree") setEdit({ key: `file:${item.id}`, text: item.name.replace(/\.[^.]+$/, ""), run: (text2) => retitle(item, text2) });
15700
- else setNaming({ id: item.id, text: item.name.replace(/\.[^.]+$/, "") });
15674
+ setEdit({ key: `file:${item.id}`, text: item.name.replace(/\.[^.]+$/, ""), run: (text2) => retitle(item, text2) });
15701
15675
  }, children: [
15702
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Pencil, { "aria-hidden": true }),
15676
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Pencil, { "aria-hidden": true }),
15703
15677
  t.rename
15704
15678
  ] }),
15705
- host.move && dirs.data?.has(menu.item.spaceId) && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", "aria-haspopup": "menu", onClick: () => setMenu({ ...menu, moving: true }), children: [
15706
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FolderInput, { "aria-hidden": true }),
15679
+ host.move && dirs.data?.has(menu.item.spaceId) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", "aria-haspopup": "menu", onClick: () => setMenu({ ...menu, moving: true }), children: [
15680
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FolderInput, { "aria-hidden": true }),
15707
15681
  t.moveTo
15708
15682
  ] }),
15709
- host.create && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(async () => copy2(await host.document(menu.item.id))), children: [
15710
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Copy, { "aria-hidden": true }),
15683
+ host.create && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(async () => copy2(await host.document(menu.item.id))), children: [
15684
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Copy, { "aria-hidden": true }),
15711
15685
  t.makeCopy
15712
15686
  ] }),
15713
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => fetchFile(menu.item)), children: [
15714
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Download, { "aria-hidden": true }),
15687
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => fetchFile(menu.item)), children: [
15688
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Download, { "aria-hidden": true }),
15715
15689
  t.download
15716
15690
  ] }),
15717
- host.saveTemplate && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => host.saveTemplate(menu.item.id), t.templateSaved), children: [
15718
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Bookmark, { "aria-hidden": true }),
15691
+ host.saveTemplate && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => host.saveTemplate(menu.item.id), t.templateSaved), children: [
15692
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Bookmark, { "aria-hidden": true }),
15719
15693
  t.saveTemplate
15720
15694
  ] }),
15721
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15695
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15722
15696
  setMenu(null);
15723
15697
  open(menu.item);
15724
15698
  setTab("details");
15725
15699
  side2("panel", true);
15726
15700
  }, children: [
15727
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Info, { "aria-hidden": true }),
15701
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Info, { "aria-hidden": true }),
15728
15702
  t.details
15729
15703
  ] }),
15730
- host.remove && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
15731
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", {}),
15732
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setMenu({ ...menu, sure: true }), children: [
15733
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
15704
+ host.remove && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
15705
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", {}),
15706
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setMenu({ ...menu, sure: true }), children: [
15707
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
15734
15708
  t.trash
15735
15709
  ] })
15736
15710
  ] })
15737
15711
  ] })
15738
15712
  ] }),
15739
- spot3 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.folderActions, style: { left: spot3.x, top: spot3.y }, children: [
15740
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-context-head", children: [
15741
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: folderNamed(spot3.at) }),
15742
- spot3.at.folder && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [names2.get(spot3.at.spaceId), ...spot3.at.folder.split("/").slice(0, -1)].filter(Boolean).join(" / ") })
15713
+ spot3 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.folderActions, style: { left: spot3.x, top: spot3.y }, children: [
15714
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-context-head", children: [
15715
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: folderNamed(spot3.at) }),
15716
+ spot3.at.folder && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: [names2.get(spot3.at.spaceId), ...spot3.at.folder.split("/").slice(0, -1)].filter(Boolean).join(" / ") })
15743
15717
  ] }),
15744
- spot3.sure ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-context-ask", children: [
15745
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: t.folderTrashAsk.replace("{name}", folderNamed(spot3.at)) }),
15746
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
15747
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setSpot({ ...spot3, sure: false }), children: t.cancel }),
15748
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => {
15718
+ spot3.sure ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-context-ask", children: [
15719
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: t.folderTrashAsk.replace("{name}", folderNamed(spot3.at)) }),
15720
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
15721
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setSpot({ ...spot3, sure: false }), children: t.cancel }),
15722
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => {
15749
15723
  const at2 = spot3.at;
15750
15724
  const inside3 = doc.data && doc.data.spaceId === at2.spaceId && `${doc.data.folder ?? ""}/`.startsWith(`${at2.folder}/`);
15751
15725
  void act(() => host.removeFolder(at2), t.trashed).then(() => {
@@ -15753,42 +15727,42 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15753
15727
  if (inside3) go({ spaceId: here.spaceId, documentId: null });
15754
15728
  });
15755
15729
  }, children: [
15756
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
15730
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
15757
15731
  t.trash
15758
15732
  ] })
15759
15733
  ] })
15760
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
15761
- host.create && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15734
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
15735
+ host.create && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15762
15736
  const at2 = spot3.at;
15763
15737
  setSpot(null);
15764
15738
  void note(t.untitled, true, at2);
15765
15739
  }, children: [
15766
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FilePlus, { "aria-hidden": true }),
15740
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FilePlus, { "aria-hidden": true }),
15767
15741
  t.newNoteHere
15768
15742
  ] }),
15769
- host.makeFolder && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15743
+ host.makeFolder && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15770
15744
  const at2 = spot3.at;
15771
15745
  setSpot(null);
15772
15746
  setEdit({ key: `new:${spot3.key}`, text: t.newFolder, run: (name) => act(() => host.makeFolder(at2, name)).then(refresh) });
15773
15747
  }, children: [
15774
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.FolderPlus, { "aria-hidden": true }),
15748
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FolderPlus, { "aria-hidden": true }),
15775
15749
  t.newFolder
15776
15750
  ] }),
15777
- spot3.at.folder && host.renameFolder && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
15778
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", {}),
15779
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15751
+ spot3.at.folder && host.renameFolder && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
15752
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", {}),
15753
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
15780
15754
  const at2 = spot3.at;
15781
15755
  setSpot(null);
15782
15756
  setEdit({ key: `dir:${spot3.key}`, text: folderNamed(at2), run: (name) => name === folderNamed(at2) ? Promise.resolve() : act(() => host.renameFolder(at2, name)).then(refresh) });
15783
15757
  }, children: [
15784
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Pencil, { "aria-hidden": true }),
15758
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Pencil, { "aria-hidden": true }),
15785
15759
  t.renameFolder
15786
15760
  ] })
15787
15761
  ] }),
15788
- spot3.at.folder && host.removeFolder && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
15789
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("hr", {}),
15790
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setSpot({ ...spot3, sure: true }), children: [
15791
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
15762
+ spot3.at.folder && host.removeFolder && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
15763
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", {}),
15764
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setSpot({ ...spot3, sure: true }), children: [
15765
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
15792
15766
  t.trashFolder
15793
15767
  ] })
15794
15768
  ] })
@@ -15800,12 +15774,12 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
15800
15774
 
15801
15775
  // src/FilePreview.tsx
15802
15776
  var import_react20 = require("react");
15803
- var import_jsx_runtime18 = require("react/jsx-runtime");
15777
+ var import_jsx_runtime19 = require("react/jsx-runtime");
15804
15778
  function FilePreview({ url, name, mimeType, size: size2 = 0, bytes, pdfWorker }) {
15805
15779
  const [source] = (0, import_react20.useState)(() => ({ pdfWorker, content: () => bytes ? bytes(url) : fetch(url, { credentials: "include" }).then((res) => res.ok ? res.arrayBuffer() : Promise.reject(new Error(String(res.status)))) }));
15806
15780
  const kind = kindOf(name, mimeType);
15807
15781
  if (!kind) return null;
15808
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-preview", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Thumb, { host: source, item: { id: url.split("?")[0], spaceId: "", name, kind, size: size2, updatedAt: "" } }) });
15782
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-preview", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Thumb, { host: source, item: { id: url.split("?")[0], spaceId: "", name, kind, size: size2, updatedAt: "" } }) });
15809
15783
  }
15810
15784
 
15811
15785
  // src/GuestDocument.tsx
@@ -15813,10 +15787,10 @@ var import_react21 = require("react");
15813
15787
  var import_lucide_react14 = require("lucide-react");
15814
15788
  init_text();
15815
15789
  init_useLoad();
15816
- var import_jsx_runtime19 = require("react/jsx-runtime");
15790
+ var import_jsx_runtime20 = require("react/jsx-runtime");
15817
15791
  var TextEditor4 = (0, import_react21.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
15818
15792
  var SheetView4 = (0, import_react21.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
15819
- var icons5 = { docx: import_lucide_react14.FileText, markdown: import_lucide_react14.FileType, pdf: import_lucide_react14.Files, sheet: import_lucide_react14.FileSpreadsheet, slides: import_lucide_react14.Presentation };
15793
+ var icons4 = { docx: import_lucide_react14.FileText, markdown: import_lucide_react14.FileType, pdf: import_lucide_react14.Files, sheet: import_lucide_react14.FileSpreadsheet, slides: import_lucide_react14.Presentation };
15820
15794
  var GuestRefused = class extends Error {
15821
15795
  constructor(reason, file = "", sharedBy = "") {
15822
15796
  super(reason);
@@ -15874,18 +15848,18 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
15874
15848
  };
15875
15849
  const top = (file2, badge) => {
15876
15850
  const kind2 = file2 ? kindOf(file2.name, file2.mimeType) : null;
15877
- const Kind = kind2 ? icons5[kind2] : import_lucide_react14.FileText;
15878
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
15879
- brand && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-guest-brand", children: brand }),
15880
- file2 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
15881
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Kind, { "aria-hidden": true }) }),
15882
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-heading", children: [
15883
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { className: "w100n-docs-title", children: file2.name }),
15884
- file2.sharedBy && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
15851
+ const Kind = kind2 ? icons4[kind2] : import_lucide_react14.FileText;
15852
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
15853
+ brand && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-guest-brand", children: brand }),
15854
+ file2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
15855
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Kind, { "aria-hidden": true }) }),
15856
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs-heading", children: [
15857
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { className: "w100n-docs-title", children: file2.name }),
15858
+ file2.sharedBy && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
15885
15859
  ] }),
15886
- badge && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
15887
- file2.download && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-end", children: [
15888
- (kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
15860
+ badge && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
15861
+ file2.download && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs-end", children: [
15862
+ (kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
15889
15863
  "button",
15890
15864
  {
15891
15865
  type: "button",
@@ -15896,25 +15870,25 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
15896
15870
  "aria-label": t.pdfCopy,
15897
15871
  title: t.pdfCopy,
15898
15872
  children: [
15899
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FileDown, { "aria-hidden": true }),
15900
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: t.pdfCopy })
15873
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.FileDown, { "aria-hidden": true }),
15874
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: t.pdfCopy })
15901
15875
  ]
15902
15876
  }
15903
15877
  ),
15904
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", disabled: saving === "busy", onClick: () => void download("file"), "aria-label": t.download, title: t.download, children: [
15905
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Download, { "aria-hidden": true }),
15906
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: t.download })
15878
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", disabled: saving === "busy", onClick: () => void download("file"), "aria-label": t.download, title: t.download, children: [
15879
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Download, { "aria-hidden": true }),
15880
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: t.download })
15907
15881
  ] })
15908
15882
  ] })
15909
15883
  ] })
15910
15884
  ] });
15911
15885
  };
15912
- const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
15886
+ const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
15913
15887
  top(null, null),
15914
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-guest-card", children: [
15915
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { "aria-hidden": true }) }),
15916
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { children: title }),
15917
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: body }),
15888
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-guest-card", children: [
15889
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { "aria-hidden": true }) }),
15890
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { children: title }),
15891
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: body }),
15918
15892
  form
15919
15893
  ] }) })
15920
15894
  ] });
@@ -15930,7 +15904,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
15930
15904
  password ? import_lucide_react14.Lock : import_lucide_react14.UserRound,
15931
15905
  refused.file || t.documents,
15932
15906
  shared + (password ? t.passwordAsk : t.nameAsk),
15933
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { className: "w100n-guest-form", onSubmit: (e) => {
15907
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { className: "w100n-guest-form", onSubmit: (e) => {
15934
15908
  e.preventDefault();
15935
15909
  if (!typed.trim()) return;
15936
15910
  if (password) setAsk({ ...ask, password: typed });
@@ -15940,7 +15914,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
15940
15914
  }
15941
15915
  setTyped("");
15942
15916
  }, children: [
15943
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15917
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
15944
15918
  "input",
15945
15919
  {
15946
15920
  className: "w100n-share-input",
@@ -15953,21 +15927,21 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
15953
15927
  onChange: (e) => setTyped(e.target.value)
15954
15928
  }
15955
15929
  ),
15956
- refused.reason === "wrong" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
15957
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
15958
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Eye, { "aria-hidden": true }),
15930
+ refused.reason === "wrong" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
15931
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
15932
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Eye, { "aria-hidden": true }),
15959
15933
  t.openDoc
15960
15934
  ] })
15961
15935
  ] })
15962
15936
  );
15963
15937
  }
15964
15938
  if (refused?.reason === "busy") return gate("slate", import_lucide_react14.Ban, t.failed, t.tooMany);
15965
- return gate("slate", import_lucide_react14.Ban, t.failed, "", /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "w100n-docs-action", onClick: opened2.retry, children: t.retry }));
15939
+ return gate("slate", import_lucide_react14.Ban, t.failed, "", /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "w100n-docs-action", onClick: opened2.retry, children: t.retry }));
15966
15940
  }
15967
15941
  const file = opened2.data;
15968
- if (!file) return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
15942
+ if (!file) return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
15969
15943
  top(null, null),
15970
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-empty", children: t.loading })
15944
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-empty", children: t.loading })
15971
15945
  ] });
15972
15946
  const kind = kindOf(file.name, file.mimeType);
15973
15947
  const text = kind === "docx" || kind === "markdown";
@@ -15975,23 +15949,23 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
15975
15949
  const rights = { view: true, comment: talk, edit: false };
15976
15950
  const quiet3 = () => {
15977
15951
  };
15978
- let stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
15979
- if (text) stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react21.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TextEditor4, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes3 : void 0, documentId: file.id, onOutline: quiet3, slot: talk ? slot : null }) });
15980
- else if (kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet3 });
15981
- else if (kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet3 });
15982
- else if (kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react21.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SheetView4, { bytes: file.bytes, name: file.name, kind: /\.csv$/i.test(file.name) || file.mimeType === "text/csv" ? "csv" : "xlsx", rights, language, theme, documentId: file.id }) });
15983
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
15952
+ let stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
15953
+ if (text) stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react21.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextEditor4, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes3 : void 0, documentId: file.id, onOutline: quiet3, slot: talk ? slot : null }) });
15954
+ else if (kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet3 });
15955
+ else if (kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet3 });
15956
+ else if (kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react21.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SheetView4, { bytes: file.bytes, name: file.name, kind: /\.csv$/i.test(file.name) || file.mimeType === "text/csv" ? "csv" : "xlsx", rights, language, theme, documentId: file.id }) });
15957
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
15984
15958
  top(file, talk ? t.badgeComment : t.badgeRead),
15985
- saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
15986
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-body w100n-guest-body", children: [
15987
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-bare", children: stage }) }),
15988
- talk && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-panel-body", children: [
15989
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "w100n-share-field", children: [
15990
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: t.yourName }),
15991
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
15959
+ saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
15960
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs-body w100n-guest-body", children: [
15961
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-bare", children: stage }) }),
15962
+ talk && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs-panel-body", children: [
15963
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "w100n-share-field", children: [
15964
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: t.yourName }),
15965
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
15992
15966
  ] }),
15993
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
15994
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref: setSlot })
15967
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
15968
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref: setSlot })
15995
15969
  ] }) })
15996
15970
  ] })
15997
15971
  ] });
@@ -16006,6 +15980,7 @@ init_docx();
16006
15980
  FilePreview,
16007
15981
  GuestDocument,
16008
15982
  GuestRefused,
15983
+ PreviewCard,
16009
15984
  SlidesView,
16010
15985
  kindOf,
16011
15986
  kinds,