dsh-dock 0.24.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client.js CHANGED
@@ -2121,12 +2121,25 @@ var require_browser = __commonJS({
2121
2121
  // src/client.jsx
2122
2122
  var client_exports = {};
2123
2123
  __export(client_exports, {
2124
+ COMMIT_COLUMNS: () => COMMIT_COLUMNS,
2125
+ DEFAULT_VISIBLE_COLUMNS: () => DEFAULT_VISIBLE_COLUMNS,
2126
+ DirBrowser: () => DirBrowser,
2127
+ GitDragSplitter: () => DragSplitter,
2128
+ GitView: () => GitView,
2124
2129
  apply: () => apply,
2130
+ clampPercent: () => clampPercent,
2131
+ columnsTemplate: () => columnsTemplate,
2125
2132
  dockBridge: () => dockBridge,
2126
- inject: () => inject
2133
+ dragToPercent: () => dragToPercent,
2134
+ fmtDateTime: () => fmtDateTime,
2135
+ gitPanelEnabled: () => gitPanelEnabled,
2136
+ inject: () => inject,
2137
+ readSessionDir: () => currentSessionDir,
2138
+ splitterStep: () => splitterStep,
2139
+ toggleRepoSelection: () => toggleRepoSelection
2127
2140
  });
2128
2141
  module.exports = __toCommonJS(client_exports);
2129
- var import_react23 = __toESM(require("react"), 1);
2142
+ var import_react24 = __toESM(require("react"), 1);
2130
2143
 
2131
2144
  // src/shared.js
2132
2145
  var import_react = __toESM(require("react"), 1);
@@ -15764,8 +15777,1758 @@ var feature12 = {
15764
15777
  View: DshToolsView
15765
15778
  };
15766
15779
 
15780
+ // features/git/view.jsx
15781
+ var import_react23 = require("react");
15782
+
15783
+ // features/git/rpc.js
15784
+ async function rpc2(method, body) {
15785
+ const res = await fetch("dsh-dock/git/" + method, {
15786
+ method: body === void 0 ? "GET" : "POST",
15787
+ headers: body === void 0 ? void 0 : { "content-type": "application/json" },
15788
+ body: body === void 0 ? void 0 : JSON.stringify(body)
15789
+ });
15790
+ const data = await res.json().catch(() => ({}));
15791
+ if (res.ok && data && data.ok === true) return data.data;
15792
+ if (res.status === 404 || res.status === 405) {
15793
+ throw new Error("\u5BBF\u4E3B\u4FA7\u6CA1\u6709\u300CGit \u7BA1\u7406\u300D\u63A5\u53E3\uFF1A\u5BBF\u4E3B\u8FDB\u7A0B\u53EF\u80FD\u662F\u65E7\u7248\u672C\uFF0C\u6216\u8BE5\u529F\u80FD\u5728\u5BBF\u4E3B\u4FA7\u672A\u542F\u7528\uFF08\u91CD\u542F dsh web\uFF0C\u6216\u628A\u529F\u80FD\u575E\u91CC\u7684\u5F00\u5173\u5173\u6389\u518D\u6253\u5F00\uFF09");
15794
+ }
15795
+ const message = data && data.error && data.error.message;
15796
+ throw new Error(message || "HTTP " + res.status);
15797
+ }
15798
+ function fmtAgo(iso) {
15799
+ if (!iso) return "";
15800
+ const t = new Date(iso).getTime();
15801
+ if (Number.isNaN(t)) return "";
15802
+ const diff = Math.max(0, Date.now() - t);
15803
+ const min = Math.floor(diff / 6e4);
15804
+ if (min < 1) return "\u521A\u521A";
15805
+ if (min < 60) return min + " \u5206\u949F\u524D";
15806
+ const hour = Math.floor(min / 60);
15807
+ if (hour < 24) return hour + " \u5C0F\u65F6\u524D";
15808
+ const day = Math.floor(hour / 24);
15809
+ if (day < 30) return day + " \u5929\u524D";
15810
+ const month = Math.floor(day / 30);
15811
+ if (month < 12) return month + " \u4E2A\u6708\u524D";
15812
+ return Math.floor(month / 12) + " \u5E74\u524D";
15813
+ }
15814
+ function fmtTime4(iso) {
15815
+ if (!iso) return "";
15816
+ const d = new Date(iso);
15817
+ if (Number.isNaN(d.getTime())) return String(iso);
15818
+ const p = (x) => String(x).padStart(2, "0");
15819
+ return d.getFullYear() + "-" + p(d.getMonth() + 1) + "-" + p(d.getDate()) + " " + p(d.getHours()) + ":" + p(d.getMinutes());
15820
+ }
15821
+ function fmtDateTime(iso) {
15822
+ if (!iso) return "";
15823
+ const d = new Date(iso);
15824
+ if (Number.isNaN(d.getTime())) return String(iso);
15825
+ const p = (x) => String(x).padStart(2, "0");
15826
+ return d.getFullYear() + "-" + p(d.getMonth() + 1) + "-" + p(d.getDate()) + " " + p(d.getHours()) + ":" + p(d.getMinutes()) + ":" + p(d.getSeconds());
15827
+ }
15828
+ function truncate4(str, max) {
15829
+ if (!str) return "";
15830
+ const s = String(str);
15831
+ return s.length > max ? s.slice(0, max) + "\u2026" : s;
15832
+ }
15833
+ function shortRefs(refs) {
15834
+ if (!Array.isArray(refs) || refs.length === 0) return [];
15835
+ const out = [];
15836
+ for (const raw of refs) {
15837
+ const ref = String(raw).trim();
15838
+ if (!ref) continue;
15839
+ if (ref.indexOf("HEAD -> ") === 0) {
15840
+ out.push("HEAD");
15841
+ continue;
15842
+ }
15843
+ out.push(ref.replace(/^tag:\s*/, ""));
15844
+ }
15845
+ return out.slice(0, 3);
15846
+ }
15847
+ function dirOfSessionState(state, sessionId) {
15848
+ if (!state || !sessionId) return "";
15849
+ const projected = state.projectionsBySession && state.projectionsBySession[sessionId] ? state.projectionsBySession[sessionId].values : void 0;
15850
+ if (projected && typeof projected.workingDirectory === "string" && projected.workingDirectory) {
15851
+ return projected.workingDirectory;
15852
+ }
15853
+ const row = state.byId ? state.byId[sessionId] : void 0;
15854
+ if (row) {
15855
+ const rowProjected = row.projectionValues;
15856
+ if (rowProjected && typeof rowProjected.workingDirectory === "string" && rowProjected.workingDirectory) {
15857
+ return rowProjected.workingDirectory;
15858
+ }
15859
+ if (typeof row.cwd === "string" && row.cwd) return row.cwd;
15860
+ }
15861
+ return "";
15862
+ }
15863
+ function currentSessionDir(ctx, sessionId) {
15864
+ if (!ctx || typeof ctx.get !== "function") return "";
15865
+ try {
15866
+ const sessions = ctx.get("sessions");
15867
+ if (!sessions || typeof sessions.list.getSnapshot !== "function") return "";
15868
+ const state = sessions.list.getSnapshot();
15869
+ if (sessionId) {
15870
+ const direct = dirOfSessionState(state, sessionId);
15871
+ if (direct) return direct;
15872
+ }
15873
+ let fallbackId = "";
15874
+ try {
15875
+ const uiSession = ctx.get("uiSession");
15876
+ const snap = uiSession && uiSession.adapter && uiSession.adapter.current ? uiSession.adapter.current.getSnapshot() : null;
15877
+ fallbackId = snap && snap.props ? snap.props.sessionId : "";
15878
+ } catch {
15879
+ fallbackId = "";
15880
+ }
15881
+ return dirOfSessionState(state, fallbackId);
15882
+ } catch {
15883
+ return "";
15884
+ }
15885
+ }
15886
+ async function pickDirectory(ctx) {
15887
+ if (!ctx || typeof ctx.get !== "function") return null;
15888
+ let uiw = null;
15889
+ try {
15890
+ uiw = ctx.get("uiWorkspace");
15891
+ } catch {
15892
+ return null;
15893
+ }
15894
+ if (!uiw || typeof uiw.pickDirectory !== "function") return null;
15895
+ try {
15896
+ return await uiw.pickDirectory();
15897
+ } catch {
15898
+ return null;
15899
+ }
15900
+ }
15901
+
15902
+ // features/git/view.jsx
15903
+ var import_jsx_runtime15 = require("react/jsx-runtime");
15904
+ function DiffHunk(props) {
15905
+ const h = props.hunk;
15906
+ let oldNo = h.oldStart;
15907
+ let newNo = h.newStart;
15908
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-hunk", children: [
15909
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-hunk-head", children: h.header }),
15910
+ h.lines.map((line, i) => {
15911
+ const isAdd = line.kind === "+";
15912
+ const isDel = line.kind === "-";
15913
+ const oldLabel = isAdd ? "" : String(oldNo++);
15914
+ const newLabel = isDel ? "" : String(newNo++);
15915
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-line" + (isAdd ? " add" : isDel ? " del" : ""), children: [
15916
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ln", children: oldLabel }),
15917
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ln", children: newLabel }),
15918
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-sign", children: isAdd ? "+" : isDel ? "\u2212" : " " }),
15919
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-code", children: line.text || " " })
15920
+ ] }, i);
15921
+ })
15922
+ ] });
15923
+ }
15924
+ function DiffFile(props) {
15925
+ const f = props.file;
15926
+ const [open, setOpen] = (0, import_react23.useState)(props.defaultOpen !== false);
15927
+ const statusLabel = f.status === "added" ? "\u65B0\u589E" : f.status === "deleted" ? "\u5220\u9664" : f.status === "renamed" ? "\u91CD\u547D\u540D" : "\u4FEE\u6539";
15928
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-file" + (open ? " open" : ""), children: [
15929
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-file-head", onClick: () => setOpen((v) => !v), children: [
15930
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-caret", children: open ? "\u25BE" : "\u25B8" }),
15931
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-file-path", title: f.path, children: f.path }),
15932
+ f.oldPath && f.oldPath !== f.path ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-file-old", title: f.oldPath, children: [
15933
+ "\u2190 ",
15934
+ f.oldPath
15935
+ ] }) : null,
15936
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-tag " + f.status, children: statusLabel }),
15937
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-add", children: [
15938
+ "+",
15939
+ f.additions
15940
+ ] }),
15941
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-del", children: [
15942
+ "\u2212",
15943
+ f.deletions
15944
+ ] })
15945
+ ] }),
15946
+ open ? f.binary ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u4E0D\u663E\u793A\u9010\u884C\u5DEE\u5F02\u3002" }) : f.hunks.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u6CA1\u6709\u53EF\u663E\u793A\u7684\u5DEE\u5F02\uFF08\u53EF\u80FD\u53EA\u662F\u6587\u4EF6\u6A21\u5F0F\u53D8\u5316\uFF09\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-diff", children: f.hunks.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DiffHunk, { hunk: h }, i)) }) : null
15947
+ ] });
15948
+ }
15949
+ function buildTree(files) {
15950
+ const root = { name: "", path: "", dirs: /* @__PURE__ */ new Map(), files: [] };
15951
+ for (const f of files) {
15952
+ const parts = f.path.split("/");
15953
+ let node = root;
15954
+ for (let i = 0; i < parts.length - 1; i++) {
15955
+ const name = parts[i];
15956
+ if (!node.dirs.has(name)) {
15957
+ node.dirs.set(name, { name, path: parts.slice(0, i + 1).join("/"), dirs: /* @__PURE__ */ new Map(), files: [] });
15958
+ }
15959
+ node = node.dirs.get(name);
15960
+ }
15961
+ node.files.push(f);
15962
+ }
15963
+ return root;
15964
+ }
15965
+ function FileTree(props) {
15966
+ const tree = (0, import_react23.useMemo)(() => buildTree(props.files || []), [props.files]);
15967
+ const [collapsed, setCollapsed] = (0, import_react23.useState)({});
15968
+ const toggle = (path) => setCollapsed((prev) => Object.assign({}, prev, { [path]: !prev[path] }));
15969
+ const render = (node, depth) => {
15970
+ const out = [];
15971
+ for (const dir of node.dirs.values()) {
15972
+ const key = "d:" + dir.path;
15973
+ const isCollapsed = !!collapsed[dir.path];
15974
+ out.push(
15975
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-tree-row dir", style: { paddingLeft: depth * 12 + 6 + "px" }, onClick: () => toggle(dir.path), children: [
15976
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-caret", children: isCollapsed ? "\u25B8" : "\u25BE" }),
15977
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-tree-name", children: dir.name })
15978
+ ] }, key)
15979
+ );
15980
+ if (!isCollapsed) out.push(...render(dir, depth + 1));
15981
+ }
15982
+ for (const f of node.files) {
15983
+ const selected = props.selected === f.path;
15984
+ out.push(
15985
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-tree-row file" + (selected ? " on" : ""), style: { paddingLeft: depth * 12 + 18 + "px" }, onClick: () => props.onSelect(f.path), title: f.path, children: [
15986
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-tree-name", children: f.path.split("/").pop() }),
15987
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-add", children: [
15988
+ "+",
15989
+ f.additions
15990
+ ] }),
15991
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-del", children: [
15992
+ "\u2212",
15993
+ f.deletions
15994
+ ] })
15995
+ ] }, "f:" + f.path)
15996
+ );
15997
+ }
15998
+ return out;
15999
+ };
16000
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-tree", children: render(tree, 0) });
16001
+ }
16002
+ var COMMIT_COLUMNS = [
16003
+ { id: "graph", title: "", width: "12px", fixed: true },
16004
+ { id: "subject", title: "\u8BF4\u660E", width: "minmax(0,1fr)", fixed: true },
16005
+ { id: "refs", title: "\u5F15\u7528", width: "64px" },
16006
+ { id: "author", title: "\u4F5C\u8005", width: "78px" },
16007
+ { id: "date", title: "\u65E5\u671F", width: "56px" },
16008
+ { id: "datetime", title: "\u65E5\u671F\u65F6\u95F4", width: "132px" }
16009
+ ];
16010
+ var DEFAULT_VISIBLE_COLUMNS = ["graph", "subject", "refs", "author", "date"];
16011
+ function columnsTemplate(visible) {
16012
+ const set = new Set(Array.isArray(visible) ? visible : []);
16013
+ const parts = COMMIT_COLUMNS.filter((c) => c.fixed || set.has(c.id)).map((c) => c.width);
16014
+ return parts.join(" ");
16015
+ }
16016
+ function toggleRepoSelection(prev, path, current) {
16017
+ const list = Array.isArray(prev) && prev.length > 0 ? prev : [current].filter(Boolean);
16018
+ if (list.includes(path)) {
16019
+ const next = list.filter((p) => p !== path);
16020
+ return next.length > 0 ? next : list;
16021
+ }
16022
+ return list.concat(path);
16023
+ }
16024
+ function CommitRow(props) {
16025
+ const c = props.commit;
16026
+ const refs = shortRefs(c.refs);
16027
+ const visible = Array.isArray(props.visibleCols) ? props.visibleCols : null;
16028
+ const show = (id) => visible ? visible.includes(id) : true;
16029
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16030
+ "div",
16031
+ {
16032
+ className: "dkg-tr" + (props.active ? " on" : ""),
16033
+ role: "row",
16034
+ tabIndex: -1,
16035
+ onClick: () => props.onSelect(c),
16036
+ onKeyDown: (ev) => {
16037
+ if (ev.key === "Enter" || ev.key === " ") {
16038
+ ev.preventDefault();
16039
+ props.onSelect(c);
16040
+ }
16041
+ },
16042
+ title: c.subject,
16043
+ children: [
16044
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-td graph", "aria-hidden": "true", children: [
16045
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-graph-line" }),
16046
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-graph-dot" })
16047
+ ] }),
16048
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-td subject", children: [
16049
+ c.__repo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-repo-tag", title: c.__repo, children: c.__repo.split("/").filter(Boolean).pop() }) : null,
16050
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-commit-subject", children: c.subject }),
16051
+ refs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-commit-refs", children: refs.map((r) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ref" + (/^(origin|upstream)\//.test(r) ? " remote" : ""), children: r }, r)) }) : null
16052
+ ] }),
16053
+ show("refs") ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-td refs", children: refs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-muted", children: "\u2014" }) : null }) : null,
16054
+ show("author") ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-td author", title: c.authorEmail, children: c.author }) : null,
16055
+ show("date") ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-td date", title: fmtTime4(c.authorDate), children: fmtAgo(c.authorDate) }) : null,
16056
+ show("datetime") ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-td datetime", title: fmtTime4(c.authorDate), children: fmtDateTime(c.authorDate) }) : null
16057
+ ]
16058
+ }
16059
+ );
16060
+ }
16061
+ function HistoryPane(props) {
16062
+ const { repo, refs } = props;
16063
+ const repoOptions = Array.isArray(props.repos) ? props.repos : [];
16064
+ const pickedRepos = Array.isArray(props.selectedRepos) && props.selectedRepos.length > 0 ? props.selectedRepos : [repo];
16065
+ const repoKey = pickedRepos.join("\0");
16066
+ const [commits, setCommits] = (0, import_react23.useState)([]);
16067
+ const [loading, setLoading] = (0, import_react23.useState)(false);
16068
+ const [error, setError] = (0, import_react23.useState)("");
16069
+ const [search, setSearch] = (0, import_react23.useState)("");
16070
+ const [author, setAuthor] = (0, import_react23.useState)("");
16071
+ const [path, setPath] = (0, import_react23.useState)(props.initialPath || "");
16072
+ const [branch, setBranch] = (0, import_react23.useState)("");
16073
+ const [limit, setLimit] = (0, import_react23.useState)(100);
16074
+ const [since, setSince] = (0, import_react23.useState)("");
16075
+ const [until, setUntil] = (0, import_react23.useState)("");
16076
+ const [authors, setAuthors] = (0, import_react23.useState)([]);
16077
+ const [authorPick, setAuthorPick] = (0, import_react23.useState)("");
16078
+ const [groups, setGroups] = (0, import_react23.useState)([]);
16079
+ const [visibleCols, setVisibleCols] = (0, import_react23.useState)(DEFAULT_VISIBLE_COLUMNS);
16080
+ const [colMenu, setColMenu] = (0, import_react23.useState)(false);
16081
+ const showCol = (id) => visibleCols.includes(id);
16082
+ const toggleCol = (id) => {
16083
+ const col = COMMIT_COLUMNS.find((c) => c.id === id);
16084
+ if (!col || col.fixed) return;
16085
+ setVisibleCols((prev) => prev.includes(id) ? prev.filter((x) => x !== id) : prev.concat(id));
16086
+ };
16087
+ const [selected, setSelected] = (0, import_react23.useState)(null);
16088
+ const [detail, setDetail] = (0, import_react23.useState)(null);
16089
+ const [detailLoading, setDetailLoading] = (0, import_react23.useState)(false);
16090
+ const [activeFile, setActiveFile] = (0, import_react23.useState)("");
16091
+ const load = (0, import_react23.useCallback)(async () => {
16092
+ if (!repo) return;
16093
+ setLoading(true);
16094
+ setError("");
16095
+ const repoList = repoKey.split("\0").filter(Boolean);
16096
+ if (repoList.length === 0) {
16097
+ setLoading(false);
16098
+ return;
16099
+ }
16100
+ const common = {
16101
+ limit,
16102
+ search: search.trim(),
16103
+ author: authorPick || author.trim(),
16104
+ path: path.trim(),
16105
+ branch: branch || void 0,
16106
+ since: since || void 0,
16107
+ until: until || void 0
16108
+ };
16109
+ try {
16110
+ const data = repoList.length === 1 ? await rpc2("commits", Object.assign({ repo: repoList[0] }, common)) : await rpc2("commits", Object.assign({ repos: repoList }, common));
16111
+ const results = data && data.results || [];
16112
+ const ok = results.filter((r) => r && r.ok !== false);
16113
+ const failed = results.filter((r) => r && r.ok === false);
16114
+ setGroups(ok.map((r) => ({ repo: r.repo, commits: r.commits || [] })));
16115
+ const flat = [];
16116
+ for (const r of ok) {
16117
+ for (const c of r.commits || []) flat.push(Object.assign({ __repo: r.repo }, c));
16118
+ }
16119
+ if (repoList.length > 1) {
16120
+ flat.sort((a, b) => String(b.authorDate).localeCompare(String(a.authorDate)));
16121
+ }
16122
+ setCommits(flat);
16123
+ if (failed.length > 0) setError(failed.map((r) => r.repo + "\uFF1A" + (r.error || "\u8BFB\u53D6\u5931\u8D25")).join("\uFF1B"));
16124
+ if (flat.length > 0) selectCommit(flat[0]);
16125
+ else {
16126
+ setSelected(null);
16127
+ setDetail(null);
16128
+ }
16129
+ } catch (e) {
16130
+ setCommits([]);
16131
+ setGroups([]);
16132
+ setError(e && e.message || String(e));
16133
+ } finally {
16134
+ setLoading(false);
16135
+ }
16136
+ }, [repo, repoKey, limit, search, author, authorPick, path, branch, since, until]);
16137
+ const selectCommit = async (c) => {
16138
+ setSelected(c);
16139
+ setDetailLoading(true);
16140
+ setActiveFile("");
16141
+ try {
16142
+ const owner = c.__repo || repo;
16143
+ const data = await rpc2("commit", { repo: owner, sha: c.sha });
16144
+ setDetail(data && data.commit);
16145
+ } catch (e) {
16146
+ setDetail({ error: e && e.message || String(e) });
16147
+ } finally {
16148
+ setDetailLoading(false);
16149
+ }
16150
+ };
16151
+ (0, import_react23.useEffect)(() => {
16152
+ if (!repo) return;
16153
+ const timer = setTimeout(() => {
16154
+ load();
16155
+ }, 200);
16156
+ return () => clearTimeout(timer);
16157
+ }, [load]);
16158
+ (0, import_react23.useEffect)(() => {
16159
+ if (!repo) return;
16160
+ let stopped = false;
16161
+ rpc2("authors", { repo }).then((data) => {
16162
+ if (!stopped) setAuthors(data && data.authors || []);
16163
+ }).catch(() => {
16164
+ if (!stopped) setAuthors([]);
16165
+ });
16166
+ return () => {
16167
+ stopped = true;
16168
+ };
16169
+ }, [repo]);
16170
+ const onListKeyDown = (ev) => {
16171
+ if (commits.length === 0) return;
16172
+ const index = selected ? commits.findIndex((c) => c.sha === selected.sha) : -1;
16173
+ if (ev.key === "ArrowDown") {
16174
+ ev.preventDefault();
16175
+ const next = commits[Math.min(commits.length - 1, index + 1)];
16176
+ if (next) selectCommit(next);
16177
+ } else if (ev.key === "ArrowUp") {
16178
+ ev.preventDefault();
16179
+ const prev = commits[Math.max(0, index - 1)];
16180
+ if (prev) selectCommit(prev);
16181
+ } else if (ev.key === "Home") {
16182
+ ev.preventDefault();
16183
+ selectCommit(commits[0]);
16184
+ } else if (ev.key === "End") {
16185
+ ev.preventDefault();
16186
+ selectCommit(commits[commits.length - 1]);
16187
+ }
16188
+ };
16189
+ const localBranches = refs && refs.local || [];
16190
+ const remoteBranches = refs && refs.remote || [];
16191
+ const tags = refs && refs.tags || [];
16192
+ const diffFiles = detail && detail.diff && detail.diff.files || [];
16193
+ const shownFiles = activeFile ? diffFiles.filter((f) => f.path === activeFile) : diffFiles;
16194
+ const [mainPct, setMainPct] = (0, import_react23.useState)(50);
16195
+ const [detailPct, setDetailPct] = (0, import_react23.useState)(50);
16196
+ const bodyRef = (0, import_react23.useRef)(null);
16197
+ const detailRef = (0, import_react23.useRef)(null);
16198
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-body", ref: bodyRef, style: { "--dkg-main-pct": mainPct + "%", "--dkg-detail-pct": detailPct + "%", "--dkg-cols": columnsTemplate(visibleCols) }, children: [
16199
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-side", children: [
16200
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-side-item" + (branch === "" ? " on" : ""), onClick: () => setBranch(""), children: [
16201
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-side-icon", children: "\u25C8" }),
16202
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: "HEAD\uFF08\u5F53\u524D\u5206\u652F\uFF09" })
16203
+ ] }),
16204
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-side-group", children: [
16205
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-side-title", children: "\u672C\u5730" }),
16206
+ localBranches.map((b) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-side-item" + (branch === b.name ? " on" : ""), onClick: () => setBranch(b.name), title: b.subject, children: [
16207
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-side-icon", children: "\u2387" }),
16208
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: b.name })
16209
+ ] }, b.full))
16210
+ ] }),
16211
+ remoteBranches.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-side-group", children: [
16212
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-side-title", children: "\u8FDC\u7AEF" }),
16213
+ remoteBranches.map((b) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-side-item" + (branch === b.name ? " on" : ""), onClick: () => setBranch(b.name), title: b.subject, children: [
16214
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-side-icon remote", children: "\u2601" }),
16215
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: b.name })
16216
+ ] }, b.full))
16217
+ ] }) : null,
16218
+ tags.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-side-group", children: [
16219
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-side-title", children: "\u6807\u7B7E" }),
16220
+ tags.slice().reverse().map((t) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-side-item" + (branch === t.name ? " on" : ""), onClick: () => setBranch(t.name), title: t.subject, children: [
16221
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-side-icon tag", children: "\u25C6" }),
16222
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: t.name })
16223
+ ] }, t.full))
16224
+ ] }) : null
16225
+ ] }),
16226
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-mid", children: [
16227
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-toolbar", children: [
16228
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input", value: search, placeholder: "\u641C\u7D22\u5173\u952E\u8BCD\uFF08\u8BF4\u660E / \u54C8\u5E0C\uFF09", onChange: (e) => setSearch(e.target.value) }),
16229
+ authors.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { className: "dkg-select", value: authorPick, onChange: (e) => setAuthorPick(e.target.value), title: "\u6309\u63D0\u4EA4\u4EBA\u7B5B\u9009", children: [
16230
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: "\u5168\u90E8\u63D0\u4EA4\u4EBA" }),
16231
+ authors.map((a) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: a.name, children: [
16232
+ a.name,
16233
+ "\uFF08",
16234
+ a.count,
16235
+ "\uFF09"
16236
+ ] }, a.name))
16237
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input sm", value: author, placeholder: "\u63D0\u4EA4\u4EBA", onChange: (e) => setAuthor(e.target.value) }),
16238
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input sm", value: path, placeholder: "\u8DEF\u5F84", onChange: (e) => setPath(e.target.value) }),
16239
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input sm", type: "date", value: since, onChange: (e) => setSince(e.target.value), title: "\u8D77\u59CB\u65E5\u671F\uFF08\u542B\uFF09" }),
16240
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-hint", children: "\u2192" }),
16241
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input sm", type: "date", value: until, onChange: (e) => setUntil(e.target.value), title: "\u7ED3\u675F\u65E5\u671F\uFF08\u542B\uFF09" }),
16242
+ repoOptions.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16243
+ RepoPicker,
16244
+ {
16245
+ repos: repoOptions,
16246
+ selected: pickedRepos,
16247
+ current: repo,
16248
+ onToggle: props.onToggleRepo,
16249
+ onOnlyCurrent: props.onOnlyCurrent,
16250
+ onSelectAll: props.onSelectAll
16251
+ }
16252
+ ) : null,
16253
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { className: "dkg-select", value: limit, onChange: (e) => setLimit(Number(e.target.value)), children: [
16254
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 50, children: "50" }),
16255
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 100, children: "100" }),
16256
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 200, children: "200" }),
16257
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 500, children: "500" })
16258
+ ] }),
16259
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-colpick", children: [
16260
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16261
+ "button",
16262
+ {
16263
+ type: "button",
16264
+ className: "dkg-icon-btn",
16265
+ onClick: () => setColMenu(!colMenu),
16266
+ title: "\u9009\u62E9\u8981\u663E\u793A\u7684\u5217",
16267
+ children: "\u25A4"
16268
+ }
16269
+ ),
16270
+ colMenu ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-colpick-menu", role: "listbox", "aria-multiselectable": "true", children: COMMIT_COLUMNS.map((c) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16271
+ "button",
16272
+ {
16273
+ type: "button",
16274
+ role: "option",
16275
+ "aria-selected": c.fixed || showCol(c.id),
16276
+ disabled: !!c.fixed,
16277
+ className: "dkg-colpick-row" + (c.fixed || showCol(c.id) ? " on" : "") + (c.fixed ? " locked" : ""),
16278
+ title: c.fixed ? "\u8BE5\u5217\u4E0D\u53EF\u9690\u85CF" : "\u70B9\u51FB\u5207\u6362\u663E\u793A",
16279
+ onClick: () => toggleCol(c.id),
16280
+ children: [
16281
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-chip-check", "aria-hidden": "true", children: c.fixed || showCol(c.id) ? "\u2611" : "\u2610" }),
16282
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: c.title || "\uFF08\u5206\u652F\u56FE\uFF09" })
16283
+ ]
16284
+ },
16285
+ c.id
16286
+ )) }) : null
16287
+ ] }),
16288
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-icon-btn", onClick: load, disabled: loading, title: "\u5237\u65B0", children: loading ? "\u2026" : "\u27F3" })
16289
+ ] }),
16290
+ branch ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-filter-tag", children: [
16291
+ "\u5206\u652F\uFF1A",
16292
+ branch,
16293
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", onClick: () => setBranch(""), children: "\u6E05\u9664" })
16294
+ ] }) : null,
16295
+ error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: error }) : null,
16296
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-thead", children: COMMIT_COLUMNS.filter((c) => c.fixed || showCol(c.id)).map((c) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-th " + c.id, children: c.title }, c.id)) }),
16297
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-commits", tabIndex: 0, onKeyDown: onListKeyDown, role: "grid", "aria-label": "\u63D0\u4EA4\u5217\u8868", children: [
16298
+ commits.length === 0 && !loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u6CA1\u6709\u5339\u914D\u7684\u63D0\u4EA4\u3002" }) : null,
16299
+ commits.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CommitRow, { commit: c, index: i, visibleCols, active: selected && selected.sha === c.sha, onSelect: selectCommit }, c.sha))
16300
+ ] })
16301
+ ] }),
16302
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-splitter-slot dkg-splitter-main", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DragSplitter, { value: mainPct, onChange: setMainPct, min: 20, max: 85, containerRef: bodyRef }) }),
16303
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail", ref: detailRef, children: [
16304
+ !selected ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u9009\u62E9\u5DE6\u4FA7\u4E00\u6761\u63D0\u4EA4\u67E5\u770B\u8BE6\u60C5\u3002" }) : null,
16305
+ selected && detailLoading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u8BFB\u53D6\u4E2D\u2026" }) : null,
16306
+ detail && detail.error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: detail.error }) : null,
16307
+ detail && !detail.error && !detailLoading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
16308
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-detail-diff", children: diffFiles.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail-split", children: [
16309
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileTree, { files: diffFiles, selected: activeFile, onSelect: (p) => setActiveFile(activeFile === p ? "" : p) }),
16310
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-diffs", children: [
16311
+ activeFile ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", onClick: () => setActiveFile(""), children: "\u663E\u793A\u5168\u90E8\u6587\u4EF6" }) : null,
16312
+ shownFiles.map((f) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DiffFile, { file: f, defaultOpen: !!activeFile || diffFiles.length <= 3 }, f.path)),
16313
+ detail.diff && detail.diff.truncated ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u5DEE\u5F02\u8FC7\u5927\uFF0C\u5DF2\u622A\u65AD\u663E\u793A\u3002" }) : null
16314
+ ] })
16315
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u8FD9\u6761\u63D0\u4EA4\u6CA1\u6709\u53EF\u663E\u793A\u7684\u5DEE\u5F02\u3002" }) }),
16316
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-splitter-slot", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DragSplitter, { value: detailPct, onChange: setDetailPct, min: 15, max: 85, containerRef: detailRef }) }),
16317
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail-msgbox", children: [
16318
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-detail-subject", children: detail.subject }),
16319
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail-meta", children: [
16320
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-sha", children: detail.sha }),
16321
+ detail.parents && detail.parents.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-tag", children: "\u5408\u5E76\u63D0\u4EA4" }) : null,
16322
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
16323
+ detail.author,
16324
+ " <",
16325
+ detail.authorEmail,
16326
+ ">"
16327
+ ] }),
16328
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: fmtTime4(detail.authorDate) }),
16329
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-add", children: [
16330
+ "+",
16331
+ detail.additions
16332
+ ] }),
16333
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-del", children: [
16334
+ "\u2212",
16335
+ detail.deletions
16336
+ ] })
16337
+ ] }),
16338
+ detail.body ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("pre", { className: "dkg-detail-msg", children: detail.body }) : null
16339
+ ] })
16340
+ ] }) : null
16341
+ ] })
16342
+ ] });
16343
+ }
16344
+ function WorktreePane(props) {
16345
+ const { repo, status, onRefresh } = props;
16346
+ const [checked, setChecked] = (0, import_react23.useState)({});
16347
+ const [message, setMessage] = (0, import_react23.useState)("");
16348
+ const [busy, setBusy] = (0, import_react23.useState)("");
16349
+ const [error, setError] = (0, import_react23.useState)("");
16350
+ const [preview, setPreview] = (0, import_react23.useState)(null);
16351
+ const [previewLoading, setPreviewLoading] = (0, import_react23.useState)(false);
16352
+ const [result, setResult] = (0, import_react23.useState)(null);
16353
+ const [activeFile, setActiveFile] = (0, import_react23.useState)("");
16354
+ const entries = status && status.entries || [];
16355
+ const staged = entries.filter((e) => e.staged);
16356
+ const unstaged = entries.filter((e) => !e.staged && !e.untracked);
16357
+ const untracked = entries.filter((e) => e.untracked);
16358
+ const toggle = (path) => setChecked((prev) => Object.assign({}, prev, { [path]: !prev[path] }));
16359
+ const toggleAll = (list) => {
16360
+ const allOn = list.length > 0 && list.every((e) => checked[e.path]);
16361
+ const next = Object.assign({}, checked);
16362
+ for (const e of list) next[e.path] = !allOn;
16363
+ setChecked(next);
16364
+ };
16365
+ const doStage = async (paths, unstage) => {
16366
+ if (paths.length === 0) return;
16367
+ setBusy(unstage ? "\u53D6\u6D88\u6682\u5B58\u2026" : "\u6682\u5B58\u4E2D\u2026");
16368
+ setError("");
16369
+ try {
16370
+ await rpc2("stage", { repo, paths, unstage: unstage === true, confirm: true });
16371
+ setChecked({});
16372
+ await onRefresh();
16373
+ } catch (e) {
16374
+ setError(e && e.message || String(e));
16375
+ } finally {
16376
+ setBusy("");
16377
+ }
16378
+ };
16379
+ const loadPreview = async () => {
16380
+ setPreviewLoading(true);
16381
+ setError("");
16382
+ setActiveFile("");
16383
+ try {
16384
+ const data = await rpc2("diff", { repo, staged: true });
16385
+ setPreview(data);
16386
+ } catch (e) {
16387
+ setError(e && e.message || String(e));
16388
+ setPreview(null);
16389
+ } finally {
16390
+ setPreviewLoading(false);
16391
+ }
16392
+ };
16393
+ const doCommit = async () => {
16394
+ if (!message.trim()) {
16395
+ setError("\u8BF7\u5148\u586B\u5199\u63D0\u4EA4\u8BF4\u660E");
16396
+ return;
16397
+ }
16398
+ if (staged.length === 0) {
16399
+ setError("\u6682\u5B58\u533A\u4E3A\u7A7A\uFF0C\u5148\u52FE\u9009\u8981\u63D0\u4EA4\u7684\u6587\u4EF6");
16400
+ return;
16401
+ }
16402
+ setBusy("\u63D0\u4EA4\u4E2D\u2026");
16403
+ setError("");
16404
+ try {
16405
+ const data = await rpc2("create-commit", { repo, message: message.trim(), confirm: true });
16406
+ setResult(data && data.commit);
16407
+ setMessage("");
16408
+ setPreview(null);
16409
+ setChecked({});
16410
+ await onRefresh();
16411
+ } catch (e) {
16412
+ setError(e && e.message || String(e));
16413
+ } finally {
16414
+ setBusy("");
16415
+ }
16416
+ };
16417
+ const doPush = async () => {
16418
+ setBusy("\u63A8\u9001\u4E2D\u2026");
16419
+ setError("");
16420
+ try {
16421
+ const data = await rpc2("push", { repo, confirm: true });
16422
+ setResult({ pushed: true, output: data && data.output });
16423
+ await onRefresh();
16424
+ } catch (e) {
16425
+ setError(e && e.message || String(e));
16426
+ } finally {
16427
+ setBusy("");
16428
+ }
16429
+ };
16430
+ const previewFiles = preview && preview.files || [];
16431
+ const shownPreview = activeFile ? previewFiles.filter((f) => f.path === activeFile) : previewFiles;
16432
+ const group = (title, list, stagedGroup) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-group", children: [
16433
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-head", children: [
16434
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "dkg-check", children: [
16435
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "checkbox", checked: list.length > 0 && list.every((e) => checked[e.path]), onChange: () => toggleAll(list) }),
16436
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: title }),
16437
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-hint", children: list.length })
16438
+ ] }),
16439
+ list.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", disabled: !!busy, onClick: () => {
16440
+ const paths = list.filter((e) => checked[e.path]).map((e) => e.path);
16441
+ doStage(paths.length > 0 ? paths : list.map((e) => e.path), stagedGroup);
16442
+ }, children: stagedGroup ? "\u5168\u90E8\u53D6\u6D88\u6682\u5B58" : "\u5168\u90E8\u6682\u5B58" }) : null
16443
+ ] }),
16444
+ list.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note dkg-wt-empty", children: "\u65E0" }) : list.map((e) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "dkg-wt-item" + (checked[e.path] ? " on" : ""), children: [
16445
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "checkbox", checked: !!checked[e.path], onChange: () => toggle(e.path) }),
16446
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-wt-code", children: [
16447
+ e.index,
16448
+ e.worktree
16449
+ ] }),
16450
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", title: e.origPath ? e.origPath + " \u2192 " + e.path : e.path, children: e.path }),
16451
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-wt-actions", children: stagedGroup ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", disabled: !!busy, onClick: (ev) => {
16452
+ ev.preventDefault();
16453
+ doStage([e.path], true);
16454
+ }, children: "\u53D6\u6D88\u6682\u5B58" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", disabled: !!busy, onClick: (ev) => {
16455
+ ev.preventDefault();
16456
+ doStage([e.path], false);
16457
+ }, children: "\u6682\u5B58" }) })
16458
+ ] }, e.path))
16459
+ ] });
16460
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt", children: [
16461
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-files", children: [
16462
+ group("\u5DF2\u6682\u5B58", staged, true),
16463
+ group("\u672A\u6682\u5B58", unstaged, false),
16464
+ group("\u672A\u8DDF\u8E2A", untracked, false),
16465
+ entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u5DE5\u4F5C\u533A\u5E72\u51C0\uFF0C\u6CA1\u6709\u53EF\u63D0\u4EA4\u7684\u6539\u52A8\u3002" }) : null
16466
+ ] }),
16467
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-commit", children: [
16468
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16469
+ "textarea",
16470
+ {
16471
+ className: "dkg-textarea",
16472
+ rows: 4,
16473
+ value: message,
16474
+ placeholder: "\u63D0\u4EA4\u8BF4\u660E\uFF08\u7B2C\u4E00\u884C\u662F\u6807\u9898\uFF0C\u7A7A\u4E00\u884C\u540E\u53EF\u5199\u6B63\u6587\uFF09",
16475
+ onChange: (e) => setMessage(e.target.value)
16476
+ }
16477
+ ),
16478
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-wt-actions", children: [
16479
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: loadPreview, disabled: !!busy || staged.length === 0, children: previewLoading ? "\u8BFB\u53D6\u4E2D\u2026" : "\u9884\u89C8\u53D8\u66F4" }),
16480
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn primary", onClick: doCommit, disabled: !!busy || staged.length === 0 || !message.trim(), children: "\u63D0\u4EA4" }),
16481
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: doPush, disabled: !!busy || status && status.ahead === 0, title: status && status.ahead === 0 ? "\u6CA1\u6709\u5F85\u63A8\u9001\u7684\u63D0\u4EA4" : "\u63A8\u9001\u5230\u8FDC\u7AEF", children: status && status.ahead > 0 ? "\u63A8\u9001 " + status.ahead + " \u4E2A\u63D0\u4EA4" : "\u63A8\u9001" })
16482
+ ] }),
16483
+ busy ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-hint", children: busy }) : null,
16484
+ error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: error }) : null,
16485
+ result && result.pushed ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-ok", children: [
16486
+ "\u63A8\u9001\u5B8C\u6210",
16487
+ result.output ? "\uFF1A" + truncate4(result.output, 200) : ""
16488
+ ] }) : null,
16489
+ result && result.subject ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-ok", children: [
16490
+ "\u5DF2\u63D0\u4EA4 ",
16491
+ result.shortSha,
16492
+ "\uFF1A",
16493
+ truncate4(result.subject, 80)
16494
+ ] }) : null,
16495
+ preview ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-preview", children: [
16496
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-preview-head", children: [
16497
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
16498
+ "\u63D0\u4EA4\u9884\u89C8\uFF1A",
16499
+ previewFiles.length,
16500
+ " \u4E2A\u6587\u4EF6"
16501
+ ] }),
16502
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", onClick: () => {
16503
+ setPreview(null);
16504
+ setActiveFile("");
16505
+ }, children: "\u6536\u8D77" })
16506
+ ] }),
16507
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-detail-split", children: [
16508
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileTree, { files: previewFiles, selected: activeFile, onSelect: (p) => setActiveFile(activeFile === p ? "" : p) }),
16509
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-diffs", children: shownPreview.map((f) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DiffFile, { file: f, defaultOpen: !!activeFile || previewFiles.length <= 3 }, f.path)) })
16510
+ ] })
16511
+ ] }) : null
16512
+ ] })
16513
+ ] });
16514
+ }
16515
+ function clampPercent(value, min, max) {
16516
+ const lo = typeof min === "number" ? min : 15;
16517
+ const hi = typeof max === "number" ? max : 85;
16518
+ const n = Number(value);
16519
+ if (!Number.isFinite(n)) return lo;
16520
+ return Math.min(hi, Math.max(lo, Math.round(n)));
16521
+ }
16522
+ function splitterStep(key, value, min, max) {
16523
+ const lo = typeof min === "number" ? min : 15;
16524
+ const hi = typeof max === "number" ? max : 85;
16525
+ if (key === "ArrowUp") return clampPercent(value + 2, lo, hi);
16526
+ if (key === "ArrowDown") return clampPercent(value - 2, lo, hi);
16527
+ if (key === "Home") return lo;
16528
+ if (key === "End") return hi;
16529
+ return null;
16530
+ }
16531
+ function dragToPercent(startValue, deltaY, containerHeight, min, max) {
16532
+ const lo = typeof min === "number" ? min : 15;
16533
+ const hi = typeof max === "number" ? max : 85;
16534
+ if (!(containerHeight > 0)) return clampPercent(startValue, lo, hi);
16535
+ const deltaPct = deltaY / containerHeight * 100;
16536
+ return clampPercent(startValue - deltaPct, lo, hi);
16537
+ }
16538
+ function RepoPicker(props) {
16539
+ const { repos, selected, current, onToggle, onOnlyCurrent, onSelectAll } = props;
16540
+ const [open, setOpen] = (0, import_react23.useState)(false);
16541
+ const rootRef = (0, import_react23.useRef)(null);
16542
+ (0, import_react23.useEffect)(() => {
16543
+ if (!open) return;
16544
+ const onDown = (ev) => {
16545
+ const root = rootRef.current;
16546
+ if (root && ev.target && !root.contains(ev.target)) setOpen(false);
16547
+ };
16548
+ const onKey = (ev) => {
16549
+ if (ev.key === "Escape") setOpen(false);
16550
+ };
16551
+ document.addEventListener("mousedown", onDown);
16552
+ document.addEventListener("keydown", onKey);
16553
+ return () => {
16554
+ document.removeEventListener("mousedown", onDown);
16555
+ document.removeEventListener("keydown", onKey);
16556
+ };
16557
+ }, [open]);
16558
+ const picked = selected.length > 0 ? selected : [current];
16559
+ const onlyCurrent = picked.length === 1 && picked[0] === current;
16560
+ const label = onlyCurrent ? "\u5F53\u524D\u4ED3\u5E93" : picked.length + " \u4E2A\u4ED3\u5E93";
16561
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-repopick", ref: rootRef, children: [
16562
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16563
+ "button",
16564
+ {
16565
+ type: "button",
16566
+ className: "dkg-repopick-btn" + (picked.length > 1 ? " on" : ""),
16567
+ onClick: () => setOpen(!open),
16568
+ title: picked.join("\n"),
16569
+ children: [
16570
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
16571
+ "\u4ED3\u5E93\uFF1A",
16572
+ label
16573
+ ] }),
16574
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-caret", "aria-hidden": "true", children: open ? "\u25B4" : "\u25BE" })
16575
+ ]
16576
+ }
16577
+ ),
16578
+ open ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-repopick-menu", role: "listbox", "aria-multiselectable": "true", children: [
16579
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-repopick-all", children: [
16580
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16581
+ "button",
16582
+ {
16583
+ type: "button",
16584
+ className: "dkg-repopick-allbtn",
16585
+ onClick: () => onSelectAll(repos.map((r) => r.path)),
16586
+ title: "\u52FE\u9009\u5168\u90E8\u4ED3\u5E93",
16587
+ children: "\u2611 \u5168\u9009"
16588
+ }
16589
+ ),
16590
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16591
+ "button",
16592
+ {
16593
+ type: "button",
16594
+ className: "dkg-repopick-allbtn",
16595
+ onClick: () => onSelectAll([current]),
16596
+ title: "\u53EA\u4FDD\u7559\u5F53\u524D\u4ED3\u5E93",
16597
+ children: "\u2610 \u53D6\u6D88\u5168\u9009"
16598
+ }
16599
+ )
16600
+ ] }),
16601
+ repos.map((r) => {
16602
+ const checked = picked.includes(r.path);
16603
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16604
+ "button",
16605
+ {
16606
+ type: "button",
16607
+ role: "option",
16608
+ "aria-selected": checked,
16609
+ className: "dkg-repopick-row" + (checked ? " on" : ""),
16610
+ title: r.path,
16611
+ onClick: () => onToggle(r.path),
16612
+ children: [
16613
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-chip-check", "aria-hidden": "true", children: checked ? "\u2611" : "\u2610" }),
16614
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: r.isRoot ? r.name + "\uFF08\u5F53\u524D\u76EE\u5F55\uFF09" : r.relPath }),
16615
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-hint", children: [
16616
+ r.branch,
16617
+ r.dirty > 0 ? " \xB7 " + r.dirty : ""
16618
+ ] })
16619
+ ]
16620
+ },
16621
+ r.path
16622
+ );
16623
+ }),
16624
+ picked.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-repopick-foot", onClick: onOnlyCurrent, children: "\u53EA\u770B\u5F53\u524D\u4ED3\u5E93" }) : null
16625
+ ] }) : null
16626
+ ] });
16627
+ }
16628
+ function DragSplitter(props) {
16629
+ const { value, onChange } = props;
16630
+ const min = typeof props.min === "number" ? props.min : 15;
16631
+ const max = typeof props.max === "number" ? props.max : 85;
16632
+ const [dragging, setDragging] = (0, import_react23.useState)(false);
16633
+ const boxRef = (0, import_react23.useRef)(null);
16634
+ const session = (0, import_react23.useRef)(null);
16635
+ const frame = (0, import_react23.useRef)(0);
16636
+ const pendingY = (0, import_react23.useRef)(0);
16637
+ const latestValue = (0, import_react23.useRef)(value);
16638
+ latestValue.current = value;
16639
+ const resolveContainer = () => {
16640
+ const given = props.containerRef && props.containerRef.current;
16641
+ if (given) return given;
16642
+ let node = boxRef.current;
16643
+ while (node && node.parentElement) {
16644
+ node = node.parentElement;
16645
+ if (node.getBoundingClientRect().height > 60) return node;
16646
+ }
16647
+ return null;
16648
+ };
16649
+ const begin = (clientY) => {
16650
+ const container = resolveContainer();
16651
+ if (!container) return;
16652
+ const rect2 = container.getBoundingClientRect();
16653
+ if (rect2.height <= 0) return;
16654
+ session.current = {
16655
+ top: rect2.top,
16656
+ height: rect2.height,
16657
+ startY: clientY,
16658
+ startValue: clampPercent(latestValue.current, min, max)
16659
+ };
16660
+ setDragging(true);
16661
+ };
16662
+ const apply2 = () => {
16663
+ frame.current = 0;
16664
+ const s = session.current;
16665
+ if (!s) return;
16666
+ onChange(dragToPercent(s.startValue, pendingY.current - s.startY, s.height, min, max));
16667
+ };
16668
+ const moveTo = (clientY) => {
16669
+ pendingY.current = clientY;
16670
+ if (frame.current) return;
16671
+ if (typeof requestAnimationFrame === "function") {
16672
+ frame.current = requestAnimationFrame(apply2);
16673
+ } else {
16674
+ apply2();
16675
+ }
16676
+ };
16677
+ const end = () => {
16678
+ session.current = null;
16679
+ if (frame.current && typeof cancelAnimationFrame === "function") {
16680
+ cancelAnimationFrame(frame.current);
16681
+ frame.current = 0;
16682
+ }
16683
+ setDragging(false);
16684
+ };
16685
+ (0, import_react23.useEffect)(() => {
16686
+ if (!dragging) return;
16687
+ const onMouseMove = (ev) => moveTo(ev.clientY);
16688
+ const onTouchMove = (ev) => {
16689
+ const t = ev.touches && ev.touches[0];
16690
+ if (!t) return;
16691
+ if (typeof ev.preventDefault === "function" && ev.cancelable !== false) ev.preventDefault();
16692
+ moveTo(t.clientY);
16693
+ };
16694
+ const onUp = () => end();
16695
+ document.addEventListener("mousemove", onMouseMove);
16696
+ document.addEventListener("mouseup", onUp);
16697
+ document.addEventListener("touchmove", onTouchMove, { passive: false });
16698
+ document.addEventListener("touchend", onUp);
16699
+ document.addEventListener("touchcancel", onUp);
16700
+ window.addEventListener("blur", onUp);
16701
+ document.body.classList.add("dkg-resizing");
16702
+ return () => {
16703
+ document.removeEventListener("mousemove", onMouseMove);
16704
+ document.removeEventListener("mouseup", onUp);
16705
+ document.removeEventListener("touchmove", onTouchMove);
16706
+ document.removeEventListener("touchend", onUp);
16707
+ document.removeEventListener("touchcancel", onUp);
16708
+ window.removeEventListener("blur", onUp);
16709
+ document.body.classList.remove("dkg-resizing");
16710
+ if (frame.current && typeof cancelAnimationFrame === "function") {
16711
+ cancelAnimationFrame(frame.current);
16712
+ frame.current = 0;
16713
+ }
16714
+ };
16715
+ }, [dragging, onChange, min, max]);
16716
+ const onKeyDown = (ev) => {
16717
+ const next = splitterStep(ev.key, value, min, max);
16718
+ if (next === null) return;
16719
+ ev.preventDefault();
16720
+ onChange(next);
16721
+ };
16722
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16723
+ "div",
16724
+ {
16725
+ ref: boxRef,
16726
+ className: "dkg-splitter" + (dragging ? " dragging" : ""),
16727
+ role: "separator",
16728
+ "aria-orientation": "horizontal",
16729
+ "aria-valuenow": value,
16730
+ "aria-valuemin": min,
16731
+ "aria-valuemax": max,
16732
+ tabIndex: 0,
16733
+ title: "\u62D6\u52A8\u8C03\u6574\u9AD8\u5EA6\uFF08\u4E5F\u53EF\u7528\u65B9\u5411\u952E\uFF09",
16734
+ onMouseDown: (ev) => {
16735
+ ev.preventDefault();
16736
+ begin(ev.clientY);
16737
+ },
16738
+ onTouchStart: (ev) => {
16739
+ const t = ev.touches && ev.touches[0];
16740
+ if (t) begin(t.clientY);
16741
+ },
16742
+ onKeyDown,
16743
+ onDoubleClick: () => onChange(50),
16744
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-splitter-grip", "aria-hidden": "true" })
16745
+ }
16746
+ );
16747
+ }
16748
+ function DirBrowser(props) {
16749
+ const ctx = props.ctx;
16750
+ const [listing, setListing] = (0, import_react23.useState)(null);
16751
+ const [loading, setLoading] = (0, import_react23.useState)(false);
16752
+ const [error, setError] = (0, import_react23.useState)("");
16753
+ const [showHidden, setShowHidden] = (0, import_react23.useState)(false);
16754
+ const [input, setInput] = (0, import_react23.useState)(props.startPath || "");
16755
+ const load = (0, import_react23.useCallback)(async (path) => {
16756
+ setLoading(true);
16757
+ setError("");
16758
+ try {
16759
+ const uiw = ctx && typeof ctx.get === "function" ? ctx.get("uiWorkspace") : null;
16760
+ if (!uiw || typeof uiw.listDirectory !== "function") {
16761
+ throw new Error("\u5F53\u524D\u73AF\u5883\u6CA1\u6709\u76EE\u5F55\u6D4F\u89C8\u80FD\u529B\uFF08uiWorkspace.listDirectory \u4E0D\u53EF\u7528\uFF09");
16762
+ }
16763
+ const data = await uiw.listDirectory(path || void 0);
16764
+ setListing(data);
16765
+ setInput(data && data.path ? data.path : "");
16766
+ } catch (e) {
16767
+ setError(e && e.message || String(e));
16768
+ } finally {
16769
+ setLoading(false);
16770
+ }
16771
+ }, [ctx]);
16772
+ (0, import_react23.useEffect)(() => {
16773
+ load(props.startPath || "");
16774
+ }, [load, props.startPath]);
16775
+ const entries = (listing && listing.entries || []).filter((e) => showHidden || !e.hidden);
16776
+ const crumbs = listing && listing.crumbs || [];
16777
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker", children: [
16778
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker-head", children: [
16779
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-picker-title", children: "\u9009\u62E9\u76EE\u5F55" }),
16780
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-link", onClick: props.onClose, children: "\u5173\u95ED" })
16781
+ ] }),
16782
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-crumbs", children: crumbs.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16783
+ "button",
16784
+ {
16785
+ type: "button",
16786
+ className: "dkg-crumb" + (i === crumbs.length - 1 ? " on" : ""),
16787
+ title: c.path,
16788
+ onClick: () => load(c.path),
16789
+ children: i === 0 ? c.name || "/" : c.name
16790
+ },
16791
+ c.path
16792
+ )) }),
16793
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker-bar", children: [
16794
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16795
+ "input",
16796
+ {
16797
+ className: "dkg-input",
16798
+ value: input,
16799
+ placeholder: "\u7EDD\u5BF9\u8DEF\u5F84",
16800
+ spellCheck: false,
16801
+ onChange: (e) => setInput(e.target.value),
16802
+ onKeyDown: (e) => {
16803
+ if (e.key === "Enter") load(input.trim());
16804
+ }
16805
+ }
16806
+ ),
16807
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: () => load(input.trim()), disabled: loading, children: "\u524D\u5F80" }),
16808
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "dkg-check", children: [
16809
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "checkbox", checked: showHidden, onChange: (e) => setShowHidden(e.target.checked) }),
16810
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u9690\u85CF\u9879" })
16811
+ ] })
16812
+ ] }),
16813
+ error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: error }) : null,
16814
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker-list", children: [
16815
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u8BFB\u53D6\u4E2D\u2026" }) : null,
16816
+ !loading && entries.length === 0 && !error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u8FD9\u4E2A\u76EE\u5F55\u4E0B\u6CA1\u6709\u5B50\u76EE\u5F55\u3002" }) : null,
16817
+ entries.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
16818
+ "button",
16819
+ {
16820
+ type: "button",
16821
+ className: "dkg-picker-row",
16822
+ title: entry.path,
16823
+ onClick: () => load(entry.path),
16824
+ children: [
16825
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-folder", children: "\u25B8" }),
16826
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-ellipsis", children: entry.name })
16827
+ ]
16828
+ },
16829
+ entry.path
16830
+ )),
16831
+ listing && listing.truncated ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u76EE\u5F55\u8FC7\u591A\uFF0C\u53EA\u663E\u793A\u4E86\u524D\u9762\u4E00\u90E8\u5206\u3002" }) : null
16832
+ ] }),
16833
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-picker-foot", children: [
16834
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-hint", title: listing && listing.path, children: listing && listing.path ? truncate4(listing.path, 60) : "" }),
16835
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16836
+ "button",
16837
+ {
16838
+ type: "button",
16839
+ className: "dkg-btn primary",
16840
+ disabled: !listing || loading,
16841
+ onClick: () => {
16842
+ if (listing && listing.path) props.onPick(listing.path);
16843
+ },
16844
+ children: "\u9009\u8FD9\u4E2A\u76EE\u5F55"
16845
+ }
16846
+ )
16847
+ ] })
16848
+ ] });
16849
+ }
16850
+ function GitView(props) {
16851
+ const ctx = props && props.ctx;
16852
+ const [dir, setDir] = (0, import_react23.useState)(props && props.repo ? props.repo : "");
16853
+ const [includeSubdirs, setIncludeSubdirs] = (0, import_react23.useState)(true);
16854
+ const [repos, setRepos] = (0, import_react23.useState)([]);
16855
+ const [selectedRepos, setSelectedRepos] = (0, import_react23.useState)([]);
16856
+ const setAllRepos = (paths) => {
16857
+ const list = Array.isArray(paths) ? paths.filter(Boolean) : [];
16858
+ setSelectedRepos(list.length > 0 ? list : [repo]);
16859
+ };
16860
+ const toggleRepo = (path) => setSelectedRepos((prev) => toggleRepoSelection(prev, path, repo));
16861
+ const [repo, setRepo] = (0, import_react23.useState)(props && props.repo ? props.repo : "");
16862
+ const [refs, setRefs] = (0, import_react23.useState)(null);
16863
+ const [status, setStatus] = (0, import_react23.useState)(null);
16864
+ const [tab, setTab] = (0, import_react23.useState)("history");
16865
+ const [loading, setLoading] = (0, import_react23.useState)(false);
16866
+ const [error, setError] = (0, import_react23.useState)("");
16867
+ const [note, setError2] = (0, import_react23.useState)("");
16868
+ const booted = (0, import_react23.useRef)(false);
16869
+ (0, import_react23.useEffect)(() => {
16870
+ if (booted.current) return;
16871
+ booted.current = true;
16872
+ let stopped = false;
16873
+ rpc2("info").then((info) => {
16874
+ if (stopped) return;
16875
+ const given = props && props.repo;
16876
+ const sessionDir = currentSessionDir(ctx, props && props.sessionId);
16877
+ const start = given || sessionDir || info && info.defaultDir || "";
16878
+ setDir(start);
16879
+ if (given) setRepo(given);
16880
+ if (!given && !sessionDir) {
16881
+ setError("\u6CA1\u80FD\u8BFB\u5230\u5F53\u524D\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u76EE\u5F55\uFF0C\u5148\u663E\u793A\u5BBF\u4E3B\u8FDB\u7A0B\u7684\u76EE\u5F55\u3002\u53EF\u4EE5\u5728\u4E0A\u65B9\u624B\u52A8\u586B\u5199\u4ED3\u5E93\u8DEF\u5F84\uFF0C\u6216\u70B9\u300C\u9009\u62E9\u76EE\u5F55\u2026\u300D\u3002");
16882
+ }
16883
+ if (info && info.available === false) {
16884
+ setError("\u672C\u673A\u6CA1\u6709\u53EF\u7528\u7684 git \u547D\u4EE4\uFF08PATH \u91CC\u627E\u4E0D\u5230 git\uFF09\uFF0C\u65E0\u6CD5\u8BFB\u53D6\u63D0\u4EA4\u8BB0\u5F55\u3002");
16885
+ }
16886
+ }).catch((e) => {
16887
+ if (!stopped) setError(e && e.message || String(e));
16888
+ });
16889
+ return () => {
16890
+ stopped = true;
16891
+ };
16892
+ }, []);
16893
+ const resolveAndSet = (0, import_react23.useCallback)(async (target) => {
16894
+ if (!target) return;
16895
+ setLoading(true);
16896
+ setError("");
16897
+ try {
16898
+ const resolved = await rpc2("resolve", { path: target });
16899
+ setRepo(resolved.repo);
16900
+ if (!props || !props.repo) setDir(resolved.repo);
16901
+ } catch (e) {
16902
+ try {
16903
+ const scanned = await rpc2("repos", { dir: target, includeSubdirs: true, depth: 3 });
16904
+ const list = scanned && scanned.repos || [];
16905
+ setRepos(list);
16906
+ if (list.length > 0) {
16907
+ const first = list[0];
16908
+ setRepo(first.path);
16909
+ if (!props || !props.repo) setDir(first.path);
16910
+ return;
16911
+ }
16912
+ } catch {
16913
+ }
16914
+ setRepos([]);
16915
+ setRepo("");
16916
+ setError(e && e.message || String(e));
16917
+ } finally {
16918
+ setLoading(false);
16919
+ }
16920
+ }, []);
16921
+ (0, import_react23.useEffect)(() => {
16922
+ if (!dir) return;
16923
+ let stopped = false;
16924
+ const timer = setTimeout(() => {
16925
+ if (!stopped) resolveAndSet(dir);
16926
+ }, 200);
16927
+ return () => {
16928
+ stopped = true;
16929
+ clearTimeout(timer);
16930
+ };
16931
+ }, [dir, resolveAndSet]);
16932
+ const scanRepos = (0, import_react23.useCallback)(async (target) => {
16933
+ if (!target || !includeSubdirs) {
16934
+ setRepos([]);
16935
+ return;
16936
+ }
16937
+ try {
16938
+ const data = await rpc2("repos", { dir: target, includeSubdirs: true, depth: 3 });
16939
+ setRepos(data && data.repos || []);
16940
+ } catch {
16941
+ setRepos([]);
16942
+ }
16943
+ }, [includeSubdirs]);
16944
+ (0, import_react23.useEffect)(() => {
16945
+ scanRepos(dir);
16946
+ }, [dir, scanRepos]);
16947
+ const refreshRepo = (0, import_react23.useCallback)(async () => {
16948
+ if (!repo) {
16949
+ setRefs(null);
16950
+ setStatus(null);
16951
+ return;
16952
+ }
16953
+ try {
16954
+ const [r, s] = await Promise.all([rpc2("refs", { repo }), rpc2("status", { repo })]);
16955
+ setRefs(r);
16956
+ setStatus(s);
16957
+ } catch (e) {
16958
+ setError(e && e.message || String(e));
16959
+ setRefs(null);
16960
+ setStatus(null);
16961
+ }
16962
+ }, [repo]);
16963
+ (0, import_react23.useEffect)(() => {
16964
+ refreshRepo();
16965
+ }, [refreshRepo]);
16966
+ const [picking, setPicking] = (0, import_react23.useState)(false);
16967
+ const canBrowse = (() => {
16968
+ try {
16969
+ const uiw = ctx && typeof ctx.get === "function" ? ctx.get("uiWorkspace") : null;
16970
+ return !!(uiw && typeof uiw.listDirectory === "function");
16971
+ } catch {
16972
+ return false;
16973
+ }
16974
+ })();
16975
+ const pick = async () => {
16976
+ if (canBrowse) {
16977
+ setPicking(true);
16978
+ return;
16979
+ }
16980
+ const chosen = await pickDirectory(ctx);
16981
+ if (chosen) setDir(chosen);
16982
+ };
16983
+ const branch = refs && refs.branch || "";
16984
+ const ahead = status && status.ahead || 0;
16985
+ const behind = status && status.behind || 0;
16986
+ const dirty = status ? status.stagedCount + status.unstagedCount + status.untrackedCount : 0;
16987
+ const compact = props && props.compact === true;
16988
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg" + (compact ? " dkg-compact" : ""), children: [
16989
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-bar", children: [
16990
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { className: "dkg-input", value: dir, placeholder: "\u4ED3\u5E93\u6216\u7236\u76EE\u5F55\u7684\u7EDD\u5BF9\u8DEF\u5F84", spellCheck: false, onChange: (e) => setDir(e.target.value) }),
16991
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: () => resolveAndSet(dir), disabled: !dir || loading, children: loading ? "\u2026" : "\u6253\u5F00" }),
16992
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: pick, title: canBrowse ? "\u6D4F\u89C8\u76EE\u5F55\uFF08\u670D\u52A1\u5668\u53EF\u7528\uFF09" : "\u6253\u5F00\u7CFB\u7EDF\u76EE\u5F55\u5BF9\u8BDD\u6846", children: picking ? "\u6D4F\u89C8\u4E2D\u2026" : "\u9009\u62E9\u76EE\u5F55\u2026" })
16993
+ ] }),
16994
+ picking ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
16995
+ DirBrowser,
16996
+ {
16997
+ ctx,
16998
+ startPath: dir,
16999
+ onClose: () => setPicking(false),
17000
+ onPick: (chosen) => {
17001
+ setPicking(false);
17002
+ setDir(chosen);
17003
+ resolveAndSet(chosen);
17004
+ }
17005
+ }
17006
+ ) : null,
17007
+ !compact ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-bar", children: [
17008
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "dkg-check", children: [
17009
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "checkbox", checked: includeSubdirs, onChange: (e) => setIncludeSubdirs(e.target.checked) }),
17010
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u5305\u542B\u5B50\u76EE\u5F55\u4ED3\u5E93" })
17011
+ ] }),
17012
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-hint", children: loading ? "\u6B63\u5728\u89E3\u6790\u2026" : repos.length > 0 ? repos.length + " \u4E2A\u4ED3\u5E93" : "" })
17013
+ ] }) : null,
17014
+ error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-error", children: error }) : null,
17015
+ repo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
17016
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-tabbar", children: [
17017
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-repo-name", title: repo, children: repo }),
17018
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dkg-badge", children: branch || "(\u5206\u79BB HEAD)" }),
17019
+ behind > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-badge warn", children: [
17020
+ "\u843D\u540E ",
17021
+ behind
17022
+ ] }) : null,
17023
+ ahead > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-badge ok", children: [
17024
+ "\u5F85\u63A8\u9001 ",
17025
+ ahead
17026
+ ] }) : null,
17027
+ dirty > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dkg-badge", children: [
17028
+ dirty,
17029
+ " \u5904\u6539\u52A8"
17030
+ ] }) : null,
17031
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dkg-tabs", children: [
17032
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-tab" + (tab === "history" ? " on" : ""), onClick: () => setTab("history"), children: "\u5386\u53F2" }),
17033
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dkg-tab" + (tab === "worktree" ? " on" : ""), onClick: () => setTab("worktree"), children: [
17034
+ "\u5DE5\u4F5C\u533A",
17035
+ dirty > 0 ? " (" + dirty + ")" : ""
17036
+ ] })
17037
+ ] }),
17038
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dkg-btn", onClick: refreshRepo, children: "\u5237\u65B0" })
17039
+ ] }),
17040
+ tab === "history" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
17041
+ HistoryPane,
17042
+ {
17043
+ repo,
17044
+ repos,
17045
+ selectedRepos: selectedRepos.length > 0 ? selectedRepos : [repo],
17046
+ currentRepo: repo,
17047
+ onToggleRepo: toggleRepo,
17048
+ onOnlyCurrent: () => setSelectedRepos([repo]),
17049
+ onSelectAll: setAllRepos,
17050
+ refs,
17051
+ initialPath: props && props.initialPath
17052
+ }
17053
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorktreePane, { repo, status, onRefresh: refreshRepo })
17054
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dkg-note", children: "\u6B63\u5728\u89E3\u6790\u76EE\u5F55\u6240\u5728\u7684\u4ED3\u5E93\u2026\uFF08\u4E5F\u53EF\u4EE5\u5728\u4E0A\u9762\u586B\u4E00\u4E2A\u7EDD\u5BF9\u8DEF\u5F84\u540E\u70B9\u300C\u6253\u5F00\u300D\uFF09" })
17055
+ ] });
17056
+ }
17057
+ var GIT_TAB_ID = "dsh-dock.git";
17058
+ var GIT_TAB_KIND = "dsh-dock-git";
17059
+ var GIT_ICON_KEY = "dsh-dock.git";
17060
+ var GIT_PANEL_NAME = "Git\u4ED3\u5E93\u64CD\u4F5C";
17061
+ var dockCtx = null;
17062
+ function GitTabBody(props) {
17063
+ const tab = props.useTabInfo();
17064
+ const params = tab && tab.tab && tab.tab.navigation && tab.tab.navigation.params || {};
17065
+ const repo = typeof params.repo === "string" ? params.repo : "";
17066
+ const path = typeof params.path === "string" ? params.path : "";
17067
+ const [target, setTarget] = (0, import_react23.useState)({ repo, path });
17068
+ (0, import_react23.useEffect)(() => {
17069
+ setTarget({ repo, path });
17070
+ }, [repo, path]);
17071
+ const ctx = props.ctx || dockCtx;
17072
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GitView, { ctx, repo: target.repo, initialPath: target.path, sessionId: props.sessionId, compact: true });
17073
+ }
17074
+ function GitTabTitle(props) {
17075
+ const tab = props.useTabInfo();
17076
+ const params = tab && tab.tab && tab.tab.navigation && tab.tab.navigation.params || {};
17077
+ const repo = typeof params.repo === "string" ? params.repo : "";
17078
+ const name = repo ? repo.split("/").filter(Boolean).pop() : "";
17079
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { title: repo, children: name || GIT_PANEL_NAME });
17080
+ }
17081
+ var css6 = [
17082
+ ".dkg{display:flex;flex-direction:column;gap:8px;min-height:0;height:100%;}",
17083
+ ".dkg.dkg-compact{gap:6px;padding:0;}",
17084
+ ".dkg-bar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}",
17085
+ ".dkg-input{flex:1;min-width:120px;box-sizing:border-box;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:4px 8px;}",
17086
+ ".dkg-input.sm{min-width:70px;flex:0 1 100px;}",
17087
+ ".dkg-input:focus{outline:none;border-color:var(--dk-accent);}",
17088
+ ".dkg-select{flex:none;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:4px 6px;}",
17089
+ ".dkg-btn{flex:none;cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:transparent;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:3px 9px;}",
17090
+ ".dkg-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);}",
17091
+ ".dkg-btn:disabled{opacity:.45;cursor:default;}",
17092
+ ".dkg-btn.primary{border-color:var(--dk-accent);color:var(--dk-accent);}",
17093
+ ".dkg-btn.primary:hover:not(:disabled){background:var(--dk-accent-soft);}",
17094
+ ".dkg-link{cursor:pointer;font-family:inherit;font-size:11px;color:var(--dk-accent);background:transparent;border:0;padding:0;}",
17095
+ ".dkg-link:disabled{opacity:.5;cursor:default;}",
17096
+ ".dkg-check{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer;}",
17097
+ ".dkg-hint{font-size:11px;color:var(--dsw-alias-label-tertiary);}",
17098
+ ".dkg-note{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.6;}",
17099
+ ".dkg-error{border:1px solid color-mix(in srgb,var(--dsw-alias-state-error-primary) 45%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 8%,transparent);color:var(--dsw-alias-state-error-primary);border-radius:8px;padding:6px 10px;font-size:12px;line-height:1.6;word-break:break-all;}",
17100
+ ".dkg-ok{border:1px solid color-mix(in srgb,var(--dsw-alias-state-success-primary) 45%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 8%,transparent);color:var(--dsw-alias-state-success-primary);border-radius:8px;padding:6px 10px;font-size:12px;line-height:1.6;word-break:break-all;}",
17101
+ // 子仓库多选下拉
17102
+ ".dkg-repopick{position:relative;flex:0 1 auto;}",
17103
+ ".dkg-repopick-btn{display:flex;align-items:center;gap:4px;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:4px 8px;white-space:nowrap;}",
17104
+ ".dkg-repopick-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
17105
+ ".dkg-repopick-btn.on{border-color:var(--dk-accent);color:var(--dk-accent);}",
17106
+ ".dkg-caret{font-size:9px;opacity:.8;}",
17107
+ ".dkg-repopick-menu{position:absolute;top:calc(100% + 4px);right:0;z-index:20;min-width:260px;max-width:min(420px,90vw);max-height:300px;overflow:auto;display:flex;flex-direction:column;gap:1px;padding:4px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.28);}",
17108
+ ".dkg-repopick-row{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid transparent;border-radius:5px;padding:4px 6px;min-width:0;}",
17109
+ ".dkg-repopick-row:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17110
+ ".dkg-repopick-row.on{color:var(--dsw-alias-label-primary);}",
17111
+ ".dkg-repopick-all{display:flex;gap:4px;flex:none;border-bottom:1px solid var(--dsw-alias-border-l1);padding:2px 2px 5px;margin-bottom:2px;}",
17112
+ ".dkg-repopick-allbtn{flex:1;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dk-accent);background:transparent;border:1px solid var(--dsw-alias-border-l1);border-radius:5px;padding:3px 6px;}",
17113
+ ".dkg-repopick-allbtn:hover{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dk-accent);}",
17114
+ ".dkg-repopick-foot{flex:none;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dk-accent);background:transparent;border:0;border-top:1px solid var(--dsw-alias-border-l1);padding:5px 6px;margin-top:2px;text-align:left;}",
17115
+ ".dkg-repopick-foot:hover{text-decoration:underline;}",
17116
+ ".dkg-tabbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;border-bottom:1px solid var(--dsw-alias-border-l1);padding-bottom:5px;}",
17117
+ ".dkg-repo-name{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary);max-width:42%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left;}",
17118
+ ".dkg-badge{font-size:10px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:0 8px;color:var(--dsw-alias-label-tertiary);}",
17119
+ ".dkg-badge.ok{color:var(--dsw-alias-state-success-primary);border-color:currentColor;}",
17120
+ ".dkg-badge.warn{color:var(--dk-warn);border-color:currentColor;}",
17121
+ ".dkg-tabs{display:flex;gap:4px;margin-left:auto;}",
17122
+ ".dkg-tab{cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid transparent;border-radius:8px;padding:2px 9px;}",
17123
+ ".dkg-tab.on{color:var(--dk-accent);border-color:currentColor;background:var(--dk-accent-soft);}",
17124
+ // 抽屉里三栏改为上下堆叠,宽度不够时更可用
17125
+ ".dkg-body{display:flex;gap:6px;min-height:0;flex:1;overflow:hidden;}",
17126
+ ".dkg-compact .dkg-body{flex-direction:column;}",
17127
+ ".dkg-side{flex:none;width:150px;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:5px;display:flex;flex-direction:column;gap:1px;}",
17128
+ ".dkg-compact .dkg-side{width:auto;max-height:110px;flex-direction:row;flex-wrap:wrap;align-items:center;}",
17129
+ ".dkg-compact .dkg-side-group{flex-direction:row;flex-wrap:wrap;margin-top:0;}",
17130
+ ".dkg-compact .dkg-side-title{display:none;}",
17131
+ ".dkg-compact .dkg-side-item{width:auto;flex:none;max-width:180px;}",
17132
+ ".dkg-side-group{display:flex;flex-direction:column;gap:1px;margin-top:4px;}",
17133
+ ".dkg-side-title{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--dsw-alias-label-tertiary);padding:4px 6px 2px;}",
17134
+ ".dkg-side-item{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid transparent;border-radius:6px;padding:2px 6px;min-width:0;}",
17135
+ ".dkg-side-item:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17136
+ ".dkg-side-item.on{color:var(--dk-accent);background:var(--dk-accent-soft);border-color:color-mix(in srgb,var(--dk-accent) 35%,transparent);}",
17137
+ ".dkg-branch-icon{flex:none;font-size:10px;color:var(--dsw-alias-label-tertiary);}",
17138
+ ".dkg-branch-icon.remote{color:var(--dsw-alias-label-secondary);}",
17139
+ ".dkg-branch-icon.tag{color:var(--dk-warn);}",
17140
+ ".dkg-ellipsis{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17141
+ ".dkg-mid{flex:1 1 40%;min-width:0;min-height:0;display:flex;flex-direction:column;gap:5px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:6px;}",
17142
+ ".dkg-compact .dkg-mid{flex:1 1 auto;min-height:80px;overflow:hidden;}",
17143
+ ".dkg-filters{display:flex;flex-direction:column;gap:5px;}",
17144
+ ".dkg-filter-row{display:flex;gap:5px;flex-wrap:wrap;align-items:center;}",
17145
+ ".dkg-filter-tag{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--dk-accent);}",
17146
+ ".dkg-commits{flex:1;min-height:60px;overflow:auto;display:flex;flex-direction:column;gap:1px;}",
17147
+ ".dkg-commit{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:transparent;border:1px solid transparent;border-radius:6px;padding:3px 5px;}",
17148
+ ".dkg-commit:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17149
+ ".dkg-commit.on{background:var(--dk-accent-soft);border-color:color-mix(in srgb,var(--dk-accent) 35%,transparent);}",
17150
+ ".dkg-graph{display:flex;align-items:center;justify-content:center;position:relative;height:100%;}",
17151
+ ".dkg-graph::before{content:'';position:absolute;top:-4px;bottom:-4px;width:1px;background:var(--dsw-alias-border-l2);}",
17152
+ ".dkg-graph-dot{position:relative;width:6px;height:6px;border-radius:50%;background:var(--dk-accent);box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-1);}",
17153
+ ".dkg-commit-subject{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17154
+ ".dkg-commit-refs{display:none;}",
17155
+ ".dkg-compact .dkg-commit-refs{display:none;}",
17156
+ ".dkg-commit-meta-line{display:flex;align-items:center;gap:6px;font-size:10px;color:var(--dsw-alias-label-tertiary);overflow:hidden;}",
17157
+ ".dkg-ref{font-size:10px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:0 6px;color:var(--dsw-alias-label-secondary);}",
17158
+ ".dkg-ref.remote{color:var(--dsw-alias-label-tertiary);}",
17159
+ ".dkg-commit-author{font-size:11px;color:var(--dsw-alias-label-secondary);flex:none;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17160
+ ".dkg-commit-time{font-size:11px;color:var(--dsw-alias-label-tertiary);flex:none;min-width:58px;text-align:right;}",
17161
+ ".dkg-detail{flex:1 1 46%;min-width:0;min-height:0;overflow:hidden;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:8px;display:flex;flex-direction:column;gap:4px;}",
17162
+ ".dkg-compact .dkg-detail{flex:none;height:var(--dkg-main-pct,50%);max-height:none;min-height:80px;}",
17163
+ // 拖动分隔条:只在上下堆叠(抽屉)时占位,宽屏三栏下隐藏
17164
+ // 列表↔详情 的分隔条:只在抽屉(上下堆叠)时出现;宽屏三栏时详情在右侧,不需要它
17165
+ ".dkg-splitter-main{display:none;}",
17166
+ ".dkg-compact .dkg-splitter-main{display:block;flex:none;}",
17167
+ // 详情内部(差异↔说明)的分隔条:任何布局都显示
17168
+ // 拖动期间:全局光标改成上下调整,并禁止选中文字
17169
+ // (不禁止的话拖快了会连带选中面板里的文本,出现蓝色选区,视觉上就是「闪」)
17170
+ "body.dkg-resizing{cursor:row-resize !important;user-select:none !important;}",
17171
+ "body.dkg-resizing *{cursor:row-resize !important;user-select:none !important;}",
17172
+ // 拖动期间禁用过渡/动画:任何过渡都会让高度变化「追」不上指针,看起来像抖
17173
+ "body.dkg-resizing *{transition:none !important;animation:none !important;}",
17174
+ ".dkg-splitter{will-change:transform;}",
17175
+ ".dkg-splitter-slot{display:block;flex:none;}",
17176
+ ".dkg-splitter{display:flex;align-items:center;justify-content:center;height:10px;cursor:row-resize;border-radius:4px;background:transparent;touch-action:none;}",
17177
+ ".dkg-splitter:hover,.dkg-splitter.dragging{background:var(--dk-accent-soft);}",
17178
+ ".dkg-splitter:focus-visible{outline:2px solid var(--dk-accent);outline-offset:-2px;}",
17179
+ ".dkg-splitter-grip{display:block;width:36px;height:2px;border-radius:1px;background:var(--dsw-alias-border-l2);}",
17180
+ ".dkg-splitter:hover .dkg-splitter-grip,.dkg-splitter.dragging .dkg-splitter-grip{background:var(--dk-accent);}",
17181
+ // ---- GoLand 风格提交表格 ----
17182
+ ".dkg-toolbar{display:flex;align-items:center;gap:4px;flex-wrap:wrap;flex:none;}",
17183
+ ".dkg-toolbar .dkg-input{flex:1 1 120px;min-width:80px;}",
17184
+ ".dkg-toolbar .dkg-input.sm{flex:0 1 84px;min-width:60px;}",
17185
+ ".dkg-icon-btn{flex:none;cursor:pointer;font-family:inherit;font-size:13px;line-height:1;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid var(--dsw-alias-border-l1);border-radius:6px;padding:4px 7px;}",
17186
+ ".dkg-icon-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
17187
+ ".dkg-icon-btn:disabled{opacity:.5;cursor:default;}",
17188
+ ".dkg-colpick{position:relative;flex:none;}",
17189
+ ".dkg-colpick-menu{position:absolute;top:calc(100% + 4px);right:0;z-index:20;min-width:150px;display:flex;flex-direction:column;gap:1px;padding:4px;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.28);}",
17190
+ ".dkg-colpick-row{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-secondary);background:transparent;border:1px solid transparent;border-radius:5px;padding:4px 6px;}",
17191
+ ".dkg-colpick-row:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);}",
17192
+ ".dkg-colpick-row.on{color:var(--dsw-alias-label-primary);}",
17193
+ ".dkg-colpick-row.locked{opacity:.55;cursor:default;}",
17194
+ // 表头与行共用同一套列宽:图 14px / 说明 1fr / 引用 88px / 作者 96px / 日期 64px
17195
+ ".dkg-thead,.dkg-tr{display:grid;grid-template-columns:var(--dkg-cols,12px minmax(0,1fr) 64px 78px 56px);align-items:center;gap:5px;}",
17196
+ ".dkg-thead{flex:none;padding:3px 6px;border-bottom:1px solid var(--dsw-alias-border-l1);font-size:11px;color:var(--dsw-alias-label-tertiary);user-select:none;}",
17197
+ ".dkg-th.date,.dkg-td.date{text-align:right;}",
17198
+ ".dkg-th.refs,.dkg-td.refs{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17199
+ ".dkg-tr{cursor:default;padding:3px 6px;border-radius:4px;font-size:12px;color:var(--dsw-alias-label-primary);border:1px solid transparent;}",
17200
+ ".dkg-tr:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17201
+ ".dkg-tr.on{background:var(--dk-accent-soft);border-color:var(--dk-accent);}",
17202
+ ".dkg-td{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17203
+ ".dkg-td.subject{display:flex;align-items:center;gap:5px;min-width:0;}",
17204
+ ".dkg-td.author{font-size:11px;color:var(--dsw-alias-label-secondary);}",
17205
+ ".dkg-td.date{font-size:11px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;}",
17206
+ ".dkg-td.datetime{font-size:11px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;white-space:nowrap;}",
17207
+ ".dkg-th.datetime{white-space:nowrap;}",
17208
+ // 抽屉很窄时先牺牲「引用」列:它多数行是空的,说明与时间更要紧
17209
+ ".dkg-muted{color:var(--dsw-alias-label-tertiary);}",
17210
+ ".dkg-repo-tag{flex:none;font-size:10px;padding:0 4px;border-radius:3px;background:var(--dk-accent-soft);color:var(--dk-accent);white-space:nowrap;}",
17211
+ ".dkg-chip-check{flex:none;font-size:11px;line-height:1;}",
17212
+ ".dkg-toolbar input[type=date]{flex:0 1 120px;min-width:100px;}",
17213
+ // 分支图:一条竖线 + 一个点,像 IDE 的 Log 图列
17214
+ ".dkg-td.graph{position:relative;display:flex;align-items:center;justify-content:center;height:100%;}",
17215
+ ".dkg-graph-line{position:absolute;top:0;bottom:0;left:50%;width:1px;background:var(--dsw-alias-border-l2);transform:translateX(-50%);}",
17216
+ ".dkg-graph-dot{position:relative;width:6px;height:6px;border-radius:50%;background:var(--dk-accent);box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-1);}",
17217
+ // 右栏详情:上下分区(上方差异 / 下方说明),可拖动
17218
+ ".dkg-detail-diff{flex:1 1 0;min-height:60px;overflow:auto;display:flex;flex-direction:column;gap:6px;}",
17219
+ ".dkg-detail-msgbox{flex:0 0 auto;overflow:auto;display:flex;flex-direction:column;gap:5px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:6px;height:var(--dkg-detail-pct,50%);}",
17220
+ ".dkg-detail .dkg-splitter-slot{display:block;flex:none;}",
17221
+ ".dkg-detail-head{display:flex;flex-direction:column;gap:5px;border-bottom:1px solid var(--dsw-alias-border-l1);padding-bottom:6px;}",
17222
+ ".dkg-detail-subject{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary);word-break:break-word;}",
17223
+ ".dkg-detail-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;color:var(--dsw-alias-label-tertiary);word-break:break-all;}",
17224
+ ".dkg-sha{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--dk-accent);}",
17225
+ ".dkg-detail-msg{margin:0;font-size:11px;line-height:1.55;color:var(--dsw-alias-label-secondary);white-space:pre-wrap;word-break:break-word;max-height:120px;overflow:auto;background:var(--dsw-alias-bg-layer-2);border-radius:6px;padding:6px 8px;}",
17226
+ ".dkg-detail-split{display:flex;gap:6px;min-height:0;}",
17227
+ ".dkg-compact .dkg-detail-split{flex-direction:column;}",
17228
+ ".dkg-diffs{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px;}",
17229
+ ".dkg-tree{flex:none;width:150px;max-height:280px;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:6px;padding:3px;display:flex;flex-direction:column;gap:1px;}",
17230
+ ".dkg-compact .dkg-tree{width:auto;max-height:110px;flex-direction:row;flex-wrap:wrap;}",
17231
+ ".dkg-tree-row{display:flex;align-items:center;gap:5px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-secondary);background:transparent;border:0;border-radius:5px;padding:1px 4px;min-width:0;}",
17232
+ ".dkg-tree-row:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17233
+ ".dkg-tree-row.file.on{background:var(--dk-accent-soft);color:var(--dk-accent);}",
17234
+ ".dkg-tree-row.dir{color:var(--dsw-alias-label-tertiary);}",
17235
+ ".dkg-tree-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17236
+ ".dkg-file{border:1px solid var(--dsw-alias-border-l1);border-radius:6px;overflow:hidden;background:var(--dsw-alias-bg-layer-2);}",
17237
+ ".dkg-file-head{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:11px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:0;padding:4px 6px;min-width:0;}",
17238
+ ".dkg-file-head:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17239
+ ".dkg-file-path{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}",
17240
+ ".dkg-file-old{font-size:10px;color:var(--dsw-alias-label-tertiary);max-width:30%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17241
+ ".dkg-caret{flex:none;font-size:9px;color:var(--dsw-alias-label-tertiary);width:10px;}",
17242
+ ".dkg-tag{flex:none;font-size:10px;border-radius:999px;padding:0 6px;color:var(--dsw-alias-label-tertiary);border:1px solid var(--dsw-alias-border-l2);}",
17243
+ ".dkg-tag.added{color:var(--dsw-alias-state-success-primary);border-color:currentColor;}",
17244
+ ".dkg-tag.deleted{color:var(--dsw-alias-state-error-primary);border-color:currentColor;}",
17245
+ ".dkg-add{color:var(--dsw-alias-state-success-primary);flex:none;font-size:11px;}",
17246
+ ".dkg-del{color:var(--dsw-alias-state-error-primary);flex:none;font-size:11px;}",
17247
+ ".dkg-diff{max-height:320px;overflow:auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1.5;}",
17248
+ ".dkg-hunk-head{color:var(--dk-accent);background:color-mix(in srgb,var(--dk-accent) 8%,transparent);padding:2px 6px;font-size:10px;white-space:pre;}",
17249
+ ".dkg-line{display:flex;align-items:flex-start;gap:0;white-space:pre;}",
17250
+ ".dkg-line.add{background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 12%,transparent);}",
17251
+ ".dkg-line.del{background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 12%,transparent);}",
17252
+ ".dkg-ln{flex:none;width:34px;text-align:right;padding-right:5px;color:var(--dsw-alias-label-tertiary);user-select:none;}",
17253
+ ".dkg-sign{flex:none;width:10px;color:var(--dsw-alias-label-tertiary);}",
17254
+ ".dkg-code{flex:1;min-width:0;overflow-x:auto;color:var(--dsw-alias-label-primary);}",
17255
+ ".dkg-wt{display:flex;gap:6px;min-height:0;flex:1;overflow:hidden;}",
17256
+ ".dkg-compact .dkg-wt{flex-direction:column;}",
17257
+ ".dkg-wt-files{flex:1 1 48%;min-width:0;overflow:auto;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:6px;display:flex;flex-direction:column;gap:6px;}",
17258
+ ".dkg-compact .dkg-wt-files{max-height:44%;}",
17259
+ ".dkg-wt-group{display:flex;flex-direction:column;gap:1px;}",
17260
+ ".dkg-wt-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 4px;border-bottom:1px solid var(--dsw-alias-border-l1);margin-bottom:2px;}",
17261
+ ".dkg-wt-empty{padding-left:22px;font-size:11px;}",
17262
+ ".dkg-wt-item{display:flex;align-items:center;gap:6px;padding:2px 5px;border-radius:5px;cursor:pointer;font-size:12px;min-width:0;color:var(--dsw-alias-label-secondary);}",
17263
+ ".dkg-wt-item:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17264
+ ".dkg-wt-item.on{background:var(--dk-accent-soft);}",
17265
+ ".dkg-wt-code{flex:none;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;color:var(--dk-warn);width:20px;}",
17266
+ ".dkg-wt-actions{flex:none;}",
17267
+ ".dkg-wt-commit{flex:1 1 52%;min-width:0;display:flex;flex-direction:column;gap:6px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:6px;overflow:auto;}",
17268
+ ".dkg-textarea{width:100%;box-sizing:border-box;font-family:inherit;font-size:12px;line-height:1.55;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:6px 8px;resize:vertical;}",
17269
+ ".dkg-textarea:focus{outline:none;border-color:var(--dk-accent);}",
17270
+ ".dkg-wt-actions{display:flex;gap:5px;flex-wrap:wrap;}",
17271
+ ".dkg-preview{border-top:1px solid var(--dsw-alias-border-l1);padding-top:6px;display:flex;flex-direction:column;gap:5px;}",
17272
+ ".dkg-preview-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--dsw-alias-label-primary);}",
17273
+ // 目录浏览器
17274
+ ".dkg-picker{display:flex;flex-direction:column;gap:6px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2);padding:8px;max-height:340px;overflow:hidden;}",
17275
+ ".dkg-picker-head{display:flex;align-items:center;justify-content:space-between;gap:8px;}",
17276
+ ".dkg-picker-title{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary);}",
17277
+ ".dkg-crumbs{display:flex;align-items:center;gap:2px;flex-wrap:wrap;font-size:11px;max-height:48px;overflow:auto;}",
17278
+ ".dkg-crumb{cursor:pointer;font-family:inherit;font-size:11px;color:var(--dk-accent);background:transparent;border:0;padding:1px 4px;border-radius:4px;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
17279
+ ".dkg-crumb:hover{background:var(--dsw-alias-interactive-bg-hover);}",
17280
+ ".dkg-crumb.on{color:var(--dsw-alias-label-primary);font-weight:600;}",
17281
+ ".dkg-picker-bar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}",
17282
+ ".dkg-picker-list{flex:1;min-height:80px;overflow:auto;display:flex;flex-direction:column;gap:1px;}",
17283
+ ".dkg-picker-row{display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;text-align:left;cursor:pointer;font-family:inherit;font-size:12px;color:var(--dsw-alias-label-primary);background:transparent;border:1px solid transparent;border-radius:6px;padding:3px 6px;min-width:0;}",
17284
+ ".dkg-picker-row:hover{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l1);}",
17285
+ ".dkg-folder{flex:none;font-size:10px;color:var(--dk-warn);}",
17286
+ ".dkg-picker-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:6px;}"
17287
+ ].join("\n");
17288
+ function serviceOf2(scope, name) {
17289
+ if (!scope) return void 0;
17290
+ try {
17291
+ if (typeof scope.get === "function") {
17292
+ const viaGet = scope.get(name);
17293
+ if (viaGet !== void 0) return viaGet;
17294
+ }
17295
+ } catch {
17296
+ }
17297
+ try {
17298
+ return scope[name];
17299
+ } catch {
17300
+ return void 0;
17301
+ }
17302
+ }
17303
+ function onServices2(ctx, names, run) {
17304
+ if (typeof ctx.inject === "function") {
17305
+ try {
17306
+ ctx.inject(names, (scope) => run(scope));
17307
+ return;
17308
+ } catch (e) {
17309
+ }
17310
+ }
17311
+ run(ctx);
17312
+ }
17313
+ function gitPanelEnabled() {
17314
+ try {
17315
+ const state = stateOf("dshtools");
17316
+ if (!state || state.enabled !== true) return false;
17317
+ return valueOf("interface", "gitPanel") === true;
17318
+ } catch {
17319
+ return false;
17320
+ }
17321
+ }
17322
+ async function resolveTarget(path) {
17323
+ try {
17324
+ const data = await rpc2("resolve", { path });
17325
+ return data && data.repo ? data : null;
17326
+ } catch {
17327
+ return null;
17328
+ }
17329
+ }
17330
+ function openGit(ctx, target) {
17331
+ try {
17332
+ const sidebar = serviceOf2(ctx, "sidebarRight");
17333
+ if (!sidebar) return false;
17334
+ const params = {};
17335
+ if (target && target.repo) params.repo = target.repo;
17336
+ if (target && target.path) params.path = target.path;
17337
+ if (target && target.sessionId && typeof sidebar.openTabIn === "function") {
17338
+ sidebar.openTabIn(target.sessionId, GIT_TAB_KIND, { params });
17339
+ } else if (typeof sidebar.openTab === "function") {
17340
+ sidebar.openTab(GIT_TAB_KIND, { params });
17341
+ } else {
17342
+ return false;
17343
+ }
17344
+ return true;
17345
+ } catch {
17346
+ return false;
17347
+ }
17348
+ }
17349
+ function installClient2(ctx) {
17350
+ if (!ctx || typeof ctx !== "object") return;
17351
+ dockCtx = ctx;
17352
+ const syncers = [];
17353
+ function syncAll() {
17354
+ for (const fn of syncers) {
17355
+ try {
17356
+ fn();
17357
+ } catch {
17358
+ }
17359
+ }
17360
+ }
17361
+ try {
17362
+ const pending = ensureLoaded();
17363
+ if (pending && typeof pending.then === "function") pending.then(syncAll, syncAll);
17364
+ else syncAll();
17365
+ } catch {
17366
+ }
17367
+ onServices2(ctx, ["sidebarRightTabs", "slots"], (scope) => {
17368
+ const tabs = serviceOf2(scope, "sidebarRightTabs");
17369
+ const slots = serviceOf2(scope, "slots");
17370
+ if (!tabs || typeof tabs.register !== "function") return;
17371
+ if (!slots || typeof slots.inject !== "function" || typeof slots.register !== "function") return;
17372
+ const mount = () => {
17373
+ const disposers = [];
17374
+ disposers.push(tabs.register({
17375
+ id: GIT_TAB_ID,
17376
+ kind: GIT_TAB_KIND,
17377
+ priority: "extension",
17378
+ // 页签标题与引导卡片统一叫「Git仓库操作」:只写 Git 会被当成 Git 客户端/工具入口,
17379
+ // 这个名字说明它是「对仓库做操作」的面板。
17380
+ title: () => GIT_PANEL_NAME,
17381
+ guide: [{
17382
+ id: "git",
17383
+ order: 40,
17384
+ title: () => GIT_PANEL_NAME,
17385
+ description: () => "\u67E5\u770B\u5F53\u524D\u76EE\u5F55\u7684\u63D0\u4EA4\u5386\u53F2\u4E0E\u5DE5\u4F5C\u533A\uFF0C\u652F\u6301\u63D0\u4EA4\u4E0E\u63A8\u9001",
17386
+ icon: GitGuideArtwork
17387
+ }]
17388
+ }));
17389
+ disposers.push(slots.inject("sidebar.right.pane.tab", () => slots.register(
17390
+ { name: "sidebar.right.pane.tab", key: GIT_TAB_ID },
17391
+ GitTabBody
17392
+ )));
17393
+ disposers.push(slots.inject("sidebar.right.pane.tab.title", () => slots.register(
17394
+ { name: "sidebar.right.pane.tab.title", key: GIT_TAB_ID },
17395
+ GitTabTitle
17396
+ )));
17397
+ return () => {
17398
+ for (const dispose of disposers) {
17399
+ try {
17400
+ dispose();
17401
+ } catch {
17402
+ }
17403
+ }
17404
+ };
17405
+ };
17406
+ let unmount = null;
17407
+ const sync = () => {
17408
+ const want = gitPanelEnabled();
17409
+ if (want && !unmount) {
17410
+ unmount = mount();
17411
+ } else if (!want && unmount) {
17412
+ try {
17413
+ unmount();
17414
+ } catch {
17415
+ }
17416
+ unmount = null;
17417
+ }
17418
+ };
17419
+ syncers.push(sync);
17420
+ const start = () => {
17421
+ sync();
17422
+ return subscribe(sync);
17423
+ };
17424
+ if (typeof scope.effect === "function") {
17425
+ scope.effect(() => {
17426
+ const stop = start();
17427
+ return () => {
17428
+ try {
17429
+ stop();
17430
+ } catch {
17431
+ }
17432
+ if (unmount) {
17433
+ try {
17434
+ unmount();
17435
+ } catch {
17436
+ }
17437
+ unmount = null;
17438
+ }
17439
+ };
17440
+ }, "dsh-dock: Git \u62BD\u5C49\u9875\u7B7E");
17441
+ } else {
17442
+ start();
17443
+ }
17444
+ });
17445
+ onServices2(ctx, ["slots"], (scope) => {
17446
+ const slots = serviceOf2(scope, "slots");
17447
+ if (!slots || typeof slots.inject !== "function" || typeof slots.register !== "function") return;
17448
+ const register = () => {
17449
+ const disposers = [];
17450
+ disposers.push(slots.inject("contextMenu.icon", function* () {
17451
+ yield slots.register({ name: "contextMenu.icon", key: GIT_ICON_KEY }, GitHistoryIcon);
17452
+ }));
17453
+ return () => {
17454
+ for (const dispose of disposers) {
17455
+ try {
17456
+ dispose();
17457
+ } catch {
17458
+ }
17459
+ }
17460
+ };
17461
+ };
17462
+ if (typeof scope.effect === "function") scope.effect(register, "dsh-dock: Git \u83DC\u5355\u56FE\u6807");
17463
+ else register();
17464
+ });
17465
+ onServices2(ctx, ["contextMenus", "sidebarRight"], (scope) => {
17466
+ const menus = serviceOf2(scope, "contextMenus");
17467
+ if (!menus || typeof menus.register !== "function") return;
17468
+ const makeResolve = (kind) => async (target, signal) => {
17469
+ if (!gitPanelEnabled()) return [];
17470
+ const resolved = await resolveTarget(target.path);
17471
+ if (signal && typeof signal.throwIfAborted === "function") signal.throwIfAborted();
17472
+ if (!resolved) return [];
17473
+ return [{
17474
+ id: "git-history",
17475
+ label: kind === "directory" ? "\u67E5\u770B Git \u5386\u53F2" : "\u67E5\u770B\u8BE5\u6587\u4EF6\u7684 Git \u5386\u53F2",
17476
+ icon: { key: GIT_ICON_KEY },
17477
+ // run 绝不抛错:抛了 ui-context-menu 只会弹「操作失败,请重试」,把真实原因盖掉。
17478
+ // 打不开时自己用菜单的通知通道说清楚原因。
17479
+ run: () => {
17480
+ const ok = openGit(scope, {
17481
+ repo: resolved.repo,
17482
+ path: resolved.relPath === "." ? "" : resolved.relPath,
17483
+ sessionId: target.sessionId
17484
+ });
17485
+ if (!ok) {
17486
+ try {
17487
+ menus.notify("Git \u9762\u677F\u672A\u5C31\u7EEA\uFF1A\u8BF7\u786E\u8BA4\u300CDSH\u529F\u80FD \u2192 \u754C\u9762\u589E\u5F3A \u2192 Git \u7BA1\u7406\u9762\u677F\u300D\u5DF2\u6253\u5F00\uFF0C\u5E76\u91CD\u542F\u8FC7 dsh web", false);
17488
+ } catch {
17489
+ }
17490
+ }
17491
+ }
17492
+ }];
17493
+ };
17494
+ const register = () => {
17495
+ const disposers = [
17496
+ menus.register({ id: "dsh-dock.git.directory", target: "directory", order: 220, resolve: makeResolve("directory") }),
17497
+ menus.register({ id: "dsh-dock.git.file", target: "file", order: 220, resolve: makeResolve("file") })
17498
+ ];
17499
+ return () => {
17500
+ for (const dispose of disposers) {
17501
+ try {
17502
+ dispose();
17503
+ } catch {
17504
+ }
17505
+ }
17506
+ };
17507
+ };
17508
+ if (typeof scope.effect === "function") scope.effect(register, "dsh-dock: Git \u53F3\u952E\u5165\u53E3");
17509
+ else register();
17510
+ });
17511
+ }
17512
+ function GitGuideArtwork({ size = 36, className } = {}) {
17513
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { width: size, height: size, className, "aria-hidden": "true", viewBox: "0 0 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
17514
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "11", cy: "8", r: "3", stroke: "#F97316", strokeWidth: "2" }),
17515
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "11", cy: "28", r: "3", stroke: "#F97316", strokeWidth: "2" }),
17516
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "25", cy: "18", r: "3", stroke: "#F97316", strokeWidth: "2" }),
17517
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M11 11v14", stroke: "#F97316", strokeWidth: "2", strokeLinecap: "square" }),
17518
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M14 8h4a4 4 0 0 1 4 4v2M14 28h4a4 4 0 0 0 4-4v-2", stroke: "#F97316", strokeWidth: "2", strokeLinecap: "square" })
17519
+ ] });
17520
+ }
17521
+ function GitHistoryIcon() {
17522
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
17523
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "4", cy: "3.5", r: "1.6", stroke: "currentColor", strokeWidth: "1.3" }),
17524
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "4", cy: "12.5", r: "1.6", stroke: "currentColor", strokeWidth: "1.3" }),
17525
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "12", cy: "8", r: "1.6", stroke: "currentColor", strokeWidth: "1.3" }),
17526
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M4 5.1v5.8M5.6 3.5h2.6a2.2 2.2 0 0 1 2.2 2.2v.7M5.6 12.5h2.6a2.2 2.2 0 0 0 2.2-2.2v-.7", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" })
17527
+ ] });
17528
+ }
17529
+
15767
17530
  // src/client.jsx
