@xbzbing/dsh-git-panel 1.6.2 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  window.__ModuleLoader__.load({ id: "@xbzbing/dsh-git-panel", factory: (require) => {
2
2
  var module = { exports: {} }; var exports = module.exports;
3
- "use strict";var Sn=require("react");var ti=`
3
+ "use strict";var wr=require("react");var zo=`
4
4
  .gp-panel{display:flex;flex-direction:column;height:100%;min-height:0;color:var(--dsw-alias-label-primary);font-size:13px;position:relative;
5
5
  /* One selection language across the three list panes (Overview commits,
6
6
  * Changes rows, Files tree): primary-tinted fill + a 3px inset left bar. */
@@ -8,7 +8,7 @@ var module = { exports: {} }; var exports = module.exports;
8
8
  --gp-select-bar:inset 3px 0 0 var(--dsw-alias-state-business-primary)}
9
9
  .gp-panel[data-font-delta="1"]{zoom:1.08;font-size:14px}
10
10
  .gp-panel[data-font-delta="-1"]{zoom:.92;font-size:12px}
11
- .gp-tabbar{display:flex;align-items:center;gap:4px;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;flex-wrap:nowrap;min-width:0;container-type:inline-size}
11
+ .gp-tabbar{display:flex;align-items:center;gap:4px;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;flex-wrap:nowrap;min-width:0}
12
12
  /* The shell floats the input composer over the view's bottom (composer-overlay
13
13
  * mode). Reserve that height as bottom padding so the panel's own bottom rows
14
14
  * (commit box / commit comment) stay above it instead of being covered. */
@@ -30,34 +30,56 @@ var module = { exports: {} }; var exports = module.exports;
30
30
  /* star link: hollow by default, fills to a gold star on hover */
31
31
  .gp-verbar__gh--starred:hover{color:var(--dsw-alias-state-warn-primary,#e3b341)}
32
32
  .gp-verbar__gh--starred:hover svg{fill:currentColor}
33
- .gp-tab{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;cursor:pointer;flex:none;transition:background .12s ease,color .12s ease}
34
- .gp-tab:hover{background:var(--dsw-alias-interactive-bg-hover)}
35
- /* Active tab: primary-tinted fill + primary text + medium weight + a soft ring.
36
- * Clear enough to spot at a glance, restrained enough not to shout. */
37
- .gp-tab--active{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent);color:var(--dsw-alias-state-business-primary);font-weight:600;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--dsw-alias-state-business-primary) 32%,transparent)}
38
- .gp-tab__icon{display:inline-flex;width:15px;height:15px;flex:none}
33
+ /* The sub-tab switcher is the platform SegmentedTabs primitive (official track,
34
+ * pill and sliding indicator). We only place the tab list in our flex bar and
35
+ * supply the icon/label spans inside each tab's label. */
36
+ .gp-tabbar__tabs{flex:0 1 auto;min-width:0}
37
+ .gp-tab__icon{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;flex:none}
39
38
  .gp-tab__label{white-space:nowrap}
40
39
  /* Trailing cluster (font stepper + version bar). display:contents makes it
41
40
  * transparent to the tab-bar flex in the wide layout \u2014 font sits after the
42
41
  * tabs, version bar floats right via its own margin-left:auto \u2014 identical to a
43
- * flat layout. The compact layout re-materializes it as a wrapped second row. */
42
+ * flat layout. The compact layout re-materializes it as a single trailing item. */
44
43
  .gp-tabbar__trailing{display:contents}
45
- /* Responsive tab bar (the bar is an inline-size container): a very narrow panel
46
- * drops the tab labels to icon-only so they never wrap into a garbled multi-line
47
- * state. Hiding the trailing controls is handled by the compact layout (which
48
- * moves them to a second row) rather than removing them. */
49
- @container (max-width:300px){.gp-tab__label{display:none}.gp-tab{gap:0;padding:0 10px}}
50
44
  .gp-font{margin-left:4px;display:inline-flex;align-items:center;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;overflow:hidden}
51
45
  .gp-font button{border:0;border-left:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;line-height:22px;width:24px;height:24px;padding:0;cursor:pointer}
52
46
  .gp-font button:first-child{border-left:0}
53
47
  .gp-font button:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
48
+ /* The current step is stored as aria-pressed, so the selected cell needs no
49
+ * parallel class: it keeps the filled background even while hovered. */
50
+ .gp-font button[aria-pressed="true"]{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-primary);font-weight:600}
54
51
  .gp-font button:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
55
52
  .gp-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;height:100%;color:var(--dsw-alias-label-tertiary);font-size:12px;padding:24px;text-align:center}
56
53
  .gp-files-wrap{display:flex;flex-direction:column;width:100%;height:100%;min-height:0}
57
54
  .gp-files-wrap>.gp-files{flex:1;min-height:0;height:auto}
58
55
  .gp-notice{flex:none;padding:8px 14px;font-size:12px;line-height:1.5;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);border-bottom:1px solid var(--dsw-alias-border-l2)}
59
56
  .gp-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:6px 8px;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none}
60
- .gp-btn{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;cursor:pointer}
57
+ .gp-changes__toolbar{flex-wrap:nowrap;gap:4px;overflow-x:auto}
58
+ .gp-changes__toolbar .gp-icon-btn{flex:none}
59
+ /* Compact history toolbar: one control height across the branch pill, the
60
+ * search input, the select triggers and the icon buttons (the touch media query
61
+ * used to leave only .gp-btn at 36px, so the branch pill towered over its row).
62
+ * The author / since / refresh group starts collapsed behind a chevron. */
63
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-btn,
64
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-search,
65
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-select-trigger{height:30px}
66
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-select-trigger{min-height:30px}
67
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-icon-btn{width:30px;height:30px}
68
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-btn{flex:none;max-width:55%;min-width:0;gap:5px}
69
+ .gp-btn__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
70
+ /* Square 30px chevron button: the scoped selector keeps the 30px box and zero
71
+ * padding ahead of the later, equally specific gp-btn base rule. */
72
+ .gp-toolbar .gp-toolbar__more-toggle{flex:none;width:30px;box-sizing:border-box;padding:0;justify-content:center}
73
+ .gp-toolbar__chev{display:inline-flex;transition:transform .12s ease}
74
+ .gp-toolbar__chev--up{transform:rotate(180deg)}
75
+ .gp-toolbar__more{flex:1 1 100%;display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0}
76
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-toolbar__more .gp-filter{flex:1 1 0;min-width:0;max-width:calc(50% - 23px)}
77
+ .gp-changes__toolbar .gp-icon-btn:disabled{opacity:.4;cursor:default}
78
+ .gp-changes__toolbar .gp-icon-btn:hover:disabled{background:transparent}
79
+ .gp-changes__toolbar .gp-icon-btn:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
80
+ .gp-changes__toolbar .gp-icon-btn>span{display:inline-flex}
81
+ .gp-changes__refresh--busy svg{animation:gp-spin 1s linear infinite}
82
+ .gp-btn{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;white-space:nowrap;cursor:pointer}
61
83
  .gp-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
62
84
  .gp-btn:disabled{opacity:.5;cursor:default}
63
85
  .gp-btn--primary{border-color:transparent;background:var(--dsw-alias-state-business-primary);color:#fff}
@@ -83,16 +105,28 @@ var module = { exports: {} }; var exports = module.exports;
83
105
  /* branch list */
84
106
  .gp-branch-group{padding:2px 0}
85
107
  .gp-branch-group__head{display:flex;align-items:center;gap:6px;padding:4px 10px;font-size:11px;color:var(--dsw-alias-label-tertiary);cursor:pointer;user-select:none}
86
- .gp-branch-row{display:flex;align-items:center;gap:6px;padding:4px 10px 4px 22px;cursor:pointer;border-radius:6px;font-size:12px;color:var(--dsw-alias-label-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
108
+ /* Left corners stay square so the row highlight (and its inset accent bar)
109
+ * sits flush against the panel edge; only the right end is rounded. */
110
+ .gp-branch-row{display:flex;align-items:center;gap:6px;padding:4px 10px 4px 22px;cursor:pointer;border-radius:0 6px 6px 0;font-size:12px;color:var(--dsw-alias-label-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
87
111
  .gp-branch-row:hover{background:var(--dsw-alias-interactive-bg-hover)}
88
112
  .gp-branch-row--active,.gp-branch-row--active:hover{color:var(--dsw-alias-state-business-primary);background:var(--gp-select-bg);box-shadow:var(--gp-select-bar)}
89
- .gp-branch-row--current{color:var(--dsw-alias-state-warn-primary,var(--dsw-alias-state-business-primary))}
90
- .gp-branch-row__track{margin-left:auto;font-size:10px;color:var(--dsw-alias-label-tertiary)}
113
+ .gp-branch-row--current .gp-tree-name{font-weight:600}
114
+ .gp-branch-row__ic--current,.gp-branch-row__ic--primary{color:var(--dsw-alias-state-warn-primary,var(--dsw-alias-state-business-primary))}
115
+ .gp-branch-row__track{display:inline-flex;align-items:center;gap:7px;flex:none;margin-left:auto;font-size:11px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--dsw-alias-state-business-primary)}
116
+ .gp-branch-row__sync{display:inline-flex;align-items:center;gap:2px;white-space:nowrap}
117
+ .gp-branch-row__sync-icon{flex:none}
91
118
  .gp-branch-row__switch{display:none;flex:none;margin:-2px 0 -2px auto;padding:0 7px;height:18px;border:1px solid var(--dsw-alias-border-l2);border-radius:5px;background:var(--dsw-alias-bg-layer-1);font:inherit;font-size:11px;line-height:16px;color:var(--dsw-alias-label-secondary);cursor:pointer}
92
119
  .gp-branch-row__track+.gp-branch-row__switch{margin-left:0}
93
120
  .gp-branch-row:hover .gp-branch-row__switch{display:inline-block}
94
121
  .gp-branch-row__switch:hover{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary)}
95
122
  .gp-branch-row__switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}
123
+ /* Refs sharing a '/'-prefix fold into a collapsible directory row: the chevron
124
+ * keeps its own column and the folder glyph shares the 14px icon box, so a dir
125
+ * label lines up with the leaf labels of the same level. */
126
+ .gp-branch-row__chev{display:inline-flex;flex:none;width:11px;align-items:center;justify-content:center}
127
+ .gp-branch-row__ic{display:inline-flex;flex:none;width:14px;align-items:center;justify-content:center}
128
+ .gp-branch-row--dir{color:var(--dsw-alias-label-secondary)}
129
+ .gp-branch-row--dir .gp-tree-name{font-weight:600}
96
130
 
97
131
  /* left-column footer status bar: repo icon (left) + branch sync (right) */
98
132
  .gp-statusbar{flex:none;display:flex;align-items:center;gap:8px;min-height:30px;padding:4px 8px;border-top:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);font-size:11px}
@@ -128,9 +162,20 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
128
162
  .gp-ref-chip--head{background:var(--dsw-alias-state-business-primary);color:#fff;border-color:transparent;font-weight:700;font-size:11px}
129
163
  .gp-graph-cell{position:relative}
130
164
  .gp-graph-svg{display:block}
165
+ .gp-graph-edge,.gp-graph-boundary{vector-effect:non-scaling-stroke}
166
+ .gp-graph-boundary{opacity:.8}
131
167
  .gp-search{flex:1;min-width:60px;height:28px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;padding:0 10px;box-sizing:border-box}
132
168
  .gp-search:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
133
- .gp-select{height:28px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;padding:0 6px}
169
+ /* Filter dropdowns are the platform Menu: the wrapper is the Menu's own anchor
170
+ * span (inline-flex, so it still lays out as a toolbar item), and the trigger
171
+ * uses the same module background as the shell's settings selectors. */
172
+ .gp-filter{display:inline-flex;align-items:center;min-width:0;max-width:100%}
173
+ .gp-select-trigger{display:inline-flex;align-items:center;gap:4px;min-height:28px;max-width:180px;padding:0 8px;border:none;border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:500;line-height:20px;white-space:nowrap;cursor:pointer}
174
+ .gp-select-trigger:not(:disabled):hover,.gp-select-trigger[aria-expanded="true"]{background:var(--dsw-alias-interactive-bg-hover)}
175
+ .gp-select-trigger:disabled{cursor:default;color:var(--dsw-alias-label-quaternary)}
176
+ .gp-select-trigger:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
177
+ .gp-select-trigger__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
178
+ .gp-select-trigger__chevron{flex:none;color:var(--dsw-alias-label-caption)}
134
179
 
135
180
  /* commit detail (right pane): the changed-file tree and the commit message
136
181
  * split the column in half, each scrolling on its own. Equal halves keep the
@@ -150,12 +195,13 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
150
195
  .gp-tree-row--active{background:var(--dsw-alias-bg-layer-2)}
151
196
  .gp-tree-row--muted{color:var(--dsw-alias-label-tertiary);cursor:default}
152
197
  .gp-tree-row--muted:hover{background:transparent}
153
- .gp-tree-chev{flex:none;width:11px;display:inline-flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-tertiary)}
154
- .gp-tree-ic{flex:none;display:inline-flex;align-items:center;color:var(--dsw-alias-label-tertiary)}
198
+ .gp-tree-ic{flex:none;display:inline-flex;align-items:center;color:var(--dsw-alias-label-secondary)}
155
199
  .gp-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
156
200
  .gp-tree-row--dir .gp-tree-name{font-weight:600}
157
201
  .gp-files__entry{width:100%;border:0;background:transparent;color:inherit;text-align:left;font:inherit}
158
- .gp-files__entry--dir .gp-tree-name{font-weight:600}
202
+ /* Official file lists render directory names at the same weight as files; the
203
+ * open/closed folder glyph carries the expansion state. */
204
+ .gp-files__tree .gp-files__entry--dir .gp-tree-name{font-weight:500}
159
205
  .gp-files__entry:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
160
206
  .gp-files__entry.gp-tree-row--active,.gp-files__entry.gp-tree-row--active:hover{background:var(--gp-select-bg);box-shadow:var(--gp-select-bar)}
161
207
  .gp-files__entry.gp-tree-row--active .gp-tree-name{font-weight:600}
@@ -183,6 +229,14 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
183
229
  .gp-files__path{flex:1 1 120px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-secondary);font:inherit}
184
230
  .gp-files__copy-path{flex:none;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:4px 8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;font-size:12px}
185
231
  .gp-files__copy-path:hover{background:var(--dsw-alias-interactive-bg-hover)}
232
+ /* The path/content copy actions read as one joined button group: the shared
233
+ * border collapses (1px overlap) and only the outer corners stay rounded. */
234
+ .gp-files__copy-group{flex:none;display:flex;align-items:center}
235
+ .gp-files__copy-group .gp-files__copy-path{border-radius:0;margin-left:-1px}
236
+ .gp-files__copy-group .gp-files__copy-path:first-child{border-radius:6px 0 0 6px;margin-left:0}
237
+ .gp-files__copy-group .gp-files__copy-path:last-child{border-radius:0 6px 6px 0}
238
+ .gp-files__copy-group .gp-files__copy-path:only-child{border-radius:6px}
239
+ .gp-files__copy-group .gp-files__copy-path:hover,.gp-files__copy-group .gp-files__copy-path:focus-visible{position:relative;z-index:1}
186
240
  .gp-files__copy-path:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
187
241
  .gp-files__copy-path--error{color:var(--dsw-alias-state-error-primary)}
188
242
  /* Icon-only properties entry at the toolbar's far right. The path's flex-grow
@@ -192,10 +246,18 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
192
246
  .gp-files__props:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
193
247
  .gp-files__props:disabled{opacity:0.5;cursor:default}
194
248
  .gp-files__props:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
195
- .gp-files__mode{display:flex;gap:4px}
196
- .gp-files__mode-btn{border:0;border-radius:6px;padding:4px 10px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;font-size:12px}
197
- .gp-files__mode-btn--active{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font-weight:600}
198
- .gp-files__mode-btn:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
249
+ .gp-files__mode-seg{flex:none}
250
+ /* Compact preview toolbar: the relative path and the two copy buttons are gone
251
+ * (they forced three wrapped rows on a phone). Back + the official source/render
252
+ * control + fullscreen + properties share one row; longer locales wrap instead
253
+ * of squeezing the mode labels. */
254
+ .gp-files__bar--compact{padding:6px 8px}
255
+ .gp-files__bar--compact .gp-files__mode-seg{flex:1 1 auto;min-width:max-content}
256
+ .gp-files__bar--compact .gp-files__bar-end{flex:none;margin-left:auto;display:flex;align-items:center;gap:6px}
257
+ /* Trailing icon buttons match the 30px back button / mode control instead of
258
+ * their 24px inline size (4px padding + 14px glyph). */
259
+ .gp-panel[data-layout="compact"] .gp-files__bar-end .gp-files__props{height:30px;box-sizing:border-box;padding:0 6px}
260
+ .gp-files__bar--compact .gp-files__mode-seg button{padding:0 10px;font-size:12px}
199
261
  .gp-files__markdown{overflow:auto;overscroll-behavior:contain;padding:16px 24px;color:var(--dsw-alias-label-primary)}
200
262
  .gp-files__html{flex:1;min-height:0;width:100%;border:0;background:#fff}
201
263
  .gp-files__code{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;font-family:var(--dsw-font-mono,monospace);font-size:12px;position:relative}
@@ -235,6 +297,9 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
235
297
  .gp-changes__vrow>.gp-file-row,.gp-changes__vrow>.gp-group-head{height:100%;box-sizing:border-box}
236
298
  .gp-check{width:14px;height:14px;flex:none;cursor:pointer}
237
299
  .gp-group-head{display:flex;align-items:center;gap:6px;padding:5px 10px;font-size:11px;color:var(--dsw-alias-label-tertiary);cursor:pointer;user-select:none}
300
+ /* A group kept only for its count has nothing to collapse: no chevron, no hand. */
301
+ .gp-group-head--static{cursor:default}
302
+ .gp-group-head__chev-spacer{display:inline-block;width:12px;flex:none}
238
303
  .gp-file-row{display:flex;align-items:center;gap:8px;padding:4px 10px 4px 20px;cursor:pointer;font-size:12px;border-radius:4px}
239
304
  .gp-file-row:hover{background:var(--dsw-alias-interactive-bg-hover)}
240
305
  /* Selected change row: identical accent to the Git overview commit list
@@ -255,6 +320,12 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
255
320
  .gp-stats__del{color:var(--dsw-alias-state-error-primary)}
256
321
  /* "simplified" marker on a huge change set: muted + help cursor + dotted hint. */
257
322
  .gp-stats__partial{color:var(--dsw-alias-label-tertiary);cursor:help;text-decoration:underline dotted;text-underline-offset:2px}
323
+ /* Compact stats bar: the counts on one clipped, never-wrapping line. The
324
+ * timestamps are not rendered at all at this width (ChangeStats) \u2014 the bar must
325
+ * not cost a second row above the change list on a phone. */
326
+ .gp-stats--compact{padding:6px 8px 6px 12px;gap:4px 8px;align-items:center}
327
+ .gp-stats--compact .gp-stats__main{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:14px;overflow:hidden;white-space:nowrap}
328
+ .gp-stats--compact .gp-stats__main>.gp-stats__item{flex:none}
258
329
 
259
330
  /* commit box */
260
331
  .gp-commitbox{flex:none;border-top:1px solid var(--dsw-alias-border-l2);padding:8px 10px;display:flex;flex-direction:column;gap:8px}
@@ -265,9 +336,27 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
265
336
  .gp-commitbox__spin{position:absolute;top:8px;right:8px;width:13px;height:13px;box-sizing:border-box;border-radius:50%;border:2px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-state-business-primary);animation:gp-spin .7s linear infinite;pointer-events:none}
266
337
  .gp-commitbox__msg[readonly]{color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);cursor:progress}
267
338
  .gp-commitbox__msg:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
268
- .gp-commitbox__row{display:flex;align-items:center;gap:10px}
269
- .gp-commitbox__amend{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer}
270
- .gp-commitbox__actions{margin-left:auto;display:flex;gap:6px}
339
+ .gp-commitbox__row{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
340
+ .gp-commitbox__amend{display:inline-flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap;color:var(--dsw-alias-label-secondary);cursor:pointer}
341
+ /* Compact commit bar: stands in for the whole editor until tapped, so the
342
+ * change list keeps the panel's scarce height on a phone. */
343
+ .gp-commitbar{flex:none;border-top:1px solid var(--dsw-alias-border-l2);padding:4px 8px;display:flex;align-items:center;gap:6px}
344
+ .gp-commitbar__open{flex:1 1 auto;min-width:0;display:flex;align-items:center;height:30px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;text-align:left;cursor:text}
345
+ .gp-commitbar__open:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
346
+ .gp-commitbar__ph,.gp-commitbar__draft{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
347
+ .gp-commitbar__ph{color:var(--dsw-alias-label-tertiary)}
348
+ .gp-panel[data-layout="compact"] .gp-commitbar .gp-btn{height:30px}
349
+ /* Compact commit row: AI suggest / Commit / fold all share the 30px height, so
350
+ * the fold button lines up with its neighbours and the row loses vertical padding. */
351
+ .gp-panel[data-layout="compact"] .gp-commitbox .gp-btn{height:30px}
352
+ /* Compact fold control: a real button (tinted fill, border, press feedback) so
353
+ * collapsing the editor reads as an action next to AI suggest / Commit. */
354
+ .gp-panel[data-layout="compact"] .gp-commitbox__fold{width:30px;height:30px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);transition:background .12s ease,color .12s ease,transform .08s ease}
355
+ .gp-panel[data-layout="compact"] .gp-commitbox__fold:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
356
+ .gp-panel[data-layout="compact"] .gp-commitbox__fold:active:not(:disabled){transform:scale(.94)}
357
+ .gp-panel[data-layout="compact"] .gp-commitbox__fold:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
358
+ .gp-commitbox__fold:disabled{opacity:.5;cursor:default}
359
+ .gp-commitbox__actions{margin-left:auto;display:flex;flex-wrap:nowrap;gap:6px}
271
360
 
272
361
  /* diff view */
273
362
  .gp-diff{flex:1;min-height:0;display:flex;flex-direction:column}
@@ -278,15 +367,18 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
278
367
  .gp-diff__toolbar--compact{flex-wrap:wrap;row-gap:6px}
279
368
  .gp-diff__toolbar-row{display:flex;align-items:center;gap:8px;min-width:0}
280
369
  .gp-diff__toolbar-row:first-child{flex:1 1 100%}
281
- .gp-diff__toolbar-row--controls{flex:1 1 100%}
370
+ .gp-diff__toolbar-row--controls{flex:1 1 100%;flex-wrap:wrap}
282
371
  .gp-diff__toolbar-row--controls .gp-diff__expand{flex:none}
283
- .gp-diff__toolbar-row--controls .gp-seg{flex:1}
284
- .gp-diff__toolbar-row--controls .gp-seg__btn{flex:1;min-width:0}
372
+ /* Seg labels never break: the track keeps at least its content width and may
373
+ * wrap below the expand toggle on an ultra-narrow panel instead of squeezing
374
+ * "\u53D8\u66F4\u524D / \u53D8\u66F4\u540E" into two lines. Buttons stay equal-width while they fit. */
375
+ .gp-diff__toolbar-row--controls .gp-seg{flex:1 1 auto;min-width:max-content}
376
+ .gp-diff__toolbar-row--controls .gp-seg .gp-seg__btn{flex:1 1 0;min-width:max-content}
285
377
  .gp-diff__path{font-size:12px;color:var(--dsw-alias-label-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
286
378
  .gp-diff__expand{border:1px solid var(--dsw-alias-border-l2);border-radius:7px}
287
379
  .gp-diff__expand:disabled{opacity:.45;cursor:not-allowed}
288
380
  .gp-seg{display:inline-flex;border:1px solid var(--dsw-alias-border-l2);border-radius:7px;overflow:hidden;background:var(--dsw-alias-bg-layer-1)}
289
- .gp-seg__btn{border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;padding:5px 10px;cursor:pointer;transition:background .12s ease,color .12s ease}
381
+ .gp-seg__btn{border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;white-space:nowrap;padding:5px 10px;cursor:pointer;transition:background .12s ease,color .12s ease}
290
382
  .gp-seg__btn:hover{background:var(--dsw-alias-interactive-bg-hover)}
291
383
  .gp-seg__btn--active{background:var(--dsw-alias-state-business-primary);color:#fff}
292
384
  .gp-seg__btn--active:hover{background:var(--dsw-alias-state-business-primary)}
@@ -341,6 +433,11 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
341
433
  .gp-svgdiff__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
342
434
  .gp-feedback{padding:6px 10px;font-size:12px;color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);display:flex;align-items:center;gap:8px}
343
435
  .gp-notice{padding:6px 10px;font-size:12px;color:var(--dsw-alias-label-secondary);background:color-mix(in srgb,var(--dsw-alias-label-secondary) 10%,transparent);display:flex;align-items:center;gap:8px}
436
+ /* Dismissible banner: the text takes the free width, the close button pins right. */
437
+ .gp-notice__text{flex:1 1 auto;min-width:0}
438
+ .gp-notice__close{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;margin:-2px -4px -2px 0;padding:0;border:0;border-radius:5px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer}
439
+ .gp-notice__close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
440
+ .gp-notice__close:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
344
441
 
345
442
  /* commit file-diff modal (overview \u2192 click a file): a centered dialog over a
346
443
  * dimmed backdrop, closed by Esc / backdrop click / the close button. */
@@ -360,8 +457,9 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
360
457
  * changes-pane toolbar. The seg stretches evenly and the bordered close
361
458
  * button pins to the row's far right. */
362
459
  .gp-modal__bar-row{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 100%}
363
- .gp-modal__bar-row--controls .gp-seg{flex:1}
364
- .gp-modal__bar-row--controls .gp-seg__btn{flex:1;min-width:0}
460
+ .gp-modal__bar-row--controls{flex-wrap:wrap}
461
+ .gp-modal__bar-row--controls .gp-seg{flex:1 1 auto;min-width:max-content}
462
+ .gp-modal__bar-row--controls .gp-seg .gp-seg__btn{flex:1 1 0;min-width:max-content}
365
463
  .gp-modal__bar-row--controls .gp-modal__close{margin-left:auto;border:1px solid var(--dsw-alias-border-l2);border-radius:7px}
366
464
  .gp-modal__scroll{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;font-family:var(--dsw-font-mono,monospace);font-size:12px;background:var(--dsw-alias-bg-layer-2)}
367
465
 
@@ -458,6 +556,10 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
458
556
  .gp-detail__tags{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
459
557
  .gp-detail__tagname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px}
460
558
  .gp-detail__actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
559
+ /* Compact commit-detail ops: the touch rule lifts every .gp-btn to 36px, which
560
+ * makes revert / reset / create-tag tall for such low-frequency actions. Keep
561
+ * them at the compact control height (30px) instead. */
562
+ .gp-panel[data-layout="compact"] .gp-detail__actions .gp-btn{height:30px}
461
563
  .gp-ref-chip--del{display:inline-flex;align-items:center;gap:4px;max-width:100%}
462
564
  .gp-ref-chip__x{display:inline-flex;align-items:center;padding:0;margin-left:2px;border:none;background:none;color:inherit;cursor:pointer;opacity:.7}
463
565
  .gp-ref-chip__x:hover{opacity:1;color:var(--dsw-alias-state-error-primary)}
@@ -537,11 +639,16 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
537
639
  .gp-tab-dot--dirty{background:var(--dsw-alias-state-warn-primary,#e0982e)}
538
640
 
539
641
  /* pill wrapper + rounded hover tooltip panel (openviking-manager style):
540
- * soft radius, layered shadow, subtle border, portaled above the pill. */
541
- .gp-tip{position:fixed;z-index:60;max-width:520px;padding:8px 12px;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2));border-radius:12px;background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));box-shadow:0 6px 24px rgba(0,0,0,.18),0 1px 3px rgba(0,0,0,.12);font-size:12px;line-height:1.5;pointer-events:none}
642
+ * soft radius, layered shadow, subtle border, portaled above the pill.
643
+ * width:max-content is load-bearing: a fixed box with only left set would
644
+ * shrink to the room on its right (a phone row icon left a 36px column). */
645
+ .gp-tip{position:fixed;z-index:60;width:max-content;box-sizing:border-box;max-width:520px;padding:8px 12px;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2));border-radius:12px;background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));box-shadow:0 6px 24px rgba(0,0,0,.18),0 1px 3px rgba(0,0,0,.12);font-size:12px;line-height:1.5;pointer-events:none}
542
646
  .gp-tip__path{color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-mono,ui-monospace,monospace);word-break:break-all}
543
647
  .gp-tip__note{margin-top:4px;color:var(--dsw-alias-label-tertiary)}
544
648
  .gp-tip--sb{color:var(--dsw-alias-label-secondary);line-height:1.45}
649
+ /* Compact panels put the control's centre in the left offset and shift by half
650
+ * the bubble's own width, so it reads as centred on the row icon it explains. */
651
+ .gp-tip--center{transform:translateX(-50%)}
545
652
 
546
653
  /* ===================================================================
547
654
  * Compact (mobile / narrow-split) layout
@@ -554,13 +661,16 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
554
661
  * own classes / viewport media queries instead.
555
662
  * =================================================================== */
556
663
 
557
- /* Tab bar: wrap the trailing cluster onto a second full-width row so the
558
- * font stepper + version bar stay reachable instead of being hidden. */
559
- .gp-panel[data-layout="compact"] .gp-tabbar{flex-wrap:wrap;row-gap:4px}
560
- .gp-panel[data-layout="compact"] .gp-tabbar__trailing{display:flex;flex-basis:100%;align-items:center;gap:8px;margin-top:2px}
561
- .gp-panel[data-layout="compact"] .gp-tabbar .gp-font,
562
- .gp-panel[data-layout="compact"] .gp-tabbar .gp-verbar{display:inline-flex}
563
- .gp-panel[data-layout="compact"] .gp-tab{height:36px}
664
+ /* Tab bar: one row. The switcher drops its labels to icon-only and takes the
665
+ * remaining width (the three icon cells stay equal and touch-sized), while the
666
+ * font stepper rides the same row at the trailing edge. The version bar is not
667
+ * mounted at all in compact (Panel.tsx), so the bar keeps a single row.
668
+ * The label stays in the DOM \u2014 clipped, not display:none \u2014 so the tab keeps its
669
+ * accessible name for screen readers. */
670
+ .gp-panel[data-layout="compact"] .gp-tabbar__tabs{flex:1 1 auto}
671
+ .gp-panel[data-layout="compact"] .gp-tabbar__tabs--single{flex:0 0 auto}
672
+ .gp-panel[data-layout="compact"] .gp-tabbar__trailing{display:flex;flex:none;align-items:center;margin-left:auto}
673
+ .gp-panel[data-layout="compact"] .gp-tab__label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
564
674
 
565
675
  /* Shared drill-in back bar (overview detail / files preview). The Changes
566
676
  * diff and Files bar reuse just the .gp-subhead__back button inline. */
@@ -568,7 +678,14 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
568
678
  .gp-subhead__back{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer;flex:none;white-space:nowrap}
569
679
  .gp-subhead__back:hover{background:var(--dsw-alias-interactive-bg-hover)}
570
680
  .gp-subhead__back:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
571
- .gp-subhead__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--dsw-alias-label-tertiary)}
681
+ /* Compact drill-in back buttons (\u8FD4\u56DE\u5217\u8868 / \u8FD4\u56DE\u6587\u4EF6\u6811 / \u8FD4\u56DE\u53D8\u66F4\u5217\u8868) match the
682
+ * 30px control height of the history toolbar's branch-filter pill. */
683
+ .gp-panel[data-layout="compact"] .gp-subhead__back{height:30px}
684
+ /* The compact commit-detail header carries the change summary on the back
685
+ * button's row: the summary drops its own hairline/padding and takes the
686
+ * trailing edge, clipped (never wrapped) when the counts run long. */
687
+ .gp-panel[data-layout="compact"] .gp-detail__summary--inline{margin:0 0 0 auto;padding:0;border-bottom:0;min-width:0;overflow:hidden}
688
+ .gp-panel[data-layout="compact"] .gp-detail__summary--inline>span{white-space:nowrap}
572
689
 
573
690
  /* Overview: single column, each pane fills width + height. */
574
691
  .gp-overview--compact{flex-direction:column}
@@ -667,12 +784,13 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
667
784
  @media (prefers-reduced-motion:reduce){
668
785
  .gp-sheet,.gp-sheet-backdrop,.gp-modal,.gp-modal-backdrop,.gp-zl-mask{animation:none}
669
786
  }
670
- `,Cn=!1;function or(){if(Cn||typeof document>"u")return;let e="dsh-git-panel/client.css";if(document.querySelector(`style[data-plugin-css="${e}"]`)!==null){Cn=!0;return}let t=document.createElement("style");t.dataset.plugin="@xbzbing/dsh-git-panel",t.dataset.pluginCss=e,t.textContent=ti,document.head.appendChild(t),Cn=!0}var sr={"panel.tab":"Git","panel.fontDecrease":"\u7F29\u5C0F\u5B57\u4F53","panel.fontReset":"\u91CD\u7F6E\u5B57\u4F53\u5927\u5C0F","panel.fontIncrease":"\u653E\u5927\u5B57\u4F53","tab.overview":"Git \u603B\u89C8","tab.changes":"\u53D8\u66F4\u8BB0\u5F55","tab.files":"\u6587\u4EF6\u6D4F\u89C8","pill.unavailable":"Git \u4E0D\u53EF\u7528","pill.detached":"\u6E38\u79BB HEAD","pill.synced":"\u672C\u5730\u5DF2\u540C\u6B65","pill.dirty":"\u6709\u5F85\u63D0\u4EA4\u7684\u53D8\u66F4","common.loading":"\u52A0\u8F7D\u4E2D\u2026","common.retry":"\u91CD\u8BD5","common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","ops.aiHint":"\u63D0\u793A\uFF1A\u7ED9 AI \u591A\u4E00\u70B9\u4FE1\u4EFB\uFF0C\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u8BA9 AI \u76F4\u63A5\u6267\u884C Git \u64CD\u4F5C\u3002","version.check":"\u68C0\u67E5\u65B0\u7248\u672C","version.checking":"\u68C0\u67E5\u4E2D\u2026","version.upToDate":"\u5DF2\u662F\u6700\u65B0\uFF08{current}\uFF09","version.updateAvailable":"\u6709\u65B0\u7248\u672C {latest}\uFF08\u5F53\u524D {current}\uFF09","version.viewRelease":"\u67E5\u770B\u53D1\u5E03","version.error":"\u68C0\u67E5\u5931\u8D25","version.noRepo":"\u672A\u914D\u7F6E\u4ED3\u5E93\u5730\u5740","version.openRepo":"\u8BBF\u95EE GitHub \u67E5\u770B @xbzbing/dsh-git-panel \u9879\u76EE\uFF0C\u8BF7\u4E3A\u9879\u76EE\u70B9\u4EAE\u4E00\u9897\u5C0F\u661F\u661F\u5427 \u2B50","overview.head":"\u5168\u90E8\u5206\u652F","overview.local":"\u672C\u5730","overview.remote":"\u8FDC\u7A0B","overview.tags":"\u6807\u7B7E","overview.search":"\u641C\u7D22\u63D0\u4EA4\uFF08\u6D88\u606F / \u54C8\u5E0C\uFF09","overview.searchShort":"\u641C\u7D22\u63D0\u4EA4","overview.allUsers":"\u5168\u90E8\u4F5C\u8005","overview.allTime":"\u5168\u90E8\u65F6\u95F4","overview.today":"\u4ECA\u5929","overview.last7d":"\u8FD1 7 \u5929","overview.last30d":"\u8FD1 30 \u5929","overview.selectCommit":"\u9009\u62E9\u4E00\u4E2A\u63D0\u4EA4\u67E5\u770B\u8BE6\u60C5","overview.noMessage":"\uFF08\u65E0\u63D0\u4EA4\u6B63\u6587\uFF09","overview.noResults":"\u6CA1\u6709\u5339\u914D\u7684\u63D0\u4EA4","overview.loadFailed":"\u52A0\u8F7D\u5931\u8D25","overview.detailFailed":"\u8BE6\u60C5\u52A0\u8F7D\u5931\u8D25","overview.diffFailed":"\u5DEE\u5F02\u52A0\u8F7D\u5931\u8D25","overview.openFileDiff":"\u67E5\u770B\u8BE5\u6587\u4EF6\u5728\u6B64\u63D0\u4EA4\u4E2D\u7684\u53D8\u66F4","overview.changeSummary":"{files} \u4E2A\u6587\u4EF6","overview.expandDir":"\u5C55\u5F00\u76EE\u5F55","overview.collapseDir":"\u6298\u53E0\u76EE\u5F55","overview.fetch":"\u62C9\u53D6\u8FDC\u7A0B","overview.branchesError":"\u5206\u652F\u52A0\u8F7D\u5931\u8D25","overview.filterBranch":"\u6309\u5206\u652F\u7B5B\u9009","overview.backToList":"\u8FD4\u56DE\u5217\u8868","overview.createTag":"\u521B\u5EFA\u6807\u7B7E","overview.revert":"\u8FD8\u539F\u6B64\u63D0\u4EA4","overview.reset":"\u91CD\u7F6E\u5230\u6B64","switch.action":"\u5207\u6362","switch.rowTitle":"\u5207\u6362\u5230 {name}","switch.rowTitleTrack":"\u4ECE {ref} \u65B0\u5EFA\u8DDF\u8E2A\u5206\u652F {name} \u5E76\u5207\u6362","switch.detached":"\u6E38\u79BB HEAD","switch.confirmTitle":"\u5207\u6362\u5206\u652F","switch.body":"\u4ECE {from} \u5207\u6362\u5230 {to}\u3002","switch.trackingNote":"\u672C\u5730\u8FD8\u6CA1\u6709 {name}\uFF0C\u5C06\u5148\u4ECE {ref} \u521B\u5EFA\u5B83\u5E76\u8BBE\u7F6E\u8DDF\u8E2A\uFF08upstream\uFF09\u3002","switch.dirtyWarn":"\u5F53\u524D\u6709 {count} \u4E2A\u6587\u4EF6\u5B58\u5728\u672A\u63D0\u4EA4\u53D8\u66F4\u3002","switch.modeDirect":"\u76F4\u63A5\u5207\u6362","switch.modeDirectHint":"\u672A\u63D0\u4EA4\u53D8\u66F4\u4F1A\u968F\u5DE5\u4F5C\u533A\u5E26\u8FC7\u53BB\uFF1B\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\uFF0CGit \u4F1A\u62D2\u7EDD\u5207\u6362\uFF0C\u5DE5\u4F5C\u533A\u4FDD\u6301\u4E0D\u53D8\u3002","switch.modeStash":"\u5148\u8D2E\u85CF {count} \u4E2A\u6587\u4EF6\u7684\u53D8\u66F4\uFF0C\u518D\u5207\u6362","switch.modeStashHint":"\u53D8\u66F4\u79FB\u5165\u8D2E\u85CF\u6808\u9876\uFF08\u542B\u672A\u8DDF\u8E2A\u6587\u4EF6\uFF09\uFF0C\u5207\u6362\u540E\u53EF\u4ECE\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\u3002\u6CE8\u610F\uFF1A\u4E0D\u4F1A\u81EA\u52A8\u6062\u590D\uFF1B\u6062\u590D\u65F6\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\u9700\u624B\u52A8\u89E3\u51B3\u3002","switch.confirm":"\u5207\u6362","switch.confirmStash":"\u8D2E\u85CF\u5E76\u5207\u6362","switch.switching":"\u6B63\u5728\u5207\u6362\u2026","switch.stashMessage":"\u5207\u6362\u5230 {branch} \u524D\u81EA\u52A8\u8D2E\u85CF","tag.createTitle":"\u5728\u6B64\u63D0\u4EA4\u521B\u5EFA\u6807\u7B7E","tag.namePlaceholder":"\u6807\u7B7E\u540D","tag.annotated":"\u9644\u6CE8\u6807\u7B7E\uFF08\u5E26\u8BF4\u660E\uFF09","tag.messagePlaceholder":"\u6807\u7B7E\u8BF4\u660E","tag.create":"\u521B\u5EFA\u6807\u7B7E","tag.deleteTitle":"\u5220\u9664\u6807\u7B7E","tag.deleteConfirm":"\u786E\u5B9A\u5220\u9664\u6807\u7B7E\u300C{name}\u300D\uFF1F","tag.deleteOne":"\u5220\u9664\u6807\u7B7E\u300C{name}\u300D","ops.dirtyWarn":"\u68C0\u6D4B\u5230\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u8FD9\u4E9B\u6539\u52A8\u53EF\u80FD\u662F dsh AI \u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\u3002","revert.title":"\u8FD8\u539F\u63D0\u4EA4","revert.body":"\u5C06\u5728\u5F53\u524D HEAD \u8FFD\u52A0\u4E00\u4E2A\u53CD\u5411\u63D0\u4EA4\uFF0C\u8FD8\u539F {ref} \u7684\u6539\u52A8\u3002\u4E0D\u4F1A\u4E22\u5F03\u4F60\u7684\u5DE5\u4F5C\u533A\u6539\u52A8\u3002","revert.confirm":"\u8FD8\u539F","reset.title":"\u91CD\u7F6E\u5206\u652F","reset.body":"\u5C06\u628A\u5F53\u524D\u5206\u652F\u7684 HEAD \u4ECE {from} \u79FB\u52A8\u5230 {to}\u3002","reset.modeSoft":"\u8F6F\u91CD\u7F6E\uFF08--soft\uFF09","reset.softHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u6682\u5B58\u533A\u3002","reset.modeMixed":"\u6DF7\u5408\u91CD\u7F6E\uFF08--mixed\uFF0C\u9ED8\u8BA4\uFF09","reset.mixedHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u5DE5\u4F5C\u533A\u3002","reset.modeHard":"\u786C\u91CD\u7F6E\uFF08--hard\uFF09","reset.hardHint":"\u79FB\u52A8 HEAD \u5230\u6B64\u63D0\u4EA4\u5E76\u4E22\u5F03\u6240\u6709\u672A\u63D0\u4EA4\u6539\u52A8\uFF08\u672A\u63D0\u4EA4\u6539\u52A8\u65E0\u6CD5\u6062\u590D\uFF09\u3002","reset.hardOrphan":"\u5F53\u524D\u5206\u652F\u4E0A\u665A\u4E8E\u76EE\u6807\u7684\u63D0\u4EA4\u4F1A\u79BB\u5F00\u5206\u652F\uFF08\u4ECD\u53EF\u7528 git reflog \u627E\u56DE\uFF09\u3002","reset.hardWarn":"\u4EE5\u4E0B\u672A\u63D0\u4EA4\u6539\u52A8\u5C06\u88AB\u6C38\u4E45\u4E22\u5F03\uFF1A","reset.lostMore":"\u2026\u8FD8\u6709\u66F4\u591A\u672A\u63D0\u4EA4\u6539\u52A8\u672A\u663E\u793A\uFF08\u5217\u8868\u5DF2\u622A\u65AD\uFF09","reset.hardAck":"\u6211\u5DF2\u4E86\u89E3\uFF0C\u786E\u8BA4\u4E22\u5F03\u8FD9\u4E9B\u672A\u63D0\u4EA4\u6539\u52A8","reset.hardAckClean":"\u6211\u5DF2\u4E86\u89E3\u6B64\u64CD\u4F5C\u7684\u540E\u679C\uFF0C\u786E\u8BA4\u91CD\u7F6E","reset.confirm":"\u91CD\u7F6E","changes.groupStaged":"\u5DF2\u6682\u5B58\u7684\u66F4\u6539","changes.groupUnstaged":"\u66F4\u6539","changes.groupUntracked":"\u672A\u7248\u672C\u63A7\u5236\u7684\u6587\u4EF6","changes.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u53D8\u66F4","changes.noChanges":"\u6CA1\u6709\u672A\u63D0\u4EA4\u7684\u53D8\u66F4","changes.stageAll":"\u5168\u90E8\u6682\u5B58","changes.unstageAll":"\u5168\u90E8\u53D6\u6D88\u6682\u5B58","changes.stage":"\u6682\u5B58","changes.unstage":"\u53D6\u6D88\u6682\u5B58","changes.discard":"\u653E\u5F03\u66F4\u6539","changes.discardConfirm":"\u518D\u6B21\u70B9\u51FB\u4EE5\u786E\u8BA4\u653E\u5F03","changes.backToList":"\u8FD4\u56DE\u5217\u8868","changes.stash":"\u8D2E\u85CF\u66F4\u6539","stash.title":"\u8D2E\u85CF\u5F53\u524D\u66F4\u6539","stash.messagePlaceholder":"\u8D2E\u85CF\u8BF4\u660E\uFF08\u53EF\u9009\uFF09","stash.save":"\u8D2E\u85CF","stash.section":"\u8D2E\u85CF","stash.onBranch":"\u4F4D\u4E8E {branch}","stash.apply":"\u5E94\u7528","stash.pop":"\u5F39\u51FA","stash.drop":"\u4E22\u5F03","stash.dropTitle":"\u4E22\u5F03\u8D2E\u85CF","stash.dropConfirm":"\u786E\u5B9A\u4E22\u5F03\u6B64\u8D2E\u85CF\u6761\u76EE\uFF1F\u4E22\u5F03\u540E\u65E0\u6CD5\u6062\u590D\uFF1A{name}","files.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u5185\u5BB9","files.loadFailed":"\u52A0\u8F7D\u5931\u8D25","files.backToTree":"\u8FD4\u56DE\u6587\u4EF6\u6811","files.truncated":"\u6761\u76EE\u8FC7\u591A\uFF0C\u5DF2\u622A\u65AD","files.tooLarge":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8","files.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u9884\u89C8","files.highlightOff":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5173\u95ED\u8BED\u6CD5\u9AD8\u4EAE\u4EE5\u4FDD\u6301\u6D41\u7545","files.lineTruncated":" \u2026\uFF08\u6B64\u884C\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\uFF09","files.findPlaceholder":"\u5728\u6B64\u6587\u4EF6\u4E2D\u67E5\u627E","files.findNoMatch":"\u65E0\u5339\u914D","files.findPrev":"\u4E0A\u4E00\u4E2A","files.findNext":"\u4E0B\u4E00\u4E2A","files.findClose":"\u5173\u95ED\u67E5\u627E","files.findCase":"\u533A\u5206\u5927\u5C0F\u5199","files.previewMode":"\u9884\u89C8\u65B9\u5F0F","files.source":"\u6E90\u7801","files.render":"\u6E32\u67D3","files.copyPath":"\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84","files.pathCopied":"\u8DEF\u5F84\u5DF2\u590D\u5236","files.pathCopyFailed":"\u590D\u5236\u5931\u8D25","files.copyContent":"\u590D\u5236\u6587\u4EF6\u5185\u5BB9","files.contentCopied":"\u5185\u5BB9\u5DF2\u590D\u5236","files.contentCopyFailed":"\u590D\u5236\u5931\u8D25","files.ignored":"\u5DF2\u88AB Git \u5FFD\u7565","files.copy":"\u590D\u5236\u4EE3\u7801","files.copied":"\u5DF2\u590D\u5236","files.footnotes":"\u6CE8\u91CA","files.zoomBar":"\u56FE\u7247\u7F29\u653E","files.zoomIn":"\u653E\u5927","files.zoomOut":"\u7F29\u5C0F","files.zoomActual":"\u5B9E\u9645\u5927\u5C0F\uFF08100%\uFF09","files.zoomFit":"\u9002\u5E94\u7A97\u53E3","files.zoomFullscreen":"\u5168\u5C4F\u67E5\u770B","files.gitNotInstalled":"\u7CFB\u7EDF\u672A\u5B89\u88C5 Git\uFF0CGit \u9762\u677F\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5B89\u88C5 Git \u5DE5\u5177\u540E\u91CD\u8BD5\u3002","files.propsTitle":"\u6587\u4EF6\u5C5E\u6027","files.propsGroupStats":"\u5927\u5C0F\u4E0E\u7EDF\u8BA1","files.propsGroupTime":"\u65F6\u95F4","files.propsName":"\u540D\u79F0","files.propsType":"\u7C7B\u578B","files.propsTypeImage":"{fmt} \u56FE\u7247","files.propsTypeText":"\u6587\u672C\u6587\u4EF6","files.propsTypeBinary":"\u4E8C\u8FDB\u5236\u6587\u4EF6","files.propsTypeUnread":"\u8FC7\u5927\u672A\u8BFB\u53D6","files.propsTypeFmt":"{label}\uFF08.{ext}\uFF09","files.propsRelPath":"\u76F8\u5BF9\u8DEF\u5F84","files.propsAbsPath":"\u7EDD\u5BF9\u8DEF\u5F84","files.propsCopyHint":"\u70B9\u51FB\u590D\u5236","files.propsSize":"\u5927\u5C0F","files.propsSizeBytes":"\uFF08{bytes} \u5B57\u8282\uFF09","files.propsLines":"\u884C\u6570","files.propsImageSize":"\u56FE\u7247\u5C3A\u5BF8","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"\u4FEE\u6539\u65F6\u95F4","files.propsUntracked":"\u672A\u8DDF\u8E2A","files.propsTrackedYes":"\u5DF2\u8DDF\u8E2A","files.propsStaged":"\u5DF2\u6682\u5B58","files.stAdded":"\u5DF2\u6DFB\u52A0","files.stModified":"\u5DF2\u4FEE\u6539","files.stDeleted":"\u5DF2\u5220\u9664","files.stRenamed":"\u5DF2\u91CD\u547D\u540D","files.stConflicted":"\u6709\u51B2\u7A81","files.stTypechange":"\u7C7B\u578B\u53D8\u66F4","stats.files":"{n} \u4E2A\u6587\u4EF6","stats.lastChange":"\u6700\u8FD1\u53D8\u66F4 {time}","stats.lastCommit":"\u4E0A\u6B21\u63D0\u4EA4 {time}","stats.staged":"\u5DF2\u6682\u5B58 {n}","stats.modified":"\u5DF2\u4FEE\u6539 {n}","stats.untracked":"\u672A\u8DDF\u8E2A {n}","stats.partial":"\u7EDF\u8BA1\u5DF2\u7B80\u5316","stats.partialHint":"\u53D8\u66F4\u6570\u91CF\u8F83\u591A\uFF0C\u5DF2\u8DF3\u8FC7\u672A\u8DDF\u8E2A\u6587\u4EF6\u884C\u6570\u4E0E\u6700\u8FD1\u53D8\u66F4\u65F6\u95F4\u7684\u7CBE\u786E\u7EDF\u8BA1\u4EE5\u4FDD\u6301\u9762\u677F\u6D41\u7545\u3002","commit.placeholder":"\u63D0\u4EA4\u4FE1\u606F","commit.commit":"\u63D0\u4EA4","commit.amend":"\u4FEE\u6B63\u4E0A\u6B21\u63D0\u4EA4\uFF08amend\uFF09","commit.suggest":"AI \u751F\u6210","commit.suggesting":"\u751F\u6210\u4E2D\u2026","commit.suggestOverwrite":"\u518D\u6B21\u70B9\u51FB\u300CAI \u751F\u6210\u300D\u4EE5\u8986\u76D6\u5F53\u524D\u63D0\u4EA4\u4FE1\u606F","commit.suggestTruncated":"diff \u8FC7\u957F\u5DF2\u622A\u65AD\uFF0C\u751F\u6210\u7684\u5EFA\u8BAE\u53EF\u80FD\u4E0D\u5B8C\u6574","diff.unified":"\u7EDF\u4E00","diff.split":"\u5BF9\u7167","diff.before":"\u53D8\u66F4\u524D","diff.after":"\u53D8\u66F4\u540E","diff.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.tooLarge":"\u56FE\u7247\u8FC7\u5927\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.imageMissing":"\u4E0D\u5B58\u5728","diff.svgRender":"\u6E32\u67D3","diff.svgSource":"\u6E90\u7801","diff.empty":"\u65E0\u5DEE\u5F02","diff.expandAll":"\u5C55\u5F00\u5168\u90E8","diff.collapse":"\u6298\u53E0\u672A\u53D8\u66F4","diff.expandGap":"\u5C55\u5F00\u5168\u90E8 {n} \u884C","diff.expandUp":"\u5411\u4E0A\u5C55\u5F00 {n} \u884C","diff.expandDown":"\u5411\u4E0B\u5C55\u5F00 {n} \u884C","diff.expandCapped":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5C55\u5F00 {n} \u884C\u4E0A\u4E0B\u6587\uFF0C\u5176\u4F59\u4FDD\u6301\u6298\u53E0\uFF0C\u53EF\u9010\u6BB5\u5C55\u5F00","diff.truncated":"git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF1A\u6B64\u5DEE\u5F02\u53EA\u4FDD\u7559\u4E86\u5C3E\u6BB5\uFF0C\u5F00\u5934\u7684\u6539\u52A8\u4E0E\u589E\u5220\u7EDF\u8BA1\u53EF\u80FD\u7F3A\u5931","time.justNow":"\u521A\u521A","time.minutesAgo":"{n} \u5206\u949F\u524D","time.hoursAgo":"{n} \u5C0F\u65F6\u524D","time.daysAgo":"{n} \u5929\u524D","error.generic":"\u64CD\u4F5C\u5931\u8D25","error.notARepo":"\u5F53\u524D\u76EE\u5F55\u4E0D\u662F Git \u4ED3\u5E93","error.noCwd":"\u5F53\u524D\u4F1A\u8BDD\u65E0\u5DE5\u4F5C\u76EE\u5F55","error.localChangesBlock":"\u672C\u5730\u6709\u672A\u63D0\u4EA4\u53D8\u66F4\uFF0C\u64CD\u4F5C\u88AB\u963B\u6B62","error.emptyMessage":"\u63D0\u4EA4\u4FE1\u606F\u4E0D\u80FD\u4E3A\u7A7A","error.emptyDiff":"\u6CA1\u6709\u53EF\u751F\u6210\u7684\u53D8\u66F4","error.llmUnavailable":"AI \u670D\u52A1\u4E0D\u53EF\u7528","error.llmFailed":"AI \u751F\u6210\u5931\u8D25","error.suggestDisabled":"AI \u751F\u6210\u5DF2\u5728\u63D2\u4EF6\u914D\u7F6E\u4E2D\u5173\u95ED","error.conflict":"\u8D2E\u85CF\u5E94\u7528\u4EA7\u751F\u51B2\u7A81\uFF0C\u8D2E\u85CF\u6761\u76EE\u5DF2\u4FDD\u7559\uFF0C\u8BF7\u624B\u52A8\u89E3\u51B3\u51B2\u7A81\u540E\u518D\u8BD5","error.revertConflict":"\u8FD8\u539F\u4F1A\u4E0E\u5F53\u524D\u5185\u5BB9\u51B2\u7A81\uFF0C\u5DF2\u81EA\u52A8\u53D6\u6D88\u8FD8\u539F\uFF08\u672A\u6539\u52A8\u4F60\u7684\u5DE5\u4F5C\u533A\uFF09","error.revertStuck":"\u8FD8\u539F\u4EA7\u751F\u51B2\u7A81\u4E14\u81EA\u52A8\u53D6\u6D88\u5931\u8D25\uFF0C\u4ED3\u5E93\u4ECD\u5904\u4E8E\u8FD8\u539F\u4E2D\uFF0C\u8BF7\u624B\u52A8\u6267\u884C git revert --abort \u6216\u89E3\u51B3\u51B2\u7A81","error.revertMerge":"\u8FD9\u662F\u4E00\u4E2A\u5408\u5E76\u63D0\u4EA4\uFF0C\u9762\u677F\u6682\u4E0D\u652F\u6301\u8FD8\u539F\uFF08\u9700\u6307\u5B9A\u4E3B\u7EBF\u7236\u63D0\u4EA4\uFF09\uFF0C\u8BF7\u5728\u547D\u4EE4\u884C\u7528 git revert -m \u5904\u7406","error.indexBusy":"Git \u6B63\u5FD9\uFF08\u53E6\u4E00\u8FDB\u7A0B\u5360\u7528\u7D22\u5F15\uFF09\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5","error.notFound":"\u76EE\u6807\u4E0D\u5B58\u5728\uFF08\u5206\u652F / \u6807\u7B7E / \u8D2E\u85CF\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u91CD\u547D\u540D\uFF09","error.branchInUse":"\u8BE5\u5206\u652F\u5DF2\u5728\u53E6\u4E00\u4E2A\u5DE5\u4F5C\u6811\u4E2D\u68C0\u51FA\uFF0C\u65E0\u6CD5\u5728\u6B64\u5207\u6362","error.stashSwitchFailed":"\u672A\u63D0\u4EA4\u53D8\u66F4\u5DF2\u8D2E\u85CF\uFF08\u53EF\u5728\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\uFF09\uFF0C\u4F46\u5207\u6362\u5931\u8D25\uFF1A{reason}","error.invalidName":"\u540D\u79F0\u4E0D\u5408\u6CD5","error.notFastForward":"\u672C\u5730\u4E0E\u8FDC\u7A0B\u5206\u652F\u5DF2\u5206\u53C9\uFF0C\u65E0\u6CD5\u5FEB\u8FDB\u62C9\u53D6\uFF0C\u8BF7\u624B\u52A8\u5408\u5E76\u6216\u53D8\u57FA","error.pushRejected":"\u63A8\u9001\u88AB\u62D2\u7EDD\uFF1A\u8FDC\u7A0B\u5DF2\u6709\u65B0\u63D0\u4EA4\uFF0C\u8BF7\u5148\u300C\u68C0\u67E5\u540C\u6B65\u300D\u5E76\u62C9\u53D6\u540E\u518D\u63A8\u9001","error.authFailed":"\u8BA4\u8BC1\u5931\u8D25\uFF1A\u6CA1\u6709\u53EF\u7528\u7684 git \u51ED\u636E\uFF08HTTPS \u9700\u51ED\u636E\u52A9\u624B\u3001SSH \u9700\u5BC6\u94A5\uFF09\u3002\u8BF7\u5148\u5728\u547D\u4EE4\u884C\u5B8C\u6210\u4E00\u6B21\u63A8\u9001\u4EE5\u7F13\u5B58\u51ED\u636E","status.openRepo":"\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.openRepoOn":"\u5728 {host} \u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.synced":"\u5DF2\u4E0E\u8FDC\u7A0B\u540C\u6B65","status.ahead":"\u9886\u5148 {n}","status.behind":"\u843D\u540E {n}","status.diverged":"\u5DF2\u5206\u53C9\uFF08\u9886\u5148 {ahead} / \u843D\u540E {behind}\uFF09","status.noUpstream":"\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u5206\u652F","status.detached":"\u6E38\u79BB HEAD\uFF0C\u65E0\u5206\u652F\u540C\u6B65\u72B6\u6001","status.check":"\u68C0\u67E5\u540C\u6B65\u72B6\u6001","status.checkTitle":"\u68C0\u67E5\u4E0E\u8FDC\u7A0B\u7684\u540C\u6B65\u72B6\u6001\uFF1A\u6267\u884C git fetch \u62C9\u53D6\u6700\u65B0\u5F15\u7528\u5E76\u5237\u65B0\u9886\u5148/\u843D\u540E\u8BA1\u6570\uFF0C\u4E0D\u6539\u52A8\u5DE5\u4F5C\u533A","status.pull":"\u62C9\u53D6","status.pulling":"\u540C\u6B65\u4E2D\u2026","status.pullTitle":"\u5FEB\u8FDB\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmTitle":"\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmBody":"\u5C06\u4EE5\u5FEB\u8FDB\u65B9\u5F0F\u628A\u5F53\u524D\u5206\u652F {branch} \u66F4\u65B0\u5230\u8FDC\u7A0B\u6700\u65B0\u63D0\u4EA4\uFF08\u843D\u540E {behind} \u4E2A\u63D0\u4EA4\uFF09\u3002\u4EC5\u5728\u672A\u5206\u53C9\u65F6\u53EF\u884C\uFF0C\u4E0D\u4F1A\u4EA7\u751F\u5408\u5E76\u63D0\u4EA4\uFF0C\u4E5F\u4E0D\u4F1A\u6539\u52A8\u4F60\u7684\u672A\u63D0\u4EA4\u5185\u5BB9\u3002","status.pullConfirm":"\u62C9\u53D6","status.pullScope":"\u5C06\u5F15\u5165 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pullScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u8FDC\u7A0B\u5DEE\u5F02\u2026","status.push":"\u63A8\u9001","status.pushTitle":"\u63A8\u9001\u672C\u5730\u63D0\u4EA4\u5230\u8FDC\u7A0B","status.pushConfirmTitle":"\u63A8\u9001\u5230\u8FDC\u7A0B","status.pushConfirmBody":"\u5C06\u628A\u5F53\u524D\u5206\u652F {branch} \u9886\u5148\u8FDC\u7A0B\u7684 {ahead} \u4E2A\u63D0\u4EA4\u63A8\u9001\u5230\u4E0A\u6E38\u3002\u4EC5\u505A\u5FEB\u8FDB\u63A8\u9001\uFF0C\u4E0D\u4F1A\u5F3A\u5236\u8986\u76D6\u8FDC\u7A0B\u5386\u53F2\u3002","status.pushConfirm":"\u63A8\u9001","status.pushing":"\u63A8\u9001\u4E2D\u2026","status.pushScope":"\u5C06\u63A8\u9001 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pushScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u5F85\u63A8\u9001\u5DEE\u5F02\u2026","status.publish":"\u53D1\u5E03","status.publishTitle":"\u53D1\u5E03\u5206\u652F\u5E76\u8BBE\u7F6E\u4E0A\u6E38","status.publishConfirmTitle":"\u53D1\u5E03\u5206\u652F\u5230\u8FDC\u7A0B","status.publishConfirmBody":"\u5F53\u524D\u5206\u652F {branch} \u5C1A\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u3002\u5C06\u6267\u884C git push -u {remote} \u5728\u8FDC\u7A0B\u521B\u5EFA\u540C\u540D\u5206\u652F\u5E76\u8BBE\u4E3A\u4E0A\u6E38\u8DDF\u8E2A\u3002","status.publishConfirm":"\u53D1\u5E03","status.publishing":"\u53D1\u5E03\u4E2D\u2026","cfg.title":"\u8F93\u5165\u6846\u5206\u652F\u6807\u8BB0","cfg.toggle":"\u663E\u793A\u8F93\u5165\u6846\u6807\u8BB0","cfg.hint":"\u5F00\u542F\u65F6\u5728\u8F93\u5165\u6846\u663E\u793A zsh \u98CE\u683C\u7684 <\u4ED3\u5E93\u540D> (\u5206\u652F) \u6807\u8BB0\uFF1B\u5173\u95ED\u540E\u6539\u4E3A\u5728 Git \u6807\u7B7E\u65C1\u663E\u793A\u72B6\u6001\u5706\u70B9\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffTitle":"\u5DEE\u5F02\u5BF9\u6BD4\u9ED8\u8BA4\u89C6\u56FE","cfg.diffHint":"\u9009\u62E9\u53D8\u66F4\u5BF9\u6BD4\u9ED8\u8BA4\u6253\u5F00\u7684\u5E03\u5C40\uFF1A\u7EDF\u4E00\u89C6\u56FE\u4E3A\u5355\u680F\u884C\u5185\u5BF9\u6BD4\uFF0C\u5E76\u6392\u89C6\u56FE\u4E3A\u5DE6\u53F3\u5206\u680F\u5BF9\u6BD4\u3002\u4ECD\u53EF\u5728\u6BCF\u4E2A\u5DEE\u5F02\u89C6\u56FE\u4E2D\u4E34\u65F6\u5207\u6362\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffUnified":"\u7EDF\u4E00\u89C6\u56FE\uFF08\u5355\u680F\u884C\u5185\uFF09","cfg.diffSplit":"\u5E76\u6392\u89C6\u56FE\uFF08\u5DE6\u53F3\u5206\u680F\uFF09","cfg.graphTitle":"\u63D0\u4EA4\u5386\u53F2\u56FE\u7EBF\u6761\u6837\u5F0F","cfg.graphHint":"\u9009\u62E9\u63D0\u4EA4\u5386\u53F2\u56FE\u7684\u8FDE\u7EBF\u753B\u6CD5\uFF1A\u5E73\u884C\u7EBF\u4E3A VSCode / \u56FE\u5F62\u754C\u9762\u98CE\u683C\uFF0C\u5206\u652F\u5404\u5360\u4E00\u5217\u3001\u5171\u4EAB\u7956\u5148\u4EE5\u5E76\u884C\u7EBF\u8868\u793A\uFF1B\u7D27\u51D1\u4E3A git log \u547D\u4EE4\u884C\u98CE\u683C\uFF0C\u5171\u4EAB\u7956\u5148\u5408\u5E76\u4E3A\u4E00\u5217\u3001\u7EBF\u66F4\u5C11\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.graphParallel":"\u5E73\u884C\u7EBF\uFF08VSCode \u98CE\u683C\uFF09","cfg.graphCompact":"\u7D27\u51D1\uFF08git log \u98CE\u683C\uFF09","cfg.suggestTitle":"AI \u751F\u6210\u63D0\u4EA4\u4FE1\u606F","cfg.suggestToggle":"\u63D0\u4EA4\u6846\u663E\u793A AI \u751F\u6210\u6309\u94AE","cfg.suggestLangLabel":"\u751F\u6210\u8BED\u8A00","cfg.suggestLangAuto":"\u81EA\u52A8","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"\u81EA\u52A8 = \u8DDF\u968F\u4F60\u5728\u6B64\u4ED3\u5E93\u7684\u63D0\u4EA4\u8BED\u8A00\uFF08\u5C31\u8FD1\u52A0\u6743\uFF0C\u5F53\u524D git \u4F5C\u8005\u4F18\u5148\uFF0C\u5FFD\u7565 release / merge \u7B49\u673A\u68B0\u63D0\u4EA4\uFF09\uFF1B\u4E2D\u6587 / English \u76F4\u63A5\u6307\u5B9A\u3002","cfg.suggestMaxBytesLabel":"\u8F93\u5165\u9884\u7B97","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"\u53D1\u9001\u7ED9\u6A21\u578B\u7684 diff \u4E0A\u9650\uFF0C\u8D85\u51FA\u4F1A\u622A\u65AD\uFF1B\u8303\u56F4 16\u2013512\u3002","cfg.suggestOutputLabel":"\u8F93\u51FA\u4E0A\u9650","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"\u6A21\u578B\u751F\u6210\u9884\u7B97\uFF1B\u601D\u8003\u6A21\u578B\u7684\u63A8\u7406\u8BA1\u5165\u8BE5\u9884\u7B97\uFF1B\u8303\u56F4 256\u201316384\u3002","cfg.suggestTimeoutLabel":"\u751F\u6210\u8D85\u65F6","cfg.suggestTimeoutUnit":"\u79D2","cfg.suggestTimeoutHint":"\u8D85\u65F6\u5373\u751F\u6210\u5931\u8D25\uFF1B\u8303\u56F4 5\u2013120\u3002","cfg.suggestHint":"\u5F00\u542F\u540E\u63D0\u4EA4\u6846\u65C1\u4F1A\u51FA\u73B0\u300CAI \u751F\u6210\u300D\u6309\u94AE\uFF1A\u6839\u636E\u5F53\u524D\u53D8\u66F4\u4E0E\u4ED3\u5E93\u65E2\u6709\u63D0\u4EA4\u98CE\u683C\u751F\u6210\u63D0\u4EA4\u4FE1\u606F\uFF0C\u586B\u5165\u540E\u53EF\u7F16\u8F91\u518D\u63D0\u4EA4\u3002\u751F\u6210\u7684\u8BF7\u6C42\u4F1A\u4F7F\u7528\u4F60\u5728 DSH \u4E2D\u914D\u7F6E\u7684\u6A21\u578B\uFF0Cdiff \u5185\u5BB9\u4F1A\u53D1\u9001\u7ED9\u6A21\u578B\u4F9B\u5E94\u5546\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.notLoaded":"\u914D\u7F6E\u672A\u52A0\u8F7D\uFF1A\u8BE5\u914D\u7F6E\u7531\u8FD0\u884C\u4E2D\u7684\u5BBF\u4E3B\u63D0\u4F9B\uFF0C\u82E5\u957F\u65F6\u95F4\u7A7A\u767D\u8BF7\u91CD\u542F DSH \u540E\u91CD\u8BD5\u3002","cfg.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"},lr={"panel.tab":"Git","panel.fontDecrease":"Decrease font size","panel.fontReset":"Reset font size","panel.fontIncrease":"Increase font size","tab.overview":"Overview","tab.changes":"Changes","tab.files":"Files","pill.unavailable":"Git unavailable","pill.detached":"detached HEAD","pill.synced":"Everything committed","pill.dirty":"Uncommitted changes","common.loading":"Loading\u2026","common.retry":"Retry","common.close":"Close","common.cancel":"Cancel","ops.aiHint":"Tip: Trust AI more, try direct Git\u2011operation execution by AI.","version.check":"Check for updates","version.checking":"Checking\u2026","version.upToDate":"Up to date ({current})","version.updateAvailable":"New version {latest} available (current {current})","version.viewRelease":"View release","version.error":"Check failed","version.noRepo":"Repository not configured","version.openRepo":"Visit @xbzbing/dsh-git-panel on GitHub \u2014 please give the project a little star \u2B50","overview.head":"All branches","overview.local":"Local","overview.remote":"Remote","overview.tags":"Tags","overview.search":"Search commits (message / hash)","overview.searchShort":"Search","overview.allUsers":"All authors","overview.allTime":"All time","overview.today":"Today","overview.last7d":"Last 7 days","overview.last30d":"Last 30 days","overview.selectCommit":"Select a commit to see details","overview.noMessage":"(no commit body)","overview.noResults":"No matching commits","overview.loadFailed":"Load failed","overview.detailFailed":"Failed to load details","overview.diffFailed":"Failed to load diff","overview.openFileDiff":"View this file\u2019s changes in this commit","overview.changeSummary":"{files} files","overview.expandDir":"Expand folder","overview.collapseDir":"Collapse folder","overview.fetch":"Fetch","overview.branchesError":"Failed to load branches","overview.filterBranch":"Filter by branch","overview.backToList":"Back to list","overview.createTag":"Create tag","switch.action":"Switch","switch.rowTitle":"Switch to {name}","switch.rowTitleTrack":"Create {name} tracking {ref} and switch to it","switch.detached":"detached HEAD","switch.confirmTitle":"Switch branch","switch.body":"Switch from {from} to {to}.","switch.trackingNote":"There is no local {name} yet: it will be created from {ref} and set to track it.","switch.dirtyWarn":"{count} file(s) have uncommitted changes.","switch.modeDirect":"Switch directly","switch.modeDirectHint":"Uncommitted changes come along; if they collide with the target branch, git refuses the switch and the work tree stays untouched.","switch.modeStash":"Stash the {count} file(s) first, then switch","switch.modeStashHint":"The changes (including untracked files) move to the top of the stash; restore them from Changes \u2192 Stash afterwards. Note: they are not restored automatically, and restoring may need manual conflict resolution.","switch.confirm":"Switch","switch.confirmStash":"Stash and switch","switch.switching":"Switching\u2026","switch.stashMessage":"Auto-stash before switching to {branch}","overview.revert":"Revert this commit","overview.reset":"Reset to here","tag.createTitle":"Create a tag at this commit","tag.namePlaceholder":"Tag name","tag.annotated":"Annotated tag (with message)","tag.messagePlaceholder":"Tag message","tag.create":"Create tag","tag.deleteTitle":"Delete tag","tag.deleteConfirm":'Delete tag "{name}"?',"tag.deleteOne":'Delete tag "{name}"',"ops.dirtyWarn":"There are uncommitted changes \u2014 they may be work the dsh AI is doing.","revert.title":"Revert commit","revert.body":"Appends a reverse commit at the current HEAD that undoes the changes in {ref}. Your working-tree changes are kept.","revert.confirm":"Revert","reset.title":"Reset branch","reset.body":"Moves the current branch HEAD from {from} to {to}.","reset.modeSoft":"Soft (--soft)","reset.softHint":"Moves HEAD; changes stay staged.","reset.modeMixed":"Mixed (--mixed, default)","reset.mixedHint":"Moves HEAD; changes stay in the working tree.","reset.modeHard":"Hard (--hard)","reset.hardHint":"Moves HEAD to this commit and discards all uncommitted changes (uncommitted changes cannot be recovered).","reset.hardOrphan":"Commits after the target leave the branch (still recoverable via git reflog).","reset.hardWarn":"The following uncommitted changes will be permanently discarded:","reset.lostMore":"\u2026 more uncommitted changes not shown (list capped)","reset.hardAck":"I understand these uncommitted changes will be lost","reset.hardAckClean":"I understand the consequences and confirm the reset","reset.confirm":"Reset","changes.groupStaged":"Staged changes","changes.groupUnstaged":"Changes","changes.groupUntracked":"Unversioned files","changes.selectFile":"Select a file to see its diff","changes.noChanges":"No uncommitted changes","changes.stageAll":"Stage all","changes.unstageAll":"Unstage all","changes.stage":"Stage","changes.unstage":"Unstage","changes.discard":"Discard changes","changes.discardConfirm":"Click again to confirm discard","changes.backToList":"Back to list","changes.stash":"Stash changes","stash.title":"Stash current changes","stash.messagePlaceholder":"Stash message (optional)","stash.save":"Stash","stash.section":"Stashes","stash.onBranch":"on {branch}","stash.apply":"Apply","stash.pop":"Pop","stash.drop":"Drop","stash.dropTitle":"Drop stash","stash.dropConfirm":"Drop this stash? This cannot be undone: {name}","files.selectFile":"Select a file to preview","files.loadFailed":"Load failed","files.backToTree":"Back to files","files.truncated":"Too many entries \u2014 truncated","files.tooLarge":"File too large to preview","files.binary":"Binary file \u2014 no preview","files.highlightOff":"Large file \u2014 syntax highlighting disabled for performance","files.lineTruncated":" \u2026 (line too long, truncated)","files.findPlaceholder":"Find in file","files.findNoMatch":"No results","files.findPrev":"Previous match","files.findNext":"Next match","files.findClose":"Close find","files.findCase":"Match case","files.previewMode":"Preview mode","files.source":"Source","files.render":"Rendered","files.copyPath":"Copy relative path","files.pathCopied":"Path copied","files.pathCopyFailed":"Copy failed","files.copyContent":"Copy file content","files.contentCopied":"Content copied","files.contentCopyFailed":"Copy failed","files.ignored":"Ignored by Git","files.copy":"Copy code","files.copied":"Copied","files.footnotes":"Footnotes","files.zoomBar":"Image zoom","files.zoomIn":"Zoom in","files.zoomOut":"Zoom out","files.zoomActual":"Actual size (100%)","files.zoomFit":"Fit to window","files.zoomFullscreen":"View fullscreen","files.gitNotInstalled":"Git is not installed; the Git panel is unavailable. Please install Git and try again.","files.propsTitle":"File properties","files.propsGroupStats":"Size & stats","files.propsGroupTime":"Timestamps","files.propsName":"Name","files.propsType":"Type","files.propsTypeImage":"{fmt} image","files.propsTypeText":"Text file","files.propsTypeBinary":"Binary file","files.propsTypeUnread":"Too large to read","files.propsTypeFmt":"{label} (.{ext})","files.propsRelPath":"Relative path","files.propsAbsPath":"Absolute path","files.propsCopyHint":"Click to copy","files.propsSize":"Size","files.propsSizeBytes":"({bytes} bytes)","files.propsLines":"Lines","files.propsImageSize":"Dimensions","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"Modified","files.propsUntracked":"Untracked","files.propsTrackedYes":"Tracked","files.propsStaged":"Staged","files.stAdded":"Added","files.stModified":"Modified","files.stDeleted":"Deleted","files.stRenamed":"Renamed","files.stConflicted":"Conflicted","files.stTypechange":"Type changed","stats.files":"{n} files","stats.lastChange":"changed {time}","stats.lastCommit":"last commit {time}","stats.staged":"{n} staged","stats.modified":"{n} modified","stats.untracked":"{n} untracked","stats.partial":"simplified","stats.partialHint":"Large change set \u2014 untracked line counts and last-change time are omitted to keep the panel responsive.","commit.placeholder":"Commit message","commit.commit":"Commit","commit.amend":"Amend previous commit","commit.suggest":"AI suggest","commit.suggesting":"Generating\u2026","commit.suggestOverwrite":'Click "AI suggest" again to replace the current message',"commit.suggestTruncated":"The diff was truncated; the suggestion may be incomplete","diff.unified":"Unified","diff.split":"Split","diff.before":"Before","diff.after":"After","diff.binary":"Binary file \u2014 no diff to show","diff.tooLarge":"Image too large to compare","diff.imageMissing":"Does not exist","diff.svgRender":"Rendered","diff.svgSource":"Source","diff.empty":"No differences","diff.expandAll":"Expand all","diff.collapse":"Collapse unchanged","diff.expandGap":"Expand all {n} lines","diff.expandUp":"Expand up {n} lines","diff.expandDown":"Expand down {n} lines","diff.expandCapped":"Large file: expanded {n} lines of context; the rest stays collapsed and can be expanded in place","diff.truncated":"git output exceeded the output cap: only the tail of this diff survived, so the opening changes and the +/- counts may be missing","time.justNow":"just now","time.minutesAgo":"{n}m ago","time.hoursAgo":"{n}h ago","time.daysAgo":"{n}d ago","error.generic":"Operation failed","error.notARepo":"Not a Git repository","error.noCwd":"This session has no working directory","error.localChangesBlock":"Local changes block this operation","error.emptyMessage":"Commit message cannot be empty","error.emptyDiff":"No changes to summarize","error.llmUnavailable":"AI service unavailable","error.llmFailed":"AI generation failed","error.suggestDisabled":"AI suggest is turned off in the plugin config","error.conflict":"Applying the stash produced conflicts; the stash entry is kept \u2014 resolve them and retry","error.revertConflict":"The revert would conflict with the current content; it was cancelled automatically (your working tree is unchanged)","error.revertStuck":"The revert conflicted and could not be auto-cancelled; the repository is mid-revert \u2014 run `git revert --abort` or resolve it manually","error.revertMerge":"This is a merge commit; the panel cannot revert it (a mainline parent is required) \u2014 use `git revert -m` on the command line","error.indexBusy":"Git is busy (another process holds the index lock); try again shortly","error.notFound":"Target not found (the branch / tag / stash may have been removed or renamed)","error.branchInUse":"That branch is checked out in another worktree, so it cannot be switched to here","error.stashSwitchFailed":"The uncommitted changes were stashed (restore them from Changes \u2192 Stash), but the switch failed: {reason}","error.invalidName":"Invalid name","error.notFastForward":"Local and remote have diverged \u2014 a fast-forward pull is not possible; merge or rebase manually","error.pushRejected":"Push rejected: the remote has new commits \u2014 run \u201CCheck sync\u201D and pull first, then push","error.authFailed":"Authentication failed: no usable git credentials (HTTPS needs a credential helper, SSH needs a key). Push once from the command line first to cache them","status.openRepo":"Open the repository home in the browser","status.openRepoOn":"Open the repository home on {host}","status.synced":"Up to date with remote","status.ahead":"{n} ahead","status.behind":"{n} behind","status.diverged":"Diverged ({ahead} ahead / {behind} behind)","status.noUpstream":"No upstream branch","status.detached":"Detached HEAD \u2014 no branch sync state","status.check":"Check sync status","status.checkTitle":"Check sync with the remote: runs git fetch to update refs and refresh the ahead/behind counts; your working tree is untouched","status.pull":"Pull","status.pulling":"Syncing\u2026","status.pullTitle":"Fast-forward pull of remote updates","status.pullConfirmTitle":"Pull remote updates","status.pullConfirmBody":"Fast-forwards the current branch {branch} to the latest remote commit ({behind} behind). Only possible when not diverged; it creates no merge commit and leaves your uncommitted work untouched.","status.pullConfirm":"Pull","status.pullScope":"Brings in {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pullScopeLoading":"Measuring incoming changes\u2026","status.push":"Push","status.pushTitle":"Push local commits to the remote","status.pushConfirmTitle":"Push to remote","status.pushConfirmBody":"Pushes the {ahead} commits that {branch} is ahead of the remote to its upstream. Fast-forward only \u2014 it never force-overwrites remote history.","status.pushConfirm":"Push","status.pushing":"Pushing\u2026","status.pushScope":"Pushes {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pushScopeLoading":"Measuring outgoing changes\u2026","status.publish":"Publish","status.publishTitle":"Publish the branch and set its upstream","status.publishConfirmTitle":"Publish branch to remote","status.publishConfirmBody":"The current branch {branch} has no upstream yet. This runs git push -u {remote} to create a same-named branch on the remote and set it as the upstream.","status.publishConfirm":"Publish","status.publishing":"Publishing\u2026","cfg.title":"Input-bar branch marker","cfg.toggle":"Show input-bar marker","cfg.hint":"When on, the input bar shows the zsh-style <repo> (branch) marker; when off, a status dot appears beside the Git tab instead. Saved changes apply immediately.","cfg.diffTitle":"Default diff view","cfg.diffHint":"Choose the layout diffs open with: unified is a single inline column, split is side-by-side. You can still switch per diff. Saved changes apply immediately.","cfg.diffUnified":"Unified (single inline column)","cfg.diffSplit":"Split (side-by-side)","cfg.graphTitle":"Commit graph line style","cfg.graphHint":"Choose how the commit graph draws its lines: parallel is the VSCode / GUI style \u2014 each branch keeps its own column and a shared ancestor shows as parallel lines; compact is the git log style \u2014 a shared ancestor merges into one column with fewer lines. Saved changes apply immediately.","cfg.graphParallel":"Parallel (VSCode style)","cfg.graphCompact":"Compact (git log style)","cfg.suggestTitle":"AI commit message","cfg.suggestToggle":"Show AI suggest button in the commit box","cfg.suggestLangLabel":"Language","cfg.suggestLangAuto":"Auto","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"Auto follows the language you write commits in for this repository (recency-weighted, with the current git author preferred, ignoring mechanical commits such as releases and merges); \u4E2D\u6587 / English pin it.","cfg.suggestMaxBytesLabel":"Input budget","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"Diff bytes sent to the model; beyond it the diff is truncated. Range 16\u2013512.","cfg.suggestOutputLabel":"Output limit","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"Model generation budget; reasoning tokens count against it on thinking models. Range 256\u201316384.","cfg.suggestTimeoutLabel":"Generation timeout","cfg.suggestTimeoutUnit":"s","cfg.suggestTimeoutHint":"Generation fails after the timeout. Range 5\u2013120.","cfg.suggestHint":'When on, an "AI suggest" button appears beside the commit button: it writes a commit message from the current changes and the repository\u2019s existing commit style, filled in for you to edit before committing. Generation uses the model configured in DSH; the diff is sent to that model provider. Saved changes apply immediately.',"cfg.notLoaded":"Config not loaded: it is served by the running host. Restart DSH if this stays blank.","cfg.saveFailed":"Save failed, please retry"};var Vt=require("react");var ni=new Set(["cwd-unavailable"]),Tn=3e4,ri=6e4,Kt=class{constructor(t,n){this.remote=t;this.sessionId=n}view={state:"cold"};listeners=new Set;timer;inflight;pendingRefresh=!1;disposed=!1;pollMs=Tn;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getSnapshot(){return this.view}ensure(){this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){return this.inflight!==void 0?(this.pendingRefresh=!0,this.inflight):this.disposed?Promise.resolve():(this.view.state==="cold"&&this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId}).then(t=>{if(!this.disposed){if(t.ok)this.pollMs=t.value.refreshIntervalMs||Tn,this.setView({state:"ready",snapshot:t.value});else if(t.error.code!=="cancelled")if(ni.has(t.error.code))this.pollMs=ri,this.setView({state:"no-cwd"});else if(t.error.code==="not-a-git-repo"){let n=t.error;this.setView({state:"error",error:{code:"not-a-git-repo",...n.cwd?{cwd:n.cwd}:{},...n.showInputPill!==void 0?{showInputPill:n.showInputPill}:{}}})}else if(t.error.code==="git-unavailable"){let n=t.error;this.setView({state:"error",error:{code:"git-unavailable",...n.detail?{detail:n.detail}:{},...n.cwd?{cwd:n.cwd}:{},...n.isGitRepo!==void 0?{isGitRepo:n.isGitRepo}:{}}})}else this.setView({state:"error",error:{code:t.error.code,..."detail"in t.error?{detail:t.error.detail}:{}}})}}).catch(t=>{this.disposed||this.setView({state:"error",error:{code:"git-unavailable",detail:t instanceof Error?t.message:String(t)}})}).finally(()=>{this.inflight=void 0,this.pendingRefresh&&!this.disposed?(this.pendingRefresh=!1,this.refresh()):this.schedulePoll()}),this.inflight)}resync(){this.disposed||this.refresh()}accept(t){this.disposed||(this.pollMs=t.refreshIntervalMs||Tn,this.setView({state:"ready",snapshot:t}),this.schedulePoll())}schedulePoll(){this.disposed||(this.timer!==void 0&&clearTimeout(this.timer),!(this.pollMs<=0)&&(this.timer=setTimeout(()=>{this.refresh()},this.pollMs)))}setView(t){this.view=t;for(let n of this.listeners)n()}dispose(){this.disposed=!0,this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0,this.listeners.clear()}};var ai="/api",ii="gitPanel";function oi(e){try{let t=e.get("connection")?.rpc,n=t?.call;if(t!==void 0&&typeof n=="function")return(r,a,i)=>n.call(t,ai,r,a,i)}catch{}}function si(e){let t=e;if(t===null||typeof t!="object")return{ok:!1,error:{code:"git-unavailable",message:"malformed rpc result"}};if(t.ok!==!0){let n=t.error;return{ok:!1,error:{code:typeof n?.code=="string"?n.code:"git-unavailable",message:typeof n?.message=="string"?n.message:void 0}}}return t.value===void 0?{ok:!1,error:{code:"git-unavailable",message:"missing value"}}:t.value}function ye(e,t){return!e.ok||e.value.kind!==t?null:e.value}function et(e){return e!==void 0&&e!==""}var dr=new WeakMap;function Pt(e){let t=dr.get(e);if(t!==void 0)return t;let n=async(a,i,o)=>{let s=oi(e);if(s===void 0)return{ok:!1,error:{code:"git-unavailable",message:"no connection"}};try{let l=await s(`${ii}/${a}`,{args:{request:i}},o);return si(l)}catch(l){return{ok:!1,error:{code:"git-unavailable",message:l instanceof Error?l.message:String(l)}}}},r={snapshot:(a,i)=>n("snapshot",a,i),run:(a,i)=>n("run",a,i),query:(a,i)=>n("query",a,i),suggest:(a,i)=>n("suggest",a,i),version:(a,i)=>n("version",a,i)};return dr.set(e,r),r}var pt=new Map,cr,Nn;function pr(e){Nn=e,cr=Pt(e)}function Dt(e){let t=pt.get(e);if(t===void 0){let n=cr??(Nn?Pt(Nn):void 0);t=new Kt(n??pi(),e),pt.set(e,t)}return t}var li=6e4,Ut=new Map;function di(e){let t=Ut.get(e);t!==void 0&&(clearTimeout(t),Ut.delete(e)),vt.set(e,(vt.get(e)??0)+1)}function ci(e){let t=(vt.get(e)??1)-1;if(t>0){vt.set(e,t);return}vt.delete(e);let n=setTimeout(()=>{Ut.delete(e),!((vt.get(e)??0)>0)&&(pt.get(e)?.dispose(),pt.delete(e))},li);Ut.set(e,n)}var vt=new Map;function zt(){for(let e of pt.values())e.resync()}function ur(){for(let e of pt.values())e.dispose();pt.clear()}function pi(){let e=async()=>({ok:!1,error:{code:"git-unavailable"}});return{snapshot:e,run:e,query:e,suggest:e,version:e}}function Wt(e){let[,t]=(0,Vt.useState)(0),n=e?Dt(e):void 0;return(0,Vt.useEffect)(()=>{if(n===void 0||e===void 0)return;di(e);let r=n.subscribe(()=>t(a=>a+1));return n.ensure(),()=>{r(),ci(e)}},[n,e]),n?n.getSnapshot():{state:"cold"}}var I=require("react");var gr="[data-conversation-tabs]",Ht='[data-conversation-tabs] button[role="tab"]',En=new Map,At=new Map;function fr(e,t){let n=At.get(e);if(n!==void 0&&n.size>0){for(let r of n)r(t);return}En.set(e,t)}function mr(e){let t=En.get(e);return t===void 0?null:(En.delete(e),t)}function hr(e,t){let n=At.get(e);return n===void 0&&(n=new Set,At.set(e,n)),n.add(t),()=>{let r=At.get(e);r!==void 0&&(r.delete(t),r.size===0&&At.delete(e))}}var ui=6e4,Mn=new Map;function yr(e,t){Mn.set(e,{tab:t,leftAt:Date.now()})}function br(e){let t=Mn.get(e);return t===void 0?null:Date.now()-t.leftAt>ui?(Mn.delete(e),null):t.tab}function vr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Ht);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}function wr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Ht);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")==="true";return!1}function xr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Ht);for(let n of t)if((n.textContent??"").trim()!==e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}var c=require("react"),hn=require("react-dom");var H=require("react");function ve(e,t=15){return(0,H.createElement)("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},e)}function qt({size:e}){return ve([(0,H.createElement)("circle",{key:"c",cx:8,cy:8,r:2.4}),(0,H.createElement)("line",{key:"l1",x1:8,y1:1.5,x2:8,y2:5.6}),(0,H.createElement)("line",{key:"l2",x1:8,y1:10.4,x2:8,y2:14.5})],e)}function kr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M4 2v8"}),(0,H.createElement)("path",{key:"b",d:"M2 4h4"}),(0,H.createElement)("circle",{key:"c",cx:4,cy:12,r:1.6}),(0,H.createElement)("circle",{key:"d",cx:12,cy:4,r:1.6}),(0,H.createElement)("path",{key:"e",d:"M12 6v4"}),(0,H.createElement)("path",{key:"f",d:"M10 12h4"})],e)}function Gn({size:e}){return ve([(0,H.createElement)("circle",{key:"a",cx:4,cy:3,r:1.6}),(0,H.createElement)("circle",{key:"b",cx:4,cy:13,r:1.6}),(0,H.createElement)("circle",{key:"c",cx:12,cy:5,r:1.6}),(0,H.createElement)("path",{key:"d",d:"M4 4.6v6.8"}),(0,H.createElement)("path",{key:"e",d:"M12 6.6c0 3-4 2.4-8 4"})],e)}function wt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M2 7V3h4l8 8-4 4z"}),(0,H.createElement)("circle",{key:"b",cx:4.5,cy:5.5,r:.8,fill:"currentColor"})],e)}function tt({size:e,open:t}){return ve([(0,H.createElement)("path",{key:"a",d:t?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})],e)}function nt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M4 4l8 8M12 4l-8 8"})],e)}function xt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M10 3L5 8l5 5"}),(0,H.createElement)("path",{key:"b",d:"M5 8h8"})],e)}function _r({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M2 3h12l-4.5 5.5V13L6.5 11V8.5z"})],e)}function jt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M13 8a5 5 0 1 1-1.5-3.5"}),(0,H.createElement)("path",{key:"b",d:"M13 2v3h-3"})],e)}function Sr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M8 2.6l1.4 4 4 1.4-4 1.4-1.4 4-1.4-4-4-1.4 4-1.4z"}),(0,H.createElement)("path",{key:"b",d:"M13 11.6v2.8M11.6 13h2.8"})],e)}function Cr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M4 2h5l3 3v9H4z"}),(0,H.createElement)("path",{key:"b",d:"M9 2v3h3"})],e)}function Rn({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M2 5.5h12V13H2z"}),(0,H.createElement)("path",{key:"b",d:"M1.5 3h13v2.5h-13z"}),(0,H.createElement)("path",{key:"c",d:"M6.5 8.5h3"})],e)}function Tr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,H.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,H.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"})],e)}function Nr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M3 7a5 5 0 1 1 1.3 3.4"}),(0,H.createElement)("path",{key:"b",d:"M3 3.5V7h3.5"})],e)}function Qt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M13 3v10"}),(0,H.createElement)("path",{key:"b",d:"M10.5 8L3 3.5v9z",fill:"currentColor"})],e)}function Er({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M5 2.5h4l2.5 2.5v7.5h-6.5z"}),(0,H.createElement)("path",{key:"b",d:"M9 2.5V5h2.5"}),(0,H.createElement)("path",{key:"c",d:"M11 12.5v1.5h-6.5V6"})],e)}function Mr({size:e=15}){return(0,H.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor"},(0,H.createElement)("path",{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"}))}function Gr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M8 2.5v7"}),(0,H.createElement)("path",{key:"b",d:"M4.5 7L8 10.5 11.5 7"}),(0,H.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function Ln({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M8 10.5v-7"}),(0,H.createElement)("path",{key:"b",d:"M4.5 6L8 2.5 11.5 6"}),(0,H.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function Rr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M12.5 7a4.5 4.5 0 0 0-8-2.3"}),(0,H.createElement)("path",{key:"b",d:"M3.5 9a4.5 4.5 0 0 0 8 2.3"}),(0,H.createElement)("path",{key:"c",d:"M4.3 2.2v2.5h2.5"}),(0,H.createElement)("path",{key:"d",d:"M11.7 13.8v-2.5H9.2"})],e)}function Lr({size:e}){return ve([(0,H.createElement)("circle",{key:"a",cx:8,cy:8,r:6}),(0,H.createElement)("path",{key:"b",d:"M8 7.2v3.6"}),(0,H.createElement)("circle",{key:"c",cx:8,cy:5.2,r:.5,fill:"currentColor",stroke:"none"})],e)}function Pr({size:e=15,filled:t}){return(0,H.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},(0,H.createElement)("path",{d:"M8 1.8l1.76 3.57 3.94.57-2.85 2.78.67 3.92L8 10.78l-3.52 1.85.67-3.92L2.3 5.94l3.94-.57z"}))}function Dr(e){let t=0;for(let n of e){t=Math.max(t,n.lane+1);for(let r of n.edges)t=Math.max(t,r.fromLane+1,r.toLane+1)}return t}function zr(e,t){let n=[],r=[],a=[],i=[],o=0,s=()=>{if(i.length===0)return o++;let d=Math.min(...i);return i.splice(i.indexOf(d),1),d},l=d=>{d!==null&&!i.includes(d)&&i.push(d)};for(let d of e){let p=C=>{let R=r.findIndex(Q=>Q===C);return R===-1&&(R=r.findIndex(Q=>Q===null),R===-1&&(R=r.length,r.push(null),a.push(null)),r[R]=C,a[R]=s()),R},u=r.some(C=>C===d.hash),g=p(d.hash),S=a[g],b=[...r],_=[...a],k=d.parents,M=k.length>=2;for(let C=0;C<r.length;C++)C!==g&&r[C]===d.hash&&(l(a[C]),r[C]=null,a[C]=null);let D=-1,J=[];if(k.length===0)l(a[g]),r[g]=null,a[g]=null;else{let C=k[0],R=t==="compact"?r.findIndex((Q,U)=>Q===C&&U!==g):-1;if(R===-1)r[g]=C,D=g;else{let Q=Math.min(g,R),U=Math.max(g,R);r[Q]=C,l(a[U]),r[U]=null,a[U]=null,D=Q}for(let Q=1;Q<k.length;Q++)J.push(p(k[Q]))}let F=[];for(let C=0;C<b.length;C++){let R=b[C];if(R!==null)if(R===d.hash){if(C===g&&!u)continue;F.push({fromLane:C,toLane:g,color:_[C],kind:"into"})}else{let Q=r[C]===R?C:r.findIndex(U=>U===R);Q!==-1&&F.push({fromLane:C,toLane:Q,color:_[C],kind:"pass"})}}D!==-1&&F.push({fromLane:g,toLane:D,color:a[D],kind:"out"});for(let C of J)F.push({fromLane:g,toLane:C,color:a[C],kind:"out"});for(n.push({commit:d,lane:g,color:S,edges:F,merge:M});r.length>0&&r[r.length-1]===null;)r=r.slice(0,-1),a=a.slice(0,-1)}return n}function Ar(e){let t={name:"",path:"",dir:!0,children:[]};for(let n of e){let r=n.path.split("/").filter(o=>o!==""),a=t,i="";for(let o=0;o<r.length;o++){let s=r[o];i=i===""?s:`${i}/${s}`;let l=o===r.length-1,d=a.children.find(p=>p.name===s&&p.dir===!l);d===void 0&&(d={name:s,path:i,dir:!l,children:[],...l?{meta:n.meta}:{}},a.children.push(d)),a=d}}return Hr(t),Fr(t.children)}function Hr(e){e.children.sort((t,n)=>t.dir!==n.dir?t.dir?-1:1:t.name.localeCompare(n.name));for(let t of e.children)Hr(t)}function Fr(e){return e.map(t=>{if(!t.dir)return t;let n=t;for(;n.children.length===1&&n.children[0].dir;){let r=n.children[0];n={name:`${n.name}/${r.name}`,path:r.path,dir:!0,children:r.children}}return{...n,children:Fr(n.children)}})}function rt(e,t,n){if(e===null)return"";let r=typeof e=="number"?e:Date.parse(e);if(!Number.isFinite(r))return"";let a=Math.max(0,t-r),i=Math.floor(a/6e4);if(i<1)return n("time.justNow");if(i<60)return n("time.minutesAgo",{n:i});let o=Math.floor(i/60);if(o<24)return n("time.hoursAgo",{n:o});let s=Math.floor(o/24);return n("time.daysAgo",{n:s})}function Ft(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Bt(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var Yt={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"U",conflicted:"!",typechange:"T"};function kt(e){return e==="added"||e==="untracked"?"gp-status--added":e==="deleted"?"gp-status--deleted":e==="renamed"?"gp-status--renamed":"gp-status--modified"}function Br(e,t){return e.some(n=>n.status==="untracked"&&(n.isDirectory?t.startsWith(`${n.path}/`):n.path===t))}var x=require("react");var Re={maxBytes:{min:16384,max:524288,default:131072},maxOutputTokens:{min:256,max:16384,default:4096},timeoutMs:{min:5e3,max:12e4,default:15e3}},Zt=["auto","zh","en"],Pn="auto",gi={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff"};function It(e){let t=e.lastIndexOf(".");return t<0?null:gi[e.slice(t+1).toLowerCase()]??null}function Ir(e){return/^Binary files .* differ$/m.test(e)||/^GIT binary patch$/m.test(e)}function Or(e){return It(e)!==null}function $r(e){return/\.svg$/i.test(e)}function fi(e){let t=e.split(`
671
- `),n=[],r=!1;for(let a of t){if(a.startsWith("@@")){r=!0;continue}if(r){if(a.startsWith("diff ")||a.startsWith("index ")){r=!1;continue}a!==""&&n.push(a)}}return n}function Xr(e){let t=0,n=0;for(let r of fi(e))r.startsWith("+")?t++:r.startsWith("-")&&n++;return{add:t,del:n}}var mi=/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function Jr(e,t){let n=[],r=e.split(`
672
- `),a=Number.isFinite(t)&&t>0?t:0,i=0,o=0,s=!0,l=!1,d=0;for(;d<r.length&&!r[d].startsWith("@@");d++);for(;d<r.length;d++){let u=r[d];if(u.startsWith("@@")){let b=mi.exec(u);if(b){let _=Number(b[1]),k=Number(b[3]),M=_-k;if(s)k>1&&n.push(ut({rightStart:1,count:k-1,delta:M,atStart:!0}));else{let D=k-o;D>0&&n.push(ut({rightStart:o,count:D,delta:M,atStart:!1}))}i=_,o=k,s=!1}n.push({kind:"hunk",leftNo:null,rightNo:null,leftText:null,rightText:null,text:u});continue}if(u.startsWith("\\"))continue;let g=u[0],S=u.slice(1);g==="+"?(n.push({kind:"add",leftNo:null,rightNo:o,leftText:null,rightText:S}),o++,l=!0):g==="-"?(n.push({kind:"del",leftNo:i,rightNo:null,leftText:S,rightText:null}),i++,l=!0):g===" "&&(n.push({kind:"context",leftNo:i,rightNo:o,leftText:S,rightText:S}),i++,o++,l=!0)}let p=a-o+1;return l&&!s&&o>0&&p>0&&n.push(ut({rightStart:o,count:p,delta:i-o,atStart:!1})),hi(n)}function Kr(e,t){let n=e[e.length-1],r=n!==void 0&&n.kind==="gap",a=r?n.gap:void 0,i=r?e[e.length-2]:n,o=i===void 0?null:i.rightNo,s=o!==null&&o>0?o:0,l=Number.isFinite(t)?t-s:0,d=l>0?l:0;if(a===void 0){if(d===0||s===0)return e;let p=i===void 0?null:i.leftNo;return p===null?null:[...e,ut({rightStart:s+1,count:d,delta:p-s,atStart:!1})]}return a.rightStart===s+1&&a.count===d?e:d===0?e.slice(0,-1):[...e.slice(0,-1),ut({rightStart:s+1,count:d,delta:a.delta,atStart:!1})]}function ut(e){return{kind:"gap",leftNo:null,rightNo:null,leftText:null,rightText:null,gap:e}}function hi(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind==="del"){let a=[],i=n;for(;i<e.length&&e[i].kind==="del";)a.push(e[i]),i++;let o=[];for(;i<e.length&&e[i].kind==="add";)o.push(e[i]),i++;let s=Math.max(a.length,o.length);for(let l=0;l<s;l++){let d=a[l],p=o[l];if(d&&p){let u=yi(d.leftText??"",p.rightText??"");t.push({kind:"mod",leftNo:d.leftNo,rightNo:p.rightNo,leftText:d.leftText,rightText:p.rightText,...u!==null?{leftWord:u.left,rightWord:u.right}:{}})}else d?t.push({kind:"del",leftNo:d.leftNo,rightNo:null,leftText:d.leftText,rightText:null}):p&&t.push({kind:"add",leftNo:null,rightNo:p.rightNo,leftText:null,rightText:p.rightText})}n=i}else t.push(r),n++}return t}function yi(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let a=0;for(;a<n-r&&e[e.length-1-a]===t[t.length-1-a];)a++;return r===0&&a===0?null:{left:[r,e.length-a],right:[r,t.length-a]}}function bi(e,t,n){return n.map((r,a)=>{let i=t+a;return{kind:"context",leftNo:i+e,rightNo:i,leftText:r,rightText:r}})}var gt=20;function Ur(e){let t=[];for(let n of e)n.kind==="mod"?(t.push({kind:"del",leftNo:n.leftNo,rightNo:null,leftText:n.leftText,rightText:null,...n.leftWord!==void 0?{leftWord:n.leftWord}:{}}),t.push({kind:"add",leftNo:null,rightNo:n.rightNo,leftText:null,rightText:n.rightText,...n.rightWord!==void 0?{rightWord:n.rightWord}:{}})):t.push(n);return t}function Vr(e,t,n,r,a,i){let o=e.findIndex(u=>u.kind==="gap"&&u.gap?.rightStart===t);if(o<0)return e.slice();let s=e[o].gap,l=bi(s.delta,r,a),d=[],p=s.count;if(n==="all"||a.length>=p)d.push(...l);else if(n==="down")d.push(...l),i||d.push(ut({rightStart:s.rightStart+a.length,count:p-a.length,delta:s.delta,atStart:!1}));else{if(a.length===0)return[...e.slice(0,o),...e.slice(o+1)];let u=p-a.length;d.push(ut({rightStart:s.rightStart,count:u,delta:s.delta,atStart:s.atStart})),d.push(...l)}return[...e.slice(0,o),...d,...e.slice(o+1)]}var pn=require("@deepseek-ai/dsh-client-ui-primitives");function Wr(e,t){let n=[[],[],[]],r=0;for(let a of e){let i=r+a.text.length,o=[r,Math.max(r,Math.min(i,t[0])),Math.max(r,Math.min(i,t[1])),i];for(let s=0;s<3;s++){let l=a.text.slice(o[s]-r,o[s+1]-r);l!==""&&n[s].push({text:l,style:a.style})}r=i}return n}function qr(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.size>=8e3&&t.clear(),t.set(n,r),r}}function St(e){let t=new Array(e.length+1);t[0]=0;for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t}function jr(e,t){let n=0,r=e.length-1;for(;n<r;){let a=n+r+1>>1;e[a]<=t?n=a:r=a-1}return n}function Ct(e,t,n,r){let a=e.length-1;if(a<=0)return{first:0,last:0};let i=jr(e,t-r),o=Math.min(a,jr(e,t+n+r)+1);return{first:i,last:o}}function en(e,t,n,r){return t<0?e:t>=e.first&&t<e.last?{first:Math.min(e.first,Math.max(0,t-r)),last:Math.max(e.last,Math.min(n,t+r))}:{first:Math.max(0,t-r),last:Math.min(n,t+r)}}var ft=require("react");function Tt(){let[e,t]=(0,ft.useState)({top:0,height:0}),n=(0,ft.useRef)(null),r=(0,ft.useRef)(null);return{setEl:(0,ft.useCallback)(i=>{if(r.current!==null&&(r.current(),r.current=null),n.current=i,i===null)return;let o=()=>t(l=>{let d=i.scrollTop,p=i.clientHeight;return l.top===d&&l.height===p?l:{top:d,height:p}});o(),i.addEventListener("scroll",o,{passive:!0});let s=typeof ResizeObserver<"u"?new ResizeObserver(o):null;s?.observe(i),r.current=()=>{i.removeEventListener("scroll",o),s?.disconnect()}},[]),viewport:e,elRef:n}}var Ne=require("react"),tn=5e3,nn=120;function rn(e,t){let[n,r]=(0,Ne.useState)(e);return(0,Ne.useEffect)(()=>{let a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}function an(e,t){if(t==="")return[];let n=[],r=0;for(;;){let a=e.indexOf(t,r);if(a<0)break;n.push([a,a+t.length]),r=a+t.length}return n}function Dn(e,t,n,r,a){if(n>=r)return[];if(e===void 0)return[t.slice(n,r)];let i=[],o=0,s=0;for(let l of e){let d=o+l.text.length,p=Math.max(n,o),u=Math.min(r,d);if(u>p&&i.push((0,Ne.createElement)("span",{key:`${a}-${s++}`,style:l.style},l.text.slice(p-o,u-o))),o=d,o>=r)break}return i}function on(e,t,n,r,a,i){let o=[],s=0,l=[...t].sort((d,p)=>d[0]-p[0]);for(let[d,p]of l){if(d<s)continue;d>s&&o.push(...Dn(n,e,s,d,`${r}b${s}`));let u=a!==null&&a[0]===d&&a[1]===p;o.push((0,Ne.createElement)("mark",{key:`mk${r}-${d}`,className:`gp-find-hit${u?" gp-find-hit--active":""}`,...u?{ref:i}:{}},Dn(n,e,d,p,`mk${r}-${d}`))),s=p}return s<e.length&&o.push(...Dn(n,e,s,e.length,`${r}e`)),o}function sn(e){return(0,Ne.createElement)("div",{key:"find",className:"gp-find"},[(0,Ne.createElement)("input",{key:"in",ref:e.inputRef,className:"gp-find__input",type:"text",placeholder:e.t("files.findPlaceholder"),value:e.query,spellCheck:!1,"aria-label":e.t("files.findPlaceholder"),onChange:t=>e.onChange(t.target.value),onKeyDown:t=>{t.key==="Escape"?(t.preventDefault(),t.stopPropagation(),e.onClose()):t.key==="Enter"&&(t.preventDefault(),e.onStep(t.shiftKey?-1:1))}}),(0,Ne.createElement)("button",{key:"case",type:"button",className:`gp-find__btn gp-find__case${e.caseSensitive?" gp-find__case--active":""}`,title:e.t("files.findCase"),"aria-label":e.t("files.findCase"),"aria-pressed":e.caseSensitive,onClick:()=>e.onToggleCase()},"Aa"),(0,Ne.createElement)("span",{key:"cnt",className:"gp-find__count"},e.query===""?"":e.matches===0?e.t("files.findNoMatch"):`${e.active+1}/${e.matches}`),(0,Ne.createElement)("button",{key:"prev",type:"button",className:"gp-find__btn",title:e.t("files.findPrev"),"aria-label":e.t("files.findPrev"),disabled:e.matches===0,onClick:()=>e.onStep(-1)},"\u2039"),(0,Ne.createElement)("button",{key:"next",type:"button",className:"gp-find__btn",title:e.t("files.findNext"),"aria-label":e.t("files.findNext"),disabled:e.matches===0,onClick:()=>e.onStep(1)},"\u203A"),(0,Ne.createElement)("button",{key:"x",type:"button",className:"gp-find__btn",title:e.t("files.findClose"),"aria-label":e.t("files.findClose"),onClick:()=>e.onClose()},"\u2715")])}var at=require("react");var X=require("react"),ra=require("react-dom");function Yr(e){let t=e.deltaMode===1?8:e.deltaMode===2?24:1;return Math.sign(e.deltaY)*Math.min(24,Math.abs(e.deltaY*t))}function Zr(e){let t=Math.sign(e)*Math.min(24,Math.abs(e));return t<=0?1-2*t/100:1/(1+2*t/100)}var vi=.1,wi=8,zn=1.25;function ea(e){return Number.isFinite(e)?Math.min(wi,Math.max(vi,e)):1}function An(e,t,n){return(e+t)*n-t}var Qr=3;function ta(e,t){return e*e+t*t>=Qr*Qr}function na(e,t,n,r){return{left:e-n,top:t-r}}var xi=300;function Ot({src:e,alt:t,t:n,viewportClass:r,fullscreen:a=!0,onEmptyAreaMouseDown:i}){let o=(0,X.useRef)(null),s=(0,X.useRef)(null),l=(0,X.useRef)(null),[d,p]=(0,X.useState)(null),[u,g]=(0,X.useState)("fit"),[S,b]=(0,X.useState)(null),[_,k]=(0,X.useState)(!1),[M,D]=(0,X.useState)(!1),J=(0,X.useRef)("fit"),F=(0,X.useRef)(null),C=(0,X.useRef)(null),R=(0,X.useRef)(null),Q=(0,X.useRef)(0),U=(0,X.useCallback)(()=>{let w=l.current;return w===null||w.naturalWidth===0||w.clientWidth===0?null:w.clientWidth/w.naturalWidth},[]),K=(0,X.useCallback)((w,T,j)=>{let Y=s.current,m=l.current;if(Y===null||m===null||m.naturalWidth===0||m.clientWidth===0)return;let G=m.clientWidth/m.naturalWidth,B=ea(w);if(B===G)return;let P=Y.getBoundingClientRect();F.current={x:T-P.left,y:j-P.top,ratio:B/G},g(B)},[]),ae=(0,X.useCallback)(w=>{let T=s.current,j=U();if(T===null||j===null)return;let Y=T.getBoundingClientRect();K(j*w,Y.left+Y.width/2,Y.top+Y.height/2)},[U,K]),z=(0,X.useCallback)(()=>{let w=s.current;if(w===null)return;let T=w.getBoundingClientRect();K(1,T.left+T.width/2,T.top+T.height/2)},[K]),W=(0,X.useCallback)(()=>{g("fit")},[]),O=(0,X.useCallback)(()=>{let w=l.current;w===null||w.naturalWidth===0||w.clientWidth===0||b(Math.round(w.clientWidth/w.naturalWidth*100))},[]);(0,X.useLayoutEffect)(()=>{J.current=u,u==="fit"&&O();let w=F.current;F.current=null;let T=s.current;w===null||T===null||(T.scrollLeft=An(T.scrollLeft,w.x,w.ratio),T.scrollTop=An(T.scrollTop,w.y,w.ratio))},[u,O]),(0,X.useEffect)(()=>{J.current="fit",F.current=null,C.current=null,g("fit"),p(null),b(null)},[e]),(0,X.useEffect)(()=>{let w=o.current;if(w===null)return;let T=G=>{if(!G.ctrlKey)return;G.cancelable&&G.preventDefault();let B=l.current;if(B===null||!B.complete||B.naturalWidth===0)return;let P=U();P!==null&&K(P*Zr(Yr(G)),G.clientX,G.clientY)},j=G=>{let B=G,P=U();P!==null&&(B.cancelable&&B.preventDefault(),C.current={base:P,x:B.clientX,y:B.clientY})},Y=G=>{let B=G,P=C.current;P!==null&&(B.cancelable&&B.preventDefault(),K(P.base*B.scale,P.x,P.y))},m=()=>{C.current=null};return w.addEventListener("wheel",T,{passive:!1}),w.addEventListener("gesturestart",j,{passive:!1}),w.addEventListener("gesturechange",Y,{passive:!1}),w.addEventListener("gestureend",m),()=>{w.removeEventListener("wheel",T),w.removeEventListener("gesturestart",j),w.removeEventListener("gesturechange",Y),w.removeEventListener("gestureend",m)}},[U,K]);let se=(0,X.useCallback)(w=>{if(w.button!==0||w.pointerType!=="mouse")return;let T=s.current;if(T===null)return;let{offsetX:j,offsetY:Y}=w.nativeEvent;w.target===T&&(j>=T.clientWidth||Y>=T.clientHeight)||(R.current={id:w.pointerId,x:w.clientX,y:w.clientY,left:T.scrollLeft,top:T.scrollTop,pan:T.scrollWidth>T.clientWidth||T.scrollHeight>T.clientHeight,moved:!1})},[]);(0,X.useEffect)(()=>{let w=Y=>{let m=R.current;m===null||Y!==m.id||(m.moved&&(Q.current=performance.now()),R.current=null,D(!1))},T=Y=>{let m=R.current;if(m===null||Y.pointerId!==m.id)return;if(Y.buttons===0){w(Y.pointerId);return}let G=Y.clientX-m.x,B=Y.clientY-m.y;if(!m.moved){if(!ta(G,B))return;m.moved=!0,D(!0)}let P=s.current;if(P===null||!m.pan)return;let ue=na(m.left,m.top,G,B);P.scrollLeft=ue.left,P.scrollTop=ue.top},j=Y=>{w(Y.pointerId)};return window.addEventListener("pointermove",T),window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j),()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j)}},[]),(0,X.useEffect)(()=>{let w=s.current;if(w===null||typeof ResizeObserver>"u")return;let T=new ResizeObserver(()=>{J.current==="fit"&&O()});return T.observe(w),()=>T.disconnect()},[O]);let q=(0,X.useCallback)(()=>{let w=l.current;w!==null&&(p({w:w.naturalWidth,h:w.naturalHeight}),J.current==="fit"&&O())},[O]),de=(0,X.useCallback)(()=>{performance.now()-Q.current<xi||(u==="fit"?z():W())},[u,z,W]),le=(0,X.useCallback)(()=>{k(!1)},[]),he=u==="fit"?S!==null?`${S}%`:"\u2014":`${Math.round(u*100)}%`,be=u!=="fit"&&d!==null?{width:`${d.w*u}px`,maxWidth:"none",maxHeight:"none"}:void 0,ee=d!==null?(0,X.createElement)("div",{key:"bar",className:"gp-zoom__bar",role:"group","aria-label":n("files.zoomBar")},[(0,X.createElement)("button",{key:"out",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomOut"),title:n("files.zoomOut"),onClick:()=>ae(1/zn)},"\u2212"),(0,X.createElement)("button",{key:"pct",type:"button",className:"gp-zoom__btn gp-zoom__pct","aria-label":`${he}\uFF0C${n("files.zoomActual")}`,title:n("files.zoomActual"),onClick:z},he),(0,X.createElement)("button",{key:"in",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomIn"),title:n("files.zoomIn"),onClick:()=>ae(zn)},"+"),(0,X.createElement)("button",{key:"fit",type:"button",className:"gp-zoom__btn gp-zoom__btn--text","aria-pressed":u==="fit",onClick:W},n("files.zoomFit")),a?(0,X.createElement)("button",{key:"fs",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomFullscreen"),title:n("files.zoomFullscreen"),onClick:()=>k(!0)},"\u2921"):null]):null;return(0,X.createElement)("div",{className:"gp-zoom",ref:o,"data-zoomed":u==="fit"?void 0:"true","data-dragging":M?"true":void 0},[(0,X.createElement)("div",{key:"vp",className:`gp-zoom__scroll ${r}`,ref:s,onPointerDown:se,onMouseDown:i===void 0?void 0:w=>{w.target===w.currentTarget&&i()}},(0,X.createElement)("img",{key:"img",ref:l,className:"gp-zoom__img",src:e,alt:t,style:be,draggable:!1,onLoad:q,onDoubleClick:de})),ee,_?(0,X.createElement)(ki,{key:"lb",src:e,alt:t,t:n,onClose:le}):null])}function ki({src:e,alt:t,t:n,onClose:r}){let a=(0,X.useRef)(null),i=(0,X.useRef)(null),o=(0,X.useRef)(null);return(0,X.useEffect)(()=>{o.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i.current?.focus();let s=()=>{let d=a.current;return d===null?[]:[...d.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(p=>!p.hasAttribute("disabled")&&p.getClientRects().length>0)},l=d=>{if(d.key==="Escape"){d.stopPropagation(),r();return}if(d.key!=="Tab")return;let p=s();if(p.length===0)return;let u=document.activeElement instanceof HTMLElement?document.activeElement:null,g=u===null?-1:p.indexOf(u);d.preventDefault();let S=d.shiftKey?-1:1,b=g===-1?S===-1?p.length-1:0:(g+S+p.length)%p.length;p[b]?.focus()};return window.addEventListener("keydown",l,!0),()=>{window.removeEventListener("keydown",l,!0),o.current?.focus()}},[r]),(0,ra.createPortal)((0,X.createElement)("div",{className:"gp-zl-backdrop",ref:a,role:"dialog","aria-modal":"true","aria-label":n("files.zoomFullscreen")},[(0,X.createElement)("div",{key:"stage",className:"gp-zl-stage"},[(0,X.createElement)("div",{key:"mask",className:"gp-zl-mask","aria-hidden":"true",onMouseDown:r}),(0,X.createElement)("div",{key:"frame",className:"gp-zl-frame"},(0,X.createElement)(Ot,{src:e,alt:t,t:n,viewportClass:"gp-zl-viewport",fullscreen:!1,onEmptyAreaMouseDown:r})),(0,X.createElement)("button",{key:"close",ref:i,type:"button",className:"gp-zl-close","aria-label":n("common.close"),onClick:r},(0,X.createElement)(nt,{size:16}))])]),document.body)}function ln(e,t,n){let r=n(`diff.${e}`);return(0,at.createElement)("div",{className:`gp-imgcmp__pane gp-imgcmp__pane--${e}`},[(0,at.createElement)("div",{key:"head",className:"gp-imgcmp__head"},r),t===void 0?(0,at.createElement)("div",{key:"missing",className:"gp-imgcmp__missing"},n("diff.imageMissing")):(0,at.createElement)(Ot,{key:"img",src:t,alt:r,t:n,viewportClass:"gp-imgcmp__img"})])}function aa({oldUrl:e,newUrl:t,mode:n,t:r}){return n==="before"?(0,at.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},ln("before",e,r)):n==="after"?(0,at.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},ln("after",t,r)):(0,at.createElement)("div",{className:"gp-imgcmp"},[ln("before",e,r),ln("after",t,r)])}var Hn=20,_i=27,Si=29,ia=12,Ci=600,un=(0,x.memo)(function({text:t,mode:n,path:r,remote:a,sessionId:i,base:o,commit:s,expanded:l,truncated:d,newLines:p,t:u}){let g=(0,x.useMemo)(()=>Jr(t,p),[t,p]),S=Ir(t),b=(0,pn.useCodeHighlighter)(r===void 0?void 0:(0,pn.languageForPath)(r)),_=(0,x.useMemo)(()=>qr(b),[b]),[k,M]=(0,x.useState)(g),D=(0,x.useRef)(t);(0,x.useEffect)(()=>{if(D.current!==t){D.current=t,M(g);return}M(te=>Kr(te,p)??g)},[t,p,g]);let J=Mi(k,M,a,i,r,o,s),F=r!==void 0&&$r(r),[C,R]=(0,x.useState)("render");(0,x.useEffect)(()=>{R("render")},[r]);let U=(S||F)&&r!==void 0&&Or(r)&&a!==void 0&&i!==void 0&&o!==void 0&&(!F||C==="render"),K=Ri(U?a:void 0,U?i:void 0,U?r:void 0,U?o:void 0,U?s:void 0),[ae,z]=(0,x.useState)(!1),[W,O]=(0,x.useState)(""),[se,q]=(0,x.useState)(!1),[de,le]=(0,x.useState)(0),he=(0,x.useRef)(null),be=(0,x.useRef)(null),ee=(0,x.useRef)(null);(0,x.useEffect)(()=>{z(!1),O(""),le(0)},[t,r]);let w=(0,x.useMemo)(()=>n==="unified"?Ur(k):null,[n,k]),T=(0,x.useMemo)(()=>n==="before"?Li(k):n==="after"?Pi(k):null,[n,k]),j=(0,x.useMemo)(()=>Ni(k,w,T),[k,w,T]),Y=(0,x.useMemo)(()=>j.map(te=>({key:te.key,text:te.text.toLowerCase()})),[j]),m=rn(W,nn),G=se?m:m.toLowerCase(),B=se?j:Y,P=(0,x.useMemo)(()=>Ei(B,G),[B,G]);(0,x.useEffect)(()=>{le(0)},[G]);let ue=P.length===0?0:Math.min(de,P.length-1),Se=P.length>0?P[ue]:null,_e=Se?.cellKey??null,lt=Se?.start??-1,Fe=(0,x.useMemo)(()=>{let te=new Map;for(let $ of P){let h=te.get($.cellKey)??[];h.push([$.start,$.end]),te.set($.cellKey,h)}return te},[P]);(0,x.useEffect)(()=>{if(_e===null)return;let te=requestAnimationFrame(()=>ee.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(te)},[ue,P,_e,lt]);let De=(0,x.useCallback)(te=>{le($=>P.length===0?0:($+te+P.length)%P.length)},[P.length]);(0,x.useEffect)(()=>{let te=$=>{if(!(($.ctrlKey||$.metaKey)&&($.key==="f"||$.key==="F")))return;let h=he.current;h===null||h.offsetParent===null||($.preventDefault(),z(!0),requestAnimationFrame(()=>be.current?.select()))};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[]);let{setEl:N,viewport:Ee,elRef:ze}=Tt(),xe=(0,x.useRef)(null),[$e,Ve]=(0,x.useState)(0),[Be,Ae]=(0,x.useState)(0),Me=(0,x.useRef)({mode:n,rows:k,heights:[]});(Me.current.mode!==n||Me.current.rows!==k)&&(Me.current={mode:n,rows:k,heights:[]});let Te=Me.current.heights,Xe=w!==null?w.length:T!==null?T.length:k.length,qe=(0,x.useCallback)(te=>{let $=w!==null?w[te]??null:T===null?k[te]??null:null;return $===null?Hn:$.kind==="hunk"?_i:$.kind==="gap"?Si:Hn},[w,T,k]),Ge=(0,x.useMemo)(()=>{let te=new Array(Xe);for(let $=0;$<Xe;$++){let h=Te[$];te[$]=h!==void 0&&h>0?h:qe($)}return te},[Xe,Te,qe,Be]),ke=(0,x.useMemo)(()=>St(Ge),[Ge]),ht=Ee.height>0?Ee.height:Ci,{first:ne,last:Ie}=Ct(ke,Math.max(0,Ee.top-$e),ht,ia*Hn),Lt=_e===null?-1:Ti(_e),{first:je,last:Qe}=en({first:ne,last:Ie},Lt,Xe,ia);if((0,x.useLayoutEffect)(()=>{let te=xe.current,$=ze.current;if(te===null||$===null)return;let h=te.getBoundingClientRect().top-$.getBoundingClientRect().top+$.scrollTop;Math.abs(h-$e)>.5&&Ve(h);let L=new Map;for(let re of te.querySelectorAll("[data-r]")){let pe=Number(re.dataset.r),we=re.getBoundingClientRect().height;if(!Number.isFinite(we)||we<=0)continue;let We=L.get(pe);(We===void 0||we>We)&&L.set(pe,we)}let E=!1;for(let[re,pe]of L){let we=Te[re];(we===void 0||Math.abs(we-pe)>.5)&&(Te[re]=pe,E=!0)}E&&Ae(re=>re+1)}),U){let te=(()=>{if(K.kind==="idle"||K.kind==="loading")return(0,x.createElement)("div",{className:"gp-empty"},u("common.loading"));if(K.kind==="ready"){let $=K.res;if($.tooLarge===!0)return(0,x.createElement)("div",{className:"gp-empty"},u("diff.tooLarge"));if($.mime!==null&&($.old!==void 0||$.new!==void 0))return(0,x.createElement)(aa,{oldUrl:$.old,newUrl:$.new,mode:n,t:u})}return(0,x.createElement)("div",{className:"gp-empty"},u("diff.binary"))})();return F?oa(C,R,te,u):te}if(S&&!F)return(0,x.createElement)("div",{className:"gp-empty"},u("diff.binary"));let Ye=ae&&G!==""?{perCell:Fe,activeKey:_e,activeRange:Se!==null?[Se.start,Se.end]:null,activeRef:ee}:null,yt=(te,$)=>$>.5?(0,x.createElement)("div",{key:te,className:"gp-diff__spacer",style:{gridColumn:"1 / -1",height:`${$}px`}}):null,Ce=yt("lead",ke[je]),Je=yt("tail",ke[Xe]-ke[Qe]),bt=(()=>{if(t.trim()==="")return(0,x.createElement)("div",{className:"gp-empty"},u("diff.empty"));if(T!==null){let $=[Ce];for(let h=je;h<Qe;h++){let L=T[h];$.push((0,x.createElement)("div",{key:`n${h}`,className:"gp-diff-no"},L.no??"")),$.push(cn("gp-diff-cell",`c${h}`,L.text,_,Ye,h))}return $.push(Je),(0,x.createElement)("div",{className:"gp-diff__single",ref:xe},$)}if(w!==null){let $=[Ce];for(let h=je;h<Qe;h++)$.push(...zi(w[h],h,_,J,Ye,u));return $.push(Je),(0,x.createElement)("div",{className:"gp-diff__unified",ref:xe},$)}let te=[Ce];for(let $=je;$<Qe;$++)te.push(...Di(k[$],$,_,J,Ye,u));return te.push(Je),(0,x.createElement)("div",{className:"gp-diff__side",ref:xe},te)})(),dt=ae?(0,x.createElement)(sn,{inputRef:be,query:W,matches:P.length,active:ue,caseSensitive:se,onChange:O,onToggleCase:()=>q(te=>!te),onStep:De,onClose:()=>z(!1),t:u}):null,Ze=l===!0&&k.some(te=>te.kind==="gap"),ct=(0,x.createElement)("div",{className:"gp-diff__wrap",ref:he},[dt,d===!0?(0,x.createElement)("div",{key:"truncated",className:"gp-notice"},u("diff.truncated")):null,Ze?(0,x.createElement)("div",{key:"capped",className:"gp-notice"},u("diff.expandCapped",{n:2e3})):null,(0,x.createElement)("div",{key:"scroll",className:"gp-diff__scroll",ref:N},bt)]);return F?oa(C,R,ct,u):ct});function Ti(e){let t=Number(e.slice(1));return Number.isFinite(t)?t:-1}function Ni(e,t,n){let r=[];return n!==null?(n.forEach((a,i)=>r.push({key:`c${i}`,text:a.text})),r):t!==null?(t.forEach((a,i)=>{if(a.kind==="hunk"||a.kind==="gap")return;let o=a.rightText??a.leftText??"";o!==""&&r.push({key:`c${i}`,text:o})}),r):(e.forEach((a,i)=>{a.kind==="hunk"||a.kind==="gap"||(a.leftText!==null&&a.leftText!==""&&r.push({key:`l${i}`,text:a.leftText}),a.rightText!==null&&a.rightText!==""&&r.push({key:`r${i}`,text:a.rightText}))}),r)}function Ei(e,t){if(t==="")return[];let n=[];for(let r of e)for(let[a,i]of an(r.text,t))if(n.push({cellKey:r.key,start:a,end:i}),n.length>=tn)return n;return n}function oa(e,t,n,r){let a=(i,o)=>(0,x.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${e===i?" gp-seg__btn--active":""}`,"aria-pressed":e===i,onClick:()=>t(i)},o);return(0,x.createElement)("div",{className:"gp-svgdiff"},[(0,x.createElement)("div",{key:"bar",className:"gp-svgdiff__bar"},(0,x.createElement)("div",{className:"gp-seg"},[a("render",r("diff.svgRender")),a("source",r("diff.svgSource"))])),(0,x.createElement)("div",{key:"body",className:"gp-svgdiff__body"},n)])}function Mi(e,t,n,r,a,i,o){let[s,l]=(0,x.useState)(null),d=(0,x.useRef)(0);(0,x.useEffect)(()=>{d.current+=1,l(null)},[e]);let p=(0,x.useCallback)((u,g)=>{if(n===void 0||r===void 0||a===void 0||i===void 0)return;let S=`${u.rightStart}:${g}`;l(S);let b=++d.current,{start:_,end:k}=Gi(u,g),M=i==="commit"&&o!==void 0?{kind:"file-lines",path:a,base:"commit",commit:o,start:_,end:k}:i==="staged"?{kind:"file-lines",path:a,base:"staged",start:_,end:k}:{kind:"file-lines",path:a,base:"worktree",start:_,end:k};n.query({sessionId:r,query:M}).then(D=>{if(b!==d.current)return;let J=ye(D,"file-lines");l(null),J!==null&&t(F=>Vr(F,u.rightStart,g,J.start,J.lines,J.eof))}).catch(()=>{b===d.current&&l(null)})},[n,r,a,i,o,t]);return{busy:s,run:p}}function Gi(e,t){let n=e.count;return t==="all"||n<=gt?{start:e.rightStart,end:e.rightStart+n-1}:t==="down"?{start:e.rightStart,end:e.rightStart+gt-1}:{start:e.rightStart+n-gt,end:e.rightStart+n-1}}function Ri(e,t,n,r,a){let[i,o]=(0,x.useState)({kind:"idle"});return(0,x.useEffect)(()=>{if(e===void 0||t===void 0||n===void 0||r===void 0)return;let s=!0;o({kind:"loading"});let l=r==="commit"&&a!==void 0?{kind:"image-diff",path:n,base:"commit",commit:a}:r==="staged"?{kind:"image-diff",path:n,base:"staged"}:{kind:"image-diff",path:n,base:"worktree"};return e.query({sessionId:t,query:l}).then(d=>{if(!s)return;let p=ye(d,"image-diff");o(p!==null?{kind:"ready",res:p}:{kind:"failed"})}).catch(()=>{s&&o({kind:"failed"})}),()=>{s=!1}},[e,t,n,r,a]),i}function dn(e,t=""){return e.map((n,r)=>(0,x.createElement)("span",{key:`${t}${r}`,style:n.style},n.text))}function sa(e,t,n,r){if(n===null)return null;let a=n.perCell.get(t);if(a===void 0||a.length===0)return null;let i=n.activeKey===t?n.activeRange:null;return on(e,a,r,t,i,n.activeRef)}function cn(e,t,n,r,a=null,i=-1){let o={key:t,className:e,"data-r":i>=0?i:void 0};if(n==="")return(0,x.createElement)("div",o,"\xA0");let s=r(n)?.[0],l=sa(n,t,a,s);return l!==null?(0,x.createElement)("div",o,l):(0,x.createElement)("div",o,s===void 0?n:dn(s))}function Fn(e,t,n,r,a,i,o=null,s=-1){let l={key:t,className:e,"data-r":s>=0?s:void 0},d=i(n)?.[0]??[{text:n,style:{}}],p=sa(n,t,o,d);if(p!==null)return(0,x.createElement)("div",l,p);let[u,g,S]=Wr(d,r);return(0,x.createElement)("div",l,[...dn(u,"p"),(0,x.createElement)("span",{key:"w",className:a},g.length===0?"\xA0":dn(g)),...dn(S,"s")])}function Li(e){return e.filter(t=>t.leftText!==null).map(t=>({no:t.leftNo,text:t.leftText}))}function Pi(e){return e.filter(t=>t.rightText!==null).map(t=>({no:t.rightNo,text:t.rightText}))}function Di(e,t,n,r,a,i){if(e.kind==="hunk")return[(0,x.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[la(e.gap,t,r,i)];let o=e.kind==="del"||e.kind==="mod"?"gp-diff-row--del":"",s=e.kind==="add"||e.kind==="mod"?"gp-diff-row--add":"",l=e.leftText===null?(0,x.createElement)("div",{key:`l${t}`,className:`gp-diff-cell ${o}`}):e.kind==="mod"&&e.leftWord!==void 0?Fn(`gp-diff-cell ${o}`,`l${t}`,e.leftText,e.leftWord,"gp-diff-word gp-diff-word--del",n,a,t):cn(`gp-diff-cell ${o}`,`l${t}`,e.leftText,n,a,t),d=e.rightText===null?(0,x.createElement)("div",{key:`r${t}`,className:`gp-diff-cell ${s}`}):e.kind==="mod"&&e.rightWord!==void 0?Fn(`gp-diff-cell ${s}`,`r${t}`,e.rightText,e.rightWord,"gp-diff-word gp-diff-word--add",n,a,t):cn(`gp-diff-cell ${s}`,`r${t}`,e.rightText,n,a,t);return[(0,x.createElement)("div",{key:`ln${t}`,className:"gp-diff-no"},e.leftNo??""),l,(0,x.createElement)("div",{key:`rn${t}`,className:"gp-diff-no"},e.rightNo??""),d]}function zi(e,t,n,r,a,i){if(e.kind==="hunk")return[(0,x.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[la(e.gap,t,r,i)];let o=e.kind==="del",s=e.kind==="add",l=s?"gp-diff-row--add":o?"gp-diff-row--del":"",d=s?"+":o?"\u2212":"\xA0",p=e.rightText??e.leftText??"",u=s?e.rightWord:o?e.leftWord:void 0,g=s?"gp-diff-word gp-diff-word--add":"gp-diff-word gp-diff-word--del",S=`gp-diff-cell gp-diff-uni__code ${l}`,b=u!==void 0?Fn(S,`c${t}`,p,u,g,n,a,t):cn(S,`c${t}`,p,n,a,t);return[(0,x.createElement)("div",{key:`ol${t}`,className:"gp-diff-no"},e.leftNo??""),(0,x.createElement)("div",{key:`nl${t}`,className:"gp-diff-no"},e.rightNo??""),(0,x.createElement)("div",{key:`sg${t}`,className:`gp-diff-uni__sign ${l}`},d),b]}function la(e,t,n,r){let a=n.busy===`${e.rightStart}:all`,i=n.busy===`${e.rightStart}:up`,o=n.busy===`${e.rightStart}:down`,s=(p,u,g)=>(0,x.createElement)("button",{key:p,type:"button",className:"gp-gap__btn",disabled:n.busy!==null,onClick:S=>{S.stopPropagation(),n.run(e,p)}},g?r("common.loading"):u),l=[],d=e.count;return d<=gt?l.push(s("all",r("diff.expandGap",{n:d}),a)):(e.atStart||l.push(s("up",r("diff.expandUp",{n:gt}),i)),l.push(s("all",r("diff.expandGap",{n:d}),a)),l.push(s("down",r("diff.expandDown",{n:gt}),o))),(0,x.createElement)("div",{key:`g${t}`,className:"gp-diff-row--gap",style:{gridColumn:"1 / -1"},"data-r":t},l)}function gn(e){return Xr(e)}var Z=require("react");var Ai=100;function da(e,t,n){let[r,a]=(0,Z.useState)(null),[i,o]=(0,Z.useState)(!1),[s,l]=(0,Z.useState)([]),d=(0,Z.useCallback)(()=>{o(!1),(async()=>{let[p,u]=await Promise.all([e.query({sessionId:t,query:{kind:"branches"}}),e.query({sessionId:t,query:{kind:"tags"}})]),g=ye(p,"branches");if(g===null){o(!0);return}let S=ye(u,"tags");a({current:g.current,defaultBranch:g.defaultBranch,local:g.local,remote:g.remote,tags:S?.tags??[]}),e.query({sessionId:t,query:{kind:"authors"}}).then(b=>{l(ye(b,"authors")?.authors??[])})})()},[e,t]);return(0,Z.useEffect)(()=>{d()},[n]),{tree:r,treeError:i,authors:s,reload:d}}function ca(e,t,n,r,a){let[i,o]=(0,Z.useState)([]),[s,l]=(0,Z.useState)(0),[d,p]=(0,Z.useState)(!1),[u,g]=(0,Z.useState)(!1),S=(0,Z.useRef)(0),b=(0,Z.useRef)(!1),_=(0,Z.useRef)(null),k=(0,Z.useCallback)(async(F,C)=>{if(b.current)return;b.current=!0;let R=S.current;p(!0),g(!1);let Q=await e.query({sessionId:t,query:{kind:"history",limit:Ai,skip:F,...C.ref?{ref:C.ref}:{},...C.search?{search:C.search}:{},...C.author?{author:C.author}:{},...C.since?{since:C.since}:{}}});if(b.current=!1,R!==S.current)return;p(!1);let U=ye(Q,"history");if(U===null){g(!0);return}let K=U.commits;o(ae=>F===0?K:[...ae,...K]),l(U.total)},[e,t]),M=(0,Z.useRef)(n);(0,Z.useEffect)(()=>{S.current+=1,b.current=!1,M.current!==n&&(M.current=n,a(),_.current&&(_.current.scrollTop=0)),k(0,n)},[n,r]);let D=s<0?!0:i.length<s,J=(0,Z.useCallback)(()=>{b.current||!D||k(i.length,n)},[k,i.length,n,D]);return{commits:i,total:s,loading:d,listError:u,hasMore:D,listRef:_,loadMore:J}}function pa(e,t,n){let[r,a]=(0,Z.useState)(null),[i,o]=(0,Z.useState)(null),[s,l]=(0,Z.useState)(!1),[d,p]=(0,Z.useState)(null),[u,g]=(0,Z.useState)(null),[S,b]=(0,Z.useState)(!1),[_,k]=(0,Z.useState)(n),[M,D]=(0,Z.useState)(!1),J=(0,Z.useRef)(0),F=(0,Z.useRef)(null),C=(0,Z.useRef)(new Map),R=(0,Z.useCallback)((ee,w)=>{let T=C.current;for(T.set(ee,w);T.size>50;){let j=T.keys().next().value;if(j===void 0)break;T.delete(j)}},[]),Q=(0,Z.useCallback)(()=>{a(null),o(null),F.current=null},[]),U=(0,Z.useCallback)(ee=>{F.current===ee.hash&&a(ee)},[]),K=(0,Z.useCallback)(async ee=>{F.current=ee.hash,a(ee),l(!1),J.current+=1,p(null),g(null),b(!1);let w=C.current.get(ee.hash);if(w!==void 0){o(w);return}o(null);let T=await e.query({sessionId:t,query:{kind:"show",ref:ee.hash}});if(F.current!==ee.hash)return;let j=ye(T,"show");if(j!==null){let Y={commit:j.commit,body:j.body,stats:j.stats,insertions:j.insertions,deletions:j.deletions};R(ee.hash,Y),o(Y)}else l(!0)},[e,t,R]),ae=(0,Z.useCallback)(async(ee,w,T,j=!1)=>{let Y=++J.current;p({path:ee,hash:w,shortHash:T}),g(null),b(!1),D(j);let m=await e.query({sessionId:t,query:{kind:"diff",path:ee,base:"commit",commit:w,...j?{context:2e3}:{}}});if(Y!==J.current)return;let G=ye(m,"diff");G!==null?g({text:G.text,newLines:G.newLines,truncated:G.truncated}):b(!0)},[e,t]),z=(0,Z.useCallback)(()=>{J.current+=1,p(null),g(null),b(!1),D(!1)},[]);(0,Z.useEffect)(()=>{if(d===null)return;let ee=w=>{w.key==="Escape"&&z()};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[d,z]);let[W,O]=(0,Z.useState)(null),[se,q]=(0,Z.useState)(null),de=(0,Z.useRef)(void 0),le=(0,Z.useRef)(null),he=(0,Z.useCallback)((ee,w,T)=>{de.current!==void 0&&clearTimeout(de.current),de.current=setTimeout(()=>{le.current=ee.hash,O({commit:ee,x:w,y:T});let j=C.current.get(ee.hash);if(j!==void 0){q(j.body);return}q(null),e.query({sessionId:t,query:{kind:"show",ref:ee.hash}}).then(Y=>{if(le.current!==ee.hash)return;let m=ye(Y,"show");m!==null?(R(ee.hash,{commit:m.commit,body:m.body,stats:m.stats,insertions:m.insertions,deletions:m.deletions}),q(m.body)):q("")})},260)},[e,t,R]),be=(0,Z.useCallback)(()=>{de.current!==void 0&&clearTimeout(de.current),le.current=null,O(null),q(null)},[]);return(0,Z.useEffect)(()=>()=>{de.current!==void 0&&clearTimeout(de.current)},[]),{selected:r,detail:i,detailError:s,select:K,resyncSelected:U,clearSelection:Q,fileDiff:d,fileDiffData:u,fileDiffError:S,fileDiffMode:_,setFileDiffMode:k,fileDiffExpanded:M,openFileDiff:ae,closeFileDiff:z,hover:W,hoverBody:se,onHoverEnter:he,onHoverLeave:be}}var Oe=require("react"),Hi=(e,t,n)=>Math.max(t,Math.min(n,e));function Fi(e,t){try{let n=typeof localStorage<"u"?localStorage.getItem(e):null,r=n===null?NaN:Number(n);return Number.isFinite(r)?r:t}catch{return t}}function Bi(e,t){try{typeof localStorage<"u"&&localStorage.setItem(e,String(Math.round(t)))}catch{}}function mt(e){let{storageKey:t,initial:n,min:r,reserve:a,edge:i}=e,[o,s]=(0,Oe.useState)(()=>Fi(t,n)),l=(0,Oe.useRef)(null),d=(0,Oe.useRef)(null),p=(0,Oe.useCallback)(g=>{let b=l.current?.parentElement?.clientWidth??Number.MAX_SAFE_INTEGER;d.current={x:g.clientX,w:o,max:Math.max(r,b-a)},g.preventDefault(),typeof document<"u"&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none")},[o,r,a]);(0,Oe.useEffect)(()=>{if(typeof window>"u")return;let g=b=>{let _=d.current;if(_===null)return;let k=b.clientX-_.x;s(Hi(_.w+(i==="end"?k:-k),r,_.max))},S=()=>{d.current!==null&&(d.current=null,typeof document<"u"&&(document.body.style.cursor="",document.body.style.userSelect=""),s(b=>(Bi(t,b),b)))};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",S),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",S)}},[i,r,t]);let u=(0,Oe.createElement)("div",{key:`rz-${t}`,ref:l,className:"gp-resizer",role:"separator","aria-orientation":"vertical",onPointerDown:p});return{width:o,divider:u}}var ua=require("react");function it(e,t,n,r,a=!1){return e.map(i=>(0,ua.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${t===i?" gp-seg__btn--active":""}`,...a?{disabled:!0}:{},onClick:()=>n(i)},r(i)))}var me=require("react"),ga=require("react-dom");function $t(e,t,n){switch(e){case"empty-message":return n("error.emptyMessage");case"not-a-git-repo":return n("error.notARepo");case"cwd-unavailable":return n("error.noCwd");case"local-changes-block":return n("error.localChangesBlock");case"not-ff":return n("error.notFastForward");case"push-rejected":return n("error.pushRejected");case"auth-failed":return n("error.authFailed");case"conflict":return n("error.conflict");case"revert-conflict":return n("error.revertConflict");case"revert-stuck":return n("error.revertStuck");case"revert-merge":return n("error.revertMerge");case"index-busy":return n("error.indexBusy");case"not-found":return n("error.notFound");case"branch-in-use":return n("error.branchInUse");case"stash-switch-failed":return n("error.stashSwitchFailed",{reason:t??""});case"invalid-name":case"invalid-index":return n("error.invalidName");default:return t??n("error.generic")}}function Nt(e){return(0,me.createElement)("div",{key:"aihint",className:"gp-modal__hint"},e("ops.aiHint"))}function Et(e){return(0,me.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,me.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",onClick:e.onClose},e.t("common.cancel")),(0,me.createElement)("button",{key:"ok",type:"button",className:`gp-btn ${e.danger?"gp-btn--danger":"gp-btn--primary"}`,disabled:e.confirmDisabled,onClick:e.onConfirm},e.confirmLabel)])}function ot(e){return typeof document>"u"?null:(0,me.createElement)(Ii,e)}function Ii({onClose:e,title:t,icon:n,hash:r,body:a,footer:i,overlay:o,portalKey:s,t:l}){let d=o!=null;(0,me.useEffect)(()=>{let u=g=>{g.key==="Escape"&&!d&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,d]);let p=(0,me.createElement)("div",{className:"gp-modal-backdrop",onClick:u=>{!d&&u.target===u.currentTarget&&e()}},(0,me.createElement)("div",{className:"gp-modal gp-modal--sm",role:"dialog","aria-modal":!0},[(0,me.createElement)("div",{key:"bar",className:"gp-modal__bar"},[n!==void 0?(0,me.createElement)("span",{key:"ic",className:"gp-modal__fileicon"},n):null,(0,me.createElement)("span",{key:"title",className:"gp-modal__path"},t),r!==void 0?(0,me.createElement)("span",{key:"hash",className:"gp-modal__hash"},r):null,(0,me.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),disabled:d,onClick:e},(0,me.createElement)(nt,{size:15}))]),(0,me.createElement)("div",{key:"body",className:"gp-modal__form"},a),i,o??null]));return(0,ga.createPortal)(p,document.body,s)}function Oi(e){return(0,me.createElement)("div",{key:"overlay",className:"gp-modal__overlay"},[(0,me.createElement)("div",{key:"sp",className:"gp-spinner"}),(0,me.createElement)("div",{key:"lb",className:"gp-modal__overlay-label"},e)])}function Ke(e){let t=e.confirmBusy===!0&&e.busyLabel!==void 0;return ot({onClose:e.onClose,title:e.title,portalKey:"confirm-modal",t:e.t,body:[(0,me.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},e.body),e.extra??null,Nt(e.t),e.error!==null?(0,me.createElement)("div",{key:"err",className:"gp-feedback"},e.error):null],footer:Et({onClose:e.onClose,onConfirm:e.onConfirm,confirmLabel:e.confirmLabel,confirmDisabled:e.confirmBusy===!0,danger:e.danger,t:e.t}),...t?{overlay:Oi(e.busyLabel)}:{}})}var ie=require("react");function fa(e,t){return typeof document>"u"?null:(0,ie.createElement)($i,{target:e,...t})}function $i({target:e,onClose:t,onCreate:n,error:r,t:a}){let[i,o]=(0,ie.useState)(""),[s,l]=(0,ie.useState)(!1),[d,p]=(0,ie.useState)(""),u=()=>{i.trim()!==""&&n(i.trim(),s?d:"")};return ot({onClose:t,title:a("tag.createTitle"),icon:(0,ie.createElement)(wt,{size:15}),hash:e.shortHash,portalKey:"tag-create-modal",t:a,body:[(0,ie.createElement)("input",{key:"name",className:"gp-input",placeholder:a("tag.namePlaceholder"),value:i,autoFocus:!0,onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&u()}}),(0,ie.createElement)("label",{key:"ann",className:"gp-modal__check"},[(0,ie.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:s,onChange:()=>l(g=>!g)}),a("tag.annotated")]),s?(0,ie.createElement)("textarea",{key:"msg",className:"gp-input gp-input--area",placeholder:a("tag.messagePlaceholder"),value:d,onChange:g=>p(g.target.value)}):null,Nt(a),r!==null?(0,ie.createElement)("div",{key:"err",className:"gp-feedback"},r):null],footer:Et({onClose:t,onConfirm:u,confirmLabel:a("tag.create"),confirmDisabled:i.trim()==="",danger:!1,t:a})})}function ma(e,t){return typeof document>"u"?null:(0,ie.createElement)(Xi,{target:e,...t})}function Xi({target:e,from:t,dirty:n,lostFiles:r,lostTotal:a,lostTruncated:i,busy:o,error:s,onReset:l,onClose:d,t:p}){let[u,g]=(0,ie.useState)("mixed"),[S,b]=(0,ie.useState)(!1);(0,ie.useEffect)(()=>{u!=="hard"&&b(!1)},[u]);let _=[{value:"mixed",label:"reset.modeMixed",hint:"reset.mixedHint"},{value:"soft",label:"reset.modeSoft",hint:"reset.softHint"},{value:"hard",label:"reset.modeHard",hint:"reset.hardHint"}],k=o||u==="hard"&&!S;return ot({onClose:d,title:p("reset.title"),icon:(0,ie.createElement)(Qt,{size:15}),hash:e.shortHash,portalKey:"reset-modal",t:p,body:[(0,ie.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},p("reset.body",{from:t,to:e.shortHash})),(0,ie.createElement)("div",{key:"modes",className:"gp-reset__modes"},_.map(M=>(0,ie.createElement)("label",{key:M.value,className:`gp-reset__mode${u===M.value?" gp-reset__mode--on":""}${M.value==="hard"?" gp-reset__mode--danger":""}`},[(0,ie.createElement)("input",{key:"r",type:"radio",name:"gp-reset-mode",className:"gp-check",checked:u===M.value,onChange:()=>g(M.value)}),(0,ie.createElement)("span",{key:"tx",className:"gp-reset__modetext"},[(0,ie.createElement)("span",{key:"l",className:"gp-reset__modelabel"},p(M.label)),(0,ie.createElement)("span",{key:"h",className:"gp-reset__modehint"},p(M.hint))])]))),u==="hard"?(0,ie.createElement)("div",{key:"orphan",className:"gp-reset__dirtywarn"},p("reset.hardOrphan")):null,u==="hard"&&a>0?(0,ie.createElement)("div",{key:"lost",className:"gp-reset__lost"},[(0,ie.createElement)("div",{key:"w",className:"gp-reset__warn"},p("reset.hardWarn")),(0,ie.createElement)("ul",{key:"ul",className:"gp-reset__lostlist"},[...r.map(M=>(0,ie.createElement)("li",{key:M,title:M},M)),i?(0,ie.createElement)("li",{key:"_more",className:"gp-reset__lostmore"},p("reset.lostMore")):null])]):null,u==="hard"?(0,ie.createElement)("label",{key:"ack",className:"gp-modal__check gp-reset__ack"},[(0,ie.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:S,onChange:()=>b(M=>!M)}),p(a>0?"reset.hardAck":"reset.hardAckClean")]):null,n?(0,ie.createElement)("div",{key:"dirty",className:"gp-reset__dirtywarn"},p("ops.dirtyWarn")):null,Nt(p),s!==null?(0,ie.createElement)("div",{key:"err",className:"gp-feedback"},s):null],footer:Et({onClose:d,onConfirm:()=>void l(u),confirmLabel:p("reset.confirm"),confirmDisabled:k,danger:u==="hard",t:p})})}var Le=require("react");function ha(e,t){return typeof document>"u"?null:(0,Le.createElement)(Ji,{target:e,...t})}function Ji({target:e,from:t,dirty:n,busy:r,error:a,onConfirm:i,onClose:o,t:s}){let[l,d]=(0,Le.useState)(!1),p=(u,g,S,b)=>(0,Le.createElement)("label",{key:g,className:`gp-bpick__mode${l===u?" gp-bpick__mode--on":""}`},[(0,Le.createElement)("input",{key:"r",type:"radio",name:"gp-switch-mode",className:"gp-check",checked:l===u,onChange:()=>d(u)}),(0,Le.createElement)("span",{key:"tx",className:"gp-bpick__modetext"},[(0,Le.createElement)("span",{key:"l",className:"gp-bpick__modelabel"},S),(0,Le.createElement)("span",{key:"h",className:"gp-bpick__modehint"},b)])]);return Ke({title:s("switch.confirmTitle"),body:s("switch.body",{from:t??s("switch.detached"),to:e.name}),extra:(0,Le.createElement)("div",{key:"x",className:"gp-bpick__extra"},[e.createFrom===void 0?null:(0,Le.createElement)("div",{key:"trk",className:"gp-bpick__note"},s("switch.trackingNote",{name:e.name,ref:e.createFrom})),n===0?null:(0,Le.createElement)("div",{key:"dw",className:"gp-bpick__warn"},s("switch.dirtyWarn",{count:n})),n===0?null:(0,Le.createElement)("div",{key:"md",className:"gp-bpick__modes"},[p(!1,"direct",s("switch.modeDirect"),s("switch.modeDirectHint")),p(!0,"stash",s("switch.modeStash",{count:n}),s("switch.modeStashHint"))])]),confirmLabel:s(l?"switch.confirmStash":"switch.confirm"),danger:!1,error:a,confirmBusy:r,busyLabel:s("switch.switching"),onConfirm:()=>i(l),onClose:o,t:s})}function Ki(e){let t=e.indexOf("/");return t<=0||t===e.length-1?null:{remote:e.slice(0,t),branch:e.slice(t+1)}}function ya(e){let t=new Set(e.local.map(a=>a.name)),n=e.local.map(a=>({key:`local:${a.name}`,group:"local",label:a.name,name:a.name,reused:!1,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})),r=[];for(let a of e.remote){let i=Ki(a.name);if(i===null)continue;let o=t.has(i.branch);r.push({key:`remote:${a.name}`,group:"remote",label:a.name,name:i.branch,createFrom:o?void 0:a.name,reused:o,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})}return[...n,...r]}function ba(e,t){return e.name!==t}var ge=require("react");var Ue=require("react"),va=require("react-dom"),Ui=140,Vi=260;function fn(e){let t=e?.placement??"above",n=e?.delayMs??Ui,r=e?.maxWidth??Vi,[a,i]=(0,Ue.useState)(null),o=(0,Ue.useRef)(void 0),s=(0,Ue.useCallback)(()=>{o.current!==void 0&&(clearTimeout(o.current),o.current=void 0),i(null)},[]),l=(0,Ue.useCallback)((g,S)=>{o.current!==void 0&&clearTimeout(o.current),o.current=setTimeout(()=>{let b=g.getBoundingClientRect(),_=Math.max(8,Math.min(b.left,window.innerWidth-r-8));i(t==="below"?{text:S,left:_,top:b.bottom+6}:{text:S,left:_,bottom:Math.max(8,window.innerHeight-b.top+6)})},n)},[t,n,r]),d=(0,Ue.useCallback)(g=>({onMouseEnter:S=>l(S.currentTarget,g),onMouseLeave:s,onFocus:S=>l(S.currentTarget,g),onBlur:s}),[l,s]),p={left:a?.left??0,maxWidth:r};a?.top!==void 0&&(p.top=a.top),a?.bottom!==void 0&&(p.bottom=a.bottom);let u=a!==null&&typeof document<"u"?(0,va.createPortal)((0,Ue.createElement)("div",{className:"gp-tip gp-tip--sb",style:p},a.text),document.body):null;return{tipProps:d,tipNode:u,hideTip:s}}function wa(e,t,n){if(e==="loading"||e===null)return(0,ge.createElement)("div",{className:"gp-pullscope gp-pullscope--loading"},t(n.loading));let r=t(n.line,{commits:e.commits,files:e.files,ins:e.insertions,del:e.deletions}),a=r.match(/(\+\d+)\s*\/\s*([-−]\d+)/);if(a===null)return(0,ge.createElement)("div",{className:"gp-pullscope"},r);let i=r.indexOf(a[0]);return(0,ge.createElement)("div",{className:"gp-pullscope"},[r.slice(0,i),(0,ge.createElement)("span",{key:"add",className:"gp-pullscope__add"},a[1])," / ",(0,ge.createElement)("span",{key:"del",className:"gp-pullscope__del"},a[2]),r.slice(i+a[0].length)])}function xa(e,t){return wa(e,t,{line:"status.pullScope",loading:"status.pullScopeLoading"})}function ka(e,t){return wa(e,t,{line:"status.pushScope",loading:"status.pushScopeLoading"})}function Wi(e){let t=e.replace(/^https?:\/\/[^/]+\//,"").replace(/\/+$/,""),n=t.split("/");return n.length>=2?n.slice(-2).join("/"):t}function Bn(e,t){return(0,ge.createElement)(qi,{snapshot:e,cb:t})}function qi({snapshot:e,cb:t}){let{t:n}=t,{tipProps:r,tipNode:a,hideTip:i}=fn({placement:"above"}),o=e.remote??null,s=e.hasUpstream===!0,l=(()=>{if(o===null||o.hostKind!=="github")return null;let M=(0,ge.createElement)(Mr,{size:14});if(o.webUrl===null)return(0,ge.createElement)("span",{key:"r",className:"gp-statusbar__repo gp-statusbar__repo--none","aria-label":o.url,...r(o.url)},(0,ge.createElement)("span",{className:"gp-statusbar__ic"},M));let D=o.host!==null?n("status.openRepoOn",{host:o.host}):n("status.openRepo"),J=`${Wi(o.webUrl)} \xB7 ${D}`;return(0,ge.createElement)("a",{key:"r",className:"gp-statusbar__repo",href:o.webUrl,target:"_blank",rel:"noreferrer","aria-label":J,...r(J)},(0,ge.createElement)("span",{className:"gp-statusbar__ic"},M))})(),{ahead:d,behind:p,branch:u}=e,g=s&&p>0&&d===0,S=s&&d>0&&p===0,b=!s&&u!==null&&o!==null,_=(()=>{let M,D="";return u===null?M=n("status.detached"):s?d===0&&p===0?(M=n("status.synced"),D=" gp-statusbar__state--ok"):d>0&&p>0?(M=n("status.diverged",{ahead:d,behind:p}),D=" gp-statusbar__state--warn"):p>0?(M=n("status.behind",{n:p}),D=" gp-statusbar__state--warn"):M=n("status.ahead",{n:d}):M=n("status.noUpstream"),(0,ge.createElement)("span",{key:"s",className:`gp-statusbar__state${D}`},M)})(),k=[o!==null?(0,ge.createElement)("button",{key:"check",type:"button",className:"gp-icon-btn gp-statusbar__btn",disabled:t.syncBusy,"aria-label":n("status.check"),...r(n("status.checkTitle")),onClick:()=>{i(),t.onCheck()}},(0,ge.createElement)(Rr,{size:13})):null,g?(0,ge.createElement)("button",{key:"pull",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pullBusy,"aria-label":n("status.pullTitle"),...r(n("status.pullTitle")),onClick:()=>{i(),t.onPull()}},[(0,ge.createElement)(Gr,{key:"i",size:12}),n("status.pull")]):null,S?(0,ge.createElement)("button",{key:"push",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pushBusy,"aria-label":n("status.pushTitle"),...r(n("status.pushTitle")),onClick:()=>{i(),t.onPush()}},[(0,ge.createElement)(Ln,{key:"i",size:12}),n("status.push")]):null,b?(0,ge.createElement)("button",{key:"publish",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.publishBusy,"aria-label":n("status.publishTitle"),...r(n("status.publishTitle")),onClick:()=>{i(),t.onPublish()}},[(0,ge.createElement)(Ln,{key:"i",size:12}),n("status.publish")]):null];return(0,ge.createElement)("div",{key:"statusbar",className:`gp-statusbar${t.syncBusy?" gp-statusbar--busy":""}`},[l,(0,ge.createElement)("div",{key:"sync",className:"gp-statusbar__sync"},[_,...k]),a])}var In=new Set,Mt=14,_a=30;function ji(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].kind!==t[n].kind||e[n].name!==t[n].name||e[n].head!==t[n].head)return!1;return!0}var Qi=46,Yi=260;function Zi(e,t){let[n,r]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=()=>r(e.clientWidth>0&&e.clientWidth<t);a();let i=new ResizeObserver(a);return i.observe(e),()=>i.disconnect()},[e,t]),n}function Sa({remote:e,sessionId:t,refreshKey:n,defaultDiffView:r,snapshot:a,onAction:i,onResync:o,compact:s,t:l}){let[d,p]=(0,c.useState)({ref:null,search:"",author:"",since:""}),[u,g]=(0,c.useState)(""),[S,b]=(0,c.useState)(null),_=Zi(S,Yi),[k,M]=(0,c.useState)(new Set(["tags","remote"])),[D,J]=(0,c.useState)(0),F=n+D,C=()=>J(y=>y+1),[R,Q]=(0,c.useState)(null),[U,K]=(0,c.useState)(null),[ae,z]=(0,c.useState)(null),[W,O]=(0,c.useState)(null),[se,q]=(0,c.useState)(null),[de,le]=(0,c.useState)(!1),[he,be]=(0,c.useState)(!1),[ee,w]=(0,c.useState)(!1),[T,j]=(0,c.useState)(!1),[Y,m]=(0,c.useState)(!1),[G,B]=(0,c.useState)(!1),[P,ue]=(0,c.useState)(!1),[Se,_e]=(0,c.useState)(!1),[lt,Fe]=(0,c.useState)(null),[De,N]=(0,c.useState)(null),[Ee,ze]=(0,c.useState)("list"),[xe,$e]=(0,c.useState)(null),[Ve,Be]=(0,c.useState)(!1),[Ae,Me]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!Ae)return;let y=V=>{V.key==="Escape"&&Me(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[Ae]),(0,c.useEffect)(()=>{!s&&Ae&&Me(!1)},[s,Ae]),(0,c.useEffect)(()=>{if(!T){Fe(null);return}let y=!0;return Fe("loading"),e.query({sessionId:t,query:{kind:"pull-preview"}}).then(V=>{if(!y)return;let ce=ye(V,"pull-preview");Fe(ce!==null&&ce.hasUpstream?{commits:ce.commits,files:ce.files,insertions:ce.insertions,deletions:ce.deletions}:null)}),()=>{y=!1}},[T,e,t]),(0,c.useEffect)(()=>{if(!G){N(null);return}let y=!0;return N("loading"),e.query({sessionId:t,query:{kind:"push-preview"}}).then(V=>{if(!y)return;let ce=ye(V,"push-preview");N(ce!==null&&ce.hasUpstream?{commits:ce.commits,files:ce.files,insertions:ce.insertions,deletions:ce.deletions}:null)}),()=>{y=!1}},[G,e,t]);let{tree:Te,treeError:Xe,authors:qe,reload:Ge}=da(e,t,F),ke=(0,c.useMemo)(()=>{let y=new Map;if(Te===null)return y;for(let V of ya(Te))ba(V,Te.current)&&y.set(V.key,V);return y},[Te]),ht=y=>{q(null),$e(y)},ne=pa(e,t,r),{commits:Ie,loading:Lt,listError:je,hasMore:Qe,listRef:Ye,loadMore:yt}=ca(e,t,d,F,ne.clearSelection);(0,c.useEffect)(()=>{let y=setTimeout(()=>p(V=>V.search===u?V:{...V,search:u}),300);return()=>clearTimeout(y)},[u]);let Ce=d.search!=="",Je=(0,c.useMemo)(()=>Ce?Ie.map(y=>({commit:y,lane:0,color:0,edges:[],merge:!1})):zr(Ie,a.graphStyle),[Ie,Ce,a.graphStyle]),bt=(0,c.useMemo)(()=>Ce?0:Dr(Je),[Je,Ce]),dt=Ce?12:Math.max(Mt,bt*Mt),Ze=s?Qi:_a,ct=s?`${dt}px minmax(0,1fr)`:`${dt}px minmax(120px,1fr) 72px 120px 96px`,te=()=>{let y=Ye.current;y===null||!Qe||y.scrollTop+y.clientHeight>=y.scrollHeight-240&&yt()},$=y=>{ne.select(y),s&&ze("detail")},h=(0,c.useMemo)(()=>Date.now(),[Ie]),L=(0,c.useMemo)(()=>ne.detail===null?[]:Ar(ne.detail.stats.map(y=>({path:y.path,meta:y.status}))),[ne.detail]),E=ne.selected,re=E?.hash??null,[pe,we]=(0,c.useState)({hash:null,dirs:In}),We=pe.hash===re?pe.dirs:In,Ka=(0,c.useCallback)(y=>{we(V=>{let ce=V.hash===re?V.dirs:In,Jt=new Set(ce);return Jt.has(y)?Jt.delete(y):Jt.add(y),{hash:re,dirs:Jt}})},[re]);(0,c.useEffect)(()=>{if(E===null)return;let y=Ie.find(V=>V.hash===E.hash);y!==void 0&&y!==E&&!ji(y.refs,E.refs)&&ne.resyncSelected(y)},[Ie,E]);let Qn=mt({storageKey:"gp.overview.left",initial:200,min:130,reserve:360,edge:"end"}),Yn=mt({storageKey:"gp.overview.right",initial:340,min:190,reserve:360,edge:"start"}),Zn=y=>p(V=>({...V,ref:y})),Ua=async(y,V)=>{if(!(R===null||de)){q(null),le(!0);try{let ce=await e.run({sessionId:t,action:{kind:"tag-create",name:y,commit:R.hash,...V.trim()!==""?{message:V}:{}}});ce.ok?(Q(null),C()):q($t(ce.error.code,ce.error.message,l))}finally{le(!1)}}},Va=async y=>{if(!de){q(null),le(!0);try{let V=await e.run({sessionId:t,action:{kind:"tag-delete",name:y}});V.ok?(K(null),C()):q($t(V.error.code,V.error.message,l))}finally{le(!1)}}},Wa=async()=>{if(!(ae===null||de)){q(null),le(!0);try{let y=await i({kind:"revert",commit:ae.hash});y.ok?z(null):q(y.error??l("error.generic"))}finally{le(!1)}}},qa=async y=>{if(!(W===null||de)){q(null),le(!0);try{let V=await i({kind:"reset",commit:W.hash,mode:y});V.ok?O(null):q(V.error??l("error.generic"))}finally{le(!1)}}},ja=async y=>{if(!(xe===null||Ve)){q(null),Be(!0);try{let V=await i({kind:"branch-checkout",name:xe.name,...xe.createFrom===void 0?{}:{createFrom:xe.createFrom},...y?{stashMessage:l("switch.stashMessage",{branch:xe.name})}:{}});V.ok?($e(null),Ge()):q(V.error??l("error.generic"))}finally{Be(!1)}}},Qa=async()=>{if(!he){q(null),be(!0);try{let y=await i({kind:"fetch"});y.ok?Ge():q(y.error??l("error.generic"))}finally{be(!1)}}},Ya=async()=>{if(!ee){q(null),w(!0);try{let y=await i({kind:"pull-ff"});y.ok?(j(!1),Ge()):q(y.error??l("error.generic"))}finally{w(!1)}}},Za=async()=>{if(!Y){q(null),m(!0);try{let y=await i({kind:"push"});y.ok?(B(!1),Ge()):q(y.error??l("error.generic"))}finally{m(!1)}}},ei=async()=>{if(!(P||a.remote===null)){q(null),ue(!0);try{let y=await i({kind:"publish",remote:a.remote.name});y.ok?(_e(!1),Ge()):q(y.error??l("error.generic"))}finally{ue(!1)}}},er={syncBusy:he,pullBusy:ee,pushBusy:Y,publishBusy:P,onCheck:()=>void Qa(),onPull:()=>{q(null),j(!0)},onPush:()=>{q(null),B(!0)},onPublish:()=>{q(null),_e(!0)},t:l},tr=io(ne.fileDiff,{data:ne.fileDiffData,error:ne.fileDiffError,mode:ne.fileDiffMode,onMode:ne.setFileDiffMode,expanded:ne.fileDiffExpanded,onExpand:y=>{ne.fileDiff!==null&&ne.openFileDiff(ne.fileDiff.path,ne.fileDiff.hash,ne.fileDiff.shortHash,y)},onClose:ne.closeFileDiff,remote:e,sessionId:t,compact:s,t:l}),nr=(0,c.useMemo)(()=>[...new Set(a.changes.filter(y=>y.status!=="untracked").map(y=>y.path))],[a.changes]),rr=[R!==null?fa(R,{onClose:()=>Q(null),onCreate:Ua,error:se,compact:s,t:l}):null,U!==null?Ke({title:l("tag.deleteTitle"),body:l("tag.deleteConfirm",{name:U}),confirmLabel:l("tag.deleteTitle"),danger:!0,error:se,confirmBusy:de,onConfirm:()=>void Va(U),onClose:()=>K(null),t:l}):null,ae!==null?Ke({title:l("revert.title"),body:l("revert.body",{ref:`${ae.shortHash} ${ae.subject}`})+(a.dirty?`
673
-
674
- ${l("ops.dirtyWarn")}`:""),confirmLabel:l("revert.confirm"),danger:!1,error:se,confirmBusy:de,onConfirm:()=>void Wa(),onClose:()=>z(null),t:l}):null,W!==null?ma(W,{from:a.head??W.shortHash,dirty:a.dirty,lostFiles:nr,lostTotal:nr.length,lostTruncated:a.truncated,busy:de,error:se,onReset:qa,onClose:()=>O(null),t:l}):null,T?Ke({title:l("status.pullConfirmTitle"),body:l("status.pullConfirmBody",{branch:a.branch??"HEAD",behind:a.behind}),extra:xa(lt,l),confirmLabel:l("status.pullConfirm"),danger:!1,error:se,confirmBusy:ee,busyLabel:l("status.pulling"),onConfirm:()=>void Ya(),onClose:()=>j(!1),t:l}):null,G?Ke({title:l("status.pushConfirmTitle"),body:l("status.pushConfirmBody",{branch:a.branch??"HEAD",ahead:a.ahead}),extra:ka(De,l),confirmLabel:l("status.pushConfirm"),danger:!1,error:se,confirmBusy:Y,busyLabel:l("status.pushing"),onConfirm:()=>void Za(),onClose:()=>B(!1),t:l}):null,Se?Ke({title:l("status.publishConfirmTitle"),body:l("status.publishConfirmBody",{branch:a.branch??"HEAD",remote:a.remote?.name??"origin"}),confirmLabel:l("status.publishConfirm"),danger:!1,error:se,confirmBusy:P,busyLabel:l("status.publishing"),onConfirm:()=>void ei(),onClose:()=>_e(!1),t:l}):null,xe!==null?ha(xe,{from:a.branch,dirty:a.dirty?Math.max(1,a.stats.fileCount):0,busy:Ve,error:se,onConfirm:y=>void ja(y),onClose:()=>$e(null),t:l}):null],ar=(0,c.createElement)("div",{key:"mid",className:"gp-col gp-col--mid gp-history"},[(0,c.createElement)("div",{key:"tb",className:"gp-toolbar",ref:b},[s?(0,c.createElement)("button",{key:"filter",type:"button",className:`gp-btn${d.ref!==null?" gp-btn--primary":""}`,title:l("overview.filterBranch"),onClick:()=>Me(!0)},[(0,c.createElement)(_r,{key:"ic",size:13}),d.ref??l("overview.filterBranch")]):null,(0,c.createElement)("input",{key:"search",className:"gp-search",placeholder:l(_||s?"overview.searchShort":"overview.search"),value:u,onChange:y=>g(y.target.value)}),(0,c.createElement)("select",{key:"author",className:"gp-select",value:d.author,onChange:y=>p(V=>({...V,author:y.target.value}))},[(0,c.createElement)("option",{key:"",value:""},l("overview.allUsers")),...qe.map(y=>(0,c.createElement)("option",{key:y,value:y},y))]),(0,c.createElement)("select",{key:"since",className:"gp-select",value:d.since,onChange:y=>p(V=>({...V,since:y.target.value}))},[(0,c.createElement)("option",{key:"",value:""},l("overview.allTime")),(0,c.createElement)("option",{key:"today",value:"1 day ago"},l("overview.today")),(0,c.createElement)("option",{key:"7d",value:"7 days ago"},l("overview.last7d")),(0,c.createElement)("option",{key:"30d",value:"30 days ago"},l("overview.last30d"))]),(0,c.createElement)("button",{key:"fetch",type:"button",className:"gp-icon-btn",title:l("overview.fetch"),onClick:()=>{e.run({sessionId:t,action:{kind:"fetch"}}).then(()=>Ge())}},(0,c.createElement)(jt,{size:14}))]),(0,c.createElement)("div",{key:"list",className:"gp-history__list",ref:Ye,onScroll:te},Ie.length===0?(0,c.createElement)("div",{className:"gp-empty"},l(Lt?"common.loading":je?"overview.loadFailed":"overview.noResults")):Je.map(y=>no(y,{selected:E?.hash===y.commit.hash,gridTpl:ct,graphW:dt,laneCount:bt,searching:Ce,now:h,compact:s,rowH:Ze,onSelect:()=>$(y.commit),onHoverEnter:ne.onHoverEnter,onHoverLeave:ne.onHoverLeave,t:l})))]),ir=E===null?[(0,c.createElement)("div",{key:"empty",className:"gp-empty"},[(0,c.createElement)(qt,{key:"i",size:20}),l("overview.selectCommit")])]:[(0,c.createElement)("div",{key:"files",className:"gp-detail__files"},ne.detail===null?(0,c.createElement)("div",{className:"gp-empty"},ne.detailError?l("overview.detailFailed"):l("common.loading")):[ne.detail.stats.length>0?(0,c.createElement)("div",{key:"sum",className:"gp-detail__summary"},[(0,c.createElement)("span",{key:"f"},l("overview.changeSummary",{files:ne.detail.stats.length})),(0,c.createElement)("span",{key:"sep",className:"gp-detail__summary-sep"},"\xB7"),(0,c.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ne.detail.insertions}`),(0,c.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ne.detail.deletions}`)]):null,ao(L,{activePath:ne.fileDiff?.path??null,openTitle:l("overview.openFileDiff"),onOpen:y=>{E!==null&&ne.openFileDiff(y,E.hash,E.shortHash)},collapsed:We,onToggleDir:Ka,expandLabel:l("overview.expandDir"),collapseLabel:l("overview.collapseDir")})]),(0,c.createElement)("div",{key:"msg",className:"gp-detail__msg"},[(0,c.createElement)("div",{key:"subj",className:"gp-detail__subject"},E.subject),(0,c.createElement)("div",{key:"meta",className:"gp-detail__meta"},[(0,c.createElement)("span",{key:"h",className:"gp-commit-hash"},E.shortHash),(0,c.createElement)("span",{key:"a"},E.author),(0,c.createElement)("span",{key:"t"},Bt(E.dateIso))]),(0,c.createElement)("div",{key:"ops",className:"gp-detail__ops"},(()=>{let y=E.refs.filter(V=>V.kind==="tag");return[y.length>0?(0,c.createElement)("div",{key:"tags",className:"gp-detail__tags"},y.map(V=>(0,c.createElement)("span",{key:`tag-${V.name}`,className:"gp-ref-chip gp-ref-chip--tag gp-ref-chip--del",title:V.name},[(0,c.createElement)(wt,{key:"i",size:11}),(0,c.createElement)("span",{key:"n",className:"gp-detail__tagname"},V.name),(0,c.createElement)("button",{key:"x",type:"button",className:"gp-ref-chip__x",title:l("tag.deleteOne",{name:V.name}),onClick:()=>{q(null),K(V.name)}},(0,c.createElement)(nt,{size:11}))]))):null,(0,c.createElement)("div",{key:"actions",className:"gp-detail__actions"},[(0,c.createElement)("button",{key:"revert",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.revert"),onClick:()=>{q(null),z({hash:E.hash,shortHash:E.shortHash,subject:E.subject})}},[(0,c.createElement)(Nr,{key:"i",size:12}),l("overview.revert")]),(0,c.createElement)("button",{key:"reset",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.reset"),onClick:()=>{q(null),o(),O({hash:E.hash,shortHash:E.shortHash,subject:E.subject})}},[(0,c.createElement)(Qt,{key:"i",size:12}),l("overview.reset")]),(0,c.createElement)("button",{key:"addtag",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.createTag"),onClick:()=>{q(null),Q({hash:E.hash,shortHash:E.shortHash})}},[(0,c.createElement)(wt,{key:"i",size:12}),l("overview.createTag")])])]})()),ne.detail!==null&&ne.detail.body!==""?(0,c.createElement)("pre",{key:"body",className:"gp-detail__body"},ne.detail.body):(0,c.createElement)("div",{key:"nb",className:"gp-empty"},l("overview.noMessage"))])];return s?(0,c.createElement)("div",{className:"gp-overview gp-overview--compact"},[tr,...rr,Ee==="detail"?(0,c.createElement)("div",{key:"detail",className:"gp-col gp-col--mid gp-detail"},[(0,c.createElement)("div",{key:"back",className:"gp-subhead"},[(0,c.createElement)("button",{key:"b",type:"button",className:"gp-subhead__back",onClick:()=>ze("list")},[(0,c.createElement)(xt,{key:"i",size:14}),l("overview.backToList")]),E!==null?(0,c.createElement)("span",{key:"h",className:"gp-subhead__title gp-commit-hash"},E.shortHash):null]),...ir]):ar,Bn(a,er),Ae?to(Te,Xe,d.ref,k,{onFilter:y=>{Zn(y),Me(!1)},switchOptions:ke,onSwitch:y=>{Me(!1),ht(y)},onToggle:y=>M(V=>{let ce=new Set(V);return ce.has(y)?ce.delete(y):ce.add(y),ce}),onRetry:Ge,onClose:()=>Me(!1),t:l}):null]):(0,c.createElement)("div",{className:"gp-overview"},[tr,...rr,(0,c.createElement)("div",{key:"left",className:"gp-col gp-col--left",style:{flex:`0 0 ${Qn.width}px`}},[(0,c.createElement)("div",{key:"scroll",className:"gp-col-left__scroll"},Ca(Te,Xe,d.ref,k,{onFilter:y=>Zn(y),switchOptions:ke,onSwitch:ht,onToggle:y=>M(V=>{let ce=new Set(V);return ce.has(y)?ce.delete(y):ce.add(y),ce}),onRetry:Ge,t:l})),Bn(a,er)]),Qn.divider,ar,Yn.divider,(0,c.createElement)("div",{key:"right",className:"gp-col gp-col--right gp-detail",style:{flex:`0 0 ${Yn.width}px`}},ir),eo(ne.hover,ne.hoverBody,l)])}function eo(e,t,n){if(e===null||typeof document>"u")return null;let r=460,a=Math.min(e.x+16,(typeof window<"u"?window.innerWidth:1200)-r-12),i=e.y+14,o=(0,c.createElement)("div",{className:"gp-hovercard",style:{left:a,top:i,maxWidth:r}},[(0,c.createElement)("div",{key:"subj",className:"gp-hovercard__subject"},e.commit.subject),(0,c.createElement)("div",{key:"meta",className:"gp-hovercard__meta"},[(0,c.createElement)("span",{key:"h",className:"gp-commit-hash"},e.commit.shortHash),(0,c.createElement)("span",{key:"a"},e.commit.author),(0,c.createElement)("span",{key:"t"},Bt(e.commit.dateIso))]),t===null?(0,c.createElement)("div",{key:"l",className:"gp-hovercard__loading"},n("common.loading")):t===""?(0,c.createElement)("div",{key:"e",className:"gp-hovercard__loading"},n("overview.noMessage")):(0,c.createElement)("pre",{key:"body",className:"gp-hovercard__body"},t)]);return(0,hn.createPortal)(o,document.body,"commit-hovercard")}function Ca(e,t,n,r,a){if(t)return(0,c.createElement)("div",{className:"gp-empty"},[(0,c.createElement)("span",{key:"m"},a.t("overview.branchesError")),(0,c.createElement)("button",{key:"r",type:"button",className:"gp-btn",style:{marginTop:8},onClick:a.onRetry},a.t("common.retry"))]);if(e===null)return(0,c.createElement)("div",{className:"gp-empty"},a.t("common.loading"));let i=(o,s,l,d,p="")=>(0,c.createElement)("div",{key:o,className:"gp-branch-group"},[(0,c.createElement)("div",{key:"head",className:"gp-branch-group__head",onClick:()=>a.onToggle(o)},[(0,c.createElement)(tt,{key:"c",size:11,open:!r.has(o)}),`${a.t(s)} (${l.length})`]),r.has(o)?null:l.map(u=>{let g=p+u.name,S=e.current===u.name,b=`gp-branch-row${n===g?" gp-branch-row--active":""}${S?" gp-branch-row--current":""}`,_=a.switchOptions.get(`${o}:${u.name}`);return(0,c.createElement)("div",{key:u.name,className:b,title:u.name,onClick:()=>a.onFilter(n===g?null:g)},[(0,c.createElement)("span",{key:"i",style:{display:"inline-flex",width:14}},d),(0,c.createElement)("span",{key:"n",className:"gp-tree-name"},u.name),u.ahead||u.behind?(0,c.createElement)("span",{key:"t",className:"gp-branch-row__track"},`${u.ahead?`\u2191${u.ahead}`:""}${u.behind?`\u2193${u.behind}`:""}`):null,_===void 0?null:(0,c.createElement)("button",{key:"sw",type:"button",className:"gp-branch-row__switch",title:a.t(_.createFrom===void 0?"switch.rowTitle":"switch.rowTitleTrack",{name:_.name,ref:_.label}),onClick:k=>{k.stopPropagation(),a.onSwitch(_)}},a.t("switch.action"))])})]);return(0,c.createElement)("div",{},[(0,c.createElement)("div",{key:"head-row",className:"gp-branch-row",style:{fontWeight:600,justifyContent:"center",padding:"4px 10px"},onClick:()=>a.onFilter(null)},a.t("overview.head")),i("local","overview.local",e.local,(0,c.createElement)(Gn,{size:13})),i("remote","overview.remote",e.remote,(0,c.createElement)(Gn,{size:13})),i("tags","overview.tags",e.tags,(0,c.createElement)(wt,{size:13}))])}function to(e,t,n,r,a){if(typeof document>"u")return null;let i=(0,c.createElement)("div",{className:"gp-sheet-backdrop",onClick:o=>{o.target===o.currentTarget&&a.onClose()}},(0,c.createElement)("div",{className:"gp-sheet",role:"dialog","aria-modal":!0},[(0,c.createElement)("div",{key:"bar",className:"gp-sheet__bar"},[(0,c.createElement)("span",{key:"title",className:"gp-sheet__title"},a.t("overview.filterBranch")),(0,c.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-sheet__close",title:a.t("common.close"),onClick:a.onClose},(0,c.createElement)(nt,{size:15}))]),(0,c.createElement)("div",{key:"body",className:"gp-sheet__body"},Ca(e,t,n,r,a))]));return(0,hn.createPortal)(i,document.body,"branch-filter-sheet")}function no(e,t){let n=e.commit,r=n.refs.map(i=>(0,c.createElement)("span",{key:i.name,className:`gp-ref-chip${i.head?" gp-ref-chip--head":""}${i.kind==="remote"?" gp-ref-chip--remote":""}${i.kind==="tag"?" gp-ref-chip--tag":""}`},i.name)),a=(0,c.createElement)("div",{key:"g",className:"gp-graph-cell"},t.searching?null:ro(e,t.laneCount,t.rowH));return t.compact?(0,c.createElement)("div",{key:n.hash,className:`gp-commit-row gp-commit-row--compact${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl,height:`${t.rowH}px`},onClick:t.onSelect},[a,(0,c.createElement)("div",{key:"tx",className:"gp-commit-lines"},[(0,c.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,c.createElement)("div",{key:"m",className:"gp-commit-sub"},[(0,c.createElement)("span",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,c.createElement)("span",{key:"a",className:"gp-commit-author"},n.author),(0,c.createElement)("span",{key:"d",className:"gp-commit-date"},rt(n.dateIso,t.now,t.t))])])]):(0,c.createElement)("div",{key:n.hash,className:`gp-commit-row${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl},onClick:t.onSelect,onMouseEnter:i=>t.onHoverEnter(n,i.clientX,i.clientY),onMouseLeave:t.onHoverLeave},[a,(0,c.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,c.createElement)("div",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,c.createElement)("div",{key:"a",className:"gp-commit-author"},n.author),(0,c.createElement)("div",{key:"d",className:"gp-commit-date",title:Ft(n.dateIso)},rt(n.dateIso,t.now,t.t))])}var mn=["#4e9bff","#3fb950","#e0982e","#d05ce3","#e5534b","#2dc6c6","#d29922","#8b949e"];function ro(e,t,n=_a){let r=Math.max(Mt,t*Mt),a=s=>s*Mt+Mt/2,i=n/2,o=[];for(let s of e.edges){let l=mn[s.color%mn.length],d=s.kind==="out"?i:0,p=s.kind==="into"?i:n,u=(d+p)/2;o.push((0,c.createElement)("path",{key:`e${s.kind}-${s.fromLane}-${s.toLane}-${s.color}`,d:`M ${a(s.fromLane)} ${d} C ${a(s.fromLane)} ${u}, ${a(s.toLane)} ${u}, ${a(s.toLane)} ${p}`,stroke:l,strokeWidth:1.6,fill:"none"}))}return o.push((0,c.createElement)("circle",{key:"node",cx:a(e.lane),cy:i,r:e.merge?4:3.2,fill:mn[e.color%mn.length],stroke:"var(--dsw-alias-bg-layer-1)",strokeWidth:1})),(0,c.createElement)("svg",{className:"gp-graph-svg",width:r,height:n},o)}function ao(e,t){let n=[],r=(a,i)=>{for(let o of a)if(o.dir){let s=t.collapsed.has(o.path);n.push((0,c.createElement)("div",{key:o.path,className:"gp-tree-row gp-tree-row--dir",style:{paddingLeft:10+i*14},title:s?t.expandLabel:t.collapseLabel,role:"button",tabIndex:0,"aria-expanded":!s,onClick:()=>t.onToggleDir(o.path),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.onToggleDir(o.path))}},[(0,c.createElement)(tt,{key:"c",size:11,open:!s}),(0,c.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)])),s||r(o.children,i+1)}else{let s=String(o.meta??"modified"),l=t.activePath===o.path;n.push((0,c.createElement)("div",{key:o.path,className:`gp-tree-row${l?" gp-tree-row--active":""}`,style:{paddingLeft:10+i*14},title:t.openTitle,onClick:()=>t.onOpen(o.path)},[(0,c.createElement)("span",{key:"st",className:`gp-status-badge ${kt(s)}`},(Yt[s]??s[0]??"M").toUpperCase()),(0,c.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)]))}};return r(e,0),(0,c.createElement)("div",{},n)}function io(e,t){if(e===null||typeof document>"u")return null;let{data:n,error:r,mode:a,onMode:i,expanded:o,onExpand:s,onClose:l,remote:d,sessionId:p,compact:u,t:g}=t,S=u?["unified","before","after"]:["unified","split","before","after"],b=u&&a==="split"?"unified":a,_=n!==null&&n.text!==""?(()=>{let R=gn(n.text);return(0,c.createElement)("span",{key:"sum",className:"gp-modal__sum"},[(0,c.createElement)("span",{key:"a",className:"gp-stats__add"},`+${R.add}`),(0,c.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${R.del}`)])})():null,k=(0,c.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${o?" gp-seg__btn--active":""}`,disabled:b!=="split"&&b!=="unified",title:g(o?"diff.collapse":"diff.expandAll"),onClick:()=>s(!o)},g(o?"diff.collapse":"diff.expandAll")),M=(0,c.createElement)("div",{key:"seg",className:"gp-seg"},it(S,b,i,R=>g(`diff.${R}`))),D=(0,c.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:g("common.close"),onClick:l},(0,c.createElement)(nt,{size:15})),J=[(0,c.createElement)("span",{key:"fileicon",className:"gp-modal__fileicon"},(0,c.createElement)(Cr,{size:15})),(0,c.createElement)("span",{key:"path",className:"gp-modal__path",title:e.path},oo(e.path)),(0,c.createElement)("span",{key:"hash",className:"gp-modal__hash"},e.shortHash),_,k],F=u?[(0,c.createElement)("div",{key:"brow1",className:"gp-modal__bar-row"},J),(0,c.createElement)("div",{key:"brow2",className:"gp-modal__bar-row gp-modal__bar-row--controls"},[M,D])]:[...J,M,D],C=(0,c.createElement)("div",{className:"gp-modal-backdrop",onClick:R=>{R.target===R.currentTarget&&l()}},(0,c.createElement)("div",{className:"gp-modal",role:"dialog","aria-modal":!0},[(0,c.createElement)("div",{key:"bar",className:"gp-modal__bar"},F),(0,c.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},n===null?(0,c.createElement)("div",{className:"gp-empty"},g(r?"overview.diffFailed":"common.loading")):(0,c.createElement)(un,{key:"diff",text:n.text,mode:b,path:e.path,remote:d,sessionId:p,base:"commit",commit:e.hash,expanded:o,truncated:n.truncated===!0,newLines:n.newLines,t:g}))]));return(0,hn.createPortal)(C,document.body,"file-diff-modal")}function oo(e){let t=e.lastIndexOf("/");return t<0?[(0,c.createElement)("span",{key:"n",className:"gp-modal__name"},e)]:[(0,c.createElement)("span",{key:"d",className:"gp-modal__dir"},e.slice(0,t+1)),(0,c.createElement)("span",{key:"n",className:"gp-modal__name"},e.slice(t+1))]}var f=require("react");var Pe=require("react");function Ta({stats:e,t}){let n=Date.now(),r=[(0,Pe.createElement)("span",{key:"files",className:"gp-stats__item"},t("stats.files",{n:e.fileCount})),(0,Pe.createElement)("span",{key:"lines",className:"gp-stats__item"},[(0,Pe.createElement)("span",{key:"a",className:"gp-stats__add"},`+${e.insertions}`)," ",(0,Pe.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${e.deletions}`)])];e.staged>0&&r.push((0,Pe.createElement)("span",{key:"st",className:"gp-stats__item"},t("stats.staged",{n:e.staged}))),e.modified>0&&r.push((0,Pe.createElement)("span",{key:"mo",className:"gp-stats__item"},t("stats.modified",{n:e.modified}))),e.untracked>0&&r.push((0,Pe.createElement)("span",{key:"un",className:"gp-stats__item"},t("stats.untracked",{n:e.untracked}))),e.partial&&r.push((0,Pe.createElement)("span",{key:"partial",className:"gp-stats__item gp-stats__partial",title:t("stats.partialHint")},t("stats.partial")));let a=[];return e.lastChangeAt!==null&&a.push((0,Pe.createElement)("span",{key:"lc",className:"gp-stats__item",title:Ft(e.lastChangeAt)},t("stats.lastChange",{time:rt(e.lastChangeAt,n,t)}))),e.headCommittedAt!==null&&a.push((0,Pe.createElement)("span",{key:"hc",className:"gp-stats__item",title:Ft(e.headCommittedAt)},t("stats.lastCommit",{time:rt(e.headCommittedAt,n,t)}))),a.length>0&&r.push((0,Pe.createElement)("span",{key:"times",className:"gp-stats__times"},a)),(0,Pe.createElement)("div",{className:"gp-stats"},r)}var On=28,Na=26,so=8,lo=600;function Ea({remote:e,sessionId:t,snapshot:n,onAction:r,compact:a,t:i}){let[o,s]=(0,f.useState)(new Set),[l,d]=(0,f.useState)(""),[p,u]=(0,f.useState)(!1),[g,S]=(0,f.useState)(!1),[b,_]=(0,f.useState)(null),[k,M]=(0,f.useState)(new Set),[D,J]=(0,f.useState)(null),[F,C]=(0,f.useState)(null),[R,Q]=(0,f.useState)(null),[U,K]=(0,f.useState)(()=>n.defaultDiffView),[ae,z]=(0,f.useState)(!1),[W,O]=(0,f.useState)(!1),[se,q]=(0,f.useState)(!1),[de,le]=(0,f.useState)(!1),[he,be]=(0,f.useState)(null),[ee,w]=(0,f.useState)("list"),[T,j]=(0,f.useState)([]),[Y,m]=(0,f.useState)(!0),[G,B]=(0,f.useState)(!1),[P,ue]=(0,f.useState)(null),Se=(0,f.useRef)(null),_e=(0,f.useRef)(0),{setEl:lt,viewport:Fe}=Tt(),De=(0,f.useCallback)(async()=>{let h=await e.query({sessionId:t,query:{kind:"stash-list"}}),L=ye(h,"stash-list");j(L?.entries??[])},[e,t]);(0,f.useEffect)(()=>{De()},[De,n.checkedAt]);let N=(0,f.useMemo)(()=>n.changes.filter(h=>h.staged).sort($n),[n]),Ee=(0,f.useMemo)(()=>n.changes.filter(h=>!h.staged&&h.status!=="untracked").sort($n),[n]),ze=(0,f.useMemo)(()=>n.changes.filter(h=>h.status==="untracked").sort($n),[n]),$e=[{key:"staged",labelKey:"changes.groupStaged",items:N},{key:"unstaged",labelKey:"changes.groupUnstaged",items:Ee},{key:"untracked",labelKey:"changes.groupUntracked",items:ze}].filter(h=>h.items.length>0),{items:Ve,tops:Be,totalH:Ae}=(0,f.useMemo)(()=>{let h=[];for(let E of $e)if(h.push({kind:"head",g:{key:E.key,labelKey:E.labelKey,count:E.items.length}}),!k.has(E.key))for(let re of E.items)h.push({kind:"row",c:re});let L=St(h.map(E=>E.kind==="head"?Na:On));return{items:h,tops:L,totalH:L[h.length]}},[N,Ee,ze,k]),Me=Fe.height>0?Fe.height:lo,{first:Te,last:Xe}=Ct(Be,Fe.top,Me,so*On);(0,f.useEffect)(()=>{s(h=>{if(h.size===0)return h;let L=new Set(n.changes.map(pe=>pe.path+(pe.staged?":s":":w"))),E=new Set,re=!1;for(let pe of h)L.has(pe)?E.add(pe):re=!0;return re?E:h})},[n]),(0,f.useEffect)(()=>{if(!p||W||l.trim()!=="")return;let h=!0;return e.query({sessionId:t,query:{kind:"last-commit-message"}}).then(L=>{let E=ye(L,"last-commit-message");h&&E!==null&&(d(E.message),O(!0))}),()=>{h=!1}},[p,W,l,e,t]);let qe=(0,f.useCallback)(async(h,L,E=!1,re=!1)=>{let pe=++_e.current;C({path:h,base:L}),re||Q(null),z(E);let we=await e.query({sessionId:t,query:{kind:"diff",path:h,base:L,...E?{context:2e3}:{}}});if(pe!==_e.current)return;let We=ye(we,"diff");Q(We!==null?{text:We.text,newLines:We.newLines,truncated:We.truncated}:{text:"",newLines:0})},[e,t]);(0,f.useEffect)(()=>{if(F===null)return;if(!n.changes.some(L=>L.path===F.path)){C(null),Q(null),w("list");return}qe(F.path,F.base,ae,!0)},[n]),(0,f.useEffect)(()=>{J(null)},[n]),(0,f.useEffect)(()=>{le(!1)},[n]);let Ge=h=>{s(L=>{let E=new Set(L);return E.has(h)?E.delete(h):E.add(h),E})},ke=async h=>{if(g)return!1;S(!0),_(null),be(null);try{let L=await r(h);return L.ok?!0:(_(L.error??i("error.generic")),!1)}catch(L){return _(L instanceof Error?L.message:i("error.generic")),!1}finally{S(!1)}},ht=async()=>{let h=l.trim();if(h===""&&!p){_(i("error.emptyMessage"));return}let L=o.size>0?[...new Set([...o].map(re=>re.replace(/:[sw]$/,"")))]:void 0;await ke({kind:"commit",message:h,...L?{paths:L}:{},...p?{amend:!0}:{}})&&(d(""),s(new Set),u(!1),O(!1))},ne=async h=>{await ke({kind:"stash-push",...h.trim()!==""?{message:h}:{}})&&(B(!1),De())},Ie=(h,L)=>{ke({kind:"stash-apply",index:h,sha:L}).then(E=>{E&&De()})},Lt=(h,L)=>{ke({kind:"stash-pop",index:h,sha:L}).then(E=>{E&&De()})},je=async(h,L)=>{await ke({kind:"stash-drop",index:h,sha:L})&&(ue(null),De())},Qe=(h,L)=>{switch(h){case"empty-diff":return i("error.emptyDiff");case"llm-unavailable":return i("error.llmUnavailable");case"suggest-disabled":return i("error.suggestDisabled");case"llm-error":case"llm-output":return L===void 0?i("error.llmFailed"):`${i("error.llmFailed")}: ${L}`;default:return L??i("error.generic")}},Ye=async()=>{if(se)return;if(p&&!de&&l.trim()!==""){le(!0),_(null),be(i("commit.suggestOverwrite"));return}le(!1);let h=o.size>0?[...new Set([...o].map(L=>L.replace(/:[sw]$/,"")))]:void 0;q(!0),_(null),be(null);try{let L=await e.suggest({sessionId:t,...h&&h.length>0?{paths:h}:{}});L.ok?(d(L.value.message),L.value.truncated===!0&&be(i("commit.suggestTruncated")),Se.current?.focus()):_(Qe(L.error.code,L.error.message))}catch(L){_(L instanceof Error?L.message:i("error.generic"))}finally{q(!1)}},yt=h=>{M(L=>{let E=new Set(L);return E.has(h)?E.delete(h):E.add(h),E})},Ce=R!==null&&R.text!==""?gn(R.text):null,Je=mt({storageKey:"gp.changes.left",initial:380,min:220,reserve:200,edge:"end"}),bt=(h,L)=>{qe(h,L),a&&w("diff")},dt=a?["unified","before","after"]:["unified","split","before","after"],Ze=a&&U==="split"?"unified":U,ct=[(0,f.createElement)(Ta,{key:"stats",stats:n.stats,t:i}),(0,f.createElement)("div",{key:"toolbar",className:"gp-toolbar"},[(0,f.createElement)("button",{key:"sa",type:"button",className:"gp-btn",disabled:g||n.changes.length===0,onClick:()=>void ke({kind:"stage-all"})},i("changes.stageAll")),(0,f.createElement)("button",{key:"ua",type:"button",className:"gp-btn",disabled:g||n.staged===0,onClick:()=>void ke({kind:"unstage-all"})},i("changes.unstageAll")),(0,f.createElement)("button",{key:"stash",type:"button",className:"gp-btn",disabled:g||n.staged===0&&n.modified===0,title:i("changes.stash"),onClick:()=>{_(null),B(!0)}},[(0,f.createElement)(Rn,{key:"ic",size:13}),i("changes.stash")])]),b!==null?(0,f.createElement)("div",{key:"err",className:"gp-feedback"},b):null,he!==null?(0,f.createElement)("div",{key:"notice",className:"gp-notice"},he):null,(0,f.createElement)("div",{key:"list",className:"gp-changes__list",ref:lt},n.changes.length===0?(0,f.createElement)("div",{className:"gp-empty"},i("changes.noChanges")):(0,f.createElement)("div",{className:"gp-changes__vlist",style:{height:Ae}},Ve.slice(Te,Xe).map((h,L)=>{let E=Te+L;if(h.kind==="head"){let we=h.g;return(0,f.createElement)("div",{key:`h:${we.key}`,className:"gp-changes__vrow",style:{top:Be[E],height:Na}},(0,f.createElement)("div",{className:"gp-group-head",onClick:()=>yt(we.key)},[(0,f.createElement)(tt,{key:"chev",size:12,open:!k.has(we.key)}),`${i(we.labelKey)} (${we.count})`]))}let re=h.c,pe=re.path+(re.staged?":s":":w");return(0,f.createElement)("div",{key:pe,className:"gp-changes__vrow",style:{top:Be[E],height:On}},uo(re,{selected:o.has(pe),active:F?.path===re.path&&F.base===(re.staged?"staged":"worktree"),busy:g,armed:D===pe,onToggle:()=>Ge(pe),onOpen:()=>bt(re.path,re.staged?"staged":"worktree"),onStage:()=>void ke(re.staged?{kind:"unstage",paths:[re.path]}:{kind:"stage",paths:[re.path]}),onDiscard:()=>{D===pe?(ke({kind:"discard",paths:[re.path]}),J(null)):J(pe)},t:i}))}))),T.length>0?(0,f.createElement)("div",{key:"stashes",className:"gp-stash"},[(0,f.createElement)("div",{key:"head",className:"gp-group-head",onClick:()=>m(h=>!h)},[(0,f.createElement)(tt,{key:"chev",size:12,open:!Y}),`${i("stash.section")} (${T.length})`]),Y?null:(0,f.createElement)("div",{key:"items"},T.map(h=>po(h,{busy:g,onApply:()=>Ie(h.index,h.sha),onPop:()=>Lt(h.index,h.sha),onDrop:()=>{_(null),ue(h)},t:i})))]):null,(0,f.createElement)("div",{key:"box",className:"gp-commitbox"},[(0,f.createElement)("div",{key:"msg",className:`gp-commitbox__msg-wrap${se?" gp-commitbox__msg-wrap--busy":""}`},[(0,f.createElement)("textarea",{key:"ta",className:"gp-commitbox__msg",placeholder:i("commit.placeholder"),value:l,ref:Se,readOnly:se,"aria-busy":se,onChange:h=>d(h.target.value)}),se?(0,f.createElement)("span",{key:"spin",className:"gp-commitbox__spin","aria-hidden":"true"}):null]),(0,f.createElement)("div",{key:"row",className:"gp-commitbox__row"},[(0,f.createElement)("label",{key:"amend",className:"gp-commitbox__amend"},[(0,f.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:p,disabled:se,onChange:()=>{u(h=>!h),O(!1)}}),i("commit.amend")]),(0,f.createElement)("div",{key:"actions",className:"gp-commitbox__actions"},[n.suggestEnabled!==!1?(0,f.createElement)("button",{key:"suggest",type:"button",className:"gp-btn",disabled:g||se||n.changes.length===0,onClick:()=>void Ye(),title:i("commit.suggest")},[(0,f.createElement)(Sr,{key:"ic",size:13}),i(se?"commit.suggesting":"commit.suggest")]):null,(0,f.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary",disabled:g||se||l.trim()==="",onClick:()=>void ht()},i("commit.commit"))])])])],te=F===null?(0,f.createElement)("div",{className:"gp-empty"},i("changes.selectFile")):(0,f.createElement)("div",{className:"gp-diff"},[(0,f.createElement)("div",{key:"tb",className:`gp-diff__toolbar${a?" gp-diff__toolbar--compact":""}`},(()=>{let h=a?(0,f.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>w("list")},[(0,f.createElement)(xt,{key:"i",size:14}),i("changes.backToList")]):null,L=(0,f.createElement)("span",{key:"path",className:"gp-diff__path"},F.path),E=Ce?(0,f.createElement)("span",{key:"sum",className:"gp-stats__item",style:{marginLeft:"auto"}},[(0,f.createElement)("span",{key:"a",className:"gp-stats__add"},`+${Ce.add}`)," ",(0,f.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${Ce.del}`)]):null,re=(0,f.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${ae?" gp-seg__btn--active":""}`,style:Ce||a?{}:{marginLeft:"auto"},disabled:Ze!=="split"&&Ze!=="unified",title:i(ae?"diff.collapse":"diff.expandAll"),onClick:()=>void qe(F.path,F.base,!ae)},i(ae?"diff.collapse":"diff.expandAll")),pe=(0,f.createElement)("div",{key:"seg",className:"gp-seg"},it(dt,Ze,K,we=>i(`diff.${we}`)));return a?[(0,f.createElement)("div",{key:"row1",className:"gp-diff__toolbar-row"},[h,L,E]),(0,f.createElement)("div",{key:"row2",className:"gp-diff__toolbar-row gp-diff__toolbar-row--controls"},[re,pe])]:[h,L,E,re,pe]})()),R===null?(0,f.createElement)("div",{key:"scroll",className:"gp-diff__scroll"},(0,f.createElement)("div",{className:"gp-empty"},i("common.loading"))):(0,f.createElement)(un,{key:"diff",text:R.text,mode:Ze,path:F.path,remote:e,sessionId:t,base:F.base,expanded:ae,truncated:R.truncated===!0,newLines:R.newLines,t:i})]),$=[G?(0,f.createElement)(co,{key:"push",onClose:()=>B(!1),onStash:ne,error:b,t:i}):null,P!==null?Ke({title:i("stash.dropTitle"),body:i("stash.dropConfirm",{name:P.message}),confirmLabel:i("stash.drop"),danger:!0,error:b,onConfirm:()=>void je(P.index,P.sha),onClose:()=>ue(null),t:i}):null];return a?(0,f.createElement)("div",{className:"gp-changes gp-changes--compact"},[...$,ee==="diff"?(0,f.createElement)("div",{key:"right",className:"gp-changes__right"},te):(0,f.createElement)("div",{key:"left",className:"gp-changes__left"},ct)]):(0,f.createElement)("div",{className:"gp-changes"},[...$,(0,f.createElement)("div",{key:"left",className:"gp-changes__left",style:{flex:`0 0 ${Je.width}px`}},ct),Je.divider,(0,f.createElement)("div",{key:"right",className:"gp-changes__right"},te)])}function co({onClose:e,onStash:t,error:n,t:r}){let[a,i]=(0,f.useState)("");return ot({onClose:e,title:r("stash.title"),icon:(0,f.createElement)(Rn,{size:15}),portalKey:"stash-push-modal",t:r,body:[(0,f.createElement)("input",{key:"msg",className:"gp-input",placeholder:r("stash.messagePlaceholder"),value:a,autoFocus:!0,onChange:o=>i(o.target.value),onKeyDown:o=>{o.key==="Enter"&&t(a)}}),Nt(r),n!==null?(0,f.createElement)("div",{key:"err",className:"gp-feedback"},n):null],footer:Et({onClose:e,onConfirm:()=>void t(a),confirmLabel:r("stash.save"),confirmDisabled:!1,danger:!1,t:r})})}function po(e,t){return(0,f.createElement)("div",{key:e.index,className:"gp-stash-row"},[(0,f.createElement)("div",{key:"info",className:"gp-stash-row__info"},[(0,f.createElement)("span",{key:"m",className:"gp-stash-row__msg",title:e.message},e.message),(0,f.createElement)("span",{key:"meta",className:"gp-stash-row__meta"},[e.branch!==null?(0,f.createElement)("span",{key:"b"},t.t("stash.onBranch",{branch:e.branch})):null,e.relTime!==""?(0,f.createElement)("span",{key:"t"},e.relTime):null])]),(0,f.createElement)("div",{key:"act",className:"gp-stash-row__actions"},[(0,f.createElement)("button",{key:"apply",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onApply},t.t("stash.apply")),(0,f.createElement)("button",{key:"pop",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onPop},t.t("stash.pop")),(0,f.createElement)("button",{key:"drop",type:"button",className:"gp-icon-btn",disabled:t.busy,title:t.t("stash.drop"),onClick:t.onDrop},(0,f.createElement)(Tr,{size:14}))])])}function $n(e,t){return e.path.localeCompare(t.path)}function uo(e,t){let n=e.path.split("/").pop()??e.path,r=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,f.createElement)("div",{key:e.path+(e.staged?":s":":w"),className:`gp-file-row${t.active?" gp-file-row--active":""}`,onClick:t.onOpen},[(0,f.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:t.selected,onClick:a=>a.stopPropagation(),onChange:t.onToggle}),(0,f.createElement)("span",{key:"st",className:`gp-status-badge ${kt(e.status)}`},Yt[e.status]??"?"),(0,f.createElement)("span",{key:"nm",className:"gp-tree-name",title:e.path},[n,r?(0,f.createElement)("span",{key:"d",style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6,fontSize:11}},r):null]),(0,f.createElement)("span",{key:"act",className:"gp-file-row__actions"},[(0,f.createElement)("button",{key:"stg",type:"button",className:"gp-icon-btn",title:e.staged?t.t("changes.unstage"):t.t("changes.stage"),disabled:t.busy,onClick:a=>{a.stopPropagation(),t.onStage()}},e.staged?"\u2212":"+"),(0,f.createElement)("button",{key:"dis",type:"button",className:"gp-icon-btn",title:t.armed?t.t("changes.discardConfirm"):t.t("changes.discard"),style:t.armed?{color:"var(--dsw-alias-state-error-primary)"}:{},disabled:t.busy,onClick:a=>{a.stopPropagation(),t.onDiscard()}},"\u21BA")])])}var v=require("react");var He=require("@deepseek-ai/dsh-client-ui-primitives");var oe=require("react");function Xn(e){if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],n=e/1024,r=0;for(;(n>=1024||Number(n.toFixed(1))>=1024)&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}var go={bash:"Bash",c:"C",cpp:"C++",csharp:"C#",css:"CSS",dockerfile:"Dockerfile",go:"Go",html:"HTML",java:"Java",javascript:"JavaScript",json:"JSON",jsx:"JSX",kotlin:"Kotlin",markdown:"Markdown",php:"PHP",python:"Python",ruby:"Ruby",rust:"Rust",scss:"SCSS",shellscript:"Shell",sql:"SQL",swift:"Swift",toml:"TOML",tsx:"TSX",typescript:"TypeScript",vue:"Vue",xml:"XML",yaml:"YAML"};function Ma(e){return go[e]??fo(e)}function fo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Gt=require("@deepseek-ai/dsh-client-ui-primitives");function mo(e,t){let n=ho(e.path);if(e.kind==="binary")return t("files.propsTypeBinary");let r=It(e.path);if((e.kind==="image"||e.kind==="tooLarge")&&r!==null){let s=r.slice(6).toUpperCase();return t("files.propsTypeFmt",{label:t("files.propsTypeImage",{fmt:s}),ext:n})}let a=(0,Gt.languageForPath)(e.path),o=a!==void 0&&a!==""?Ma(a):e.kind==="tooLarge"?t("files.propsTypeUnread"):t("files.propsTypeText");return n===""?o:t("files.propsTypeFmt",{label:o,ext:n})}function ho(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n+1):""}function st(e,t,n){return{label:e,value:typeof t=="string"?(0,oe.createElement)("span",{},t):t,key:n}}function Jn(e,t,n){return(0,oe.createElement)("div",{key:n,className:"gp-props__group"},[e!==null?(0,oe.createElement)("div",{key:"t",className:"gp-props__group-title"},e):null,...t.map(r=>(0,oe.createElement)("div",{key:r.key,className:"gp-props__row"},[(0,oe.createElement)("span",{key:"l",className:"gp-props__label"},r.label),(0,oe.createElement)("span",{key:"v",className:"gp-props__value"},r.value)]))])}function Ga(e,t,n){return(0,oe.createElement)("button",{type:"button",className:"gp-props__copy",title:t,"aria-label":t,onClick:n},(0,oe.createElement)("code",{className:"gp-props__mono"},e))}function yo(e,t,n){let r=[],a=e.filter(i=>i.path===t&&!i.isDirectory);a.some(i=>i.staged)&&r.push((0,oe.createElement)("span",{key:"staged",className:"gp-props__badge gp-status--added"},n("files.propsStaged")));for(let i of a)i.staged||i.status==="untracked"||r.push((0,oe.createElement)("span",{key:i.status,className:`gp-props__badge ${kt(i.status)}`},bo(i.status,n)));return r}function bo(e,t){switch(e){case"added":return t("files.stAdded");case"modified":return t("files.stModified");case"deleted":return t("files.stDeleted");case"renamed":return t("files.stRenamed");case"untracked":return t("files.propsUntracked");case"conflicted":return t("files.stConflicted");case"typechange":return t("files.stTypechange")}}function Ra({input:e,snapshot:t,onClose:n,t:r}){let[a,i]=(0,oe.useState)(null);(0,oe.useEffect)(()=>{if(e.kind!=="image"||e.dataUrl===void 0)return;let D=!0,J=new Image;return J.onload=()=>{D&&i({w:J.naturalWidth,h:J.naturalHeight})},J.src=e.dataUrl,()=>{D=!1}},[e.kind,e.dataUrl]);let[o,s]=(0,oe.useState)(null),l=(0,oe.useRef)(void 0);(0,oe.useEffect)(()=>{s(null)},[e.path]),(0,oe.useEffect)(()=>()=>{l.current!==void 0&&clearTimeout(l.current)},[]);let d=D=>{(0,Gt.writeClipboard)(D).then(J=>{s(J?"copied":"error"),l.current!==void 0&&clearTimeout(l.current),l.current=setTimeout(()=>s(null),1600)})},p=e.path.lastIndexOf("/"),u=p<0?e.path:e.path.slice(p+1),g=[st(r("files.propsName"),(0,oe.createElement)("span",{className:"gp-props__strong"},u),"name"),st(r("files.propsType"),mo(e,r),"type"),st(r("files.propsRelPath"),Ga(e.path,r("files.propsCopyHint"),()=>d(e.path)),"rel")];if(t!==null){let D=`${t.root}/${e.path}`;g.push(st(r("files.propsAbsPath"),Ga(D,r("files.propsCopyHint"),()=>d(D)),"abs"))}let S=[];if(e.size!==void 0){let D=e.size>=1024?(0,oe.createElement)("span",{},[(0,oe.createElement)("span",{key:"h",className:"gp-props__strong"},Xn(e.size)),(0,oe.createElement)("span",{key:"b",className:"gp-props__sub"},r("files.propsSizeBytes",{bytes:e.size.toLocaleString("en-US")}))]):(0,oe.createElement)("span",{className:"gp-props__strong"},Xn(e.size));S.push(st(r("files.propsSize"),D,"size"))}e.kind==="text"&&e.lines!==void 0&&S.push(st(r("files.propsLines"),(0,oe.createElement)("span",{className:"gp-props__strong"},String(e.lines)),"lines")),a!==null&&S.push(st(r("files.propsImageSize"),(0,oe.createElement)("span",{className:"gp-props__strong"},r("files.propsImageSizeFmt",a)),"dims"));let b=[];e.mtimeMs!==void 0&&b.push(st(r("files.propsMtime"),(0,oe.createElement)("span",{title:rt(e.mtimeMs,Date.now(),r)},Bt(e.mtimeMs)),"mtime"));let _=[Jn(null,g,"g-basic"),S.length>0?Jn(r("files.propsGroupStats"),S,"g-stats"):null,b.length>0?Jn(r("files.propsGroupTime"),b,"g-time"):null],k=[];t!==null&&(k.push(e.ignored?(0,oe.createElement)("span",{key:"ig",className:"gp-props__badge gp-props__badge--muted"},r("files.ignored")):Br(t.changes,e.path)?(0,oe.createElement)("span",{key:"un",className:"gp-props__badge gp-props__badge--muted"},r("files.propsUntracked")):(0,oe.createElement)("span",{key:"tr",className:"gp-props__badge gp-props__badge--ok"},r("files.propsTrackedYes"))),k.push(...yo(t.changes,e.path,r)));let M=(0,oe.createElement)("div",{key:"status",className:"gp-modal__footer gp-props__statusbar","aria-live":"polite"},[k.length>0?(0,oe.createElement)("span",{key:"chips",className:"gp-props__footer-chips"},k):null,o!==null?(0,oe.createElement)("span",{key:"fb",className:`gp-props__copied${o==="error"?" gp-props__copied--err":""}`},r(o==="copied"?"files.pathCopied":"files.pathCopyFailed")):null]);return ot({onClose:n,title:r("files.propsTitle"),icon:(0,oe.createElement)(Gt.FileTypeIcon,{path:e.path,size:15}),body:_,footer:M,portalKey:"file-props",t:r})}function Da(e){return/\.(?:md|markdown)$/i.test(e)}function Kn(e){return/\.(?:html?|xhtml)$/i.test(e)}function vo(e){return Da(e)||Kn(e)}var wo=256*1024,xo=5e3,La=5e3,yn=20,Pa=12,ko=600,_o=6e4,bn=new Map;function So(e,t){let n=t.file.kind==="loading"?{kind:"idle"}:t.file;bn.set(e,{state:{...t,file:n},leftAt:Date.now()})}function Co(e){let t=bn.get(e);return t===void 0?null:Date.now()-t.leftAt>_o?(bn.delete(e),null):t.state}function Un({remote:e,sessionId:t,compact:n,worktreeGen:r,snapshot:a,t:i}){let o=(0,v.useRef)(void 0);o.current===void 0&&(o.current=Co(t));let s=o.current,[l,d]=(0,v.useState)(()=>s?.dirs??new Map),[p,u]=(0,v.useState)(()=>s?.open??new Set([""])),[g,S]=(0,v.useState)(()=>s?.selected??null),[b,_]=(0,v.useState)(()=>s?.file??{kind:"idle"}),[k,M]=(0,v.useState)(()=>s?.renderMarkdown??!0),[D,J]=(0,v.useState)("idle"),[F,C]=(0,v.useState)("idle"),[R,Q]=(0,v.useState)(!1),[U,K]=(0,v.useState)(()=>s?.pane??"tree"),ae=(0,v.useMemo)(()=>({code:{copyLabel:i("files.copy"),copiedLabel:i("files.copied")},footnotes:i("files.footnotes")}),[i]),z=(0,v.useRef)(0),W=mt({storageKey:"gp.files.left",initial:300,min:180,reserve:220,edge:"end"}),O=(0,v.useCallback)(m=>{d(G=>{let B=G.get(m);if(B!==void 0&&B.status!=="error")return G;let P=new Map(G);return P.set(m,{status:"loading"}),P}),e.query({sessionId:t,query:{kind:"dir-list",path:m}}).then(G=>{let B=ye(G,"dir-list");d(P=>{let ue=new Map(P);return ue.set(m,B===null?{status:"error"}:{status:"ready",entries:B.entries,truncated:B.truncated}),ue})}).catch(()=>{d(G=>{let B=new Map(G);return B.set(m,{status:"error"}),B})})},[e,t]);(0,v.useEffect)(()=>{O("")},[O]);let se=(0,v.useRef)(r);(0,v.useEffect)(()=>{se.current!==r&&(se.current=r,bn.delete(t),d(new Map),u(new Set([""])),S(null),_({kind:"idle"}),K("tree"),O(""))},[r,t,O]);let q=(0,v.useCallback)(m=>{u(G=>{let B=new Set(G);return B.has(m)?(B.delete(m),B):(B.add(m),l.get(m)===void 0&&O(m),B)})},[l,O]),de=(0,v.useCallback)(m=>{S(m),n&&K("preview"),M(!Kn(m)),J("idle"),C("idle"),Q(!1);let G=++z.current;_({kind:"loading",path:m}),e.query({sessionId:t,query:{kind:"file-content",path:m}}).then(B=>{if(G!==z.current)return;let P=ye(B,"file-content");if(P===null){_({kind:"error",path:m});return}let ue={...P.size!==void 0?{size:P.size}:{},...P.mtimeMs!==void 0?{mtimeMs:P.mtimeMs}:{}};if(P.tooLarge===!0){_({kind:"tooLarge",path:m,...ue});return}if(P.variant==="image"&&P.dataUrl!==void 0){_({kind:"image",path:m,dataUrl:P.dataUrl,...ue});return}if(P.variant==="text"){_({kind:"text",path:m,content:P.content??"",lines:P.lines??0,...ue});return}_({kind:"binary",path:m,...ue})}).catch(()=>{G===z.current&&_({kind:"error",path:m})})},[e,t,n]),le=(0,v.useRef)({dirs:l,open:p,selected:g,file:b,renderMarkdown:k,pane:U});le.current={dirs:l,open:p,selected:g,file:b,renderMarkdown:k,pane:U},(0,v.useEffect)(()=>()=>{So(t,le.current)},[t]);let he=(0,v.useRef)(!1);(0,v.useEffect)(()=>{he.current||(he.current=!0,s!==null&&s.selected!==null&&b.kind==="idle"&&de(s.selected))},[s,b.kind,de]);let be=(0,v.useMemo)(()=>za("",0,{dirs:l,open:p,selected:g,toggleDir:q,selectFile:de,t:i}),[l,p,g,q,de,i]),ee=async()=>{if(g===null)return;let m=z.current,G=await(0,He.writeClipboard)(g);m===z.current&&J(G?"copied":"error")},w=async()=>{if(b.kind!=="text")return;let m=z.current,G=await(0,He.writeClipboard)(b.content);m===z.current&&C(G?"copied":"error")},T=(()=>{if(g===null||b.kind!=="text"&&b.kind!=="image"&&b.kind!=="binary"&&b.kind!=="tooLarge")return null;let m=g.lastIndexOf("/"),G=m<0?"":g.slice(0,m),B=m<0?g:g.slice(m+1),P=l.get(G),ue=P?.status==="ready"?P.entries.find(Se=>!Se.dir&&Se.name===B):void 0;return{path:g,kind:b.kind,...b.size!==void 0?{size:b.size}:{},...b.mtimeMs!==void 0?{mtimeMs:b.mtimeMs}:{},...b.kind==="text"?{lines:b.lines}:{},...b.kind==="image"?{dataUrl:b.dataUrl}:{},ignored:ue?.ignored===!0}})(),j=(0,v.createElement)("div",{key:"left",className:"gp-files__tree",style:n?void 0:{flex:`0 0 ${W.width}px`}},be),Y=(0,v.createElement)("div",{key:"right",className:"gp-files__preview"},[g!==null?(0,v.createElement)("div",{key:"bar",className:"gp-files__bar"},[n?(0,v.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>K("tree")},[(0,v.createElement)(xt,{key:"i",size:14}),i("files.backToTree")]):null,(0,v.createElement)("code",{key:"path",className:"gp-files__path",title:g},g),b.kind==="text"&&vo(b.path)?(0,v.createElement)("div",{key:"mode",className:"gp-files__mode",role:"group","aria-label":i("files.previewMode")},[(0,v.createElement)("button",{key:"source",type:"button",className:`gp-files__mode-btn${k?"":" gp-files__mode-btn--active"}`,"aria-pressed":!k,onClick:()=>M(!1)},i("files.source")),(0,v.createElement)("button",{key:"render",type:"button",className:`gp-files__mode-btn${k?" gp-files__mode-btn--active":""}`,"aria-pressed":k,onClick:()=>M(!0)},i("files.render"))]):null,(0,v.createElement)("button",{key:"copy",type:"button",className:`gp-files__copy-path${D==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{ee()}},i(D==="copied"?"files.pathCopied":D==="error"?"files.pathCopyFailed":"files.copyPath")),b.kind==="text"?(0,v.createElement)("button",{key:"copy-content",type:"button",className:`gp-files__copy-path${F==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{w()}},i(F==="copied"?"files.contentCopied":F==="error"?"files.contentCopyFailed":"files.copyContent")):null,(0,v.createElement)("button",{key:"props",type:"button",className:"gp-files__props",title:i("files.propsTitle"),"aria-label":i("files.propsTitle"),disabled:T===null,onClick:()=>Q(!0)},(0,v.createElement)(Lr,{size:14}))]):null,(0,v.createElement)("div",{key:"content",className:"gp-files__preview-content"},To(b,k,ae,i)),T!==null&&R?(0,v.createElement)(Ra,{key:"props-modal",input:T,snapshot:a,onClose:()=>Q(!1),t:i}):null]);return n?(0,v.createElement)("div",{className:"gp-files gp-files--compact"},U==="preview"?Y:j):(0,v.createElement)("div",{className:"gp-files"},[j,W.divider,Y])}function To(e,t,n,r){return e.kind==="text"&&t&&Da(e.path)?(0,v.createElement)("div",{className:"gp-files__markdown"},(0,v.createElement)(He.MarkdownText,{text:e.content,labels:n,variant:"body"})):e.kind==="text"&&t&&Kn(e.path)?(0,v.createElement)("iframe",{className:"gp-files__html",title:e.path,srcDoc:e.content,sandbox:"allow-scripts",referrerPolicy:"no-referrer"}):No(e,r)}function za(e,t,n){let r=n.dirs.get(e);if(r===void 0||r.status==="loading")return t===0?[(0,v.createElement)("div",{key:"l",className:"gp-empty"},n.t("common.loading"))]:[(0,v.createElement)("div",{key:`l${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("common.loading"))];if(r.status==="error")return[(0,v.createElement)("div",{key:`e${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("files.loadFailed"))];let a=[];for(let i of r.entries){let o=e===""?i.name:`${e}/${i.name}`;if(i.dir){let s=n.open.has(o);a.push((0,v.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry gp-files__entry--dir${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:10+t*14},"aria-expanded":s,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.toggleDir(o)},[(0,v.createElement)("span",{key:"c",className:"gp-tree-chev"},(0,v.createElement)(tt,{size:11,open:s})),(0,v.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,v.createElement)(He.FileTypeIcon,{kind:"folder",size:18})),(0,v.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)])),s&&a.push(...za(o,t+1,n))}else{let s=n.selected===o;a.push((0,v.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry${s?" gp-tree-row--active":""}${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:10+t*14},"aria-current":s?"true":void 0,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.selectFile(o)},[(0,v.createElement)("span",{key:"c",className:"gp-tree-chev"}),(0,v.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,v.createElement)(He.FileTypeIcon,{path:o,size:18})),(0,v.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)]))}}return r.truncated&&a.push((0,v.createElement)("div",{key:`t${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("files.truncated"))),a}function No(e,t){switch(e.kind){case"idle":return(0,v.createElement)("div",{className:"gp-empty"},t("files.selectFile"));case"loading":return(0,v.createElement)("div",{className:"gp-empty"},t("common.loading"));case"error":return(0,v.createElement)("div",{className:"gp-empty"},t("files.loadFailed"));case"tooLarge":return(0,v.createElement)("div",{className:"gp-empty"},t("files.tooLarge"));case"binary":return(0,v.createElement)("div",{className:"gp-empty"},t("files.binary"));case"image":return(0,v.createElement)(Ot,{src:e.dataUrl,alt:e.path,t,viewportClass:"gp-files__image"});case"text":return(0,v.createElement)(Mo,{content:e.content,path:e.path,t})}}function Eo(e,t){if(t==="")return[];let n=[];for(let r=0;r<e.length;r++)for(let[a,i]of an(e[r],t))if(n.push({line:r,start:a,end:i}),n.length>=tn)return n;return n}function Mo({content:e,path:t,t:n}){let r=(0,v.useMemo)(()=>{let m=e.split(`
675
- `);return m.length>0&&m[m.length-1]===""&&m.pop(),m},[e]),a=e.length>wo||r.length>xo,i=a?void 0:(0,He.languageForPath)(t),o=(0,He.useCodeHighlighter)(i),s=(0,v.useMemo)(()=>a?void 0:o(r.join(`
676
- `)),[a,o,r]),[l,d]=(0,v.useState)(!1),[p,u]=(0,v.useState)(""),[g,S]=(0,v.useState)(!1),[b,_]=(0,v.useState)(0),{setEl:k,viewport:M,elRef:D}=Tt(),J=(0,v.useRef)(null),F=(0,v.useRef)(null);(0,v.useEffect)(()=>{d(!1),u(""),_(0)},[t]);let C=rn(p,nn),R=(0,v.useMemo)(()=>r.map(m=>m.toLowerCase()),[r]),Q=g?C:C.toLowerCase(),U=g?r:R,K=(0,v.useMemo)(()=>Eo(U,Q),[U,Q]);(0,v.useEffect)(()=>{_(0)},[Q]);let ae=K.length===0?0:Math.min(b,K.length-1),z=(0,v.useMemo)(()=>{let m=new Map;for(let G of K){let B=m.get(G.line)??[];B.push([G.start,G.end]),m.set(G.line,B)}return m},[K]);(0,v.useEffect)(()=>{let m=G=>{if(!((G.ctrlKey||G.metaKey)&&(G.key==="f"||G.key==="F")))return;let B=D.current;B===null||B.offsetParent===null||(G.preventDefault(),d(!0),requestAnimationFrame(()=>J.current?.select()))};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[]);let W=r.length,O=(0,v.useMemo)(()=>St(new Array(W).fill(yn)),[W]),se=M.height>0?M.height:ko,{first:q,last:de}=Ct(O,M.top,se,Pa*yn),le=K.length>0?K[ae].line:-1,{first:he,last:be}=en({first:q,last:de},le,W,Pa);(0,v.useEffect)(()=>{if(le<0)return;let m=requestAnimationFrame(()=>F.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(m)},[ae,K,le]);let ee=(0,v.useCallback)(m=>{_(G=>K.length===0?0:(G+m+K.length)%K.length)},[K.length]),w=K.length>0?K[ae]:null,T=l?(0,v.createElement)(sn,{inputRef:J,query:p,matches:K.length,active:ae,caseSensitive:g,onChange:u,onToggleCase:()=>S(m=>!m),onStep:ee,onClose:()=>d(!1),t:n}):null,j=a||l?(0,v.createElement)("div",{key:"hd",className:"gp-files__header"},[a?(0,v.createElement)("div",{key:"note",className:"gp-files__note"},n("files.highlightOff")):null,T]):null,Y=[];for(let m=he;m<be;m++)Y.push((0,v.createElement)("div",{key:m,className:"gp-files__row",style:{top:m*yn}},[(0,v.createElement)("div",{key:"n",className:"gp-diff-no"},m+1),Go(r[m],m,s?.[m],z.get(m),w,F,n)]));return(0,v.createElement)("div",{className:"gp-files__code gp-diff__scroll",ref:k},[j,(0,v.createElement)("div",{key:"grid",className:"gp-files__single gp-files__single--virt",style:{height:W*yn}},Y)])}function Go(e,t,n,r,a,i,o){if(e==="")return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},"\xA0");if(e.length>La)return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},[e.slice(0,La),(0,v.createElement)("span",{key:"trunc",className:"gp-files__trunc"},o("files.lineTruncated"))]);if(r===void 0||r.length===0)return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},n!==void 0?n.map((l,d)=>(0,v.createElement)("span",{key:d,style:l.style},l.text)):e);let s=a!==null&&a.line===t?[a.start,a.end]:null;return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},on(e,r,n,`c${t}`,s,i))}var vn=require("react"),Ro=620;function Aa(e){let[t,n]=(0,vn.useState)(!1);return(0,vn.useLayoutEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=()=>n(e.clientWidth>0&&e.clientWidth<=Ro);r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}var Ha="gp.panel.fontDelta";function Lo(){if(typeof localStorage>"u")return 0;let e=Number(localStorage.getItem(Ha));return e===-1||e===1?e:0}function Fa({ctx:e,sessionId:t,t:n}){let[r,a]=(0,I.useState)(Lo),[i,o]=(0,I.useState)(null),[s,l]=(0,I.useState)(null),d=Aa(s),p=Wt(t),u=Pt(e),g=p.state==="error"&&p.error.code==="git-unavailable",S=p.state==="error"&&(p.error.code==="not-a-git-repo"||p.error.code==="git-unavailable"),b=g&&p.state==="error"&&p.error.isGitRepo===!0,_=S?"files":i!==null&&i.sessionId===t?i.tab:null,k=(0,I.useRef)({tabs:new Set});k.current.sessionId!==t&&(k.current={sessionId:t,tabs:new Set}),_!==null&&k.current.tabs.add(_);let M=k.current.tabs.has("files");(0,I.useEffect)(()=>{if(!et(t))return;if(S){o(null);return}if(i?.sessionId===t)return;let z=mr(t);if(z!==null){o({sessionId:t,tab:z});return}let W=br(t);if(W!==null){o({sessionId:t,tab:W});return}p.state==="ready"&&o({sessionId:t,tab:p.snapshot.dirty?"changes":"overview"})},[t,p,S,i?.sessionId]),(0,I.useEffect)(()=>{if(et(t))return hr(t,z=>o({sessionId:t,tab:z}))},[t]);let D=(0,I.useRef)({tab:null});D.current={sessionId:t,tab:_},(0,I.useEffect)(()=>()=>{let{sessionId:z,tab:W}=D.current;z!==void 0&&W!==null&&yr(z,W)},[]);let J=p.state==="ready"?p.snapshot.checkedAt:0,[F,C]=(0,I.useState)(0),R=async z=>{if(!et(t))return{ok:!1,error:n("error.noCwd")};let W=await u.run({sessionId:t,action:z});return W.ok?(Dt(t).accept(W.snapshot),z.kind==="branch-checkout"&&C(O=>O+1),{ok:!0}):(z.kind==="branch-checkout"&&z.stashMessage!==void 0&&C(O=>O+1),Dt(t).resync(),{ok:!1,error:$t(W.error.code,W.error.message,n)})},Q=z=>{a(z),typeof localStorage<"u"&&localStorage.setItem(Ha,String(z))},U=[{key:"overview",label:n("tab.overview"),icon:(0,I.createElement)(qt,{size:14})},{key:"changes",label:n("tab.changes"),icon:(0,I.createElement)(kr,{size:14})},{key:"files",label:n("tab.files"),icon:(0,I.createElement)(Er,{size:14})}],K=S?U.filter(z=>z.key==="files"):U,ae=(()=>{if(!et(t))return(0,I.createElement)("div",{className:"gp-empty"},n("error.noCwd"));if(p.state==="no-cwd")return(0,I.createElement)("div",{className:"gp-empty"},n("error.noCwd"));if(S){let W=M?(0,I.createElement)(Un,{key:t,remote:u,sessionId:t,compact:d,worktreeGen:F,snapshot:null,t:n}):null;return b?(0,I.createElement)("div",{className:"gp-files-wrap"},[(0,I.createElement)("div",{key:"notice",className:"gp-notice"},n("files.gitNotInstalled")),W]):(0,I.createElement)("div",{style:{display:"contents"}},W)}if(p.state==="error")return(0,I.createElement)("div",{className:"gp-empty"},n("pill.unavailable"));if(p.state==="cold"||p.state==="loading"||_===null)return(0,I.createElement)("div",{className:"gp-empty"},n("common.loading"));let z=p.snapshot;return(0,I.createElement)("div",{style:{display:"contents"}},[k.current.tabs.has("overview")?(0,I.createElement)("div",{key:"overview",style:_==="overview"?{display:"contents"}:{display:"none"}},(0,I.createElement)(Sa,{key:t,remote:u,sessionId:t,refreshKey:J,defaultDiffView:z.defaultDiffView,snapshot:z,onAction:R,onResync:()=>Dt(t).resync(),compact:d,t:n})):null,k.current.tabs.has("changes")?(0,I.createElement)("div",{key:"changes",style:_==="changes"?{display:"contents"}:{display:"none"}},(0,I.createElement)(Ea,{key:t,remote:u,sessionId:t,snapshot:z,onAction:R,compact:d,t:n})):null,M?(0,I.createElement)("div",{key:"files",style:_==="files"?{display:"contents"}:{display:"none"}},(0,I.createElement)(Un,{key:t,remote:u,sessionId:t,compact:d,worktreeGen:F,snapshot:z,t:n})):null])})();return(0,I.createElement)("div",{className:"gp-panel",ref:l,"data-conversation-composer-overlay":"","data-font-delta":r,"data-layout":d?"compact":"wide"},[(0,I.createElement)("div",{key:"tabs",className:"gp-tabbar",role:"tablist"},[...K.map(z=>(0,I.createElement)("button",{key:z.key,type:"button",role:"tab","aria-selected":_===z.key,className:`gp-tab${_===z.key?" gp-tab--active":""}`,onClick:()=>{et(t)&&o({sessionId:t,tab:z.key})}},[(0,I.createElement)("span",{key:"i",className:"gp-tab__icon"},z.icon),(0,I.createElement)("span",{key:"l",className:"gp-tab__label"},z.label)])),(0,I.createElement)("div",{key:"trailing",className:"gp-tabbar__trailing"},[(0,I.createElement)("div",{key:"font",className:"gp-font"},[(0,I.createElement)("button",{key:"dec",type:"button",className:"gp-font__decrease",onClick:()=>Q(-1),"aria-label":n("panel.fontDecrease")},"A\u2212"),(0,I.createElement)("button",{key:"reset",type:"button",className:"gp-font__reset",onClick:()=>Q(0),"aria-label":n("panel.fontReset")},"A"),(0,I.createElement)("button",{key:"inc",type:"button",className:"gp-font__increase",onClick:()=>Q(1),"aria-label":n("panel.fontIncrease")},"A+")]),(0,I.createElement)(Po,{key:"ver",remote:u,t:n})])]),(0,I.createElement)("div",{key:"body",className:"gp-body"},ae)])}function Po({remote:e,t}){let[n,r]=(0,I.useState)({kind:"idle"}),{tipProps:a,tipNode:i}=fn({placement:"below",maxWidth:300});(0,I.useEffect)(()=>{let d=!0;return e.version({}).then(p=>{d&&"current"in p&&r(u=>({...u,info:p}))}),()=>{d=!1}},[e]);let o=async()=>{r(p=>({kind:"checking",info:p.info}));let d=await e.version({check:!0});r({kind:"idle",info:"current"in d?d:void 0})},s=n.info,l=n.kind==="checking"?(0,I.createElement)("span",{className:"gp-verbar__status"},t("version.checking")):s===void 0||!s.checkedRemote?null:s.error!==void 0?(0,I.createElement)("span",{className:"gp-verbar__status gp-verbar__status--err",title:s.error},s.error==="repository is not configured"?t("version.noRepo"):t("version.error")):s.updateAvailable&&s.latest!==void 0?(0,I.createElement)("span",{},[(0,I.createElement)("span",{key:"s",className:"gp-verbar__status gp-verbar__status--new"},t("version.updateAvailable",{latest:s.latest,current:s.current})),s.releaseUrl!==void 0?(0,I.createElement)("a",{key:"l",className:"gp-verbar__link",href:s.releaseUrl,target:"_blank",rel:"noreferrer",style:{marginLeft:8}},t("version.viewRelease")):null]):(0,I.createElement)("span",{className:"gp-verbar__status gp-verbar__status--ok"},t("version.upToDate",{current:s.current}));return(0,I.createElement)("div",{className:"gp-verbar"},[s!==void 0?(0,I.createElement)("span",{key:"tag",className:"gp-verbar__tag"},`v${s.current}`):null,l,(0,I.createElement)("button",{key:"btn",type:"button",className:"gp-verbar__btn",disabled:n.kind==="checking",onClick:()=>void o()},[(0,I.createElement)("span",{key:"i",className:"gp-tab__icon"},(0,I.createElement)(jt,{size:12})),t("version.check")]),s?.repositoryUrl!==void 0?(0,I.createElement)("a",{key:"gh",className:"gp-icon-btn gp-verbar__gh gp-verbar__gh--starred",href:s.repositoryUrl,target:"_blank",rel:"noreferrer","aria-label":t("version.openRepo"),...a(t("version.openRepo"))},(0,I.createElement)(Pr,{size:15})):null,i])}var fe=require("react"),$a=require("react-dom");var Ba="data-gp-tab-dot",Rt,Vn=null,Ia="",xn=null,wn;function Do(e){if(typeof document>"u")return null;let t=document.querySelectorAll(Ht);for(let n of t)if((n.textContent??"").trim()===e)return n;return null}function Wn(){let e=Do(Ia);if(e===null)return;let t=e.querySelector(`[${Ba}]`);if(xn===null){t?.remove();return}let n=`gp-tab-dot gp-tab-dot--${xn}`;if(t!==null){t.className!==n&&(t.className=n);return}let r=document.createElement("span");r.className=n,r.setAttribute(Ba,""),r.setAttribute("aria-hidden","true"),e.appendChild(r)}function zo(){if(typeof document>"u"||typeof MutationObserver>"u")return;let e=document.querySelector(gr);if(e!==Vn){if(Rt?.disconnect(),Vn=e,e===null){Rt=void 0;return}Rt=new MutationObserver(()=>Wn()),Rt.observe(e,{childList:!0,subtree:!0})}}function Ao(){Rt?.disconnect(),Rt=void 0,Vn=null}function Oa(e,t,n){if(!(typeof document>"u")){if(n===null){qn(e);return}wn=e,Ia=t,xn=n,zo(),Wn()}}function qn(e){wn!==void 0&&wn!==e||(wn=void 0,xn=null,Wn(),Ao())}function Ho(e){let t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function Fo(){let[e,t]=(0,fe.useState)(!1),[n,r]=(0,fe.useState)(null),a=(0,fe.useRef)(null);return(0,fe.useLayoutEffect)(()=>{if(!e||a.current===null){r(null);return}let s=a.current.getBoundingClientRect();r({left:s.left,bottom:window.innerHeight-s.top+8})},[e]),{bind:{ref:s=>{a.current=s},onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1)},render:s=>!e||n===null||typeof document>"u"?null:(0,$a.createPortal)((0,fe.createElement)("div",{className:"gp-tip",style:{left:n.left,bottom:n.bottom}},s.map((l,d)=>(0,fe.createElement)("div",{key:d,className:d===0?"gp-tip__path":"gp-tip__note"},l))),document.body)}}function Bo(e){let[t,n]=(0,fe.useState)(!1);return(0,fe.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=e.closest("[data-conversation-region]")??document.body,i=()=>n(a.clientWidth>0&&a.clientWidth<Io);i();let o=new ResizeObserver(i);return o.observe(a),()=>o.disconnect()},[e]),t}var Io=620;function Xa({sessionId:e,t}){let n=Wt(e),r=Fo(),[a,i]=(0,fe.useState)(null),o=Bo(a),s=(0,fe.useRef)(Symbol("gp-tab-dot")),l=n.state==="ready"&&n.snapshot.showInputPill===!1?n.snapshot.dirty?"dirty":"synced":null,d=t("panel.tab");if((0,fe.useEffect)(()=>{Oa(s.current,d,l);let k=s.current;return()=>{qn(k)}},[d,l]),n.state==="cold"||n.state==="loading"||n.state==="no-cwd")return null;if(n.state==="error")return n.error.code==="not-a-git-repo"||n.error.code==="git-unavailable"||n.error.showInputPill===!1?null:(0,fe.createElement)("span",{className:"gp-pill gp-pill--degraded",title:n.error.detail??t("pill.unavailable")},t("pill.unavailable"));let p=n.snapshot;if(p.showInputPill===!1)return null;let u=Ho(p.root),g=p.branch??`(${t("pill.detached")})`,S=p.dirty,b=S?"gp-pill--dirty":"gp-pill--synced",_=()=>{if(wr(d)){xr(d);return}et(e)&&fr(e,S?"changes":"overview"),vr(d)};return(0,fe.createElement)("span",{className:"gp-pill-wrap",ref:i},[(0,fe.createElement)("button",{key:"btn",type:"button",className:`gp-pill ${b}${o?" gp-pill--compact":""}`,onClick:_,ref:r.bind.ref,onMouseEnter:r.bind.onMouseEnter,onMouseLeave:r.bind.onMouseLeave},[(0,fe.createElement)("span",{key:"dot",className:"gp-pill__dot","aria-hidden":"true"}),(0,fe.createElement)("span",{key:"repo",className:"gp-pill__repo"},u),(0,fe.createElement)("span",{key:"git",className:"gp-pill__git"},["(",(0,fe.createElement)("span",{key:"b",className:"gp-pill__branch"},g),")"])]),r.render([p.root,t(S?"pill.dirty":"pill.synced")])])}var A=require("react");function Oo(e){for(let t of e){let n=t.schema?.dict;if(n!==void 0&&"showInputPill"in n||JSON.stringify(t.schema).includes("showInputPill"))return t.ns}}var kn={min:Re.maxBytes.min/1024,max:Re.maxBytes.max/1024},_n={min:Re.timeoutMs.min/1e3,max:Re.timeoutMs.max/1e3};function jn(e,t){return Math.min(t.max,Math.max(t.min,Math.floor(e)))}function $o(e){let t=e.trim();if(t==="")return null;let n=Number(t);return Number.isFinite(n)?n:null}function Ja({ctx:e,t}){let[,n]=(0,A.useState)(0),[r,a]=(0,A.useState)(!1),[i,o]=(0,A.useState)(!1),[s,l]=(0,A.useState)(null),[d,p]=(0,A.useState)(null),[u,g]=(0,A.useState)(null),[S,b]=(0,A.useState)(null),[_,k]=(0,A.useState)(null),[M,D]=(0,A.useState)(null),[J,F]=(0,A.useState)(null),[C,R]=(0,A.useState)(null),Q=()=>{n(N=>N+1)},U=e.get("configForms"),K=(0,A.useMemo)(()=>U?.describe(),[U]);(0,A.useEffect)(()=>{if(K!==void 0)return K.ensure(),K.subscribe(Q)},[K]);let ae=K?.getSnapshot().view,z=(0,A.useMemo)(()=>ae===void 0?void 0:Oo(ae.namespaces),[ae]),W=(0,A.useMemo)(()=>U!==void 0&&z!==void 0?U.get(z):void 0,[U,z]);(0,A.useEffect)(()=>{if(W!==void 0)return W.subscribe(Q)},[W]);let O=W?.getSnapshot(),se=W!==void 0&&O!==void 0&&O.status==="ready",q=K?.getSnapshot().status,de=s??(typeof O?.value?.showInputPill=="boolean"?O.value.showInputPill:!0),le=d??(O?.value?.defaultDiffView==="split"?"split":"unified"),he=u??(O?.value?.graphStyle==="compact"?"compact":"parallel"),be=S??(typeof O?.value?.suggestEnabled=="boolean"?O.value.suggestEnabled:!0),ee=O?.value?.suggestLanguage,w=_??(typeof ee=="string"&&Zt.includes(ee)?ee:Pn),T=jn(typeof O?.value?.suggestMaxBytes=="number"?O.value.suggestMaxBytes/1024:Re.maxBytes.default/1024,kn),j=jn(typeof O?.value?.suggestMaxOutputTokens=="number"?O.value.suggestMaxOutputTokens:Re.maxOutputTokens.default,Re.maxOutputTokens),Y=jn(typeof O?.value?.suggestTimeoutMs=="number"?O.value.suggestTimeoutMs/1e3:Re.timeoutMs.default/1e3,_n),m=async(N,Ee,ze)=>{if(W!==void 0){o(!1),a(!0);try{let xe=await W.set(N,Ee);ze(),xe?(zt(),setTimeout(()=>zt(),1e3)):o(!0)}catch{ze(),o(!0)}finally{a(!1)}}},G=N=>(l(N),m("showInputPill",N,()=>l(null))),B=N=>N===le?Promise.resolve():(p(N),m("defaultDiffView",N,()=>p(null))),P=N=>N===he?Promise.resolve():(g(N),m("graphStyle",N,()=>g(null))),ue=N=>(b(N),m("suggestEnabled",N,()=>b(null))),Se=N=>N===w?Promise.resolve():(k(N),m("suggestLanguage",N,()=>k(null))),_e=(N,Ee,ze,xe,$e,Ve)=>{let Be=N===null?null:$o(N);if(Be===null)return Ve(),Promise.resolve();let Ae=Math.min(Ee.max,Math.max(Ee.min,Math.floor(Be)));return $e(String(Ae)),m(xe,Ae*ze,Ve)},lt=N=>_e(N,kn,1024,"suggestMaxBytes",D,()=>D(null)),Fe=N=>_e(N,Re.maxOutputTokens,1,"suggestMaxOutputTokens",F,()=>F(null)),De=N=>_e(N,_n,1e3,"suggestTimeoutMs",R,()=>R(null));return U===void 0?(0,A.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded")):se?(0,A.createElement)("div",{className:"gp-cfg"},[(0,A.createElement)("h3",{key:"title",className:"gp-cfg__title"},t("cfg.title")),(0,A.createElement)("label",{key:"row",className:"gp-cfg__row"},[(0,A.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:de,disabled:r||O?.writable===!1,onChange:N=>{G(N.currentTarget.checked)}}),(0,A.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.toggle"))]),(0,A.createElement)("p",{key:"hint",className:"gp-cfg__hint"},t("cfg.hint")),(0,A.createElement)("h3",{key:"difftitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.diffTitle")),(0,A.createElement)("div",{key:"diffseg",className:"gp-seg gp-cfg__seg"},it(["unified","split"],le,N=>{B(N)},N=>t(N==="unified"?"cfg.diffUnified":"cfg.diffSplit"),r||O?.writable===!1)),(0,A.createElement)("p",{key:"diffhint",className:"gp-cfg__hint"},t("cfg.diffHint")),(0,A.createElement)("h3",{key:"graphtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.graphTitle")),(0,A.createElement)("div",{key:"graphseg",className:"gp-seg gp-cfg__seg"},it(["parallel","compact"],he,N=>{P(N)},N=>t(N==="parallel"?"cfg.graphParallel":"cfg.graphCompact"),r||O?.writable===!1)),(0,A.createElement)("p",{key:"graphhint",className:"gp-cfg__hint"},t("cfg.graphHint")),(0,A.createElement)("div",{key:"suggestcard",className:"gp-cfg__card"},[(0,A.createElement)("h3",{key:"sgtitle",className:"gp-cfg__card-title"},t("cfg.suggestTitle")),(0,A.createElement)("label",{key:"sgrow",className:"gp-cfg__row"},[(0,A.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:be,disabled:r||O?.writable===!1,onChange:N=>{ue(N.currentTarget.checked)}}),(0,A.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.suggestToggle"))]),(0,A.createElement)("p",{key:"sglangtitle",className:"gp-cfg__seglabel"},t("cfg.suggestLangLabel")),(0,A.createElement)("div",{key:"sglang",className:"gp-seg gp-cfg__seg",role:"group","aria-label":t("cfg.suggestLangLabel")},it([...Zt],w,N=>{Se(N)},N=>t(N==="auto"?"cfg.suggestLangAuto":N==="zh"?"cfg.suggestLangZh":"cfg.suggestLangEn"),r||O?.writable===!1)),(0,A.createElement)("p",{key:"sglanghint",className:"gp-cfg__rangehint"},t("cfg.suggestLangHint")),(0,A.createElement)("div",{key:"numax",className:"gp-cfg__numrow"},[(0,A.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-maxkib"},t("cfg.suggestMaxBytesLabel")),(0,A.createElement)("input",{key:"input",id:"gp-cfg-maxkib",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:kn.min,max:kn.max,"aria-describedby":"gp-cfg-maxkib-hint",value:M??String(T),disabled:r||O?.writable===!1,onChange:N=>{D(N.currentTarget.value)},onBlur:()=>{lt(M)},onKeyDown:N=>{N.key==="Enter"&&N.currentTarget.blur()}}),(0,A.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestMaxBytesUnit"))]),(0,A.createElement)("p",{key:"numaxhint",id:"gp-cfg-maxkib-hint",className:"gp-cfg__rangehint"},t("cfg.suggestMaxBytesHint")),(0,A.createElement)("div",{key:"nuout",className:"gp-cfg__numrow"},[(0,A.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-outtok"},t("cfg.suggestOutputLabel")),(0,A.createElement)("input",{key:"input",id:"gp-cfg-outtok",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:Re.maxOutputTokens.min,max:Re.maxOutputTokens.max,"aria-describedby":"gp-cfg-outtok-hint",value:J??String(j),disabled:r||O?.writable===!1,onChange:N=>{F(N.currentTarget.value)},onBlur:()=>{Fe(J)},onKeyDown:N=>{N.key==="Enter"&&N.currentTarget.blur()}}),(0,A.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestOutputUnit"))]),(0,A.createElement)("p",{key:"nuouthint",id:"gp-cfg-outtok-hint",className:"gp-cfg__rangehint"},t("cfg.suggestOutputHint")),(0,A.createElement)("div",{key:"nuto",className:"gp-cfg__numrow"},[(0,A.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-timeout"},t("cfg.suggestTimeoutLabel")),(0,A.createElement)("input",{key:"input",id:"gp-cfg-timeout",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:_n.min,max:_n.max,"aria-describedby":"gp-cfg-timeout-hint",value:C??String(Y),disabled:r||O?.writable===!1,onChange:N=>{R(N.currentTarget.value)},onBlur:()=>{De(C)},onKeyDown:N=>{N.key==="Enter"&&N.currentTarget.blur()}}),(0,A.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestTimeoutUnit"))]),(0,A.createElement)("p",{key:"nutohint",id:"gp-cfg-timeout-hint",className:"gp-cfg__rangehint"},t("cfg.suggestTimeoutHint")),(0,A.createElement)("p",{key:"sghint",className:"gp-cfg__hint"},t("cfg.suggestHint"))]),i?(0,A.createElement)("p",{key:"error",className:"gp-cfg__err",role:"alert"},t("cfg.saveFailed")):null]):q==="idle"||q==="loading"?(0,A.createElement)("p",{className:"gp-cfg__hint"},t("common.loading")):(0,A.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded"))}var Xt="gitPanel",Xo=["dsh-git-panel","@xbzbing/dsh-git-panel"],Jo=["slots","locale","connection"],Ko="dsh-git-panel";function Uo(e){or(),pr(e),e.effect(()=>e.locale.register(Xt,{zh:sr,en:lr})??void 0,"dsh-git-panel: dictionaries");let t=e.locale.bind(Xt),n=[],r=a=>{typeof a=="function"&&n.push(a)};r(e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"git-panel",order:30,locale:Xt,label:()=>t("panel.tab")},a=>(0,Sn.createElement)(Fa,{ctx:e,sessionId:a.sessionId,t})))),r(e.slots.inject("conversation.input.left",()=>e.slots.register({name:"conversation.input.left",id:"git-panel-pill",order:100,locale:Xt},a=>(0,Sn.createElement)(Xa,{sessionId:a.sessionId,t}))));for(let a of Xo)r(e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:a,locale:Xt},i=>i.view==="summary"?t("cfg.title"):(0,Sn.createElement)(Ja,{ctx:e,t}))));e.effect(()=>{let a=e.on("connection/reset",()=>zt());return()=>{typeof a=="function"&&a();for(let i of n.splice(0))try{i()}catch{}ur()}},"dsh-git-panel: lifecycle")}module.exports={name:Ko,inject:Jo,apply:Uo};
787
+ `,Cr=!1;function ca(){if(Cr||typeof document>"u")return;let e="dsh-git-panel/client.css";if(document.querySelector(`style[data-plugin-css="${e}"]`)!==null){Cr=!0;return}let t=document.createElement("style");t.dataset.plugin="@xbzbing/dsh-git-panel",t.dataset.pluginCss=e,t.textContent=zo,document.head.appendChild(t),Cr=!0}var pa={"panel.tab":"Git","panel.fontDecrease":"\u7F29\u5C0F\u5B57\u4F53","panel.fontReset":"\u91CD\u7F6E\u5B57\u4F53\u5927\u5C0F","panel.fontIncrease":"\u653E\u5927\u5B57\u4F53","panel.fontSize":"\u9762\u677F\u5B57\u53F7","panel.tabs":"\u9762\u677F\u6807\u7B7E\u9875","tab.overview":"Git \u603B\u89C8","tab.changes":"\u53D8\u66F4\u8BB0\u5F55","tab.files":"\u6587\u4EF6\u6D4F\u89C8","pill.unavailable":"Git \u4E0D\u53EF\u7528","pill.detached":"\u6E38\u79BB HEAD","pill.synced":"\u672C\u5730\u5DF2\u540C\u6B65","pill.dirty":"\u6709\u5F85\u63D0\u4EA4\u7684\u53D8\u66F4","common.loading":"\u52A0\u8F7D\u4E2D\u2026","common.retry":"\u91CD\u8BD5","common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","ops.aiHint":"\u63D0\u793A\uFF1A\u7ED9 AI \u591A\u4E00\u70B9\u4FE1\u4EFB\uFF0C\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u8BA9 AI \u76F4\u63A5\u6267\u884C Git \u64CD\u4F5C\u3002","version.check":"\u68C0\u67E5\u65B0\u7248\u672C","version.checking":"\u68C0\u67E5\u4E2D\u2026","version.upToDate":"\u5DF2\u662F\u6700\u65B0\uFF08{current}\uFF09","version.updateAvailable":"\u6709\u65B0\u7248\u672C {latest}\uFF08\u5F53\u524D {current}\uFF09","version.viewRelease":"\u67E5\u770B\u53D1\u5E03","version.error":"\u68C0\u67E5\u5931\u8D25","version.noRepo":"\u672A\u914D\u7F6E\u4ED3\u5E93\u5730\u5740","version.openRepo":"\u8BBF\u95EE GitHub \u67E5\u770B @xbzbing/dsh-git-panel \u9879\u76EE\uFF0C\u8BF7\u4E3A\u9879\u76EE\u70B9\u4EAE\u4E00\u9897\u5C0F\u661F\u661F\u5427 \u2B50","overview.head":"\u5168\u90E8\u5206\u652F","overview.local":"\u672C\u5730","overview.currentBranch":"\u5F53\u524D\u5206\u652F","overview.primaryBranch":"\u4E3B\u5206\u652F","overview.branchAhead":"\u6BD4\u4E0A\u6E38\u9886\u5148 {n} \u4E2A\u63D0\u4EA4","overview.branchBehind":"\u6BD4\u4E0A\u6E38\u843D\u540E {n} \u4E2A\u63D0\u4EA4","overview.remote":"\u8FDC\u7A0B","overview.tags":"\u6807\u7B7E","overview.search":"\u641C\u7D22\u63D0\u4EA4\uFF08\u6D88\u606F / \u54C8\u5E0C\uFF09","overview.searchShort":"\u641C\u7D22\u63D0\u4EA4","overview.allUsers":"\u5168\u90E8\u4F5C\u8005","overview.allTime":"\u5168\u90E8\u65F6\u95F4","overview.today":"\u4ECA\u5929","overview.last7d":"\u8FD1 7 \u5929","overview.last30d":"\u8FD1 30 \u5929","overview.selectCommit":"\u9009\u62E9\u4E00\u4E2A\u63D0\u4EA4\u67E5\u770B\u8BE6\u60C5","overview.noMessage":"\uFF08\u65E0\u63D0\u4EA4\u6B63\u6587\uFF09","overview.noResults":"\u6CA1\u6709\u5339\u914D\u7684\u63D0\u4EA4","overview.loadFailed":"\u52A0\u8F7D\u5931\u8D25","overview.detailFailed":"\u8BE6\u60C5\u52A0\u8F7D\u5931\u8D25","overview.diffFailed":"\u5DEE\u5F02\u52A0\u8F7D\u5931\u8D25","overview.openFileDiff":"\u67E5\u770B\u8BE5\u6587\u4EF6\u5728\u6B64\u63D0\u4EA4\u4E2D\u7684\u53D8\u66F4","overview.changeSummary":"{files} \u4E2A\u6587\u4EF6","overview.expandDir":"\u5C55\u5F00\u76EE\u5F55","overview.collapseDir":"\u6298\u53E0\u76EE\u5F55","overview.fetch":"\u62C9\u53D6\u8FDC\u7A0B","overview.branchesError":"\u5206\u652F\u52A0\u8F7D\u5931\u8D25","overview.filterBranch":"\u6309\u5206\u652F\u7B5B\u9009","overview.moreFilters":"\u66F4\u591A\u7B5B\u9009","overview.backToList":"\u8FD4\u56DE\u5217\u8868","overview.createTag":"\u521B\u5EFA\u6807\u7B7E","overview.revert":"\u8FD8\u539F\u6B64\u63D0\u4EA4","overview.reset":"\u91CD\u7F6E\u5230\u6B64","switch.action":"\u5207\u6362","switch.rowTitle":"\u5207\u6362\u5230 {name}","switch.rowTitleTrack":"\u4ECE {ref} \u65B0\u5EFA\u8DDF\u8E2A\u5206\u652F {name} \u5E76\u5207\u6362","switch.detached":"\u6E38\u79BB HEAD","switch.confirmTitle":"\u5207\u6362\u5206\u652F","switch.body":"\u4ECE {from} \u5207\u6362\u5230 {to}\u3002","switch.trackingNote":"\u672C\u5730\u8FD8\u6CA1\u6709 {name}\uFF0C\u5C06\u5148\u4ECE {ref} \u521B\u5EFA\u5B83\u5E76\u8BBE\u7F6E\u8DDF\u8E2A\uFF08upstream\uFF09\u3002","switch.dirtyWarn":"\u5F53\u524D\u6709 {count} \u4E2A\u6587\u4EF6\u5B58\u5728\u672A\u63D0\u4EA4\u53D8\u66F4\u3002","switch.modeDirect":"\u76F4\u63A5\u5207\u6362","switch.modeDirectHint":"\u672A\u63D0\u4EA4\u53D8\u66F4\u4F1A\u968F\u5DE5\u4F5C\u533A\u5E26\u8FC7\u53BB\uFF1B\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\uFF0CGit \u4F1A\u62D2\u7EDD\u5207\u6362\uFF0C\u5DE5\u4F5C\u533A\u4FDD\u6301\u4E0D\u53D8\u3002","switch.modeStash":"\u5148\u8D2E\u85CF {count} \u4E2A\u6587\u4EF6\u7684\u53D8\u66F4\uFF0C\u518D\u5207\u6362","switch.modeStashHint":"\u53D8\u66F4\u79FB\u5165\u8D2E\u85CF\u6808\u9876\uFF08\u542B\u672A\u8DDF\u8E2A\u6587\u4EF6\uFF09\uFF0C\u5207\u6362\u540E\u53EF\u4ECE\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\u3002\u6CE8\u610F\uFF1A\u4E0D\u4F1A\u81EA\u52A8\u6062\u590D\uFF1B\u6062\u590D\u65F6\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\u9700\u624B\u52A8\u89E3\u51B3\u3002","switch.confirm":"\u5207\u6362","switch.confirmStash":"\u8D2E\u85CF\u5E76\u5207\u6362","switch.switching":"\u6B63\u5728\u5207\u6362\u2026","switch.stashMessage":"\u5207\u6362\u5230 {branch} \u524D\u81EA\u52A8\u8D2E\u85CF","tag.createTitle":"\u5728\u6B64\u63D0\u4EA4\u521B\u5EFA\u6807\u7B7E","tag.namePlaceholder":"\u6807\u7B7E\u540D","tag.annotated":"\u9644\u6CE8\u6807\u7B7E\uFF08\u5E26\u8BF4\u660E\uFF09","tag.messagePlaceholder":"\u6807\u7B7E\u8BF4\u660E","tag.create":"\u521B\u5EFA\u6807\u7B7E","tag.deleteTitle":"\u5220\u9664\u6807\u7B7E","tag.deleteConfirm":"\u786E\u5B9A\u5220\u9664\u6807\u7B7E\u300C{name}\u300D\uFF1F","tag.deleteOne":"\u5220\u9664\u6807\u7B7E\u300C{name}\u300D","ops.dirtyWarn":"\u68C0\u6D4B\u5230\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u8FD9\u4E9B\u6539\u52A8\u53EF\u80FD\u662F dsh AI \u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\u3002","revert.title":"\u8FD8\u539F\u63D0\u4EA4","revert.body":"\u5C06\u5728\u5F53\u524D HEAD \u8FFD\u52A0\u4E00\u4E2A\u53CD\u5411\u63D0\u4EA4\uFF0C\u8FD8\u539F {ref} \u7684\u6539\u52A8\u3002\u4E0D\u4F1A\u4E22\u5F03\u4F60\u7684\u5DE5\u4F5C\u533A\u6539\u52A8\u3002","revert.confirm":"\u8FD8\u539F","reset.title":"\u91CD\u7F6E\u5206\u652F","reset.body":"\u5C06\u628A\u5F53\u524D\u5206\u652F\u7684 HEAD \u4ECE {from} \u79FB\u52A8\u5230 {to}\u3002","reset.modeSoft":"\u8F6F\u91CD\u7F6E\uFF08--soft\uFF09","reset.softHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u6682\u5B58\u533A\u3002","reset.modeMixed":"\u6DF7\u5408\u91CD\u7F6E\uFF08--mixed\uFF0C\u9ED8\u8BA4\uFF09","reset.mixedHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u5DE5\u4F5C\u533A\u3002","reset.modeHard":"\u786C\u91CD\u7F6E\uFF08--hard\uFF09","reset.hardHint":"\u79FB\u52A8 HEAD \u5230\u6B64\u63D0\u4EA4\u5E76\u4E22\u5F03\u6240\u6709\u672A\u63D0\u4EA4\u6539\u52A8\uFF08\u672A\u63D0\u4EA4\u6539\u52A8\u65E0\u6CD5\u6062\u590D\uFF09\u3002","reset.hardOrphan":"\u5F53\u524D\u5206\u652F\u4E0A\u665A\u4E8E\u76EE\u6807\u7684\u63D0\u4EA4\u4F1A\u79BB\u5F00\u5206\u652F\uFF08\u4ECD\u53EF\u7528 git reflog \u627E\u56DE\uFF09\u3002","reset.hardWarn":"\u4EE5\u4E0B\u672A\u63D0\u4EA4\u6539\u52A8\u5C06\u88AB\u6C38\u4E45\u4E22\u5F03\uFF1A","reset.lostMore":"\u2026\u8FD8\u6709\u66F4\u591A\u672A\u63D0\u4EA4\u6539\u52A8\u672A\u663E\u793A\uFF08\u5217\u8868\u5DF2\u622A\u65AD\uFF09","reset.hardAck":"\u6211\u5DF2\u4E86\u89E3\uFF0C\u786E\u8BA4\u4E22\u5F03\u8FD9\u4E9B\u672A\u63D0\u4EA4\u6539\u52A8","reset.hardAckClean":"\u6211\u5DF2\u4E86\u89E3\u6B64\u64CD\u4F5C\u7684\u540E\u679C\uFF0C\u786E\u8BA4\u91CD\u7F6E","reset.confirm":"\u91CD\u7F6E","changes.groupStaged":"\u5DF2\u6682\u5B58\u7684\u66F4\u6539","changes.groupUnstaged":"\u66F4\u6539","changes.groupUntracked":"\u672A\u7248\u672C\u63A7\u5236\u7684\u6587\u4EF6","changes.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u53D8\u66F4","changes.noChanges":"\u6CA1\u6709\u672A\u63D0\u4EA4\u7684\u53D8\u66F4","changes.actions":"\u4ED3\u5E93\u53D8\u66F4\u64CD\u4F5C","changes.refresh":"\u5237\u65B0\u5F53\u524D\u4ED3\u5E93\u72B6\u6001","changes.stageAll":"\u5168\u90E8\u6682\u5B58","changes.unstageAll":"\u5168\u90E8\u53D6\u6D88\u6682\u5B58","changes.stage":"\u6682\u5B58","changes.unstage":"\u53D6\u6D88\u6682\u5B58","changes.discard":"\u653E\u5F03\u66F4\u6539","changes.discardConfirm":"\u518D\u6B21\u70B9\u51FB\u4EE5\u786E\u8BA4\u653E\u5F03","changes.stageTip":"\u6682\u5B58\u6B64\u6587\u4EF6\uFF0C\u4E0B\u4E00\u6B21\u63D0\u4EA4\u4F1A\u5305\u542B\u5B83\u7684\u6539\u52A8","changes.unstageTip":"\u53D6\u6D88\u6682\u5B58\u6B64\u6587\u4EF6\uFF0C\u6539\u52A8\u4ECD\u7559\u5728\u5DE5\u4F5C\u533A","changes.discardTip":"\u653E\u5F03\u6B64\u6587\u4EF6\u5728\u5DE5\u4F5C\u533A\u7684\u6539\u52A8\uFF08\u4E0D\u53EF\u6062\u590D\uFF09\uFF1B\u518D\u70B9\u4E00\u6B21\u786E\u8BA4","changes.discardTipArmed":"\u518D\u70B9\u4E00\u6B21\u5373\u653E\u5F03\u6B64\u6587\u4EF6\u7684\u6539\u52A8\uFF0C\u4E0D\u53EF\u6062\u590D","changes.discardPicked":"\u653E\u5F03\u9009\u4E2D\u7684\u66F4\u6539","changes.discardPickedTitle":"\u653E\u5F03\u9009\u4E2D\u7684\u66F4\u6539","changes.discardPickedBody":"\u5C06\u653E\u5F03 {count} \u4E2A\u6587\u4EF6\u5728\u5DE5\u4F5C\u533A\u7684\u672A\u63D0\u4EA4\u66F4\u6539\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","changes.discardPickedStaged":"\u53E6\u6709 {count} \u4E2A\u9009\u4E2D\u9879\u5728\u6682\u5B58\u533A\uFF0C\u4E0D\u5728\u6B64\u6B21\u653E\u5F03\u8303\u56F4\uFF08\u5982\u9700\u64A4\u9500\u6682\u5B58\u8BF7\u7528\u300C\u53D6\u6D88\u6682\u5B58\u300D\uFF09\u3002","changes.discardPickedUntracked":"\u5176\u4E2D {count} \u4E2A\u662F\u672A\u8DDF\u8E2A\u7684\u6587\u4EF6\u6216\u76EE\u5F55\uFF0C\u5C06\u4ECE\u78C1\u76D8\u5220\u9664\uFF08\u4E0D\u5728 Git \u5386\u53F2\u4E2D\uFF0C\u65E0\u6CD5\u6062\u590D\uFF09\u3002","changes.discarding":"\u6B63\u5728\u653E\u5F03\u2026","changes.backToList":"\u8FD4\u56DE\u5217\u8868","changes.stash":"\u8D2E\u85CF\u66F4\u6539","changes.untrackedCollapsed":"\u672A\u8DDF\u8E2A\u9879\u4EE5\u76EE\u5F55\u5F62\u5F0F\u663E\u793A\uFF0C\u672A\u9010\u4E2A\u5C55\u5F00","changes.truncatedCap":"\u53D8\u66F4\u8FC7\u591A\uFF0C\u5217\u8868\u4EC5\u663E\u793A\u524D {n} \u9879\uFF1B\u8BA1\u6570\u4ECD\u4E3A\u5168\u90E8\u53D8\u66F4\u7684\u7EDF\u8BA1","changes.truncatedLossy":"Git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF0C\u5217\u8868\u53EF\u80FD\u7F3A\u5C11\u5F00\u5934\u90E8\u5206","changes.truncatedUnknown":"\u5217\u8868\u4E0D\u5B8C\u6574\uFF0C\u53EF\u80FD\u7F3A\u5C11\u90E8\u5206\u53D8\u66F4","stash.title":"\u8D2E\u85CF\u5F53\u524D\u66F4\u6539","stash.messagePlaceholder":"\u8D2E\u85CF\u8BF4\u660E\uFF08\u53EF\u9009\uFF09","stash.save":"\u8D2E\u85CF","stash.section":"\u8D2E\u85CF","stash.onBranch":"\u4F4D\u4E8E {branch}","stash.apply":"\u5E94\u7528","stash.pop":"\u5F39\u51FA","stash.drop":"\u4E22\u5F03","stash.dropTitle":"\u4E22\u5F03\u8D2E\u85CF","stash.dropConfirm":"\u786E\u5B9A\u4E22\u5F03\u6B64\u8D2E\u85CF\u6761\u76EE\uFF1F\u4E22\u5F03\u540E\u65E0\u6CD5\u6062\u590D\uFF1A{name}","files.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u5185\u5BB9","files.loadFailed":"\u52A0\u8F7D\u5931\u8D25","files.backToTree":"\u8FD4\u56DE\u6587\u4EF6\u6811","files.truncated":"\u6761\u76EE\u8FC7\u591A\uFF0C\u5DF2\u622A\u65AD","files.tooLarge":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8","files.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u9884\u89C8","files.highlightOff":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5173\u95ED\u8BED\u6CD5\u9AD8\u4EAE\u4EE5\u4FDD\u6301\u6D41\u7545","files.lineTruncated":" \u2026\uFF08\u6B64\u884C\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\uFF09","files.findPlaceholder":"\u5728\u6B64\u6587\u4EF6\u4E2D\u67E5\u627E","files.findNoMatch":"\u65E0\u5339\u914D","files.findPrev":"\u4E0A\u4E00\u4E2A","files.findNext":"\u4E0B\u4E00\u4E2A","files.findClose":"\u5173\u95ED\u67E5\u627E","files.findCase":"\u533A\u5206\u5927\u5C0F\u5199","files.previewMode":"\u9884\u89C8\u65B9\u5F0F","files.source":"\u6E90\u7801","files.render":"\u6E32\u67D3","files.copyPath":"\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84","files.pathCopied":"\u8DEF\u5F84\u5DF2\u590D\u5236","files.pathCopyFailed":"\u590D\u5236\u5931\u8D25","files.copyContent":"\u590D\u5236\u6587\u4EF6\u5185\u5BB9","files.contentCopied":"\u5185\u5BB9\u5DF2\u590D\u5236","files.contentCopyFailed":"\u590D\u5236\u5931\u8D25","files.ignored":"\u5DF2\u88AB Git \u5FFD\u7565","files.copy":"\u590D\u5236\u4EE3\u7801","files.copied":"\u5DF2\u590D\u5236","files.footnotes":"\u6CE8\u91CA","files.zoomBar":"\u56FE\u7247\u7F29\u653E","files.zoomIn":"\u653E\u5927","files.zoomOut":"\u7F29\u5C0F","files.zoomActual":"\u5B9E\u9645\u5927\u5C0F\uFF08100%\uFF09","files.zoomFit":"\u9002\u5E94\u7A97\u53E3","files.zoomFullscreen":"\u5168\u5C4F\u67E5\u770B","files.fullscreen":"\u5168\u5C4F\u67E5\u770B\u6587\u4EF6","files.gitNotInstalled":"\u7CFB\u7EDF\u672A\u5B89\u88C5 Git\uFF0CGit \u9762\u677F\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5B89\u88C5 Git \u5DE5\u5177\u540E\u91CD\u8BD5\u3002","files.propsTitle":"\u6587\u4EF6\u5C5E\u6027","files.propsGroupStats":"\u5927\u5C0F\u4E0E\u7EDF\u8BA1","files.propsGroupTime":"\u65F6\u95F4","files.propsName":"\u540D\u79F0","files.propsType":"\u7C7B\u578B","files.propsTypeImage":"{fmt} \u56FE\u7247","files.propsTypeText":"\u6587\u672C\u6587\u4EF6","files.propsTypeBinary":"\u4E8C\u8FDB\u5236\u6587\u4EF6","files.propsTypeUnread":"\u8FC7\u5927\u672A\u8BFB\u53D6","files.propsTypeFmt":"{label}\uFF08.{ext}\uFF09","files.propsRelPath":"\u76F8\u5BF9\u8DEF\u5F84","files.propsAbsPath":"\u7EDD\u5BF9\u8DEF\u5F84","files.propsCopyHint":"\u70B9\u51FB\u590D\u5236","files.propsSize":"\u5927\u5C0F","files.propsSizeBytes":"\uFF08{bytes} \u5B57\u8282\uFF09","files.propsLines":"\u884C\u6570","files.propsImageSize":"\u56FE\u7247\u5C3A\u5BF8","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"\u4FEE\u6539\u65F6\u95F4","files.propsUntracked":"\u672A\u8DDF\u8E2A","files.propsTrackedYes":"\u5DF2\u8DDF\u8E2A","files.propsStaged":"\u5DF2\u6682\u5B58","files.stAdded":"\u5DF2\u6DFB\u52A0","files.stModified":"\u5DF2\u4FEE\u6539","files.stDeleted":"\u5DF2\u5220\u9664","files.stRenamed":"\u5DF2\u91CD\u547D\u540D","files.stConflicted":"\u6709\u51B2\u7A81","files.stTypechange":"\u7C7B\u578B\u53D8\u66F4","stats.files":"{n} \u4E2A\u6587\u4EF6","stats.lastChange":"\u6700\u8FD1\u53D8\u66F4 {time}","stats.lastCommit":"\u4E0A\u6B21\u63D0\u4EA4 {time}","stats.staged":"\u5DF2\u6682\u5B58 {n}","stats.modified":"\u5DF2\u4FEE\u6539 {n}","stats.untracked":"\u672A\u8DDF\u8E2A {n}","stats.partial":"\u7EDF\u8BA1\u5DF2\u7B80\u5316","stats.partialHint":"\u53D8\u66F4\u6570\u91CF\u8F83\u591A\uFF0C\u5DF2\u8DF3\u8FC7\u672A\u8DDF\u8E2A\u6587\u4EF6\u884C\u6570\u4E0E\u6700\u8FD1\u53D8\u66F4\u65F6\u95F4\u7684\u7CBE\u786E\u7EDF\u8BA1\u4EE5\u4FDD\u6301\u9762\u677F\u6D41\u7545\u3002","commit.placeholder":"\u63D0\u4EA4\u4FE1\u606F","commit.commit":"\u63D0\u4EA4","commit.amend":"Amend \u63D0\u4EA4","commit.edit":"\u7F16\u8F91\u63D0\u4EA4\u4FE1\u606F","commit.collapse":"\u6536\u8D77\u63D0\u4EA4\u6846","commit.suggest":"AI \u751F\u6210","commit.suggesting":"\u751F\u6210\u4E2D\u2026","commit.suggestOverwrite":"\u518D\u6B21\u70B9\u51FB\u300CAI \u751F\u6210\u300D\u4EE5\u8986\u76D6\u5F53\u524D\u63D0\u4EA4\u4FE1\u606F","commit.suggestTruncated":"diff \u8FC7\u957F\u5DF2\u622A\u65AD\uFF0C\u751F\u6210\u7684\u5EFA\u8BAE\u53EF\u80FD\u4E0D\u5B8C\u6574","diff.unified":"\u7EDF\u4E00","diff.split":"\u5BF9\u7167","diff.before":"\u53D8\u66F4\u524D","diff.after":"\u53D8\u66F4\u540E","diff.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.tooLarge":"\u56FE\u7247\u8FC7\u5927\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.imageMissing":"\u4E0D\u5B58\u5728","diff.svgRender":"\u6E32\u67D3","diff.svgSource":"\u6E90\u7801","diff.empty":"\u65E0\u5DEE\u5F02","diff.expandAll":"\u5C55\u5F00\u5168\u90E8","diff.collapse":"\u6298\u53E0\u672A\u53D8\u66F4","diff.expandGap":"\u5C55\u5F00\u5168\u90E8 {n} \u884C","diff.expandUp":"\u5411\u4E0A\u5C55\u5F00 {n} \u884C","diff.expandDown":"\u5411\u4E0B\u5C55\u5F00 {n} \u884C","diff.expandCapped":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5C55\u5F00 {n} \u884C\u4E0A\u4E0B\u6587\uFF0C\u5176\u4F59\u4FDD\u6301\u6298\u53E0\uFF0C\u53EF\u9010\u6BB5\u5C55\u5F00","diff.truncated":"git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF1A\u6B64\u5DEE\u5F02\u53EA\u4FDD\u7559\u4E86\u5C3E\u6BB5\uFF0C\u5F00\u5934\u7684\u6539\u52A8\u4E0E\u589E\u5220\u7EDF\u8BA1\u53EF\u80FD\u7F3A\u5931","time.justNow":"\u521A\u521A","time.minutesAgo":"{n} \u5206\u949F\u524D","time.hoursAgo":"{n} \u5C0F\u65F6\u524D","time.daysAgo":"{n} \u5929\u524D","error.generic":"\u64CD\u4F5C\u5931\u8D25","error.notARepo":"\u5F53\u524D\u76EE\u5F55\u4E0D\u662F Git \u4ED3\u5E93","error.noCwd":"\u5F53\u524D\u4F1A\u8BDD\u65E0\u5DE5\u4F5C\u76EE\u5F55","error.localChangesBlock":"\u672C\u5730\u6709\u672A\u63D0\u4EA4\u53D8\u66F4\uFF0C\u64CD\u4F5C\u88AB\u963B\u6B62","error.emptyMessage":"\u63D0\u4EA4\u4FE1\u606F\u4E0D\u80FD\u4E3A\u7A7A","error.emptyDiff":"\u6CA1\u6709\u53EF\u751F\u6210\u7684\u53D8\u66F4","error.llmUnavailable":"AI \u670D\u52A1\u4E0D\u53EF\u7528","error.llmFailed":"AI \u751F\u6210\u5931\u8D25","error.suggestDisabled":"AI \u751F\u6210\u5DF2\u5728\u63D2\u4EF6\u914D\u7F6E\u4E2D\u5173\u95ED","error.conflict":"\u8D2E\u85CF\u5E94\u7528\u4EA7\u751F\u51B2\u7A81\uFF0C\u8D2E\u85CF\u6761\u76EE\u5DF2\u4FDD\u7559\uFF0C\u8BF7\u624B\u52A8\u89E3\u51B3\u51B2\u7A81\u540E\u518D\u8BD5","error.revertConflict":"\u8FD8\u539F\u4F1A\u4E0E\u5F53\u524D\u5185\u5BB9\u51B2\u7A81\uFF0C\u5DF2\u81EA\u52A8\u53D6\u6D88\u8FD8\u539F\uFF08\u672A\u6539\u52A8\u4F60\u7684\u5DE5\u4F5C\u533A\uFF09","error.revertStuck":"\u8FD8\u539F\u4EA7\u751F\u51B2\u7A81\u4E14\u81EA\u52A8\u53D6\u6D88\u5931\u8D25\uFF0C\u4ED3\u5E93\u4ECD\u5904\u4E8E\u8FD8\u539F\u4E2D\uFF0C\u8BF7\u624B\u52A8\u6267\u884C git revert --abort \u6216\u89E3\u51B3\u51B2\u7A81","error.revertMerge":"\u8FD9\u662F\u4E00\u4E2A\u5408\u5E76\u63D0\u4EA4\uFF0C\u9762\u677F\u6682\u4E0D\u652F\u6301\u8FD8\u539F\uFF08\u9700\u6307\u5B9A\u4E3B\u7EBF\u7236\u63D0\u4EA4\uFF09\uFF0C\u8BF7\u5728\u547D\u4EE4\u884C\u7528 git revert -m \u5904\u7406","error.indexBusy":"Git \u6B63\u5FD9\uFF08\u53E6\u4E00\u8FDB\u7A0B\u5360\u7528\u7D22\u5F15\uFF09\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5","error.notFound":"\u76EE\u6807\u4E0D\u5B58\u5728\uFF08\u5206\u652F / \u6807\u7B7E / \u8D2E\u85CF\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u91CD\u547D\u540D\uFF09","error.branchInUse":"\u8BE5\u5206\u652F\u5DF2\u5728\u53E6\u4E00\u4E2A\u5DE5\u4F5C\u6811\u4E2D\u68C0\u51FA\uFF0C\u65E0\u6CD5\u5728\u6B64\u5207\u6362","error.nestedRepo":"\u8BE5\u6761\u76EE\u672C\u8EAB\u662F\u4E00\u4E2A Git \u4ED3\u5E93\uFF08\u5D4C\u5957\u4ED3\u5E93\u6216\u5B50\u6A21\u5757\uFF09\uFF0C\u653E\u5F03\u4F1A\u8FDE\u5E26\u5220\u9664\u6574\u4E2A\u5185\u90E8\u4ED3\u5E93\uFF1B\u6B64\u64CD\u4F5C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u5B8C\u6210","error.nestedRepoPartial":"\u8BE5\u6761\u76EE\u672C\u8EAB\u662F\u4E00\u4E2A Git \u4ED3\u5E93\uFF08\u5D4C\u5957\u4ED3\u5E93\u6216\u5B50\u6A21\u5757\uFF09\uFF0C\u62D2\u7EDD\u8FDE\u5E26\u5220\u9664\uFF1B\u4F46\u540C\u6279\u4E2D\u4F4D\u4E8E\u5B83\u4E4B\u524D\u7684\u6761\u76EE\u5DF2\u7ECF\u88AB\u5220\u9664\u4E86\uFF0C\u8BF7\u5237\u65B0\u540E\u786E\u8BA4\u5269\u4F59\u53D8\u66F4\uFF0C\u6B64\u64CD\u4F5C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u5B8C\u6210","error.stashSwitchFailed":"\u672A\u63D0\u4EA4\u53D8\u66F4\u5DF2\u8D2E\u85CF\uFF08\u53EF\u5728\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\uFF09\uFF0C\u4F46\u5207\u6362\u5931\u8D25\uFF1A{reason}","error.invalidName":"\u540D\u79F0\u4E0D\u5408\u6CD5","error.notFastForward":"\u672C\u5730\u4E0E\u8FDC\u7A0B\u5206\u652F\u5DF2\u5206\u53C9\uFF0C\u65E0\u6CD5\u5FEB\u8FDB\u62C9\u53D6\uFF0C\u8BF7\u624B\u52A8\u5408\u5E76\u6216\u53D8\u57FA","error.pushRejected":"\u63A8\u9001\u88AB\u62D2\u7EDD\uFF1A\u8FDC\u7A0B\u5DF2\u6709\u65B0\u63D0\u4EA4\uFF0C\u8BF7\u5148\u300C\u68C0\u67E5\u540C\u6B65\u300D\u5E76\u62C9\u53D6\u540E\u518D\u63A8\u9001","error.authFailed":"\u8BA4\u8BC1\u5931\u8D25\uFF1A\u6CA1\u6709\u53EF\u7528\u7684 git \u51ED\u636E\uFF08HTTPS \u9700\u51ED\u636E\u52A9\u624B\u3001SSH \u9700\u5BC6\u94A5\uFF09\u3002\u8BF7\u5148\u5728\u547D\u4EE4\u884C\u5B8C\u6210\u4E00\u6B21\u63A8\u9001\u4EE5\u7F13\u5B58\u51ED\u636E","status.openRepo":"\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.openRepoOn":"\u5728 {host} \u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.synced":"\u5DF2\u4E0E\u8FDC\u7A0B\u540C\u6B65","status.ahead":"\u9886\u5148 {n}","status.behind":"\u843D\u540E {n}","status.diverged":"\u5DF2\u5206\u53C9\uFF08\u9886\u5148 {ahead} / \u843D\u540E {behind}\uFF09","status.noUpstream":"\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u5206\u652F","status.detached":"\u6E38\u79BB HEAD\uFF0C\u65E0\u5206\u652F\u540C\u6B65\u72B6\u6001","status.check":"\u68C0\u67E5\u540C\u6B65\u72B6\u6001","status.checkTitle":"\u68C0\u67E5\u4E0E\u8FDC\u7A0B\u7684\u540C\u6B65\u72B6\u6001\uFF1A\u6267\u884C git fetch \u62C9\u53D6\u6700\u65B0\u5F15\u7528\u5E76\u5237\u65B0\u9886\u5148/\u843D\u540E\u8BA1\u6570\uFF0C\u4E0D\u6539\u52A8\u5DE5\u4F5C\u533A","status.pull":"\u62C9\u53D6","status.pulling":"\u540C\u6B65\u4E2D\u2026","status.pullTitle":"\u5FEB\u8FDB\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmTitle":"\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmBody":"\u5C06\u4EE5\u5FEB\u8FDB\u65B9\u5F0F\u628A\u5F53\u524D\u5206\u652F {branch} \u66F4\u65B0\u5230\u8FDC\u7A0B\u6700\u65B0\u63D0\u4EA4\uFF08\u843D\u540E {behind} \u4E2A\u63D0\u4EA4\uFF09\u3002\u4EC5\u5728\u672A\u5206\u53C9\u65F6\u53EF\u884C\uFF0C\u4E0D\u4F1A\u4EA7\u751F\u5408\u5E76\u63D0\u4EA4\uFF0C\u4E5F\u4E0D\u4F1A\u6539\u52A8\u4F60\u7684\u672A\u63D0\u4EA4\u5185\u5BB9\u3002","status.pullConfirm":"\u62C9\u53D6","status.pullScope":"\u5C06\u5F15\u5165 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pullScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u8FDC\u7A0B\u5DEE\u5F02\u2026","status.push":"\u63A8\u9001","status.pushTitle":"\u63A8\u9001\u672C\u5730\u63D0\u4EA4\u5230\u8FDC\u7A0B","status.pushConfirmTitle":"\u63A8\u9001\u5230\u8FDC\u7A0B","status.pushConfirmBody":"\u5C06\u628A\u5F53\u524D\u5206\u652F {branch} \u9886\u5148\u8FDC\u7A0B\u7684 {ahead} \u4E2A\u63D0\u4EA4\u63A8\u9001\u5230\u4E0A\u6E38\u3002\u4EC5\u505A\u5FEB\u8FDB\u63A8\u9001\uFF0C\u4E0D\u4F1A\u5F3A\u5236\u8986\u76D6\u8FDC\u7A0B\u5386\u53F2\u3002","status.pushConfirm":"\u63A8\u9001","status.pushing":"\u63A8\u9001\u4E2D\u2026","status.pushScope":"\u5C06\u63A8\u9001 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pushScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u5F85\u63A8\u9001\u5DEE\u5F02\u2026","status.publish":"\u53D1\u5E03","status.publishTitle":"\u53D1\u5E03\u5206\u652F\u5E76\u8BBE\u7F6E\u4E0A\u6E38","status.publishConfirmTitle":"\u53D1\u5E03\u5206\u652F\u5230\u8FDC\u7A0B","status.publishConfirmBody":"\u5F53\u524D\u5206\u652F {branch} \u5C1A\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u3002\u5C06\u6267\u884C git push -u {remote} \u5728\u8FDC\u7A0B\u521B\u5EFA\u540C\u540D\u5206\u652F\u5E76\u8BBE\u4E3A\u4E0A\u6E38\u8DDF\u8E2A\u3002","status.publishConfirm":"\u53D1\u5E03","status.publishing":"\u53D1\u5E03\u4E2D\u2026","cfg.title":"\u8F93\u5165\u6846\u5206\u652F\u6807\u8BB0","cfg.toggle":"\u663E\u793A\u8F93\u5165\u6846\u6807\u8BB0","cfg.hint":"\u5F00\u542F\u65F6\u5728\u8F93\u5165\u6846\u663E\u793A zsh \u98CE\u683C\u7684 <\u4ED3\u5E93\u540D> (\u5206\u652F) \u6807\u8BB0\uFF1B\u5173\u95ED\u540E\u6539\u4E3A\u5728 Git \u6807\u7B7E\u65C1\u663E\u793A\u72B6\u6001\u5706\u70B9\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffTitle":"\u5DEE\u5F02\u5BF9\u6BD4\u9ED8\u8BA4\u89C6\u56FE","cfg.diffHint":"\u9009\u62E9\u53D8\u66F4\u5BF9\u6BD4\u9ED8\u8BA4\u6253\u5F00\u7684\u5E03\u5C40\uFF1A\u7EDF\u4E00\u89C6\u56FE\u4E3A\u5355\u680F\u884C\u5185\u5BF9\u6BD4\uFF0C\u5E76\u6392\u89C6\u56FE\u4E3A\u5DE6\u53F3\u5206\u680F\u5BF9\u6BD4\u3002\u4ECD\u53EF\u5728\u6BCF\u4E2A\u5DEE\u5F02\u89C6\u56FE\u4E2D\u4E34\u65F6\u5207\u6362\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffUnified":"\u7EDF\u4E00\u89C6\u56FE\uFF08\u5355\u680F\u884C\u5185\uFF09","cfg.diffSplit":"\u5E76\u6392\u89C6\u56FE\uFF08\u5DE6\u53F3\u5206\u680F\uFF09","cfg.graphTitle":"\u63D0\u4EA4\u5386\u53F2\u56FE\u7EBF\u6761\u6837\u5F0F","cfg.graphHint":"\u9009\u62E9\u63D0\u4EA4\u5386\u53F2\u56FE\u7684\u8FDE\u7EBF\u753B\u6CD5\uFF1A\u5E73\u884C\u7EBF\u4E3A VSCode / \u56FE\u5F62\u754C\u9762\u98CE\u683C\uFF0C\u5206\u652F\u5404\u5360\u4E00\u5217\u3001\u5171\u4EAB\u7956\u5148\u4EE5\u5E76\u884C\u7EBF\u8868\u793A\uFF1B\u7D27\u51D1\u4E3A git log \u547D\u4EE4\u884C\u98CE\u683C\uFF0C\u5171\u4EAB\u7956\u5148\u5408\u5E76\u4E3A\u4E00\u5217\u3001\u7EBF\u66F4\u5C11\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.graphParallel":"\u5E73\u884C\u7EBF\uFF08VSCode \u98CE\u683C\uFF09","cfg.graphCompact":"\u7D27\u51D1\uFF08git log \u98CE\u683C\uFF09","cfg.suggestTitle":"AI \u751F\u6210\u63D0\u4EA4\u4FE1\u606F","cfg.suggestToggle":"\u63D0\u4EA4\u6846\u663E\u793A AI \u751F\u6210\u6309\u94AE","cfg.suggestLangLabel":"\u751F\u6210\u8BED\u8A00","cfg.suggestLangAuto":"\u81EA\u52A8","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"\u81EA\u52A8 = \u8DDF\u968F\u4F60\u5728\u6B64\u4ED3\u5E93\u7684\u63D0\u4EA4\u8BED\u8A00\uFF08\u5C31\u8FD1\u52A0\u6743\uFF0C\u5F53\u524D git \u4F5C\u8005\u4F18\u5148\uFF0C\u5FFD\u7565 release / merge \u7B49\u673A\u68B0\u63D0\u4EA4\uFF09\uFF1B\u4E2D\u6587 / English \u76F4\u63A5\u6307\u5B9A\u3002","cfg.suggestMaxBytesLabel":"\u8F93\u5165\u9884\u7B97","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"\u53D1\u9001\u7ED9\u6A21\u578B\u7684 diff \u4E0A\u9650\uFF0C\u8D85\u51FA\u4F1A\u622A\u65AD\uFF1B\u8303\u56F4 16\u2013512\u3002","cfg.suggestOutputLabel":"\u8F93\u51FA\u4E0A\u9650","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"\u6A21\u578B\u751F\u6210\u9884\u7B97\uFF1B\u601D\u8003\u6A21\u578B\u7684\u63A8\u7406\u8BA1\u5165\u8BE5\u9884\u7B97\uFF1B\u8303\u56F4 256\u201316384\u3002","cfg.suggestTimeoutLabel":"\u751F\u6210\u8D85\u65F6","cfg.suggestTimeoutUnit":"\u79D2","cfg.suggestTimeoutHint":"\u8D85\u65F6\u5373\u751F\u6210\u5931\u8D25\uFF1B\u8303\u56F4 5\u2013120\u3002","cfg.suggestHint":"\u5F00\u542F\u540E\u63D0\u4EA4\u6846\u65C1\u4F1A\u51FA\u73B0\u300CAI \u751F\u6210\u300D\u6309\u94AE\uFF1A\u6839\u636E\u5F53\u524D\u53D8\u66F4\u4E0E\u4ED3\u5E93\u65E2\u6709\u63D0\u4EA4\u98CE\u683C\u751F\u6210\u63D0\u4EA4\u4FE1\u606F\uFF0C\u586B\u5165\u540E\u53EF\u7F16\u8F91\u518D\u63D0\u4EA4\u3002\u751F\u6210\u7684\u8BF7\u6C42\u4F1A\u4F7F\u7528\u4F60\u5728 DSH \u4E2D\u914D\u7F6E\u7684\u6A21\u578B\uFF0Cdiff \u5185\u5BB9\u4F1A\u53D1\u9001\u7ED9\u6A21\u578B\u4F9B\u5E94\u5546\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.notLoaded":"\u914D\u7F6E\u672A\u52A0\u8F7D\uFF1A\u8BE5\u914D\u7F6E\u7531\u8FD0\u884C\u4E2D\u7684\u5BBF\u4E3B\u63D0\u4F9B\uFF0C\u82E5\u957F\u65F6\u95F4\u7A7A\u767D\u8BF7\u91CD\u542F DSH \u540E\u91CD\u8BD5\u3002","cfg.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"},ua={"panel.tab":"Git","panel.fontDecrease":"Decrease font size","panel.fontReset":"Reset font size","panel.fontIncrease":"Increase font size","panel.fontSize":"Panel font size","panel.tabs":"Panel tabs","tab.overview":"Overview","tab.changes":"Changes","tab.files":"Files","pill.unavailable":"Git unavailable","pill.detached":"detached HEAD","pill.synced":"Everything committed","pill.dirty":"Uncommitted changes","common.loading":"Loading\u2026","common.retry":"Retry","common.close":"Close","common.cancel":"Cancel","ops.aiHint":"Tip: Trust AI more, try direct Git\u2011operation execution by AI.","version.check":"Check for updates","version.checking":"Checking\u2026","version.upToDate":"Up to date ({current})","version.updateAvailable":"New version {latest} available (current {current})","version.viewRelease":"View release","version.error":"Check failed","version.noRepo":"Repository not configured","version.openRepo":"Visit @xbzbing/dsh-git-panel on GitHub \u2014 please give the project a little star \u2B50","overview.head":"All branches","overview.local":"Local","overview.currentBranch":"Current branch","overview.primaryBranch":"Primary branch","overview.branchAhead":"{n} commits ahead of upstream","overview.branchBehind":"{n} commits behind upstream","overview.remote":"Remote","overview.tags":"Tags","overview.search":"Search commits (message / hash)","overview.searchShort":"Search","overview.allUsers":"All authors","overview.allTime":"All time","overview.today":"Today","overview.last7d":"Last 7 days","overview.last30d":"Last 30 days","overview.selectCommit":"Select a commit to see details","overview.noMessage":"(no commit body)","overview.noResults":"No matching commits","overview.loadFailed":"Load failed","overview.detailFailed":"Failed to load details","overview.diffFailed":"Failed to load diff","overview.openFileDiff":"View this file\u2019s changes in this commit","overview.changeSummary":"{files} files","overview.expandDir":"Expand folder","overview.collapseDir":"Collapse folder","overview.fetch":"Fetch","overview.branchesError":"Failed to load branches","overview.filterBranch":"Filter by branch","overview.moreFilters":"More filters","overview.backToList":"Back to list","overview.createTag":"Create tag","switch.action":"Switch","switch.rowTitle":"Switch to {name}","switch.rowTitleTrack":"Create {name} tracking {ref} and switch to it","switch.detached":"detached HEAD","switch.confirmTitle":"Switch branch","switch.body":"Switch from {from} to {to}.","switch.trackingNote":"There is no local {name} yet: it will be created from {ref} and set to track it.","switch.dirtyWarn":"{count} file(s) have uncommitted changes.","switch.modeDirect":"Switch directly","switch.modeDirectHint":"Uncommitted changes come along; if they collide with the target branch, git refuses the switch and the work tree stays untouched.","switch.modeStash":"Stash the {count} file(s) first, then switch","switch.modeStashHint":"The changes (including untracked files) move to the top of the stash; restore them from Changes \u2192 Stash afterwards. Note: they are not restored automatically, and restoring may need manual conflict resolution.","switch.confirm":"Switch","switch.confirmStash":"Stash and switch","switch.switching":"Switching\u2026","switch.stashMessage":"Auto-stash before switching to {branch}","overview.revert":"Revert this commit","overview.reset":"Reset to here","tag.createTitle":"Create a tag at this commit","tag.namePlaceholder":"Tag name","tag.annotated":"Annotated tag (with message)","tag.messagePlaceholder":"Tag message","tag.create":"Create tag","tag.deleteTitle":"Delete tag","tag.deleteConfirm":'Delete tag "{name}"?',"tag.deleteOne":'Delete tag "{name}"',"ops.dirtyWarn":"There are uncommitted changes \u2014 they may be work the dsh AI is doing.","revert.title":"Revert commit","revert.body":"Appends a reverse commit at the current HEAD that undoes the changes in {ref}. Your working-tree changes are kept.","revert.confirm":"Revert","reset.title":"Reset branch","reset.body":"Moves the current branch HEAD from {from} to {to}.","reset.modeSoft":"Soft (--soft)","reset.softHint":"Moves HEAD; changes stay staged.","reset.modeMixed":"Mixed (--mixed, default)","reset.mixedHint":"Moves HEAD; changes stay in the working tree.","reset.modeHard":"Hard (--hard)","reset.hardHint":"Moves HEAD to this commit and discards all uncommitted changes (uncommitted changes cannot be recovered).","reset.hardOrphan":"Commits after the target leave the branch (still recoverable via git reflog).","reset.hardWarn":"The following uncommitted changes will be permanently discarded:","reset.lostMore":"\u2026 more uncommitted changes not shown (list capped)","reset.hardAck":"I understand these uncommitted changes will be lost","reset.hardAckClean":"I understand the consequences and confirm the reset","reset.confirm":"Reset","changes.groupStaged":"Staged changes","changes.groupUnstaged":"Changes","changes.groupUntracked":"Unversioned files","changes.selectFile":"Select a file to see its diff","changes.noChanges":"No uncommitted changes","changes.actions":"Repository change actions","changes.refresh":"Refresh repository status","changes.stageAll":"Stage all","changes.unstageAll":"Unstage all","changes.stage":"Stage","changes.unstage":"Unstage","changes.discard":"Discard changes","changes.discardConfirm":"Click again to confirm discard","changes.stageTip":"Stage this file so the next commit includes its changes","changes.unstageTip":"Unstage this file; its changes stay in the working tree","changes.discardTip":"Discard this file's working-tree changes (cannot be undone); click again to confirm","changes.discardTipArmed":"Click again to discard this file's changes \u2014 cannot be undone","changes.discardPicked":"Discard selected","changes.discardPickedTitle":"Discard selected changes","changes.discardPickedBody":"Discards uncommitted working-tree changes in {count} file(s). This cannot be undone.","changes.discardPickedStaged":"{count} of the selected rows are on the staged side and are not affected; use Unstage to undo the index.","changes.discardPickedUntracked":"{count} of them are untracked files or directories that will be deleted from disk (never in Git history \u2014 unrecoverable).","changes.discarding":"Discarding\u2026","changes.backToList":"Back to list","changes.stash":"Stash changes","changes.untrackedCollapsed":"Untracked entries are shown as directories, not expanded","changes.truncatedCap":"Too many changes \u2014 showing the first {n}; counts still cover all changes","changes.truncatedLossy":"Git output exceeded the limit; the list may be missing its opening entries","changes.truncatedUnknown":"The list is incomplete; some changes may be missing","stash.title":"Stash current changes","stash.messagePlaceholder":"Stash message (optional)","stash.save":"Stash","stash.section":"Stashes","stash.onBranch":"on {branch}","stash.apply":"Apply","stash.pop":"Pop","stash.drop":"Drop","stash.dropTitle":"Drop stash","stash.dropConfirm":"Drop this stash? This cannot be undone: {name}","files.selectFile":"Select a file to preview","files.loadFailed":"Load failed","files.backToTree":"Back to files","files.truncated":"Too many entries \u2014 truncated","files.tooLarge":"File too large to preview","files.binary":"Binary file \u2014 no preview","files.highlightOff":"Large file \u2014 syntax highlighting disabled for performance","files.lineTruncated":" \u2026 (line too long, truncated)","files.findPlaceholder":"Find in file","files.findNoMatch":"No results","files.findPrev":"Previous match","files.findNext":"Next match","files.findClose":"Close find","files.findCase":"Match case","files.previewMode":"Preview mode","files.source":"Source","files.render":"Rendered","files.copyPath":"Copy relative path","files.pathCopied":"Path copied","files.pathCopyFailed":"Copy failed","files.copyContent":"Copy file content","files.contentCopied":"Content copied","files.contentCopyFailed":"Copy failed","files.ignored":"Ignored by Git","files.copy":"Copy code","files.copied":"Copied","files.footnotes":"Footnotes","files.zoomBar":"Image zoom","files.zoomIn":"Zoom in","files.zoomOut":"Zoom out","files.zoomActual":"Actual size (100%)","files.zoomFit":"Fit to window","files.zoomFullscreen":"View fullscreen","files.fullscreen":"View file full screen","files.gitNotInstalled":"Git is not installed; the Git panel is unavailable. Please install Git and try again.","files.propsTitle":"File properties","files.propsGroupStats":"Size & stats","files.propsGroupTime":"Timestamps","files.propsName":"Name","files.propsType":"Type","files.propsTypeImage":"{fmt} image","files.propsTypeText":"Text file","files.propsTypeBinary":"Binary file","files.propsTypeUnread":"Too large to read","files.propsTypeFmt":"{label} (.{ext})","files.propsRelPath":"Relative path","files.propsAbsPath":"Absolute path","files.propsCopyHint":"Click to copy","files.propsSize":"Size","files.propsSizeBytes":"({bytes} bytes)","files.propsLines":"Lines","files.propsImageSize":"Dimensions","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"Modified","files.propsUntracked":"Untracked","files.propsTrackedYes":"Tracked","files.propsStaged":"Staged","files.stAdded":"Added","files.stModified":"Modified","files.stDeleted":"Deleted","files.stRenamed":"Renamed","files.stConflicted":"Conflicted","files.stTypechange":"Type changed","stats.files":"{n} files","stats.lastChange":"changed {time}","stats.lastCommit":"last commit {time}","stats.staged":"{n} staged","stats.modified":"{n} modified","stats.untracked":"{n} untracked","stats.partial":"simplified","stats.partialHint":"Large change set \u2014 untracked line counts and last-change time are omitted to keep the panel responsive.","commit.placeholder":"Commit message","commit.commit":"Commit","commit.amend":"Amend previous commit","commit.edit":"Edit commit message","commit.collapse":"Collapse commit editor","commit.suggest":"AI suggest","commit.suggesting":"Generating\u2026","commit.suggestOverwrite":'Click "AI suggest" again to replace the current message',"commit.suggestTruncated":"The diff was truncated; the suggestion may be incomplete","diff.unified":"Unified","diff.split":"Split","diff.before":"Before","diff.after":"After","diff.binary":"Binary file \u2014 no diff to show","diff.tooLarge":"Image too large to compare","diff.imageMissing":"Does not exist","diff.svgRender":"Rendered","diff.svgSource":"Source","diff.empty":"No differences","diff.expandAll":"Expand all","diff.collapse":"Collapse unchanged","diff.expandGap":"Expand all {n} lines","diff.expandUp":"Expand up {n} lines","diff.expandDown":"Expand down {n} lines","diff.expandCapped":"Large file: expanded {n} lines of context; the rest stays collapsed and can be expanded in place","diff.truncated":"git output exceeded the output cap: only the tail of this diff survived, so the opening changes and the +/- counts may be missing","time.justNow":"just now","time.minutesAgo":"{n}m ago","time.hoursAgo":"{n}h ago","time.daysAgo":"{n}d ago","error.generic":"Operation failed","error.notARepo":"Not a Git repository","error.noCwd":"This session has no working directory","error.localChangesBlock":"Local changes block this operation","error.emptyMessage":"Commit message cannot be empty","error.emptyDiff":"No changes to summarize","error.llmUnavailable":"AI service unavailable","error.llmFailed":"AI generation failed","error.suggestDisabled":"AI suggest is turned off in the plugin config","error.conflict":"Applying the stash produced conflicts; the stash entry is kept \u2014 resolve them and retry","error.revertConflict":"The revert would conflict with the current content; it was cancelled automatically (your working tree is unchanged)","error.revertStuck":"The revert conflicted and could not be auto-cancelled; the repository is mid-revert \u2014 run `git revert --abort` or resolve it manually","error.revertMerge":"This is a merge commit; the panel cannot revert it (a mainline parent is required) \u2014 use `git revert -m` on the command line","error.indexBusy":"Git is busy (another process holds the index lock); try again shortly","error.notFound":"Target not found (the branch / tag / stash may have been removed or renamed)","error.branchInUse":"That branch is checked out in another worktree, so it cannot be switched to here","error.nestedRepo":"That entry is a Git repository itself (a nested repo or a submodule): discarding it would delete the whole inner repository. Do it from a terminal instead","error.nestedRepoPartial":"That entry is a Git repository itself (a nested repo or a submodule), so it was not deleted \u2014 but earlier entries in this batch already were. Refresh to see what is left, and handle this one from a terminal","error.stashSwitchFailed":"The uncommitted changes were stashed (restore them from Changes \u2192 Stash), but the switch failed: {reason}","error.invalidName":"Invalid name","error.notFastForward":"Local and remote have diverged \u2014 a fast-forward pull is not possible; merge or rebase manually","error.pushRejected":"Push rejected: the remote has new commits \u2014 run \u201CCheck sync\u201D and pull first, then push","error.authFailed":"Authentication failed: no usable git credentials (HTTPS needs a credential helper, SSH needs a key). Push once from the command line first to cache them","status.openRepo":"Open the repository home in the browser","status.openRepoOn":"Open the repository home on {host}","status.synced":"Up to date with remote","status.ahead":"{n} ahead","status.behind":"{n} behind","status.diverged":"Diverged ({ahead} ahead / {behind} behind)","status.noUpstream":"No upstream branch","status.detached":"Detached HEAD \u2014 no branch sync state","status.check":"Check sync status","status.checkTitle":"Check sync with the remote: runs git fetch to update refs and refresh the ahead/behind counts; your working tree is untouched","status.pull":"Pull","status.pulling":"Syncing\u2026","status.pullTitle":"Fast-forward pull of remote updates","status.pullConfirmTitle":"Pull remote updates","status.pullConfirmBody":"Fast-forwards the current branch {branch} to the latest remote commit ({behind} behind). Only possible when not diverged; it creates no merge commit and leaves your uncommitted work untouched.","status.pullConfirm":"Pull","status.pullScope":"Brings in {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pullScopeLoading":"Measuring incoming changes\u2026","status.push":"Push","status.pushTitle":"Push local commits to the remote","status.pushConfirmTitle":"Push to remote","status.pushConfirmBody":"Pushes the {ahead} commits that {branch} is ahead of the remote to its upstream. Fast-forward only \u2014 it never force-overwrites remote history.","status.pushConfirm":"Push","status.pushing":"Pushing\u2026","status.pushScope":"Pushes {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pushScopeLoading":"Measuring outgoing changes\u2026","status.publish":"Publish","status.publishTitle":"Publish the branch and set its upstream","status.publishConfirmTitle":"Publish branch to remote","status.publishConfirmBody":"The current branch {branch} has no upstream yet. This runs git push -u {remote} to create a same-named branch on the remote and set it as the upstream.","status.publishConfirm":"Publish","status.publishing":"Publishing\u2026","cfg.title":"Input-bar branch marker","cfg.toggle":"Show input-bar marker","cfg.hint":"When on, the input bar shows the zsh-style <repo> (branch) marker; when off, a status dot appears beside the Git tab instead. Saved changes apply immediately.","cfg.diffTitle":"Default diff view","cfg.diffHint":"Choose the layout diffs open with: unified is a single inline column, split is side-by-side. You can still switch per diff. Saved changes apply immediately.","cfg.diffUnified":"Unified (single inline column)","cfg.diffSplit":"Split (side-by-side)","cfg.graphTitle":"Commit graph line style","cfg.graphHint":"Choose how the commit graph draws its lines: parallel is the VSCode / GUI style \u2014 each branch keeps its own column and a shared ancestor shows as parallel lines; compact is the git log style \u2014 a shared ancestor merges into one column with fewer lines. Saved changes apply immediately.","cfg.graphParallel":"Parallel (VSCode style)","cfg.graphCompact":"Compact (git log style)","cfg.suggestTitle":"AI commit message","cfg.suggestToggle":"Show AI suggest button in the commit box","cfg.suggestLangLabel":"Language","cfg.suggestLangAuto":"Auto","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"Auto follows the language you write commits in for this repository (recency-weighted, with the current git author preferred, ignoring mechanical commits such as releases and merges); \u4E2D\u6587 / English pin it.","cfg.suggestMaxBytesLabel":"Input budget","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"Diff bytes sent to the model; beyond it the diff is truncated. Range 16\u2013512.","cfg.suggestOutputLabel":"Output limit","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"Model generation budget; reasoning tokens count against it on thinking models. Range 256\u201316384.","cfg.suggestTimeoutLabel":"Generation timeout","cfg.suggestTimeoutUnit":"s","cfg.suggestTimeoutHint":"Generation fails after the timeout. Range 5\u2013120.","cfg.suggestHint":'When on, an "AI suggest" button appears beside the commit button: it writes a commit message from the current changes and the repository\u2019s existing commit style, filled in for you to edit before committing. Generation uses the model configured in DSH; the diff is sent to that model provider. Saved changes apply immediately.',"cfg.notLoaded":"Config not loaded: it is served by the running host. Restart DSH if this stays blank.","cfg.saveFailed":"Save failed, please retry"};var vn=require("react");function Fo(e=()=>typeof document>"u"?void 0:document){let t=new Set,n,r=!0,a=()=>e()?.hidden!==!0,i=()=>{let s=a();if(s!==r){r=s;for(let o of[...t])o()}};return{isVisible:a,subscribe(s){return t.size===0&&(n=e(),r=a(),n?.addEventListener("visibilitychange",i)),t.add(s),()=>{t.delete(s),t.size===0&&(n?.removeEventListener("visibilitychange",i),n=void 0)}}}}var Ie=Fo();var Ho=new Set(["cwd-unavailable"]),ga=3e4,Bo=6e4,Pn=class{constructor(t,n,r=Ie){this.remote=t;this.sessionId=n;this.visibility=r;this.unsubscribeVisibility=r.subscribe(()=>{this.disposed||(this.visibilityGeneration+=1,this.publish(this.view,this.unreadySignal()),r.isVisible()?this.refresh():this.clearPoll())})}view={state:"cold"};listeners=new Set;timer;inflight;pendingRefresh=!1;disposed=!1;pollMs=ga;unsubscribeVisibility;visibilityGeneration=0;requestGeneration=0;querySignal={tick:0,sampledAt:0,ready:!1,root:null};queryListeners=new Set;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getSnapshot(){return this.view}subscribeQueries(t){return this.queryListeners.add(t),()=>{this.queryListeners.delete(t)}}getQuerySignal(){return this.querySignal}ensure(){this.inflight!==void 0||this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){if(this.disposed)return Promise.resolve();if(!this.visibility.isVisible())return this.pendingRefresh=!0,this.clearPoll(),Promise.resolve();if(this.inflight!==void 0)return this.pendingRefresh=!0,this.inflight.then(()=>this.inflight);this.pendingRefresh=!1,this.clearPoll();let t=this.visibilityGeneration,n=this.requestGeneration;return this.view.state==="cold"&&this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId}).then(r=>{if(!(this.disposed||n!==this.requestGeneration)){if(r.ok)this.publishSnapshot(r.value,t,!1);else if(r.error.code!=="cancelled")if(Ho.has(r.error.code))this.pollMs=Bo,this.setView({state:"no-cwd"});else if(r.error.code==="not-a-git-repo"){let a=r.error;this.setView({state:"error",error:{code:"not-a-git-repo",...a.cwd?{cwd:a.cwd}:{},...a.showInputPill!==void 0?{showInputPill:a.showInputPill}:{}}})}else if(r.error.code==="git-unavailable"){let a=r.error;this.setView({state:"error",error:{code:"git-unavailable",...a.detail?{detail:a.detail}:{},...a.cwd?{cwd:a.cwd}:{},...a.isGitRepo!==void 0?{isGitRepo:a.isGitRepo}:{}}})}else this.setView({state:"error",error:{code:r.error.code,..."detail"in r.error?{detail:r.error.detail}:{}}})}}).catch(r=>{this.disposed||n!==this.requestGeneration||this.setView({state:"error",error:{code:"git-unavailable",detail:r instanceof Error?r.message:String(r)}})}).finally(()=>{this.inflight=void 0,!(this.disposed||!this.visibility.isVisible())&&(this.pendingRefresh?this.refresh():this.schedulePoll())}),this.inflight}resync(){this.disposed||(this.requestGeneration+=1,this.refresh())}accept(t){this.disposed||(this.requestGeneration+=1,this.pendingRefresh=!1,this.publishSnapshot(t,this.visibilityGeneration,!0),this.schedulePoll())}publishSnapshot(t,n,r){this.pollMs=t.refreshIntervalMs||ga;let a=this.view.state==="ready"?this.view.snapshot:null,i=!r&&a!==null&&t.root===a.root&&t.stateFingerprint!==void 0&&t.stateFingerprint===a.stateFingerprint,s={tick:this.querySignal.tick+1,sampledAt:t.checkedAt,ready:this.visibility.isVisible()&&n===this.visibilityGeneration,root:t.root};this.publish(i?this.view:{state:"ready",snapshot:t},s)}unreadySignal(){return this.querySignal.ready?{...this.querySignal,ready:!1}:this.querySignal}clearPoll(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}schedulePoll(){this.clearPoll(),!(this.disposed||!this.visibility.isVisible()||this.inflight!==void 0||this.pollMs<=0)&&(this.timer=setTimeout(()=>{this.timer=void 0,this.refresh()},this.pollMs))}setView(t){this.publish(t,this.unreadySignal())}publish(t,n){let r=t!==this.view,a=n!==this.querySignal;if(this.view=t,this.querySignal=n,r)for(let i of this.listeners)i();if(a)for(let i of this.queryListeners)i()}dispose(){this.disposed=!0,this.clearPoll(),this.unsubscribeVisibility(),this.pendingRefresh=!1,this.listeners.clear(),this.queryListeners.clear()}};var Ln=require("react"),Tr={tick:0,sampledAt:0,ready:!1,root:null};function Io(e,t){let[n,r]=(0,Ln.useState)(()=>e?.getQuerySignal()??Tr);return(0,Ln.useEffect)(()=>{if(e===void 0){r(Tr);return}let a=()=>r(e.getQuerySignal());if(!t){a();return}let i=e.subscribeQueries(a);return a(),i},[e,t]),t?e?.getQuerySignal()??Tr:n}function fa(e,t,n){let r=Io(e,t);return{signal:r,queryVisible:t&&r.ready&&r.root===n,queryKey:[r.root,r.tick]}}var Oo="/api",Xo="gitPanel";function $o(e){try{let t=e.get("connection")?.rpc,n=t?.call;if(t!==void 0&&typeof n=="function")return(r,a,i)=>n.call(t,Oo,r,a,i)}catch{}}function Jo(e){let t=e;if(t===null||typeof t!="object")return{ok:!1,error:{code:"git-unavailable",message:"malformed rpc result"}};if(t.ok!==!0){let n=t.error;return{ok:!1,error:{code:typeof n?.code=="string"?n.code:"git-unavailable",message:typeof n?.message=="string"?n.message:void 0}}}return t.value===void 0?{ok:!1,error:{code:"git-unavailable",message:"missing value"}}:t.value}function be(e,t){return!e.ok||e.value.kind!==t?null:e.value}function ct(e){return e!==void 0&&e!==""}var ma=new WeakMap;function bn(e){let t=ma.get(e);if(t!==void 0)return t;let n=async(a,i,s)=>{let o=$o(e);if(o===void 0)return{ok:!1,error:{code:"git-unavailable",message:"no connection"}};try{let l=await o(`${Xo}/${a}`,{args:{request:i}},s);return Jo(l)}catch(l){return{ok:!1,error:{code:"git-unavailable",message:l instanceof Error?l.message:String(l)}}}},r={snapshot:(a,i)=>n("snapshot",a,i),run:(a,i)=>n("run",a,i),query:(a,i)=>n("query",a,i),suggest:(a,i)=>n("suggest",a,i),version:(a,i)=>n("version",a,i)};return ma.set(e,r),r}var mt=new Map,ha,Nr;function ya(e){Nr=e,ha=bn(e)}function It(e){let t=mt.get(e);if(t===void 0){let n=ha??(Nr?bn(Nr):void 0);t=new Pn(n??Vo(),e),mt.set(e,t)}return t}var Ko=6e4,Qt=new Map;function ba(e){let t=Qt.get(e);t!==void 0&&(clearTimeout(t),Qt.delete(e)),Bt.set(e,(Bt.get(e)??0)+1)}function va(e,t){if(mt.get(e)!==t)return;let n=(Bt.get(e)??1)-1;if(n>0){Bt.set(e,n);return}Bt.delete(e);let r=setTimeout(()=>{mt.get(e)===t&&(Qt.delete(e),!((Bt.get(e)??0)>0)&&(t.dispose(),mt.delete(e)))},Ko);Qt.set(e,r)}var Bt=new Map;function wn(){for(let e of mt.values())e.resync()}function wa(){for(let e of mt.values())e.dispose();mt.clear();for(let e of Qt.values())clearTimeout(e);Qt.clear(),Bt.clear()}function Vo(){let e=async()=>({ok:!1,error:{code:"git-unavailable"}});return{snapshot:e,run:e,query:e,suggest:e,version:e}}function Dn(e,t,n){let r=e?t?It(e):mt.get(e):void 0,a=fa(r,t,n);return(0,vn.useEffect)(()=>{if(!(!t||r===void 0||e===void 0))return ba(e),r.ensure(),()=>va(e,r)},[r,e,t]),a}function An(e){let[,t]=(0,vn.useState)(0),n=e?It(e):void 0,r=n?n.getSnapshot():{state:"cold"};return(0,vn.useEffect)(()=>{if(n===void 0||e===void 0)return;ba(e);let a=n.subscribe(()=>t(i=>i+1));return n.getSnapshot()!==r&&t(i=>i+1),n.ensure(),()=>{a(),va(e,n)}},[n,e]),r}var K=require("react"),vo=require("@deepseek-ai/dsh-client-ui-primitives");var xa="[data-conversation-tabs]",kn='[data-conversation-tabs] button[role="tab"]',Er=new Map,xn=new Map;function ka(e,t){let n=xn.get(e);if(n!==void 0&&n.size>0){for(let r of n)r(t);return}Er.set(e,t)}function _a(e){let t=Er.get(e);return t===void 0?null:(Er.delete(e),t)}function Sa(e,t){let n=xn.get(e);return n===void 0&&(n=new Set,xn.set(e,n)),n.add(t),()=>{let r=xn.get(e);r!==void 0&&(r.delete(t),r.size===0&&xn.delete(e))}}var qo=6e4,Gr=new Map;function Ca(e,t){Gr.set(e,{tab:t,leftAt:Date.now()})}function Ta(e){let t=Gr.get(e);return t===void 0?null:Date.now()-t.leftAt>qo?(Gr.delete(e),null):t.tab}function Na(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(kn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}function Ea(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(kn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")==="true";return!1}function Ga(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(kn);for(let n of t)if((n.textContent??"").trim()!==e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}var p=require("react"),lr=require("react-dom"),En=require("@deepseek-ai/dsh-client-ui-primitives");var A=require("react"),Uo="M2 7V3h4l8 8-4 4z",Ma="M8 1.8l1.76 3.57 3.94.57-2.85 2.78.67 3.92L8 10.78l-3.52 1.85.67-3.92L2.3 5.94l3.94-.57z";function ve(e,t=15,n=!1){return(0,A.createElement)("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round",...n?{"aria-hidden":!0}:{}},e)}function zn({size:e}){return ve([(0,A.createElement)("circle",{key:"c",cx:8,cy:8,r:2.4}),(0,A.createElement)("line",{key:"l1",x1:8,y1:1.5,x2:8,y2:5.6}),(0,A.createElement)("line",{key:"l2",x1:8,y1:10.4,x2:8,y2:14.5})],e)}function Ra({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M4 2v8"}),(0,A.createElement)("path",{key:"b",d:"M2 4h4"}),(0,A.createElement)("circle",{key:"c",cx:4,cy:12,r:1.6}),(0,A.createElement)("circle",{key:"d",cx:12,cy:4,r:1.6}),(0,A.createElement)("path",{key:"e",d:"M12 6v4"}),(0,A.createElement)("path",{key:"f",d:"M10 12h4"})],e)}function Mr({size:e}){return ve([(0,A.createElement)("circle",{key:"a",cx:4,cy:3,r:1.6}),(0,A.createElement)("circle",{key:"b",cx:4,cy:13,r:1.6}),(0,A.createElement)("circle",{key:"c",cx:12,cy:5,r:1.6}),(0,A.createElement)("path",{key:"d",d:"M4 4.6v6.8"}),(0,A.createElement)("path",{key:"e",d:"M12 6.6c0 3-4 2.4-8 4"})],e)}function Pa(e,t=!1){return ve([(0,A.createElement)("path",{key:"a",d:Uo}),(0,A.createElement)("circle",{key:"b",cx:4.5,cy:5.5,r:.8,fill:"currentColor"})],e,t)}function Yt({size:e}){return Pa(e)}function ht({size:e,open:t}){return ve([(0,A.createElement)("path",{key:"a",d:t?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})],e)}function We({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M4 4l8 8M12 4l-8 8"})],e)}function La({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M2 6V2h4"}),(0,A.createElement)("path",{key:"b",d:"M10 2h4v4"}),(0,A.createElement)("path",{key:"c",d:"M14 10v4h-4"}),(0,A.createElement)("path",{key:"d",d:"M6 14H2v-4"})],e)}function Zt({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M10 3L5 8l5 5"}),(0,A.createElement)("path",{key:"b",d:"M5 8h8"})],e)}function Da({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M2 3h12l-4.5 5.5V13L6.5 11V8.5z"})],e)}function Aa({size:e}){return ve([(0,A.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,A.createElement)("path",{key:"plus",d:"M11 8v6M8 11h6"})],e,!0)}function za({size:e}){return ve([(0,A.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,A.createElement)("path",{key:"minus",d:"M8 11h6"})],e,!0)}function en({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M13 8a5 5 0 1 1-1.5-3.5"}),(0,A.createElement)("path",{key:"b",d:"M13 2v3h-3"})],e)}function Fa({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M8 2.6l1.4 4 4 1.4-4 1.4-1.4 4-1.4-4-4-1.4 4-1.4z"}),(0,A.createElement)("path",{key:"b",d:"M13 11.6v2.8M11.6 13h2.8"})],e)}function Ha({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M4 2h5l3 3v9H4z"}),(0,A.createElement)("path",{key:"b",d:"M9 2v3h3"})],e)}function Ba({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M2 12.5V3.5h4l1.5 2H14v7z"})],e)}function Fn({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M2 5.5h12V13H2z"}),(0,A.createElement)("path",{key:"b",d:"M1.5 3h13v2.5h-13z"}),(0,A.createElement)("path",{key:"c",d:"M6.5 8.5h3"})],e)}function Hn({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,A.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,A.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"})],e)}function Ia({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M3 7a5 5 0 1 1 1.3 3.4"}),(0,A.createElement)("path",{key:"b",d:"M3 3.5V7h3.5"})],e)}function Bn({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M13 3v10"}),(0,A.createElement)("path",{key:"b",d:"M10.5 8L3 3.5v9z",fill:"currentColor"})],e)}function Oa({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M5 2.5h4l2.5 2.5v7.5h-6.5z"}),(0,A.createElement)("path",{key:"b",d:"M9 2.5V5h2.5"}),(0,A.createElement)("path",{key:"c",d:"M11 12.5v1.5h-6.5V6"})],e)}function Xa({size:e=15}){return(0,A.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor"},(0,A.createElement)("path",{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"}))}function $a({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M8 2.5v7"}),(0,A.createElement)("path",{key:"b",d:"M4.5 7L8 10.5 11.5 7"}),(0,A.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function _n({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M8 10.5v-7"}),(0,A.createElement)("path",{key:"b",d:"M4.5 6L8 2.5 11.5 6"}),(0,A.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function Ja({size:e}){return ve([(0,A.createElement)("path",{key:"a",d:"M12.5 7a4.5 4.5 0 0 0-8-2.3"}),(0,A.createElement)("path",{key:"b",d:"M3.5 9a4.5 4.5 0 0 0 8 2.3"}),(0,A.createElement)("path",{key:"c",d:"M4.3 2.2v2.5h2.5"}),(0,A.createElement)("path",{key:"d",d:"M11.7 13.8v-2.5H9.2"})],e)}function Ka({size:e}){return ve([(0,A.createElement)("circle",{key:"a",cx:8,cy:8,r:6}),(0,A.createElement)("path",{key:"b",d:"M8 7.2v3.6"}),(0,A.createElement)("circle",{key:"c",cx:8,cy:5.2,r:.5,fill:"currentColor",stroke:"none"})],e)}function Va({size:e=15,filled:t}){return(0,A.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},(0,A.createElement)("path",{d:Ma}))}function qa({size:e}){return Pa(e,!0)}function Ua({size:e=15}){return(0,A.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},(0,A.createElement)("path",{d:Ma}))}function ja({size:e,direction:t}){let n=e??15,r=t==="ahead"?"M4.5 11.5L11.5 4.5":"M11.5 4.5L4.5 11.5",a=t==="ahead"?"M6.5 4.5h5v5":"M9.5 11.5h-5v-5";return(0,A.createElement)("svg",{className:"gp-branch-row__sync-icon","data-direction":t,width:n,height:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},[(0,A.createElement)("path",{key:"a",d:r}),(0,A.createElement)("path",{key:"b",d:a})])}function Wa(e){let t=0;for(let n of e){t=Math.max(t,n.lane+1);for(let r of n.edges)t=Math.max(t,r.fromLane+1,r.toLane+1)}return t}function In(e,t,n){let r=[],a=[],i=[],s=[],o=[],l=0,d=()=>{if(o.length===0)return l++;let y=Math.min(...o);return o.splice(o.indexOf(y),1),y},c=y=>{y!==null&&!o.includes(y)&&o.push(y)},u=(y,w)=>{let h=a.findIndex(k=>k===null);return h===-1&&(h=a.length,a.push(null),i.push(null),s.push(!1)),a[h]=y,i[h]=d(),s[h]=w,h},g=y=>a.findIndex(w=>w===y),b=(y,w)=>{let h=a.findIndex((k,S)=>k===y&&s[S]===w);return h===-1?u(y,w):h},f=(y,w,h,k,S)=>S?{fromLane:y,toLane:w,color:h,kind:k,indirect:!0}:{fromLane:y,toLane:w,color:h,kind:k};for(let y=0;y<e.length;y++){let w=e[y],h=n===void 0?void 0:n[y],k=h===void 0?w.parents.length:h.length,S=L=>h===void 0?w.parents[L]:h[L].hash,T=L=>h!==void 0&&h[L].indirect,D=g(w.hash),G=D!==-1,E=D===-1?u(w.hash,!1):D,O=i[E],I=[...a],ee=[...i],J=[...s],B=w.parents.length>=2;for(let L=0;L<a.length;L++)L!==E&&a[L]===w.hash&&(c(i[L]),a[L]=null,i[L]=null);let F=-1,ae=[];if(k===0)c(i[E]),a[E]=null,i[E]=null;else{let L=S(0),Y=T(0),ie=t==="compact"?a.findIndex((ne,H)=>ne===L&&H!==E&&s[H]===Y):-1;if(ie===-1)a[E]=L,s[E]=Y,F=E;else{let ne=Math.min(E,ie),H=Math.max(E,ie);a[ne]=L,s[ne]=Y,c(i[H]),a[H]=null,i[H]=null,F=ne}for(let ne=1;ne<k;ne++)ae.push(b(S(ne),T(ne)))}let le=[];for(let L=0;L<I.length;L++){let Y=I[L];if(Y!==null)if(Y===w.hash){if(L===E&&!G)continue;le.push(f(L,E,ee[L],"into",J[L]))}else{let ie=a[L]===Y?L:a.findIndex((ne,H)=>ne===Y&&s[H]===J[L]);ie!==-1&&le.push(f(L,ie,ee[L],"pass",J[L]))}}F!==-1&&le.push(f(E,F,i[F],"out",s[F]));for(let L of ae)le.push(f(E,L,i[L],"out",s[L]));for(r.push({commit:w,lane:E,color:O,edges:le,merge:B});a.length>0&&a[a.length-1]===null;)a=a.slice(0,-1),i=i.slice(0,-1),s=s.slice(0,-1)}return r}var Qa=4096,jo=1e6,Wo=1e5;function Ya(e,t,n){let r=new Map;for(let f of t)r.set(f.hash,f.parents);let a=new Map;e.forEach((f,y)=>a.set(f.hash,y));let i=Math.min(Qa,a.size),s=new Map,o=0,l=f=>{let y=s.get(f);if(y!==void 0)return y;let w=[{hash:f,expanded:!1}],h=new Set,k=[];for(;w.length>0;){let S=w[w.length-1];if(!S.expanded){S.expanded=!0,h.add(S.hash);let T=r.get(S.hash);for(let D=T.length-1;D>=0;D--){let G=T[D];a.has(G)||!r.has(G)||h.has(G)||s.has(G)||w.push({hash:G,expanded:!1})}continue}k.push(S.hash),w.pop()}for(let S of k){if(s.has(S))continue;let T=r.get(S),D,G=T.length>0;for(let J of T){if(a.has(J)){G=!1;break}let B=s.get(J);if(B===void 0){G=!1;break}if(D===void 0)D=B;else if(D!==B){G=!1;break}}if(G&&D!==void 0){s.set(S,D);continue}let E=[],O=new Set,I=!1,ee=J=>{if(!O.has(J)){if(E.length>=i||o>=jo){I=!0;return}O.add(J),E.push(J),o++}};for(let J of T){if(a.has(J)){ee(J);continue}let B=s.get(J);if(B===void 0){I=!0;continue}for(let F of B.ancestors)ee(F);B.unknown&&(I=!0)}s.set(S,{ancestors:E,unknown:I})}return s.get(f)},d=Qa,c=Wo,u=[],g=[];for(let f=0;f<e.length;f++){let w=e[f].parents,h=[],k=new Map,S=!1,T=G=>{let E=a.get(G);return E!==void 0&&E>f},D=(G,E)=>{let O=k.get(G);if(O===void 0){let I=a.get(G)-f+1;if(d===0||c<I){S=!0;return}d--,c-=I,k.set(G,h.length),h.push({hash:G,indirect:E})}else!E&&h[O].indirect&&(h[O]={hash:G,indirect:!1})};for(let G of w){if(a.has(G)){T(G)?D(G,!1):S=!0;continue}if(!r.has(G)){S=!0;continue}let E=l(G);(E.ancestors.length===0||E.unknown)&&(S=!0);for(let O of E.ancestors)T(O)?D(O,!0):S=!0}u.push(h),g.push(S)}let b=In(e,n,u);return g.some(f=>f)?b.map((f,y)=>g[y]===!0?{...f,boundary:!0}:f):b}var Xe=require("react"),Ot=14,On=["#4e9bff","#3fb950","#e0982e","#d05ce3","#e5534b","#2dc6c6","#d29922","#8b949e"];function Za({row:e,laneCount:t,rowH:n,current:r}){let a=(0,Xe.useId)(),i=Math.max(Ot,t*Ot),s=c=>c*Ot+Ot/2,o=n/2,l=On[e.color%On.length],d=e.edges.map(c=>{let u=c.kind==="out"?o:0,g=c.kind==="into"?o:n,b=(u+g)/2;return(0,Xe.createElement)("path",{key:`${c.kind}-${c.fromLane}-${c.toLane}-${c.color}`,className:"gp-graph-edge",d:`M ${s(c.fromLane)} ${u} C ${s(c.fromLane)} ${b}, ${s(c.toLane)} ${b}, ${s(c.toLane)} ${g}`,stroke:On[c.color%On.length],strokeWidth:1.6,fill:"none",...c.indirect?{strokeDasharray:"7 5","data-indirect":"true"}:{}})});if(e.boundary){let c=s(e.lane)+(e.edges.some(u=>u.kind==="out")?5:0);d.push((0,Xe.createElement)("path",{key:"boundary",className:"gp-graph-boundary",d:`M ${s(e.lane)} ${o} L ${c} ${o+7} V ${Math.min(n-3,o+13)}`,stroke:l,strokeWidth:1.6,strokeDasharray:"3 3",fill:"none"}))}return(0,Xe.createElement)("svg",{className:"gp-graph-svg",width:i,height:n,"aria-hidden":!0},[r?(0,Xe.createElement)("defs",{key:"defs"},(0,Xe.createElement)("mask",{id:a,maskUnits:"userSpaceOnUse",x:0,y:0,width:i,height:n},[(0,Xe.createElement)("rect",{key:"area",x:0,y:0,width:i,height:n,fill:"white"}),(0,Xe.createElement)("circle",{key:"hole",cx:s(e.lane),cy:o,r:6.2,fill:"black"})])):null,(0,Xe.createElement)("g",{key:"edges",...r?{mask:`url(#${a})`}:{}},d),(0,Xe.createElement)("circle",{key:"node",className:`gp-graph-node${r?" gp-graph-node--current":""}`,cx:s(e.lane),cy:o,r:r?5.2:e.merge?4:3.2,fill:r?"none":l,stroke:r?l:"var(--dsw-alias-bg-layer-1)",strokeWidth:r?2:1}),r?(0,Xe.createElement)("circle",{key:"head-dot",className:"gp-graph-node__dot",cx:s(e.lane),cy:o,r:2.2,fill:l}):null])}function Qo(e){return/^[0-9a-fA-F]{7,40}$/.test(e.trim())}function Rr(e){let t=e.search?.trim()??"";return!Qo(t)&&(t!==""||(e.author??"")!==""||(e.since??"")!=="")}var Xn=10*1024*1024,$e={maxBytes:{min:16*1024,max:512*1024,default:200*1024},maxOutputTokens:{min:256,max:16384,default:4096},timeoutMs:{min:5e3,max:12e4,default:15e3}},$n=["auto","zh","en"],Pr="auto",Yo={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff"};function Sn(e){let t=e.lastIndexOf(".");return t<0?null:Yo[e.slice(t+1).toLowerCase()]??null}function Jn(e){let t=[],n=new Set;for(let i of e){let s=i.name.split("/").filter(l=>l!=="");if(s.length===0)continue;t.push({segments:s,branch:i});let o="";for(let l=0;l<s.length-1;l++)o=o===""?s[l]:`${o}/${s[l]}`,n.add(o)}let r=new Map,a=[];for(let{segments:i,branch:s}of t){let o=i.join("/"),l=n.has(o),d=a,c="";for(let u=0;u<i.length;u++){let g=i[u];c=c===""?g:`${c}/${g}`;let b=u===i.length-1;if(b&&!l){d.push({kind:"leaf",label:g,path:o,branch:s});break}let f=r.get(c);f===void 0&&(f={kind:"dir",label:g,path:c,self:null,children:[]},r.set(c,f),d.push(f)),b?f.self=s:d=f.children}}return ei(a)}function ei(e){return e.map(t=>{if(t.kind==="leaf")return t;let n=t;for(;;){let r=n.children.length===1?n.children[0]:void 0;if(n.self!==null||r===void 0||r.kind!=="dir")break;n={kind:"dir",label:`${n.label}/${r.label}`,path:r.path,self:r.self,children:r.children}}return{kind:"dir",label:n.label,path:n.path,self:n.self,children:ei(n.children)}})}function ti(e,t){let n=r=>e.some(a=>a.name===r);return t!==null&&n(t)?t:n("main")?"main":n("master")?"master":null}function ni(e,t){if(t===null)return e;let n=e.findIndex(r=>r.name===t);return n<=0?e:[e[n],...e.slice(0,n),...e.slice(n+1)]}function ri(e,t,n){if(t===null)return null;let r=n===null?["main","master"]:[n,"main","master"];for(let a of r){let i=`${t}/${a}`;if(e.some(s=>s.name===i))return i}return null}function ai(e,t,n){let r=[],a=s=>{if(s===null||r.some(l=>l.name===s))return;let o=e.find(l=>l.name===s);o!==void 0&&r.push(o)};a(t),a(n);let i=new Set(r.map(s=>s.name));return{pinned:r,nodes:Jn(e.filter(s=>!i.has(s.name)))}}function ii(e){let t={name:"",path:"",dir:!0,children:[]};for(let n of e){let r=n.path.split("/").filter(s=>s!==""),a=t,i="";for(let s=0;s<r.length;s++){let o=r[s];i=i===""?o:`${i}/${o}`;let l=s===r.length-1,d=a.children.find(c=>c.name===o&&c.dir===!l);d===void 0&&(d={name:o,path:i,dir:!l,children:[],...l?{meta:n.meta}:{}},a.children.push(d)),a=d}}return oi(t),si(t.children)}function oi(e){e.children.sort((t,n)=>t.dir!==n.dir?t.dir?-1:1:t.name.localeCompare(n.name));for(let t of e.children)oi(t)}function si(e){return e.map(t=>{if(!t.dir)return t;let n=t;for(;n.children.length===1&&n.children[0].dir;){let r=n.children[0];n={name:`${n.name}/${r.name}`,path:r.path,dir:!0,children:r.children}}return{...n,children:si(n.children)}})}function Ct(e,t,n){if(e===null)return"";let r=typeof e=="number"?e:Date.parse(e);if(!Number.isFinite(r))return"";let a=Math.max(0,t-r),i=Math.floor(a/6e4);if(i<1)return n("time.justNow");if(i<60)return n("time.minutesAgo",{n:i});let s=Math.floor(i/60);if(s<24)return n("time.hoursAgo",{n:s});let o=Math.floor(s/24);return n("time.daysAgo",{n:o})}function Cn(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Tn(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var Kn={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"U",conflicted:"!",typechange:"T"};function nn(e){return e==="added"||e==="untracked"?"gp-status--added":e==="deleted"?"gp-status--deleted":e==="renamed"?"gp-status--renamed":"gp-status--modified"}function li(e,t){return e.some(n=>n.status==="untracked"&&(n.isDirectory?t.startsWith(`${n.path}/`):n.path===t))}var R=require("react");function di(e){return/^Binary files .* differ$/m.test(e)||/^GIT binary patch$/m.test(e)}function ci(e){return Sn(e)!==null}function pi(e){return/\.svg$/i.test(e)}function Zo(e){let t=e.split(`
788
+ `),n=[],r=!1;for(let a of t){if(a.startsWith("@@")){r=!0;continue}if(r){if(a.startsWith("diff ")||a.startsWith("index ")){r=!1;continue}a!==""&&n.push(a)}}return n}function ui(e){let t=0,n=0;for(let r of Zo(e))r.startsWith("+")?t++:r.startsWith("-")&&n++;return{add:t,del:n}}var es=/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function gi(e,t){let n=[],r=e.split(`
789
+ `),a=Number.isFinite(t)&&t>0?t:0,i=0,s=0,o=!0,l=!1,d=0;for(;d<r.length&&!r[d].startsWith("@@");d++);for(;d<r.length;d++){let u=r[d];if(u.startsWith("@@")){let f=es.exec(u);if(f){let y=Number(f[1]),w=Number(f[3]),h=y-w;if(o)w>1&&n.push(Xt({rightStart:1,count:w-1,delta:h,atStart:!0}));else{let k=w-s;k>0&&n.push(Xt({rightStart:s,count:k,delta:h,atStart:!1}))}i=y,s=w,o=!1}n.push({kind:"hunk",leftNo:null,rightNo:null,leftText:null,rightText:null,text:u});continue}if(u.startsWith("\\"))continue;let g=u[0],b=u.slice(1);g==="+"?(n.push({kind:"add",leftNo:null,rightNo:s,leftText:null,rightText:b}),s++,l=!0):g==="-"?(n.push({kind:"del",leftNo:i,rightNo:null,leftText:b,rightText:null}),i++,l=!0):g===" "&&(n.push({kind:"context",leftNo:i,rightNo:s,leftText:b,rightText:b}),i++,s++,l=!0)}let c=a-s+1;return l&&!o&&s>0&&c>0&&n.push(Xt({rightStart:s,count:c,delta:i-s,atStart:!1})),ts(n)}function fi(e,t){let n=e[e.length-1],r=n!==void 0&&n.kind==="gap",a=r?n.gap:void 0,i=r?e[e.length-2]:n,s=i===void 0?null:i.rightNo,o=s!==null&&s>0?s:0,l=Number.isFinite(t)?t-o:0,d=l>0?l:0;if(a===void 0){if(d===0||o===0)return e;let c=i===void 0?null:i.leftNo;return c===null?null:[...e,Xt({rightStart:o+1,count:d,delta:c-o,atStart:!1})]}return a.rightStart===o+1&&a.count===d?e:d===0?e.slice(0,-1):[...e.slice(0,-1),Xt({rightStart:o+1,count:d,delta:a.delta,atStart:!1})]}function Xt(e){return{kind:"gap",leftNo:null,rightNo:null,leftText:null,rightText:null,gap:e}}function ts(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind==="del"){let a=[],i=n;for(;i<e.length&&e[i].kind==="del";)a.push(e[i]),i++;let s=[];for(;i<e.length&&e[i].kind==="add";)s.push(e[i]),i++;let o=Math.max(a.length,s.length);for(let l=0;l<o;l++){let d=a[l],c=s[l];if(d&&c){let u=ns(d.leftText??"",c.rightText??"");t.push({kind:"mod",leftNo:d.leftNo,rightNo:c.rightNo,leftText:d.leftText,rightText:c.rightText,...u!==null?{leftWord:u.left,rightWord:u.right}:{}})}else d?t.push({kind:"del",leftNo:d.leftNo,rightNo:null,leftText:d.leftText,rightText:null}):c&&t.push({kind:"add",leftNo:null,rightNo:c.rightNo,leftText:null,rightText:c.rightText})}n=i}else t.push(r),n++}return t}function ns(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let a=0;for(;a<n-r&&e[e.length-1-a]===t[t.length-1-a];)a++;return r===0&&a===0?null:{left:[r,e.length-a],right:[r,t.length-a]}}function rs(e,t,n){return n.map((r,a)=>{let i=t+a;return{kind:"context",leftNo:i+e,rightNo:i,leftText:r,rightText:r}})}var $t=20;function mi(e){let t=[];for(let n of e)n.kind==="mod"?(t.push({kind:"del",leftNo:n.leftNo,rightNo:null,leftText:n.leftText,rightText:null,...n.leftWord!==void 0?{leftWord:n.leftWord}:{}}),t.push({kind:"add",leftNo:null,rightNo:n.rightNo,leftText:null,rightText:n.rightText,...n.rightWord!==void 0?{rightWord:n.rightWord}:{}})):t.push(n);return t}function hi(e,t,n,r,a,i){let s=e.findIndex(u=>u.kind==="gap"&&u.gap?.rightStart===t);if(s<0)return e.slice();let o=e[s].gap,l=rs(o.delta,r,a),d=[],c=o.count;if(n==="all"||a.length>=c)d.push(...l);else if(n==="down")d.push(...l),i||d.push(Xt({rightStart:o.rightStart+a.length,count:c-a.length,delta:o.delta,atStart:!1}));else{if(a.length===0)return[...e.slice(0,s),...e.slice(s+1)];let u=c-a.length;d.push(Xt({rightStart:o.rightStart,count:u,delta:o.delta,atStart:o.atStart})),d.push(...l)}return[...e.slice(0,s),...d,...e.slice(s+1)]}var ar=require("@deepseek-ai/dsh-client-ui-primitives");function yi(e,t){let n=[[],[],[]],r=0;for(let a of e){let i=r+a.text.length,s=[r,Math.max(r,Math.min(i,t[0])),Math.max(r,Math.min(i,t[1])),i];for(let o=0;o<3;o++){let l=a.text.slice(s[o]-r,s[o+1]-r);l!==""&&n[o].push({text:l,style:a.style})}r=i}return n}function bi(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.size>=8e3&&t.clear(),t.set(n,r),r}}function rn(e){let t=new Array(e.length+1);t[0]=0;for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t}function vi(e,t){let n=0,r=e.length-1;for(;n<r;){let a=n+r+1>>1;e[a]<=t?n=a:r=a-1}return n}function an(e,t,n,r){let a=e.length-1;if(a<=0)return{first:0,last:0};let i=vi(e,t-r),s=Math.min(a,vi(e,t+n+r)+1);return{first:i,last:s}}function Vn(e,t,n,r){return t<0?e:t>=e.first&&t<e.last?{first:Math.min(e.first,Math.max(0,t-r)),last:Math.max(e.last,Math.min(n,t+r))}:{first:Math.max(0,t-r),last:Math.min(n,t+r)}}var Jt=require("react");function on(){let[e,t]=(0,Jt.useState)({top:0,height:0}),n=(0,Jt.useRef)(null),r=(0,Jt.useRef)(null);return{setEl:(0,Jt.useCallback)(i=>{if(r.current!==null&&(r.current(),r.current=null),n.current=i,i===null)return;let s=()=>t(l=>{let d=i.scrollTop,c=i.clientHeight;return l.top===d&&l.height===c?l:{top:d,height:c}});s(),i.addEventListener("scroll",s,{passive:!0});let o=typeof ResizeObserver<"u"?new ResizeObserver(s):null;o?.observe(i),r.current=()=>{i.removeEventListener("scroll",s),o?.disconnect()}},[]),viewport:e,elRef:n}}var Oe=require("react"),qn=5e3,Un=120;function jn(e,t){let[n,r]=(0,Oe.useState)(e);return(0,Oe.useEffect)(()=>{let a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}function Wn(e,t){if(t==="")return[];let n=[],r=0;for(;;){let a=e.indexOf(t,r);if(a<0)break;n.push([a,a+t.length]),r=a+t.length}return n}function Lr(e,t,n,r,a){if(n>=r)return[];if(e===void 0)return[t.slice(n,r)];let i=[],s=0,o=0;for(let l of e){let d=s+l.text.length,c=Math.max(n,s),u=Math.min(r,d);if(u>c&&i.push((0,Oe.createElement)("span",{key:`${a}-${o++}`,style:l.style},l.text.slice(c-s,u-s))),s=d,s>=r)break}return i}function Qn(e,t,n,r,a,i){let s=[],o=0,l=[...t].sort((d,c)=>d[0]-c[0]);for(let[d,c]of l){if(d<o)continue;d>o&&s.push(...Lr(n,e,o,d,`${r}b${o}`));let u=a!==null&&a[0]===d&&a[1]===c;s.push((0,Oe.createElement)("mark",{key:`mk${r}-${d}`,className:`gp-find-hit${u?" gp-find-hit--active":""}`,...u?{ref:i}:{}},Lr(n,e,d,c,`mk${r}-${d}`))),o=c}return o<e.length&&s.push(...Lr(n,e,o,e.length,`${r}e`)),s}function Yn(e){return(0,Oe.createElement)("div",{key:"find",className:"gp-find"},[(0,Oe.createElement)("input",{key:"in",ref:e.inputRef,className:"gp-find__input",type:"text",placeholder:e.t("files.findPlaceholder"),value:e.query,spellCheck:!1,"aria-label":e.t("files.findPlaceholder"),onChange:t=>e.onChange(t.target.value),onKeyDown:t=>{t.key==="Escape"?(t.preventDefault(),t.stopPropagation(),e.onClose()):t.key==="Enter"&&(t.preventDefault(),e.onStep(t.shiftKey?-1:1))}}),(0,Oe.createElement)("button",{key:"case",type:"button",className:`gp-find__btn gp-find__case${e.caseSensitive?" gp-find__case--active":""}`,title:e.t("files.findCase"),"aria-label":e.t("files.findCase"),"aria-pressed":e.caseSensitive,onClick:()=>e.onToggleCase()},"Aa"),(0,Oe.createElement)("span",{key:"cnt",className:"gp-find__count"},e.query===""?"":e.matches===0?e.t("files.findNoMatch"):`${e.active+1}/${e.matches}`),(0,Oe.createElement)("button",{key:"prev",type:"button",className:"gp-find__btn",title:e.t("files.findPrev"),"aria-label":e.t("files.findPrev"),disabled:e.matches===0,onClick:()=>e.onStep(-1)},"\u2039"),(0,Oe.createElement)("button",{key:"next",type:"button",className:"gp-find__btn",title:e.t("files.findNext"),"aria-label":e.t("files.findNext"),disabled:e.matches===0,onClick:()=>e.onStep(1)},"\u203A"),(0,Oe.createElement)("button",{key:"x",type:"button",className:"gp-find__btn",title:e.t("files.findClose"),"aria-label":e.t("files.findClose"),onClick:()=>e.onClose()},"\u2715")])}var Tt=require("react");var W=require("react");var sn=require("react"),as='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function Zn(e,t,n){let r=(0,sn.useRef)(t);(0,sn.useLayoutEffect)(()=>{r.current=t}),(0,sn.useEffect)(()=>{let a=document.activeElement instanceof HTMLElement?document.activeElement:null;n?.current?.focus();let i=()=>{let o=e.current;return o===null?[]:[...o.querySelectorAll(as)].filter(l=>!l.hasAttribute("disabled")&&l.getClientRects().length>0)},s=o=>{if(o.key==="Escape"){o.stopPropagation(),r.current();return}if(o.key!=="Tab")return;let l=i();if(l.length===0)return;let d=document.activeElement instanceof HTMLElement?document.activeElement:null,c=d===null?-1:l.indexOf(d);o.preventDefault();let u=o.shiftKey?-1:1,g=c===-1?u===-1?l.length-1:0:(c+u+l.length)%l.length;l[g]?.focus()};return window.addEventListener("keydown",s,!0),()=>{window.removeEventListener("keydown",s,!0),a?.focus()}},[e,n])}var Ti=require("react-dom");function xi(e){let t=e.deltaMode===1?8:e.deltaMode===2?24:1;return Math.sign(e.deltaY)*Math.min(24,Math.abs(e.deltaY*t))}function ki(e){let t=Math.sign(e)*Math.min(24,Math.abs(e));return t<=0?1-2*t/100:1/(1+2*t/100)}var is=.1,os=8,Dr=1.25;function _i(e){return Number.isFinite(e)?Math.min(os,Math.max(is,e)):1}function Ar(e,t,n){return(e+t)*n-t}var wi=3;function Si(e,t){return e*e+t*t>=wi*wi}function Ci(e,t,n,r){return{left:e-n,top:t-r}}var ss=300;function Nn({src:e,alt:t,t:n,viewportClass:r,fullscreen:a=!0,onEmptyAreaMouseDown:i}){let s=(0,W.useRef)(null),o=(0,W.useRef)(null),l=(0,W.useRef)(null),[d,c]=(0,W.useState)(null),[u,g]=(0,W.useState)("fit"),[b,f]=(0,W.useState)(null),[y,w]=(0,W.useState)(!1),[h,k]=(0,W.useState)(!1),S=(0,W.useRef)("fit"),T=(0,W.useRef)(null),D=(0,W.useRef)(null),G=(0,W.useRef)(null),E=(0,W.useRef)(0),O=(0,W.useCallback)(()=>{let N=l.current;return N===null||N.naturalWidth===0||N.clientWidth===0?null:N.clientWidth/N.naturalWidth},[]),I=(0,W.useCallback)((N,P,Q)=>{let z=o.current,_=l.current;if(z===null||_===null||_.naturalWidth===0||_.clientWidth===0)return;let j=_.clientWidth/_.naturalWidth,V=_i(N);if(V===j)return;let oe=z.getBoundingClientRect();T.current={x:P-oe.left,y:Q-oe.top,ratio:V/j},g(V)},[]),ee=(0,W.useCallback)(N=>{let P=o.current,Q=O();if(P===null||Q===null)return;let z=P.getBoundingClientRect();I(Q*N,z.left+z.width/2,z.top+z.height/2)},[O,I]),J=(0,W.useCallback)(()=>{let N=o.current;if(N===null)return;let P=N.getBoundingClientRect();I(1,P.left+P.width/2,P.top+P.height/2)},[I]),B=(0,W.useCallback)(()=>{g("fit")},[]),F=(0,W.useCallback)(()=>{let N=l.current;N===null||N.naturalWidth===0||N.clientWidth===0||f(Math.round(N.clientWidth/N.naturalWidth*100))},[]);(0,W.useLayoutEffect)(()=>{S.current=u,u==="fit"&&F();let N=T.current;T.current=null;let P=o.current;N===null||P===null||(P.scrollLeft=Ar(P.scrollLeft,N.x,N.ratio),P.scrollTop=Ar(P.scrollTop,N.y,N.ratio))},[u,F]),(0,W.useEffect)(()=>{S.current="fit",T.current=null,D.current=null,g("fit"),c(null),f(null)},[e]),(0,W.useEffect)(()=>{let N=s.current;if(N===null)return;let P=j=>{if(!j.ctrlKey)return;j.cancelable&&j.preventDefault();let V=l.current;if(V===null||!V.complete||V.naturalWidth===0)return;let oe=O();oe!==null&&I(oe*ki(xi(j)),j.clientX,j.clientY)},Q=j=>{let V=j,oe=O();oe!==null&&(V.cancelable&&V.preventDefault(),D.current={base:oe,x:V.clientX,y:V.clientY})},z=j=>{let V=j,oe=D.current;oe!==null&&(V.cancelable&&V.preventDefault(),I(oe.base*V.scale,oe.x,oe.y))},_=()=>{D.current=null};return N.addEventListener("wheel",P,{passive:!1}),N.addEventListener("gesturestart",Q,{passive:!1}),N.addEventListener("gesturechange",z,{passive:!1}),N.addEventListener("gestureend",_),()=>{N.removeEventListener("wheel",P),N.removeEventListener("gesturestart",Q),N.removeEventListener("gesturechange",z),N.removeEventListener("gestureend",_)}},[O,I]);let ae=(0,W.useCallback)(N=>{if(N.button!==0||N.pointerType!=="mouse")return;let P=o.current;if(P===null)return;let{offsetX:Q,offsetY:z}=N.nativeEvent;N.target===P&&(Q>=P.clientWidth||z>=P.clientHeight)||(G.current={id:N.pointerId,x:N.clientX,y:N.clientY,left:P.scrollLeft,top:P.scrollTop,pan:P.scrollWidth>P.clientWidth||P.scrollHeight>P.clientHeight,moved:!1})},[]);(0,W.useEffect)(()=>{let N=z=>{let _=G.current;_===null||z!==_.id||(_.moved&&(E.current=performance.now()),G.current=null,k(!1))},P=z=>{let _=G.current;if(_===null||z.pointerId!==_.id)return;if(z.buttons===0){N(z.pointerId);return}let j=z.clientX-_.x,V=z.clientY-_.y;if(!_.moved){if(!Si(j,V))return;_.moved=!0,k(!0)}let oe=o.current;if(oe===null||!_.pan)return;let Ge=Ci(_.left,_.top,j,V);oe.scrollLeft=Ge.left,oe.scrollTop=Ge.top},Q=z=>{N(z.pointerId)};return window.addEventListener("pointermove",P),window.addEventListener("pointerup",Q),window.addEventListener("pointercancel",Q),()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",Q),window.removeEventListener("pointercancel",Q)}},[]),(0,W.useEffect)(()=>{let N=o.current;if(N===null||typeof ResizeObserver>"u")return;let P=new ResizeObserver(()=>{S.current==="fit"&&F()});return P.observe(N),()=>P.disconnect()},[F]);let le=(0,W.useCallback)(()=>{let N=l.current;N!==null&&(c({w:N.naturalWidth,h:N.naturalHeight}),S.current==="fit"&&F())},[F]),L=(0,W.useCallback)(()=>{performance.now()-E.current<ss||(u==="fit"?J():B())},[u,J,B]),Y=(0,W.useCallback)(()=>{w(!1)},[]),ie=u==="fit"?b!==null?`${b}%`:"\u2014":`${Math.round(u*100)}%`,ne=u!=="fit"&&d!==null?{width:`${d.w*u}px`,maxWidth:"none",maxHeight:"none"}:void 0,H=d!==null?(0,W.createElement)("div",{key:"bar",className:"gp-zoom__bar",role:"group","aria-label":n("files.zoomBar")},[(0,W.createElement)("button",{key:"out",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomOut"),title:n("files.zoomOut"),onClick:()=>ee(1/Dr)},"\u2212"),(0,W.createElement)("button",{key:"pct",type:"button",className:"gp-zoom__btn gp-zoom__pct","aria-label":`${ie}\uFF0C${n("files.zoomActual")}`,title:n("files.zoomActual"),onClick:J},ie),(0,W.createElement)("button",{key:"in",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomIn"),title:n("files.zoomIn"),onClick:()=>ee(Dr)},"+"),(0,W.createElement)("button",{key:"fit",type:"button",className:"gp-zoom__btn gp-zoom__btn--text","aria-pressed":u==="fit",onClick:B},n("files.zoomFit")),a?(0,W.createElement)("button",{key:"fs",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomFullscreen"),title:n("files.zoomFullscreen"),onClick:()=>w(!0)},"\u2921"):null]):null;return(0,W.createElement)("div",{className:"gp-zoom",ref:s,"data-zoomed":u==="fit"?void 0:"true","data-dragging":h?"true":void 0},[(0,W.createElement)("div",{key:"vp",className:`gp-zoom__scroll ${r}`,ref:o,onPointerDown:ae,onMouseDown:i===void 0?void 0:N=>{N.target===N.currentTarget&&i()}},(0,W.createElement)("img",{key:"img",ref:l,className:"gp-zoom__img",src:e,alt:t,style:ne,draggable:!1,onLoad:le,onDoubleClick:L})),H,y?(0,W.createElement)(ls,{key:"lb",src:e,alt:t,t:n,onClose:Y}):null])}function ls({src:e,alt:t,t:n,onClose:r}){let a=(0,W.useRef)(null),i=(0,W.useRef)(null);return Zn(a,r,i),(0,Ti.createPortal)((0,W.createElement)("div",{className:"gp-zl-backdrop",ref:a,role:"dialog","aria-modal":"true","aria-label":n("files.zoomFullscreen")},[(0,W.createElement)("div",{key:"stage",className:"gp-zl-stage"},[(0,W.createElement)("div",{key:"mask",className:"gp-zl-mask","aria-hidden":"true",onMouseDown:r}),(0,W.createElement)("div",{key:"frame",className:"gp-zl-frame"},(0,W.createElement)(Nn,{src:e,alt:t,t:n,viewportClass:"gp-zl-viewport",fullscreen:!1,onEmptyAreaMouseDown:r})),(0,W.createElement)("button",{key:"close",ref:i,type:"button",className:"gp-zl-close","aria-label":n("common.close"),onClick:r},(0,W.createElement)(We,{size:16}))])]),document.body)}function er(e,t,n){let r=n(`diff.${e}`);return(0,Tt.createElement)("div",{className:`gp-imgcmp__pane gp-imgcmp__pane--${e}`},[(0,Tt.createElement)("div",{key:"head",className:"gp-imgcmp__head"},r),t===void 0?(0,Tt.createElement)("div",{key:"missing",className:"gp-imgcmp__missing"},n("diff.imageMissing")):(0,Tt.createElement)(Nn,{key:"img",src:t,alt:r,t:n,viewportClass:"gp-imgcmp__img"})])}function Ni({oldUrl:e,newUrl:t,mode:n,t:r}){return n==="before"?(0,Tt.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},er("before",e,r)):n==="after"?(0,Tt.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},er("after",t,r)):(0,Tt.createElement)("div",{className:"gp-imgcmp"},[er("before",e,r),er("after",t,r)])}var Ei=require("react");var pt=require("react");function Nt(e,t,n,r){let a=JSON.stringify(e),i=(0,pt.useRef)({key:a,visible:t,load:n,onError:r});i.current={key:a,visible:t,load:n,onError:r};let s=(0,pt.useRef)(!0),o=(0,pt.useRef)(0),l=(0,pt.useRef)(null);(0,pt.useEffect)(()=>(s.current=!0,()=>{s.current=!1,o.current+=1,l.current=null}),[]);let d=(0,pt.useCallback)(()=>{let c=i.current;if(!s.current||!c.visible||!Ie.isVisible())return Promise.resolve();if(l.current?.key===c.key)return l.current.promise;let u=++o.current,g=()=>s.current&&u===o.current&&i.current.key===c.key,b=()=>g()&&i.current.visible&&Ie.isVisible(),f=c.load(g,b).catch(()=>{g()&&c.onError()}).finally(()=>{l.current?.promise===f&&(l.current=null)});return l.current={key:c.key,promise:f},f},[]);return(0,pt.useEffect)(()=>{t&&d()},[a,t,d]),d}function Gi(e,t,n,r,a,i){let s=[t,n,r,a],[o,l]=(0,Ei.useState)({queryKey:s,value:{kind:"idle"}}),d=c=>c.length===s.length&&c.every((u,g)=>u===s[g]);return Nt(s,i&&e!==void 0&&t!==void 0&&n!==void 0&&r!==void 0,async c=>{if(e===void 0||t===void 0||n===void 0||r===void 0)return;l(f=>d(f.queryKey)&&f.value.kind==="ready"?f:{queryKey:s,value:{kind:"loading"}});let u=r==="commit"&&a!==void 0?{kind:"image-diff",path:n,base:"commit",commit:a}:r==="staged"?{kind:"image-diff",path:n,base:"staged"}:{kind:"image-diff",path:n,base:"worktree"},g=await e.query({sessionId:t,query:u});if(!c())return;let b=be(g,"image-diff");l({queryKey:s,value:b!==null?{kind:"ready",res:b}:{kind:"failed"}})},()=>l({queryKey:s,value:{kind:"failed"}})),d(o.queryKey)?o.value:{kind:"idle"}}var yt=require("react");function bt({text:e,closeLabel:t,onClose:n,status:r=!1}){return(0,yt.createElement)("div",{className:"gp-notice",...r?{role:"status"}:{}},[(0,yt.createElement)("span",{key:"txt",className:"gp-notice__text"},e),(0,yt.createElement)("button",{key:"close",type:"button",className:"gp-notice__close",title:t,"aria-label":t,onClick:n},(0,yt.createElement)(We,{key:"i",size:12}))])}function tr(){let[e,t]=(0,yt.useState)(()=>new Set);return(0,yt.useMemo)(()=>({isDismissed:n=>e.has(n),dismiss:n=>t(r=>r.has(n)?r:new Set(r).add(n))}),[e])}var zr=20,ds=27,cs=29,Mi=12,ps=600,ir=(0,R.memo)(function({visible:t=!0,text:n,mode:r,path:a,remote:i,sessionId:s,base:o,commit:l,expanded:d,truncated:c,newLines:u,t:g}){let b=tr(),f=(0,R.useMemo)(()=>gi(n,u),[n,u]),y=di(n),w=(0,ar.useCodeHighlighter)(a===void 0?void 0:(0,ar.languageForPath)(a)),h=(0,R.useMemo)(()=>bi(w),[w]),[k,S]=(0,R.useState)(f),T=(0,R.useRef)(n);(0,R.useEffect)(()=>{if(T.current!==n){T.current=n,S(f);return}S(te=>fi(te,u)??f)},[n,u,f]);let D=ms(k,S,i,s,a,o,l),G=a!==void 0&&pi(a),[E,O]=(0,R.useState)("render");(0,R.useEffect)(()=>{O("render")},[a]);let ee=(y||G)&&a!==void 0&&ci(a)&&i!==void 0&&s!==void 0&&o!==void 0&&(!G||E==="render"),J=Gi(ee?i:void 0,ee?s:void 0,ee?a:void 0,ee?o:void 0,ee?l:void 0,t),[B,F]=(0,R.useState)(!1),[ae,le]=(0,R.useState)(""),[L,Y]=(0,R.useState)(!1),[ie,ne]=(0,R.useState)(0),H=(0,R.useRef)(null),N=(0,R.useRef)(null),P=(0,R.useRef)(null);(0,R.useEffect)(()=>{F(!1),le(""),ne(0)},[n,a]);let Q=(0,R.useMemo)(()=>r==="unified"?mi(k):null,[r,k]),z=(0,R.useMemo)(()=>r==="before"?ys(k):r==="after"?bs(k):null,[r,k]),_=(0,R.useMemo)(()=>gs(k,Q,z),[k,Q,z]),j=(0,R.useMemo)(()=>_.map(te=>({key:te.key,text:te.text.toLowerCase()})),[_]),V=jn(ae,Un),oe=L?V:V.toLowerCase(),Ge=L?_:j,ye=(0,R.useMemo)(()=>fs(Ge,oe),[Ge,oe]);(0,R.useEffect)(()=>{ne(0)},[oe]);let Me=ye.length===0?0:Math.min(ie,ye.length-1),Pe=ye.length>0?ye[Me]:null,_e=Pe?.cellKey??null,Ae=Pe?.start??-1,C=(0,R.useMemo)(()=>{let te=new Map;for(let U of ye){let fe=te.get(U.cellKey)??[];fe.push([U.start,U.end]),te.set(U.cellKey,fe)}return te},[ye]);(0,R.useEffect)(()=>{if(_e===null)return;let te=requestAnimationFrame(()=>P.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(te)},[Me,ye,_e,Ae]);let ue=(0,R.useCallback)(te=>{ne(U=>ye.length===0?0:(U+te+ye.length)%ye.length)},[ye.length]);(0,R.useEffect)(()=>{let te=U=>{if(!((U.ctrlKey||U.metaKey)&&(U.key==="f"||U.key==="F")))return;let fe=H.current;fe===null||fe.offsetParent===null||(U.preventDefault(),F(!0),requestAnimationFrame(()=>N.current?.select()))};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[]);let{setEl:ge,viewport:pe,elRef:Se}=on(),Re=(0,R.useRef)(null),[Qe,ut]=(0,R.useState)(0),[Pt,gn]=(0,R.useState)(0),qe=(0,R.useRef)({mode:r,rows:k,heights:[]});(qe.current.mode!==r||qe.current.rows!==k)&&(qe.current={mode:r,rows:k,heights:[]});let wt=qe.current.heights,Ye=Q!==null?Q.length:z!==null?z.length:k.length,Fe=(0,R.useCallback)(te=>{let U=Q!==null?Q[te]??null:z===null?k[te]??null:null;return U===null?zr:U.kind==="hunk"?ds:U.kind==="gap"?cs:zr},[Q,z,k]),xt=(0,R.useMemo)(()=>{let te=new Array(Ye);for(let U=0;U<Ye;U++){let fe=wt[U];te[U]=fe!==void 0&&fe>0?fe:Fe(U)}return te},[Ye,wt,Fe,Pt]),rt=(0,R.useMemo)(()=>rn(xt),[xt]),Lt=pe.height>0?pe.height:ps,{first:at,last:it}=an(rt,Math.max(0,pe.top-Qe),Lt,Mi*zr),Ce=_e===null?-1:us(_e),{first:gt,last:kt}=Vn({first:at,last:it},Ce,Ye,Mi);if((0,R.useLayoutEffect)(()=>{let te=Re.current,U=Se.current;if(te===null||U===null)return;let fe=te.getBoundingClientRect().top-U.getBoundingClientRect().top+U.scrollTop;Math.abs(fe-Qe)>.5&&ut(fe);let Ze=new Map;for(let je of te.querySelectorAll("[data-r]")){let lt=Number(je.dataset.r),et=je.getBoundingClientRect().height;if(!Number.isFinite(et)||et<=0)continue;let ft=Ze.get(lt);(ft===void 0||et>ft)&&Ze.set(lt,et)}let St=!1;for(let[je,lt]of Ze){let et=wt[je];(et===void 0||Math.abs(et-lt)>.5)&&(wt[je]=lt,St=!0)}St&&gn(je=>je+1)}),ee){let te=(()=>{if(J.kind==="idle"||J.kind==="loading")return(0,R.createElement)("div",{className:"gp-empty"},g("common.loading"));if(J.kind==="ready"){let U=J.res;if(U.tooLarge===!0)return(0,R.createElement)("div",{className:"gp-empty"},g("diff.tooLarge"));if(U.mime!==null&&(U.old!==void 0||U.new!==void 0))return(0,R.createElement)(Ni,{oldUrl:U.old,newUrl:U.new,mode:r,t:g})}return(0,R.createElement)("div",{className:"gp-empty"},g("diff.binary"))})();return G?Ri(E,O,te,g):te}if(y&&!G)return(0,R.createElement)("div",{className:"gp-empty"},g("diff.binary"));let ot=B&&oe!==""?{perCell:C,activeKey:_e,activeRange:Pe!==null?[Pe.start,Pe.end]:null,activeRef:P}:null,Dt=(te,U)=>U>.5?(0,R.createElement)("div",{key:te,className:"gp-diff__spacer",style:{gridColumn:"1 / -1",height:`${U}px`}}):null,_t=Dt("lead",rt[gt]),st=Dt("tail",rt[Ye]-rt[kt]),At=(()=>{if(n.trim()==="")return(0,R.createElement)("div",{className:"gp-empty"},g("diff.empty"));if(z!==null){let U=[_t];for(let fe=gt;fe<kt;fe++){let Ze=z[fe];U.push((0,R.createElement)("div",{key:`n${fe}`,className:"gp-diff-no"},Ze.no??"")),U.push(rr("gp-diff-cell",`c${fe}`,Ze.text,h,ot,fe))}return U.push(st),(0,R.createElement)("div",{className:"gp-diff__single",ref:Re},U)}if(Q!==null){let U=[_t];for(let fe=gt;fe<kt;fe++)U.push(...ws(Q[fe],fe,h,D,ot,g));return U.push(st),(0,R.createElement)("div",{className:"gp-diff__unified",ref:Re},U)}let te=[_t];for(let U=gt;U<kt;U++)te.push(...vs(k[U],U,h,D,ot,g));return te.push(st),(0,R.createElement)("div",{className:"gp-diff__side",ref:Re},te)})(),re=B?(0,R.createElement)(Yn,{inputRef:N,query:ae,matches:ye.length,active:Me,caseSensitive:L,onChange:le,onToggleCase:()=>Y(te=>!te),onStep:ue,onClose:()=>F(!1),t:g}):null,Ue=d===!0&&k.some(te=>te.kind==="gap"),He=g("diff.truncated"),zt=g("diff.expandCapped",{n:2e3}),Le=te=>`${a??""}\0${te}`,Ft=(0,R.createElement)("div",{className:"gp-diff__wrap",ref:H},[re,c===!0&&!b.isDismissed(Le(He))?(0,R.createElement)(bt,{key:"truncated",text:He,closeLabel:g("common.close"),onClose:()=>b.dismiss(Le(He))}):null,Ue&&!b.isDismissed(Le(zt))?(0,R.createElement)(bt,{key:"capped",text:zt,closeLabel:g("common.close"),onClose:()=>b.dismiss(Le(zt))}):null,(0,R.createElement)("div",{key:"scroll",className:"gp-diff__scroll",ref:ge},At)]);return G?Ri(E,O,Ft,g):Ft});function us(e){let t=Number(e.slice(1));return Number.isFinite(t)?t:-1}function gs(e,t,n){let r=[];return n!==null?(n.forEach((a,i)=>r.push({key:`c${i}`,text:a.text})),r):t!==null?(t.forEach((a,i)=>{if(a.kind==="hunk"||a.kind==="gap")return;let s=a.rightText??a.leftText??"";s!==""&&r.push({key:`c${i}`,text:s})}),r):(e.forEach((a,i)=>{a.kind==="hunk"||a.kind==="gap"||(a.leftText!==null&&a.leftText!==""&&r.push({key:`l${i}`,text:a.leftText}),a.rightText!==null&&a.rightText!==""&&r.push({key:`r${i}`,text:a.rightText}))}),r)}function fs(e,t){if(t==="")return[];let n=[];for(let r of e)for(let[a,i]of Wn(r.text,t))if(n.push({cellKey:r.key,start:a,end:i}),n.length>=qn)return n;return n}function Ri(e,t,n,r){let a=(i,s)=>(0,R.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${e===i?" gp-seg__btn--active":""}`,"aria-pressed":e===i,onClick:()=>t(i)},s);return(0,R.createElement)("div",{className:"gp-svgdiff"},[(0,R.createElement)("div",{key:"bar",className:"gp-svgdiff__bar"},(0,R.createElement)("div",{className:"gp-seg"},[a("render",r("diff.svgRender")),a("source",r("diff.svgSource"))])),(0,R.createElement)("div",{key:"body",className:"gp-svgdiff__body"},n)])}function ms(e,t,n,r,a,i,s){let[o,l]=(0,R.useState)(null),d=(0,R.useRef)(0);(0,R.useEffect)(()=>{d.current+=1,l(null)},[e]);let c=(0,R.useCallback)((u,g)=>{if(n===void 0||r===void 0||a===void 0||i===void 0)return;let b=`${u.rightStart}:${g}`;l(b);let f=++d.current,{start:y,end:w}=hs(u,g),h=i==="commit"&&s!==void 0?{kind:"file-lines",path:a,base:"commit",commit:s,start:y,end:w}:i==="staged"?{kind:"file-lines",path:a,base:"staged",start:y,end:w}:{kind:"file-lines",path:a,base:"worktree",start:y,end:w};n.query({sessionId:r,query:h}).then(k=>{if(f!==d.current)return;let S=be(k,"file-lines");l(null),S!==null&&t(T=>hi(T,u.rightStart,g,S.start,S.lines,S.eof))}).catch(()=>{f===d.current&&l(null)})},[n,r,a,i,s,t]);return{busy:o,run:c}}function hs(e,t){let n=e.count;return t==="all"||n<=$t?{start:e.rightStart,end:e.rightStart+n-1}:t==="down"?{start:e.rightStart,end:e.rightStart+$t-1}:{start:e.rightStart+n-$t,end:e.rightStart+n-1}}function nr(e,t=""){return e.map((n,r)=>(0,R.createElement)("span",{key:`${t}${r}`,style:n.style},n.text))}function Pi(e,t,n,r){if(n===null)return null;let a=n.perCell.get(t);if(a===void 0||a.length===0)return null;let i=n.activeKey===t?n.activeRange:null;return Qn(e,a,r,t,i,n.activeRef)}function rr(e,t,n,r,a=null,i=-1){let s={key:t,className:e,"data-r":i>=0?i:void 0};if(n==="")return(0,R.createElement)("div",s,"\xA0");let o=r(n)?.[0],l=Pi(n,t,a,o);return l!==null?(0,R.createElement)("div",s,l):(0,R.createElement)("div",s,o===void 0?n:nr(o))}function Fr(e,t,n,r,a,i,s=null,o=-1){let l={key:t,className:e,"data-r":o>=0?o:void 0},d=i(n)?.[0]??[{text:n,style:{}}],c=Pi(n,t,s,d);if(c!==null)return(0,R.createElement)("div",l,c);let[u,g,b]=yi(d,r);return(0,R.createElement)("div",l,[...nr(u,"p"),(0,R.createElement)("span",{key:"w",className:a},g.length===0?"\xA0":nr(g)),...nr(b,"s")])}function ys(e){return e.filter(t=>t.leftText!==null).map(t=>({no:t.leftNo,text:t.leftText}))}function bs(e){return e.filter(t=>t.rightText!==null).map(t=>({no:t.rightNo,text:t.rightText}))}function vs(e,t,n,r,a,i){if(e.kind==="hunk")return[(0,R.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[Li(e.gap,t,r,i)];let s=e.kind==="del"||e.kind==="mod"?"gp-diff-row--del":"",o=e.kind==="add"||e.kind==="mod"?"gp-diff-row--add":"",l=e.leftText===null?(0,R.createElement)("div",{key:`l${t}`,className:`gp-diff-cell ${s}`}):e.kind==="mod"&&e.leftWord!==void 0?Fr(`gp-diff-cell ${s}`,`l${t}`,e.leftText,e.leftWord,"gp-diff-word gp-diff-word--del",n,a,t):rr(`gp-diff-cell ${s}`,`l${t}`,e.leftText,n,a,t),d=e.rightText===null?(0,R.createElement)("div",{key:`r${t}`,className:`gp-diff-cell ${o}`}):e.kind==="mod"&&e.rightWord!==void 0?Fr(`gp-diff-cell ${o}`,`r${t}`,e.rightText,e.rightWord,"gp-diff-word gp-diff-word--add",n,a,t):rr(`gp-diff-cell ${o}`,`r${t}`,e.rightText,n,a,t);return[(0,R.createElement)("div",{key:`ln${t}`,className:"gp-diff-no"},e.leftNo??""),l,(0,R.createElement)("div",{key:`rn${t}`,className:"gp-diff-no"},e.rightNo??""),d]}function ws(e,t,n,r,a,i){if(e.kind==="hunk")return[(0,R.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[Li(e.gap,t,r,i)];let s=e.kind==="del",o=e.kind==="add",l=o?"gp-diff-row--add":s?"gp-diff-row--del":"",d=o?"+":s?"\u2212":"\xA0",c=e.rightText??e.leftText??"",u=o?e.rightWord:s?e.leftWord:void 0,g=o?"gp-diff-word gp-diff-word--add":"gp-diff-word gp-diff-word--del",b=`gp-diff-cell gp-diff-uni__code ${l}`,f=u!==void 0?Fr(b,`c${t}`,c,u,g,n,a,t):rr(b,`c${t}`,c,n,a,t);return[(0,R.createElement)("div",{key:`ol${t}`,className:"gp-diff-no"},e.leftNo??""),(0,R.createElement)("div",{key:`nl${t}`,className:"gp-diff-no"},e.rightNo??""),(0,R.createElement)("div",{key:`sg${t}`,className:`gp-diff-uni__sign ${l}`},d),f]}function Li(e,t,n,r){let a=n.busy===`${e.rightStart}:all`,i=n.busy===`${e.rightStart}:up`,s=n.busy===`${e.rightStart}:down`,o=(c,u,g)=>(0,R.createElement)("button",{key:c,type:"button",className:"gp-gap__btn",disabled:n.busy!==null,onClick:b=>{b.stopPropagation(),n.run(e,c)}},g?r("common.loading"):u),l=[],d=e.count;return d<=$t?l.push(o("all",r("diff.expandGap",{n:d}),a)):(e.atStart||l.push(o("up",r("diff.expandUp",{n:$t}),i)),l.push(o("all",r("diff.expandGap",{n:d}),a)),l.push(o("down",r("diff.expandDown",{n:$t}),s))),(0,R.createElement)("div",{key:`g${t}`,className:"gp-diff-row--gap",style:{gridColumn:"1 / -1"},"data-r":t},l)}function or(e){return ui(e)}var Z=require("react");var xs=100;function Ai(e,t,n,r=!0){let[a,i]=(0,Z.useState)(null),[s,o]=(0,Z.useState)(!1),[l,d]=(0,Z.useState)([]),c=Nt([t,...n],r,async(u,g)=>{o(!1);let[b,f]=await Promise.all([e.query({sessionId:t,query:{kind:"branches"}}),e.query({sessionId:t,query:{kind:"tags"}})]);if(!u())return;let y=be(b,"branches"),w=be(f,"tags");if(y===null){o(!0);return}if(i({current:y.current,defaultBranch:y.defaultBranch,local:y.local,remote:y.remote,tags:w?.tags??a?.tags??[]}),!g())return;let h=await e.query({sessionId:t,query:{kind:"authors"}});if(!u())return;let k=be(h,"authors");d(k?.authors??[])},()=>o(!0));return{tree:a,treeError:s,authors:l,reload:c}}var Di=2e4;function ks(e,t,n){if(t===void 0)return e;let r=n.map(l=>({hash:l.hash,parents:l.parents})),a=new Set(r.map(l=>l.hash)),i=new Map;for(let l of[...e??[],...t])a.has(l.hash)||(i.delete(l.hash),i.set(l.hash,l.parents));let s=[...i],o=s.length>Di?s.slice(s.length-Di):s;return[...r,...o.map(([l,d])=>({hash:l,parents:d}))]}function zi(e,t,n,r,a,i=!0){let[s,o]=(0,Z.useState)({commits:[],topology:void 0,total:0,appliedFilter:n}),{commits:l,topology:d,total:c,appliedFilter:u}=s,[g,b]=(0,Z.useState)(!1),[f,y]=(0,Z.useState)(!1),w=(0,Z.useRef)(0),h=(0,Z.useRef)(!1),k=(0,Z.useRef)(s),S=(0,Z.useRef)(!1),T=(0,Z.useRef)(()=>!1),D=(0,Z.useRef)(i);D.current=i;let G=(0,Z.useRef)(null),E=(0,Z.useCallback)(async(J,B,F)=>{if(h.current)return;h.current=!0;let ae=w.current;b(!0),y(!1);let le=await e.query({sessionId:t,query:{kind:"history",limit:xs,skip:J,...B.ref?{ref:B.ref}:{},...B.search?{search:B.search}:{},...B.author?{author:B.author}:{},...B.since?{since:B.since}:{}}});if(!F()||ae!==w.current)return;h.current=!1,b(!1);let L=be(le,"history");if(L===null){y(!0);return}let Y=k.current,ie=J===0?L.commits:[...Y.commits,...L.commits],ne={commits:ie,topology:ks(J===0?void 0:Y.topology,L.topology,ie),total:L.total,appliedFilter:B};k.current=ne,S.current=!0,o(ne)},[e,t]),O=(0,Z.useRef)(n);Nt([t,...r,n.ref,n.search,n.author,n.since],i,async J=>{w.current+=1,h.current=!1,T.current=J,S.current=!1,O.current!==n&&(O.current=n,a(),G.current&&(G.current.scrollTop=0)),await E(0,n,J)},()=>{h.current=!1,b(!1),y(!0)});let I=c<0?!0:l.length<c,ee=(0,Z.useCallback)(()=>{if(!D.current||!Ie.isVisible()||h.current||!S.current||!I||!T.current())return;let J=T.current;E(l.length,n,J).catch(()=>{J()&&(h.current=!1,b(!1),y(!0))})},[E,l.length,n,I]);return{commits:l,topology:d,appliedFilter:u,total:c,loading:g,listError:f,hasMore:I,listRef:G,loadMore:ee}}function Fi(e,t,n,r=!0){let[a,i]=(0,Z.useState)(null),[s,o]=(0,Z.useState)(null),[l,d]=(0,Z.useState)(!1),[c,u]=(0,Z.useState)(null),[g,b]=(0,Z.useState)(null),[f,y]=(0,Z.useState)(!1),[w,h]=(0,Z.useState)(n),[k,S]=(0,Z.useState)(!1),T=(0,Z.useRef)(0),D=(0,Z.useRef)(null),G=(0,Z.useRef)(new Map),E=(0,Z.useCallback)((P,Q)=>{let z=G.current;for(z.set(P,Q);z.size>50;){let _=z.keys().next().value;if(_===void 0)break;z.delete(_)}},[]),O=(0,Z.useCallback)(()=>{i(null),o(null),D.current=null},[]),I=(0,Z.useCallback)(P=>{D.current===P.hash&&i(P)},[]),ee=(0,Z.useCallback)(async P=>{D.current=P.hash,i(P),d(!1),T.current+=1,u(null),b(null),y(!1);let Q=G.current.get(P.hash);if(Q!==void 0){o(Q);return}o(null);let z=await e.query({sessionId:t,query:{kind:"show",ref:P.hash}});if(D.current!==P.hash)return;let _=be(z,"show");if(_!==null){let j={commit:_.commit,body:_.body,stats:_.stats,insertions:_.insertions,deletions:_.deletions};E(P.hash,j),o(j)}else d(!0)},[e,t,E]),J=(0,Z.useCallback)(async(P,Q,z,_=!1)=>{let j=++T.current;u({path:P,hash:Q,shortHash:z}),b(null),y(!1),S(_);let V=await e.query({sessionId:t,query:{kind:"diff",path:P,base:"commit",commit:Q,..._?{context:2e3}:{}}});if(j!==T.current)return;let oe=be(V,"diff");oe!==null?b({text:oe.text,newLines:oe.newLines,truncated:oe.truncated}):y(!0)},[e,t]),B=(0,Z.useCallback)(()=>{T.current+=1,u(null),b(null),y(!1),S(!1)},[]);(0,Z.useEffect)(()=>{if(c===null)return;let P=Q=>{Q.key==="Escape"&&B()};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[c,B]);let[F,ae]=(0,Z.useState)(null),[le,L]=(0,Z.useState)(null),Y=(0,Z.useRef)(void 0),ie=(0,Z.useRef)(null),ne=(0,Z.useRef)(r);ne.current=r;let H=(0,Z.useCallback)((P,Q,z)=>{Y.current!==void 0&&clearTimeout(Y.current),Y.current=setTimeout(()=>{if(!ne.current||!Ie.isVisible())return;ie.current=P.hash,ae({commit:P,x:Q,y:z});let _=G.current.get(P.hash);if(_!==void 0){L(_.body);return}L(null),e.query({sessionId:t,query:{kind:"show",ref:P.hash}}).then(j=>{if(ie.current!==P.hash)return;let V=be(j,"show");V!==null?(E(P.hash,{commit:V.commit,body:V.body,stats:V.stats,insertions:V.insertions,deletions:V.deletions}),L(V.body)):L("")})},260)},[e,t,E]),N=(0,Z.useCallback)(()=>{Y.current!==void 0&&clearTimeout(Y.current),ie.current=null,ae(null),L(null)},[]);return(0,Z.useEffect)(()=>{r||N()},[r,N]),(0,Z.useEffect)(()=>()=>{Y.current!==void 0&&clearTimeout(Y.current)},[]),{selected:a,detail:s,detailError:l,select:ee,resyncSelected:I,clearSelection:O,fileDiff:c,fileDiffData:g,fileDiffError:f,fileDiffMode:w,setFileDiffMode:h,fileDiffExpanded:k,openFileDiff:J,closeFileDiff:B,hover:F,hoverBody:le,onHoverEnter:H,onHoverLeave:N}}var tt=require("react"),_s=(e,t,n)=>Math.max(t,Math.min(n,e));function Ss(e,t){try{let n=typeof localStorage<"u"?localStorage.getItem(e):null,r=n===null?NaN:Number(n);return Number.isFinite(r)?r:t}catch{return t}}function Cs(e,t){try{typeof localStorage<"u"&&localStorage.setItem(e,String(Math.round(t)))}catch{}}function Kt(e){let{storageKey:t,initial:n,min:r,reserve:a,edge:i}=e,[s,o]=(0,tt.useState)(()=>Ss(t,n)),l=(0,tt.useRef)(null),d=(0,tt.useRef)(null),c=(0,tt.useCallback)(g=>{let f=l.current?.parentElement?.clientWidth??Number.MAX_SAFE_INTEGER;d.current={x:g.clientX,w:s,max:Math.max(r,f-a)},g.preventDefault(),typeof document<"u"&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none")},[s,r,a]);(0,tt.useEffect)(()=>{if(typeof window>"u")return;let g=f=>{let y=d.current;if(y===null)return;let w=f.clientX-y.x;o(_s(y.w+(i==="end"?w:-w),r,y.max))},b=()=>{d.current!==null&&(d.current=null,typeof document<"u"&&(document.body.style.cursor="",document.body.style.userSelect=""),o(f=>(Cs(t,f),f)))};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",b),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",b)}},[i,r,t]);let u=(0,tt.createElement)("div",{key:`rz-${t}`,ref:l,className:"gp-resizer",role:"separator","aria-orientation":"vertical",onPointerDown:c});return{width:s,divider:u}}var Hi=require("react");function Et(e,t,n,r,a=!1){return e.map(i=>(0,Hi.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${t===i?" gp-seg__btn--active":""}`,...a?{disabled:!0}:{},onClick:()=>n(i)},r(i)))}var ke=require("react"),Bi=require("react-dom");function Vt(e,t,n){switch(e){case"empty-message":return n("error.emptyMessage");case"not-a-git-repo":return n("error.notARepo");case"cwd-unavailable":return n("error.noCwd");case"local-changes-block":return n("error.localChangesBlock");case"not-ff":return n("error.notFastForward");case"push-rejected":return n("error.pushRejected");case"auth-failed":return n("error.authFailed");case"conflict":return n("error.conflict");case"revert-conflict":return n("error.revertConflict");case"revert-stuck":return n("error.revertStuck");case"revert-merge":return n("error.revertMerge");case"index-busy":return n("error.indexBusy");case"not-found":return n("error.notFound");case"branch-in-use":return n("error.branchInUse");case"nested-repo":return n("error.nestedRepo");case"nested-repo-partial":return n("error.nestedRepoPartial");case"stash-switch-failed":return n("error.stashSwitchFailed",{reason:t??""});case"invalid-name":case"invalid-index":return n("error.invalidName");default:return t??n("error.generic")}}function ln(e){return(0,ke.createElement)("div",{key:"aihint",className:"gp-modal__hint"},e("ops.aiHint"))}function dn(e){return(0,ke.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,ke.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",onClick:e.onClose},e.t("common.cancel")),(0,ke.createElement)("button",{key:"ok",type:"button",className:`gp-btn ${e.danger?"gp-btn--danger":"gp-btn--primary"}`,disabled:e.confirmDisabled,onClick:e.onConfirm},e.confirmLabel)])}function Gt(e){return typeof document>"u"?null:(0,ke.createElement)(Ts,e)}function Ts({onClose:e,title:t,icon:n,hash:r,body:a,footer:i,overlay:s,portalKey:o,t:l}){let d=s!=null;(0,ke.useEffect)(()=>{let u=g=>{g.key==="Escape"&&!d&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,d]);let c=(0,ke.createElement)("div",{className:"gp-modal-backdrop",onClick:u=>{!d&&u.target===u.currentTarget&&e()}},(0,ke.createElement)("div",{className:"gp-modal gp-modal--sm",role:"dialog","aria-modal":!0},[(0,ke.createElement)("div",{key:"bar",className:"gp-modal__bar"},[n!==void 0?(0,ke.createElement)("span",{key:"ic",className:"gp-modal__fileicon"},n):null,(0,ke.createElement)("span",{key:"title",className:"gp-modal__path"},t),r!==void 0?(0,ke.createElement)("span",{key:"hash",className:"gp-modal__hash"},r):null,(0,ke.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),disabled:d,onClick:e},(0,ke.createElement)(We,{size:15}))]),(0,ke.createElement)("div",{key:"body",className:"gp-modal__form"},a),i,s??null]));return(0,Bi.createPortal)(c,document.body,o)}function Ns(e){return(0,ke.createElement)("div",{key:"overlay",className:"gp-modal__overlay"},[(0,ke.createElement)("div",{key:"sp",className:"gp-spinner"}),(0,ke.createElement)("div",{key:"lb",className:"gp-modal__overlay-label"},e)])}function Je(e){let t=e.confirmBusy===!0&&e.busyLabel!==void 0;return Gt({onClose:e.onClose,title:e.title,portalKey:"confirm-modal",t:e.t,body:[(0,ke.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},e.body),e.extra??null,ln(e.t),e.error!==null?(0,ke.createElement)("div",{key:"err",className:"gp-feedback"},e.error):null],footer:dn({onClose:e.onClose,onConfirm:e.onConfirm,confirmLabel:e.confirmLabel,confirmDisabled:e.confirmBusy===!0,danger:e.danger,t:e.t}),...t?{overlay:Ns(e.busyLabel)}:{}})}var de=require("react");function Ii(e,t){return typeof document>"u"?null:(0,de.createElement)(Es,{target:e,...t})}function Es({target:e,onClose:t,onCreate:n,error:r,t:a}){let[i,s]=(0,de.useState)(""),[o,l]=(0,de.useState)(!1),[d,c]=(0,de.useState)(""),u=()=>{i.trim()!==""&&n(i.trim(),o?d:"")};return Gt({onClose:t,title:a("tag.createTitle"),icon:(0,de.createElement)(Yt,{size:15}),hash:e.shortHash,portalKey:"tag-create-modal",t:a,body:[(0,de.createElement)("input",{key:"name",className:"gp-input",placeholder:a("tag.namePlaceholder"),value:i,autoFocus:!0,onChange:g=>s(g.target.value),onKeyDown:g=>{g.key==="Enter"&&u()}}),(0,de.createElement)("label",{key:"ann",className:"gp-modal__check"},[(0,de.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:o,onChange:()=>l(g=>!g)}),a("tag.annotated")]),o?(0,de.createElement)("textarea",{key:"msg",className:"gp-input gp-input--area",placeholder:a("tag.messagePlaceholder"),value:d,onChange:g=>c(g.target.value)}):null,ln(a),r!==null?(0,de.createElement)("div",{key:"err",className:"gp-feedback"},r):null],footer:dn({onClose:t,onConfirm:u,confirmLabel:a("tag.create"),confirmDisabled:i.trim()==="",danger:!1,t:a})})}function Oi(e,t){return typeof document>"u"?null:(0,de.createElement)(Gs,{target:e,...t})}function Gs({target:e,from:t,dirty:n,lostFiles:r,lostTotal:a,lostTruncated:i,busy:s,error:o,onReset:l,onClose:d,t:c}){let[u,g]=(0,de.useState)("mixed"),[b,f]=(0,de.useState)(!1);(0,de.useEffect)(()=>{u!=="hard"&&f(!1)},[u]);let y=[{value:"mixed",label:"reset.modeMixed",hint:"reset.mixedHint"},{value:"soft",label:"reset.modeSoft",hint:"reset.softHint"},{value:"hard",label:"reset.modeHard",hint:"reset.hardHint"}],w=s||u==="hard"&&!b;return Gt({onClose:d,title:c("reset.title"),icon:(0,de.createElement)(Bn,{size:15}),hash:e.shortHash,portalKey:"reset-modal",t:c,body:[(0,de.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},c("reset.body",{from:t,to:e.shortHash})),(0,de.createElement)("div",{key:"modes",className:"gp-reset__modes"},y.map(h=>(0,de.createElement)("label",{key:h.value,className:`gp-reset__mode${u===h.value?" gp-reset__mode--on":""}${h.value==="hard"?" gp-reset__mode--danger":""}`},[(0,de.createElement)("input",{key:"r",type:"radio",name:"gp-reset-mode",className:"gp-check",checked:u===h.value,onChange:()=>g(h.value)}),(0,de.createElement)("span",{key:"tx",className:"gp-reset__modetext"},[(0,de.createElement)("span",{key:"l",className:"gp-reset__modelabel"},c(h.label)),(0,de.createElement)("span",{key:"h",className:"gp-reset__modehint"},c(h.hint))])]))),u==="hard"?(0,de.createElement)("div",{key:"orphan",className:"gp-reset__dirtywarn"},c("reset.hardOrphan")):null,u==="hard"&&a>0?(0,de.createElement)("div",{key:"lost",className:"gp-reset__lost"},[(0,de.createElement)("div",{key:"w",className:"gp-reset__warn"},c("reset.hardWarn")),(0,de.createElement)("ul",{key:"ul",className:"gp-reset__lostlist"},[...r.map(h=>(0,de.createElement)("li",{key:h,title:h},h)),i?(0,de.createElement)("li",{key:"_more",className:"gp-reset__lostmore"},c("reset.lostMore")):null])]):null,u==="hard"?(0,de.createElement)("label",{key:"ack",className:"gp-modal__check gp-reset__ack"},[(0,de.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:b,onChange:()=>f(h=>!h)}),c(a>0?"reset.hardAck":"reset.hardAckClean")]):null,n?(0,de.createElement)("div",{key:"dirty",className:"gp-reset__dirtywarn"},c("ops.dirtyWarn")):null,ln(c),o!==null?(0,de.createElement)("div",{key:"err",className:"gp-feedback"},o):null],footer:dn({onClose:d,onConfirm:()=>void l(u),confirmLabel:c("reset.confirm"),confirmDisabled:w,danger:u==="hard",t:c})})}var Ke=require("react");function Xi(e,t){return typeof document>"u"?null:(0,Ke.createElement)(Ms,{target:e,...t})}function Ms({target:e,from:t,dirty:n,busy:r,error:a,onConfirm:i,onClose:s,t:o}){let[l,d]=(0,Ke.useState)(!1),c=(u,g,b,f)=>(0,Ke.createElement)("label",{key:g,className:`gp-bpick__mode${l===u?" gp-bpick__mode--on":""}`},[(0,Ke.createElement)("input",{key:"r",type:"radio",name:"gp-switch-mode",className:"gp-check",checked:l===u,onChange:()=>d(u)}),(0,Ke.createElement)("span",{key:"tx",className:"gp-bpick__modetext"},[(0,Ke.createElement)("span",{key:"l",className:"gp-bpick__modelabel"},b),(0,Ke.createElement)("span",{key:"h",className:"gp-bpick__modehint"},f)])]);return Je({title:o("switch.confirmTitle"),body:o("switch.body",{from:t??o("switch.detached"),to:e.name}),extra:(0,Ke.createElement)("div",{key:"x",className:"gp-bpick__extra"},[e.createFrom===void 0?null:(0,Ke.createElement)("div",{key:"trk",className:"gp-bpick__note"},o("switch.trackingNote",{name:e.name,ref:e.createFrom})),n===0?null:(0,Ke.createElement)("div",{key:"dw",className:"gp-bpick__warn"},o("switch.dirtyWarn",{count:n})),n===0?null:(0,Ke.createElement)("div",{key:"md",className:"gp-bpick__modes"},[c(!1,"direct",o("switch.modeDirect"),o("switch.modeDirectHint")),c(!0,"stash",o("switch.modeStash",{count:n}),o("switch.modeStashHint"))])]),confirmLabel:o(l?"switch.confirmStash":"switch.confirm"),danger:!1,error:a,confirmBusy:r,busyLabel:o("switch.switching"),onConfirm:()=>i(l),onClose:s,t:o})}function Rs(e){let t=e.indexOf("/");return t<=0||t===e.length-1?null:{remote:e.slice(0,t),branch:e.slice(t+1)}}function $i(e){let t=new Set(e.local.map(a=>a.name)),n=e.local.map(a=>({key:`local:${a.name}`,group:"local",label:a.name,name:a.name,reused:!1,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})),r=[];for(let a of e.remote){let i=Rs(a.name);if(i===null)continue;let s=t.has(i.branch);r.push({key:`remote:${a.name}`,group:"remote",label:a.name,name:i.branch,createFrom:s?void 0:a.name,reused:s,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})}return[...n,...r]}function Ji(e,t){return e.name!==t}var we=require("react");var Ee=require("react"),Ki=require("react-dom"),Ps=140,Ls=260;function Mt(e){let t=e?.placement??"above",n=e?.delayMs??Ps,r=e?.maxWidth??Ls,[a,i]=(0,Ee.useState)(null),[s,o]=(0,Ee.useState)(!1),l=(0,Ee.useRef)(!1),d=(0,Ee.useRef)(void 0),c=(0,Ee.useCallback)(S=>{l.current=S,o(S)},[]),u=(0,Ee.useCallback)(()=>{d.current!==void 0&&(clearTimeout(d.current),d.current=void 0),c(!1),i(null)},[c]),g=(0,Ee.useCallback)((S,T)=>{let D=S.getBoundingClientRect(),G=S.closest('.gp-panel[data-layout="compact"]')!==null,E=G?D.left+D.width/2:D.left,O=Math.min(r,Math.max(80,window.innerWidth-16));i(t==="below"?{text:T,left:E,center:G,maxW:O,top:D.bottom+6}:{text:T,left:E,center:G,maxW:O,bottom:Math.max(8,window.innerHeight-D.top+6)})},[t,r]),b=(0,Ee.useCallback)((S,T)=>{l.current||(d.current!==void 0&&clearTimeout(d.current),c(!1),d.current=setTimeout(()=>g(S,T),n))},[g,n,c]),f=(0,Ee.useCallback)((S,T)=>{d.current!==void 0&&(clearTimeout(d.current),d.current=void 0),c(!0),g(S,T)},[g,c]),y=(0,Ee.useRef)(null);(0,Ee.useLayoutEffect)(()=>{let S=y.current;if(S===null||a===null)return;let T=8,D=window.innerWidth,G=window.innerHeight,E=S.getBoundingClientRect(),O=a.center===!0?T+E.width/2:T,I=a.center===!0?D-T-E.width/2:D-T-E.width,ee=Math.min(Math.max(a.left,O),Math.max(O,I)),J=Math.max(T,G-T-E.height),B=a.top===void 0?void 0:Math.min(Math.max(a.top,T),J),F=a.bottom===void 0?void 0:Math.min(Math.max(a.bottom,T),J);ee===a.left&&B===a.top&&F===a.bottom||i(ae=>{if(ae===null)return ae;let le={...ae,left:ee};return B!==void 0&&(le.top=B),F!==void 0&&(le.bottom=F),le})},[a]),(0,Ee.useEffect)(()=>{if(!s)return;let S=D=>{let G=D.target;G instanceof Element&&G.closest(".gp-tip")!==null||u()},T=D=>{D.key==="Escape"&&u()};return document.addEventListener("pointerdown",S,!0),document.addEventListener("keydown",T,!0),()=>{document.removeEventListener("pointerdown",S,!0),document.removeEventListener("keydown",T,!0)}},[s,u]);let w=(0,Ee.useCallback)(S=>({onMouseEnter:T=>b(T.currentTarget,S),onMouseLeave:()=>{l.current||u()},onFocus:T=>b(T.currentTarget,S),onBlur:()=>{l.current||u()}}),[b,u]),h={left:a?.left??0,maxWidth:a?.maxW??r};a?.top!==void 0&&(h.top=a.top),a?.bottom!==void 0&&(h.bottom=a.bottom);let k=a!==null&&typeof document<"u"?(0,Ki.createPortal)((0,Ee.createElement)("div",{ref:y,className:`gp-tip gp-tip--sb${a.center===!0?" gp-tip--center":""}`,style:h},a.text),document.body):null;return{tipProps:w,tipNode:k,hideTip:u,showTipNow:f}}function vt(e){return e.hasUpstream===!0&&e.ahead>0&&e.behind===0}function Vi(e,t,n){if(e==="loading"||e===null)return(0,we.createElement)("div",{className:"gp-pullscope gp-pullscope--loading"},t(n.loading));let r=t(n.line,{commits:e.commits,files:e.files,ins:e.insertions,del:e.deletions}),a=r.match(/(\+\d+)\s*\/\s*([-−]\d+)/);if(a===null)return(0,we.createElement)("div",{className:"gp-pullscope"},r);let i=r.indexOf(a[0]);return(0,we.createElement)("div",{className:"gp-pullscope"},[r.slice(0,i),(0,we.createElement)("span",{key:"add",className:"gp-pullscope__add"},a[1])," / ",(0,we.createElement)("span",{key:"del",className:"gp-pullscope__del"},a[2]),r.slice(i+a[0].length)])}function qi(e,t){return Vi(e,t,{line:"status.pullScope",loading:"status.pullScopeLoading"})}function Ui(e,t){return Vi(e,t,{line:"status.pushScope",loading:"status.pushScopeLoading"})}function Ds(e){let t=e.replace(/^https?:\/\/[^/]+\//,"").replace(/\/+$/,""),n=t.split("/");return n.length>=2?n.slice(-2).join("/"):t}function Hr(e,t){return(0,we.createElement)(As,{snapshot:e,cb:t})}function As({snapshot:e,cb:t}){let{t:n}=t,{tipProps:r,tipNode:a,hideTip:i}=Mt({placement:"above"}),s=e.remote??null,o=e.hasUpstream===!0,l=(()=>{if(s===null||s.hostKind!=="github")return null;let h=(0,we.createElement)(Xa,{size:14});if(s.webUrl===null)return(0,we.createElement)("span",{key:"r",className:"gp-statusbar__repo gp-statusbar__repo--none","aria-label":s.url,...r(s.url)},(0,we.createElement)("span",{className:"gp-statusbar__ic"},h));let k=s.host!==null?n("status.openRepoOn",{host:s.host}):n("status.openRepo"),S=`${Ds(s.webUrl)} \xB7 ${k}`;return(0,we.createElement)("a",{key:"r",className:"gp-statusbar__repo",href:s.webUrl,target:"_blank",rel:"noreferrer","aria-label":S,...r(S)},(0,we.createElement)("span",{className:"gp-statusbar__ic"},h))})(),{ahead:d,behind:c,branch:u}=e,g=o&&c>0&&d===0,b=vt(e),f=!o&&u!==null&&s!==null,y=(()=>{let h,k="";return u===null?h=n("status.detached"):o?d===0&&c===0?(h=n("status.synced"),k=" gp-statusbar__state--ok"):d>0&&c>0?(h=n("status.diverged",{ahead:d,behind:c}),k=" gp-statusbar__state--warn"):c>0?(h=n("status.behind",{n:c}),k=" gp-statusbar__state--warn"):h=n("status.ahead",{n:d}):h=n("status.noUpstream"),t.syncError!==null?(0,we.createElement)("span",{key:"error",className:"gp-statusbar__state gp-statusbar__state--warn",role:"alert",title:t.syncError},t.syncError):(0,we.createElement)("span",{key:"s",className:`gp-statusbar__state${k}`},h)})(),w=[s!==null?(0,we.createElement)("button",{key:"check",type:"button",className:"gp-icon-btn gp-statusbar__btn",disabled:t.syncBusy,"aria-label":n("status.check"),...r(n("status.checkTitle")),onClick:()=>{i(),t.onCheck()}},(0,we.createElement)(Ja,{size:13})):null,g?(0,we.createElement)("button",{key:"pull",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pullBusy,"aria-label":n("status.pullTitle"),...r(n("status.pullTitle")),onClick:()=>{i(),t.onPull()}},[(0,we.createElement)($a,{key:"i",size:12}),n("status.pull")]):null,b?(0,we.createElement)("button",{key:"push",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pushBusy,"aria-label":n("status.pushTitle"),...r(n("status.pushTitle")),onClick:()=>{i(),t.onPush()}},[(0,we.createElement)(_n,{key:"i",size:12}),n("status.push")]):null,f?(0,we.createElement)("button",{key:"publish",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.publishBusy,"aria-label":n("status.publishTitle"),...r(n("status.publishTitle")),onClick:()=>{i(),t.onPublish()}},[(0,we.createElement)(_n,{key:"i",size:12}),n("status.publish")]):null];return(0,we.createElement)("div",{key:"statusbar",className:`gp-statusbar${t.syncBusy?" gp-statusbar--busy":""}`},[l,(0,we.createElement)("div",{key:"sync",className:"gp-statusbar__sync"},[y,...w]),a])}var Ve=require("react");function sr({remote:e,sessionId:t,snapshot:n,onAction:r,onClose:a,t:i,onBusyChange:s}){let o=JSON.stringify([t,n.root,n.branch,n.head]),l=(0,Ve.useRef)(o),d=(0,Ve.useRef)({scope:o,snapshot:n});d.current={scope:o,snapshot:n};let c=(0,Ve.useRef)(!1),u=(0,Ve.useRef)(!1),[g,b]=(0,Ve.useState)("loading"),[f,y]=(0,Ve.useState)(null),[w,h]=(0,Ve.useState)(!1),k=o===l.current;(0,Ve.useEffect)(()=>(c.current=!0,()=>{c.current=!1}),[]),(0,Ve.useEffect)(()=>{(!k||!vt(n))&&(u.current||a())},[k,n,w,a]),(0,Ve.useEffect)(()=>{if(!k)return;let T=!0;return b("loading"),(async()=>{try{let D=await e.query({sessionId:t,query:{kind:"push-preview"}});if(!T||d.current.scope!==l.current)return;let G=be(D,"push-preview");G!==null&&G.hasUpstream?b(G):(b(null),y(D.ok?i("error.generic"):Vt(D.error.code,D.error.message,i)))}catch(D){if(!T||d.current.scope!==l.current)return;b(null),y(D instanceof Error?D.message:i("error.generic"))}})(),()=>{T=!1}},[e,t,o,k,i]);let S=async()=>{if(!(u.current||d.current.scope!==l.current||!vt(d.current.snapshot))){u.current=!0,y(null),h(!0),s?.(!0);try{let T=await r({kind:"push"});if(!c.current)return;T.ok?a():d.current.scope===l.current&&y(T.error??i("error.generic"))}catch(T){c.current&&d.current.scope===l.current&&y(T instanceof Error?T.message:i("error.generic"))}finally{u.current=!1,c.current&&h(!1),s?.(!1)}}};return k?Je({title:i("status.pushConfirmTitle"),body:i("status.pushConfirmBody",{branch:n.branch??"HEAD",ahead:n.ahead}),extra:g===null?null:Ui(g,i),confirmLabel:i("status.pushConfirm"),danger:!1,error:f,confirmBusy:w,busyLabel:i("status.pushing"),onConfirm:()=>void S(),onClose:()=>{u.current||a()},t:i}):null}var Br=new Set,ji=22,Wi=24,Qi=[["","overview.allTime"],["1 day ago","overview.today"],["7 days ago","overview.last7d"],["30 days ago","overview.last30d"]],zs=30;function Fs(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].kind!==t[n].kind||e[n].name!==t[n].name||e[n].head!==t[n].head)return!1;return!0}var Hs=46,Bs=260;function Is(e,t){let[n,r]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=()=>r(e.clientWidth>0&&e.clientWidth<t);a();let i=new ResizeObserver(a);return i.observe(e),()=>i.disconnect()},[e,t]),n}function Yi({remote:e,sessionId:t,visible:n=!0,defaultDiffView:r,snapshot:a,onAction:i,onResync:s,compact:o,t:l}){let{signal:d,queryVisible:c,queryKey:u}=Dn(t,n,a.root),[g,b]=(0,p.useState)({ref:null,search:"",author:"",since:""}),[f,y]=(0,p.useState)(""),[w,h]=(0,p.useState)(!1),[k,S]=(0,p.useState)(!1),[T,D]=(0,p.useState)(null),G=Is(T,Bs),[E,O]=(0,p.useState)(!1),I=(0,p.useId)(),[ee,J]=(0,p.useState)(new Set(["tags","remote"])),[B,F]=(0,p.useState)(0),ae=[...u,B],le=()=>F(x=>x+1),[L,Y]=(0,p.useState)(null),[ie,ne]=(0,p.useState)(null),[H,N]=(0,p.useState)(null),[P,Q]=(0,p.useState)(null),[z,_]=(0,p.useState)(null),[j,V]=(0,p.useState)(!1),[oe,Ge]=(0,p.useState)(!1),[ye,Me]=(0,p.useState)(null),[Pe,_e]=(0,p.useState)(!1),[Ae,C]=(0,p.useState)(!1),[ue,ge]=(0,p.useState)(!1),[pe,Se]=(0,p.useState)(!1),[Re,Qe]=(0,p.useState)(!1),[ut,Pt]=(0,p.useState)(!1),[gn,qe]=(0,p.useState)(null),[wt,Ye]=(0,p.useState)("list"),[Fe,xt]=(0,p.useState)(null),[rt,Lt]=(0,p.useState)(!1),[at,it]=(0,p.useState)(!1);(0,p.useEffect)(()=>{if(!at)return;let x=X=>{X.key==="Escape"&&it(!1)};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[at]),(0,p.useEffect)(()=>{!o&&at&&it(!1)},[o,at]),(0,p.useEffect)(()=>{if(!Ae){qe(null);return}let x=!0;return qe("loading"),e.query({sessionId:t,query:{kind:"pull-preview"}}).then(X=>{if(!x)return;let he=be(X,"pull-preview");qe(he!==null&&he.hasUpstream?{commits:he.commits,files:he.files,insertions:he.insertions,deletions:he.deletions}:null)}),()=>{x=!1}},[Ae,e,t]);let{tree:Ce,treeError:gt,authors:kt,reload:ot}=Ai(e,t,ae,c),Dt=(0,p.useMemo)(()=>{let x=new Map;if(Ce===null)return x;for(let X of $i(Ce))Ji(X,Ce.current)&&x.set(X.key,X);return x},[Ce]),_t=a.remote?.name??null,st=(0,p.useMemo)(()=>{let x=Ce?.local??[],X=Ce?.remote??[],he=Ce?.defaultBranch??null,Ht=ti(x,he),la=ri(X,_t,he),da=ai(x,Ce?.current??null,Ht);return{local:da.nodes,localPinned:da.pinned,localPrimary:Ht,remotePrimary:la,remote:Jn(ni(X,la)),tags:Jn(Ce?.tags??[])}},[Ce?.local,Ce?.remote,Ce?.tags,Ce?.current,Ce?.defaultBranch,_t]),At=x=>{_(null),xt(x)},re=Fi(e,t,r,c),{commits:Ue,topology:He,appliedFilter:zt,loading:Le,listError:Ft,hasMore:te,listRef:U,loadMore:fe}=zi(e,t,g,ae,re.clearSelection,c);(0,p.useEffect)(()=>{let x=setTimeout(()=>b(X=>X.search===f?X:{...X,search:f}),300);return()=>clearTimeout(x)},[f]);let Ze=He!==void 0||Rr(zt),St=(0,p.useMemo)(()=>Ze?Ya(Ue,He??[],a.graphStyle):In(Ue,a.graphStyle),[Ue,He,Ze,a.graphStyle]),je=(0,p.useMemo)(()=>Wa(St),[St]),lt=Math.max(Ot,je*Ot),et=o?Hs:zs,ft=o?`${lt}px minmax(0,1fr)`:`${lt}px minmax(120px,1fr) 72px 120px 96px`,Mn=()=>{let x=U.current;x===null||!te||x.scrollTop+x.clientHeight>=x.scrollHeight-240&&fe()},xr=x=>{re.select(x),o&&Ye("detail")},kr=(0,p.useMemo)(()=>Date.now(),[Ue,d.sampledAt]),qt=(0,p.useMemo)(()=>re.detail===null?[]:ii(re.detail.stats.map(x=>({path:x.path,meta:x.status}))),[re.detail]),me=re.selected,Ut=me?.hash??null,[fn,_r]=(0,p.useState)({hash:null,dirs:Br}),Sr=fn.hash===Ut?fn.dirs:Br,mn=(0,p.useCallback)(x=>{_r(X=>{let he=X.hash===Ut?X.dirs:Br,Ht=new Set(he);return Ht.has(x)?Ht.delete(x):Ht.add(x),{hash:Ut,dirs:Ht}})},[Ut]);(0,p.useEffect)(()=>{if(me===null)return;let x=Ue.find(X=>X.hash===me.hash);x!==void 0&&x!==me&&!Fs(x.refs,me.refs)&&re.resyncSelected(x)},[Ue,me]);let jt=Kt({storageKey:"gp.overview.left",initial:200,min:130,reserve:360,edge:"end"}),hn=Kt({storageKey:"gp.overview.right",initial:340,min:190,reserve:360,edge:"start"}),yn=x=>b(X=>({...X,ref:x})),Rn=async(x,X)=>{if(!(L===null||j)){_(null),V(!0);try{let he=await e.run({sessionId:t,action:{kind:"tag-create",name:x,commit:L.hash,...X.trim()!==""?{message:X}:{}}});he.ok?(Y(null),le()):_(Vt(he.error.code,he.error.message,l))}finally{V(!1)}}},M=async x=>{if(!j){_(null),V(!0);try{let X=await e.run({sessionId:t,action:{kind:"tag-delete",name:x}});X.ok?(ne(null),le()):_(Vt(X.error.code,X.error.message,l))}finally{V(!1)}}},q=async()=>{if(!(H===null||j)){_(null),V(!0);try{let x=await i({kind:"revert",commit:H.hash});x.ok?N(null):_(x.error??l("error.generic"))}finally{V(!1)}}},se=async x=>{if(!(P===null||j)){_(null),V(!0);try{let X=await i({kind:"reset",commit:P.hash,mode:x});X.ok?Q(null):_(X.error??l("error.generic"))}finally{V(!1)}}},Te=async x=>{if(!(Fe===null||rt)){_(null),Lt(!0);try{let X=await i({kind:"branch-checkout",name:Fe.name,...Fe.createFrom===void 0?{}:{createFrom:Fe.createFrom},...x?{stashMessage:l("switch.stashMessage",{branch:Fe.name})}:{}});X.ok?(xt(null),Ne(!0)):_(X.error??l("error.generic"))}finally{Lt(!1)}}},Ne=async(x=!1)=>{if(!(oe||a.remote===null)){x||Me(null),Ge(!0);try{let X=await i({kind:"fetch"});X.ok?Me(null):x||Me(X.error??l("error.generic"))}catch(X){x||Me(X instanceof Error?X.message:l("error.generic"))}finally{Ge(!1)}}},Wt=async()=>{if(!Pe){_(null),_e(!0);try{let x=await i({kind:"pull-ff"});x.ok?C(!1):_(x.error??l("error.generic"))}finally{_e(!1)}}},dt=async()=>{if(!(Re||a.remote===null)){_(null),Qe(!0);try{let x=await i({kind:"publish",remote:a.remote.name});x.ok?Pt(!1):_(x.error??l("error.generic"))}finally{Qe(!1)}}},Qr={syncBusy:oe,syncError:ye,pullBusy:Pe,pushBusy:ue,publishBusy:Re,onCheck:()=>void Ne(),onPull:()=>{_(null),C(!0)},onPush:()=>{vt(a)&&!ue&&Se(!0)},onPublish:()=>{_(null),Pt(!0)},t:l},Yr=Ks(re.fileDiff,{visible:c,data:re.fileDiffData,error:re.fileDiffError,mode:re.fileDiffMode,onMode:re.setFileDiffMode,expanded:re.fileDiffExpanded,onExpand:x=>{re.fileDiff!==null&&re.openFileDiff(re.fileDiff.path,re.fileDiff.hash,re.fileDiff.shortHash,x)},onClose:re.closeFileDiff,remote:e,sessionId:t,compact:o,t:l}),Zr=(0,p.useMemo)(()=>[...new Set(a.changes.filter(x=>x.status!=="untracked").map(x=>x.path))],[a.changes]),ea=[L!==null?Ii(L,{onClose:()=>Y(null),onCreate:Rn,error:z,compact:o,t:l}):null,ie!==null?Je({title:l("tag.deleteTitle"),body:l("tag.deleteConfirm",{name:ie}),confirmLabel:l("tag.deleteTitle"),danger:!0,error:z,confirmBusy:j,onConfirm:()=>void M(ie),onClose:()=>ne(null),t:l}):null,H!==null?Je({title:l("revert.title"),body:l("revert.body",{ref:`${H.shortHash} ${H.subject}`})+(a.dirty?`
790
+
791
+ ${l("ops.dirtyWarn")}`:""),confirmLabel:l("revert.confirm"),danger:!1,error:z,confirmBusy:j,onConfirm:()=>void q(),onClose:()=>N(null),t:l}):null,P!==null?Oi(P,{from:a.head??P.shortHash,dirty:a.dirty,lostFiles:Zr,lostTotal:Zr.length,lostTruncated:a.truncated,busy:j,error:z,onReset:se,onClose:()=>Q(null),t:l}):null,Ae?Je({title:l("status.pullConfirmTitle"),body:l("status.pullConfirmBody",{branch:a.branch??"HEAD",behind:a.behind}),extra:qi(gn,l),confirmLabel:l("status.pullConfirm"),danger:!1,error:z,confirmBusy:Pe,busyLabel:l("status.pulling"),onConfirm:()=>void Wt(),onClose:()=>C(!1),t:l}):null,pe?(0,p.createElement)(sr,{key:"push",remote:e,sessionId:t,snapshot:a,onAction:i,onClose:()=>Se(!1),onBusyChange:ge,t:l}):null,ut?Je({title:l("status.publishConfirmTitle"),body:l("status.publishConfirmBody",{branch:a.branch??"HEAD",remote:a.remote?.name??"origin"}),confirmLabel:l("status.publishConfirm"),danger:!1,error:z,confirmBusy:Re,busyLabel:l("status.publishing"),onConfirm:()=>void dt(),onClose:()=>Pt(!1),t:l}):null,Fe!==null?Xi(Fe,{from:a.branch,dirty:a.dirty?Math.max(1,a.stats.fileCount):0,busy:rt,error:z,onConfirm:x=>void Te(x),onClose:()=>xt(null),t:l}):null],Eo=[{id:"",label:l("overview.allUsers")},...kt.map(x=>({id:x,label:x}))],Go=Qi.map(([x,X])=>({id:x,label:l(X)})),Mo=l(Qi.find(([x])=>x===g.since)?.[1]??"overview.allTime"),Ro=g.author===""?l("overview.allUsers"):g.author,ta=(x,X,he)=>(0,p.createElement)("button",{type:"button",className:"gp-select-trigger","aria-haspopup":"menu","aria-expanded":x,title:X,onClick:he},[(0,p.createElement)("span",{key:"l",className:"gp-select-trigger__label"},X),(0,p.createElement)(En.IconChevronDownOutlineRegular,{key:"c",className:"gp-select-trigger__chevron",size:14})]),na=o?(0,p.createElement)("button",{key:"more",type:"button",className:`gp-btn gp-toolbar__more-toggle${g.author!==""||g.since!==""?" gp-btn--primary":""}`,title:l("overview.moreFilters"),"aria-label":l("overview.moreFilters"),"aria-expanded":E,...E?{"aria-controls":I}:{},onClick:()=>O(x=>!x)},(0,p.createElement)("span",{key:"c",className:`gp-toolbar__chev${E?" gp-toolbar__chev--up":""}`},(0,p.createElement)(ht,{size:14,open:!0}))):null,Po=(0,p.createElement)("button",{key:"fetch",type:"button",className:"gp-icon-btn",title:l("overview.fetch"),disabled:oe,onClick:()=>void Ne()},(0,p.createElement)(en,{size:14})),Lo=(0,p.createElement)(En.Menu,{key:"author",open:w,onClose:()=>h(!1),items:Eo,selectedId:g.author,onSelect:x=>{h(!1),b(X=>({...X,author:x}))},align:"start",portal:!0,className:"gp-filter",anchor:ta(w,Ro,()=>h(x=>!x))}),Do=(0,p.createElement)(En.Menu,{key:"since",open:k,onClose:()=>S(!1),items:Go,selectedId:g.since,onSelect:x=>{S(!1),b(X=>({...X,since:x}))},align:"start",portal:!0,className:"gp-filter",anchor:ta(k,Mo,()=>S(x=>!x))}),ra=(0,p.createElement)("input",{key:"search",className:"gp-search",placeholder:l(G||o?"overview.searchShort":"overview.search"),value:f,onChange:x=>y(x.target.value)}),aa=[Lo,Do,Po],Ao=o?[(0,p.createElement)("button",{key:"filter",type:"button",className:`gp-btn${g.ref!==null?" gp-btn--primary":""}`,title:l("overview.filterBranch"),onClick:()=>it(!0)},[(0,p.createElement)(Da,{key:"ic",size:13}),(0,p.createElement)("span",{key:"l",className:"gp-btn__label"},g.ref??l("overview.filterBranch"))]),ra,...na===null?[]:[na],...E?[(0,p.createElement)("div",{key:"more",id:I,className:"gp-toolbar__more"},aa)]:[]]:[ra,...aa],ia=(0,p.createElement)("div",{key:"mid",className:"gp-col gp-col--mid gp-history"},[(0,p.createElement)("div",{key:"tb",className:"gp-toolbar",ref:D},Ao),(0,p.createElement)("div",{key:"list",className:"gp-history__list",ref:U,onScroll:Mn},Ue.length===0?(0,p.createElement)("div",{className:"gp-empty"},l(Le?"common.loading":Ft?"overview.loadFailed":"overview.noResults")):St.map(x=>$s(x,{selected:me?.hash===x.commit.hash,current:!a.unborn&&a.head!==null&&a.head!==""&&x.commit.hash.startsWith(a.head),gridTpl:ft,laneCount:je,now:kr,compact:o,rowH:et,onSelect:()=>xr(x.commit),onHoverEnter:re.onHoverEnter,onHoverLeave:re.onHoverLeave,t:l})))]),oa=x=>re.detail!==null&&re.detail.stats.length>0?(0,p.createElement)("div",{className:x},[(0,p.createElement)("span",{key:"f"},l("overview.changeSummary",{files:re.detail.stats.length})),(0,p.createElement)("span",{key:"sep",className:"gp-detail__summary-sep"},"\xB7"),(0,p.createElement)("span",{key:"a",className:"gp-stats__add"},`+${re.detail.insertions}`),(0,p.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${re.detail.deletions}`)]):null,sa=me===null?[(0,p.createElement)("div",{key:"empty",className:"gp-empty"},[(0,p.createElement)(zn,{key:"i",size:20}),l("overview.selectCommit")])]:[(0,p.createElement)("div",{key:"files",className:"gp-detail__files"},re.detail===null?(0,p.createElement)("div",{className:"gp-empty"},re.detailError?l("overview.detailFailed"):l("common.loading")):[o?null:oa("gp-detail__summary"),Js(qt,{activePath:re.fileDiff?.path??null,openTitle:l("overview.openFileDiff"),onOpen:x=>{me!==null&&re.openFileDiff(x,me.hash,me.shortHash)},collapsed:Sr,onToggleDir:mn,expandLabel:l("overview.expandDir"),collapseLabel:l("overview.collapseDir")})]),(0,p.createElement)("div",{key:"msg",className:"gp-detail__msg"},[(0,p.createElement)("div",{key:"subj",className:"gp-detail__subject"},me.subject),(0,p.createElement)("div",{key:"meta",className:"gp-detail__meta"},[(0,p.createElement)("span",{key:"h",className:"gp-commit-hash"},me.shortHash),(0,p.createElement)("span",{key:"a"},me.author),(0,p.createElement)("span",{key:"t"},Tn(me.dateIso))]),(0,p.createElement)("div",{key:"ops",className:"gp-detail__ops"},(()=>{let x=me.refs.filter(X=>X.kind==="tag");return[x.length>0?(0,p.createElement)("div",{key:"tags",className:"gp-detail__tags"},x.map(X=>(0,p.createElement)("span",{key:`tag-${X.name}`,className:"gp-ref-chip gp-ref-chip--tag gp-ref-chip--del",title:X.name},[(0,p.createElement)(Yt,{key:"i",size:11}),(0,p.createElement)("span",{key:"n",className:"gp-detail__tagname"},X.name),(0,p.createElement)("button",{key:"x",type:"button",className:"gp-ref-chip__x",title:l("tag.deleteOne",{name:X.name}),onClick:()=>{_(null),ne(X.name)}},(0,p.createElement)(We,{size:11}))]))):null,(0,p.createElement)("div",{key:"actions",className:"gp-detail__actions"},[(0,p.createElement)("button",{key:"revert",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.revert"),onClick:()=>{_(null),N({hash:me.hash,shortHash:me.shortHash,subject:me.subject})}},[(0,p.createElement)(Ia,{key:"i",size:12}),l("overview.revert")]),(0,p.createElement)("button",{key:"reset",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.reset"),onClick:()=>{_(null),s(),Q({hash:me.hash,shortHash:me.shortHash,subject:me.subject})}},[(0,p.createElement)(Bn,{key:"i",size:12}),l("overview.reset")]),(0,p.createElement)("button",{key:"addtag",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.createTag"),onClick:()=>{_(null),Y({hash:me.hash,shortHash:me.shortHash})}},[(0,p.createElement)(Yt,{key:"i",size:12}),l("overview.createTag")])])]})()),re.detail!==null&&re.detail.body!==""?(0,p.createElement)("pre",{key:"body",className:"gp-detail__body"},re.detail.body):(0,p.createElement)("div",{key:"nb",className:"gp-empty"},l("overview.noMessage"))])];return o?(0,p.createElement)("div",{className:"gp-overview gp-overview--compact"},[Yr,...ea,wt==="detail"?(0,p.createElement)("div",{key:"detail",className:"gp-col gp-col--mid gp-detail"},[(0,p.createElement)("div",{key:"back",className:"gp-subhead"},[(0,p.createElement)("button",{key:"b",type:"button",className:"gp-subhead__back",onClick:()=>Ye("list")},[(0,p.createElement)(Zt,{key:"i",size:14}),l("overview.backToList")]),oa("gp-detail__summary gp-detail__summary--inline")]),...sa]):ia,Hr(a,Qr),at?Xs(Ce,gt,g.ref,ee,{onFilter:x=>{yn(x),it(!1)},switchOptions:Dt,onSwitch:x=>{it(!1),At(x)},onToggle:x=>J(X=>{let he=new Set(X);return he.has(x)?he.delete(x):he.add(x),he}),onRetry:ot,onClose:()=>it(!1),t:l},st):null]):(0,p.createElement)("div",{className:"gp-overview"},[Yr,...ea,(0,p.createElement)("div",{key:"left",className:"gp-col gp-col--left",style:{flex:`0 0 ${jt.width}px`}},[(0,p.createElement)("div",{key:"scroll",className:"gp-col-left__scroll"},Zi(Ce,gt,g.ref,ee,{onFilter:x=>yn(x),switchOptions:Dt,onSwitch:At,onToggle:x=>J(X=>{let he=new Set(X);return he.has(x)?he.delete(x):he.add(x),he}),onRetry:ot,t:l},st)),Hr(a,Qr)]),jt.divider,ia,hn.divider,(0,p.createElement)("div",{key:"right",className:"gp-col gp-col--right gp-detail",style:{flex:`0 0 ${hn.width}px`}},sa),Os(re.hover,re.hoverBody,l)])}function Os(e,t,n){if(e===null||typeof document>"u")return null;let r=460,a=Math.min(e.x+16,(typeof window<"u"?window.innerWidth:1200)-r-12),i=e.y+14,s=(0,p.createElement)("div",{className:"gp-hovercard",style:{left:a,top:i,maxWidth:r}},[(0,p.createElement)("div",{key:"subj",className:"gp-hovercard__subject"},e.commit.subject),(0,p.createElement)("div",{key:"meta",className:"gp-hovercard__meta"},[(0,p.createElement)("span",{key:"h",className:"gp-commit-hash"},e.commit.shortHash),(0,p.createElement)("span",{key:"a"},e.commit.author),(0,p.createElement)("span",{key:"t"},Tn(e.commit.dateIso))]),t===null?(0,p.createElement)("div",{key:"l",className:"gp-hovercard__loading"},n("common.loading")):t===""?(0,p.createElement)("div",{key:"e",className:"gp-hovercard__loading"},n("overview.noMessage")):(0,p.createElement)("pre",{key:"body",className:"gp-hovercard__body"},t)]);return(0,lr.createPortal)(s,document.body,"commit-hovercard")}function Zi(e,t,n,r,a,i){if(t)return(0,p.createElement)("div",{className:"gp-empty"},[(0,p.createElement)("span",{key:"m"},a.t("overview.branchesError")),(0,p.createElement)("button",{key:"r",type:"button",className:"gp-btn",style:{marginTop:8},onClick:a.onRetry},a.t("common.retry"))]);if(e===null)return(0,p.createElement)("div",{className:"gp-empty"},a.t("common.loading"));let s=(d,c,u,g,b)=>{let f=d.name,y=g==="local"&&e.current===d.name,w=g==="local"&&i.localPrimary===d.name||g==="remote"&&i.remotePrimary===d.name,h=`gp-branch-row${n===f?" gp-branch-row--active":""}${y?" gp-branch-row--current":""}${w?" gp-branch-row--primary":""}`,k=a.switchOptions.get(`${g}:${d.name}`),S=[y?a.t("overview.currentBranch"):"",w?a.t("overview.primaryBranch"):""].filter(Boolean).join(" \xB7 "),T=y?(0,p.createElement)(qa,{size:14}):w?(0,p.createElement)(Ua,{size:14}):b,D=(G,E)=>E&&E>0?(0,p.createElement)("span",{key:G,className:"gp-branch-row__sync",title:a.t(G==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:E}),"aria-label":a.t(G==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:E})},[(0,p.createElement)(ja,{key:"icon",size:12,direction:G}),(0,p.createElement)("span",{key:"count"},E)]):null;return(0,p.createElement)("div",{key:d.name,className:h,style:{paddingLeft:ji+u*Wi},title:d.name,"data-current":y?"true":void 0,"data-primary":w?"true":void 0,onClick:()=>a.onFilter(n===f?null:f)},[(0,p.createElement)("span",{key:"i",className:`gp-branch-row__ic${y?" gp-branch-row__ic--current":w?" gp-branch-row__ic--primary":""}`,title:S||void 0,"aria-label":S||void 0},T),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},c),d.ahead||d.behind?(0,p.createElement)("span",{key:"t",className:"gp-branch-row__track"},[D("ahead",d.ahead),D("behind",d.behind)]):null,k===void 0?null:(0,p.createElement)("button",{key:"sw",type:"button",className:"gp-branch-row__switch",title:a.t(k.createFrom===void 0?"switch.rowTitle":"switch.rowTitleTrack",{name:k.name,ref:k.label}),onClick:G=>{G.stopPropagation(),a.onSwitch(k)}},a.t("switch.action"))])},o=(d,c,u,g,b)=>{for(let f of d){if(f.kind==="leaf"){b.push(s(f.branch,f.label,c,u,g));continue}let y=`${u}:${f.path}`,w=c===0,h=r.has(y)?!w:w;b.push((0,p.createElement)("div",{key:y,className:"gp-branch-row gp-branch-row--dir",style:{paddingLeft:ji+c*Wi},title:f.path,role:"button",tabIndex:0,"aria-expanded":h,onClick:()=>a.onToggle(y),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),a.onToggle(y))}},[(0,p.createElement)("span",{key:"c",className:"gp-branch-row__chev"},(0,p.createElement)(ht,{size:11,open:h})),(0,p.createElement)("span",{key:"i",className:"gp-branch-row__ic gp-branch-row__ic--folder"},(0,p.createElement)(Ba,{size:13})),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},f.label)])),h&&(f.self!==null&&b.push(s(f.self,f.path,c+1,u,g)),o(f.children,c+1,u,g,b))}},l=(d,c,u,g,b,f=[])=>{let y=[];if(!r.has(d)){for(let w of f)y.push(s(w,w.name,0,d,g));o(b,0,d,g,y)}return(0,p.createElement)("div",{key:d,className:"gp-branch-group"},[(0,p.createElement)("div",{key:"head",className:"gp-branch-group__head",onClick:()=>a.onToggle(d)},[(0,p.createElement)(ht,{key:"c",size:11,open:!r.has(d)}),`${a.t(c)} (${u})`]),...y])};return(0,p.createElement)("div",{},[(0,p.createElement)("div",{key:"head-row",className:"gp-branch-row",style:{fontWeight:600,justifyContent:"center",padding:"4px 10px"},onClick:()=>a.onFilter(null)},a.t("overview.head")),l("local","overview.local",e.local.length,(0,p.createElement)(Mr,{size:13}),i.local,i.localPinned),l("remote","overview.remote",e.remote.length,(0,p.createElement)(Mr,{size:13}),i.remote),l("tags","overview.tags",e.tags.length,(0,p.createElement)(Yt,{size:13}),i.tags)])}function Xs(e,t,n,r,a,i){if(typeof document>"u")return null;let s=(0,p.createElement)("div",{className:"gp-sheet-backdrop",onClick:o=>{o.target===o.currentTarget&&a.onClose()}},(0,p.createElement)("div",{className:"gp-sheet",role:"dialog","aria-modal":!0},[(0,p.createElement)("div",{key:"bar",className:"gp-sheet__bar"},[(0,p.createElement)("span",{key:"title",className:"gp-sheet__title"},a.t("overview.filterBranch")),(0,p.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-sheet__close",title:a.t("common.close"),onClick:a.onClose},(0,p.createElement)(We,{size:15}))]),(0,p.createElement)("div",{key:"body",className:"gp-sheet__body"},Zi(e,t,n,r,a,i))]));return(0,lr.createPortal)(s,document.body,"branch-filter-sheet")}function $s(e,t){let n=e.commit,r=n.refs.map(i=>(0,p.createElement)("span",{key:i.name,className:`gp-ref-chip${i.head?" gp-ref-chip--head":""}${i.kind==="remote"?" gp-ref-chip--remote":""}${i.kind==="tag"?" gp-ref-chip--tag":""}`},i.name)),a=(0,p.createElement)("div",{key:"g",className:"gp-graph-cell"},(0,p.createElement)(Za,{row:e,laneCount:t.laneCount,rowH:t.rowH,current:t.current}));return t.compact?(0,p.createElement)("div",{key:n.hash,className:`gp-commit-row gp-commit-row--compact${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl,height:`${t.rowH}px`},onClick:t.onSelect},[a,(0,p.createElement)("div",{key:"tx",className:"gp-commit-lines"},[(0,p.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,p.createElement)("div",{key:"m",className:"gp-commit-sub"},[(0,p.createElement)("span",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,p.createElement)("span",{key:"a",className:"gp-commit-author"},n.author),(0,p.createElement)("span",{key:"d",className:"gp-commit-date"},Ct(n.dateIso,t.now,t.t))])])]):(0,p.createElement)("div",{key:n.hash,className:`gp-commit-row${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl},onClick:t.onSelect,onMouseEnter:i=>t.onHoverEnter(n,i.clientX,i.clientY),onMouseLeave:t.onHoverLeave},[a,(0,p.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,p.createElement)("div",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,p.createElement)("div",{key:"a",className:"gp-commit-author"},n.author),(0,p.createElement)("div",{key:"d",className:"gp-commit-date",title:Cn(n.dateIso)},Ct(n.dateIso,t.now,t.t))])}function Js(e,t){let n=[],r=(a,i)=>{for(let s of a)if(s.dir){let o=t.collapsed.has(s.path);n.push((0,p.createElement)("div",{key:s.path,className:"gp-tree-row gp-tree-row--dir",style:{paddingLeft:10+i*14},title:o?t.expandLabel:t.collapseLabel,role:"button",tabIndex:0,"aria-expanded":!o,onClick:()=>t.onToggleDir(s.path),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.onToggleDir(s.path))}},[(0,p.createElement)(ht,{key:"c",size:11,open:!o}),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},s.name)])),o||r(s.children,i+1)}else{let o=String(s.meta??"modified"),l=t.activePath===s.path;n.push((0,p.createElement)("div",{key:s.path,className:`gp-tree-row${l?" gp-tree-row--active":""}`,style:{paddingLeft:10+i*14},title:t.openTitle,onClick:()=>t.onOpen(s.path)},[(0,p.createElement)("span",{key:"st",className:`gp-status-badge ${nn(o)}`},(Kn[o]??o[0]??"M").toUpperCase()),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},s.name)]))}};return r(e,0),(0,p.createElement)("div",{},n)}function Ks(e,t){if(e===null||typeof document>"u")return null;let{visible:n,data:r,error:a,mode:i,onMode:s,expanded:o,onExpand:l,onClose:d,remote:c,sessionId:u,compact:g,t:b}=t,f=g?["unified","before","after"]:["unified","split","before","after"],y=g&&i==="split"?"unified":i,w=r!==null&&r.text!==""?(()=>{let E=or(r.text);return(0,p.createElement)("span",{key:"sum",className:"gp-modal__sum"},[(0,p.createElement)("span",{key:"a",className:"gp-stats__add"},`+${E.add}`),(0,p.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${E.del}`)])})():null,h=(0,p.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${o?" gp-seg__btn--active":""}`,disabled:y!=="split"&&y!=="unified",title:b(o?"diff.collapse":"diff.expandAll"),onClick:()=>l(!o)},b(o?"diff.collapse":"diff.expandAll")),k=(0,p.createElement)("div",{key:"seg",className:"gp-seg"},Et(f,y,s,E=>b(`diff.${E}`))),S=(0,p.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:b("common.close"),onClick:d},(0,p.createElement)(We,{size:15})),T=[(0,p.createElement)("span",{key:"fileicon",className:"gp-modal__fileicon"},(0,p.createElement)(Ha,{size:15})),(0,p.createElement)("span",{key:"path",className:"gp-modal__path",title:e.path},Vs(e.path)),(0,p.createElement)("span",{key:"hash",className:"gp-modal__hash"},e.shortHash),w,h],D=g?[(0,p.createElement)("div",{key:"brow1",className:"gp-modal__bar-row"},T),(0,p.createElement)("div",{key:"brow2",className:"gp-modal__bar-row gp-modal__bar-row--controls"},[k,S])]:[...T,k,S],G=(0,p.createElement)("div",{className:"gp-modal-backdrop",onClick:E=>{E.target===E.currentTarget&&d()}},(0,p.createElement)("div",{className:"gp-modal",role:"dialog","aria-modal":!0},[(0,p.createElement)("div",{key:"bar",className:"gp-modal__bar"},D),(0,p.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},r===null?(0,p.createElement)("div",{className:"gp-empty"},b(a?"overview.diffFailed":"common.loading")):(0,p.createElement)(ir,{key:"diff",visible:n,text:r.text,mode:y,path:e.path,remote:c,sessionId:u,base:"commit",commit:e.hash,expanded:o,truncated:r.truncated===!0,newLines:r.newLines,t:b}))]));return(0,lr.createPortal)(G,document.body,"file-diff-modal")}function Vs(e){let t=e.lastIndexOf("/");return t<0?[(0,p.createElement)("span",{key:"n",className:"gp-modal__name"},e)]:[(0,p.createElement)("span",{key:"d",className:"gp-modal__dir"},e.slice(0,t+1)),(0,p.createElement)("span",{key:"n",className:"gp-modal__name"},e.slice(t+1))]}var m=require("react");var nt=require("react");function eo(e,t,n,r,a,i){let[s,o]=(0,nt.useState)([]),[l,d]=(0,nt.useState)(null),[c,u]=(0,nt.useState)(null),g=(0,nt.useRef)(null),b=(0,nt.useRef)(0);Nt([t,...i],r,async h=>{let k=await e.query({sessionId:t,query:{kind:"stash-list"}});if(!h())return;let S=be(k,"stash-list");S!==null?o(S.entries):a()},a);let f=l!==null&&n.changes.some(h=>h.path===l.path);(0,nt.useEffect)(()=>{l===null||f||(g.current=null,d(null),u(null))},[l,f]);let y=[t,...i,l?.path,l?.base,l?.expand,l?.version];Nt(y,r&&f,async h=>{if(l===null)return;let k=l,S=await e.query({sessionId:t,query:{kind:"diff",path:k.path,base:k.base,...k.expand?{context:2e3}:{}}});if(!h()||g.current!==k)return;let T=be(S,"diff");u(T!==null?{text:T.text,newLines:T.newLines,truncated:T.truncated}:{text:"",newLines:0})},()=>u({text:"",newLines:0}));let w=(0,nt.useCallback)((h,k,S=!1)=>{let T={path:h,base:k,expand:S,version:++b.current};g.current=T,d(T),u(null)},[]);return{stashes:s,diffPath:l,diffData:c,expanded:l?.expand??!1,showDiff:w}}var Be=require("react");function to({stats:e,compact:t=!1,t:n}){let r=Date.now(),a=[(0,Be.createElement)("span",{key:"files",className:"gp-stats__item"},n("stats.files",{n:e.fileCount})),(0,Be.createElement)("span",{key:"lines",className:"gp-stats__item"},[(0,Be.createElement)("span",{key:"a",className:"gp-stats__add"},`+${e.insertions}`)," ",(0,Be.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${e.deletions}`)])];e.staged>0&&a.push((0,Be.createElement)("span",{key:"st",className:"gp-stats__item"},n("stats.staged",{n:e.staged}))),e.modified>0&&a.push((0,Be.createElement)("span",{key:"mo",className:"gp-stats__item"},n("stats.modified",{n:e.modified}))),e.untracked>0&&a.push((0,Be.createElement)("span",{key:"un",className:"gp-stats__item"},n("stats.untracked",{n:e.untracked}))),e.partial&&a.push((0,Be.createElement)("span",{key:"partial",className:"gp-stats__item gp-stats__partial",title:n("stats.partialHint")},n("stats.partial")));let i=[];e.lastChangeAt!==null&&i.push((0,Be.createElement)("span",{key:"lc",className:"gp-stats__item",title:Cn(e.lastChangeAt)},n("stats.lastChange",{time:Ct(e.lastChangeAt,r,n)}))),e.headCommittedAt!==null&&i.push((0,Be.createElement)("span",{key:"hc",className:"gp-stats__item",title:Cn(e.headCommittedAt)},n("stats.lastCommit",{time:Ct(e.headCommittedAt,r,n)})));let s=i.length>0?(0,Be.createElement)("span",{key:"times",className:"gp-stats__times"},i):null;return t?(0,Be.createElement)("div",{className:"gp-stats gp-stats--compact"},(0,Be.createElement)("div",{key:"main",className:"gp-stats__main"},a)):(0,Be.createElement)("div",{className:"gp-stats"},s===null?a:[...a,s])}function dr(e){return e.path+(e.staged?":s":":w")}function no(e){return e.endsWith(":s")?"s":e.endsWith(":w")?"w":null}function cr(e){return no(e)===null?e:e.slice(0,-2)}function ro(e){let t=new Set,n=new Set,r={w:t,s:n};for(let a of e){let i=no(a);i!==null&&r[i].add(cr(a))}return{paths:[...t].sort(),stagedOnly:[...n].filter(a=>!t.has(a)).sort()}}var cn=require("react");function ao({paths:e,stagedOnly:t,snapshot:n,busy:r,error:a,onConfirm:i,onClose:s,t:o}){let l=(0,cn.useMemo)(()=>{let c=new Set(e);return n.changes.filter(u=>u.status==="untracked"&&c.has(u.path)).length},[e,n]),d=t.length>0||l>0?(0,cn.createElement)("div",{key:"notes"},[t.length>0?(0,cn.createElement)("div",{key:"staged",className:"gp-modal__confirmtext"},o("changes.discardPickedStaged",{count:t.length})):null,l>0?(0,cn.createElement)("div",{key:"untracked",className:"gp-modal__confirmtext"},o("changes.discardPickedUntracked",{count:l})):null]):null;return Je({title:o("changes.discardPickedTitle"),body:o("changes.discardPickedBody",{count:e.length}),extra:d,confirmLabel:o("changes.discard"),danger:!0,error:a,confirmBusy:r,busyLabel:o("changes.discarding"),onConfirm:i,onClose:s,t:o})}var ze=require("react");function io(e){let{snapshot:t,busy:n,t:r}=e,[a,i]=(0,ze.useState)(!1),s=(0,ze.useRef)(!1),{tipProps:o,tipNode:l,hideTip:d}=Mt({placement:"below"});(0,ze.useEffect)(()=>{d()},[t,d]);let c=async()=>{if(!s.current){s.current=!0,i(!0);try{await e.onRefresh()}finally{s.current=!1,i(!1)}}},u=n||a,g=(b,f,y,w,h,k="")=>(0,ze.createElement)("button",{key:b,type:"button",className:`gp-icon-btn gp-changes__${b}${k}`,"aria-label":r(f),disabled:u||w,...b==="refresh"?{"aria-busy":a}:{},...o(r(f)),onClick:()=>{d(),h()}},(0,ze.createElement)("span",{"aria-hidden":!0},y));return(0,ze.createElement)("div",{className:"gp-toolbar gp-changes__toolbar",role:"group","aria-label":r("changes.actions")},[g("stage-all","changes.stageAll",(0,ze.createElement)(Aa,{size:16}),t.changes.length===0,e.onStageAll),g("unstage-all","changes.unstageAll",(0,ze.createElement)(za,{size:16}),t.staged===0,e.onUnstageAll),g("discard-picked","changes.discardPicked",(0,ze.createElement)(Hn,{size:16}),!e.hasDiscardTargets,e.onDiscard),g("stash","changes.stash",(0,ze.createElement)(Fn,{size:16}),t.staged===0&&t.modified===0,e.onStash),g("push","status.pushTitle",(0,ze.createElement)(_n,{size:16}),!vt(t),e.onPush),g("refresh","changes.refresh",(0,ze.createElement)(en,{size:16}),!1,()=>void c(),a?" gp-changes__refresh--busy":""),l])}var Ir=28,oo=26,qs=8,Us=600;function so({remote:e,sessionId:t,visible:n=!0,snapshot:r,onAction:a,onRefresh:i,compact:s,t:o}){let{queryVisible:l,queryKey:d}=Dn(t,n,r.root),[c,u]=(0,m.useState)(new Set),[g,b]=(0,m.useState)(""),[f,y]=(0,m.useState)(!1),[w,h]=(0,m.useState)(!1),[k,S]=(0,m.useState)(!1),[T,D]=(0,m.useState)(!1),G=w||T,[E,O]=(0,m.useState)(null),[I,ee]=(0,m.useState)(new Set),[J,B]=(0,m.useState)(null),[F,ae]=(0,m.useState)(!1),{stashes:le,diffPath:L,diffData:Y,expanded:ie,showDiff:ne}=eo(e,t,r,l,()=>O(o("error.generic")),d),[H,N]=(0,m.useState)(()=>r.defaultDiffView),[P,Q]=(0,m.useState)(!1),[z,_]=(0,m.useState)(!1),[j,V]=(0,m.useState)(!1),[oe,Ge]=(0,m.useState)(null),ye=tr(),[Me,Pe]=(0,m.useState)("list"),[_e,Ae]=(0,m.useState)(!1),[C,ue]=(0,m.useState)(!0),[ge,pe]=(0,m.useState)(!1),[Se,Re]=(0,m.useState)(null),Qe=(0,m.useRef)(null),ut=(0,m.useRef)(null),Pt=(0,m.useCallback)(M=>{Qe.current=M,M!==null&&s&&_e&&M.focus()},[s,_e]),{setEl:gn,viewport:qe}=on(),{tipProps:wt,tipNode:Ye,hideTip:Fe,showTipNow:xt}=Mt({placement:"above",maxWidth:300}),rt=(0,m.useMemo)(()=>r.changes.filter(M=>M.staged).sort(Or),[r]),Lt=(0,m.useMemo)(()=>r.changes.filter(M=>!M.staged&&M.status!=="untracked").sort(Or),[r]),at=(0,m.useMemo)(()=>r.changes.filter(M=>M.status==="untracked").sort(Or),[r]),it=[{key:"staged",labelKey:"changes.groupStaged",items:rt},{key:"unstaged",labelKey:"changes.groupUnstaged",items:Lt},{key:"untracked",labelKey:"changes.groupUntracked",items:at}],Ce={staged:r.stats.staged,unstaged:r.stats.modified,untracked:r.stats.untracked},gt=it.filter(M=>M.items.length>0||r.truncated&&Ce[M.key]>0),{items:kt,tops:ot,totalH:Dt}=(0,m.useMemo)(()=>{let M=[];for(let se of gt){let Te=r.truncated?Ce[se.key]:se.items.length;if(M.push({kind:"head",g:{key:se.key,labelKey:se.labelKey,count:Te,collapsible:se.items.length>0}}),!I.has(se.key))for(let Ne of se.items)M.push({kind:"row",c:Ne})}let q=rn(M.map(se=>se.kind==="head"?oo:Ir));return{items:M,tops:q,totalH:q[M.length]}},[rt,Lt,at,I,r.truncated,r.stats]),_t=qe.height>0?qe.height:Us,{first:st,last:At}=an(ot,qe.top,_t,qs*Ir);(0,m.useEffect)(()=>{Fe()},[st,At,r,Fe]),(0,m.useEffect)(()=>{u(M=>{if(M.size===0)return M;let q=new Set(r.changes.map(Ne=>dr(Ne))),se=new Set,Te=!1;for(let Ne of M)q.has(Ne)?se.add(Ne):Te=!0;return Te?se:M})},[r]),(0,m.useEffect)(()=>{if(!l||!Ie.isVisible()||!f||P||g.trim()!=="")return;let M=!0;return e.query({sessionId:t,query:{kind:"last-commit-message"}}).then(q=>{let se=be(q,"last-commit-message");M&&se!==null&&(b(se.message),Q(!0))}),()=>{M=!1}},[f,P,g,e,t,l]),(0,m.useEffect)(()=>{L===null&&Pe("list")},[L]),(0,m.useEffect)(()=>{Me==="diff"&&Ae(!1)},[Me]),(0,m.useEffect)(()=>{if(!s||!_e||typeof document>"u")return;let M=q=>{if(z)return;let se=ut.current;se!==null&&q.target instanceof Node&&se.contains(q.target)||q.target instanceof Element&&q.target.closest(".gp-notice")!==null||Ae(!1)};return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[s,_e,z]);let re=(0,m.useRef)(null),Ue=(0,m.useRef)(!1);(0,m.useEffect)(()=>{let M=Ue.current;Ue.current=s&&_e,s&&M&&!_e&&re.current?.focus({preventScroll:!0})},[s,_e]),(0,m.useEffect)(()=>{B(null)},[r]),(0,m.useEffect)(()=>{V(!1)},[r]);let He=(0,m.useMemo)(()=>ro(c),[c]);(0,m.useEffect)(()=>{F&&He.paths.length===0&&ae(!1)},[F,He]);let zt=M=>{u(q=>{let se=new Set(q);return se.has(M)?se.delete(M):se.add(M),se})},Le=async M=>{if(G)return!1;h(!0),O(null),Ge(null);try{let q=await a(M);return q.ok?!0:(O(q.error??o("error.generic")),!1)}catch(q){return O(q instanceof Error?q.message:o("error.generic")),!1}finally{h(!1)}},Ft=async()=>{let M=g.trim();if(M===""&&!f){O(o("error.emptyMessage"));return}let q=c.size>0?[...new Set([...c].map(Te=>cr(Te)))]:void 0;await Le({kind:"commit",message:M,...q?{paths:q}:{},...f?{amend:!0}:{}})&&(b(""),u(new Set),y(!1),Q(!1),Ae(!1))},te=async M=>{await Le({kind:"stash-push",...M.trim()!==""?{message:M}:{}})&&pe(!1)},U=(M,q)=>{Le({kind:"stash-apply",index:M,sha:q})},fe=(M,q)=>{Le({kind:"stash-pop",index:M,sha:q})},Ze=async(M,q)=>{await Le({kind:"stash-drop",index:M,sha:q})&&Re(null)},St=async()=>{let M=[...He.paths];if(M.length===0){ae(!1);return}await Le({kind:"discard",paths:M})&&ae(!1)},je=(M,q)=>{switch(M){case"empty-diff":return o("error.emptyDiff");case"llm-unavailable":return o("error.llmUnavailable");case"suggest-disabled":return o("error.suggestDisabled");case"llm-error":case"llm-output":return q===void 0?o("error.llmFailed"):`${o("error.llmFailed")}: ${q}`;default:return q??o("error.generic")}},lt=async()=>{if(z)return;if(f&&!j&&g.trim()!==""){V(!0),O(null),Ge(o("commit.suggestOverwrite"));return}V(!1);let M=c.size>0?[...new Set([...c].map(q=>cr(q)))]:void 0;_(!0),O(null),Ge(null);try{let q=await e.suggest({sessionId:t,...M&&M.length>0?{paths:M}:{}});q.ok?(b(q.value.message),q.value.truncated===!0&&Ge(o("commit.suggestTruncated")),Qe.current?.focus()):O(je(q.error.code,q.error.message))}catch(q){O(q instanceof Error?q.message:o("error.generic"))}finally{_(!1)}},et=M=>{ee(q=>{let se=new Set(q);return se.has(M)?se.delete(M):se.add(M),se})},ft=Y!==null&&Y.text!==""?or(Y.text):null,Mn=Kt({storageKey:"gp.changes.left",initial:380,min:220,reserve:200,edge:"end"}),xr=(M,q)=>{ne(M,q),s&&Pe("diff")},kr=s?["unified","before","after"]:["unified","split","before","after"],qt=s&&H==="split"?"unified":H,me=g.trim(),Ut=me.split(`
792
+ `)[0]??"",fn=G||z||me==="",_r=(0,m.createElement)("div",{key:"box",className:"gp-commitbox",ref:ut},[(0,m.createElement)("div",{key:"msg",className:`gp-commitbox__msg-wrap${z?" gp-commitbox__msg-wrap--busy":""}`},[(0,m.createElement)("textarea",{key:"ta",className:"gp-commitbox__msg",placeholder:o("commit.placeholder"),value:g,ref:Pt,readOnly:z,"aria-busy":z,onChange:M=>b(M.target.value)}),z?(0,m.createElement)("span",{key:"spin",className:"gp-commitbox__spin","aria-hidden":"true"}):null]),(0,m.createElement)("div",{key:"row",className:"gp-commitbox__row"},[(0,m.createElement)("label",{key:"amend",className:"gp-commitbox__amend"},[(0,m.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:f,disabled:z,onChange:()=>{y(M=>!M),Q(!1)}}),o("commit.amend")]),(0,m.createElement)("div",{key:"actions",className:"gp-commitbox__actions"},[r.suggestEnabled!==!1?(0,m.createElement)("button",{key:"suggest",type:"button",className:"gp-btn",disabled:G||z||r.changes.length===0,onClick:()=>void lt(),title:o("commit.suggest")},[(0,m.createElement)(Fa,{key:"ic",size:13}),o(z?"commit.suggesting":"commit.suggest")]):null,(0,m.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary",disabled:fn,onClick:()=>void Ft()},o("commit.commit")),s?(0,m.createElement)("button",{key:"fold",type:"button",className:"gp-icon-btn gp-commitbox__fold",disabled:z,title:o("commit.collapse"),"aria-label":o("commit.collapse"),onClick:()=>Ae(!1)},(0,m.createElement)(ht,{key:"i",size:13,open:!0})):null])])]),Sr=!s||_e?_r:(0,m.createElement)("div",{key:"box",className:"gp-commitbar"},[(0,m.createElement)("button",{key:"open",type:"button",className:"gp-commitbar__open",ref:re,title:o("commit.edit"),"aria-label":o("commit.edit"),onClick:()=>Ae(!0)},me===""?(0,m.createElement)("span",{key:"ph",className:"gp-commitbar__ph"},o("commit.placeholder")):(0,m.createElement)("span",{key:"draft",className:"gp-commitbar__draft"},Ut)),(0,m.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary gp-commitbar__commit",disabled:fn,onClick:()=>void Ft()},o("commit.commit"))]),mn=o("changes.untrackedCollapsed"),jt=o(r.truncatedReason==="lossy"?"changes.truncatedLossy":r.truncatedReason==="cap"?"changes.truncatedCap":"changes.truncatedUnknown",{n:r.changes.length}),hn=[(0,m.createElement)(to,{key:"stats",stats:r.stats,compact:s,t:o}),(0,m.createElement)(io,{key:"toolbar",snapshot:r,busy:G,hasDiscardTargets:He.paths.length>0,onStageAll:()=>void Le({kind:"stage-all"}),onUnstageAll:()=>void Le({kind:"unstage-all"}),onDiscard:()=>{O(null),ae(!0)},onStash:()=>{O(null),pe(!0)},onPush:()=>{Fe(),S(!0)},onRefresh:i,t:o}),E!==null?(0,m.createElement)("div",{key:"err",className:"gp-feedback"},E):null,oe!==null?(0,m.createElement)(bt,{key:"notice",text:oe,closeLabel:o("common.close"),onClose:()=>Ge(null)}):null,r.untrackedCollapsed===!0&&!ye.isDismissed(mn)?(0,m.createElement)(bt,{key:"collapsed",status:!0,text:mn,closeLabel:o("common.close"),onClose:()=>ye.dismiss(mn)}):null,r.truncated&&!ye.isDismissed(jt)?(0,m.createElement)(bt,{key:"truncated",status:!0,text:jt,closeLabel:o("common.close"),onClose:()=>ye.dismiss(jt)}):null,(0,m.createElement)("div",{key:"list",className:"gp-changes__list",ref:gn},r.changes.length===0?(0,m.createElement)("div",{className:"gp-empty"},o("changes.noChanges")):(0,m.createElement)("div",{className:"gp-changes__vlist",style:{height:Dt}},kt.slice(st,At).map((M,q)=>{let se=st+q;if(M.kind==="head"){let dt=M.g;return(0,m.createElement)("div",{key:`h:${dt.key}`,className:"gp-changes__vrow",style:{top:ot[se],height:oo}},(0,m.createElement)("div",{className:`gp-group-head${dt.collapsible?"":" gp-group-head--static"}`,...dt.collapsible?{onClick:()=>et(dt.key)}:{}},[dt.collapsible?(0,m.createElement)(ht,{key:"chev",size:12,open:!I.has(dt.key)}):(0,m.createElement)("span",{key:"chev",className:"gp-group-head__chev-spacer"}),`${o(dt.labelKey)} (${dt.count})`]))}let Te=M.c,Ne=dr(Te),Wt=Te.staged?"staged":"worktree";return(0,m.createElement)("div",{key:Ne,className:"gp-changes__vrow",style:{top:ot[se],height:Ir}},Qs(Te,{selected:c.has(Ne),active:L?.path===Te.path&&L.base===Wt,busy:G,armed:J===Ne,onToggle:()=>zt(Ne),onOpen:()=>xr(Te.path,Wt),onStage:()=>void Le(Te.staged?{kind:"unstage",paths:[Te.path]}:{kind:"stage",paths:[Te.path]}),onDiscard:()=>{J===Ne?(Le({kind:"discard",paths:[Te.path]}),B(null)):B(Ne)},tipProps:wt,hideTip:Fe,showTipNow:xt,t:o}))}))),le.length>0?(0,m.createElement)("div",{key:"stashes",className:"gp-stash"},[(0,m.createElement)("div",{key:"head",className:"gp-group-head",onClick:()=>ue(M=>!M)},[(0,m.createElement)(ht,{key:"chev",size:12,open:!C}),`${o("stash.section")} (${le.length})`]),C?null:(0,m.createElement)("div",{key:"items"},le.map(M=>Ws(M,{busy:G,onApply:()=>U(M.index,M.sha),onPop:()=>fe(M.index,M.sha),onDrop:()=>{O(null),Re(M)},t:o})))]):null,Sr],yn=L===null?(0,m.createElement)("div",{className:"gp-empty"},o("changes.selectFile")):(0,m.createElement)("div",{className:"gp-diff"},[(0,m.createElement)("div",{key:"tb",className:`gp-diff__toolbar${s?" gp-diff__toolbar--compact":""}`},(()=>{let M=s?(0,m.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>Pe("list")},[(0,m.createElement)(Zt,{key:"i",size:14}),o("changes.backToList")]):null,q=(0,m.createElement)("span",{key:"path",className:"gp-diff__path"},L.path),se=ft?(0,m.createElement)("span",{key:"sum",className:"gp-stats__item",style:{marginLeft:"auto"}},[(0,m.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ft.add}`)," ",(0,m.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ft.del}`)]):null,Te=(0,m.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${ie?" gp-seg__btn--active":""}`,style:ft||s?{}:{marginLeft:"auto"},disabled:qt!=="split"&&qt!=="unified",title:o(ie?"diff.collapse":"diff.expandAll"),onClick:()=>void ne(L.path,L.base,!ie)},o(ie?"diff.collapse":"diff.expandAll")),Ne=(0,m.createElement)("div",{key:"seg",className:"gp-seg"},Et(kr,qt,N,Wt=>o(`diff.${Wt}`)));return s?[(0,m.createElement)("div",{key:"row1",className:"gp-diff__toolbar-row"},[M,q,se]),(0,m.createElement)("div",{key:"row2",className:"gp-diff__toolbar-row gp-diff__toolbar-row--controls"},[Te,Ne])]:[M,q,se,Te,Ne]})()),Y===null?(0,m.createElement)("div",{key:"scroll",className:"gp-diff__scroll"},(0,m.createElement)("div",{className:"gp-empty"},o("common.loading"))):(0,m.createElement)(ir,{key:"diff",visible:l,text:Y.text,mode:qt,path:L.path,remote:e,sessionId:t,base:L.base,expanded:ie,truncated:Y.truncated===!0,newLines:Y.newLines,t:o})]),Rn=[k?(0,m.createElement)(sr,{key:"remote-push",remote:e,sessionId:t,snapshot:r,onAction:a,onClose:()=>S(!1),onBusyChange:D,t:o}):null,ge?(0,m.createElement)(js,{key:"push",onClose:()=>pe(!1),onStash:te,error:E,t:o}):null,Se!==null?Je({title:o("stash.dropTitle"),body:o("stash.dropConfirm",{name:Se.message}),confirmLabel:o("stash.drop"),danger:!0,error:E,onConfirm:()=>void Ze(Se.index,Se.sha),onClose:()=>Re(null),t:o}):null,F&&He.paths.length>0?(0,m.createElement)(ao,{key:"discard-picked",paths:He.paths,stagedOnly:He.stagedOnly,snapshot:r,busy:G,error:E,onConfirm:()=>void St(),onClose:()=>ae(!1),t:o}):null];return s?(0,m.createElement)("div",{className:"gp-changes gp-changes--compact"},[...Rn,Ye,Me==="diff"?(0,m.createElement)("div",{key:"right",className:"gp-changes__right"},yn):(0,m.createElement)("div",{key:"left",className:"gp-changes__left"},hn)]):(0,m.createElement)("div",{className:"gp-changes"},[...Rn,Ye,(0,m.createElement)("div",{key:"left",className:"gp-changes__left",style:{flex:`0 0 ${Mn.width}px`}},hn),Mn.divider,(0,m.createElement)("div",{key:"right",className:"gp-changes__right"},yn)])}function js({onClose:e,onStash:t,error:n,t:r}){let[a,i]=(0,m.useState)("");return Gt({onClose:e,title:r("stash.title"),icon:(0,m.createElement)(Fn,{size:15}),portalKey:"stash-push-modal",t:r,body:[(0,m.createElement)("input",{key:"msg",className:"gp-input",placeholder:r("stash.messagePlaceholder"),value:a,autoFocus:!0,onChange:s=>i(s.target.value),onKeyDown:s=>{s.key==="Enter"&&t(a)}}),ln(r),n!==null?(0,m.createElement)("div",{key:"err",className:"gp-feedback"},n):null],footer:dn({onClose:e,onConfirm:()=>void t(a),confirmLabel:r("stash.save"),confirmDisabled:!1,danger:!1,t:r})})}function Ws(e,t){return(0,m.createElement)("div",{key:e.index,className:"gp-stash-row"},[(0,m.createElement)("div",{key:"info",className:"gp-stash-row__info"},[(0,m.createElement)("span",{key:"m",className:"gp-stash-row__msg",title:e.message},e.message),(0,m.createElement)("span",{key:"meta",className:"gp-stash-row__meta"},[e.branch!==null?(0,m.createElement)("span",{key:"b"},t.t("stash.onBranch",{branch:e.branch})):null,e.relTime!==""?(0,m.createElement)("span",{key:"t"},e.relTime):null])]),(0,m.createElement)("div",{key:"act",className:"gp-stash-row__actions"},[(0,m.createElement)("button",{key:"apply",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onApply},t.t("stash.apply")),(0,m.createElement)("button",{key:"pop",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onPop},t.t("stash.pop")),(0,m.createElement)("button",{key:"drop",type:"button",className:"gp-icon-btn",disabled:t.busy,title:t.t("stash.drop"),onClick:t.onDrop},(0,m.createElement)(Hn,{size:14}))])])}function Or(e,t){return e.path.localeCompare(t.path)}function Qs(e,t){let n=e.path.split("/").pop()??e.path,r=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,m.createElement)("div",{key:dr(e),className:`gp-file-row${t.active?" gp-file-row--active":""}`,onClick:t.onOpen},[(0,m.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:t.selected,onClick:a=>a.stopPropagation(),onChange:t.onToggle}),(0,m.createElement)("span",{key:"st",className:`gp-status-badge ${nn(e.status)}`},Kn[e.status]??"?"),(0,m.createElement)("span",{key:"nm",className:"gp-tree-name",title:e.path},[n,r?(0,m.createElement)("span",{key:"d",style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6,fontSize:11}},r):null]),(0,m.createElement)("span",{key:"act",className:"gp-file-row__actions"},[(0,m.createElement)("button",{key:"stg",type:"button",className:"gp-icon-btn","aria-label":e.staged?t.t("changes.unstage"):t.t("changes.stage"),disabled:t.busy,...t.tipProps(e.staged?t.t("changes.unstageTip"):t.t("changes.stageTip")),onClick:a=>{a.stopPropagation(),t.hideTip(),t.onStage()}},e.staged?"\u2212":"+"),e.staged?null:(0,m.createElement)("button",{key:"dis",type:"button",className:"gp-icon-btn","aria-label":t.armed?t.t("changes.discardConfirm"):t.t("changes.discard"),style:t.armed?{color:"var(--dsw-alias-state-error-primary)"}:{},disabled:t.busy,...t.tipProps(t.armed?t.t("changes.discardTipArmed"):t.t("changes.discardTip")),onClick:a=>{if(a.stopPropagation(),t.armed){t.hideTip(),t.onDiscard();return}t.onDiscard(),t.showTipNow(a.currentTarget,t.t("changes.discardTipArmed"))}},"\u21BA")])])}var v=require("react"),fo=require("react-dom");var De=require("@deepseek-ai/dsh-client-ui-primitives");var ce=require("react");function Xr(e){if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],n=e/1024,r=0;for(;(n>=1024||Number(n.toFixed(1))>=1024)&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}var Ys={bash:"Bash",c:"C",cpp:"C++",csharp:"C#",css:"CSS",dockerfile:"Dockerfile",go:"Go",html:"HTML",java:"Java",javascript:"JavaScript",json:"JSON",jsx:"JSX",kotlin:"Kotlin",markdown:"Markdown",php:"PHP",python:"Python",ruby:"Ruby",rust:"Rust",scss:"SCSS",shellscript:"Shell",sql:"SQL",swift:"Swift",toml:"TOML",tsx:"TSX",typescript:"TypeScript",vue:"Vue",xml:"XML",yaml:"YAML"};function lo(e){return Ys[e]??Zs(e)}function Zs(e){return e.charAt(0).toUpperCase()+e.slice(1)}var pn=require("@deepseek-ai/dsh-client-ui-primitives");function el(e,t){let n=tl(e.path);if(e.kind==="binary")return t("files.propsTypeBinary");let r=Sn(e.path);if((e.kind==="image"||e.kind==="tooLarge")&&r!==null){let o=r.slice(6).toUpperCase();return t("files.propsTypeFmt",{label:t("files.propsTypeImage",{fmt:o}),ext:n})}let a=(0,pn.languageForPath)(e.path),s=a!==void 0&&a!==""?lo(a):e.kind==="tooLarge"?t("files.propsTypeUnread"):t("files.propsTypeText");return n===""?s:t("files.propsTypeFmt",{label:s,ext:n})}function tl(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n+1):""}function Rt(e,t,n){return{label:e,value:typeof t=="string"?(0,ce.createElement)("span",{},t):t,key:n}}function $r(e,t,n){return(0,ce.createElement)("div",{key:n,className:"gp-props__group"},[e!==null?(0,ce.createElement)("div",{key:"t",className:"gp-props__group-title"},e):null,...t.map(r=>(0,ce.createElement)("div",{key:r.key,className:"gp-props__row"},[(0,ce.createElement)("span",{key:"l",className:"gp-props__label"},r.label),(0,ce.createElement)("span",{key:"v",className:"gp-props__value"},r.value)]))])}function co(e,t,n){return(0,ce.createElement)("button",{type:"button",className:"gp-props__copy",title:t,"aria-label":t,onClick:n},(0,ce.createElement)("code",{className:"gp-props__mono"},e))}function nl(e,t,n){let r=[],a=e.filter(i=>i.path===t&&!i.isDirectory);a.some(i=>i.staged)&&r.push((0,ce.createElement)("span",{key:"staged",className:"gp-props__badge gp-status--added"},n("files.propsStaged")));for(let i of a)i.staged||i.status==="untracked"||r.push((0,ce.createElement)("span",{key:i.status,className:`gp-props__badge ${nn(i.status)}`},rl(i.status,n)));return r}function rl(e,t){switch(e){case"added":return t("files.stAdded");case"modified":return t("files.stModified");case"deleted":return t("files.stDeleted");case"renamed":return t("files.stRenamed");case"untracked":return t("files.propsUntracked");case"conflicted":return t("files.stConflicted");case"typechange":return t("files.stTypechange")}}function po({input:e,snapshot:t,onClose:n,t:r}){let[a,i]=(0,ce.useState)(null);(0,ce.useEffect)(()=>{if(e.kind!=="image"||e.dataUrl===void 0)return;let k=!0,S=new Image;return S.onload=()=>{k&&i({w:S.naturalWidth,h:S.naturalHeight})},S.src=e.dataUrl,()=>{k=!1}},[e.kind,e.dataUrl]);let[s,o]=(0,ce.useState)(null),l=(0,ce.useRef)(void 0);(0,ce.useEffect)(()=>{o(null)},[e.path]),(0,ce.useEffect)(()=>()=>{l.current!==void 0&&clearTimeout(l.current)},[]);let d=k=>{(0,pn.writeClipboard)(k).then(S=>{o(S?"copied":"error"),l.current!==void 0&&clearTimeout(l.current),l.current=setTimeout(()=>o(null),1600)})},c=e.path.lastIndexOf("/"),u=c<0?e.path:e.path.slice(c+1),g=[Rt(r("files.propsName"),(0,ce.createElement)("span",{className:"gp-props__strong"},u),"name"),Rt(r("files.propsType"),el(e,r),"type"),Rt(r("files.propsRelPath"),co(e.path,r("files.propsCopyHint"),()=>d(e.path)),"rel")];if(t!==null){let k=`${t.root}/${e.path}`;g.push(Rt(r("files.propsAbsPath"),co(k,r("files.propsCopyHint"),()=>d(k)),"abs"))}let b=[];if(e.size!==void 0){let k=e.size>=1024?(0,ce.createElement)("span",{},[(0,ce.createElement)("span",{key:"h",className:"gp-props__strong"},Xr(e.size)),(0,ce.createElement)("span",{key:"b",className:"gp-props__sub"},r("files.propsSizeBytes",{bytes:e.size.toLocaleString("en-US")}))]):(0,ce.createElement)("span",{className:"gp-props__strong"},Xr(e.size));b.push(Rt(r("files.propsSize"),k,"size"))}e.kind==="text"&&e.lines!==void 0&&b.push(Rt(r("files.propsLines"),(0,ce.createElement)("span",{className:"gp-props__strong"},String(e.lines)),"lines")),a!==null&&b.push(Rt(r("files.propsImageSize"),(0,ce.createElement)("span",{className:"gp-props__strong"},r("files.propsImageSizeFmt",a)),"dims"));let f=[];e.mtimeMs!==void 0&&f.push(Rt(r("files.propsMtime"),(0,ce.createElement)("span",{title:Ct(e.mtimeMs,Date.now(),r)},Tn(e.mtimeMs)),"mtime"));let y=[$r(null,g,"g-basic"),b.length>0?$r(r("files.propsGroupStats"),b,"g-stats"):null,f.length>0?$r(r("files.propsGroupTime"),f,"g-time"):null],w=[];t!==null&&(w.push(e.ignored?(0,ce.createElement)("span",{key:"ig",className:"gp-props__badge gp-props__badge--muted"},r("files.ignored")):li(t.changes,e.path)?(0,ce.createElement)("span",{key:"un",className:"gp-props__badge gp-props__badge--muted"},r("files.propsUntracked")):(0,ce.createElement)("span",{key:"tr",className:"gp-props__badge gp-props__badge--ok"},r("files.propsTrackedYes"))),w.push(...nl(t.changes,e.path,r)));let h=(0,ce.createElement)("div",{key:"status",className:"gp-modal__footer gp-props__statusbar","aria-live":"polite"},[w.length>0?(0,ce.createElement)("span",{key:"chips",className:"gp-props__footer-chips"},w):null,s!==null?(0,ce.createElement)("span",{key:"fb",className:`gp-props__copied${s==="error"?" gp-props__copied--err":""}`},r(s==="copied"?"files.pathCopied":"files.pathCopyFailed")):null]);return Gt({onClose:n,title:r("files.propsTitle"),icon:(0,ce.createElement)(pn.FileTypeIcon,{path:e.path,size:15}),body:y,footer:h,portalKey:"file-props",t:r})}function Jr(e){return e.kind!=="text"?!1:e.size!==void 0?e.size<Xn:new TextEncoder().encode(e.content??"").length<Xn}function mo(e){return/\.(?:md|markdown)$/i.test(e)}function Kr(e){return/\.(?:html?|xhtml)$/i.test(e)}function al(e){return mo(e)||Kr(e)}var il=256*1024,ol=5e3,uo=5e3,pr=20,go=12,sl=600,ll=6e4,gr=new Map;function dl(e,t){let n=t.file.kind==="loading"?{kind:"idle"}:t.file;gr.set(e,{state:{...t,file:n},leftAt:Date.now()})}function cl(e){let t=gr.get(e);return t===void 0?null:Date.now()-t.leftAt>ll?(gr.delete(e),null):t.state}function Vr({remote:e,sessionId:t,compact:n,worktreeGen:r,snapshot:a,t:i}){let s=(0,v.useRef)(void 0);s.current===void 0&&(s.current=cl(t));let o=s.current,[l,d]=(0,v.useState)(()=>o?.dirs??new Map),[c,u]=(0,v.useState)(()=>o?.open??new Set([""])),[g,b]=(0,v.useState)(()=>o?.selected??null),[f,y]=(0,v.useState)(()=>o?.file??{kind:"idle"}),[w,h]=(0,v.useState)(()=>o?.renderMarkdown??!0),[k,S]=(0,v.useState)("idle"),[T,D]=(0,v.useState)("idle"),[G,E]=(0,v.useState)(!1),[O,I]=(0,v.useState)(!1),[ee,J]=(0,v.useState)(()=>o?.pane??"tree"),B=(0,v.useId)(),F=(0,v.useMemo)(()=>({code:{copyLabel:i("files.copy"),copiedLabel:i("files.copied")},footnotes:i("files.footnotes")}),[i]),ae=(0,v.useRef)(0),le=Kt({storageKey:"gp.files.left",initial:300,min:180,reserve:220,edge:"end"}),L=(0,v.useCallback)(C=>{d(ue=>{let ge=ue.get(C);if(ge!==void 0&&ge.status!=="error")return ue;let pe=new Map(ue);return pe.set(C,{status:"loading"}),pe}),e.query({sessionId:t,query:{kind:"dir-list",path:C}}).then(ue=>{let ge=be(ue,"dir-list");d(pe=>{let Se=new Map(pe);return Se.set(C,ge===null?{status:"error"}:{status:"ready",entries:ge.entries,truncated:ge.truncated}),Se})}).catch(()=>{d(ue=>{let ge=new Map(ue);return ge.set(C,{status:"error"}),ge})})},[e,t]);(0,v.useEffect)(()=>{L("")},[L]);let Y=(0,v.useRef)(r);(0,v.useEffect)(()=>{Y.current!==r&&(Y.current=r,gr.delete(t),d(new Map),u(new Set([""])),b(null),y({kind:"idle"}),J("tree"),L(""))},[r,t,L]);let ie=(0,v.useCallback)(C=>{u(ue=>{let ge=new Set(ue);return ge.has(C)?(ge.delete(C),ge):(ge.add(C),l.get(C)===void 0&&L(C),ge)})},[l,L]),ne=(0,v.useCallback)(C=>{b(C),n&&J("preview"),h(!Kr(C)),S("idle"),D("idle"),E(!1);let ue=++ae.current;y({kind:"loading",path:C}),e.query({sessionId:t,query:{kind:"file-content",path:C}}).then(ge=>{if(ue!==ae.current)return;let pe=be(ge,"file-content");if(pe===null){y({kind:"error",path:C});return}let Se={...pe.size!==void 0?{size:pe.size}:{},...pe.mtimeMs!==void 0?{mtimeMs:pe.mtimeMs}:{}};if(pe.tooLarge===!0){y({kind:"tooLarge",path:C,...Se});return}if(pe.variant==="image"&&pe.dataUrl!==void 0){y({kind:"image",path:C,dataUrl:pe.dataUrl,...Se});return}if(pe.variant==="text"){y({kind:"text",path:C,content:pe.content??"",lines:pe.lines??0,...Se});return}y({kind:"binary",path:C,...Se})}).catch(()=>{ue===ae.current&&y({kind:"error",path:C})})},[e,t,n]),H=(0,v.useRef)({dirs:l,open:c,selected:g,file:f,renderMarkdown:w,pane:ee});H.current={dirs:l,open:c,selected:g,file:f,renderMarkdown:w,pane:ee},(0,v.useEffect)(()=>()=>{dl(t,H.current)},[t]);let N=(0,v.useRef)(!1);(0,v.useEffect)(()=>{N.current||(N.current=!0,o!==null&&o.selected!==null&&f.kind==="idle"&&ne(o.selected))},[o,f.kind,ne]);let P=(0,v.useMemo)(()=>ho("",0,{dirs:l,open:c,selected:g,toggleDir:ie,selectFile:ne,t:i}),[l,c,g,ie,ne,i]),Q=async()=>{if(g===null)return;let C=ae.current,ue=await(0,De.writeClipboard)(g);C===ae.current&&S(ue?"copied":"error")},z=async()=>{if(f.kind!=="text"||!Jr(f))return;let C=ae.current,ue=await(0,De.writeClipboard)(f.content);C===ae.current&&D(ue?"copied":"error")},_=(()=>{if(g===null||f.kind!=="text"&&f.kind!=="image"&&f.kind!=="binary"&&f.kind!=="tooLarge")return null;let C=g.lastIndexOf("/"),ue=C<0?"":g.slice(0,C),ge=C<0?g:g.slice(C+1),pe=l.get(ue),Se=pe?.status==="ready"?pe.entries.find(Re=>!Re.dir&&Re.name===ge):void 0;return{path:g,kind:f.kind,...f.size!==void 0?{size:f.size}:{},...f.mtimeMs!==void 0?{mtimeMs:f.mtimeMs}:{},...f.kind==="text"?{lines:f.lines}:{},...f.kind==="image"?{dataUrl:f.dataUrl}:{},ignored:Se?.ignored===!0}})(),j=(0,v.createElement)("div",{key:"left",className:"gp-files__tree",style:n?void 0:{flex:`0 0 ${le.width}px`}},P),V=f.kind==="text"&&al(f.path),oe=V?(0,v.createElement)(De.SegmentedControl,{key:"mode",className:"gp-files__mode-seg",id:B,label:i("files.previewMode"),value:w?"render":"source",options:[{value:"source",label:i("files.source")},{value:"render",label:i("files.render")}],onChange:C=>h(C==="render")}):null,Ge=f.kind==="text"?(0,v.createElement)("button",{key:"full",type:"button",className:"gp-files__props",title:i("files.fullscreen"),"aria-label":i("files.fullscreen"),onClick:()=>I(!0)},(0,v.createElement)(La,{size:14})):null,ye=(0,v.createElement)("button",{key:"props",type:"button",className:"gp-files__props",title:i("files.propsTitle"),"aria-label":i("files.propsTitle"),disabled:_===null,onClick:()=>E(!0)},(0,v.createElement)(Ka,{size:14})),Me=n?(0,v.createElement)("div",{key:"bar",className:"gp-files__bar gp-files__bar--compact"},[(0,v.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>J("tree")},[(0,v.createElement)(Zt,{key:"i",size:14}),i("files.backToTree")]),oe,(0,v.createElement)("div",{key:"end",className:"gp-files__bar-end"},[Ge,ye])]):null,Pe=n?null:(0,v.createElement)("div",{key:"bar",className:"gp-files__bar"},[(0,v.createElement)("code",{key:"path",className:"gp-files__path",title:g??""},g??""),oe,(0,v.createElement)("div",{key:"copy",className:"gp-files__copy-group"},[(0,v.createElement)("button",{key:"copy-path",type:"button",className:`gp-files__copy-path${k==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{Q()}},i(k==="copied"?"files.pathCopied":k==="error"?"files.pathCopyFailed":"files.copyPath")),Jr(f)?(0,v.createElement)("button",{key:"copy-content",type:"button",className:`gp-files__copy-path${T==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{z()}},i(T==="copied"?"files.contentCopied":T==="error"?"files.contentCopyFailed":"files.copyContent")):null]),Ge,ye]),_e=V?[(0,v.createElement)("div",{key:"src",id:`${B}-source-panel`,role:"tabpanel","aria-labelledby":`${B}-source`,style:w?{display:"none"}:{display:"contents"}},w?null:ur(f,!1,F,i)),(0,v.createElement)("div",{key:"rnd",id:`${B}-render-panel`,role:"tabpanel","aria-labelledby":`${B}-render`,style:w?{display:"contents"}:{display:"none"}},w?ur(f,!0,F,i):null)]:ur(f,w,F,i),Ae=(0,v.createElement)("div",{key:"right",className:"gp-files__preview"},[g!==null?n?Me:Pe:null,(0,v.createElement)("div",{key:"content",className:"gp-files__preview-content"},_e),O&&g!==null&&f.kind==="text"?(0,v.createElement)(pl,{key:"full",file:f,renderMarkdown:w,markdownLabels:F,onClose:()=>I(!1),t:i}):null,_!==null&&G?(0,v.createElement)(po,{key:"props-modal",input:_,snapshot:a,onClose:()=>E(!1),t:i}):null]);return n?(0,v.createElement)("div",{className:"gp-files gp-files--compact"},ee==="preview"?Ae:j):(0,v.createElement)("div",{className:"gp-files"},[j,le.divider,Ae])}function ur(e,t,n,r){return e.kind==="text"&&t&&mo(e.path)?(0,v.createElement)("div",{className:"gp-files__markdown"},(0,v.createElement)(De.MarkdownText,{text:e.content,labels:n,variant:"body"})):e.kind==="text"&&t&&Kr(e.path)?(0,v.createElement)("iframe",{className:"gp-files__html",title:e.path,srcDoc:e.content,sandbox:"allow-scripts",referrerPolicy:"no-referrer"}):ul(e,r)}function pl(e){let{file:t,renderMarkdown:n,markdownLabels:r,onClose:a,t:i}=e,s=(0,v.useRef)(null),o=(0,v.useRef)(null);return Zn(s,a,o),typeof document>"u"||t.kind!=="text"?null:(0,fo.createPortal)((0,v.createElement)("div",{className:"gp-modal-backdrop",onClick:l=>{l.target===l.currentTarget&&a()}},(0,v.createElement)("div",{ref:s,className:"gp-modal",role:"dialog","aria-modal":!0,"aria-label":i("files.fullscreen")},[(0,v.createElement)("div",{key:"bar",className:"gp-modal__bar"},[(0,v.createElement)("code",{key:"path",className:"gp-modal__path",title:t.path},t.path),(0,v.createElement)("button",{key:"close",ref:o,type:"button",className:"gp-icon-btn gp-modal__close",title:i("common.close"),"aria-label":i("common.close"),onClick:a},(0,v.createElement)(We,{size:15}))]),(0,v.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},(0,v.createElement)("div",{key:"body",className:"gp-files__preview-content"},ur(t,n,r,i)))])),document.body,"file-fullscreen")}function ho(e,t,n){let r=n.dirs.get(e);if(r===void 0||r.status==="loading")return t===0?[(0,v.createElement)("div",{key:"l",className:"gp-empty"},n.t("common.loading"))]:[(0,v.createElement)("div",{key:`l${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("common.loading"))];if(r.status==="error")return[(0,v.createElement)("div",{key:`e${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.loadFailed"))];let a=[];for(let i of r.entries){let s=e===""?i.name:`${e}/${i.name}`;if(i.dir){let o=n.open.has(s);a.push((0,v.createElement)("button",{key:s,type:"button",className:`gp-tree-row gp-files__entry gp-files__entry--dir${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-expanded":o,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.toggleDir(s)},[(0,v.createElement)("span",{key:"i",className:"gp-tree-ic"},o?(0,v.createElement)(De.IconFolderOpenRegular,{size:16}):(0,v.createElement)(De.IconFolderCloseRegular,{size:16})),(0,v.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)])),o&&a.push(...ho(s,t+1,n))}else{let o=n.selected===s;a.push((0,v.createElement)("button",{key:s,type:"button",className:`gp-tree-row gp-files__entry${o?" gp-tree-row--active":""}${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-current":o?"true":void 0,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.selectFile(s)},[(0,v.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,v.createElement)(De.FileTypeIcon,{path:s,size:16})),(0,v.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)]))}}return r.truncated&&a.push((0,v.createElement)("div",{key:`t${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.truncated"))),a}function ul(e,t){switch(e.kind){case"idle":return(0,v.createElement)("div",{className:"gp-empty"},t("files.selectFile"));case"loading":return(0,v.createElement)("div",{className:"gp-empty"},t("common.loading"));case"error":return(0,v.createElement)("div",{className:"gp-empty"},t("files.loadFailed"));case"tooLarge":return(0,v.createElement)("div",{className:"gp-empty"},t("files.tooLarge"));case"binary":return(0,v.createElement)("div",{className:"gp-empty"},t("files.binary"));case"image":return(0,v.createElement)(Nn,{src:e.dataUrl,alt:e.path,t,viewportClass:"gp-files__image"});case"text":return(0,v.createElement)(fl,{content:e.content,path:e.path,t})}}function gl(e,t){if(t==="")return[];let n=[];for(let r=0;r<e.length;r++)for(let[a,i]of Wn(e[r],t))if(n.push({line:r,start:a,end:i}),n.length>=qn)return n;return n}function fl({content:e,path:t,t:n}){let r=(0,v.useMemo)(()=>{let _=e.split(`
793
+ `);return _.length>0&&_[_.length-1]===""&&_.pop(),_},[e]),a=e.length>il||r.length>ol,i=a?void 0:(0,De.languageForPath)(t),s=(0,De.useCodeHighlighter)(i),o=(0,v.useMemo)(()=>a?void 0:s(r.join(`
794
+ `)),[a,s,r]),[l,d]=(0,v.useState)(!1),[c,u]=(0,v.useState)(""),[g,b]=(0,v.useState)(!1),[f,y]=(0,v.useState)(0),{setEl:w,viewport:h,elRef:k}=on(),S=(0,v.useRef)(null),T=(0,v.useRef)(null);(0,v.useEffect)(()=>{d(!1),u(""),y(0)},[t]);let D=jn(c,Un),G=(0,v.useMemo)(()=>r.map(_=>_.toLowerCase()),[r]),E=g?D:D.toLowerCase(),O=g?r:G,I=(0,v.useMemo)(()=>gl(O,E),[O,E]);(0,v.useEffect)(()=>{y(0)},[E]);let ee=I.length===0?0:Math.min(f,I.length-1),J=(0,v.useMemo)(()=>{let _=new Map;for(let j of I){let V=_.get(j.line)??[];V.push([j.start,j.end]),_.set(j.line,V)}return _},[I]);(0,v.useEffect)(()=>{let _=j=>{if(!((j.ctrlKey||j.metaKey)&&(j.key==="f"||j.key==="F")))return;let V=k.current;V===null||V.offsetParent===null||(j.preventDefault(),d(!0),requestAnimationFrame(()=>S.current?.select()))};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[]);let B=r.length,F=(0,v.useMemo)(()=>rn(new Array(B).fill(pr)),[B]),ae=h.height>0?h.height:sl,{first:le,last:L}=an(F,h.top,ae,go*pr),Y=I.length>0?I[ee].line:-1,{first:ie,last:ne}=Vn({first:le,last:L},Y,B,go);(0,v.useEffect)(()=>{if(Y<0)return;let _=requestAnimationFrame(()=>T.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(_)},[ee,I,Y]);let H=(0,v.useCallback)(_=>{y(j=>I.length===0?0:(j+_+I.length)%I.length)},[I.length]),N=I.length>0?I[ee]:null,P=l?(0,v.createElement)(Yn,{inputRef:S,query:c,matches:I.length,active:ee,caseSensitive:g,onChange:u,onToggleCase:()=>b(_=>!_),onStep:H,onClose:()=>d(!1),t:n}):null,Q=a||l?(0,v.createElement)("div",{key:"hd",className:"gp-files__header"},[a?(0,v.createElement)("div",{key:"note",className:"gp-files__note"},n("files.highlightOff")):null,P]):null,z=[];for(let _=ie;_<ne;_++)z.push((0,v.createElement)("div",{key:_,className:"gp-files__row",style:{top:_*pr}},[(0,v.createElement)("div",{key:"n",className:"gp-diff-no"},_+1),ml(r[_],_,o?.[_],J.get(_),N,T,n)]));return(0,v.createElement)("div",{className:"gp-files__code gp-diff__scroll",ref:w},[Q,(0,v.createElement)("div",{key:"grid",className:"gp-files__single gp-files__single--virt",style:{height:B*pr}},z)])}function ml(e,t,n,r,a,i,s){if(e==="")return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},"\xA0");if(e.length>uo)return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},[e.slice(0,uo),(0,v.createElement)("span",{key:"trunc",className:"gp-files__trunc"},s("files.lineTruncated"))]);if(r===void 0||r.length===0)return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},n!==void 0?n.map((l,d)=>(0,v.createElement)("span",{key:d,style:l.style},l.text)):e);let o=a!==null&&a.line===t?[a.start,a.end]:null;return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},Qn(e,r,n,`c${t}`,o,i))}var fr=require("react"),hl=620;function yo(e){let[t,n]=(0,fr.useState)(!1);return(0,fr.useLayoutEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=()=>n(e.clientWidth>0&&e.clientWidth<=hl);r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}var mr=require("react");function bo(){let[e,t]=(0,mr.useState)(()=>Ie.isVisible());return(0,mr.useEffect)(()=>{let n=()=>t(Ie.isVisible()),r=Ie.subscribe(n);return n(),r},[]),e}var wo="gp.panel.fontDelta";function yl(){if(typeof localStorage>"u")return 0;let e=Number(localStorage.getItem(wo));return e===-1||e===1?e:0}function xo({ctx:e,sessionId:t,t:n}){let r=bo(),[a,i]=(0,K.useState)(yl),[s,o]=(0,K.useState)(null),[l,d]=(0,K.useState)(null),c=yo(l),u=An(t),g=bn(e),b=u.state==="error"&&u.error.code==="git-unavailable",f=u.state==="error"&&(u.error.code==="not-a-git-repo"||u.error.code==="git-unavailable"),y=b&&u.state==="error"&&u.error.isGitRepo===!0,w=f?"files":s!==null&&s.sessionId===t?s.tab:null,h=(0,K.useRef)({tabs:new Set});h.current.sessionId!==t&&(h.current={sessionId:t,tabs:new Set}),w!==null&&h.current.tabs.add(w);let k=h.current.tabs.has("files");(0,K.useEffect)(()=>{if(!ct(t))return;if(f){o(null);return}if(s?.sessionId===t)return;let H=_a(t);if(H!==null){o({sessionId:t,tab:H});return}let N=Ta(t);if(N!==null){o({sessionId:t,tab:N});return}u.state==="ready"&&o({sessionId:t,tab:u.snapshot.dirty?"changes":"overview"})},[t,u,f,s?.sessionId]),(0,K.useEffect)(()=>{if(ct(t))return Sa(t,H=>o({sessionId:t,tab:H}))},[t]);let S=(0,K.useRef)({tab:null});S.current={sessionId:t,tab:w},(0,K.useEffect)(()=>()=>{let{sessionId:H,tab:N}=S.current;H!==void 0&&N!==null&&Ca(H,N)},[]);let T=r&&ct(t),[D,G]=(0,K.useState)(0),[E,O]=(0,K.useState)(!1),I=async H=>{if(!ct(t))return{ok:!1,error:n("error.noCwd")};let N=await g.run({sessionId:t,action:H});return N.ok?(It(t).accept(N.snapshot),H.kind==="branch-checkout"&&G(P=>P+1),{ok:!0}):(H.kind==="branch-checkout"&&H.stashMessage!==void 0&&G(P=>P+1),It(t).resync(),{ok:!1,error:Vt(N.error.code,N.error.message,n)})},ee=H=>{i(H),typeof localStorage<"u"&&localStorage.setItem(wo,String(H))},J=[{key:"overview",label:n("tab.overview"),icon:(0,K.createElement)(zn,{size:14})},{key:"changes",label:n("tab.changes"),icon:(0,K.createElement)(Ra,{size:14})},{key:"files",label:n("tab.files"),icon:(0,K.createElement)(Oa,{size:14})}],B=f?J.filter(H=>H.key==="files"):J,F=(0,K.useId)(),ae=B.map(H=>({value:H.key,label:[(0,K.createElement)("span",{key:"i",className:"gp-tab__icon"},H.icon),(0,K.createElement)("span",{key:"l",className:"gp-tab__label"},H.label)],id:`${F}-${H.key}`,panelId:`${F}-${H.key}-panel`})),le=w??B[0]?.key??"overview",L=!ct(t)||u.state==="no-cwd"?(0,K.createElement)("div",{className:"gp-empty"},n("error.noCwd")):f?null:u.state==="error"?(0,K.createElement)("div",{className:"gp-empty"},n("pill.unavailable")):u.state==="cold"||u.state==="loading"||w===null?(0,K.createElement)("div",{className:"gp-empty"},n("common.loading")):null,Y=H=>{if(L!==null)return H===le?L:null;if(!ct(t))return null;if(f)return k?(0,K.createElement)(Vr,{key:t,remote:g,sessionId:t,compact:c,worktreeGen:D,snapshot:null,t:n}):null;if(u.state!=="ready")return null;let N=u.snapshot;return H==="overview"?h.current.tabs.has("overview")?(0,K.createElement)(Yi,{key:t,remote:g,sessionId:t,visible:T&&w==="overview",defaultDiffView:N.defaultDiffView,snapshot:N,onAction:I,onResync:()=>It(t).resync(),compact:c,t:n}):null:H==="changes"?h.current.tabs.has("changes")?(0,K.createElement)(so,{key:t,remote:g,sessionId:t,visible:T&&w==="changes",snapshot:N,onAction:I,onRefresh:()=>It(t).refresh(),compact:c,t:n}):null:k?(0,K.createElement)(Vr,{key:t,remote:g,sessionId:t,compact:c,worktreeGen:D,snapshot:N,t:n}):null},ie=B.map(H=>(0,K.createElement)("div",{key:H.key,id:`${F}-${H.key}-panel`,role:"tabpanel","aria-labelledby":`${F}-${H.key}`,style:le===H.key?{display:"contents"}:{display:"none"}},Y(H.key))),ne=y?(0,K.createElement)("div",{className:"gp-files-wrap"},[E?null:(0,K.createElement)(bt,{key:"notice",text:n("files.gitNotInstalled"),closeLabel:n("common.close"),onClose:()=>O(!0)}),...ie]):(0,K.createElement)("div",{style:{display:"contents"}},ie);return(0,K.createElement)("div",{className:"gp-panel",ref:d,"data-conversation-composer-overlay":"","data-font-delta":a,"data-layout":c?"compact":"wide"},[(0,K.createElement)("div",{key:"tabs",className:"gp-tabbar"},[(0,K.createElement)(vo.SegmentedTabs,{key:"switcher",className:`gp-tabbar__tabs${B.length===1?" gp-tabbar__tabs--single":""}`,label:n("panel.tabs"),items:ae,value:le,onChange:H=>{let N=B.find(P=>P.key===H);N!==void 0&&ct(t)&&o({sessionId:t,tab:N.key})}}),(0,K.createElement)("div",{key:"trailing",className:"gp-tabbar__trailing"},[(0,K.createElement)("div",{key:"font",className:"gp-font",role:"group","aria-label":n("panel.fontSize")},[(0,K.createElement)("button",{key:"dec",type:"button",className:"gp-font__decrease","aria-pressed":a===-1,onClick:()=>ee(-1),"aria-label":n("panel.fontDecrease")},"A\u2212"),(0,K.createElement)("button",{key:"reset",type:"button",className:"gp-font__reset","aria-pressed":a===0,onClick:()=>ee(0),"aria-label":n("panel.fontReset")},"A"),(0,K.createElement)("button",{key:"inc",type:"button",className:"gp-font__increase","aria-pressed":a===1,onClick:()=>ee(1),"aria-label":n("panel.fontIncrease")},"A+")]),c?null:(0,K.createElement)(bl,{key:"ver",remote:g,t:n})])]),(0,K.createElement)("div",{key:"body",className:"gp-body"},ne)])}function bl({remote:e,t}){let[n,r]=(0,K.useState)({kind:"idle"}),{tipProps:a,tipNode:i}=Mt({placement:"below",maxWidth:300});(0,K.useEffect)(()=>{let d=!0;return e.version({}).then(c=>{d&&"current"in c&&r(u=>({...u,info:c}))}),()=>{d=!1}},[e]);let s=async()=>{r(c=>({kind:"checking",info:c.info}));let d=await e.version({check:!0});r({kind:"idle",info:"current"in d?d:void 0})},o=n.info,l=n.kind==="checking"?(0,K.createElement)("span",{className:"gp-verbar__status"},t("version.checking")):o===void 0||!o.checkedRemote?null:o.error!==void 0?(0,K.createElement)("span",{className:"gp-verbar__status gp-verbar__status--err",title:o.error},o.error==="repository is not configured"?t("version.noRepo"):t("version.error")):o.updateAvailable&&o.latest!==void 0?(0,K.createElement)("span",{},[(0,K.createElement)("span",{key:"s",className:"gp-verbar__status gp-verbar__status--new"},t("version.updateAvailable",{latest:o.latest,current:o.current})),o.releaseUrl!==void 0?(0,K.createElement)("a",{key:"l",className:"gp-verbar__link",href:o.releaseUrl,target:"_blank",rel:"noreferrer",style:{marginLeft:8}},t("version.viewRelease")):null]):(0,K.createElement)("span",{className:"gp-verbar__status gp-verbar__status--ok"},t("version.upToDate",{current:o.current}));return(0,K.createElement)("div",{className:"gp-verbar"},[o!==void 0?(0,K.createElement)("span",{key:"tag",className:"gp-verbar__tag"},`v${o.current}`):null,l,(0,K.createElement)("button",{key:"btn",type:"button",className:"gp-verbar__btn",disabled:n.kind==="checking",onClick:()=>void s()},[(0,K.createElement)("span",{key:"i",className:"gp-tab__icon"},(0,K.createElement)(en,{size:12})),t("version.check")]),o?.repositoryUrl!==void 0?(0,K.createElement)("a",{key:"gh",className:"gp-icon-btn gp-verbar__gh gp-verbar__gh--starred",href:o.repositoryUrl,target:"_blank",rel:"noreferrer","aria-label":t("version.openRepo"),...a(t("version.openRepo"))},(0,K.createElement)(Va,{size:15})):null,i])}var xe=require("react"),Co=require("react-dom");var ko="data-gp-tab-dot",un,qr=null,_o="",yr=null,hr;function vl(e){if(typeof document>"u")return null;let t=document.querySelectorAll(kn);for(let n of t)if((n.textContent??"").trim()===e)return n;return null}function Ur(){let e=vl(_o);if(e===null)return;let t=e.querySelector(`[${ko}]`);if(yr===null){t?.remove();return}let n=`gp-tab-dot gp-tab-dot--${yr}`;if(t!==null){t.className!==n&&(t.className=n);return}let r=document.createElement("span");r.className=n,r.setAttribute(ko,""),r.setAttribute("aria-hidden","true"),e.appendChild(r)}function wl(){if(typeof document>"u"||typeof MutationObserver>"u")return;let e=document.querySelector(xa);if(e!==qr){if(un?.disconnect(),qr=e,e===null){un=void 0;return}un=new MutationObserver(()=>Ur()),un.observe(e,{childList:!0,subtree:!0})}}function xl(){un?.disconnect(),un=void 0,qr=null}function So(e,t,n){if(!(typeof document>"u")){if(n===null){jr(e);return}hr=e,_o=t,yr=n,wl(),Ur()}}function jr(e){hr!==void 0&&hr!==e||(hr=void 0,yr=null,Ur(),xl())}function kl(e){let t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function _l(){let[e,t]=(0,xe.useState)(!1),[n,r]=(0,xe.useState)(null),a=(0,xe.useRef)(null);return(0,xe.useLayoutEffect)(()=>{if(!e||a.current===null){r(null);return}let o=a.current.getBoundingClientRect();r({left:o.left,bottom:window.innerHeight-o.top+8})},[e]),{bind:{ref:o=>{a.current=o},onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1)},render:o=>!e||n===null||typeof document>"u"?null:(0,Co.createPortal)((0,xe.createElement)("div",{className:"gp-tip",style:{left:n.left,bottom:n.bottom}},o.map((l,d)=>(0,xe.createElement)("div",{key:d,className:d===0?"gp-tip__path":"gp-tip__note"},l))),document.body)}}function Sl(e){let[t,n]=(0,xe.useState)(!1);return(0,xe.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=e.closest("[data-conversation-region]")??document.body,i=()=>n(a.clientWidth>0&&a.clientWidth<Cl);i();let s=new ResizeObserver(i);return s.observe(a),()=>s.disconnect()},[e]),t}var Cl=620;function To({sessionId:e,t}){let n=An(e),r=_l(),[a,i]=(0,xe.useState)(null),s=Sl(a),o=(0,xe.useRef)(Symbol("gp-tab-dot")),l=n.state==="ready"&&n.snapshot.showInputPill===!1?n.snapshot.dirty?"dirty":"synced":null,d=t("panel.tab");if((0,xe.useEffect)(()=>{So(o.current,d,l);let w=o.current;return()=>{jr(w)}},[d,l]),n.state==="cold"||n.state==="loading"||n.state==="no-cwd")return null;if(n.state==="error")return n.error.code==="not-a-git-repo"||n.error.code==="git-unavailable"||n.error.showInputPill===!1?null:(0,xe.createElement)("span",{className:"gp-pill gp-pill--degraded",title:n.error.detail??t("pill.unavailable")},t("pill.unavailable"));let c=n.snapshot;if(c.showInputPill===!1)return null;let u=kl(c.root),g=c.branch??`(${t("pill.detached")})`,b=c.dirty,f=b?"gp-pill--dirty":"gp-pill--synced",y=()=>{if(Ea(d)){Ga(d);return}ct(e)&&ka(e,b?"changes":"overview"),Na(d)};return(0,xe.createElement)("span",{className:"gp-pill-wrap",ref:i},[(0,xe.createElement)("button",{key:"btn",type:"button",className:`gp-pill ${f}${s?" gp-pill--compact":""}`,onClick:y,ref:r.bind.ref,onMouseEnter:r.bind.onMouseEnter,onMouseLeave:r.bind.onMouseLeave},[(0,xe.createElement)("span",{key:"dot",className:"gp-pill__dot","aria-hidden":"true"}),(0,xe.createElement)("span",{key:"repo",className:"gp-pill__repo"},u),(0,xe.createElement)("span",{key:"git",className:"gp-pill__git"},["(",(0,xe.createElement)("span",{key:"b",className:"gp-pill__branch"},g),")"])]),r.render([c.root,t(b?"pill.dirty":"pill.synced")])])}var $=require("react");function Tl(e){for(let t of e){let n=t.schema?.dict;if(n!==void 0&&"showInputPill"in n||JSON.stringify(t.schema).includes("showInputPill"))return t.ns}}var br={min:$e.maxBytes.min/1024,max:$e.maxBytes.max/1024},vr={min:$e.timeoutMs.min/1e3,max:$e.timeoutMs.max/1e3};function Wr(e,t){return Math.min(t.max,Math.max(t.min,Math.floor(e)))}function Nl(e){let t=e.trim();if(t==="")return null;let n=Number(t);return Number.isFinite(n)?n:null}function No({ctx:e,t}){let[,n]=(0,$.useState)(0),[r,a]=(0,$.useState)(!1),[i,s]=(0,$.useState)(!1),[o,l]=(0,$.useState)(null),[d,c]=(0,$.useState)(null),[u,g]=(0,$.useState)(null),[b,f]=(0,$.useState)(null),[y,w]=(0,$.useState)(null),[h,k]=(0,$.useState)(null),[S,T]=(0,$.useState)(null),[D,G]=(0,$.useState)(null),E=()=>{n(C=>C+1)},O=e.get("configForms"),I=(0,$.useMemo)(()=>O?.describe(),[O]);(0,$.useEffect)(()=>{if(I!==void 0)return I.ensure(),I.subscribe(E)},[I]);let ee=I?.getSnapshot().view,J=(0,$.useMemo)(()=>ee===void 0?void 0:Tl(ee.namespaces),[ee]),B=(0,$.useMemo)(()=>O!==void 0&&J!==void 0?O.get(J):void 0,[O,J]);(0,$.useEffect)(()=>{if(B!==void 0)return B.subscribe(E)},[B]);let F=B?.getSnapshot(),ae=B!==void 0&&F!==void 0&&F.status==="ready",le=I?.getSnapshot().status,L=o??(typeof F?.value?.showInputPill=="boolean"?F.value.showInputPill:!0),Y=d??(F?.value?.defaultDiffView==="split"?"split":"unified"),ie=u??(F?.value?.graphStyle==="compact"?"compact":"parallel"),ne=b??(typeof F?.value?.suggestEnabled=="boolean"?F.value.suggestEnabled:!0),H=F?.value?.suggestLanguage,N=y??(typeof H=="string"&&$n.includes(H)?H:Pr),P=Wr(typeof F?.value?.suggestMaxBytes=="number"?F.value.suggestMaxBytes/1024:$e.maxBytes.default/1024,br),Q=Wr(typeof F?.value?.suggestMaxOutputTokens=="number"?F.value.suggestMaxOutputTokens:$e.maxOutputTokens.default,$e.maxOutputTokens),z=Wr(typeof F?.value?.suggestTimeoutMs=="number"?F.value.suggestTimeoutMs/1e3:$e.timeoutMs.default/1e3,vr),_=async(C,ue,ge)=>{if(B!==void 0){s(!1),a(!0);try{let pe=await B.set(C,ue);ge(),pe?(wn(),setTimeout(()=>wn(),1e3)):s(!0)}catch{ge(),s(!0)}finally{a(!1)}}},j=C=>(l(C),_("showInputPill",C,()=>l(null))),V=C=>C===Y?Promise.resolve():(c(C),_("defaultDiffView",C,()=>c(null))),oe=C=>C===ie?Promise.resolve():(g(C),_("graphStyle",C,()=>g(null))),Ge=C=>(f(C),_("suggestEnabled",C,()=>f(null))),ye=C=>C===N?Promise.resolve():(w(C),_("suggestLanguage",C,()=>w(null))),Me=(C,ue,ge,pe,Se,Re)=>{let Qe=C===null?null:Nl(C);if(Qe===null)return Re(),Promise.resolve();let ut=Math.min(ue.max,Math.max(ue.min,Math.floor(Qe)));return Se(String(ut)),_(pe,ut*ge,Re)},Pe=C=>Me(C,br,1024,"suggestMaxBytes",k,()=>k(null)),_e=C=>Me(C,$e.maxOutputTokens,1,"suggestMaxOutputTokens",T,()=>T(null)),Ae=C=>Me(C,vr,1e3,"suggestTimeoutMs",G,()=>G(null));return O===void 0?(0,$.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded")):ae?(0,$.createElement)("div",{className:"gp-cfg"},[(0,$.createElement)("h3",{key:"title",className:"gp-cfg__title"},t("cfg.title")),(0,$.createElement)("label",{key:"row",className:"gp-cfg__row"},[(0,$.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:L,disabled:r||F?.writable===!1,onChange:C=>{j(C.currentTarget.checked)}}),(0,$.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.toggle"))]),(0,$.createElement)("p",{key:"hint",className:"gp-cfg__hint"},t("cfg.hint")),(0,$.createElement)("h3",{key:"difftitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.diffTitle")),(0,$.createElement)("div",{key:"diffseg",className:"gp-seg gp-cfg__seg"},Et(["unified","split"],Y,C=>{V(C)},C=>t(C==="unified"?"cfg.diffUnified":"cfg.diffSplit"),r||F?.writable===!1)),(0,$.createElement)("p",{key:"diffhint",className:"gp-cfg__hint"},t("cfg.diffHint")),(0,$.createElement)("h3",{key:"graphtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.graphTitle")),(0,$.createElement)("div",{key:"graphseg",className:"gp-seg gp-cfg__seg"},Et(["parallel","compact"],ie,C=>{oe(C)},C=>t(C==="parallel"?"cfg.graphParallel":"cfg.graphCompact"),r||F?.writable===!1)),(0,$.createElement)("p",{key:"graphhint",className:"gp-cfg__hint"},t("cfg.graphHint")),(0,$.createElement)("div",{key:"suggestcard",className:"gp-cfg__card"},[(0,$.createElement)("h3",{key:"sgtitle",className:"gp-cfg__card-title"},t("cfg.suggestTitle")),(0,$.createElement)("label",{key:"sgrow",className:"gp-cfg__row"},[(0,$.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:ne,disabled:r||F?.writable===!1,onChange:C=>{Ge(C.currentTarget.checked)}}),(0,$.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.suggestToggle"))]),(0,$.createElement)("p",{key:"sglangtitle",className:"gp-cfg__seglabel"},t("cfg.suggestLangLabel")),(0,$.createElement)("div",{key:"sglang",className:"gp-seg gp-cfg__seg",role:"group","aria-label":t("cfg.suggestLangLabel")},Et([...$n],N,C=>{ye(C)},C=>t(C==="auto"?"cfg.suggestLangAuto":C==="zh"?"cfg.suggestLangZh":"cfg.suggestLangEn"),r||F?.writable===!1)),(0,$.createElement)("p",{key:"sglanghint",className:"gp-cfg__rangehint"},t("cfg.suggestLangHint")),(0,$.createElement)("div",{key:"numax",className:"gp-cfg__numrow"},[(0,$.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-maxkib"},t("cfg.suggestMaxBytesLabel")),(0,$.createElement)("input",{key:"input",id:"gp-cfg-maxkib",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:br.min,max:br.max,"aria-describedby":"gp-cfg-maxkib-hint",value:h??String(P),disabled:r||F?.writable===!1,onChange:C=>{k(C.currentTarget.value)},onBlur:()=>{Pe(h)},onKeyDown:C=>{C.key==="Enter"&&C.currentTarget.blur()}}),(0,$.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestMaxBytesUnit"))]),(0,$.createElement)("p",{key:"numaxhint",id:"gp-cfg-maxkib-hint",className:"gp-cfg__rangehint"},t("cfg.suggestMaxBytesHint")),(0,$.createElement)("div",{key:"nuout",className:"gp-cfg__numrow"},[(0,$.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-outtok"},t("cfg.suggestOutputLabel")),(0,$.createElement)("input",{key:"input",id:"gp-cfg-outtok",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:$e.maxOutputTokens.min,max:$e.maxOutputTokens.max,"aria-describedby":"gp-cfg-outtok-hint",value:S??String(Q),disabled:r||F?.writable===!1,onChange:C=>{T(C.currentTarget.value)},onBlur:()=>{_e(S)},onKeyDown:C=>{C.key==="Enter"&&C.currentTarget.blur()}}),(0,$.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestOutputUnit"))]),(0,$.createElement)("p",{key:"nuouthint",id:"gp-cfg-outtok-hint",className:"gp-cfg__rangehint"},t("cfg.suggestOutputHint")),(0,$.createElement)("div",{key:"nuto",className:"gp-cfg__numrow"},[(0,$.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-timeout"},t("cfg.suggestTimeoutLabel")),(0,$.createElement)("input",{key:"input",id:"gp-cfg-timeout",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:vr.min,max:vr.max,"aria-describedby":"gp-cfg-timeout-hint",value:D??String(z),disabled:r||F?.writable===!1,onChange:C=>{G(C.currentTarget.value)},onBlur:()=>{Ae(D)},onKeyDown:C=>{C.key==="Enter"&&C.currentTarget.blur()}}),(0,$.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestTimeoutUnit"))]),(0,$.createElement)("p",{key:"nutohint",id:"gp-cfg-timeout-hint",className:"gp-cfg__rangehint"},t("cfg.suggestTimeoutHint")),(0,$.createElement)("p",{key:"sghint",className:"gp-cfg__hint"},t("cfg.suggestHint"))]),i?(0,$.createElement)("p",{key:"error",className:"gp-cfg__err",role:"alert"},t("cfg.saveFailed")):null]):le==="idle"||le==="loading"?(0,$.createElement)("p",{className:"gp-cfg__hint"},t("common.loading")):(0,$.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded"))}var Gn="gitPanel",El=["dsh-git-panel","@xbzbing/dsh-git-panel"],Gl=["slots","locale","connection"],Ml="dsh-git-panel";function Rl(e){ca(),ya(e),e.effect(()=>e.locale.register(Gn,{zh:pa,en:ua})??void 0,"dsh-git-panel: dictionaries");let t=e.locale.bind(Gn),n=[],r=a=>{typeof a=="function"&&n.push(a)};r(e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"git-panel",order:30,locale:Gn,label:()=>t("panel.tab")},a=>(0,wr.createElement)(xo,{ctx:e,sessionId:a.sessionId,t})))),r(e.slots.inject("conversation.input.left",()=>e.slots.register({name:"conversation.input.left",id:"git-panel-pill",order:100,locale:Gn},a=>(0,wr.createElement)(To,{sessionId:a.sessionId,t}))));for(let a of El)r(e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:a,locale:Gn},i=>i.view==="summary"?t("cfg.title"):(0,wr.createElement)(No,{ctx:e,t}))));e.effect(()=>{let a=e.on("connection/reset",()=>wn());return()=>{typeof a=="function"&&a();for(let i of n.splice(0))try{i()}catch{}wa()}},"dsh-git-panel: lifecycle")}module.exports={name:Ml,inject:Gl,apply:Rl};
677
795
  return module.exports;
678
796
  } });