@hiai-gg/docsmint 0.3.7 → 0.3.9
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/backend/src/lib/logger.ts +45 -15
- package/dist/backend/index.js +238 -150
- package/dist/client.d.ts +11 -0
- package/dist/client.js +9 -0
- package/dist/frontend/CategoryDialog-CxVyaBV5.js +611 -0
- package/dist/frontend/ConfirmDialog-NFGXRa3E.js +214 -0
- package/dist/frontend/CreateSnapshotDialog-BDgFTeFn.js +216 -0
- package/dist/frontend/DatePicker-BZRBluzF.js +256 -0
- package/dist/frontend/DeleteDialog-CvAr2WPu.js +174 -0
- package/dist/frontend/FolderNode-C6FJv99G.js +298 -0
- package/dist/frontend/FolderTreeSelector-CyB8y2Sm.js +103 -0
- package/dist/frontend/HiaiDocsExtensionProvider-DHWLzRUu.js +11 -0
- package/dist/frontend/Icon-CooFj4Ee.js +64 -0
- package/dist/frontend/SettingsDialog-BHh68rTB.js +1016 -0
- package/dist/frontend/ShareDialog-BUOkYSlw.js +165 -0
- package/dist/frontend/Sidebar-Cu3JrKDC.js +2021 -0
- package/dist/frontend/TagCreateDialog-B9YZBNHi.js +260 -0
- package/dist/frontend/api/settings.js +1 -1
- package/dist/frontend/app-shell.d.ts +8 -0
- package/dist/frontend/app-shell.js +291 -0
- package/dist/frontend/{bundle-mjs-CP6Owz-8.js → bundle-mjs-DllmqUxV.js} +583 -568
- package/dist/frontend/camera-iKXDOOWT.js +29 -0
- package/dist/frontend/check-D-UuvBuh.js +25 -0
- package/dist/frontend/chevron-down-CiPtYyFh.js +25 -0
- package/dist/frontend/circle-check-tSPE1V6t.js +29 -0
- package/dist/frontend/clock-DJHbHZb8.js +29 -0
- package/dist/frontend/components/category-dialog.js +1 -1
- package/dist/frontend/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend/components/delete-dialog.js +1 -1
- package/dist/frontend/components/editor/document-editor.js +1367 -1356
- package/dist/frontend/components/editor/document-title.js +25 -25
- package/dist/frontend/components/editor/markdown-toggle.js +45 -45
- package/dist/frontend/components/folder-node.js +1 -1
- package/dist/frontend/components/folder-tree-selector.js +1 -1
- package/dist/frontend/components/save-as-dialog.js +169 -151
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.js +1 -1
- package/dist/frontend/components/sidebar.js +2 -2013
- package/dist/frontend/components/tag-create-dialog.js +1 -1
- package/dist/frontend/components/version-history.js +188 -187
- package/dist/frontend/confirm-dialog-C4jTRbiS.js +250 -0
- package/dist/frontend/copy-GppwRMjX.js +32 -0
- package/dist/frontend/dashboard.js +1187 -1155
- package/dist/frontend/dialog-Bevp9mmM.js +213 -0
- package/dist/frontend/{loader-circle-Bk-WFz9g.js → dist-C3857Spp.js} +93 -92
- package/dist/frontend/doc-tabs.js +2 -2
- package/dist/frontend/dropdown-menu-CRSby3e9.js +530 -0
- package/dist/frontend/extension.js +2 -11
- package/dist/frontend/{floating-layer-anchor-C51M4l6v.js → floating-layer-anchor-BDs7vO-M.js} +1414 -1412
- package/dist/frontend/folder-DeWhnD7O.js +45 -0
- package/dist/frontend/folder-refresh.js +1 -1
- package/dist/frontend/frontend.css +1 -1
- package/dist/frontend/i18n.js +2 -2
- package/dist/frontend/input-BWlOML_m.js +23 -0
- package/dist/frontend/keyboard.js +1 -1
- package/dist/frontend/{keyboard.svelte-D7H8DihC.js → keyboard.svelte-CApmX0vl.js} +53 -53
- package/dist/frontend/label-C2HfJNQ2.js +30 -0
- package/dist/frontend/{messages-BpYaLbzE.js → messages-C5Q890i2.js} +8 -8
- package/dist/frontend/rotate-ccw-B4Q7brmV.js +25 -0
- package/dist/frontend/search.js +673 -647
- package/dist/frontend/select-value-GXwx90Pr.js +1446 -0
- package/dist/frontend/{settings-blyobazp.js → settings-DSrUl4hW.js} +9 -9
- package/dist/frontend/shared-document.js +94 -94
- package/dist/frontend/subfolders-refresh-store.svelte-B2dKVmgz.js +65 -0
- package/dist/frontend/tag-HxRazVN_.js +54 -0
- package/dist/frontend/tag-store.svelte-CqrUXo0o.js +29 -0
- package/dist/frontend/textarea-DOAE-h42.js +23 -0
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/theme.svelte-DKfCy12k.js +49 -0
- package/dist/frontend/{utils-D8kmM3ub.js → utils-BPDRytUU.js} +2 -3
- package/dist/frontend/{utils-C0OW2678.js → utils-DrfHTcei.js} +2 -3
- package/dist/frontend/utils.js +1 -1
- package/dist/frontend/x-CzBsnJ2x.js +25 -0
- package/dist/frontend-ssr/api/attachments.js +2 -0
- package/dist/frontend-ssr/api/categories.js +2 -0
- package/dist/frontend-ssr/api/documents.js +2 -0
- package/dist/frontend-ssr/api/folders.js +2 -0
- package/dist/frontend-ssr/api/settings.js +2 -0
- package/dist/frontend-ssr/api/share.js +2 -0
- package/dist/frontend-ssr/api/tags.js +2 -0
- package/dist/frontend-ssr/app-shell.js +294 -0
- package/dist/frontend-ssr/assets/CategoryDialog-BcGW8-Kf.js +584 -0
- package/dist/frontend-ssr/assets/ConfirmDialog-DjMFKc0V.js +420 -0
- package/dist/frontend-ssr/assets/CreateSnapshotDialog-1bROJ-Rn.js +214 -0
- package/dist/frontend-ssr/assets/DatePicker-B1ML8OVz.js +312 -0
- package/dist/frontend-ssr/assets/DeleteDialog-tBYaP0L3.js +154 -0
- package/dist/frontend-ssr/assets/FolderNode-BZ0Q2QUS.js +171 -0
- package/dist/frontend-ssr/assets/FolderTreeSelector-DZNZ2oI6.js +147 -0
- package/dist/frontend-ssr/assets/HiaiDocsExtensionProvider-DAM-lX4R.js +13 -0
- package/dist/frontend-ssr/assets/Icon-B0Zqppjo.js +231 -0
- package/dist/frontend-ssr/assets/SettingsDialog-B8L_YqNA.js +1107 -0
- package/dist/frontend-ssr/assets/ShareDialog-vMvJLRfn.js +54 -0
- package/dist/frontend-ssr/assets/Sidebar-EHuUAx3W.js +2033 -0
- package/dist/frontend-ssr/assets/TagCreateDialog-B0DPEfmQ.js +264 -0
- package/dist/frontend-ssr/assets/api-keys-DFqX39MT.js +35 -0
- package/dist/frontend-ssr/assets/attachments-CWBxE3Vz.js +85 -0
- package/dist/frontend-ssr/assets/auth-client-x26kqY8Z.js +1286 -0
- package/dist/frontend-ssr/assets/camera-CdxscTw-.js +84 -0
- package/dist/frontend-ssr/assets/categories-AOqgcsn4.js +75 -0
- package/dist/frontend-ssr/assets/chevron-down-CSSNGNh_.js +80 -0
- package/dist/frontend-ssr/assets/chevron-right-B4p7Sk6X.js +80 -0
- package/dist/frontend-ssr/assets/circle-check-CI1v4vYh.js +84 -0
- package/dist/frontend-ssr/assets/client-DZMkDkDn.js +129 -0
- package/dist/frontend-ssr/assets/clipboard-CXOaoz2W.js +30 -0
- package/dist/frontend-ssr/assets/clock-IL-eX2di.js +84 -0
- package/dist/frontend-ssr/assets/confirm-dialog-BCthVwUY.js +429 -0
- package/dist/frontend-ssr/assets/context-jz1GGEUi.js +45 -0
- package/dist/frontend-ssr/assets/copy-CjV57nGQ.js +87 -0
- package/dist/frontend-ssr/assets/db-CnxeO66n.js +65 -0
- package/dist/frontend-ssr/assets/dialog-BOV1u6zP.js +157 -0
- package/dist/frontend-ssr/assets/dndzone-DMvTO_Jz.js +2114 -0
- package/dist/frontend-ssr/assets/document-drop-coordinator-CEaYACsC.js +109 -0
- package/dist/frontend-ssr/assets/documents-BnOTRdTY.js +108 -0
- package/dist/frontend-ssr/assets/dropdown-menu-Bj5rbqbB.js +555 -0
- package/dist/frontend-ssr/assets/editorExtensions-DUzwndMy.js +186 -0
- package/dist/frontend-ssr/assets/floating-layer-anchor-CYIE8Oj6.js +6114 -0
- package/dist/frontend-ssr/assets/folder-DChhG7qN.js +80 -0
- package/dist/frontend-ssr/assets/folders-CTfbS24J.js +127 -0
- package/dist/frontend-ssr/assets/identity-B3uHoDtf.js +99 -0
- package/dist/frontend-ssr/assets/input-DezGsU3y.js +19 -0
- package/dist/frontend-ssr/assets/keyboard.svelte-BgF47N3L.js +174 -0
- package/dist/frontend-ssr/assets/label-Bj8-TfFN.js +21 -0
- package/dist/frontend-ssr/assets/loader-circle-DZsrZ-er.js +80 -0
- package/dist/frontend-ssr/assets/markdown-CjqvGi5W.js +20 -0
- package/dist/frontend-ssr/assets/messages-CvqpZNJe.js +11125 -0
- package/dist/frontend-ssr/assets/resolve-BqHozBXl.js +32 -0
- package/dist/frontend-ssr/assets/rotate-ccw-BlgWwaiq.js +80 -0
- package/dist/frontend-ssr/assets/select-value-6Lk0ToYd.js +1526 -0
- package/dist/frontend-ssr/assets/settings-Bk5Hk9Vq.js +64 -0
- package/dist/frontend-ssr/assets/share-BTBJelxA.js +30 -0
- package/dist/frontend-ssr/assets/subfolders-refresh-store.svelte-DAh4gT16.js +77 -0
- package/dist/frontend-ssr/assets/tag-GZEuGWk1.js +166 -0
- package/dist/frontend-ssr/assets/tag-store.svelte-DPodKj6Z.js +21 -0
- package/dist/frontend-ssr/assets/tags-BId2wdYd.js +49 -0
- package/dist/frontend-ssr/assets/textarea-Dev-qSEc.js +21 -0
- package/dist/frontend-ssr/assets/theme.svelte-Co0-ssaD.js +67 -0
- package/dist/frontend-ssr/assets/utils-DtlPPXpJ.js +9 -0
- package/dist/frontend-ssr/assets/utils-DvZnctjz.js +23 -0
- package/dist/frontend-ssr/collaboration.js +39 -0
- package/dist/frontend-ssr/components/category-dialog.js +2 -0
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +2 -0
- package/dist/frontend-ssr/components/delete-dialog.js +2 -0
- package/dist/frontend-ssr/components/editor/document-editor.js +2499 -0
- package/dist/frontend-ssr/components/editor/document-title.js +11 -0
- package/dist/frontend-ssr/components/editor/docx-serializer.js +186 -0
- package/dist/frontend-ssr/components/editor/extensions.js +2 -0
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +20 -0
- package/dist/frontend-ssr/components/editor/markdown.js +2 -0
- package/dist/frontend-ssr/components/folder-node.js +2 -0
- package/dist/frontend-ssr/components/folder-tree-selector.js +2 -0
- package/dist/frontend-ssr/components/save-as-dialog.js +280 -0
- package/dist/frontend-ssr/components/settings.js +2 -0
- package/dist/frontend-ssr/components/share-dialog.js +2 -0
- package/dist/frontend-ssr/components/sidebar.js +2 -0
- package/dist/frontend-ssr/components/tag-create-dialog.js +2 -0
- package/dist/frontend-ssr/components/version-history.js +370 -0
- package/dist/frontend-ssr/dashboard.js +2542 -0
- package/dist/frontend-ssr/doc-tabs.js +23 -0
- package/dist/frontend-ssr/document-drop-coordinator.js +2 -0
- package/dist/frontend-ssr/extension.js +2 -0
- package/dist/frontend-ssr/folder-refresh.js +2 -0
- package/dist/frontend-ssr/i18n.js +10 -0
- package/dist/frontend-ssr/keyboard.js +2 -0
- package/dist/frontend-ssr/offline/identity.js +2 -0
- package/dist/frontend-ssr/search.js +332 -0
- package/dist/frontend-ssr/shared-document.js +273 -0
- package/dist/frontend-ssr/theme.js +9 -0
- package/dist/frontend-ssr/types.js +1 -0
- package/dist/frontend-ssr/utils/clipboard.js +2 -0
- package/dist/frontend-ssr/utils/dndzone.js +2 -0
- package/dist/frontend-ssr/utils.js +2 -0
- package/package.json +28 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +3 -0
- package/packages/mcp-server/src/index.ts +1 -1
- package/dist/frontend/CategoryDialog--rIE7FrH.js +0 -580
- package/dist/frontend/ConfirmDialog-Cpzyb55f.js +0 -212
- package/dist/frontend/CreateSnapshotDialog-CmkV-n2A.js +0 -216
- package/dist/frontend/DatePicker-Byynca7V.js +0 -257
- package/dist/frontend/DeleteDialog-ap6nOywZ.js +0 -174
- package/dist/frontend/FolderDialog-DmN_trV0.js +0 -247
- package/dist/frontend/FolderNode-C4B8a2fd.js +0 -317
- package/dist/frontend/FolderTreeSelector-D6ijiZTA.js +0 -100
- package/dist/frontend/Icon-DtNo0N1U.js +0 -64
- package/dist/frontend/SettingsDialog-2kTaTXAs.js +0 -992
- package/dist/frontend/ShareDialog-BBDGNF5n.js +0 -165
- package/dist/frontend/TagCreateDialog-DiLZnJo4.js +0 -258
- package/dist/frontend/camera-B7dAOd4s.js +0 -28
- package/dist/frontend/check-CDwRlG9T.js +0 -24
- package/dist/frontend/chevron-down-B7ZrjUmT.js +0 -24
- package/dist/frontend/circle-check-CDqeMB2d.js +0 -28
- package/dist/frontend/client-Bc5Fzx40.js +0 -2785
- package/dist/frontend/clock-Ck5Sn-Zl.js +0 -28
- package/dist/frontend/clsx-nmtDPO_P.js +0 -16
- package/dist/frontend/copy-CMAA6GP0.js +0 -31
- package/dist/frontend/dialog-BDkiG42a.js +0 -213
- package/dist/frontend/disclose-version-5I57E3LD.js +0 -3
- package/dist/frontend/ellipsis-vertical-BBuPldbW.js +0 -519
- package/dist/frontend/folder-TQjKY4yn.js +0 -44
- package/dist/frontend/index-client-jobkrWVL.js +0 -86
- package/dist/frontend/input-CBI6p4Xl.js +0 -23
- package/dist/frontend/label-C-GkhEp4.js +0 -30
- package/dist/frontend/rotate-ccw-CleZtJ5D.js +0 -24
- package/dist/frontend/select-value-CvrWRkXW.js +0 -1436
- package/dist/frontend/subfolders-refresh-store.svelte-BsheoQma.js +0 -65
- package/dist/frontend/tag-Dx3SmucJ.js +0 -53
- package/dist/frontend/tag-store.svelte-CIaF4sdZ.js +0 -29
- package/dist/frontend/textarea-Dfp78XlL.js +0 -23
- package/dist/frontend/theme.svelte-CROg1Hi5.js +0 -49
- package/dist/frontend/x-DaTdeDXv.js +0 -24
|
@@ -0,0 +1,2021 @@
|
|
|
1
|
+
import { t as e } from "./Icon-CooFj4Ee.js";
|
|
2
|
+
import { t } from "./check-D-UuvBuh.js";
|
|
3
|
+
import { t as n } from "./chevron-down-CiPtYyFh.js";
|
|
4
|
+
import { n as r, t as i } from "./folder-DeWhnD7O.js";
|
|
5
|
+
import { t as a } from "./clock-DJHbHZb8.js";
|
|
6
|
+
import { t as o } from "./copy-GppwRMjX.js";
|
|
7
|
+
import { n as s, r as c, t as l } from "./confirm-dialog-C4jTRbiS.js";
|
|
8
|
+
import { t as u } from "./SettingsDialog-BHh68rTB.js";
|
|
9
|
+
import { n as d, t as f } from "./tag-HxRazVN_.js";
|
|
10
|
+
import { t as p } from "./x-CzBsnJ2x.js";
|
|
11
|
+
import { a as m, i as h, o as g, r as _, t as ee } from "./dropdown-menu-CRSby3e9.js";
|
|
12
|
+
import { n as te } from "./dist-C3857Spp.js";
|
|
13
|
+
import { $r as v, Ai as y, C as b, Ci as ne, D as x, Di as S, Ei as C, Fi as w, Gt as T, Ht as E, It as D, Jn as re, Ni as ie, Oi as ae, Qr as O, Ti as k, Tr as A, Un as j, Wn as M, Wt as oe, Xr as N, Yn as se, Yr as P, Zr as F, _i as ce, ar as le, ci as ue, er as de, f as fe, fi as pe, li as me, mi as he, ni as I, nr as ge, rr as _e, tr as L, ui as ve, wi as ye } from "./messages-C5Q890i2.js";
|
|
14
|
+
import { t as R } from "./utils-DrfHTcei.js";
|
|
15
|
+
import { a as be, i as xe, n as Se, o as Ce, r as we, t as Te } from "./dialog-Bevp9mmM.js";
|
|
16
|
+
import { t as Ee } from "./input-BWlOML_m.js";
|
|
17
|
+
import { t as De } from "./label-C2HfJNQ2.js";
|
|
18
|
+
import { n as Oe } from "./client-GbtOH90i.js";
|
|
19
|
+
import { i as ke, r as Ae, s as je } from "./categories-izQovv2w.js";
|
|
20
|
+
import { t as Me } from "./context-BMD6XTPe.js";
|
|
21
|
+
import { t as z } from "./resolve-BG4HgzpN.js";
|
|
22
|
+
import { n as Ne, t as Pe } from "./dndzone-BzsOINtP.js";
|
|
23
|
+
import { c as Fe, i as Ie, r as Le, s as Re, t as ze } from "./documents-BsDkvzCm.js";
|
|
24
|
+
import { c as Be, r as Ve, s as He, t as Ue } from "./folders-CTuV_JtU.js";
|
|
25
|
+
import { t as We } from "./DeleteDialog-CvAr2WPu.js";
|
|
26
|
+
import { t as Ge } from "./clipboard-Cgzxc0_R.js";
|
|
27
|
+
import { t as Ke } from "./ShareDialog-BUOkYSlw.js";
|
|
28
|
+
import { t as qe } from "./CategoryDialog-CxVyaBV5.js";
|
|
29
|
+
import { n as Je, t as Ye } from "./document-drop-coordinator-C4xHMjwC.js";
|
|
30
|
+
import { a as Xe, c as Ze, f as Qe, i as $e, n as et, o as tt, p as nt, r as rt, s as it, t as at, u as ot } from "./subfolders-refresh-store.svelte-B2dKVmgz.js";
|
|
31
|
+
import { t as st } from "./FolderNode-C6FJv99G.js";
|
|
32
|
+
import { a as ct, i as lt, n as B, o as ut, s as dt, t as ft } from "./tag-store.svelte-CqrUXo0o.js";
|
|
33
|
+
import { t as pt } from "./ConfirmDialog-NFGXRa3E.js";
|
|
34
|
+
import { i as mt, o as ht } from "./tags-CtCV0Djo.js";
|
|
35
|
+
import { t as gt } from "./TagCreateDialog-B9YZBNHi.js";
|
|
36
|
+
import "svelte/internal/disclose-version";
|
|
37
|
+
import * as V from "svelte/internal/client";
|
|
38
|
+
import "svelte/internal/flags/legacy";
|
|
39
|
+
import { onDestroy as _t, onMount as vt, untrack as yt } from "svelte";
|
|
40
|
+
import { goto as bt } from "$app/navigation";
|
|
41
|
+
import { page as xt } from "$app/state";
|
|
42
|
+
import { flip as St } from "svelte/animate";
|
|
43
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/panel-left-close.svelte
|
|
44
|
+
function H(t, n) {
|
|
45
|
+
let r = V.legacy_rest_props(n, [
|
|
46
|
+
"children",
|
|
47
|
+
"$$slots",
|
|
48
|
+
"$$events",
|
|
49
|
+
"$$legacy"
|
|
50
|
+
]), i = [
|
|
51
|
+
["rect", {
|
|
52
|
+
width: "18",
|
|
53
|
+
height: "18",
|
|
54
|
+
x: "3",
|
|
55
|
+
y: "3",
|
|
56
|
+
rx: "2"
|
|
57
|
+
}],
|
|
58
|
+
["path", { d: "M9 3v18" }],
|
|
59
|
+
["path", { d: "m16 15-3-3 3-3" }]
|
|
60
|
+
];
|
|
61
|
+
e(t, V.spread_props({ name: "panel-left-close" }, () => r, {
|
|
62
|
+
get iconNode() {
|
|
63
|
+
return i;
|
|
64
|
+
},
|
|
65
|
+
children: (e, t) => {
|
|
66
|
+
var r = V.comment(), i = V.first_child(r);
|
|
67
|
+
V.slot(i, n, "default", {}, null), V.append(e, r);
|
|
68
|
+
},
|
|
69
|
+
$$slots: { default: !0 }
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/panel-left-open.svelte
|
|
74
|
+
function U(t, n) {
|
|
75
|
+
let r = V.legacy_rest_props(n, [
|
|
76
|
+
"children",
|
|
77
|
+
"$$slots",
|
|
78
|
+
"$$events",
|
|
79
|
+
"$$legacy"
|
|
80
|
+
]), i = [
|
|
81
|
+
["rect", {
|
|
82
|
+
width: "18",
|
|
83
|
+
height: "18",
|
|
84
|
+
x: "3",
|
|
85
|
+
y: "3",
|
|
86
|
+
rx: "2"
|
|
87
|
+
}],
|
|
88
|
+
["path", { d: "M9 3v18" }],
|
|
89
|
+
["path", { d: "m14 9 3 3-3 3" }]
|
|
90
|
+
];
|
|
91
|
+
e(t, V.spread_props({ name: "panel-left-open" }, () => r, {
|
|
92
|
+
get iconNode() {
|
|
93
|
+
return i;
|
|
94
|
+
},
|
|
95
|
+
children: (e, t) => {
|
|
96
|
+
var r = V.comment(), i = V.first_child(r);
|
|
97
|
+
V.slot(i, n, "default", {}, null), V.append(e, r);
|
|
98
|
+
},
|
|
99
|
+
$$slots: { default: !0 }
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/settings.svelte
|
|
104
|
+
function Ct(t, n) {
|
|
105
|
+
let r = V.legacy_rest_props(n, [
|
|
106
|
+
"children",
|
|
107
|
+
"$$slots",
|
|
108
|
+
"$$events",
|
|
109
|
+
"$$legacy"
|
|
110
|
+
]), i = [["path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", {
|
|
111
|
+
cx: "12",
|
|
112
|
+
cy: "12",
|
|
113
|
+
r: "3"
|
|
114
|
+
}]];
|
|
115
|
+
e(t, V.spread_props({ name: "settings" }, () => r, {
|
|
116
|
+
get iconNode() {
|
|
117
|
+
return i;
|
|
118
|
+
},
|
|
119
|
+
children: (e, t) => {
|
|
120
|
+
var r = V.comment(), i = V.first_child(r);
|
|
121
|
+
V.slot(i, n, "default", {}, null), V.append(e, r);
|
|
122
|
+
},
|
|
123
|
+
$$slots: { default: !0 }
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/lib/components/SearchBar.svelte
|
|
128
|
+
var wt = V.from_html("<button type=\"button\" class=\"absolute right-2 top-1/2 inline-flex size-5 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"><!></button>"), Tt = V.from_html("<div><!> <input type=\"text\"/> <!></div>");
|
|
129
|
+
function Et(e, t) {
|
|
130
|
+
V.push(t, !0);
|
|
131
|
+
let n = V.state(""), r = V.state(null);
|
|
132
|
+
function i() {
|
|
133
|
+
V.set(n, ""), V.get(r)?.focus();
|
|
134
|
+
}
|
|
135
|
+
var a = Tt(), o = V.child(a);
|
|
136
|
+
d(o, { class: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" });
|
|
137
|
+
var s = V.sibling(o, 2);
|
|
138
|
+
V.remove_input_defaults(s), V.bind_this(s, (e) => V.set(r, e), () => V.get(r));
|
|
139
|
+
var c = V.sibling(s, 2), l = (e) => {
|
|
140
|
+
var t = wt();
|
|
141
|
+
p(V.child(t), { class: "size-3.5" }), V.reset(t), V.template_effect((e, n) => {
|
|
142
|
+
V.set_attribute(t, "aria-label", e), V.set_attribute(t, "title", n);
|
|
143
|
+
}, [() => D(), () => D()]), V.delegated("click", t, i), V.append(e, t);
|
|
144
|
+
};
|
|
145
|
+
V.if(c, (e) => {
|
|
146
|
+
V.get(n) && e(l);
|
|
147
|
+
}), V.reset(a), V.template_effect((e, t, n) => {
|
|
148
|
+
V.set_class(a, 1, e), V.set_attribute(s, "placeholder", t), V.set_class(s, 1, n);
|
|
149
|
+
}, [
|
|
150
|
+
() => V.clsx(R("relative", t.class)),
|
|
151
|
+
() => P(),
|
|
152
|
+
() => V.clsx(R("flex h-9 w-full rounded-md border border-input bg-transparent pl-9 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", V.get(n) ? "pr-9" : "pr-3"))
|
|
153
|
+
]), V.delegated("keydown", s, (e) => {
|
|
154
|
+
e.key === "Enter" && V.get(n).trim() && bt(`/search?q=${encodeURIComponent(V.get(n).trim())}`);
|
|
155
|
+
}), V.event("focus", s, () => {}), V.bind_value(s, () => V.get(n), (e) => V.set(n, e)), V.append(e, a), V.pop();
|
|
156
|
+
}
|
|
157
|
+
V.delegate(["keydown", "click"]);
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/lib/components/sidebar/FolderTree.svelte
|
|
160
|
+
var Dt = (e, t = V.noop) => {
|
|
161
|
+
var n = Mt(), r = V.sibling(V.child(n), 2);
|
|
162
|
+
c(r, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
163
|
+
var i = V.sibling(r, 2), a = V.child(i, !0);
|
|
164
|
+
V.reset(i), V.reset(n), V.template_effect((e) => {
|
|
165
|
+
V.set_attribute(n, "href", `/docs/${t().id}`), V.set_class(n, 1, e), V.set_text(a, t().title);
|
|
166
|
+
}, [() => V.clsx(R("flex w-full min-w-0 items-center gap-1.5 rounded-md px-2 py-1 text-sm transition-colors hover:bg-accent hover:text-accent-foreground", xt.params.id === t().id && "bg-accent text-accent-foreground font-medium"))]), V.append(e, n);
|
|
167
|
+
}, Ot = V.from_html("<button><!></button>"), kt = V.from_html("<!> <!> <!>", 1), At = V.from_html("<!> <!>", 1), jt = V.from_html("<button type=\"button\"><!></button>"), Mt = V.from_html("<a data-sveltekit-noscroll=\"\"><span class=\"w-3.5 shrink-0\"></span> <!> <span class=\"min-w-0 truncate\"> </span></a>"), Nt = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), Pt = V.from_html("<!> <!> <!> <!> <!> <!>", 1), Ft = V.from_html("<div><!></div>"), It = V.from_html("<div class=\"group/doc flex w-full min-w-0 items-center gap-1\"><!> <!> <!></div>"), Lt = V.from_html("<div class=\"ml-0.5 space-y-0.5 border-l border-border pl-0.5\"><div></div> <div></div></div>"), Rt = V.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\"><!> <span class=\"min-w-0 truncate\"> </span></button> <!></div> <!></div>"), zt = V.from_html("<div class=\"group/bucket\"><div class=\"flex w-full min-w-0 items-center gap-0.5\"><button type=\"button\"><!> <span class=\"min-w-0 truncate\"> </span></button></div> <!></div>"), Bt = V.from_html("<p id=\"rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Vt = V.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), Ht = V.from_html("<div class=\"space-y-1\"><div class=\"mb-2 flex items-center justify-between gap-1\"><a href=\"/\" class=\"block flex-1 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground\"> </a> <button type=\"button\" class=\"inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"><!></button></div> <!> <!> <div class=\"min-h-[8px] space-y-1\"></div> <!> <button type=\"button\" class=\"flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!> <span> </span></button></div> <!> <!> <!> <!> <!>", 1);
|
|
168
|
+
function Ut(e, i) {
|
|
169
|
+
V.push(i, !0);
|
|
170
|
+
let a = (e, t = V.noop) => {
|
|
171
|
+
m(e, {
|
|
172
|
+
children: (e, n) => {
|
|
173
|
+
var r = At(), i = V.first_child(r);
|
|
174
|
+
ee(i, {
|
|
175
|
+
child: (e, t) => {
|
|
176
|
+
let n = () => (t?.()).props;
|
|
177
|
+
var r = Ot(), i = (e) => {
|
|
178
|
+
e.preventDefault(), e.stopPropagation();
|
|
179
|
+
};
|
|
180
|
+
V.attribute_effect(r, (e, t) => ({
|
|
181
|
+
...n(),
|
|
182
|
+
type: "button",
|
|
183
|
+
class: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
184
|
+
"aria-label": e,
|
|
185
|
+
title: t,
|
|
186
|
+
onclick: i
|
|
187
|
+
}), [() => T(), () => T()]), g(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
188
|
+
},
|
|
189
|
+
$$slots: { child: !0 }
|
|
190
|
+
}), h(V.sibling(i, 2), {
|
|
191
|
+
align: "end",
|
|
192
|
+
children: (e, n) => {
|
|
193
|
+
var r = kt(), i = V.first_child(r);
|
|
194
|
+
_(i, {
|
|
195
|
+
onSelect: () => $n("doc", t().id, t().title),
|
|
196
|
+
children: (e, t) => {
|
|
197
|
+
V.next();
|
|
198
|
+
var n = V.text();
|
|
199
|
+
V.template_effect((e) => V.set_text(n, e), [() => he()]), V.append(e, n);
|
|
200
|
+
},
|
|
201
|
+
$$slots: { default: !0 }
|
|
202
|
+
});
|
|
203
|
+
var a = V.sibling(i, 2);
|
|
204
|
+
_(a, {
|
|
205
|
+
onSelect: () => rr(t().id, t().title),
|
|
206
|
+
children: (e, t) => {
|
|
207
|
+
V.next();
|
|
208
|
+
var n = V.text();
|
|
209
|
+
V.template_effect((e) => V.set_text(n, e), [() => ye()]), V.append(e, n);
|
|
210
|
+
},
|
|
211
|
+
$$slots: { default: !0 }
|
|
212
|
+
}), _(V.sibling(a, 2), {
|
|
213
|
+
class: "text-destructive focus:text-destructive",
|
|
214
|
+
onSelect: () => nr("doc", t().id, t().title),
|
|
215
|
+
children: (e, t) => {
|
|
216
|
+
V.next();
|
|
217
|
+
var n = V.text();
|
|
218
|
+
V.template_effect((e) => V.set_text(n, e), [() => L()]), V.append(e, n);
|
|
219
|
+
},
|
|
220
|
+
$$slots: { default: !0 }
|
|
221
|
+
}), V.append(e, r);
|
|
222
|
+
},
|
|
223
|
+
$$slots: { default: !0 }
|
|
224
|
+
}), V.append(e, r);
|
|
225
|
+
},
|
|
226
|
+
$$slots: { default: !0 }
|
|
227
|
+
});
|
|
228
|
+
}, c = (e, n = V.noop) => {
|
|
229
|
+
var r = jt(), i = V.child(r), a = (e) => {
|
|
230
|
+
te(e, { class: "size-3.5 animate-spin" });
|
|
231
|
+
}, s = (e) => {
|
|
232
|
+
t(e, { class: "size-3.5" });
|
|
233
|
+
}, c = (e) => {
|
|
234
|
+
o(e, { class: "size-3.5" });
|
|
235
|
+
};
|
|
236
|
+
V.if(i, (e) => {
|
|
237
|
+
V.get(rn) === n().id ? e(a) : V.get(nn) === n().id ? e(s, 1) : e(c, -1);
|
|
238
|
+
}), V.reset(r), V.template_effect((e, t) => {
|
|
239
|
+
V.set_class(r, 1, `inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(nn) === n().id || V.get(rn) === n().id ? "opacity-100" : ""}`), V.set_attribute(r, "aria-label", e), V.set_attribute(r, "title", t), r.disabled = V.get(rn) === n().id;
|
|
240
|
+
}, [() => oe(), () => oe()]), V.delegated("click", r, (e) => {
|
|
241
|
+
e.preventDefault(), e.stopPropagation(), on(n().id);
|
|
242
|
+
}), V.append(e, r);
|
|
243
|
+
}, u = (e, t = V.noop) => {
|
|
244
|
+
st(e, {
|
|
245
|
+
get folder() {
|
|
246
|
+
return t();
|
|
247
|
+
},
|
|
248
|
+
get expandedFolderIds() {
|
|
249
|
+
return V.get(E);
|
|
250
|
+
},
|
|
251
|
+
onToggleFolder: wn,
|
|
252
|
+
onRename: (e, t) => $n("folder", e, t),
|
|
253
|
+
onDelete: (e, t) => nr("folder", e, t),
|
|
254
|
+
onCreateSubfolder: kn,
|
|
255
|
+
onShare: ir,
|
|
256
|
+
get dragDisabled() {
|
|
257
|
+
return V.get(P);
|
|
258
|
+
},
|
|
259
|
+
get isDraggingGlobal() {
|
|
260
|
+
return V.get(F);
|
|
261
|
+
},
|
|
262
|
+
get isDraggingFolder() {
|
|
263
|
+
return V.get(I);
|
|
264
|
+
},
|
|
265
|
+
get isDraggingDoc() {
|
|
266
|
+
return V.get(Me);
|
|
267
|
+
},
|
|
268
|
+
get draggedDocId() {
|
|
269
|
+
return V.get(z);
|
|
270
|
+
},
|
|
271
|
+
onScheduleFolderExpand: cn,
|
|
272
|
+
onClearExpandTimer: sn,
|
|
273
|
+
onConsiderDocs: Mn,
|
|
274
|
+
onFinalizeDocs: Nn,
|
|
275
|
+
onConsiderSubfolders: Vn,
|
|
276
|
+
onFinalizeSubfolders: Hn,
|
|
277
|
+
onDropOnFolder: Ln,
|
|
278
|
+
get folderDocsMap() {
|
|
279
|
+
return V.get(gt);
|
|
280
|
+
},
|
|
281
|
+
folderFlipDurationMs: d,
|
|
282
|
+
documentFlipDurationMs: f,
|
|
283
|
+
get docRowInner() {
|
|
284
|
+
return Dt;
|
|
285
|
+
},
|
|
286
|
+
get copyButton() {
|
|
287
|
+
return c;
|
|
288
|
+
},
|
|
289
|
+
get docMenu() {
|
|
290
|
+
return a;
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
}, d = 200, f = 80, p = V.state(V.proxy([])), v = V.state(V.proxy([])), x = V.state(V.proxy([])), E = V.state(V.proxy(/* @__PURE__ */ new Set())), D = V.state(V.proxy(/* @__PURE__ */ new Set())), O = V.state(!0), k = V.state(null), A = V.state(null), M = null;
|
|
294
|
+
function N(e) {
|
|
295
|
+
V.set(A, e, !0), M &&= (clearTimeout(M), null), e !== null && (M = setTimeout(() => {
|
|
296
|
+
V.set(A, null), M = null;
|
|
297
|
+
}, 5e3));
|
|
298
|
+
}
|
|
299
|
+
let P = V.state(!1), F = V.state(!1), I = V.state(!1), Me = V.state(!1), z = V.state(null), lt = 0, ut = V.state(!1), dt = V.state(!1), pt = 0, mt = Promise.resolve(), ht = V.state(V.proxy([])), gt = V.state(V.proxy({})), xt = V.state(V.proxy({})), H = V.state(V.proxy({})), U = V.state(V.proxy([])), Ct = V.state(!1), wt = V.state(null), Tt = V.state(null), Et = V.state(!1), Mt = V.state(null), Ut = V.state(""), W = V.state(null), G = V.state(!1), K = V.state(!1), q = V.state(null), Wt = V.state(!1), Gt = V.state(""), Kt = V.state(""), qt = V.state(""), Jt = V.state(""), Yt = V.state(""), Xt = V.state(""), Zt = V.state(!1), Qt = V.state("create"), J = V.state(null), $t = V.state(!1), Y = null, en = V.state(null), X = null, tn = V.state(null), nn = V.state(null), rn = V.state(null), an = null;
|
|
300
|
+
async function on(e) {
|
|
301
|
+
if (typeof window > "u") return;
|
|
302
|
+
let t = V.get(x).find((t) => t.id === e), n = "";
|
|
303
|
+
V.set(rn, e, !0);
|
|
304
|
+
try {
|
|
305
|
+
n = (await Ie(e)).content ?? "";
|
|
306
|
+
} catch (e) {
|
|
307
|
+
console.error("FolderTree: failed to fetch full document for copy", e), n = t?.excerpt ?? t?.content ?? "";
|
|
308
|
+
} finally {
|
|
309
|
+
V.set(rn, null);
|
|
310
|
+
}
|
|
311
|
+
n && await Ge(n) && (V.set(nn, e, !0), an && clearTimeout(an), an = setTimeout(() => {
|
|
312
|
+
V.set(nn, null), an = null;
|
|
313
|
+
}, 2e3));
|
|
314
|
+
}
|
|
315
|
+
function sn() {
|
|
316
|
+
Y !== null && (clearTimeout(Y), Y = null), V.set(en, null);
|
|
317
|
+
}
|
|
318
|
+
function cn(e) {
|
|
319
|
+
sn(), !V.get(E).has(e) && (V.set(en, e, !0), Y = setTimeout(() => {
|
|
320
|
+
if (V.get(en) === e && !V.get(E).has(e)) {
|
|
321
|
+
let t = new Set(V.get(E));
|
|
322
|
+
t.add(e), V.set(E, t, !0);
|
|
323
|
+
}
|
|
324
|
+
Y = null, V.set(en, null);
|
|
325
|
+
}, 400));
|
|
326
|
+
}
|
|
327
|
+
function ln() {
|
|
328
|
+
X !== null && (clearTimeout(X), X = null), V.set(tn, null);
|
|
329
|
+
}
|
|
330
|
+
function un(e) {
|
|
331
|
+
ln(), !(e === $ ? V.get(O) : V.get(D).has(e)) && (V.set(tn, e, !0), X = setTimeout(() => {
|
|
332
|
+
if (V.get(tn) === e) if (e === $) V.set(O, !0);
|
|
333
|
+
else {
|
|
334
|
+
let t = new Set(V.get(D));
|
|
335
|
+
t.add(e), V.set(D, t, !0);
|
|
336
|
+
}
|
|
337
|
+
X = null, V.set(tn, null);
|
|
338
|
+
}, 400));
|
|
339
|
+
}
|
|
340
|
+
function dn(e) {
|
|
341
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
342
|
+
}
|
|
343
|
+
function fn(e) {
|
|
344
|
+
let t = [], n = {}, r = {};
|
|
345
|
+
for (let i of e) if (i.folderId) {
|
|
346
|
+
let e = r[i.folderId] ?? [];
|
|
347
|
+
e.push(i), r[i.folderId] = e;
|
|
348
|
+
} else if (i.categoryId) {
|
|
349
|
+
let e = n[i.categoryId] ?? [];
|
|
350
|
+
e.push(i), n[i.categoryId] = e;
|
|
351
|
+
} else t.push(i);
|
|
352
|
+
return {
|
|
353
|
+
root: t,
|
|
354
|
+
byCategory: n,
|
|
355
|
+
byFolder: r
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
function pn() {
|
|
359
|
+
let { root: e, byCategory: t, byFolder: n } = fn(V.get(x));
|
|
360
|
+
V.set(ht, e, !0), V.set(xt, t, !0), V.set(gt, n, !0);
|
|
361
|
+
}
|
|
362
|
+
function mn() {
|
|
363
|
+
let e = /* @__PURE__ */ new Map();
|
|
364
|
+
for (let t of V.get(v)) e.set(t.id, []);
|
|
365
|
+
let t = [];
|
|
366
|
+
for (let n of V.get(p)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
367
|
+
let n = {};
|
|
368
|
+
for (let t of V.get(v)) n[t.id] = e.get(t.id) ?? [];
|
|
369
|
+
n[$] = t, V.set(H, n, !0);
|
|
370
|
+
}
|
|
371
|
+
V.user_effect(() => {
|
|
372
|
+
V.get(p), V.get(v), !(V.get(ut) || V.get(dt)) && (V.set(U, V.get(gr).map((e) => ({
|
|
373
|
+
id: e.id,
|
|
374
|
+
category: e.category,
|
|
375
|
+
folders: e.folders
|
|
376
|
+
})), !0), mn());
|
|
377
|
+
});
|
|
378
|
+
async function hn() {
|
|
379
|
+
try {
|
|
380
|
+
let e = await He(null);
|
|
381
|
+
V.set(p, (e[0]?.children ?? []).map((e) => (nt(e.id, e.parentId ?? null, e.categoryId ?? null, e.order ?? 0), {
|
|
382
|
+
id: e.id,
|
|
383
|
+
name: e.name,
|
|
384
|
+
categoryId: e.categoryId ?? null,
|
|
385
|
+
parentId: e.parentId,
|
|
386
|
+
order: e.order ?? 0
|
|
387
|
+
})), !0), V.set(k, null);
|
|
388
|
+
} catch (e) {
|
|
389
|
+
console.error("FolderTree: failed to load folders", e), V.set(k, "Failed to load folders");
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
async function gn() {
|
|
393
|
+
try {
|
|
394
|
+
let e = await ke(), t = /* @__PURE__ */ new Set();
|
|
395
|
+
for (let n of e) {
|
|
396
|
+
if (t.has(n.id)) throw Error(`Categories response contains duplicate id: ${n.id}`);
|
|
397
|
+
t.add(n.id);
|
|
398
|
+
}
|
|
399
|
+
V.set(v, e, !0);
|
|
400
|
+
} catch (e) {
|
|
401
|
+
console.error("FolderTree: failed to load categories", e);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
let _n = 0;
|
|
405
|
+
async function vn() {
|
|
406
|
+
let e = ++_n;
|
|
407
|
+
try {
|
|
408
|
+
let t = B(), n = await Re({
|
|
409
|
+
limit: 100,
|
|
410
|
+
...t ? { tag: t } : {}
|
|
411
|
+
});
|
|
412
|
+
if (e !== _n) return;
|
|
413
|
+
V.set(x, n.items.map((e) => Ze(e.id) ? {
|
|
414
|
+
...e,
|
|
415
|
+
folderId: Ze(e.id)?.folderId ?? null,
|
|
416
|
+
categoryId: Ze(e.id)?.categoryId ?? null
|
|
417
|
+
} : e), !0), V.get(x).forEach((e) => {
|
|
418
|
+
e.id, e.title, e.categoryId, e.folderId, Object.keys(e), Qe(e.id, e.folderId ?? null, e.categoryId ?? null);
|
|
419
|
+
}), pn();
|
|
420
|
+
} catch (e) {
|
|
421
|
+
console.error("FolderTree: failed to load documents", e), V.set(k, "Failed to load documents");
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
async function Z() {
|
|
425
|
+
ze(), await Promise.all([
|
|
426
|
+
hn(),
|
|
427
|
+
gn(),
|
|
428
|
+
vn()
|
|
429
|
+
]);
|
|
430
|
+
}
|
|
431
|
+
function yn(e, t) {
|
|
432
|
+
_n++, Qe(e, t.folderId, t.categoryId), V.set(x, V.get(x).map((n) => n.id === e ? {
|
|
433
|
+
...n,
|
|
434
|
+
...t
|
|
435
|
+
} : n), !0), pn();
|
|
436
|
+
}
|
|
437
|
+
let bn = Je({
|
|
438
|
+
patch: (e, t) => Fe(e, t),
|
|
439
|
+
optimistic: (e, t) => ot(e, t.folderId, t.categoryId),
|
|
440
|
+
acknowledge: at,
|
|
441
|
+
rollback: yn,
|
|
442
|
+
onError: (e) => {
|
|
443
|
+
console.error("FolderTree: document move failed", e), N(e instanceof Error ? e.message : "Move failed");
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
function xn(e, t) {
|
|
447
|
+
let n = rt(e);
|
|
448
|
+
n && (n.folderId === t.folderId && n.categoryId === t.categoryId || bn(e, t, n).catch(() => void 0));
|
|
449
|
+
}
|
|
450
|
+
let Q = Ye({ persist: xn });
|
|
451
|
+
vt(() => {
|
|
452
|
+
let e = setTimeout(() => {
|
|
453
|
+
Z();
|
|
454
|
+
}, 500);
|
|
455
|
+
return () => clearTimeout(e);
|
|
456
|
+
}), _t(() => {
|
|
457
|
+
Q.cancel(), M &&= (clearTimeout(M), null), Y &&= (clearTimeout(Y), null), X &&= (clearTimeout(X), null);
|
|
458
|
+
}), V.user_effect(() => {
|
|
459
|
+
let e = ft(), t = tt();
|
|
460
|
+
e === 0 && t === 0 || Z();
|
|
461
|
+
}), V.user_effect(() => {
|
|
462
|
+
if ($e() === 0) return;
|
|
463
|
+
let e = it();
|
|
464
|
+
e && yt(() => {
|
|
465
|
+
_n++;
|
|
466
|
+
let t = V.get(x).findIndex((t) => t.id === e.id);
|
|
467
|
+
t !== -1 && (V.set(x, V.get(x).map((n, r) => r === t ? {
|
|
468
|
+
...n,
|
|
469
|
+
folderId: e.folderId,
|
|
470
|
+
categoryId: e.categoryId
|
|
471
|
+
} : n), !0), pn());
|
|
472
|
+
});
|
|
473
|
+
});
|
|
474
|
+
let Sn = !0;
|
|
475
|
+
V.user_effect(() => {
|
|
476
|
+
if (B(), Sn) {
|
|
477
|
+
Sn = !1;
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
Z();
|
|
481
|
+
});
|
|
482
|
+
async function Cn() {
|
|
483
|
+
await Z();
|
|
484
|
+
}
|
|
485
|
+
function wn(e) {
|
|
486
|
+
let t = V.get(E).has(e), n = new Set(V.get(E));
|
|
487
|
+
t ? n.delete(e) : n.add(e), V.set(E, n, !0), V.set(P, !0), typeof window < "u" && window.setTimeout(() => {
|
|
488
|
+
V.set(P, !1);
|
|
489
|
+
}, 250);
|
|
490
|
+
}
|
|
491
|
+
function Tn(e) {
|
|
492
|
+
let t = new Set(V.get(D));
|
|
493
|
+
t.has(e) ? t.delete(e) : t.add(e), V.set(D, t, !0);
|
|
494
|
+
}
|
|
495
|
+
function En() {
|
|
496
|
+
V.set(O, !V.get(O));
|
|
497
|
+
}
|
|
498
|
+
function Dn() {
|
|
499
|
+
V.set(wt, null), V.set(Tt, null), V.set(Ct, !0);
|
|
500
|
+
}
|
|
501
|
+
function On(e) {
|
|
502
|
+
V.set(wt, null), V.set(Tt, e, !0), V.set(Ct, !0);
|
|
503
|
+
}
|
|
504
|
+
function kn(e) {
|
|
505
|
+
V.set(wt, e, !0), V.set(Tt, null), V.set(Ct, !0);
|
|
506
|
+
}
|
|
507
|
+
async function An(e) {
|
|
508
|
+
let t = V.get(wt), n = await Ue({
|
|
509
|
+
name: e,
|
|
510
|
+
parentId: t,
|
|
511
|
+
categoryId: V.get(Tt)
|
|
512
|
+
});
|
|
513
|
+
return await hn(), t && (V.set(E, new Set(V.get(E)).add(t), !0), et(t)), n;
|
|
514
|
+
}
|
|
515
|
+
function jn(e, t) {
|
|
516
|
+
if (e.kind === "root") {
|
|
517
|
+
V.set(ht, t, !0);
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
if (e.kind === "category") {
|
|
521
|
+
V.set(xt, {
|
|
522
|
+
...V.get(xt),
|
|
523
|
+
[e.id]: t
|
|
524
|
+
}, !0);
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
V.set(gt, {
|
|
528
|
+
...V.get(gt),
|
|
529
|
+
[e.id]: t
|
|
530
|
+
}, !0);
|
|
531
|
+
}
|
|
532
|
+
function Mn(e) {
|
|
533
|
+
return (t) => {
|
|
534
|
+
t.stopPropagation();
|
|
535
|
+
let n = !V.get(Me);
|
|
536
|
+
V.set(F, !0), V.set(Me, !0), t.detail.info?.id && (V.set(z, t.detail.info.id, !0), n && Q.begin(t.detail.info.id, ++lt)), jn(e, dn(t.detail.items)), sn();
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
function Nn(e) {
|
|
540
|
+
return (t) => {
|
|
541
|
+
t.stopPropagation(), jn(e, dn(t.detail.items)), sn();
|
|
542
|
+
let n = t.detail.info?.trigger === "droppedIntoAnother";
|
|
543
|
+
t.detail.info?.trigger;
|
|
544
|
+
let r = t.detail.info?.id ?? V.get(z);
|
|
545
|
+
!n && r && Q.zone(r, Pn(e)), r && Q.end(r, lt), V.set(F, !1), V.set(Me, !1), typeof window < "u" ? window.setTimeout(() => {
|
|
546
|
+
V.get(z) === r && V.set(z, null);
|
|
547
|
+
}, 0) : V.set(z, null);
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
function Pn(e) {
|
|
551
|
+
return {
|
|
552
|
+
folderId: e.kind === "folder" ? e.id : null,
|
|
553
|
+
categoryId: e.kind === "category" ? e.id : e.kind === "root" ? null : Xe(e.id)?.categoryId ?? null
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
function Fn(e) {
|
|
557
|
+
(V.get(z) ?? Q.pendingId(lt)) && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
|
|
558
|
+
}
|
|
559
|
+
function In(e, t) {
|
|
560
|
+
let n = V.get(z) ?? Q.pendingId(lt);
|
|
561
|
+
if (!n) return;
|
|
562
|
+
e.preventDefault(), e.stopPropagation();
|
|
563
|
+
let r = t === $ ? null : t, i = rt(n);
|
|
564
|
+
if (!i) return;
|
|
565
|
+
let a = i.folderId !== null, o = i.categoryId !== r;
|
|
566
|
+
(a || o) && Q.header(n, {
|
|
567
|
+
folderId: null,
|
|
568
|
+
categoryId: r
|
|
569
|
+
}), V.set(z, null);
|
|
570
|
+
}
|
|
571
|
+
function Ln(e, t) {
|
|
572
|
+
let n = V.get(z) ?? Q.pendingId(lt);
|
|
573
|
+
if (!n) return;
|
|
574
|
+
e.preventDefault(), e.stopPropagation();
|
|
575
|
+
let r = Xe(t)?.categoryId ?? null, i = rt(n);
|
|
576
|
+
i && (i.folderId !== t && Q.header(n, {
|
|
577
|
+
folderId: t,
|
|
578
|
+
categoryId: r
|
|
579
|
+
}), V.set(z, null));
|
|
580
|
+
}
|
|
581
|
+
let Rn = "parent:";
|
|
582
|
+
function zn(e) {
|
|
583
|
+
return (t) => {
|
|
584
|
+
t.stopPropagation(), V.set(F, !0), V.set(I, !0);
|
|
585
|
+
let n = Un(t.detail.items);
|
|
586
|
+
e.startsWith(Rn) || V.set(H, {
|
|
587
|
+
...V.get(H),
|
|
588
|
+
[e]: n
|
|
589
|
+
}, !0);
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
function Bn(e) {
|
|
593
|
+
return (t) => {
|
|
594
|
+
t.stopPropagation();
|
|
595
|
+
let n = Un(t.detail.items), r = t.detail.info?.trigger === "droppedIntoAnother";
|
|
596
|
+
e.startsWith(Rn) || V.set(H, {
|
|
597
|
+
...V.get(H),
|
|
598
|
+
[e]: n
|
|
599
|
+
}, !0), V.set(F, !1), V.set(I, !1), r || Gn(e, n);
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
function Vn(e) {
|
|
603
|
+
return zn(`${Rn}${e}`);
|
|
604
|
+
}
|
|
605
|
+
function Hn(e) {
|
|
606
|
+
return Bn(`${Rn}${e}`);
|
|
607
|
+
}
|
|
608
|
+
function Un(e) {
|
|
609
|
+
return Array.isArray(e) ? e.filter((e) => typeof e == "object" && !!e && typeof e.id == "string") : [];
|
|
610
|
+
}
|
|
611
|
+
function Wn(e) {
|
|
612
|
+
let t = /* @__PURE__ */ new Set();
|
|
613
|
+
if (!e) return t;
|
|
614
|
+
let n = e;
|
|
615
|
+
for (; n && !t.has(n);) t.add(n), n = Xe(n)?.parentId ?? null;
|
|
616
|
+
return t;
|
|
617
|
+
}
|
|
618
|
+
async function Gn(e, t) {
|
|
619
|
+
let n = e.startsWith(Rn), r = n || e === $ ? null : e, i = n && e.slice(7) || null, a = /* @__PURE__ */ new Map(), o = n ? Wn(i) : /* @__PURE__ */ new Set();
|
|
620
|
+
if (n) for (let e of t) {
|
|
621
|
+
if (o.has(e.id)) continue;
|
|
622
|
+
let t = Xe(e.id);
|
|
623
|
+
t && t.parentId !== i && (a.set(e.id, {
|
|
624
|
+
folderId: e.id,
|
|
625
|
+
parentId: i
|
|
626
|
+
}), nt(e.id, i, t.categoryId, t.order));
|
|
627
|
+
}
|
|
628
|
+
else for (let e of t) {
|
|
629
|
+
let t = Xe(e.id);
|
|
630
|
+
if (!t) continue;
|
|
631
|
+
let n = t.categoryId !== r, i = t.parentId !== null;
|
|
632
|
+
if (n || i) {
|
|
633
|
+
let o = { folderId: e.id };
|
|
634
|
+
n && (o.categoryId = r), i && (o.parentId = null), a.set(e.id, o), nt(e.id, null, r, t.order);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
t.forEach((e, t) => {
|
|
638
|
+
if (n && o.has(e.id)) return;
|
|
639
|
+
let r = Xe(e.id);
|
|
640
|
+
if (!r) return;
|
|
641
|
+
let i = r.order !== t, s = a.get(e.id);
|
|
642
|
+
s ? (s.order = t, nt(e.id, s.parentId === void 0 ? r.parentId : s.parentId, s.categoryId === void 0 ? r.categoryId : s.categoryId, t)) : i && (a.set(e.id, {
|
|
643
|
+
folderId: e.id,
|
|
644
|
+
order: t
|
|
645
|
+
}), nt(e.id, r.parentId, r.categoryId, t));
|
|
646
|
+
});
|
|
647
|
+
let s = Array.from(a.values()), c = /* @__PURE__ */ new Set();
|
|
648
|
+
if (n) {
|
|
649
|
+
i && c.add(i);
|
|
650
|
+
for (let e of t) {
|
|
651
|
+
let t = e.parentId ?? null;
|
|
652
|
+
t !== null && t !== i && c.add(t);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
if (s.length !== 0) try {
|
|
656
|
+
await Promise.all(s.map((e) => {
|
|
657
|
+
let { folderId: t, ...n } = e;
|
|
658
|
+
return Be(t, n);
|
|
659
|
+
})), await Z(), mn();
|
|
660
|
+
for (let e of c) et(e);
|
|
661
|
+
} catch (e) {
|
|
662
|
+
console.error("FolderTree: folder DnD persist failed", e), N(e instanceof Error ? `Move failed: ${e.message}` : "Move failed: unknown error");
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
function Kn(e) {
|
|
666
|
+
e.stopPropagation(), V.set(F, !0), V.set(ut, !0), V.set(U, Jn(Yn(e.detail.items)), !0);
|
|
667
|
+
}
|
|
668
|
+
function qn(e) {
|
|
669
|
+
e.stopPropagation();
|
|
670
|
+
let t = Jn(Xn(e.detail.items));
|
|
671
|
+
V.set(U, t, !0), V.set(F, !1), V.set(ut, !1), Zn(t);
|
|
672
|
+
}
|
|
673
|
+
function Jn(e) {
|
|
674
|
+
let t = e.filter((e) => e.id !== $), n = V.get(U).find((e) => e.id === $) ?? V.get(gr).find((e) => e.id === $);
|
|
675
|
+
return n ? [...t, n] : t;
|
|
676
|
+
}
|
|
677
|
+
function Yn(e) {
|
|
678
|
+
if (!Array.isArray(e)) return [];
|
|
679
|
+
let t = [];
|
|
680
|
+
for (let n of e) {
|
|
681
|
+
if (typeof n != "object" || !n || typeof n.id != "string") continue;
|
|
682
|
+
let e = n;
|
|
683
|
+
t.push(e);
|
|
684
|
+
}
|
|
685
|
+
return t;
|
|
686
|
+
}
|
|
687
|
+
function Xn(e) {
|
|
688
|
+
let t = Yn(e), n = new Set(t.filter((e) => e[Ne]).map((e) => e.id)), r = /* @__PURE__ */ new Set(), i = new Map([...V.get(U), ...V.get(gr)].map((e) => [e.id, e])), a = [];
|
|
689
|
+
for (let e of t) {
|
|
690
|
+
if (n.has(e.id) && !e.isDndShadowItem || r.has(e.id)) continue;
|
|
691
|
+
r.add(e.id);
|
|
692
|
+
let t = i.get(e.id) ?? e;
|
|
693
|
+
a.push({
|
|
694
|
+
id: t.id,
|
|
695
|
+
category: t.category,
|
|
696
|
+
folders: t.folders
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
return a;
|
|
700
|
+
}
|
|
701
|
+
function Zn(e) {
|
|
702
|
+
let t = ++pt;
|
|
703
|
+
V.set(dt, !0);
|
|
704
|
+
let n = e.map((e) => ({ ...e }));
|
|
705
|
+
mt = mt.catch(() => void 0).then(async () => {
|
|
706
|
+
try {
|
|
707
|
+
await Qn(n);
|
|
708
|
+
} catch (e) {
|
|
709
|
+
console.error("FolderTree: category DnD persist failed", e), N(e instanceof Error ? `Reorder failed: ${e.message}` : "Reorder failed: unknown error");
|
|
710
|
+
} finally {
|
|
711
|
+
t === pt && (await Z(), V.set(dt, !1));
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
async function Qn(e) {
|
|
716
|
+
let t = [];
|
|
717
|
+
if (e.forEach((e, n) => {
|
|
718
|
+
e.category && t.push({
|
|
719
|
+
id: e.category.id,
|
|
720
|
+
order: n
|
|
721
|
+
});
|
|
722
|
+
}), t.length !== 0) for (let e of t) await je(e.id, { order: e.order });
|
|
723
|
+
}
|
|
724
|
+
function $n(e, t, n) {
|
|
725
|
+
V.set(Mt, {
|
|
726
|
+
kind: e,
|
|
727
|
+
id: t,
|
|
728
|
+
name: n
|
|
729
|
+
}, !0), V.set(Ut, n, !0), V.set(W, null), V.set(Et, !0);
|
|
730
|
+
}
|
|
731
|
+
function er() {
|
|
732
|
+
V.set(Et, !1), V.set(Mt, null), V.set(Ut, ""), V.set(W, null), V.set(G, !1);
|
|
733
|
+
}
|
|
734
|
+
async function tr(e) {
|
|
735
|
+
e?.preventDefault();
|
|
736
|
+
let t = V.get(Mt);
|
|
737
|
+
if (!t) return;
|
|
738
|
+
let n = V.get(Ut).trim();
|
|
739
|
+
if (n.length === 0) {
|
|
740
|
+
V.set(W, "Name is required");
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
V.set(G, !0);
|
|
744
|
+
try {
|
|
745
|
+
t.kind === "folder" ? await Be(t.id, { name: n }) : await Fe(t.id, { title: n }), er(), await Z(), ct();
|
|
746
|
+
} catch (e) {
|
|
747
|
+
console.error("FolderTree: rename failed", e), V.set(W, e instanceof Error ? e.message : le(), !0);
|
|
748
|
+
} finally {
|
|
749
|
+
V.set(G, !1);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
function nr(e, t, n) {
|
|
753
|
+
V.set(q, {
|
|
754
|
+
kind: e,
|
|
755
|
+
id: t,
|
|
756
|
+
name: n
|
|
757
|
+
}, !0), V.set(K, !0);
|
|
758
|
+
}
|
|
759
|
+
function rr(e, t) {
|
|
760
|
+
V.set(Gt, e, !0), V.set(Kt, ""), V.set(Yt, ""), V.set(qt, t, !0), V.set(Jt, ""), V.set(Xt, ""), V.set(Wt, !0);
|
|
761
|
+
}
|
|
762
|
+
function ir(e, t) {
|
|
763
|
+
V.set(Kt, e, !0), V.set(Gt, ""), V.set(Yt, ""), V.set(Jt, t, !0), V.set(qt, ""), V.set(Xt, ""), V.set(Wt, !0);
|
|
764
|
+
}
|
|
765
|
+
function ar(e, t) {
|
|
766
|
+
V.set(Yt, e, !0), V.set(Gt, ""), V.set(Kt, ""), V.set(Xt, t, !0), V.set(qt, ""), V.set(Jt, ""), V.set(Wt, !0);
|
|
767
|
+
}
|
|
768
|
+
function or() {
|
|
769
|
+
V.set(K, !1), V.set(q, null);
|
|
770
|
+
}
|
|
771
|
+
async function sr() {
|
|
772
|
+
let e = V.get(q);
|
|
773
|
+
e && (e.kind === "folder" ? await Ve(e.id) : await Le(e.id), await Z(), ct());
|
|
774
|
+
}
|
|
775
|
+
function cr() {
|
|
776
|
+
V.set(Qt, "create"), V.set(J, null), V.set(Zt, !0);
|
|
777
|
+
}
|
|
778
|
+
function lr(e) {
|
|
779
|
+
V.set(Qt, "edit"), V.set(J, e, !0), V.set(Zt, !0);
|
|
780
|
+
}
|
|
781
|
+
function ur(e) {
|
|
782
|
+
V.set(Qt, "delete"), V.set(J, e, !0), V.set(Zt, !0);
|
|
783
|
+
}
|
|
784
|
+
function dr() {
|
|
785
|
+
V.get($t) || (V.set(Zt, !1), V.set(J, null), V.set($t, !1));
|
|
786
|
+
}
|
|
787
|
+
async function fr(e) {
|
|
788
|
+
V.set($t, !0);
|
|
789
|
+
try {
|
|
790
|
+
let t = {
|
|
791
|
+
name: e.name,
|
|
792
|
+
apiMode: e.apiMode,
|
|
793
|
+
apiPermissionRead: e.apiPermissionRead,
|
|
794
|
+
apiPermissionEdit: e.apiPermissionEdit,
|
|
795
|
+
apiPermissionWrite: e.apiPermissionWrite
|
|
796
|
+
}, n;
|
|
797
|
+
return n = V.get(Qt) === "edit" && V.get(J) ? await Oe(`/api/categories/${encodeURIComponent(V.get(J).id)}`, {
|
|
798
|
+
method: "PATCH",
|
|
799
|
+
body: t
|
|
800
|
+
}) : await Oe("/api/categories", {
|
|
801
|
+
method: "POST",
|
|
802
|
+
body: t
|
|
803
|
+
}), await Z(), n;
|
|
804
|
+
} finally {
|
|
805
|
+
V.set($t, !1);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
async function pr() {
|
|
809
|
+
if (V.get(J)) {
|
|
810
|
+
V.set($t, !0);
|
|
811
|
+
try {
|
|
812
|
+
await Ae(V.get(J).id), await Z();
|
|
813
|
+
} finally {
|
|
814
|
+
V.set($t, !1);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
let $ = "__uncategorized__", mr = V.derived(() => V.get(U).filter((e) => e.id !== $ && e.category !== null)), hr = V.derived(() => V.get(U).find((e) => e.id === $) ?? null), gr = V.derived(() => {
|
|
819
|
+
let e = /* @__PURE__ */ new Map();
|
|
820
|
+
for (let t of V.get(v)) e.set(t.id, []);
|
|
821
|
+
let t = [];
|
|
822
|
+
for (let n of V.get(p)) n.categoryId && e.has(n.categoryId) ? e.get(n.categoryId)?.push(n) : t.push(n);
|
|
823
|
+
let n = [];
|
|
824
|
+
for (let t of V.get(v)) n.push({
|
|
825
|
+
id: t.id,
|
|
826
|
+
category: t,
|
|
827
|
+
folders: e.get(t.id) ?? []
|
|
828
|
+
});
|
|
829
|
+
return n.push({
|
|
830
|
+
id: $,
|
|
831
|
+
category: null,
|
|
832
|
+
folders: t
|
|
833
|
+
}), n;
|
|
834
|
+
});
|
|
835
|
+
var _r = { refreshFolderTree: Cn }, vr = Ht(), yr = V.first_child(vr), br = V.child(yr), xr = V.child(br), Sr = V.child(xr, !0);
|
|
836
|
+
V.reset(xr);
|
|
837
|
+
var Cr = V.sibling(xr, 2);
|
|
838
|
+
s(V.child(Cr), { class: "size-3.5" }), V.reset(Cr), V.reset(br);
|
|
839
|
+
var wr = V.sibling(br, 2), Tr = (e) => {
|
|
840
|
+
var t = Nt(), n = V.child(t, !0);
|
|
841
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(k))), V.append(e, t);
|
|
842
|
+
};
|
|
843
|
+
V.if(wr, (e) => {
|
|
844
|
+
V.get(k) && e(Tr);
|
|
845
|
+
});
|
|
846
|
+
var Er = V.sibling(wr, 2), Dr = (e) => {
|
|
847
|
+
var t = Nt(), n = V.child(t, !0);
|
|
848
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(A))), V.append(e, t);
|
|
849
|
+
};
|
|
850
|
+
V.if(Er, (e) => {
|
|
851
|
+
V.get(A) && e(Dr);
|
|
852
|
+
});
|
|
853
|
+
var Or = V.sibling(Er, 2);
|
|
854
|
+
V.each(Or, 29, () => V.get(mr), (e) => `${e.id}:${e.isDndShadowItem ? "shadow" : "item"}`, (e, t) => {
|
|
855
|
+
let i = V.derived(() => V.get(D).has(V.get(t).id));
|
|
856
|
+
var o = Rt(), s = V.child(o), l = V.child(s), d = V.child(l), f = (e) => {
|
|
857
|
+
n(e, { class: "size-3.5 shrink-0" });
|
|
858
|
+
}, p = (e) => {
|
|
859
|
+
r(e, { class: "size-3.5 shrink-0" });
|
|
860
|
+
};
|
|
861
|
+
V.if(d, (e) => {
|
|
862
|
+
V.get(i) ? e(f) : e(p, -1);
|
|
863
|
+
});
|
|
864
|
+
var te = V.sibling(d, 2), v = V.child(te, !0);
|
|
865
|
+
V.reset(te), V.reset(l), m(V.sibling(l, 2), {
|
|
866
|
+
children: (e, n) => {
|
|
867
|
+
var r = At(), i = V.first_child(r);
|
|
868
|
+
ee(i, {
|
|
869
|
+
child: (e, t) => {
|
|
870
|
+
let n = () => (t?.()).props;
|
|
871
|
+
var r = Ot();
|
|
872
|
+
V.attribute_effect(r, (e, t) => ({
|
|
873
|
+
...n(),
|
|
874
|
+
type: "button",
|
|
875
|
+
class: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/bucket:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
876
|
+
"aria-label": e,
|
|
877
|
+
title: t
|
|
878
|
+
}), [() => T(), () => T()]), g(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
879
|
+
},
|
|
880
|
+
$$slots: { child: !0 }
|
|
881
|
+
}), h(V.sibling(i, 2), {
|
|
882
|
+
align: "end",
|
|
883
|
+
children: (e, n) => {
|
|
884
|
+
var r = Pt(), i = V.first_child(r);
|
|
885
|
+
_(i, {
|
|
886
|
+
onSelect: () => bt(`/?category=${V.get(t).category.id}`),
|
|
887
|
+
children: (e, t) => {
|
|
888
|
+
V.next();
|
|
889
|
+
var n = V.text();
|
|
890
|
+
V.template_effect((e) => V.set_text(n, e), [() => se()]), V.append(e, n);
|
|
891
|
+
},
|
|
892
|
+
$$slots: { default: !0 }
|
|
893
|
+
});
|
|
894
|
+
var a = V.sibling(i, 2);
|
|
895
|
+
_(a, {
|
|
896
|
+
onSelect: () => bt(`/docs/new?category=${V.get(t).category.id}`),
|
|
897
|
+
children: (e, t) => {
|
|
898
|
+
V.next();
|
|
899
|
+
var n = V.text();
|
|
900
|
+
V.template_effect((e) => V.set_text(n, e), [() => ie()]), V.append(e, n);
|
|
901
|
+
},
|
|
902
|
+
$$slots: { default: !0 }
|
|
903
|
+
});
|
|
904
|
+
var o = V.sibling(a, 2);
|
|
905
|
+
_(o, {
|
|
906
|
+
onSelect: () => On(V.get(t).category.id),
|
|
907
|
+
children: (e, t) => {
|
|
908
|
+
V.next();
|
|
909
|
+
var n = V.text();
|
|
910
|
+
V.template_effect((e) => V.set_text(n, e), [() => ce()]), V.append(e, n);
|
|
911
|
+
},
|
|
912
|
+
$$slots: { default: !0 }
|
|
913
|
+
});
|
|
914
|
+
var s = V.sibling(o, 2);
|
|
915
|
+
_(s, {
|
|
916
|
+
onSelect: () => ar(V.get(t).category.id, V.get(t).category.name),
|
|
917
|
+
children: (e, t) => {
|
|
918
|
+
V.next();
|
|
919
|
+
var n = V.text();
|
|
920
|
+
V.template_effect((e) => V.set_text(n, e), [() => ye()]), V.append(e, n);
|
|
921
|
+
},
|
|
922
|
+
$$slots: { default: !0 }
|
|
923
|
+
});
|
|
924
|
+
var c = V.sibling(s, 2);
|
|
925
|
+
_(c, {
|
|
926
|
+
onSelect: () => lr(V.get(t).category),
|
|
927
|
+
children: (e, t) => {
|
|
928
|
+
V.next();
|
|
929
|
+
var n = V.text();
|
|
930
|
+
V.template_effect((e) => V.set_text(n, e), [() => de()]), V.append(e, n);
|
|
931
|
+
},
|
|
932
|
+
$$slots: { default: !0 }
|
|
933
|
+
}), _(V.sibling(c, 2), {
|
|
934
|
+
class: "text-destructive focus:text-destructive",
|
|
935
|
+
onSelect: () => ur(V.get(t).category),
|
|
936
|
+
children: (e, t) => {
|
|
937
|
+
V.next();
|
|
938
|
+
var n = V.text();
|
|
939
|
+
V.template_effect((e) => V.set_text(n, e), [() => L()]), V.append(e, n);
|
|
940
|
+
},
|
|
941
|
+
$$slots: { default: !0 }
|
|
942
|
+
}), V.append(e, r);
|
|
943
|
+
},
|
|
944
|
+
$$slots: { default: !0 }
|
|
945
|
+
}), V.append(e, r);
|
|
946
|
+
},
|
|
947
|
+
$$slots: { default: !0 }
|
|
948
|
+
}), V.reset(s);
|
|
949
|
+
var y = V.sibling(s, 2), b = (e) => {
|
|
950
|
+
let n = V.derived(() => V.get(H)[V.get(t).id] ?? []), r = V.derived(() => V.get(xt)[V.get(t).id] ?? []);
|
|
951
|
+
var i = Lt(), o = V.child(i), s = V.derived(() => zn(V.get(t).id)), l = V.derived(() => Bn(V.get(t).id));
|
|
952
|
+
V.each(o, 29, () => V.get(n), (e) => e.id, (e, t) => {
|
|
953
|
+
var n = Ft();
|
|
954
|
+
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () => St, () => ({ duration: 200 })), V.append(e, n);
|
|
955
|
+
}), V.reset(o), V.action(o, (e, t) => Pe?.(e, t), () => ({
|
|
956
|
+
items: V.get(n),
|
|
957
|
+
flipDurationMs: 200,
|
|
958
|
+
type: "folder",
|
|
959
|
+
dropTargetStyle: {},
|
|
960
|
+
dragDisabled: V.get(P)
|
|
961
|
+
}));
|
|
962
|
+
var d = V.sibling(o, 2), f = V.derived(() => Mn({
|
|
963
|
+
kind: "category",
|
|
964
|
+
id: V.get(t).id
|
|
965
|
+
})), p = V.derived(() => Nn({
|
|
966
|
+
kind: "category",
|
|
967
|
+
id: V.get(t).id
|
|
968
|
+
}));
|
|
969
|
+
V.each(d, 29, () => V.get(r), (e) => e.id, (e, t) => {
|
|
970
|
+
var n = It(), r = V.child(n);
|
|
971
|
+
Dt(r, () => V.get(t));
|
|
972
|
+
var i = V.sibling(r, 2);
|
|
973
|
+
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () => St, () => ({ duration: 80 })), V.append(e, n);
|
|
974
|
+
}), V.reset(d), V.action(d, (e, t) => Pe?.(e, t), () => ({
|
|
975
|
+
items: V.get(r),
|
|
976
|
+
flipDurationMs: 80,
|
|
977
|
+
type: "doc",
|
|
978
|
+
dropTargetStyle: {},
|
|
979
|
+
dragDisabled: V.get(P),
|
|
980
|
+
useCursorForDetection: !0,
|
|
981
|
+
centreDraggedOnCursor: !0
|
|
982
|
+
})), V.reset(i), V.template_effect((e, t) => {
|
|
983
|
+
V.set_class(o, 1, e), V.set_class(d, 1, t);
|
|
984
|
+
}, [() => V.clsx(R("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(I) && V.get(n).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => V.clsx(R("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(Me) && V.get(r).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), V.event("consider", o, function(...e) {
|
|
985
|
+
V.get(s)?.apply(this, e);
|
|
986
|
+
}), V.event("finalize", o, function(...e) {
|
|
987
|
+
V.get(l)?.apply(this, e);
|
|
988
|
+
}), V.event("consider", d, function(...e) {
|
|
989
|
+
V.get(f)?.apply(this, e);
|
|
990
|
+
}), V.event("finalize", d, function(...e) {
|
|
991
|
+
V.get(p)?.apply(this, e);
|
|
992
|
+
}), V.append(e, i);
|
|
993
|
+
};
|
|
994
|
+
V.if(y, (e) => {
|
|
995
|
+
V.get(i) && e(b);
|
|
996
|
+
}), V.reset(o), V.template_effect((e) => {
|
|
997
|
+
V.set_attribute(o, "data-is-dnd-shadow-item-hint", V.get(t)[Ne]), V.set_attribute(l, "aria-expanded", V.get(i)), V.set_class(l, 1, e), V.set_text(v, V.get(t).category.name);
|
|
998
|
+
}, [() => V.clsx(R("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", V.get(z) && "hover:bg-accent/40 border border-dashed border-primary/30"))]), V.delegated("click", l, () => Tn(V.get(t).id)), V.event("mouseenter", l, () => {
|
|
999
|
+
V.get(F) && !V.get(i) && un(V.get(t).id);
|
|
1000
|
+
}), V.event("mouseleave", l, () => {
|
|
1001
|
+
V.get(F) && ln();
|
|
1002
|
+
}), V.event("dragover", l, Fn), V.event("drop", l, (e) => In(e, V.get(t).id)), V.animation(o, () => St, () => ({ duration: 200 })), V.append(e, o);
|
|
1003
|
+
}), V.reset(Or), V.action(Or, (e, t) => Pe?.(e, t), () => ({
|
|
1004
|
+
items: V.get(mr),
|
|
1005
|
+
flipDurationMs: 200,
|
|
1006
|
+
type: "category",
|
|
1007
|
+
dropTargetStyle: {},
|
|
1008
|
+
dragDisabled: V.get(P)
|
|
1009
|
+
}));
|
|
1010
|
+
var kr = V.sibling(Or, 2), Ar = (e) => {
|
|
1011
|
+
var t = zt(), i = V.child(t), o = V.child(i), s = V.child(o), l = (e) => {
|
|
1012
|
+
n(e, { class: "size-3.5 shrink-0" });
|
|
1013
|
+
}, d = (e) => {
|
|
1014
|
+
r(e, { class: "size-3.5 shrink-0" });
|
|
1015
|
+
};
|
|
1016
|
+
V.if(s, (e) => {
|
|
1017
|
+
V.get(O) ? e(l) : e(d, -1);
|
|
1018
|
+
});
|
|
1019
|
+
var f = V.sibling(s, 2), p = V.child(f, !0);
|
|
1020
|
+
V.reset(f), V.reset(o), V.reset(i);
|
|
1021
|
+
var m = V.sibling(i, 2), h = (e) => {
|
|
1022
|
+
let t = V.derived(() => V.get(H)[$] ?? []);
|
|
1023
|
+
var n = Lt(), r = V.child(n), i = V.derived(() => zn($)), o = V.derived(() => Bn($));
|
|
1024
|
+
V.each(r, 29, () => V.get(t), (e) => e.id, (e, t) => {
|
|
1025
|
+
var n = Ft();
|
|
1026
|
+
u(V.child(n), () => V.get(t)), V.reset(n), V.animation(n, () => St, () => ({ duration: 200 })), V.append(e, n);
|
|
1027
|
+
}), V.reset(r), V.action(r, (e, t) => Pe?.(e, t), () => ({
|
|
1028
|
+
items: V.get(t),
|
|
1029
|
+
flipDurationMs: 200,
|
|
1030
|
+
type: "folder",
|
|
1031
|
+
dropTargetStyle: {},
|
|
1032
|
+
dragDisabled: V.get(P)
|
|
1033
|
+
}));
|
|
1034
|
+
var s = V.sibling(r, 2), l = V.derived(() => Mn({ kind: "root" })), d = V.derived(() => Nn({ kind: "root" }));
|
|
1035
|
+
V.each(s, 29, () => V.get(ht), (e) => e.id, (e, t) => {
|
|
1036
|
+
var n = It(), r = V.child(n);
|
|
1037
|
+
Dt(r, () => V.get(t));
|
|
1038
|
+
var i = V.sibling(r, 2);
|
|
1039
|
+
c(i, () => V.get(t)), a(V.sibling(i, 2), () => V.get(t)), V.reset(n), V.animation(n, () => St, () => ({ duration: 80 })), V.append(e, n);
|
|
1040
|
+
}), V.reset(s), V.action(s, (e, t) => Pe?.(e, t), () => ({
|
|
1041
|
+
items: V.get(ht),
|
|
1042
|
+
flipDurationMs: 80,
|
|
1043
|
+
type: "doc",
|
|
1044
|
+
dropTargetStyle: {},
|
|
1045
|
+
dragDisabled: V.get(P),
|
|
1046
|
+
useCursorForDetection: !0,
|
|
1047
|
+
centreDraggedOnCursor: !0
|
|
1048
|
+
})), V.reset(n), V.template_effect((e, t) => {
|
|
1049
|
+
V.set_class(r, 1, e), V.set_class(s, 1, t);
|
|
1050
|
+
}, [() => V.clsx(R("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(I) && V.get(t).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20")), () => V.clsx(R("min-h-[8px] space-y-0.5 transition-all duration-150", V.get(Me) && V.get(ht).length === 0 && "min-h-[36px] bg-accent/20 rounded border border-dashed border-muted-foreground/20"))]), V.event("consider", r, function(...e) {
|
|
1051
|
+
V.get(i)?.apply(this, e);
|
|
1052
|
+
}), V.event("finalize", r, function(...e) {
|
|
1053
|
+
V.get(o)?.apply(this, e);
|
|
1054
|
+
}), V.event("consider", s, function(...e) {
|
|
1055
|
+
V.get(l)?.apply(this, e);
|
|
1056
|
+
}), V.event("finalize", s, function(...e) {
|
|
1057
|
+
V.get(d)?.apply(this, e);
|
|
1058
|
+
}), V.append(e, n);
|
|
1059
|
+
};
|
|
1060
|
+
V.if(m, (e) => {
|
|
1061
|
+
V.get(O) && e(h);
|
|
1062
|
+
}), V.reset(t), V.template_effect((e, t) => {
|
|
1063
|
+
V.set_attribute(o, "aria-expanded", V.get(O)), V.set_class(o, 1, e), V.set_text(p, t);
|
|
1064
|
+
}, [() => V.clsx(R("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground", V.get(z) && "hover:bg-accent/40 border border-dashed border-primary/30")), () => fe()]), V.delegated("click", o, En), V.event("mouseenter", o, () => {
|
|
1065
|
+
V.get(F) && !V.get(O) && un($);
|
|
1066
|
+
}), V.event("mouseleave", o, () => {
|
|
1067
|
+
V.get(F) && ln();
|
|
1068
|
+
}), V.event("dragover", o, Fn), V.event("drop", o, (e) => In(e, $)), V.append(e, t);
|
|
1069
|
+
};
|
|
1070
|
+
V.if(kr, (e) => {
|
|
1071
|
+
V.get(hr) && e(Ar);
|
|
1072
|
+
});
|
|
1073
|
+
var jr = V.sibling(kr, 2), Mr = V.child(jr);
|
|
1074
|
+
s(Mr, { class: "size-3.5" });
|
|
1075
|
+
var Nr = V.sibling(Mr, 2), Pr = V.child(Nr, !0);
|
|
1076
|
+
V.reset(Nr), V.reset(jr), V.reset(yr);
|
|
1077
|
+
var Fr = V.sibling(yr, 2);
|
|
1078
|
+
l(Fr, {
|
|
1079
|
+
mode: "create",
|
|
1080
|
+
onSave: An,
|
|
1081
|
+
closeOnSave: !1,
|
|
1082
|
+
get open() {
|
|
1083
|
+
return V.get(Ct);
|
|
1084
|
+
},
|
|
1085
|
+
set open(e) {
|
|
1086
|
+
V.set(Ct, e, !0);
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
var Ir = V.sibling(Fr, 2);
|
|
1090
|
+
be(Ir, {
|
|
1091
|
+
onOpenChange: (e) => {
|
|
1092
|
+
e || er();
|
|
1093
|
+
},
|
|
1094
|
+
get open() {
|
|
1095
|
+
return V.get(Et);
|
|
1096
|
+
},
|
|
1097
|
+
set open(e) {
|
|
1098
|
+
V.set(Et, e, !0);
|
|
1099
|
+
},
|
|
1100
|
+
children: (e, t) => {
|
|
1101
|
+
var n = Vt(), r = V.first_child(n);
|
|
1102
|
+
Se(r, {
|
|
1103
|
+
children: (e, t) => {
|
|
1104
|
+
var n = At(), r = V.first_child(n);
|
|
1105
|
+
Te(r, {
|
|
1106
|
+
children: (e, t) => {
|
|
1107
|
+
V.next();
|
|
1108
|
+
var n = V.text();
|
|
1109
|
+
V.template_effect((e) => V.set_text(n, e), [() => he()]), V.append(e, n);
|
|
1110
|
+
},
|
|
1111
|
+
$$slots: { default: !0 }
|
|
1112
|
+
}), xe(V.sibling(r, 2), {
|
|
1113
|
+
children: (e, t) => {
|
|
1114
|
+
V.next();
|
|
1115
|
+
var n = V.text();
|
|
1116
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(Mt)?.kind === "folder" ? ue() : y()]), V.append(e, n);
|
|
1117
|
+
},
|
|
1118
|
+
$$slots: { default: !0 }
|
|
1119
|
+
}), V.append(e, n);
|
|
1120
|
+
},
|
|
1121
|
+
$$slots: { default: !0 }
|
|
1122
|
+
});
|
|
1123
|
+
var i = V.sibling(r, 2), a = V.child(i), o = V.child(a);
|
|
1124
|
+
De(o, {
|
|
1125
|
+
for: "rename-input",
|
|
1126
|
+
children: (e, t) => {
|
|
1127
|
+
V.next();
|
|
1128
|
+
var n = V.text();
|
|
1129
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(Mt)?.kind === "folder" ? ue() : y()]), V.append(e, n);
|
|
1130
|
+
},
|
|
1131
|
+
$$slots: { default: !0 }
|
|
1132
|
+
});
|
|
1133
|
+
var s = V.sibling(o, 2);
|
|
1134
|
+
{
|
|
1135
|
+
let e = V.derived(() => V.get(W) ? "true" : void 0), t = V.derived(() => V.get(W) ? "rename-input-error" : void 0);
|
|
1136
|
+
Ee(s, {
|
|
1137
|
+
id: "rename-input",
|
|
1138
|
+
name: "name",
|
|
1139
|
+
type: "text",
|
|
1140
|
+
maxlength: 255,
|
|
1141
|
+
required: !0,
|
|
1142
|
+
get disabled() {
|
|
1143
|
+
return V.get(G);
|
|
1144
|
+
},
|
|
1145
|
+
get "aria-invalid"() {
|
|
1146
|
+
return V.get(e);
|
|
1147
|
+
},
|
|
1148
|
+
get "aria-describedby"() {
|
|
1149
|
+
return V.get(t);
|
|
1150
|
+
},
|
|
1151
|
+
autocomplete: "off",
|
|
1152
|
+
get value() {
|
|
1153
|
+
return V.get(Ut);
|
|
1154
|
+
},
|
|
1155
|
+
set value(e) {
|
|
1156
|
+
V.set(Ut, e, !0);
|
|
1157
|
+
}
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
var c = V.sibling(s, 2), l = (e) => {
|
|
1161
|
+
var t = Bt(), n = V.child(t, !0);
|
|
1162
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(W))), V.append(e, t);
|
|
1163
|
+
};
|
|
1164
|
+
V.if(c, (e) => {
|
|
1165
|
+
V.get(W) && e(l);
|
|
1166
|
+
}), V.reset(a), V.reset(i), we(V.sibling(i, 2), {
|
|
1167
|
+
children: (e, t) => {
|
|
1168
|
+
var n = At(), r = V.first_child(n);
|
|
1169
|
+
Ce(r, {
|
|
1170
|
+
variant: "outline",
|
|
1171
|
+
type: "button",
|
|
1172
|
+
onclick: er,
|
|
1173
|
+
get disabled() {
|
|
1174
|
+
return V.get(G);
|
|
1175
|
+
},
|
|
1176
|
+
children: (e, t) => {
|
|
1177
|
+
V.next();
|
|
1178
|
+
var n = V.text();
|
|
1179
|
+
V.template_effect((e) => V.set_text(n, e), [() => ge()]), V.append(e, n);
|
|
1180
|
+
},
|
|
1181
|
+
$$slots: { default: !0 }
|
|
1182
|
+
});
|
|
1183
|
+
var i = V.sibling(r, 2);
|
|
1184
|
+
{
|
|
1185
|
+
let e = V.derived(() => V.get(G) || V.get(Ut).trim().length === 0);
|
|
1186
|
+
Ce(i, {
|
|
1187
|
+
type: "submit",
|
|
1188
|
+
onclick: tr,
|
|
1189
|
+
get disabled() {
|
|
1190
|
+
return V.get(e);
|
|
1191
|
+
},
|
|
1192
|
+
children: (e, t) => {
|
|
1193
|
+
V.next();
|
|
1194
|
+
var n = V.text();
|
|
1195
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(G) ? re() : _e()]), V.append(e, n);
|
|
1196
|
+
},
|
|
1197
|
+
$$slots: { default: !0 }
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
V.append(e, n);
|
|
1201
|
+
},
|
|
1202
|
+
$$slots: { default: !0 }
|
|
1203
|
+
}), V.event("submit", i, tr), V.append(e, n);
|
|
1204
|
+
},
|
|
1205
|
+
$$slots: { default: !0 }
|
|
1206
|
+
});
|
|
1207
|
+
var Lr = V.sibling(Ir, 2);
|
|
1208
|
+
{
|
|
1209
|
+
let e = V.derived(() => V.get(q)?.name ?? ""), t = V.derived(() => V.get(q)?.kind === "folder" ? pe() : ne()), n = V.derived(() => V.get(q)?.kind === "folder" ? "Its documents will be moved to the root and will not be deleted." : ae()), r = V.derived(() => V.get(q)?.kind === "folder" ? ve() : S()), i = V.derived(() => V.get(q)?.kind === "folder" ? me() : C()), a = V.derived(() => L()), o = V.derived(() => ge());
|
|
1210
|
+
We(Lr, {
|
|
1211
|
+
get targetName() {
|
|
1212
|
+
return V.get(e);
|
|
1213
|
+
},
|
|
1214
|
+
get title() {
|
|
1215
|
+
return V.get(t);
|
|
1216
|
+
},
|
|
1217
|
+
get description() {
|
|
1218
|
+
return V.get(n);
|
|
1219
|
+
},
|
|
1220
|
+
get successTitle() {
|
|
1221
|
+
return V.get(r);
|
|
1222
|
+
},
|
|
1223
|
+
get successDescription() {
|
|
1224
|
+
return V.get(i);
|
|
1225
|
+
},
|
|
1226
|
+
get confirmLabel() {
|
|
1227
|
+
return V.get(a);
|
|
1228
|
+
},
|
|
1229
|
+
get cancelLabel() {
|
|
1230
|
+
return V.get(o);
|
|
1231
|
+
},
|
|
1232
|
+
onConfirm: sr,
|
|
1233
|
+
onCancel: or,
|
|
1234
|
+
get open() {
|
|
1235
|
+
return V.get(K);
|
|
1236
|
+
},
|
|
1237
|
+
set open(e) {
|
|
1238
|
+
V.set(K, e, !0);
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
var Rr = V.sibling(Lr, 2);
|
|
1243
|
+
{
|
|
1244
|
+
let e = V.derived(() => V.get(J) ?? void 0);
|
|
1245
|
+
qe(Rr, {
|
|
1246
|
+
get mode() {
|
|
1247
|
+
return V.get(Qt);
|
|
1248
|
+
},
|
|
1249
|
+
get category() {
|
|
1250
|
+
return V.get(e);
|
|
1251
|
+
},
|
|
1252
|
+
onSave: fr,
|
|
1253
|
+
onDelete: pr,
|
|
1254
|
+
onClose: dr,
|
|
1255
|
+
get open() {
|
|
1256
|
+
return V.get(Zt);
|
|
1257
|
+
},
|
|
1258
|
+
set open(e) {
|
|
1259
|
+
V.set(Zt, e, !0);
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
return Ke(V.sibling(Rr, 2), {
|
|
1264
|
+
get documentId() {
|
|
1265
|
+
return V.get(Gt);
|
|
1266
|
+
},
|
|
1267
|
+
get documentTitle() {
|
|
1268
|
+
return V.get(qt);
|
|
1269
|
+
},
|
|
1270
|
+
get folderId() {
|
|
1271
|
+
return V.get(Kt);
|
|
1272
|
+
},
|
|
1273
|
+
get folderName() {
|
|
1274
|
+
return V.get(Jt);
|
|
1275
|
+
},
|
|
1276
|
+
get categoryId() {
|
|
1277
|
+
return V.get(Yt);
|
|
1278
|
+
},
|
|
1279
|
+
get categoryName() {
|
|
1280
|
+
return V.get(Xt);
|
|
1281
|
+
},
|
|
1282
|
+
get open() {
|
|
1283
|
+
return V.get(Wt);
|
|
1284
|
+
},
|
|
1285
|
+
set open(e) {
|
|
1286
|
+
V.set(Wt, e, !0);
|
|
1287
|
+
}
|
|
1288
|
+
}), V.template_effect((e, t, n, r, i) => {
|
|
1289
|
+
V.set_attribute(xr, "title", e), V.set_text(Sr, t), V.set_attribute(Cr, "aria-label", n), V.set_attribute(Cr, "title", r), V.set_text(Pr, i);
|
|
1290
|
+
}, [
|
|
1291
|
+
() => w(),
|
|
1292
|
+
() => j(),
|
|
1293
|
+
() => b(),
|
|
1294
|
+
() => b(),
|
|
1295
|
+
() => ce()
|
|
1296
|
+
]), V.delegated("click", Cr, cr), V.event("consider", Or, Kn), V.event("finalize", Or, qn), V.delegated("click", jr, Dn), V.append(e, vr), V.pop(_r);
|
|
1297
|
+
}
|
|
1298
|
+
V.delegate(["click"]);
|
|
1299
|
+
//#endregion
|
|
1300
|
+
//#region src/lib/components/sidebar/RecentDocs.svelte
|
|
1301
|
+
var W = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), G = V.from_html("<button><!></button>"), K = V.from_html("<!> <!>", 1), q = V.from_html("<div class=\"group/doc flex min-w-0 items-center gap-1\"><a><!> <div class=\"min-w-0 flex-1\"><p class=\"truncate min-w-0\"> </p> <p class=\"text-xs text-muted-foreground\"> </p></div></a> <button type=\"button\"><!></button> <!></div>"), Wt = V.from_html("<p id=\"recent-rename-input-error\" class=\"text-xs text-destructive\" role=\"alert\"> </p>"), Gt = V.from_html("<!> <form class=\"space-y-4\"><div class=\"space-y-2\"><!> <!> <!></div></form> <!>", 1), Kt = V.from_html("<div class=\"space-y-1\"><h3 class=\"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground\"> </h3> <!> <!></div> <!> <!>", 1);
|
|
1302
|
+
function qt(e, n) {
|
|
1303
|
+
V.push(n, !0);
|
|
1304
|
+
let r = V.state(V.proxy([])), i = V.state(null), a = V.state(null), s = V.state(null), l = V.state(null), u = null, d = V.state(!1), f = V.state(null), p = V.state(""), v = V.state(null), b = V.state(!1), x = V.state(!1), S = V.state(null), C = V.state(!1);
|
|
1305
|
+
async function w() {
|
|
1306
|
+
try {
|
|
1307
|
+
let e = B(), t = await Re({
|
|
1308
|
+
limit: 6,
|
|
1309
|
+
...e ? { tag: e } : {}
|
|
1310
|
+
});
|
|
1311
|
+
V.set(r, t.items, !0), V.set(a, null);
|
|
1312
|
+
} catch (e) {
|
|
1313
|
+
console.error("RecentDocs: failed to load recent documents", e), V.set(a, "Failed to load recent documents");
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
vt(() => {
|
|
1317
|
+
w();
|
|
1318
|
+
}), V.user_effect(() => {
|
|
1319
|
+
ft() !== 0 && w();
|
|
1320
|
+
});
|
|
1321
|
+
let E = !0;
|
|
1322
|
+
V.user_effect(() => {
|
|
1323
|
+
if (B(), E) {
|
|
1324
|
+
E = !1;
|
|
1325
|
+
return;
|
|
1326
|
+
}
|
|
1327
|
+
w();
|
|
1328
|
+
});
|
|
1329
|
+
async function D() {
|
|
1330
|
+
await w();
|
|
1331
|
+
}
|
|
1332
|
+
_t(() => {
|
|
1333
|
+
u &&= (clearTimeout(u), null);
|
|
1334
|
+
});
|
|
1335
|
+
async function ie(e, t) {
|
|
1336
|
+
if (e.preventDefault(), e.stopPropagation(), typeof window > "u") return;
|
|
1337
|
+
let n = V.get(r).find((e) => e.id === t), i = "";
|
|
1338
|
+
V.set(l, t, !0);
|
|
1339
|
+
try {
|
|
1340
|
+
i = (await Ie(t)).content ?? "";
|
|
1341
|
+
} catch (e) {
|
|
1342
|
+
console.error("RecentDocs: failed to fetch full document for copy", e), i = n?.excerpt ?? n?.content ?? "";
|
|
1343
|
+
} finally {
|
|
1344
|
+
V.set(l, null);
|
|
1345
|
+
}
|
|
1346
|
+
i && await Ge(i) && (V.set(s, t, !0), u && clearTimeout(u), u = setTimeout(() => {
|
|
1347
|
+
V.set(s, null), u = null;
|
|
1348
|
+
}, 2e3));
|
|
1349
|
+
}
|
|
1350
|
+
function O(e, t) {
|
|
1351
|
+
V.set(f, {
|
|
1352
|
+
id: e,
|
|
1353
|
+
title: t
|
|
1354
|
+
}, !0), V.set(p, t, !0), V.set(v, null), V.set(d, !0);
|
|
1355
|
+
}
|
|
1356
|
+
function k() {
|
|
1357
|
+
V.set(d, !1), V.set(f, null), V.set(p, ""), V.set(v, null), V.set(b, !1);
|
|
1358
|
+
}
|
|
1359
|
+
async function A(e) {
|
|
1360
|
+
e?.preventDefault();
|
|
1361
|
+
let t = V.get(f);
|
|
1362
|
+
if (!t) return;
|
|
1363
|
+
let n = V.get(p).trim();
|
|
1364
|
+
if (n.length === 0) {
|
|
1365
|
+
V.set(v, "Name is required");
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
V.set(b, !0);
|
|
1369
|
+
try {
|
|
1370
|
+
await Fe(t.id, { title: n }), k(), await w(), ct();
|
|
1371
|
+
} catch (e) {
|
|
1372
|
+
console.error("RecentDocs: rename failed", e), V.set(v, e instanceof Error ? e.message : le(), !0);
|
|
1373
|
+
} finally {
|
|
1374
|
+
V.set(b, !1);
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
function j(e, t) {
|
|
1378
|
+
V.set(S, {
|
|
1379
|
+
id: e,
|
|
1380
|
+
title: t
|
|
1381
|
+
}, !0), V.set(x, !0);
|
|
1382
|
+
}
|
|
1383
|
+
function N() {
|
|
1384
|
+
V.set(x, !1), V.set(S, null), V.set(C, !1);
|
|
1385
|
+
}
|
|
1386
|
+
async function se() {
|
|
1387
|
+
let e = V.get(S);
|
|
1388
|
+
if (!(!e || V.get(C))) {
|
|
1389
|
+
V.set(C, !0);
|
|
1390
|
+
try {
|
|
1391
|
+
await Le(e.id), N(), await w(), ct();
|
|
1392
|
+
} catch (e) {
|
|
1393
|
+
console.error("RecentDocs: delete failed", e), V.set(a, e instanceof Error ? e.message : le(), !0), V.set(C, !1);
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
var P = { refreshRecentDocs: D }, F = Kt(), ce = V.first_child(F), ue = V.child(ce), de = V.child(ue, !0);
|
|
1398
|
+
V.reset(ue);
|
|
1399
|
+
var fe = V.sibling(ue, 2), pe = (e) => {
|
|
1400
|
+
var t = W(), n = V.child(t, !0);
|
|
1401
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(a))), V.append(e, t);
|
|
1402
|
+
};
|
|
1403
|
+
V.if(fe, (e) => {
|
|
1404
|
+
V.get(a) && e(pe);
|
|
1405
|
+
});
|
|
1406
|
+
var me = V.sibling(fe, 2);
|
|
1407
|
+
V.each(me, 17, () => V.get(r), (e) => e.id, (e, n) => {
|
|
1408
|
+
var r = q(), a = V.child(r), u = V.child(a);
|
|
1409
|
+
c(u, { class: "size-4 shrink-0 text-muted-foreground" });
|
|
1410
|
+
var d = V.sibling(u, 2), f = V.child(d), p = V.child(f, !0);
|
|
1411
|
+
V.reset(f);
|
|
1412
|
+
var v = V.sibling(f, 2), y = V.child(v, !0);
|
|
1413
|
+
V.reset(v), V.reset(d), V.reset(a);
|
|
1414
|
+
var b = V.sibling(a, 2), ne = V.child(b), x = (e) => {
|
|
1415
|
+
te(e, { class: "size-3.5 animate-spin" });
|
|
1416
|
+
}, S = (e) => {
|
|
1417
|
+
t(e, { class: "size-3.5" });
|
|
1418
|
+
}, C = (e) => {
|
|
1419
|
+
o(e, { class: "size-3.5" });
|
|
1420
|
+
};
|
|
1421
|
+
V.if(ne, (e) => {
|
|
1422
|
+
V.get(l) === V.get(n).id ? e(x) : V.get(s) === V.get(n).id ? e(S, 1) : e(C, -1);
|
|
1423
|
+
}), V.reset(b), m(V.sibling(b, 2), {
|
|
1424
|
+
children: (e, t) => {
|
|
1425
|
+
var r = K(), i = V.first_child(r);
|
|
1426
|
+
ee(i, {
|
|
1427
|
+
child: (e, t) => {
|
|
1428
|
+
let n = () => (t?.()).props;
|
|
1429
|
+
var r = G(), i = (e) => {
|
|
1430
|
+
e.preventDefault(), e.stopPropagation();
|
|
1431
|
+
};
|
|
1432
|
+
V.attribute_effect(r, (e, t) => ({
|
|
1433
|
+
...n(),
|
|
1434
|
+
type: "button",
|
|
1435
|
+
class: "inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1436
|
+
"aria-label": e,
|
|
1437
|
+
title: t,
|
|
1438
|
+
onclick: i
|
|
1439
|
+
}), [() => T(), () => T()]), g(V.child(r), { class: "size-3.5" }), V.reset(r), V.append(e, r);
|
|
1440
|
+
},
|
|
1441
|
+
$$slots: { child: !0 }
|
|
1442
|
+
}), h(V.sibling(i, 2), {
|
|
1443
|
+
align: "end",
|
|
1444
|
+
children: (e, t) => {
|
|
1445
|
+
var r = K(), i = V.first_child(r);
|
|
1446
|
+
_(i, {
|
|
1447
|
+
onSelect: () => O(V.get(n).id, V.get(n).title),
|
|
1448
|
+
children: (e, t) => {
|
|
1449
|
+
V.next();
|
|
1450
|
+
var n = V.text();
|
|
1451
|
+
V.template_effect((e) => V.set_text(n, e), [() => he()]), V.append(e, n);
|
|
1452
|
+
},
|
|
1453
|
+
$$slots: { default: !0 }
|
|
1454
|
+
}), _(V.sibling(i, 2), {
|
|
1455
|
+
class: "text-destructive focus:text-destructive",
|
|
1456
|
+
onSelect: () => j(V.get(n).id, V.get(n).title),
|
|
1457
|
+
children: (e, t) => {
|
|
1458
|
+
V.next();
|
|
1459
|
+
var n = V.text();
|
|
1460
|
+
V.template_effect((e) => V.set_text(n, e), [() => L()]), V.append(e, n);
|
|
1461
|
+
},
|
|
1462
|
+
$$slots: { default: !0 }
|
|
1463
|
+
}), V.append(e, r);
|
|
1464
|
+
},
|
|
1465
|
+
$$slots: { default: !0 }
|
|
1466
|
+
}), V.append(e, r);
|
|
1467
|
+
},
|
|
1468
|
+
$$slots: { default: !0 }
|
|
1469
|
+
}), V.reset(r), V.template_effect((e, t, r) => {
|
|
1470
|
+
V.set_attribute(a, "href", `/docs/${V.get(n).id}`), V.set_class(a, 1, e), V.set_text(p, V.get(n).title), V.set_text(y, V.get(n).updatedAt), V.set_class(b, 1, `inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-accent-foreground group-hover/doc:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${V.get(s) === V.get(n).id || V.get(l) === V.get(n).id ? "opacity-100" : ""}`), V.set_attribute(b, "aria-label", t), V.set_attribute(b, "title", r), b.disabled = V.get(l) === V.get(n).id;
|
|
1471
|
+
}, [
|
|
1472
|
+
() => V.clsx(R("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent hover:text-accent-foreground", V.get(i) === V.get(n).id && "bg-accent text-accent-foreground")),
|
|
1473
|
+
() => oe(),
|
|
1474
|
+
() => oe()
|
|
1475
|
+
]), V.delegated("click", a, () => {
|
|
1476
|
+
V.set(i, V.get(n).id, !0);
|
|
1477
|
+
}), V.delegated("click", b, (e) => void ie(e, V.get(n).id)), V.append(e, r);
|
|
1478
|
+
}), V.reset(ce);
|
|
1479
|
+
var I = V.sibling(ce, 2);
|
|
1480
|
+
be(I, {
|
|
1481
|
+
onOpenChange: (e) => {
|
|
1482
|
+
e || k();
|
|
1483
|
+
},
|
|
1484
|
+
get open() {
|
|
1485
|
+
return V.get(d);
|
|
1486
|
+
},
|
|
1487
|
+
set open(e) {
|
|
1488
|
+
V.set(d, e, !0);
|
|
1489
|
+
},
|
|
1490
|
+
children: (e, t) => {
|
|
1491
|
+
var n = Gt(), r = V.first_child(n);
|
|
1492
|
+
Se(r, {
|
|
1493
|
+
children: (e, t) => {
|
|
1494
|
+
var n = K(), r = V.first_child(n);
|
|
1495
|
+
Te(r, {
|
|
1496
|
+
children: (e, t) => {
|
|
1497
|
+
V.next();
|
|
1498
|
+
var n = V.text();
|
|
1499
|
+
V.template_effect((e) => V.set_text(n, e), [() => he()]), V.append(e, n);
|
|
1500
|
+
},
|
|
1501
|
+
$$slots: { default: !0 }
|
|
1502
|
+
}), xe(V.sibling(r, 2), {
|
|
1503
|
+
children: (e, t) => {
|
|
1504
|
+
V.next();
|
|
1505
|
+
var n = V.text();
|
|
1506
|
+
V.template_effect((e) => V.set_text(n, e), [() => y()]), V.append(e, n);
|
|
1507
|
+
},
|
|
1508
|
+
$$slots: { default: !0 }
|
|
1509
|
+
}), V.append(e, n);
|
|
1510
|
+
},
|
|
1511
|
+
$$slots: { default: !0 }
|
|
1512
|
+
});
|
|
1513
|
+
var i = V.sibling(r, 2), a = V.child(i), o = V.child(a);
|
|
1514
|
+
De(o, {
|
|
1515
|
+
for: "recent-rename-input",
|
|
1516
|
+
children: (e, t) => {
|
|
1517
|
+
V.next();
|
|
1518
|
+
var n = V.text();
|
|
1519
|
+
V.template_effect((e) => V.set_text(n, e), [() => y()]), V.append(e, n);
|
|
1520
|
+
},
|
|
1521
|
+
$$slots: { default: !0 }
|
|
1522
|
+
});
|
|
1523
|
+
var s = V.sibling(o, 2);
|
|
1524
|
+
{
|
|
1525
|
+
let e = V.derived(() => V.get(v) ? "true" : void 0), t = V.derived(() => V.get(v) ? "recent-rename-input-error" : void 0);
|
|
1526
|
+
Ee(s, {
|
|
1527
|
+
id: "recent-rename-input",
|
|
1528
|
+
name: "name",
|
|
1529
|
+
type: "text",
|
|
1530
|
+
maxlength: 255,
|
|
1531
|
+
required: !0,
|
|
1532
|
+
get disabled() {
|
|
1533
|
+
return V.get(b);
|
|
1534
|
+
},
|
|
1535
|
+
get "aria-invalid"() {
|
|
1536
|
+
return V.get(e);
|
|
1537
|
+
},
|
|
1538
|
+
get "aria-describedby"() {
|
|
1539
|
+
return V.get(t);
|
|
1540
|
+
},
|
|
1541
|
+
autocomplete: "off",
|
|
1542
|
+
get value() {
|
|
1543
|
+
return V.get(p);
|
|
1544
|
+
},
|
|
1545
|
+
set value(e) {
|
|
1546
|
+
V.set(p, e, !0);
|
|
1547
|
+
}
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
var c = V.sibling(s, 2), l = (e) => {
|
|
1551
|
+
var t = Wt(), n = V.child(t, !0);
|
|
1552
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(v))), V.append(e, t);
|
|
1553
|
+
};
|
|
1554
|
+
V.if(c, (e) => {
|
|
1555
|
+
V.get(v) && e(l);
|
|
1556
|
+
}), V.reset(a), V.reset(i), we(V.sibling(i, 2), {
|
|
1557
|
+
children: (e, t) => {
|
|
1558
|
+
var n = K(), r = V.first_child(n);
|
|
1559
|
+
Ce(r, {
|
|
1560
|
+
variant: "outline",
|
|
1561
|
+
type: "button",
|
|
1562
|
+
onclick: k,
|
|
1563
|
+
get disabled() {
|
|
1564
|
+
return V.get(b);
|
|
1565
|
+
},
|
|
1566
|
+
children: (e, t) => {
|
|
1567
|
+
V.next();
|
|
1568
|
+
var n = V.text();
|
|
1569
|
+
V.template_effect((e) => V.set_text(n, e), [() => ge()]), V.append(e, n);
|
|
1570
|
+
},
|
|
1571
|
+
$$slots: { default: !0 }
|
|
1572
|
+
});
|
|
1573
|
+
var i = V.sibling(r, 2);
|
|
1574
|
+
{
|
|
1575
|
+
let e = V.derived(() => V.get(b) || V.get(p).trim().length === 0);
|
|
1576
|
+
Ce(i, {
|
|
1577
|
+
type: "submit",
|
|
1578
|
+
onclick: A,
|
|
1579
|
+
get disabled() {
|
|
1580
|
+
return V.get(e);
|
|
1581
|
+
},
|
|
1582
|
+
children: (e, t) => {
|
|
1583
|
+
V.next();
|
|
1584
|
+
var n = V.text();
|
|
1585
|
+
V.template_effect((e) => V.set_text(n, e), [() => V.get(b) ? re() : _e()]), V.append(e, n);
|
|
1586
|
+
},
|
|
1587
|
+
$$slots: { default: !0 }
|
|
1588
|
+
});
|
|
1589
|
+
}
|
|
1590
|
+
V.append(e, n);
|
|
1591
|
+
},
|
|
1592
|
+
$$slots: { default: !0 }
|
|
1593
|
+
}), V.event("submit", i, A), V.append(e, n);
|
|
1594
|
+
},
|
|
1595
|
+
$$slots: { default: !0 }
|
|
1596
|
+
});
|
|
1597
|
+
var ve = V.sibling(I, 2);
|
|
1598
|
+
{
|
|
1599
|
+
let e = V.derived(() => ne()), t = V.derived(() => ae()), n = V.derived(() => L()), r = V.derived(() => ge());
|
|
1600
|
+
pt(ve, {
|
|
1601
|
+
get title() {
|
|
1602
|
+
return V.get(e);
|
|
1603
|
+
},
|
|
1604
|
+
get description() {
|
|
1605
|
+
return V.get(t);
|
|
1606
|
+
},
|
|
1607
|
+
get confirmLabel() {
|
|
1608
|
+
return V.get(n);
|
|
1609
|
+
},
|
|
1610
|
+
get cancelLabel() {
|
|
1611
|
+
return V.get(r);
|
|
1612
|
+
},
|
|
1613
|
+
variant: "destructive",
|
|
1614
|
+
get busy() {
|
|
1615
|
+
return V.get(C);
|
|
1616
|
+
},
|
|
1617
|
+
onConfirm: se,
|
|
1618
|
+
onCancel: N,
|
|
1619
|
+
get open() {
|
|
1620
|
+
return V.get(x);
|
|
1621
|
+
},
|
|
1622
|
+
set open(e) {
|
|
1623
|
+
V.set(x, e, !0);
|
|
1624
|
+
}
|
|
1625
|
+
});
|
|
1626
|
+
}
|
|
1627
|
+
return V.template_effect((e) => V.set_text(de, e), [() => M()]), V.append(e, F), V.pop(P);
|
|
1628
|
+
}
|
|
1629
|
+
V.delegate(["click"]);
|
|
1630
|
+
//#endregion
|
|
1631
|
+
//#region src/lib/components/sidebar/TagList.svelte
|
|
1632
|
+
var Jt = V.from_html("<p class=\"px-2 text-xs text-destructive\"> </p>"), Yt = V.from_html("<button><!></button>"), Xt = V.from_html("<!> <!>", 1), Zt = V.from_html("<div><button type=\"button\" class=\"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium\"><span class=\"size-2.5 shrink-0 rounded-full\"></span> </button> <!></div>"), Qt = V.from_html("<div class=\"space-y-1\"><h3 class=\"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground\"> </h3> <!> <div class=\"flex flex-wrap gap-1 px-2\"><!> <button type=\"button\" class=\"inline-flex items-center gap-0.5 rounded-full px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-secondary hover:text-secondary-foreground\"><!> </button></div></div> <!> <!>", 1);
|
|
1633
|
+
function J(e, t) {
|
|
1634
|
+
V.push(t, !0);
|
|
1635
|
+
let n = V.state(V.proxy([])), r = V.state(null), i = V.state(!1), a = V.state(null), o = V.state(!1), c = V.state(null), l = V.state(!1);
|
|
1636
|
+
async function u() {
|
|
1637
|
+
try {
|
|
1638
|
+
V.set(n, await ht(), !0);
|
|
1639
|
+
} catch (e) {
|
|
1640
|
+
console.error("TagList: failed to load tags", e), V.set(r, E(), !0);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
vt(() => {
|
|
1644
|
+
u();
|
|
1645
|
+
}), V.user_effect(() => {
|
|
1646
|
+
lt(), u();
|
|
1647
|
+
});
|
|
1648
|
+
function d(e) {
|
|
1649
|
+
V.set(n, [...V.get(n), e], !0), ut(), u();
|
|
1650
|
+
}
|
|
1651
|
+
function f(e) {
|
|
1652
|
+
V.set(n, V.get(n).map((t) => t.id === e.id ? e : t), !0), ut();
|
|
1653
|
+
}
|
|
1654
|
+
function p(e) {
|
|
1655
|
+
V.set(a, e, !0), V.set(i, !0);
|
|
1656
|
+
}
|
|
1657
|
+
function y() {
|
|
1658
|
+
V.set(a, null);
|
|
1659
|
+
}
|
|
1660
|
+
function b(e) {
|
|
1661
|
+
V.set(c, e, !0), V.set(o, !0);
|
|
1662
|
+
}
|
|
1663
|
+
function ne() {
|
|
1664
|
+
V.set(o, !1), V.set(c, null);
|
|
1665
|
+
}
|
|
1666
|
+
async function x() {
|
|
1667
|
+
let e = V.get(c);
|
|
1668
|
+
if (!(!e || V.get(l))) {
|
|
1669
|
+
V.set(l, !0);
|
|
1670
|
+
try {
|
|
1671
|
+
await mt(e.id), V.set(n, V.get(n).filter((t) => t.id !== e.id), !0), B() === e.id && dt(null), V.set(o, !1), V.set(c, null), ut();
|
|
1672
|
+
} catch (e) {
|
|
1673
|
+
console.error("TagList: deleteTag failed", e), V.set(r, le(), !0);
|
|
1674
|
+
} finally {
|
|
1675
|
+
V.set(l, !1);
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
var S = Qt(), C = V.first_child(S), w = V.child(C), D = V.child(w, !0);
|
|
1680
|
+
V.reset(w);
|
|
1681
|
+
var re = V.sibling(w, 2), ie = (e) => {
|
|
1682
|
+
var t = Jt(), n = V.child(t, !0);
|
|
1683
|
+
V.reset(t), V.template_effect(() => V.set_text(n, V.get(r))), V.append(e, t);
|
|
1684
|
+
};
|
|
1685
|
+
V.if(re, (e) => {
|
|
1686
|
+
V.get(r) && e(ie);
|
|
1687
|
+
});
|
|
1688
|
+
var ae = V.sibling(re, 2), A = V.child(ae);
|
|
1689
|
+
V.each(A, 17, () => V.get(n), (e) => e.id, (e, t) => {
|
|
1690
|
+
var n = Zt(), r = V.child(n), i = V.child(r), a = V.sibling(i);
|
|
1691
|
+
V.reset(r), m(V.sibling(r, 2), {
|
|
1692
|
+
children: (e, n) => {
|
|
1693
|
+
var r = Xt(), i = V.first_child(r);
|
|
1694
|
+
ee(i, {
|
|
1695
|
+
child: (e, n) => {
|
|
1696
|
+
let r = () => (n?.()).props;
|
|
1697
|
+
var i = Yt();
|
|
1698
|
+
V.attribute_effect(i, (e, t, n) => ({
|
|
1699
|
+
...r(),
|
|
1700
|
+
type: "button",
|
|
1701
|
+
class: e,
|
|
1702
|
+
"aria-label": t,
|
|
1703
|
+
title: n,
|
|
1704
|
+
disabled: V.get(l)
|
|
1705
|
+
}), [
|
|
1706
|
+
() => R("hidden size-5 items-center justify-center rounded-full hover:bg-black/10 focus-visible:inline-flex group-hover/tag:inline-flex mr-0.5 data-[state=open]:inline-flex", B() === V.get(t).id && "inline-flex"),
|
|
1707
|
+
() => T(),
|
|
1708
|
+
() => T()
|
|
1709
|
+
]);
|
|
1710
|
+
var a = V.child(i), o = (e) => {
|
|
1711
|
+
te(e, { class: "size-3 animate-spin" });
|
|
1712
|
+
}, s = (e) => {
|
|
1713
|
+
g(e, { class: "size-3" });
|
|
1714
|
+
};
|
|
1715
|
+
V.if(a, (e) => {
|
|
1716
|
+
V.get(l) ? e(o) : e(s, -1);
|
|
1717
|
+
}), V.reset(i), V.append(e, i);
|
|
1718
|
+
},
|
|
1719
|
+
$$slots: { child: !0 }
|
|
1720
|
+
}), h(V.sibling(i, 2), {
|
|
1721
|
+
align: "start",
|
|
1722
|
+
children: (e, n) => {
|
|
1723
|
+
var r = Xt(), i = V.first_child(r);
|
|
1724
|
+
_(i, {
|
|
1725
|
+
onSelect: () => p(V.get(t)),
|
|
1726
|
+
children: (e, t) => {
|
|
1727
|
+
V.next();
|
|
1728
|
+
var n = V.text();
|
|
1729
|
+
V.template_effect((e) => V.set_text(n, e), [() => de()]), V.append(e, n);
|
|
1730
|
+
},
|
|
1731
|
+
$$slots: { default: !0 }
|
|
1732
|
+
}), _(V.sibling(i, 2), {
|
|
1733
|
+
class: "text-destructive focus:text-destructive",
|
|
1734
|
+
onSelect: () => b(V.get(t)),
|
|
1735
|
+
children: (e, t) => {
|
|
1736
|
+
V.next();
|
|
1737
|
+
var n = V.text();
|
|
1738
|
+
V.template_effect((e) => V.set_text(n, e), [() => L()]), V.append(e, n);
|
|
1739
|
+
},
|
|
1740
|
+
$$slots: { default: !0 }
|
|
1741
|
+
}), V.append(e, r);
|
|
1742
|
+
},
|
|
1743
|
+
$$slots: { default: !0 }
|
|
1744
|
+
}), V.append(e, r);
|
|
1745
|
+
},
|
|
1746
|
+
$$slots: { default: !0 }
|
|
1747
|
+
}), V.reset(n), V.template_effect((e, o) => {
|
|
1748
|
+
V.set_class(n, 1, e), V.set_attribute(r, "aria-pressed", o), V.set_style(i, `background-color: ${(V.get(t).color || "#888888") ?? ""}`), V.set_text(a, ` ${V.get(t).name ?? ""}`);
|
|
1749
|
+
}, [() => V.clsx(R("group/tag relative inline-flex items-center rounded-full transition-colors", B() === V.get(t).id ? "bg-primary text-primary-foreground" : "bg-secondary text-secondary-foreground hover:bg-secondary/80")), () => B() === V.get(t).id]), V.delegated("click", r, () => dt(B() === V.get(t).id ? null : V.get(t).id, V.get(t).name)), V.append(e, n);
|
|
1750
|
+
});
|
|
1751
|
+
var j = V.sibling(A, 2), M = V.child(j);
|
|
1752
|
+
s(M, { class: "size-3" });
|
|
1753
|
+
var oe = V.sibling(M);
|
|
1754
|
+
V.reset(j), V.reset(ae), V.reset(C);
|
|
1755
|
+
var N = V.sibling(C, 2);
|
|
1756
|
+
{
|
|
1757
|
+
let e = V.derived(() => V.get(a) ? "edit" : "create");
|
|
1758
|
+
gt(N, {
|
|
1759
|
+
get mode() {
|
|
1760
|
+
return V.get(e);
|
|
1761
|
+
},
|
|
1762
|
+
get tag() {
|
|
1763
|
+
return V.get(a);
|
|
1764
|
+
},
|
|
1765
|
+
onCreated: d,
|
|
1766
|
+
onUpdated: f,
|
|
1767
|
+
onClose: y,
|
|
1768
|
+
get open() {
|
|
1769
|
+
return V.get(i);
|
|
1770
|
+
},
|
|
1771
|
+
set open(e) {
|
|
1772
|
+
V.set(i, e, !0);
|
|
1773
|
+
}
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
var se = V.sibling(N, 2);
|
|
1777
|
+
{
|
|
1778
|
+
let e = V.derived(() => v()), t = V.derived(() => O()), n = V.derived(() => L()), r = V.derived(() => ge());
|
|
1779
|
+
pt(se, {
|
|
1780
|
+
get title() {
|
|
1781
|
+
return V.get(e);
|
|
1782
|
+
},
|
|
1783
|
+
get description() {
|
|
1784
|
+
return V.get(t);
|
|
1785
|
+
},
|
|
1786
|
+
get confirmLabel() {
|
|
1787
|
+
return V.get(n);
|
|
1788
|
+
},
|
|
1789
|
+
get cancelLabel() {
|
|
1790
|
+
return V.get(r);
|
|
1791
|
+
},
|
|
1792
|
+
variant: "destructive",
|
|
1793
|
+
get busy() {
|
|
1794
|
+
return V.get(l);
|
|
1795
|
+
},
|
|
1796
|
+
onConfirm: x,
|
|
1797
|
+
onCancel: ne,
|
|
1798
|
+
get open() {
|
|
1799
|
+
return V.get(o);
|
|
1800
|
+
},
|
|
1801
|
+
set open(e) {
|
|
1802
|
+
V.set(o, e, !0);
|
|
1803
|
+
}
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
V.template_effect((e, t, n) => {
|
|
1807
|
+
V.set_text(D, e), V.set_attribute(j, "aria-label", t), V.set_text(oe, ` ${n ?? ""}`);
|
|
1808
|
+
}, [
|
|
1809
|
+
() => k(),
|
|
1810
|
+
() => I(),
|
|
1811
|
+
() => F()
|
|
1812
|
+
]), V.delegated("click", j, () => {
|
|
1813
|
+
V.set(a, null), V.set(i, !0);
|
|
1814
|
+
}), V.append(e, S), V.pop();
|
|
1815
|
+
}
|
|
1816
|
+
V.delegate(["click"]);
|
|
1817
|
+
//#endregion
|
|
1818
|
+
//#region src/lib/components/sidebar/Sidebar.svelte
|
|
1819
|
+
var $t = V.from_html("<div role=\"separator\" tabindex=\"-1\"></div>"), Y = V.from_html("<button class=\"absolute -right-3 top-4 z-40 flex size-6 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent\"><!></button>"), en = V.from_html("<!> <div class=\"h-px bg-border\"></div>", 1), X = V.from_html("<span class=\"rounded bg-muted px-1.5 py-0.5 text-xs\"> </span>"), tn = V.from_html("<a class=\"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!> <span class=\"min-w-0 flex-1 truncate\"> </span> <!></a>"), nn = V.from_html("<div class=\"h-px bg-border\"></div> <nav class=\"space-y-1\" aria-label=\"Product navigation\"></nav>", 1), rn = V.from_html("<div class=\"flex flex-1 flex-col gap-4 overflow-y-auto p-3\"><!> <!> <!> <!> <!></div>"), an = V.from_html("<span class=\"text-xs\"> </span>"), on = V.from_html("<a class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50\"><!></a>"), sn = V.from_html("<div class=\"flex flex-1 flex-col items-center gap-1 pt-14\"><button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <button class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <!></div>"), cn = V.from_html("<div class=\"flex flex-col items-center gap-2\"><button type=\"button\" class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button> <a href=\"https://docsmint.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground\"><img src=\"/favicon.ico\" alt=\"DocsMint\" class=\"size-5 object-contain dark:hidden\"/> <img src=\"/favicon_white.ico\" alt=\"\" aria-hidden=\"true\" class=\"hidden size-5 object-contain dark:block\"/></a></div>"), ln = V.from_html("<div class=\"flex items-center justify-between\"><a href=\"https://docsmint.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"text-xs text-muted-foreground hover:text-foreground transition-colors\"> </a> <button type=\"button\" class=\"flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground\"><!></button></div>"), un = V.from_html("<aside tabindex=\"-1\"><!> <!> <!> <div class=\"border-t border-border p-2\"><!></div></aside> <!>", 1);
|
|
1820
|
+
function dn(e, t) {
|
|
1821
|
+
V.push(t, !0);
|
|
1822
|
+
let n = V.prop(t, "mobile", 3, !1), r = V.prop(t, "mobileOpen", 3, !1), o = V.prop(t, "element", 15, null), s = "hiai_sidebar_collapsed", c = V.state(!1), l = V.state(!1), p = V.state("all"), m = V.derived(() => !n() && V.get(c)), h = V.state(256), g = V.state(!1), _ = Me(), ee = V.derived(() => z(_.navigation, { pathname: xt.url.pathname }));
|
|
1823
|
+
V.user_effect(() => {
|
|
1824
|
+
if (typeof window < "u") {
|
|
1825
|
+
try {
|
|
1826
|
+
V.set(c, localStorage.getItem(s) === "1");
|
|
1827
|
+
} catch {}
|
|
1828
|
+
let e = localStorage.getItem("hiai_sidebar_width");
|
|
1829
|
+
if (e) {
|
|
1830
|
+
let t = parseInt(e, 10);
|
|
1831
|
+
!Number.isNaN(t) && t >= 180 && t <= 500 && V.set(h, t, !0);
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
}), V.user_effect(() => {
|
|
1835
|
+
if (V.get(g)) return window.addEventListener("mousemove", v), window.addEventListener("mouseup", y), () => {
|
|
1836
|
+
window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", y);
|
|
1837
|
+
};
|
|
1838
|
+
});
|
|
1839
|
+
function te(e) {
|
|
1840
|
+
e.preventDefault(), V.set(g, !0);
|
|
1841
|
+
}
|
|
1842
|
+
function v(e) {
|
|
1843
|
+
let t = Math.max(180, Math.min(500, e.clientX));
|
|
1844
|
+
V.set(h, t, !0);
|
|
1845
|
+
}
|
|
1846
|
+
function y() {
|
|
1847
|
+
V.set(g, !1), localStorage.setItem("hiai_sidebar_width", V.get(h).toString());
|
|
1848
|
+
}
|
|
1849
|
+
function b() {
|
|
1850
|
+
bt("/search");
|
|
1851
|
+
}
|
|
1852
|
+
function ne(e) {
|
|
1853
|
+
V.set(p, V.get(p) === e ? "all" : e, !0), V.set(c, !1), C();
|
|
1854
|
+
}
|
|
1855
|
+
function S() {
|
|
1856
|
+
V.set(c, !V.get(c)), C(), V.get(c) && V.set(p, "all");
|
|
1857
|
+
}
|
|
1858
|
+
function C() {
|
|
1859
|
+
if (!(typeof localStorage > "u")) try {
|
|
1860
|
+
localStorage.setItem(s, V.get(c) ? "1" : "0");
|
|
1861
|
+
} catch {}
|
|
1862
|
+
}
|
|
1863
|
+
var w = un(), T = V.first_child(w), E = V.child(T), D = (e) => {
|
|
1864
|
+
var t = $t();
|
|
1865
|
+
V.template_effect((e) => V.set_class(t, 1, e), [() => V.clsx(R("absolute right-0 top-0 z-40 h-full w-1 cursor-col-resize hover:bg-primary/50 transition-colors", V.get(g) && "bg-primary w-1"))]), V.delegated("mousedown", t, te), V.append(e, t);
|
|
1866
|
+
};
|
|
1867
|
+
V.if(E, (e) => {
|
|
1868
|
+
!n() && !V.get(m) && e(D);
|
|
1869
|
+
});
|
|
1870
|
+
var re = V.sibling(E, 2), ie = (e) => {
|
|
1871
|
+
var t = Y(), n = V.child(t), r = (e) => {
|
|
1872
|
+
U(e, { class: "size-3.5" });
|
|
1873
|
+
}, i = (e) => {
|
|
1874
|
+
H(e, { class: "size-3.5" });
|
|
1875
|
+
};
|
|
1876
|
+
V.if(n, (e) => {
|
|
1877
|
+
V.get(m) ? e(r) : e(i, -1);
|
|
1878
|
+
}), V.reset(t), V.delegated("click", t, S), V.append(e, t);
|
|
1879
|
+
};
|
|
1880
|
+
V.if(re, (e) => {
|
|
1881
|
+
n() || e(ie);
|
|
1882
|
+
});
|
|
1883
|
+
var ae = V.sibling(re, 2), O = (e) => {
|
|
1884
|
+
var t = rn(), n = V.child(t);
|
|
1885
|
+
Et(n, { class: "mr-5" });
|
|
1886
|
+
var r = V.sibling(n, 2), i = (e) => {
|
|
1887
|
+
var t = en();
|
|
1888
|
+
Ut(V.first_child(t), {}), V.next(2), V.append(e, t);
|
|
1889
|
+
};
|
|
1890
|
+
V.if(r, (e) => {
|
|
1891
|
+
V.get(p) === "all" && e(i);
|
|
1892
|
+
});
|
|
1893
|
+
var a = V.sibling(r, 2), o = (e) => {
|
|
1894
|
+
var t = en();
|
|
1895
|
+
qt(V.first_child(t), {}), V.next(2), V.append(e, t);
|
|
1896
|
+
};
|
|
1897
|
+
V.if(a, (e) => {
|
|
1898
|
+
(V.get(p) === "all" || V.get(p) === "recent") && e(o);
|
|
1899
|
+
});
|
|
1900
|
+
var s = V.sibling(a, 2), c = (e) => {
|
|
1901
|
+
J(e, {});
|
|
1902
|
+
};
|
|
1903
|
+
V.if(s, (e) => {
|
|
1904
|
+
(V.get(p) === "all" || V.get(p) === "tags") && e(c);
|
|
1905
|
+
});
|
|
1906
|
+
var l = V.sibling(s, 2), u = (e) => {
|
|
1907
|
+
var t = nn(), n = V.sibling(V.first_child(t), 2);
|
|
1908
|
+
V.each(n, 21, () => V.get(ee), (e) => e.id, (e, t) => {
|
|
1909
|
+
let n = V.derived(() => V.get(t).icon);
|
|
1910
|
+
var r = tn(), i = V.child(r), a = (e) => {
|
|
1911
|
+
var t = V.comment(), r = V.first_child(t);
|
|
1912
|
+
V.component(r, () => V.get(n), (e, t) => {
|
|
1913
|
+
t(e, { class: "size-4" });
|
|
1914
|
+
}), V.append(e, t);
|
|
1915
|
+
};
|
|
1916
|
+
V.if(i, (e) => {
|
|
1917
|
+
V.get(n) && e(a);
|
|
1918
|
+
});
|
|
1919
|
+
var o = V.sibling(i, 2), s = V.child(o, !0);
|
|
1920
|
+
V.reset(o);
|
|
1921
|
+
var c = V.sibling(o, 2), l = (e) => {
|
|
1922
|
+
var n = X(), r = V.child(n, !0);
|
|
1923
|
+
V.reset(n), V.template_effect(() => V.set_text(r, V.get(t).badge)), V.append(e, n);
|
|
1924
|
+
};
|
|
1925
|
+
V.if(c, (e) => {
|
|
1926
|
+
V.get(t).badge !== void 0 && e(l);
|
|
1927
|
+
}), V.reset(r), V.template_effect(() => {
|
|
1928
|
+
V.set_attribute(r, "href", V.get(t).href ?? "#"), V.set_attribute(r, "aria-disabled", V.get(t).disabled), V.set_text(s, V.get(t).label);
|
|
1929
|
+
}), V.append(e, r);
|
|
1930
|
+
}), V.reset(n), V.append(e, t);
|
|
1931
|
+
};
|
|
1932
|
+
V.if(l, (e) => {
|
|
1933
|
+
V.get(p) === "all" && V.get(ee).length > 0 && e(u);
|
|
1934
|
+
}), V.reset(t), V.append(e, t);
|
|
1935
|
+
}, oe = (e) => {
|
|
1936
|
+
var t = sn(), n = V.child(t);
|
|
1937
|
+
i(V.child(n), { class: "size-4" }), V.reset(n);
|
|
1938
|
+
var r = V.sibling(n, 2);
|
|
1939
|
+
d(V.child(r), { class: "size-4" }), V.reset(r);
|
|
1940
|
+
var o = V.sibling(r, 2);
|
|
1941
|
+
a(V.child(o), { class: "size-4" }), V.reset(o);
|
|
1942
|
+
var s = V.sibling(o, 2);
|
|
1943
|
+
f(V.child(s), { class: "size-4" }), V.reset(s);
|
|
1944
|
+
var c = V.sibling(s, 2);
|
|
1945
|
+
V.each(c, 17, () => V.get(ee), (e) => e.id, (e, t) => {
|
|
1946
|
+
let n = V.derived(() => V.get(t).icon);
|
|
1947
|
+
var r = on(), i = V.child(r), a = (e) => {
|
|
1948
|
+
var t = V.comment(), r = V.first_child(t);
|
|
1949
|
+
V.component(r, () => V.get(n), (e, t) => {
|
|
1950
|
+
t(e, { class: "size-4" });
|
|
1951
|
+
}), V.append(e, t);
|
|
1952
|
+
}, o = (e) => {
|
|
1953
|
+
var n = an(), r = V.child(n, !0);
|
|
1954
|
+
V.reset(n), V.template_effect((e) => V.set_text(r, e), [() => V.get(t).label.slice(0, 1)]), V.append(e, n);
|
|
1955
|
+
};
|
|
1956
|
+
V.if(i, (e) => {
|
|
1957
|
+
V.get(n) ? e(a) : e(o, -1);
|
|
1958
|
+
}), V.reset(r), V.template_effect(() => {
|
|
1959
|
+
V.set_attribute(r, "href", V.get(t).href ?? "#"), V.set_attribute(r, "aria-disabled", V.get(t).disabled), V.set_attribute(r, "title", V.get(t).label), V.set_attribute(r, "aria-label", V.get(t).label);
|
|
1960
|
+
}), V.append(e, r);
|
|
1961
|
+
}), V.reset(t), V.template_effect((e, t, i, a, c, l, u, d) => {
|
|
1962
|
+
V.set_attribute(n, "title", e), V.set_attribute(n, "aria-label", t), V.set_attribute(r, "title", i), V.set_attribute(r, "aria-label", a), V.set_attribute(o, "title", c), V.set_attribute(o, "aria-label", l), V.set_attribute(s, "title", u), V.set_attribute(s, "aria-label", d);
|
|
1963
|
+
}, [
|
|
1964
|
+
() => j(),
|
|
1965
|
+
() => j(),
|
|
1966
|
+
() => N(),
|
|
1967
|
+
() => N(),
|
|
1968
|
+
() => M(),
|
|
1969
|
+
() => M(),
|
|
1970
|
+
() => k(),
|
|
1971
|
+
() => k()
|
|
1972
|
+
]), V.delegated("click", n, () => bt("/")), V.delegated("click", r, b), V.delegated("click", o, () => ne("recent")), V.delegated("click", s, () => ne("tags")), V.append(e, t);
|
|
1973
|
+
};
|
|
1974
|
+
V.if(ae, (e) => {
|
|
1975
|
+
V.get(m) ? e(oe, -1) : e(O);
|
|
1976
|
+
});
|
|
1977
|
+
var se = V.sibling(ae, 2), P = V.child(se), F = (e) => {
|
|
1978
|
+
var t = cn(), n = V.child(t);
|
|
1979
|
+
Ct(V.child(n), { class: "size-4" }), V.reset(n);
|
|
1980
|
+
var r = V.sibling(n, 2);
|
|
1981
|
+
V.reset(t), V.template_effect((e, t, i, a) => {
|
|
1982
|
+
V.set_attribute(n, "title", e), V.set_attribute(n, "aria-label", t), V.set_attribute(r, "title", i), V.set_attribute(r, "aria-label", a);
|
|
1983
|
+
}, [
|
|
1984
|
+
() => A(),
|
|
1985
|
+
() => A(),
|
|
1986
|
+
() => x(),
|
|
1987
|
+
() => x()
|
|
1988
|
+
]), V.delegated("click", n, () => {
|
|
1989
|
+
V.set(l, !0);
|
|
1990
|
+
}), V.append(e, t);
|
|
1991
|
+
}, ce = (e) => {
|
|
1992
|
+
var t = ln(), n = V.child(t), r = V.child(n, !0);
|
|
1993
|
+
V.reset(n);
|
|
1994
|
+
var i = V.sibling(n, 2);
|
|
1995
|
+
Ct(V.child(i), { class: "size-4" }), V.reset(i), V.reset(t), V.template_effect((e, t, a, o) => {
|
|
1996
|
+
V.set_attribute(n, "title", e), V.set_text(r, t), V.set_attribute(i, "title", a), V.set_attribute(i, "aria-label", o);
|
|
1997
|
+
}, [
|
|
1998
|
+
() => x(),
|
|
1999
|
+
() => x(),
|
|
2000
|
+
() => A(),
|
|
2001
|
+
() => A()
|
|
2002
|
+
]), V.delegated("click", i, () => {
|
|
2003
|
+
V.set(l, !0);
|
|
2004
|
+
}), V.append(e, t);
|
|
2005
|
+
};
|
|
2006
|
+
V.if(P, (e) => {
|
|
2007
|
+
V.get(m) ? e(F) : e(ce, -1);
|
|
2008
|
+
}), V.reset(se), V.reset(T), V.bind_this(T, (e) => o(e), () => o()), u(V.sibling(T, 2), {
|
|
2009
|
+
get open() {
|
|
2010
|
+
return V.get(l);
|
|
2011
|
+
},
|
|
2012
|
+
set open(e) {
|
|
2013
|
+
V.set(l, e, !0);
|
|
2014
|
+
}
|
|
2015
|
+
}), V.template_effect((e) => {
|
|
2016
|
+
V.set_attribute(T, "id", n() ? "mobile-navigation" : void 0), V.set_attribute(T, "role", n() && r() ? "dialog" : void 0), V.set_attribute(T, "aria-modal", n() && r() ? "true" : void 0), V.set_attribute(T, "aria-label", n() ? "Navigation" : void 0), V.set_attribute(T, "aria-hidden", n() && !r() ? "true" : void 0), T.inert = n() && !r(), V.set_class(T, 1, e), V.set_style(T, n() ? "padding-top: env(safe-area-inset-top);" : V.get(m) ? "width: 48px;" : `width: ${V.get(h)}px;`);
|
|
2017
|
+
}, [() => V.clsx(R("flex flex-col border-r border-border bg-card", n() && "fixed inset-y-0 left-0 z-50 h-full w-[80%] max-w-[320px] shadow-xl transition-transform duration-300 ease-out", n() && (r() ? "translate-x-0" : "-translate-x-full"), !n() && "relative h-screen", !n() && !V.get(g) && "transition-[width] duration-200"))]), V.append(e, w), V.pop();
|
|
2018
|
+
}
|
|
2019
|
+
V.delegate(["mousedown", "click"]);
|
|
2020
|
+
//#endregion
|
|
2021
|
+
export { dn as t };
|