15768
- var DOCK_VERSION = "0.24.0";
17531
+ var DOCK_VERSION = "0.25.1";
15769
17532
  var BUILTIN_FEATURES = [feature, feature2, feature3, feature11, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature12];
15770
17533
  var PLANNED_FEATURES = [];
15771
17534
  var PLANNED_NOTES = {};
@@ -15986,6 +17749,7 @@ function cancelInitialCssSchedule() {
15986
17749
  function fullDockCss() {
15987
17750
  const parts = [SHELL_CSS];
15988
17751
  for (const f of BUILTIN_FEATURES) if (f.css) parts.push(f.css);
17752
+ if (css6) parts.push(css6);
15989
17753
  for (const f of externalDefs) if (f.css) parts.push(f.css);
15990
17754
  return parts.join("\n");
15991
17755
  }
@@ -16009,8 +17773,8 @@ function ensureCss() {
16009
17773
  }
16010
17774
  }
16011
17775
  function useExternalVersion() {
16012
- const [, bump] = import_react23.default.useReducer((n) => n + 1, 0);
16013
- import_react23.default.useEffect(() => {
17776
+ const [, bump] = import_react24.default.useReducer((n) => n + 1, 0);
17777
+ import_react24.default.useEffect(() => {
16014
17778
  externalListeners.add(bump);
16015
17779
  return () => {
16016
17780
  externalListeners.delete(bump);
@@ -16020,25 +17784,25 @@ function useExternalVersion() {
16020
17784
  var lastGeom = { x: null, y: null, w: null, h: null };
16021
17785
  function DockIcon(props) {
16022
17786
  const size = props && props.size || 16;
16023
- return import_react23.default.createElement(
17787
+ return import_react24.default.createElement(
16024
17788
  "svg",
16025
17789
  { width: size, height: size, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.3, "aria-hidden": true },
16026
- import_react23.default.createElement("rect", { x: 2.5, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
16027
- import_react23.default.createElement("rect", { x: 9, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
16028
- import_react23.default.createElement("rect", { x: 2.5, y: 9, width: 4.4, height: 4.4, rx: 1.2 }),
16029
- import_react23.default.createElement("rect", { x: 9, y: 9, width: 4.4, height: 4.4, rx: 1.2 })
17790
+ import_react24.default.createElement("rect", { x: 2.5, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
17791
+ import_react24.default.createElement("rect", { x: 9, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
17792
+ import_react24.default.createElement("rect", { x: 2.5, y: 9, width: 4.4, height: 4.4, rx: 1.2 }),
17793
+ import_react24.default.createElement("rect", { x: 9, y: 9, width: 4.4, height: 4.4, rx: 1.2 })
16030
17794
  );
16031
17795
  }
16032
17796
  function DockWorkspace() {
16033
- const [nav, setNav] = import_react23.default.useState({ open: panelNav.open, active: panelNav.active, params: panelNav.params });
16034
- import_react23.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open, active: panelNav.active, params: panelNav.params })), []);
17797
+ const [nav, setNav] = import_react24.default.useState({ open: panelNav.open, active: panelNav.active, params: panelNav.params });
17798
+ import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open, active: panelNav.active, params: panelNav.params })), []);
16035
17799
  const active = nav.active;
16036
17800
  const navParams = nav.params;
16037
17801
  const setActive = navigatePanel;
16038
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
17802
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
16039
17803
  useExternalVersion();
16040
- const contentRef = import_react23.default.useRef(null);
16041
- import_react23.default.useEffect(() => {
17804
+ const contentRef = import_react24.default.useRef(null);
17805
+ import_react24.default.useEffect(() => {
16042
17806
  if (contentRef.current) contentRef.current.scrollTop = 0;
16043
17807
  }, [active]);
16044
17808
  const MODULES = allModules();
@@ -16046,26 +17810,26 @@ function DockWorkspace() {
16046
17810
  const mod = isHome ? null : MODULES.find((m) => m.id === active) || MODULES[0];
16047
17811
  const st = mod ? stateOf(mod.id) : null;
16048
17812
  const View = mod ? mod.View : null;
16049
- const viewNode = mod && View ? import_react23.default.createElement(
17813
+ const viewNode = mod && View ? import_react24.default.createElement(
16050
17814
  "div",
16051
17815
  { className: "dockm-view" },
16052
- import_react23.default.createElement(
17816
+ import_react24.default.createElement(
16053
17817
  FeatureBoundary,
16054
17818
  { key: mod.id, label: mod.name },
16055
- import_react23.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
17819
+ import_react24.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
16056
17820
  )
16057
17821
  ) : null;
16058
17822
  const enabledCount = MODULES.filter((m) => {
16059
17823
  const s = stateOf(m.id);
16060
17824
  return !!(s && s.enabled);
16061
17825
  }).length;
16062
- return import_react23.default.createElement(
17826
+ return import_react24.default.createElement(
16063
17827
  "div",
16064
17828
  { className: "dockm-body" },
16065
- import_react23.default.createElement(
17829
+ import_react24.default.createElement(
16066
17830
  "nav",
16067
17831
  { className: "dockm-nav", "aria-label": "\u529F\u80FD\u6A21\u5757" },
16068
- import_react23.default.createElement(
17832
+ import_react24.default.createElement(
16069
17833
  "button",
16070
17834
  {
16071
17835
  type: "button",
@@ -16073,10 +17837,10 @@ function DockWorkspace() {
16073
17837
  className: "dockm-nav-item" + (isHome ? " on" : ""),
16074
17838
  onClick: () => setActive("home")
16075
17839
  },
16076
- import_react23.default.createElement("span", { className: "dockm-navhome" }, import_react23.default.createElement(DockIcon, null)),
16077
- import_react23.default.createElement("span", null, "\u9996\u9875")
17840
+ import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)),
17841
+ import_react24.default.createElement("span", null, "\u9996\u9875")
16078
17842
  ),
16079
- MODULES.map((m) => import_react23.default.createElement(
17843
+ MODULES.map((m) => import_react24.default.createElement(
16080
17844
  "button",
16081
17845
  {
16082
17846
  type: "button",
@@ -16084,42 +17848,42 @@ function DockWorkspace() {
16084
17848
  className: "dockm-nav-item" + (m.id === active ? " on" : ""),
16085
17849
  onClick: () => setActive(m.id)
16086
17850
  },
16087
- import_react23.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
16088
- import_react23.default.createElement("span", null, m.name),
16089
- m.planned ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
16090
- m.external ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
17851
+ import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
17852
+ import_react24.default.createElement("span", null, m.name),
17853
+ m.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
17854
+ m.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
16091
17855
  ))
16092
17856
  ),
16093
- import_react23.default.createElement(
17857
+ import_react24.default.createElement(
16094
17858
  "div",
16095
17859
  { className: "dockm-content", ref: contentRef },
16096
- import_react23.default.createElement(
17860
+ import_react24.default.createElement(
16097
17861
  "div",
16098
17862
  { className: "dockm-content-head" },
16099
- import_react23.default.createElement(
17863
+ import_react24.default.createElement(
16100
17864
  "div",
16101
17865
  { className: "dockm-name" },
16102
- isHome ? import_react23.default.createElement("span", { className: "dockm-navhome" }, import_react23.default.createElement(DockIcon, null)) : import_react23.default.createElement("span", { className: "dockm-dot", style: { background: mod.accent } }),
17866
+ isHome ? import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)) : import_react24.default.createElement("span", { className: "dockm-dot", style: { background: mod.accent } }),
16103
17867
  isHome ? "\u9996\u9875" : mod.name,
16104
- !isHome && mod.planned ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
16105
- !isHome && mod.external ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
17868
+ !isHome && mod.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
17869
+ !isHome && mod.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
16106
17870
  ),
16107
- import_react23.default.createElement(
17871
+ import_react24.default.createElement(
16108
17872
  "div",
16109
17873
  { className: "dockm-desc" },
16110
17874
  isHome ? "\u6240\u6709\u5B50\u529F\u80FD\u603B\u63FD\uFF1A\u8FD0\u884C\u72B6\u6001\u3001\u6982\u8981\u4E0E\u5FEB\u6377\u5F00\u5173\uFF0C\u70B9\u51FB\u5361\u7247\u8FDB\u5165\u5BF9\u5E94\u529F\u80FD\u9875\u3002" : mod.description
16111
17875
  )
16112
17876
  ),
16113
- isHome ? import_react23.default.createElement("div", { className: "dockm-view" }, import_react23.default.createElement(HomeView, { ctx: ctxRef.current, onOpen: setActive, onToggle: force })) : mod.planned ? import_react23.default.createElement("div", { className: "dockm-note" }, PLANNED_NOTES[mod.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st && st.enabled && viewNode ? viewNode : st && st.error ? import_react23.default.createElement("div", { className: "dockm-note dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : import_react23.default.createElement("div", { className: "dockm-note" }, "\u8BE5\u529F\u80FD\u5F53\u524D\u4E3A\u505C\u7528\u72B6\u6001\uFF08\u5F00\u5173\u5DF2\u6301\u4E45\u5316\uFF0C\u91CD\u542F\u540E\u4FDD\u6301\uFF09"),
16114
- import_react23.default.createElement(
17877
+ isHome ? import_react24.default.createElement("div", { className: "dockm-view" }, import_react24.default.createElement(HomeView, { ctx: ctxRef.current, onOpen: setActive, onToggle: force })) : mod.planned ? import_react24.default.createElement("div", { className: "dockm-note" }, PLANNED_NOTES[mod.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st && st.enabled && viewNode ? viewNode : st && st.error ? import_react24.default.createElement("div", { className: "dockm-note dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : import_react24.default.createElement("div", { className: "dockm-note" }, "\u8BE5\u529F\u80FD\u5F53\u524D\u4E3A\u505C\u7528\u72B6\u6001\uFF08\u5F00\u5173\u5DF2\u6301\u4E45\u5316\uFF0C\u91CD\u542F\u540E\u4FDD\u6301\uFF09"),
17878
+ import_react24.default.createElement(
16115
17879
  "div",
16116
17880
  { className: "dockm-foot" },
16117
- import_react23.default.createElement("span", null, isHome ? "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u5171 " + MODULES.length + " \u4E2A\u529F\u80FD\u6A21\u5757\uFF0C" + enabledCount + " \u4E2A\u5DF2\u542F\u7528" : "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u65B0\u529F\u80FD\u6309\u8DEF\u7EBF\u56FE\u8FFD\u52A0"),
16118
- !isHome && mod && !mod.planned && st ? import_react23.default.createElement(
17881
+ import_react24.default.createElement("span", null, isHome ? "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u5171 " + MODULES.length + " \u4E2A\u529F\u80FD\u6A21\u5757\uFF0C" + enabledCount + " \u4E2A\u5DF2\u542F\u7528" : "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u65B0\u529F\u80FD\u6309\u8DEF\u7EBF\u56FE\u8FFD\u52A0"),
17882
+ !isHome && mod && !mod.planned && st ? import_react24.default.createElement(
16119
17883
  "span",
16120
17884
  { className: "dockm-foot-sw" },
16121
- import_react23.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
16122
- import_react23.default.createElement("button", {
17885
+ import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
17886
+ import_react24.default.createElement("button", {
16123
17887
  type: "button",
16124
17888
  className: "dock-sw" + (st.enabled ? " on" : ""),
16125
17889
  role: "switch",
@@ -16132,11 +17896,11 @@ function DockWorkspace() {
16132
17896
  }
16133
17897
  })
16134
17898
  ) : null,
16135
- !isHome && mod && typeof mod.Chip === "function" ? import_react23.default.createElement(
17899
+ !isHome && mod && typeof mod.Chip === "function" ? import_react24.default.createElement(
16136
17900
  "span",
16137
17901
  { className: "dockm-foot-sw" },
16138
- import_react23.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
16139
- import_react23.default.createElement("button", {
17902
+ import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
17903
+ import_react24.default.createElement("button", {
16140
17904
  type: "button",
16141
17905
  className: "dock-sw" + (chipShown(mod.id) ? " on" : ""),
16142
17906
  role: "switch",
@@ -16154,12 +17918,12 @@ function DockWorkspace() {
16154
17918
  );
16155
17919
  }
16156
17920
  function DockModal() {
16157
- const [nav, setNav] = import_react23.default.useState({ open: panelNav.open });
16158
- import_react23.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open })), []);
17921
+ const [nav, setNav] = import_react24.default.useState({ open: panelNav.open });
17922
+ import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open })), []);
16159
17923
  const open = nav.open || typeof document === "undefined";
16160
- const [win, setWin] = import_react23.default.useState(() => ({ mode: "normal", x: null, y: null, w: null, h: null }));
16161
- const dlgRef = import_react23.default.useRef(null);
16162
- import_react23.default.useEffect(() => {
17924
+ const [win, setWin] = import_react24.default.useState(() => ({ mode: "normal", x: null, y: null, w: null, h: null }));
17925
+ const dlgRef = import_react24.default.useRef(null);
17926
+ import_react24.default.useEffect(() => {
16163
17927
  if (lastGeom.w) setWin({ mode: "normal", x: lastGeom.x, y: lastGeom.y, w: lastGeom.w, h: lastGeom.h });
16164
17928
  }, []);
16165
17929
  function beginDrag(e, type) {
@@ -16199,10 +17963,10 @@ function DockModal() {
16199
17963
  width: win.w != null ? win.w : void 0,
16200
17964
  height: win.mode === "min" ? "auto" : win.h != null ? win.h : void 0
16201
17965
  } : null;
16202
- return import_react23.default.createElement(
17966
+ return import_react24.default.createElement(
16203
17967
  "div",
16204
17968
  { className: "dockm-backdrop", onClick: () => setPanelOpen(false) },
16205
- import_react23.default.createElement(
17969
+ import_react24.default.createElement(
16206
17970
  "div",
16207
17971
  {
16208
17972
  className: "dockm-dialog" + (win.mode === "max" ? " dockm-max" : "") + (win.mode === "min" ? " dockm-min" : ""),
@@ -16210,59 +17974,59 @@ function DockModal() {
16210
17974
  ref: dlgRef,
16211
17975
  onClick: (e) => e.stopPropagation()
16212
17976
  },
16213
- import_react23.default.createElement(
17977
+ import_react24.default.createElement(
16214
17978
  "div",
16215
17979
  {
16216
17980
  className: "dockm-head",
16217
17981
  onPointerDown: (e) => beginDrag(e, "move"),
16218
17982
  onDoubleClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
16219
17983
  },
16220
- import_react23.default.createElement(DockIcon, null),
16221
- import_react23.default.createElement("span", { className: "dockm-title" }, "\u529F\u80FD\u575E"),
16222
- import_react23.default.createElement("span", { className: "dockm-sub" }, "dsh-dock \xB7 \u4E5F\u53EF\u5728 \u8BBE\u7F6E \u2192 \u529F\u80FD\u575E \u6253\u5F00\u7BA1\u7406\u9875"),
16223
- import_react23.default.createElement(
17984
+ import_react24.default.createElement(DockIcon, null),
17985
+ import_react24.default.createElement("span", { className: "dockm-title" }, "\u529F\u80FD\u575E"),
17986
+ import_react24.default.createElement("span", { className: "dockm-sub" }, "dsh-dock \xB7 \u4E5F\u53EF\u5728 \u8BBE\u7F6E \u2192 \u529F\u80FD\u575E \u6253\u5F00\u7BA1\u7406\u9875"),
17987
+ import_react24.default.createElement(
16224
17988
  "span",
16225
17989
  { className: "dockm-ctrls" },
16226
- import_react23.default.createElement("button", {
17990
+ import_react24.default.createElement("button", {
16227
17991
  type: "button",
16228
17992
  className: "dockm-win",
16229
17993
  title: win.mode === "min" ? "\u8FD8\u539F" : "\u6700\u5C0F\u5316",
16230
17994
  onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "min" ? "normal" : "min" }))
16231
17995
  }, "\u2581"),
16232
- import_react23.default.createElement("button", {
17996
+ import_react24.default.createElement("button", {
16233
17997
  type: "button",
16234
17998
  className: "dockm-win",
16235
17999
  title: win.mode === "max" ? "\u8FD8\u539F" : "\u6700\u5927\u5316",
16236
18000
  onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
16237
18001
  }, win.mode === "max" ? "\u2750" : "\u25A2"),
16238
- import_react23.default.createElement("button", { type: "button", className: "dockm-close", "aria-label": "\u5173\u95ED", title: "\u5173\u95ED", onClick: () => setPanelOpen(false) }, "\u2715")
18002
+ import_react24.default.createElement("button", { type: "button", className: "dockm-close", "aria-label": "\u5173\u95ED", title: "\u5173\u95ED", onClick: () => setPanelOpen(false) }, "\u2715")
16239
18003
  )
16240
18004
  ),
16241
- import_react23.default.createElement(DockWorkspace, null),
16242
- win.mode === "normal" ? import_react23.default.createElement("div", { className: "dockm-resize", onPointerDown: (e) => beginDrag(e, "size") }) : null
18005
+ import_react24.default.createElement(DockWorkspace, null),
18006
+ win.mode === "normal" ? import_react24.default.createElement("div", { className: "dockm-resize", onPointerDown: (e) => beginDrag(e, "size") }) : null
16243
18007
  )
16244
18008
  );
16245
18009
  }
16246
18010
  function HomeView(props) {
16247
18011
  const ctx = props && props.ctx;
16248
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
18012
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
16249
18013
  useExternalVersion();
16250
18014
  const open = (id) => {
16251
18015
  if (props && typeof props.onOpen === "function") props.onOpen(id);
16252
18016
  };
16253
- return import_react23.default.createElement(
18017
+ return import_react24.default.createElement(
16254
18018
  "div",
16255
18019
  { className: "dockh-grid" },
16256
18020
  allModules().map((m) => {
16257
18021
  const st = stateOf(m.id);
16258
18022
  const enabled = !!(st && st.enabled);
16259
18023
  const Stat = m.HomeStat;
16260
- const statNode = m.planned ? import_react23.default.createElement("span", null, PLANNED_NOTES[m.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : enabled && Stat ? import_react23.default.createElement(
18024
+ const statNode = m.planned ? import_react24.default.createElement("span", null, PLANNED_NOTES[m.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : enabled && Stat ? import_react24.default.createElement(
16261
18025
  FeatureBoundary,
16262
18026
  { key: m.id, label: m.name },
16263
- import_react23.default.createElement(Stat, { ctx })
16264
- ) : import_react23.default.createElement("span", null, "\u5DF2\u505C\u7528\uFF0C\u542F\u7528\u540E\u5728\u6B64\u5C55\u793A\u8FD0\u884C\u6982\u8981");
16265
- return import_react23.default.createElement(
18027
+ import_react24.default.createElement(Stat, { ctx })
18028
+ ) : import_react24.default.createElement("span", null, "\u5DF2\u505C\u7528\uFF0C\u542F\u7528\u540E\u5728\u6B64\u5C55\u793A\u8FD0\u884C\u6982\u8981");
18029
+ return import_react24.default.createElement(
16266
18030
  "div",
16267
18031
  {
16268
18032
  key: m.id,
@@ -16277,21 +18041,21 @@ function HomeView(props) {
16277
18041
  }
16278
18042
  }
16279
18043
  },
16280
- import_react23.default.createElement(
18044
+ import_react24.default.createElement(
16281
18045
  "div",
16282
18046
  { className: "dockh-head" },
16283
- import_react23.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
16284
- import_react23.default.createElement("span", { className: "dockh-name" }, m.name),
16285
- m.external ? import_react23.default.createElement("span", { className: "dockh-badge", title: m.package || void 0 }, "\u5916\u90E8") : null,
18047
+ import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
18048
+ import_react24.default.createElement("span", { className: "dockh-name" }, m.name),
18049
+ m.external ? import_react24.default.createElement("span", { className: "dockh-badge", title: m.package || void 0 }, "\u5916\u90E8") : null,
16286
18050
  // 状态标识:圆点 + 文字(纯展示,与开关视觉区分)
16287
- import_react23.default.createElement(
18051
+ import_react24.default.createElement(
16288
18052
  "span",
16289
18053
  { className: "dockh-status" + (m.planned ? " plan" : enabled ? "" : " off") },
16290
- import_react23.default.createElement("span", { className: "dockh-sdot" }),
16291
- import_react23.default.createElement("span", null, m.planned ? "\u89C4\u5212\u4E2D" : enabled ? "\u8FD0\u884C\u4E2D" : "\u5DF2\u505C\u7528")
18054
+ import_react24.default.createElement("span", { className: "dockh-sdot" }),
18055
+ import_react24.default.createElement("span", null, m.planned ? "\u89C4\u5212\u4E2D" : enabled ? "\u8FD0\u884C\u4E2D" : "\u5DF2\u505C\u7528")
16292
18056
  ),
16293
18057
  // 启停开关(规划中的功能不显示)
16294
- m.planned ? null : import_react23.default.createElement("button", {
18058
+ m.planned ? null : import_react24.default.createElement("button", {
16295
18059
  type: "button",
16296
18060
  className: "dock-sw" + (enabled ? " on" : ""),
16297
18061
  role: "switch",
@@ -16306,12 +18070,12 @@ function HomeView(props) {
16306
18070
  }
16307
18071
  })
16308
18072
  ),
16309
- import_react23.default.createElement("div", { className: "dockh-desc" }, m.description),
16310
- import_react23.default.createElement("div", { className: "dockh-stat" }, statNode),
16311
- import_react23.default.createElement(
18073
+ import_react24.default.createElement("div", { className: "dockh-desc" }, m.description),
18074
+ import_react24.default.createElement("div", { className: "dockh-stat" }, statNode),
18075
+ import_react24.default.createElement(
16312
18076
  "div",
16313
18077
  { className: "dockh-foot" },
16314
- import_react23.default.createElement("span", { className: "dockh-go" }, "\u67E5\u770B\u8BE6\u60C5 \u2192")
18078
+ import_react24.default.createElement("span", { className: "dockh-go" }, "\u67E5\u770B\u8BE6\u60C5 \u2192")
16315
18079
  )
16316
18080
  );
16317
18081
  })
@@ -16319,16 +18083,16 @@ function HomeView(props) {
16319
18083
  }
16320
18084
  function DockPanel(props) {
16321
18085
  const ctx = ctxRef.current;
16322
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
18086
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
16323
18087
  useExternalVersion();
16324
18088
  const toggle = (id) => {
16325
18089
  toggleFeature(id);
16326
18090
  force();
16327
18091
  };
16328
- return import_react23.default.createElement(
18092
+ return import_react24.default.createElement(
16329
18093
  "div",
16330
18094
  { className: "dock-root" },
16331
- import_react23.default.createElement(
18095
+ import_react24.default.createElement(
16332
18096
  "div",
16333
18097
  { className: "dock-intro" },
16334
18098
  "\u529F\u80FD\u575E\uFF08dsh-dock\uFF09\xB7 \u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u4E00\u4E2A\u9762\u677F\u91CC\u7BA1\u7406\u3002v0.4.0 \u8D77\u6BCF\u4E2A\u529F\u80FD\u662F\u72EC\u7ACB\u6A21\u5757\uFF08features/<id>/\uFF09\uFF0C",
@@ -16337,25 +18101,25 @@ function DockPanel(props) {
16337
18101
  allModules().map((f) => {
16338
18102
  const st = stateOf(f.id);
16339
18103
  const View = f.View;
16340
- const viewNode = !f.planned && st.enabled && View ? import_react23.default.createElement(
18104
+ const viewNode = !f.planned && st.enabled && View ? import_react24.default.createElement(
16341
18105
  "div",
16342
18106
  { className: "dock-body" },
16343
- import_react23.default.createElement(
18107
+ import_react24.default.createElement(
16344
18108
  FeatureBoundary,
16345
18109
  { key: f.id, label: f.name },
16346
- import_react23.default.createElement(View, { ctx, feature: f, params: props && props.params })
18110
+ import_react24.default.createElement(View, { ctx, feature: f, params: props && props.params })
16347
18111
  )
16348
18112
  ) : null;
16349
- return import_react23.default.createElement(
18113
+ return import_react24.default.createElement(
16350
18114
  "div",
16351
18115
  { className: "dock-card", key: f.id },
16352
- import_react23.default.createElement(
18116
+ import_react24.default.createElement(
16353
18117
  "div",
16354
18118
  { className: "dock-card-head" },
16355
- import_react23.default.createElement("span", { className: "dock-dot" + (st.error ? " err" : st.enabled ? " on" : "") }),
16356
- import_react23.default.createElement("span", { className: "dock-name" }, f.name),
16357
- import_react23.default.createElement("span", { className: "dock-desc" }, f.description + (f.external ? "\uFF08\u6765\u81EA\u5916\u90E8\u5305" + (f.package ? " " + f.package : "") + "\uFF09" : "")),
16358
- f.planned ? import_react23.default.createElement("span", { className: "dock-badge" }, "\u89C4\u5212\u4E2D") : import_react23.default.createElement("button", {
18119
+ import_react24.default.createElement("span", { className: "dock-dot" + (st.error ? " err" : st.enabled ? " on" : "") }),
18120
+ import_react24.default.createElement("span", { className: "dock-name" }, f.name),
18121
+ import_react24.default.createElement("span", { className: "dock-desc" }, f.description + (f.external ? "\uFF08\u6765\u81EA\u5916\u90E8\u5305" + (f.package ? " " + f.package : "") + "\uFF09" : "")),
18122
+ f.planned ? import_react24.default.createElement("span", { className: "dock-badge" }, "\u89C4\u5212\u4E2D") : import_react24.default.createElement("button", {
16359
18123
  type: "button",
16360
18124
  className: "dock-sw" + (st.enabled ? " on" : ""),
16361
18125
  role: "switch",
@@ -16364,11 +18128,11 @@ function DockPanel(props) {
16364
18128
  title: st.enabled ? "\u505C\u7528\u300C" + f.name + "\u300D" : "\u542F\u7528\u300C" + f.name + "\u300D",
16365
18129
  onClick: () => toggle(f.id)
16366
18130
  }),
16367
- !f.planned && typeof f.Chip === "function" ? import_react23.default.createElement(
18131
+ !f.planned && typeof f.Chip === "function" ? import_react24.default.createElement(
16368
18132
  "span",
16369
18133
  { className: "dockm-foot-sw" },
16370
- import_react23.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(f.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
16371
- import_react23.default.createElement("button", {
18134
+ import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(f.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
18135
+ import_react24.default.createElement("button", {
16372
18136
  type: "button",
16373
18137
  className: "dock-sw" + (chipShown(f.id) ? " on" : ""),
16374
18138
  role: "switch",
@@ -16382,7 +18146,7 @@ function DockPanel(props) {
16382
18146
  })
16383
18147
  ) : null
16384
18148
  ),
16385
- f.planned ? import_react23.default.createElement("div", { className: "dock-body" }, PLANNED_NOTES[f.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st.error ? import_react23.default.createElement("div", { className: "dock-body dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : null,
18149
+ f.planned ? import_react24.default.createElement("div", { className: "dock-body" }, PLANNED_NOTES[f.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st.error ? import_react24.default.createElement("div", { className: "dock-body dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : null,
16386
18150
  viewNode
16387
18151
  );
16388
18152
  })
@@ -16390,7 +18154,7 @@ function DockPanel(props) {
16390
18154
  }
16391
18155
  function DockPage() {
16392
18156
  const ctx = ctxRef.current;
16393
- const [wide, setWide] = import_react23.default.useState(false);
18157
+ const [wide, setWide] = import_react24.default.useState(false);
16394
18158
  const toggleWide = () => {
16395
18159
  try {
16396
18160
  const layout = ctx && typeof ctx.get === "function" ? ctx.get("layout") : null;
@@ -16401,20 +18165,20 @@ function DockPage() {
16401
18165
  } catch (e) {
16402
18166
  }
16403
18167
  };
16404
- return import_react23.default.createElement(
18168
+ return import_react24.default.createElement(
16405
18169
  "div",
16406
18170
  { className: "dockm-page" + (wide ? " dockm-page-wide" : "") },
16407
- import_react23.default.createElement(
18171
+ import_react24.default.createElement(
16408
18172
  "div",
16409
18173
  { className: "dockm-page-head" },
16410
- import_react23.default.createElement("span", { className: "dockm-page-icon" }, import_react23.default.createElement(DockIcon, { size: 20 })),
16411
- import_react23.default.createElement(
18174
+ import_react24.default.createElement("span", { className: "dockm-page-icon" }, import_react24.default.createElement(DockIcon, { size: 20 })),
18175
+ import_react24.default.createElement(
16412
18176
  "div",
16413
18177
  { className: "dockm-page-titles" },
16414
- import_react23.default.createElement("div", { className: "dockm-page-title" }, "\u529F\u80FD\u575E"),
16415
- import_react23.default.createElement("div", { className: "dockm-page-sub" }, "\u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u91CC\u7BA1\u7406\u3002\u4FA7\u680F\u56FE\u6807\u53EF\u5728\u300C\u66F4\u591A\u300D\u83DC\u5355\u91CC Pin \u5230\u9876\u90E8\uFF0C\u6216\u53D6\u6D88\u56FA\u5B9A\u6536\u8FDB\u66F4\u591A\u3002")
18178
+ import_react24.default.createElement("div", { className: "dockm-page-title" }, "\u529F\u80FD\u575E"),
18179
+ import_react24.default.createElement("div", { className: "dockm-page-sub" }, "\u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u91CC\u7BA1\u7406\u3002\u4FA7\u680F\u56FE\u6807\u53EF\u5728\u300C\u66F4\u591A\u300D\u83DC\u5355\u91CC Pin \u5230\u9876\u90E8\uFF0C\u6216\u53D6\u6D88\u56FA\u5B9A\u6536\u8FDB\u66F4\u591A\u3002")
16416
18180
  ),
16417
- import_react23.default.createElement("button", {
18181
+ import_react24.default.createElement("button", {
16418
18182
  type: "button",
16419
18183
  className: "dockm-page-wide-btn",
16420
18184
  title: wide ? "\u8FD8\u539F\u4FA7\u680F\u5BBD\u5EA6" : "\u6536\u8D77\u5DE6\u4FA7\u680F\uFF0C\u5168\u5C4F\u663E\u793A\u529F\u80FD\u575E",
@@ -16422,19 +18186,19 @@ function DockPage() {
16422
18186
  onClick: toggleWide
16423
18187
  }, wide ? "\u2750 \u8FD8\u539F" : "\u25A2 \u5168\u5C4F")
16424
18188
  ),
16425
- import_react23.default.createElement("div", { className: "dockm-page-body" }, import_react23.default.createElement(DockWorkspace, null))
18189
+ import_react24.default.createElement("div", { className: "dockm-page-body" }, import_react24.default.createElement(DockWorkspace, null))
16426
18190
  );
16427
18191
  }
16428
18192
  function DockChips(props) {
16429
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
16430
- import_react23.default.useEffect(() => subscribeFeatureState(() => force()), []);
18193
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
18194
+ import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
16431
18195
  const items = [];
16432
18196
  for (const f of allModules()) {
16433
18197
  if (f.planned || !stateOf(f.id).enabled || !chipShown(f.id) || typeof f.Chip !== "function") continue;
16434
- items.push(import_react23.default.createElement(
18198
+ items.push(import_react24.default.createElement(
16435
18199
  FeatureBoundary,
16436
18200
  { key: f.id, label: f.name },
16437
- import_react23.default.createElement(f.Chip, {
18201
+ import_react24.default.createElement(f.Chip, {
16438
18202
  ctx: props.ctx,
16439
18203
  feature: f,
16440
18204
  session: props.session,
@@ -16444,38 +18208,38 @@ function DockChips(props) {
16444
18208
  ));
16445
18209
  }
16446
18210
  if (items.length === 0) return null;
16447
- return import_react23.default.createElement("div", { className: "dockchip-row" }, items);
18211
+ return import_react24.default.createElement("div", { className: "dockchip-row" }, items);
16448
18212
  }
16449
18213
  function FeatureOverlays() {
16450
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
18214
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
16451
18215
  useExternalVersion();
16452
- import_react23.default.useEffect(() => subscribeFeatureState(() => force()), []);
18216
+ import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
16453
18217
  const items = [];
16454
18218
  for (const f of allModules()) {
16455
18219
  if (f.planned || !stateOf(f.id).enabled || typeof f.Overlay !== "function") continue;
16456
- items.push(import_react23.default.createElement(
18220
+ items.push(import_react24.default.createElement(
16457
18221
  FeatureBoundary,
16458
18222
  { key: f.id, label: f.name },
16459
- import_react23.default.createElement(f.Overlay, { ctx: ctxRef.current, feature: f })
18223
+ import_react24.default.createElement(f.Overlay, { ctx: ctxRef.current, feature: f })
16460
18224
  ));
16461
18225
  }
16462
18226
  if (items.length === 0) return null;
16463
- return import_react23.default.createElement(import_react23.default.Fragment, null, items);
18227
+ return import_react24.default.createElement(import_react24.default.Fragment, null, items);
16464
18228
  }
16465
18229
  function FeatureTurnTail(props) {
16466
- const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
16467
- import_react23.default.useEffect(() => subscribeFeatureState(() => force()), []);
18230
+ const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
18231
+ import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
16468
18232
  const items = [];
16469
18233
  for (const f of allModules()) {
16470
18234
  if (f.planned || !stateOf(f.id).enabled || typeof f.TurnTail !== "function") continue;
16471
- items.push(import_react23.default.createElement(
18235
+ items.push(import_react24.default.createElement(
16472
18236
  FeatureBoundary,
16473
18237
  { key: f.id, label: f.name },
16474
- import_react23.default.createElement(f.TurnTail, Object.assign({}, props, { ctx: ctxRef.current, feature: f }))
18238
+ import_react24.default.createElement(f.TurnTail, Object.assign({}, props, { ctx: ctxRef.current, feature: f }))
16475
18239
  ));
16476
18240
  }
16477
18241
  if (items.length === 0) return null;
16478
- return import_react23.default.createElement(import_react23.default.Fragment, null, items);
18242
+ return import_react24.default.createElement(import_react24.default.Fragment, null, items);
16479
18243
  }
16480
18244
  var ctxRef = { current: null };
16481
18245
  function apply(ctx) {
@@ -16486,33 +18250,34 @@ function apply(ctx) {
16486
18250
  if (slots === void 0) return;
16487
18251
  slots.inject("sidebar.panellist", () => slots.register(
16488
18252
  { name: "sidebar.panellist", id: "dsh-dock", order: 30, label: "\u529F\u80FD\u575E" },
16489
- (props) => import_react23.default.createElement(DockIcon, { size: props && props.size || 18 })
18253
+ (props) => import_react24.default.createElement(DockIcon, { size: props && props.size || 18 })
16490
18254
  ));
16491
18255
  slots.inject("main", () => slots.register(
16492
18256
  { name: "main", key: "dsh-dock", label: "\u529F\u80FD\u575E" },
16493
- () => import_react23.default.createElement(DockPage, null)
18257
+ () => import_react24.default.createElement(DockPage, null)
16494
18258
  ));
16495
18259
  slots.inject("shell.overlay", () => slots.register(
16496
18260
  { name: "shell.overlay", id: "dsh-dock-panel", order: 21, label: "\u529F\u80FD\u575E\u9762\u677F" },
16497
- () => import_react23.default.createElement(DockModal, null)
18261
+ () => import_react24.default.createElement(DockModal, null)
16498
18262
  ));
16499
18263
  slots.inject("shell.overlay", () => slots.register(
16500
18264
  { name: "shell.overlay", id: "dsh-dock-feature-overlays", order: 22, label: "\u529F\u80FD\u575E\u5168\u5C40\u6D6E\u5C42" },
16501
- () => import_react23.default.createElement(FeatureOverlays, null)
18265
+ () => import_react24.default.createElement(FeatureOverlays, null)
16502
18266
  ));
16503
18267
  slots.inject("settings.section", () => slots.register(
16504
18268
  { name: "settings.section", id: "dsh-dock", order: 90, label: "\u529F\u80FD\u575E" },
16505
- (props) => import_react23.default.createElement(DockPanel, props)
18269
+ (props) => import_react24.default.createElement(DockPanel, props)
16506
18270
  ));
16507
18271
  slots.inject("conversation.input.left", () => slots.register(
16508
18272
  { name: "conversation.input.left", id: "dsh-dock-chips", order: 10, label: "\u529F\u80FD\u575E" },
16509
- (zone) => import_react23.default.createElement(DockChips, Object.assign({}, zone, { ctx: ctxRef.current }))
18273
+ (zone) => import_react24.default.createElement(DockChips, Object.assign({}, zone, { ctx: ctxRef.current }))
16510
18274
  ));
16511
18275
  slots.inject("conversation.chat.turnTail", () => slots.register(
16512
18276
  { name: "conversation.chat.turnTail", id: "dsh-dock-turn-tail", order: 40, label: "\u529F\u80FD\u575E" },
16513
- (owner) => import_react23.default.createElement(FeatureTurnTail, owner)
18277
+ (owner) => import_react24.default.createElement(FeatureTurnTail, owner)
16514
18278
  ));
16515
18279
  installClient(ctx);
18280
+ installClient2(ctx);
16516
18281
  }
16517
18282
  var inject = ["timer"];
16518
18283