@xbzbing/dsh-git-panel 1.7.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +35 -22
- package/README.md +35 -22
- package/lib/client.js +169 -43
- package/lib/client.mermaid.js +4338 -0
- package/lib/host/actions.js +44 -2
- package/lib/host/core.d.ts +18 -6
- package/lib/host/core.js +23 -9
- package/lib/host/index.d.ts +14 -2
- package/lib/host/index.js +79 -7
- package/lib/host/llm-face.d.ts +21 -0
- package/lib/host/open-file.d.ts +16 -0
- package/lib/host/open-file.js +29 -0
- package/lib/host/queries.d.ts +8 -0
- package/lib/host/queries.js +69 -9
- package/lib/host/suggest.js +24 -4
- package/lib/host/types.d.ts +75 -2
- package/lib/host/types.js +2 -0
- package/package.json +19 -5
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
|
|
3
|
+
"use strict";var Wr=require("react");var Ms=`
|
|
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. */
|
|
@@ -86,6 +86,12 @@ var module = { exports: {} }; var exports = module.exports;
|
|
|
86
86
|
.gp-btn--primary:hover:not(:disabled){background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 85%,#000);color:#fff}
|
|
87
87
|
.gp-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer}
|
|
88
88
|
.gp-icon-btn:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
89
|
+
/* Tip shell: carries the hover handlers so a disabled child still explains
|
|
90
|
+
* itself. Hit-testing must reach the wrapper \u2014 a disabled control swallows
|
|
91
|
+
* pointer events in browsers \u2014 and the shell itself is a tight flex box so the
|
|
92
|
+
* child's geometry (and the tip anchor) is unchanged. */
|
|
93
|
+
.gp-tip-wrap{display:inline-flex;align-items:center;flex:none;min-width:0}
|
|
94
|
+
.gp-tip-wrap>.gp-icon-btn:disabled,.gp-tip-wrap>.gp-btn:disabled{pointer-events:none}
|
|
89
95
|
|
|
90
96
|
/* three-column overview \u2014 side columns shrink (with a min floor) instead of
|
|
91
97
|
* staying fixed, and the middle keeps a guaranteed min so it never collapses to
|
|
@@ -222,7 +228,17 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
222
228
|
.gp-changes__right{flex:1 1 0;min-width:180px;display:flex;flex-direction:column;min-height:0}
|
|
223
229
|
/* files browser: resizable tree column + preview pane */
|
|
224
230
|
.gp-files{display:flex;width:100%;height:100%;min-height:0}
|
|
225
|
-
|
|
231
|
+
/* The tree column keeps the entries in a scrolling child so the refresh
|
|
232
|
+
* control can float at the box's top-right corner: it neither takes a row of
|
|
233
|
+
* its own above the list nor scrolls away with the entries. */
|
|
234
|
+
.gp-files__tree-wrap{flex:0 0 300px;min-width:180px;position:relative;display:flex;flex-direction:column;min-height:0}
|
|
235
|
+
.gp-files__tree{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 0}
|
|
236
|
+
.gp-files__refresh{position:absolute;top:5px;right:10px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);cursor:pointer}
|
|
237
|
+
.gp-files__refresh:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
|
|
238
|
+
.gp-files__refresh:disabled{opacity:.55;cursor:default}
|
|
239
|
+
.gp-files__refresh:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
|
|
240
|
+
.gp-files__refresh--busy svg{animation:gp-spin 1s linear infinite}
|
|
241
|
+
.gp-panel[data-layout="compact"] .gp-files__refresh{width:30px;height:30px}
|
|
226
242
|
.gp-files__preview{flex:1 1 0;min-width:180px;display:flex;flex-direction:column;min-height:0}
|
|
227
243
|
.gp-files__preview-content{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
|
|
228
244
|
.gp-files__bar{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:6px 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}
|
|
@@ -246,6 +262,8 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
246
262
|
.gp-files__props:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
|
|
247
263
|
.gp-files__props:disabled{opacity:0.5;cursor:default}
|
|
248
264
|
.gp-files__props:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
|
|
265
|
+
.gp-files__props[aria-pressed="true"]{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent);color:var(--dsw-alias-state-business-primary);border-color:color-mix(in srgb,var(--dsw-alias-state-business-primary) 35%,transparent)}
|
|
266
|
+
.gp-files__scripts{font:600 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:0.02em;padding:5px 6px}
|
|
249
267
|
.gp-files__mode-seg{flex:none}
|
|
250
268
|
/* Compact preview toolbar: the relative path and the two copy buttons are gone
|
|
251
269
|
* (they forced three wrapped rows on a phone). Back + the official source/render
|
|
@@ -259,9 +277,41 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
259
277
|
.gp-panel[data-layout="compact"] .gp-files__bar-end .gp-files__props{height:30px;box-sizing:border-box;padding:0 6px}
|
|
260
278
|
.gp-files__bar--compact .gp-files__mode-seg button{padding:0 10px;font-size:12px}
|
|
261
279
|
.gp-files__markdown{overflow:auto;overscroll-behavior:contain;padding:16px 24px;color:var(--dsw-alias-label-primary)}
|
|
280
|
+
/* Mermaid figures: the SVG centers and never overflows the pane width; a
|
|
281
|
+
* parse/load failure falls back to the source as a plain code block. */
|
|
282
|
+
.gp-mermaid{overflow-x:auto;padding:4px 0}
|
|
283
|
+
.gp-mermaid svg{display:block;max-width:100%;height:auto;margin:0 auto}
|
|
284
|
+
.gp-mermaid--loading{min-height:64px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-skeleton);color:var(--dsw-alias-label-tertiary)}
|
|
285
|
+
.gp-mermaid__loading-text{font-size:12px;line-height:20px}
|
|
286
|
+
.gp-mermaid__fallback{overflow:auto;background:var(--dsw-alias-markdown-code-block);border-radius:6px;padding:10px 12px;font-family:var(--dsw-font-mono,monospace);font-size:12px;margin:8px 0}
|
|
287
|
+
.gp-files__html-wrap{flex:1;min-height:0;display:flex;flex-direction:column}
|
|
288
|
+
.gp-files__html-note{flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
289
|
+
.gp-files__html-note-run{flex:none;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:3px 8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);cursor:pointer;font-size:12px}
|
|
290
|
+
.gp-files__html-note-run:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
291
|
+
.gp-files__html-stage{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
|
|
262
292
|
.gp-files__html{flex:1;min-height:0;width:100%;border:0;background:#fff}
|
|
293
|
+
/* Covers the frame until its load event: a blob: document is drawn by another
|
|
294
|
+
* renderer process, so the panel shows an empty frame in the meantime. */
|
|
295
|
+
.gp-files__html-mask{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:16px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font-size:12px;transition:opacity .18s ease}
|
|
296
|
+
.gp-files__html-mask[data-state="ready"]{opacity:0;pointer-events:none}
|
|
297
|
+
/* A page that is merely slow must not look like a dead panel: the mask keeps
|
|
298
|
+
* showing but stops taking clicks, so the tree, the toolbar and the reader
|
|
299
|
+
* stay usable while the page finishes. */
|
|
300
|
+
.gp-files__html-mask[data-state="slow"]{pointer-events:none;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 72%,transparent)}
|
|
301
|
+
.gp-files__html-mask[data-state="slow"] .gp-files__html-mask-stop{pointer-events:auto}
|
|
302
|
+
.gp-files__html-mask-elapsed{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-tertiary)}
|
|
303
|
+
.gp-files__html-mask-stop{border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:3px 10px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;font-size:12px}
|
|
304
|
+
.gp-files__html-mask-stop:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
305
|
+
.gp-files__html-mask-stop:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
306
|
+
/* The platform loader owns its own animation; a transparent mask must not keep
|
|
307
|
+
* it running behind the finished page. */
|
|
308
|
+
.gp-files__html-mask-spin{flex:none;display:inline-flex}
|
|
309
|
+
.gp-files__html-mask[data-state="ready"] .gp-files__html-mask-spin *{animation:none}
|
|
310
|
+
.gp-files__html-mask-label{max-width:80%;text-align:center;line-height:1.5}
|
|
263
311
|
.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}
|
|
264
|
-
|
|
312
|
+
/* Both sticky axes: the header must also stay put under horizontal scroll
|
|
313
|
+
* (reachable only in nowrap mode), or the find bar slides out of view. */
|
|
314
|
+
.gp-files__header{position:sticky;top:0;left:0;z-index:2}
|
|
265
315
|
.gp-files__note{padding:5px 12px;font-size:11px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);border-bottom:1px solid var(--dsw-alias-border-l2)}
|
|
266
316
|
.gp-find{display:flex;align-items:center;gap:4px;padding:5px 8px;background:var(--dsw-alias-bg-layer-2);border-bottom:1px solid var(--dsw-alias-border-l2)}
|
|
267
317
|
.gp-find__input{flex:1;min-width:60px;height:26px;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 8px;box-sizing:border-box}
|
|
@@ -286,6 +336,16 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
286
336
|
/* Fixed row height needs non-wrapping cells; a long line scrolls horizontally
|
|
287
337
|
* on the container instead of growing the row past ROW_HEIGHT. */
|
|
288
338
|
.gp-files__row .gp-diff-cell{white-space:pre;overflow:hidden;text-overflow:clip}
|
|
339
|
+
/* No-wrap: rows size to the longest line (min-width keeps short files full-bleed)
|
|
340
|
+
* so the container's overflow:auto exposes a real horizontal scrollbar. */
|
|
341
|
+
.gp-files__code--nowrap .gp-files__single--virt{width:max-content;min-width:100%}
|
|
342
|
+
.gp-files__code--nowrap .gp-files__row{right:auto;width:max-content;min-width:100%}
|
|
343
|
+
.gp-files__code--nowrap .gp-files__row .gp-diff-cell{overflow:visible}
|
|
344
|
+
/* Wrap: flow layout (not the fixed-height virtual grid) so a line can grow the
|
|
345
|
+
* row; the gutter stays one column beside the wrapping cell. */
|
|
346
|
+
.gp-files__code--wrap .gp-files__single--virt{position:static;width:auto;height:auto!important}
|
|
347
|
+
.gp-files__code--wrap .gp-files__row{position:static;height:auto;min-height:20px}
|
|
348
|
+
.gp-files__code--wrap .gp-files__row .gp-diff-cell{white-space:pre-wrap;overflow-wrap:anywhere;overflow:visible}
|
|
289
349
|
.gp-files__image{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;align-items:flex-start;justify-content:flex-start;padding:16px;background-color:var(--dsw-alias-bg-layer-1);background-image:linear-gradient(45deg,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 25%,transparent 25%,transparent 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 75%,transparent 75%);background-size:16px 16px}
|
|
290
350
|
.gp-files__image img{max-width:100%;max-height:100%;object-fit:contain}
|
|
291
351
|
.gp-changes__list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 0}
|
|
@@ -300,6 +360,15 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
300
360
|
/* A group kept only for its count has nothing to collapse: no chevron, no hand. */
|
|
301
361
|
.gp-group-head--static{cursor:default}
|
|
302
362
|
.gp-group-head__chev-spacer{display:inline-block;width:12px;flex:none}
|
|
363
|
+
/* Group select-all checkbox (issue #60): sits between the chevron and the
|
|
364
|
+
* label; a padded wrapper keeps the tap target \u226524px without changing the
|
|
365
|
+
* 14px box itself. */
|
|
366
|
+
.gp-group-head__pick{margin:0 2px;padding:6px;box-sizing:content-box;display:inline-flex;align-items:center;flex:none;cursor:pointer}
|
|
367
|
+
.gp-group-head__pick .gp-check{margin:0}
|
|
368
|
+
/* Truncation bar under the change list: expand lifts the host list cap,
|
|
369
|
+
* collapse returns to the capped poll. Sits between list and stash section. */
|
|
370
|
+
.gp-changes__expandbar{display:flex;align-items:center;gap:8px;padding:6px 12px;font-size:11px;color:var(--dsw-alias-label-tertiary);border-top:1px solid var(--dsw-alias-border-l2)}
|
|
371
|
+
.gp-changes__expandbar__text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
303
372
|
.gp-file-row{display:flex;align-items:center;gap:8px;padding:4px 10px 4px 20px;cursor:pointer;font-size:12px;border-radius:4px}
|
|
304
373
|
.gp-file-row:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
305
374
|
/* Selected change row: identical accent to the Git overview commit list
|
|
@@ -310,6 +379,9 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
310
379
|
* so hovering never changes the row's width \u2014 no wobble. */
|
|
311
380
|
.gp-file-row__actions{margin-left:auto;display:flex;gap:4px;flex:none;visibility:hidden}
|
|
312
381
|
.gp-file-row:hover .gp-file-row__actions{visibility:visible}
|
|
382
|
+
/* The trash glyph sits in an aria-hidden span; without flex the span is a
|
|
383
|
+
* baseline inline box and the SVG rides above the "+" text's centre line. */
|
|
384
|
+
.gp-file-row__actions .gp-icon-btn>span{display:inline-flex;align-items:center;justify-content:center}
|
|
313
385
|
|
|
314
386
|
/* stats bar */
|
|
315
387
|
.gp-stats{display:flex;align-items:center;gap:14px;padding:8px 12px;min-height:33px;box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2);font-size:12px;color:var(--dsw-alias-label-secondary);flex:none;flex-wrap:wrap}
|
|
@@ -320,20 +392,26 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
320
392
|
.gp-stats__del{color:var(--dsw-alias-state-error-primary)}
|
|
321
393
|
/* "simplified" marker on a huge change set: muted + help cursor + dotted hint. */
|
|
322
394
|
.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.
|
|
324
|
-
*
|
|
325
|
-
*
|
|
395
|
+
/* Compact stats bar: the counts on one clipped, never-wrapping line. A cramped
|
|
396
|
+
* panel (narrow and short) drops the timestamps entirely so the bar never costs
|
|
397
|
+
* a second row above the change list; a narrow-but-tall panel keeps them and
|
|
398
|
+
* spends that row, since it has the height to spare. */
|
|
326
399
|
.gp-stats--compact{padding:6px 8px 6px 12px;gap:4px 8px;align-items:center}
|
|
327
400
|
.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
401
|
.gp-stats--compact .gp-stats__main>.gp-stats__item{flex:none}
|
|
402
|
+
/* Timed compact: the timestamps take a full row of their own under the counts. */
|
|
403
|
+
.gp-stats--timed{flex-wrap:wrap}
|
|
404
|
+
.gp-stats--timed>.gp-stats__main{flex:1 1 100%}
|
|
405
|
+
.gp-stats--timed>.gp-stats__times{flex:1 1 100%;padding-top:2px}
|
|
329
406
|
|
|
330
407
|
/* commit box */
|
|
331
408
|
.gp-commitbox{flex:none;border-top:1px solid var(--dsw-alias-border-l2);padding:8px 10px;display:flex;flex-direction:column;gap:8px}
|
|
332
409
|
.gp-commitbox__msg{width:100%;min-height:72px;resize:vertical;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:8px;box-sizing:border-box}
|
|
333
410
|
.gp-commitbox__msg-wrap{position:relative;display:block}
|
|
334
411
|
.gp-commitbox__msg-wrap--busy .gp-commitbox__msg{padding-right:28px}
|
|
335
|
-
/* Loading indicator inside the disabled field (AI suggest in flight)
|
|
336
|
-
|
|
412
|
+
/* Loading indicator inside the disabled field (AI suggest in flight): a
|
|
413
|
+
* positioning box around the platform loader. */
|
|
414
|
+
.gp-commitbox__spin{position:absolute;top:8px;right:8px;display:inline-flex;pointer-events:none}
|
|
337
415
|
.gp-commitbox__msg[readonly]{color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);cursor:progress}
|
|
338
416
|
.gp-commitbox__msg:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
339
417
|
.gp-commitbox__row{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
|
|
@@ -345,6 +423,9 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
345
423
|
.gp-commitbar__open:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
346
424
|
.gp-commitbar__ph,.gp-commitbar__draft{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
347
425
|
.gp-commitbar__ph{color:var(--dsw-alias-label-tertiary)}
|
|
426
|
+
/* Generation entry in the folded bar: the icon plus the two letters only, so it
|
|
427
|
+
* fits beside Commit on a phone (its accessible name keeps the full wording). */
|
|
428
|
+
.gp-commitbar__ai{flex:none;padding:0 8px;gap:5px}
|
|
348
429
|
.gp-panel[data-layout="compact"] .gp-commitbar .gp-btn{height:30px}
|
|
349
430
|
/* Compact commit row: AI suggest / Commit / fold all share the 30px height, so
|
|
350
431
|
* the fold button lines up with its neighbours and the row loses vertical padding. */
|
|
@@ -432,6 +513,13 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
432
513
|
.gp-svgdiff__bar{flex:none;display:flex;justify-content:flex-end;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}
|
|
433
514
|
.gp-svgdiff__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
|
|
434
515
|
.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}
|
|
516
|
+
/* Dismissible error banner: the message line is centred on a one-line banner;
|
|
517
|
+
* when the message wraps, the close control drops to the bottom-right corner. */
|
|
518
|
+
.gp-feedback--dismissible .gp-feedback__close{align-self:flex-end}
|
|
519
|
+
.gp-feedback__text{flex:1 1 auto;min-width:0}
|
|
520
|
+
.gp-feedback__close{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;border-radius:5px;background:transparent;color:inherit;cursor:pointer;opacity:.75}
|
|
521
|
+
.gp-feedback__close:hover{opacity:1;background:var(--dsw-alias-interactive-bg-hover)}
|
|
522
|
+
.gp-feedback__close:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
435
523
|
.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
524
|
/* Dismissible banner: the text takes the free width, the close button pins right. */
|
|
437
525
|
.gp-notice__text{flex:1 1 auto;min-width:0}
|
|
@@ -476,7 +564,6 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
476
564
|
.gp-modal__overlay{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:20px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 82%,transparent);backdrop-filter:blur(1.5px);border-radius:inherit;animation:gp-fade-in .12s ease}
|
|
477
565
|
.gp-modal__overlay-label{font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
478
566
|
@keyframes gp-fade-in{from{opacity:0}to{opacity:1}}
|
|
479
|
-
.gp-spinner{width:26px;height:26px;border-radius:50%;border:2.5px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-state-business-primary);animation:gp-spin .7s linear infinite}
|
|
480
567
|
.gp-modal__check{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer;user-select:none}
|
|
481
568
|
.gp-input{width:100%;box-sizing:border-box;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:13px}
|
|
482
569
|
.gp-input:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}
|
|
@@ -572,6 +659,14 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
572
659
|
.gp-stash-row__meta{display:flex;gap:8px;font-size:10px;color:var(--dsw-alias-label-tertiary)}
|
|
573
660
|
.gp-stash-row__actions{flex:none;display:flex;align-items:center;gap:4px}
|
|
574
661
|
|
|
662
|
+
/* Publish strip above the commit editor: shown only while the branch exists
|
|
663
|
+
* solely on the local side, so a fresh local branch still has a visible way
|
|
664
|
+
* onto the remote (issue #63). Mirrors VSCode's "Publish Branch" affordance \u2014
|
|
665
|
+
* a full-width primary action directly above the commit message field. */
|
|
666
|
+
.gp-publishbar{flex:none;border-top:1px solid var(--dsw-alias-border-l2);padding:8px 10px}
|
|
667
|
+
.gp-publishbar__btn{width:100%;justify-content:center}
|
|
668
|
+
.gp-panel[data-layout="compact"] .gp-publishbar__btn{height:30px}
|
|
669
|
+
|
|
575
670
|
/* commit hover card (middle column): pointer-anchored, lists changed files */
|
|
576
671
|
.gp-hovercard{position:fixed;z-index:70;padding:10px 12px;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2));border-radius:10px;background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));box-shadow:0 8px 28px rgba(0,0,0,.2),0 1px 3px rgba(0,0,0,.12);font-size:12px;pointer-events:none;max-height:60vh;overflow:hidden;display:flex;flex-direction:column}
|
|
577
672
|
.gp-hovercard__subject{font-weight:600;color:var(--dsw-alias-label-primary);margin-bottom:4px;white-space:normal;word-break:break-word;overflow-wrap:anywhere}
|
|
@@ -605,32 +700,38 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
605
700
|
.gp-pill--compact .gp-pill__dot{display:block}
|
|
606
701
|
.gp-pill--compact .gp-pill__repo,.gp-pill--compact .gp-pill__git{display:none}
|
|
607
702
|
|
|
608
|
-
/* plugin detail config form (plugins.bundle.config slot body)
|
|
609
|
-
|
|
610
|
-
.gp-
|
|
703
|
+
/* plugin detail config form (plugins.bundle.config slot body) \u2014 font sizes
|
|
704
|
+
* follow the shell settings page: 15px section titles, 14px labels, 13px hints. */
|
|
705
|
+
.gp-cfg{display:flex;flex-direction:column;gap:12px;padding:16px 20px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-1)}
|
|
706
|
+
.gp-cfg__title{margin:0;font-size:15px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
611
707
|
.gp-cfg__row{display:inline-flex;align-items:center;gap:10px;cursor:pointer;user-select:none}
|
|
612
708
|
/* \u5F00\u5173\u6E05\u96F6 border/padding\uFF1A::after \u6309 padding box \u5B9A\u4F4D\uFF0CUA \u9ED8\u8BA4 1px \u8FB9\u6846\u4F1A\u628A\u5B9A\u4F4D\u6846\u4E0A\u4E0B\u5404\u7F29 1px\uFF0C\u6ED1\u5757\u4E0A\u7F18\u5C31\u591A\u51FA 1px \u7A7A\u9699\u3002 */
|
|
613
|
-
.gp-cfg__switch{appearance:none;-webkit-appearance:none;flex:none;width:
|
|
614
|
-
.gp-cfg__switch::after{content:"";position:absolute;top:2px;left:2px;width:
|
|
709
|
+
.gp-cfg__switch{appearance:none;-webkit-appearance:none;flex:none;width:36px;height:20px;margin:0;padding:0;border:0;border-radius:999px;background:var(--dsw-alias-border-l2);position:relative;transition:background .15s ease;cursor:pointer}
|
|
710
|
+
.gp-cfg__switch::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:999px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s ease}
|
|
615
711
|
.gp-cfg__switch:checked{background:var(--dsw-alias-state-business-primary)}
|
|
616
|
-
.gp-cfg__switch:checked::after{transform:translateX(
|
|
712
|
+
.gp-cfg__switch:checked::after{transform:translateX(16px)}
|
|
617
713
|
.gp-cfg__switch:disabled{opacity:.5;cursor:default}
|
|
618
714
|
.gp-cfg__switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
|
|
619
|
-
.gp-cfg__text{font-size:
|
|
715
|
+
.gp-cfg__text{font-size:14px;color:var(--dsw-alias-label-primary)}
|
|
620
716
|
.gp-cfg__seg{align-self:flex-start}
|
|
621
|
-
.gp-cfg__seglabel{margin:0;font-size:
|
|
622
|
-
.gp-cfg__hint{margin:0;font-size:
|
|
623
|
-
.gp-cfg__err{margin:0;font-size:
|
|
624
|
-
.gp-cfg__card{display:flex;flex-direction:column;gap:10px;padding:12px 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2)}
|
|
625
|
-
.gp-cfg__card-title{margin:0;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
717
|
+
.gp-cfg__seglabel{margin:0;font-size:14px;color:var(--dsw-alias-label-primary)}
|
|
718
|
+
.gp-cfg__hint{margin:0;font-size:13px;line-height:1.6;color:var(--dsw-alias-label-tertiary)}
|
|
719
|
+
.gp-cfg__err{margin:0;font-size:13px;color:var(--dsw-alias-state-error-primary)}
|
|
626
720
|
.gp-cfg__numrow{display:flex;align-items:center;gap:8px}
|
|
627
|
-
.gp-cfg__numlabel{flex:1;min-width:0;font-size:
|
|
628
|
-
.gp-cfg__numinput{flex:none;width:
|
|
721
|
+
.gp-cfg__numlabel{flex:1;min-width:0;font-size:14px;color:var(--dsw-alias-label-primary)}
|
|
722
|
+
.gp-cfg__numinput{flex:none;width:80px;height:30px;padding:0 8px;box-sizing:border-box;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:13px;text-align:right}
|
|
629
723
|
.gp-cfg__numinput:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}
|
|
630
724
|
.gp-cfg__numinput:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}
|
|
631
725
|
.gp-cfg__numinput:disabled{opacity:.5;cursor:default}
|
|
632
|
-
.gp-cfg__numunit{flex:none;width:44px;font-size:
|
|
633
|
-
.gp-cfg__rangehint{margin:-4px 0 0;font-size:
|
|
726
|
+
.gp-cfg__numunit{flex:none;width:44px;font-size:12px;color:var(--dsw-alias-label-tertiary)}
|
|
727
|
+
.gp-cfg__rangehint{margin:-4px 0 0;font-size:12px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}
|
|
728
|
+
/* Cascading model selects use the platform Menu; the row is label + trigger. */
|
|
729
|
+
.gp-cfg__menur{display:flex;align-items:center;gap:8px}
|
|
730
|
+
.gp-cfg__menulabel{flex:1;min-width:0;font-size:14px;color:var(--dsw-alias-label-primary)}
|
|
731
|
+
.gp-cfg__select-trigger{max-width:240px;min-height:30px;font-size:13px}
|
|
732
|
+
.gp-cfg__menu{display:inline-flex;align-items:center;min-width:0}
|
|
733
|
+
.gp-cfg__retry{margin-left:6px;padding:0 8px;height:24px;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}
|
|
734
|
+
.gp-cfg__retry:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
634
735
|
|
|
635
736
|
/* status dot appended to the shell's Git view-tab button \u2014 shown only when the
|
|
636
737
|
* input-bar marker is hidden; colour mirrors the pill branch (synced/dirty). */
|
|
@@ -661,16 +762,24 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
661
762
|
* own classes / viewport media queries instead.
|
|
662
763
|
* =================================================================== */
|
|
663
764
|
|
|
664
|
-
/* Tab bar: one row.
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
*
|
|
670
|
-
|
|
765
|
+
/* Tab bar: one row. Compact shows the short tab labels (Git / \u53D8\u66F4 / \u6587\u4EF6)
|
|
766
|
+
* and drops the font stepper + version cluster entirely (the font step lives
|
|
767
|
+
* on the plugin config page). The long labels are swapped for short ones in
|
|
768
|
+
* Panel.tsx; nothing is clipped.
|
|
769
|
+
* Keep the platform track's grey module background and sliding indicator (the
|
|
770
|
+
* animation is transform on the indicator); only tighten the paddings so the
|
|
771
|
+
* short labels get more of the row width. */
|
|
772
|
+
.gp-panel[data-layout="compact"] .gp-tabbar__tabs{flex:1 1 auto;padding:2px;border-radius:8px}
|
|
671
773
|
.gp-panel[data-layout="compact"] .gp-tabbar__tabs--single{flex:0 0 auto}
|
|
774
|
+
/* Indicator width is an inline calc((100% - 8px) / n) from the primitive.
|
|
775
|
+
* Platform DOM contract pinned here: the indicator is a DIRECT span child with
|
|
776
|
+
* aria-hidden and that inline width \u2014 if the primitive wraps it or changes the
|
|
777
|
+
* width formula, compact indicator geometry breaks silently (watch the e2e). */
|
|
778
|
+
.gp-panel[data-layout="compact"] .gp-tabbar__tabs>span[aria-hidden="true"]{inset:2px auto 2px 2px;width:calc((100% - 4px) / 3) !important}
|
|
779
|
+
.gp-panel[data-layout="compact"] .gp-tabbar__tabs--single>span[aria-hidden="true"]{width:calc(100% - 4px) !important}
|
|
780
|
+
/* Slightly shorter cells + less side padding so "Overview" fits on a phone. */
|
|
781
|
+
.gp-panel[data-layout="compact"] .gp-tabbar__tabs>[role="tab"]{height:30px;padding:0 8px;font-size:12px}
|
|
672
782
|
.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}
|
|
674
783
|
|
|
675
784
|
/* Shared drill-in back bar (overview detail / files preview). The Changes
|
|
676
785
|
* diff and Files bar reuse just the .gp-subhead__back button inline. */
|
|
@@ -704,9 +813,20 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
704
813
|
/* Changes / Files: the single visible pane takes the full width. */
|
|
705
814
|
.gp-changes--compact .gp-changes__left,
|
|
706
815
|
.gp-changes--compact .gp-changes__right{flex:1 1 100%;min-width:0;width:100%}
|
|
707
|
-
.gp-files--compact .gp-files__tree,
|
|
816
|
+
.gp-files--compact .gp-files__tree-wrap,
|
|
708
817
|
.gp-files--compact .gp-files__preview{flex:1 1 100%;min-width:0;width:100%}
|
|
709
818
|
|
|
819
|
+
/* Fullscreen reader: the tab's live preview restyled in place \u2014 nothing is
|
|
820
|
+
* re-rendered, so a rendered HTML document keeps its frame and a code view
|
|
821
|
+
* keeps its scroll position. The card is fixed rather than portaled (moving
|
|
822
|
+
* the node would reload the frame), so it depends on no ancestor creating a
|
|
823
|
+
* containing block (transform, filter, contain: paint) and on the backdrop
|
|
824
|
+
* sitting below it in document order. */
|
|
825
|
+
.gp-files .gp-files__preview--full{position:fixed;inset:0;margin:auto;z-index:1000;width:min(920px,86vw);height:min(680px,82vh);min-width:0;max-height:100vh;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2));border-radius:14px;overflow:hidden;box-shadow:0 24px 64px rgba(0,0,0,.32),0 4px 12px rgba(0,0,0,.18);animation:gp-modal-in .18s cubic-bezier(.16,1,.3,1)}
|
|
826
|
+
.gp-files__fs-backdrop{position:fixed;inset:0;z-index:999;background:color-mix(in srgb,var(--dsw-alias-bg-base,#000) 62%,transparent);animation:gp-fade-in .12s ease}
|
|
827
|
+
.gp-files__fs-screen{flex:none}
|
|
828
|
+
|
|
829
|
+
|
|
710
830
|
/* Image compare stacks vertically in compact: two ~195px columns are unusable
|
|
711
831
|
* on a phone. The single-image before/after mode keeps its full-height row.
|
|
712
832
|
* The portaled diff modal lives outside .gp-panel, so it keeps side-by-side
|
|
@@ -782,15 +902,21 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
|
|
|
782
902
|
.gp-zl-close:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
783
903
|
.gp-zl-close:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:3px}
|
|
784
904
|
@media (prefers-reduced-motion:reduce){
|
|
785
|
-
.gp-sheet,.gp-sheet-backdrop,.gp-modal,.gp-modal-backdrop,.gp-zl-mask{animation:none}
|
|
905
|
+
.gp-sheet,.gp-sheet-backdrop,.gp-modal,.gp-modal-backdrop,.gp-zl-mask,.gp-files__html-mask,.gp-files__fs-backdrop,.gp-files__preview--full{animation:none;transition:none}
|
|
786
906
|
}
|
|
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
|
|
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
|
-
`)
|
|
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};
|
|
907
|
+
`,ei=!1;function Bi(){if(ei||typeof document>"u")return;let e="dsh-git-panel/client.css";if(document.querySelector(`style[data-plugin-css="${e}"]`)!==null){ei=!0;return}let t=document.createElement("style");t.dataset.plugin="@xbzbing/dsh-git-panel",t.dataset.pluginCss=e,t.textContent=Ms,document.head.appendChild(t),ei=!0}var Ii={"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","tab.overviewShort":"Git","tab.changesShort":"\u53D8\u66F4","tab.filesShort":"\u6587\u4EF6","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.selectAllGroup":"\u9009\u62E9\u672C\u7EC4\u5168\u90E8\u6587\u4EF6\uFF1A{group}","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.discardAll":"\u653E\u5F03\u5168\u90E8\u53D8\u66F4","changes.discardAllTitle":"\u653E\u5F03\u5168\u90E8\u5DE5\u4F5C\u533A\u66F4\u6539","changes.discardAllBody":"\u5C06\u653E\u5F03\u5168\u90E8 {count} \u4E2A\u5DE5\u4F5C\u533A\u6587\u4EF6\u7684\u672A\u63D0\u4EA4\u66F4\u6539\uFF0C\u56DE\u5230\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u7684\u72B6\u6001\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","changes.discardAllUntracked":"\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.discardAllStaged":"\u6682\u5B58\u533A\u7684 {count} \u4E2A\u66F4\u6539\u4E0D\u53D7\u5F71\u54CD\uFF08\u5982\u9700\u64A4\u9500\u6682\u5B58\u8BF7\u7528\u300C\u53D6\u6D88\u6682\u5B58\u300D\uFF09\u3002","changes.expandAll":"\u5C55\u5F00\u5168\u90E8","changes.expanding":"\u6B63\u5728\u52A0\u8F7D\u5168\u90E8\u53D8\u66F4\u2026","changes.expandedAll":"\u5DF2\u5C55\u5F00\u5168\u90E8 {n} \u4E2A\u53D8\u66F4","changes.collapseList":"\u6536\u8D77","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","changes.noRemoteTarget":"\u5F53\u524D\u5206\u652F\u6CA1\u6709\u53EF\u63A8\u9001\u6216\u53EF\u53D1\u5E03\u7684\u63D0\u4EA4\uFF08\u5DF2\u540C\u6B65\u3001\u5DF2\u843D\u540E\u6216\u5DF2\u5206\u53C9\uFF0C\u6216\u6CA1\u6709\u53EF\u7528\u7684\u8FDC\u7A0B\uFF09","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.notFound":"\u6587\u4EF6\u4E0D\u5B58\u5728\uFF08\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u79FB\u52A8\uFF09","files.backToTree":"\u8FD4\u56DE\u6587\u4EF6\u6811","files.truncated":"\u6761\u76EE\u8FC7\u591A\uFF0C\u5DF2\u622A\u65AD","files.refresh":"\u5237\u65B0\u6587\u4EF6\u6D4F\u89C8","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.wrap":"\u81EA\u52A8\u6362\u884C","files.wrapDisabled":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u81EA\u52A8\u6362\u884C\u4E0D\u53EF\u7528","files.runScripts":"\u8FD0\u884C\u9875\u9762\u811A\u672C","files.scriptsOff":"\u9759\u6001\u9884\u89C8\uFF1A\u4E0D\u6267\u884C\u9875\u9762\u811A\u672C\u3002\u70B9\u51FB\u8FD0\u884C\u811A\u672C\uFF08\u5927\u6587\u4EF6\u53EF\u80FD\u5361\u987F\uFF09","files.scriptsSkipped":"\u9759\u6001\u9884\u89C8\u5DF2\u8DF3\u8FC7\u9875\u9762\u811A\u672C\uFF0C\u4F9D\u8D56\u811A\u672C\u6E32\u67D3\u7684\u5185\u5BB9\u4F1A\u663E\u793A\u4E3A\u7A7A\u767D\u3002","files.htmlRendering":"\u6B63\u5728\u6E32\u67D3\u9884\u89C8\u2026","files.htmlRenderingSlow":"\u9875\u9762\u811A\u672C\u4ECD\u5728\u6267\u884C\uFF0C\u9884\u89C8\u7A0D\u540E\u51FA\u73B0","files.htmlRenderingSeconds":"\u5DF2\u7B49\u5F85 {seconds} \u79D2","files.htmlStopRendering":"\u505C\u6B62\u6E32\u67D3","files.htmlHeavyWhy":"\u8BE5\u9875\u9762\u81EA\u5E26 {size} \u5185\u8054\u811A\u672C\u3002","files.htmlHeavyInline":"\u5728\u5185\u5D4C\u9884\u89C8\u4E2D\u6E32\u67D3\u5B83\uFF0C\u53EF\u80FD\u8BA9\u6574\u4E2A\u754C\u9762\u5931\u53BB\u54CD\u5E94\u5341\u51E0\u79D2\u2014\u2014\u9875\u9762\u81EA\u8EAB\u7684\u7ED8\u56FE\u4F1A\u5360\u6EE1\u5E94\u7528\u5171\u7528\u7684 GPU \u8FDB\u7A0B\uFF0C\u5C4A\u65F6\u6240\u6709\u7A97\u53E3\u90FD\u4E0D\u518D\u5237\u65B0\u3002","files.htmlHeavyRemote":"\u8FD9\u662F\u8FDC\u7A0B\u5B9E\u4F8B\uFF0C\u6587\u4EF6\u5728\u8FDC\u7A0B\u673A\u5668\u4E0A\uFF0C\u65E0\u6CD5\u5728\u672C\u5730\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00\u3002\u4F60\u4ECD\u53EF\u5185\u5D4C\u6E32\u67D3\uFF0C\u5E76\u5728\u7B49\u5F85\u671F\u95F4\u70B9\u51FB\u300C\u505C\u6B62\u6E32\u67D3\u300D\u3002","files.htmlHeavyRun":"\u4ECD\u7136\u6E32\u67D3","files.htmlOpenInBrowser":"\u5728\u7CFB\u7EDF\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00","files.htmlOpening":"\u6B63\u5728\u6253\u5F00\u2026","files.htmlOpenFailed":"\u65E0\u6CD5\u5728\u672C\u673A\u6253\u5F00\u8BE5\u6587\u4EF6\uFF08\u8FDC\u7A0B\u5B9E\u4F8B\u6216\u7CFB\u7EDF\u4E0D\u652F\u6301\uFF09\u3002","files.scriptsOn":"\u6B63\u5728\u6267\u884C\u9875\u9762\u811A\u672C\u3002\u70B9\u51FB\u6539\u56DE\u9759\u6001\u9884\u89C8","files.mermaidLoading":"\u6B63\u5728\u52A0\u8F7D\u56FE\u8868\u5F15\u64CE\u2026","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.screenFull":"\u5168\u5C4F\u663E\u793A","files.enterFullscreen":"\u8FDB\u5165\u5168\u5C4F","files.exitFullscreen":"\u9000\u51FA\u5168\u5C4F","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.ai":"AI","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","commit.publish":"\u53D1\u5E03\u5206\u652F","commit.publishTitle":"\u8FDC\u7A0B\u8FD8\u6CA1\u6709\u8FD9\u4E2A\u5206\u652F\uFF1A\u521B\u5EFA\u540C\u540D\u8FDC\u7A0B\u5206\u652F\u5E76\u8BBE\u4E3A\u4E0A\u6E38\uFF08git push -u\uFF09","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.nothingToCommit":"\u6CA1\u6709\u53EF\u63D0\u4EA4\u7684\u53D8\u66F4\uFF1A\u8BF7\u5148\u6682\u5B58\uFF0C\u6216\u5728\u5217\u8868\u4E2D\u52FE\u9009\u6709\u6539\u52A8\u7684\u6587\u4EF6","error.timeout":"Git \u64CD\u4F5C\u8D85\u65F6\uFF1A\u547D\u4EE4\u672A\u5728\u9650\u5B9A\u65F6\u95F4\u5185\u5B8C\u6210","error.cancelled":"\u64CD\u4F5C\u5DF2\u53D6\u6D88","error.invalidPath":"\u8DEF\u5F84\u4E0D\u5408\u6CD5\uFF1A\u4E0D\u5728\u4ED3\u5E93\u5185\u6216\u4E0D\u53D7\u652F\u6301","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.statusLossy":"Git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5B8C\u6574\u53D8\u66F4\u96C6\uFF1B\u300C\u653E\u5F03\u5168\u90E8\u300D\u5DF2\u53D6\u6D88\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5\u6216\u6539\u7528\u9010\u9879\u653E\u5F03","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","error.noBranch":"\u5F53\u524D\u4E0D\u5728\u4EFB\u4F55\u5206\u652F\u4E0A\uFF08\u6E38\u79BB HEAD \u6216\u5C1A\u65E0\u63D0\u4EA4\uFF09\uFF0C\u65E0\u6CD5\u53D1\u5E03\u5206\u652F\uFF1A\u8BF7\u5148\u5207\u5230\u5206\u652F\u5E76\u5B8C\u6210\u4E00\u6B21\u63D0\u4EA4","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.fontTitle":"\u9762\u677F\u5B57\u53F7","cfg.fontSmaller":"\u8F83\u5C0F\uFF08A\u2212\uFF09","cfg.fontDefault":"\u9ED8\u8BA4\uFF08A\uFF09","cfg.fontLarger":"\u8F83\u5927\uFF08A+\uFF09","cfg.fontHint":"\u5F71\u54CD Git \u9762\u677F\u5185\u6240\u6709\u6587\u5B57\u7684\u663E\u793A\u5927\u5C0F\uFF1B\u5BBD\u9762\u677F\u5DE5\u5177\u680F\u7684 A\u2212/A/A+ \u4E0E\u6B64\u540C\u6B65\u3002","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.suggestModelLabel":"\u6A21\u578B","cfg.suggestModelSession":"\u8DDF\u968F\u4F1A\u8BDD\u9ED8\u8BA4","cfg.suggestModelLoading":"\u52A0\u8F7D\u6A21\u578B\u5217\u8868\u2026","cfg.suggestModelEmpty":"\u672A\u68C0\u6D4B\u5230\u53EF\u7528\u6A21\u578B\uFF0C\u8BF7\u5148\u5728 DSH \u8BBE\u7F6E\u4E2D\u914D\u7F6E","cfg.suggestModelFailed":"\u6A21\u578B\u5217\u8868\u52A0\u8F7D\u5931\u8D25","cfg.suggestModelRetry":"\u91CD\u8BD5","cfg.suggestProviderLabel":"\u63D0\u4F9B\u65B9","cfg.suggestModelPick":"\u9009\u62E9\u6A21\u578B","cfg.suggestEffortLabel":"\u63A8\u7406\u5F3A\u5EA6","cfg.suggestEffortUnset":"\u4E0D\u8BBE\u7F6E\uFF08\u7528\u6A21\u578B\u9ED8\u8BA4\uFF09","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\u9009\u56FA\u5B9A\u6A21\u578B\u540E\uFF0C\u751F\u6210\u4F1A\u628A diff \u53D1\u7ED9\u8BE5\u6A21\u578B\u7684\u4F9B\u5E94\u5546\uFF1B\u9009\u300C\u8DDF\u968F\u4F1A\u8BDD\u9ED8\u8BA4\u300D\u5219\u7528\u5F53\u524D\u4F1A\u8BDD\u7684 Agent \u6A21\u578B\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"},Oi={"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","tab.overviewShort":"Overview","tab.changesShort":"Changes","tab.filesShort":"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.selectAllGroup":"Select all files in this group: {group}","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.discardAll":"Discard all changes","changes.discardAllTitle":"Discard all working-tree changes","changes.discardAllBody":"Discards uncommitted working-tree changes in all {count} file(s), restoring the last committed state. This cannot be undone.","changes.discardAllUntracked":"{count} of them are untracked files or directories that will be deleted from disk (never in Git history \u2014 unrecoverable).","changes.discardAllStaged":"{count} staged change(s) are not affected; use Unstage to undo the index.","changes.expandAll":"Expand all","changes.expanding":"Loading all changes\u2026","changes.expandedAll":"All {n} changes expanded","changes.collapseList":"Collapse","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","changes.noRemoteTarget":"This branch has nothing to push or publish (already in sync, behind, diverged, or no usable remote)","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.notFound":"File not found (deleted or moved)","files.backToTree":"Back to files","files.truncated":"Too many entries \u2014 truncated","files.refresh":"Refresh the file browser","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.wrap":"Word wrap","files.wrapDisabled":"Word wrap unavailable for large files","files.runScripts":"Run page scripts","files.scriptsOff":"Static preview: page scripts are off. Click to run them (large pages can stall)","files.scriptsSkipped":"The static preview skipped the page scripts, so script-rendered content is blank.","files.htmlRendering":"Rendering preview\u2026","files.htmlRenderingSlow":"Page scripts are still running; the preview will appear shortly","files.htmlRenderingSeconds":"Waiting for {seconds} s","files.htmlStopRendering":"Stop rendering","files.htmlHeavyWhy":"This page carries {size} of inline scripts.","files.htmlHeavyInline":"Rendering it inline can freeze the whole interface for a dozen seconds: the page's own drawing saturates the GPU process that every window of the app shares, and nothing repaints until it finishes.","files.htmlHeavyRemote":'This is a remote instance, so the file lives on the remote machine and cannot be opened in a local browser. You can still render it inline and press "Stop rendering" while it waits.',"files.htmlHeavyRun":"Render anyway","files.htmlOpenInBrowser":"Open in the system browser","files.htmlOpening":"Opening\u2026","files.htmlOpenFailed":"Could not open the file on this machine (remote instance, or no desktop opener).","files.scriptsOn":"Page scripts are running. Click to return to the static preview","files.mermaidLoading":"Loading diagram engine\u2026","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.screenFull":"Full screen","files.enterFullscreen":"Enter full screen","files.exitFullscreen":"Exit full screen","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.ai":"AI","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","commit.publish":"Publish Branch","commit.publishTitle":"The remote has no such branch yet: create a same-named remote branch and set it as upstream (git push -u)","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.nothingToCommit":"Nothing to commit: stage the changes first, or select files that have changes in the list","error.timeout":"Git operation timed out: the command did not finish within the limit","error.cancelled":"Operation cancelled","error.invalidPath":"Invalid path: outside the repository or unsupported","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.statusLossy":"Git output exceeded the limit, so the full change set cannot be confirmed; \u201CDiscard all\u201D was cancelled \u2014 refresh and retry, or discard selectively","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","error.noBranch":"HEAD is not on a branch (detached, or no commits yet), so there is no branch to publish: switch to a branch and commit first","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.fontTitle":"Panel font size","cfg.fontSmaller":"Smaller (A\u2212)","cfg.fontDefault":"Default (A)","cfg.fontLarger":"Larger (A+)","cfg.fontHint":"Scales all text inside the Git panel; the wide-layout A\u2212/A/A+ stepper stays in sync.","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.suggestModelLabel":"Model","cfg.suggestModelSession":"Follow session default","cfg.suggestModelLoading":"Loading model list\u2026","cfg.suggestModelEmpty":"No models detected \u2014 configure one in DSH Settings first","cfg.suggestModelFailed":"Failed to load the model list","cfg.suggestModelRetry":"Retry","cfg.suggestProviderLabel":"Provider","cfg.suggestModelPick":"Select a model","cfg.suggestEffortLabel":"Reasoning effort","cfg.suggestEffortUnset":"Not set (model default)","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. A fixed model sends the diff to that model\u2019s provider; "Follow session default" uses the current session\u2019s Agent model. 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 Kn=require("react");function Gs(e=()=>typeof document>"u"?void 0:document){let t=new Set,n,r=!0,i=()=>e()?.hidden!==!0,a=()=>{let o=i();if(o!==r){r=o;for(let s of[...t])s()}};return{isVisible:i,subscribe(o){return t.size===0&&(n=e(),r=i(),n?.addEventListener("visibilitychange",a)),t.add(o),()=>{t.delete(o),t.size===0&&(n?.removeEventListener("visibilitychange",a),n=void 0)}}}}var ht=Gs();var Ps=new Set(["cwd-unavailable"]),Xi=3e4,Rs=6e4,or=class{constructor(t,n,r=ht){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=Xi;unsubscribeVisibility;visibilityGeneration=0;requestGeneration=0;querySignal={tick:0,sampledAt:0,ready:!1,root:null};queryListeners=new Set;fullChanges=!1;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,...this.fullChanges?{fullChanges:!0}:{}}).then(r=>{if(!(this.disposed||n!==this.requestGeneration)){if(r.ok)this.publishSnapshot(r.value,t,!1);else if(r.error.code!=="cancelled")if(Ps.has(r.error.code))this.pollMs=Rs,this.setView({state:"no-cwd"});else if(r.error.code==="not-a-git-repo"){let i=r.error;this.setView({state:"error",error:{code:"not-a-git-repo",...i.cwd?{cwd:i.cwd}:{},...i.showInputPill!==void 0?{showInputPill:i.showInputPill}:{}}})}else if(r.error.code==="git-unavailable"){let i=r.error;this.setView({state:"error",error:{code:"git-unavailable",...i.detail?{detail:i.detail}:{},...i.cwd?{cwd:i.cwd}:{},...i.isGitRepo!==void 0?{isGitRepo:i.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())}setFullChanges(t){return this.disposed?Promise.resolve():(this.fullChanges=t,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||Xi;let i=this.view.state==="ready"?this.view.snapshot:null,a=!r&&i!==null&&t.root===i.root&&t.stateFingerprint!==void 0&&t.stateFingerprint===i.stateFingerprint,o={tick:this.querySignal.tick+1,sampledAt:t.checkedAt,ready:this.visibility.isVisible()&&n===this.visibilityGeneration,root:t.root};this.publish(a?this.view:{state:"ready",snapshot:t},o)}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,i=n!==this.querySignal;if(this.view=t,this.querySignal=n,r)for(let a of this.listeners)a();if(i)for(let a of this.queryListeners)a()}dispose(){this.disposed=!0,this.clearPoll(),this.unsubscribeVisibility(),this.pendingRefresh=!1,this.listeners.clear(),this.queryListeners.clear()}};var sr=require("react"),ti={tick:0,sampledAt:0,ready:!1,root:null};function Ls(e,t){let[n,r]=(0,sr.useState)(()=>e?.getQuerySignal()??ti);return(0,sr.useEffect)(()=>{if(e===void 0){r(ti);return}let i=()=>r(e.getQuerySignal());if(!t){i();return}let a=e.subscribeQueries(i);return i(),a},[e,t]),t?e?.getQuerySignal()??ti:n}function $i(e,t,n){let r=Ls(e,t);return{signal:r,queryVisible:t&&r.ready&&r.root===n,queryKey:[r.root,r.tick]}}var As="/api",Ds="gitPanel";function Fs(e){try{let t=e.get("connection")?.rpc,n=t?.call;if(t!==void 0&&typeof n=="function")return(r,i,a)=>n.call(t,As,r,i,a)}catch{}}function zs(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 _e(e,t){return!e.ok||e.value.kind!==t?null:e.value}function It(e){return e!==void 0&&e!==""}var Ki=new WeakMap;function pn(e){let t=Ki.get(e);if(t!==void 0)return t;let n=async(i,a,o)=>{let s=Fs(e);if(s===void 0)return{ok:!1,error:{code:"git-unavailable",message:"no connection"}};try{let l=await s(`${Ds}/${i}`,{args:{request:a}},o);return zs(l)}catch(l){return{ok:!1,error:{code:"git-unavailable",message:l instanceof Error?l.message:String(l)}}}},r={snapshot:(i,a)=>n("snapshot",i,a),run:(i,a)=>n("run",i,a),query:(i,a)=>n("query",i,a),suggest:(i,a)=>n("suggest",i,a),version:(i,a)=>n("version",i,a),openFile:(i,a)=>n("openFile",i,a)};return Ki.set(e,r),r}var Vt=new Map,Ji,ni;function ji(e){ni=e,Ji=pn(e)}function tn(e){let t=Vt.get(e);if(t===void 0){let n=Ji??(ni?pn(ni):void 0);t=new or(n??Bs(),e),Vt.set(e,t)}return t}var Hs=6e4,Sn=new Map;function Vi(e){let t=Sn.get(e);t!==void 0&&(clearTimeout(t),Sn.delete(e)),un.set(e,(un.get(e)??0)+1)}function qi(e,t){if(Vt.get(e)!==t)return;let n=(un.get(e)??1)-1;if(n>0){un.set(e,n);return}un.delete(e);let r=setTimeout(()=>{Vt.get(e)===t&&(Sn.delete(e),!((un.get(e)??0)>0)&&(t.dispose(),Vt.delete(e)))},Hs);Sn.set(e,r)}var un=new Map;function Jn(){for(let e of Vt.values())e.resync()}function Ui(){for(let e of Vt.values())e.dispose();Vt.clear();for(let e of Sn.values())clearTimeout(e);Sn.clear(),un.clear()}function Bs(){let e=async()=>({ok:!1,error:{code:"git-unavailable"}});return{snapshot:e,run:e,query:e,suggest:e,version:e,openFile:e}}function lr(e,t,n){let r=e?t?tn(e):Vt.get(e):void 0,i=$i(r,t,n);return(0,Kn.useEffect)(()=>{if(!(!t||r===void 0||e===void 0))return Vi(e),r.ensure(),()=>qi(e,r)},[r,e,t]),i}function dr(e){let[,t]=(0,Kn.useState)(0),n=e?tn(e):void 0,r=n?n.getSnapshot():{state:"cold"};return(0,Kn.useEffect)(()=>{if(n===void 0||e===void 0)return;Vi(e);let i=n.subscribe(()=>t(a=>a+1));return n.getSnapshot()!==r&&t(a=>a+1),n.ensure(),()=>{i(),qi(e,n)}},[n,e]),r}var K=require("react"),ws=require("@deepseek-ai/dsh-client-ui-primitives");var Wi="[data-conversation-tabs]",Vn='[data-conversation-tabs] button[role="tab"]',ri=new Map,jn=new Map;function Qi(e,t){let n=jn.get(e);if(n!==void 0&&n.size>0){for(let r of n)r(t);return}ri.set(e,t)}function Yi(e){let t=ri.get(e);return t===void 0?null:(ri.delete(e),t)}function Zi(e,t){let n=jn.get(e);return n===void 0&&(n=new Set,jn.set(e,n)),n.add(t),()=>{let r=jn.get(e);r!==void 0&&(r.delete(t),r.size===0&&jn.delete(e))}}var Is=6e4,ii=new Map;function ea(e,t){ii.set(e,{tab:t,leftAt:Date.now()})}function ta(e){let t=ii.get(e);return t===void 0?null:Date.now()-t.leftAt>Is?(ii.delete(e),null):t.tab}function na(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Vn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}function ra(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Vn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")==="true";return!1}function ia(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Vn);for(let n of t)if((n.textContent??"").trim()!==e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}var u=require("react"),Hr=require("react-dom"),yi=require("@deepseek-ai/dsh-client-ui-primitives");var cr=require("react"),aa=require("@deepseek-ai/dsh-client-ui-primitives");function qn(e,t,n,r={}){let i=r.extraClass===void 0?"gp-select-trigger":`gp-select-trigger ${r.extraClass}`;return(0,cr.createElement)("button",{type:"button",className:i,"aria-haspopup":"menu","aria-expanded":e,title:t,disabled:r.disabled,onClick:n},[(0,cr.createElement)("span",{key:"l",className:"gp-select-trigger__label"},t),(0,cr.createElement)(aa.IconChevronDownOutlineRegular,{key:"c",className:"gp-select-trigger__chevron",size:14})])}var P=require("react"),Os="M2 7V3h4l8 8-4 4z",oa="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 Se(e,t=15,n=!1){return(0,P.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 pr({size:e}){return Se([(0,P.createElement)("circle",{key:"c",cx:8,cy:8,r:2.4}),(0,P.createElement)("line",{key:"l1",x1:8,y1:1.5,x2:8,y2:5.6}),(0,P.createElement)("line",{key:"l2",x1:8,y1:10.4,x2:8,y2:14.5})],e)}function sa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M4 2v8"}),(0,P.createElement)("path",{key:"b",d:"M2 4h4"}),(0,P.createElement)("circle",{key:"c",cx:4,cy:12,r:1.6}),(0,P.createElement)("circle",{key:"d",cx:12,cy:4,r:1.6}),(0,P.createElement)("path",{key:"e",d:"M12 6v4"}),(0,P.createElement)("path",{key:"f",d:"M10 12h4"})],e)}function ai({size:e}){return Se([(0,P.createElement)("circle",{key:"a",cx:4,cy:3,r:1.6}),(0,P.createElement)("circle",{key:"b",cx:4,cy:13,r:1.6}),(0,P.createElement)("circle",{key:"c",cx:12,cy:5,r:1.6}),(0,P.createElement)("path",{key:"d",d:"M4 4.6v6.8"}),(0,P.createElement)("path",{key:"e",d:"M12 6.6c0 3-4 2.4-8 4"})],e)}function la(e,t=!1){return Se([(0,P.createElement)("path",{key:"a",d:Os}),(0,P.createElement)("circle",{key:"b",cx:4.5,cy:5.5,r:.8,fill:"currentColor"})],e,t)}function Cn({size:e}){return la(e)}function qt({size:e,open:t}){return Se([(0,P.createElement)("path",{key:"a",d:t?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})],e)}function yt({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M4 4l8 8M12 4l-8 8"})],e)}function oi({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 6V2h4"}),(0,P.createElement)("path",{key:"b",d:"M10 2h4v4"}),(0,P.createElement)("path",{key:"c",d:"M14 10v4h-4"}),(0,P.createElement)("path",{key:"d",d:"M6 14H2v-4"})],e)}function da({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M6 2v4H2"}),(0,P.createElement)("path",{key:"b",d:"M14 6h-4V2"}),(0,P.createElement)("path",{key:"c",d:"M10 14v-4h4"}),(0,P.createElement)("path",{key:"d",d:"M2 10h4v4"})],e)}function ca({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 3.5h12"}),(0,P.createElement)("path",{key:"b",d:"M2 7.5h12"}),(0,P.createElement)("path",{key:"c",d:"M2 11.5h7"}),(0,P.createElement)("path",{key:"d",d:"M2 11.5c0 2 1.5 3 3.5 3H10"})],e)}function Tn({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M10 3L5 8l5 5"}),(0,P.createElement)("path",{key:"b",d:"M5 8h8"})],e)}function pa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 3h12l-4.5 5.5V13L6.5 11V8.5z"})],e)}function ua({size:e}){return Se([(0,P.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,P.createElement)("path",{key:"plus",d:"M11 8v6M8 11h6"})],e,!0)}function ga({size:e}){return Se([(0,P.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,P.createElement)("path",{key:"minus",d:"M8 11h6"})],e,!0)}function nn({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M13 8a5 5 0 1 1-1.5-3.5"}),(0,P.createElement)("path",{key:"b",d:"M13 2v3h-3"})],e)}function si({size:e}){return Se([(0,P.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,P.createElement)("path",{key:"b",d:"M13 11.6v2.8M11.6 13h2.8"})],e)}function fa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M4 2h5l3 3v9H4z"}),(0,P.createElement)("path",{key:"b",d:"M9 2v3h3"})],e)}function ma({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 12.5V3.5h4l1.5 2H14v7z"})],e)}function ur({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M2 5.5h12V13H2z"}),(0,P.createElement)("path",{key:"b",d:"M1.5 3h13v2.5h-13z"}),(0,P.createElement)("path",{key:"c",d:"M6.5 8.5h3"})],e)}function Un({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,P.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,P.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"})],e)}function ha({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,P.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,P.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"}),(0,P.createElement)("path",{key:"d",d:"M1.5 6.5h1.2"}),(0,P.createElement)("path",{key:"e",d:"M13.3 6.5h1.2"})],e)}function ya({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M3 7a5 5 0 1 1 1.3 3.4"}),(0,P.createElement)("path",{key:"b",d:"M3 3.5V7h3.5"})],e)}function gr({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M13 3v10"}),(0,P.createElement)("path",{key:"b",d:"M10.5 8L3 3.5v9z",fill:"currentColor"})],e)}function ba({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M5 2.5h4l2.5 2.5v7.5h-6.5z"}),(0,P.createElement)("path",{key:"b",d:"M9 2.5V5h2.5"}),(0,P.createElement)("path",{key:"c",d:"M11 12.5v1.5h-6.5V6"})],e)}function va({size:e=15}){return(0,P.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor"},(0,P.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 wa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M8 2.5v7"}),(0,P.createElement)("path",{key:"b",d:"M4.5 7L8 10.5 11.5 7"}),(0,P.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function gn({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M8 10.5v-7"}),(0,P.createElement)("path",{key:"b",d:"M4.5 6L8 2.5 11.5 6"}),(0,P.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function xa({size:e}){return Se([(0,P.createElement)("path",{key:"a",d:"M12.5 7a4.5 4.5 0 0 0-8-2.3"}),(0,P.createElement)("path",{key:"b",d:"M3.5 9a4.5 4.5 0 0 0 8 2.3"}),(0,P.createElement)("path",{key:"c",d:"M4.3 2.2v2.5h2.5"}),(0,P.createElement)("path",{key:"d",d:"M11.7 13.8v-2.5H9.2"})],e)}function ka({size:e}){return Se([(0,P.createElement)("circle",{key:"a",cx:8,cy:8,r:6}),(0,P.createElement)("path",{key:"b",d:"M8 7.2v3.6"}),(0,P.createElement)("circle",{key:"c",cx:8,cy:5.2,r:.5,fill:"currentColor",stroke:"none"})],e)}function _a({size:e=15,filled:t}){return(0,P.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,P.createElement)("path",{d:oa}))}function Sa({size:e}){return la(e,!0)}function Ca({size:e=15}){return(0,P.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,P.createElement)("path",{d:oa}))}function Ta({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",i=t==="ahead"?"M6.5 4.5h5v5":"M9.5 11.5h-5v-5";return(0,P.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,P.createElement)("path",{key:"a",d:r}),(0,P.createElement)("path",{key:"b",d:i})])}function Ea(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 fr(e,t,n){let r=[],i=[],a=[],o=[],s=[],l=0,d=()=>{if(s.length===0)return l++;let x=Math.min(...s);return s.splice(s.indexOf(x),1),x},p=x=>{x!==null&&!s.includes(x)&&s.push(x)},f=(x,h)=>{let b=i.findIndex(v=>v===null);return b===-1&&(b=i.length,i.push(null),a.push(null),o.push(!1)),i[b]=x,a[b]=d(),o[b]=h,b},g=x=>i.findIndex(h=>h===x),k=(x,h)=>{let b=i.findIndex((v,C)=>v===x&&o[C]===h);return b===-1?f(x,h):b},c=(x,h,b,v,C)=>C?{fromLane:x,toLane:h,color:b,kind:v,indirect:!0}:{fromLane:x,toLane:h,color:b,kind:v};for(let x=0;x<e.length;x++){let h=e[x],b=n===void 0?void 0:n[x],v=b===void 0?h.parents.length:b.length,C=N=>b===void 0?h.parents[N]:b[N].hash,E=N=>b!==void 0&&b[N].indirect,B=g(h.hash),H=B!==-1,F=B===-1?f(h.hash,!1):B,ee=a[F],q=[...i],W=[...a],j=[...o],Q=h.parents.length>=2;for(let N=0;N<i.length;N++)N!==F&&i[N]===h.hash&&(p(a[N]),i[N]=null,a[N]=null);let te=-1,re=[];if(v===0)p(a[F]),i[F]=null,a[F]=null;else{let N=C(0),se=E(0),ce=t==="compact"?i.findIndex((ie,le)=>ie===N&&le!==F&&o[le]===se):-1;if(ce===-1)i[F]=N,o[F]=se,te=F;else{let ie=Math.min(F,ce),le=Math.max(F,ce);i[ie]=N,o[ie]=se,p(a[le]),i[le]=null,a[le]=null,te=ie}for(let ie=1;ie<v;ie++)re.push(k(C(ie),E(ie)))}let de=[];for(let N=0;N<q.length;N++){let se=q[N];if(se!==null)if(se===h.hash){if(N===F&&!H)continue;de.push(c(N,F,W[N],"into",j[N]))}else{let ce=i[N]===se?N:i.findIndex((ie,le)=>ie===se&&o[le]===j[N]);ce!==-1&&de.push(c(N,ce,W[N],"pass",j[N]))}}te!==-1&&de.push(c(F,te,a[te],"out",o[te]));for(let N of re)de.push(c(F,N,a[N],"out",o[N]));for(r.push({commit:h,lane:F,color:ee,edges:de,merge:Q});i.length>0&&i[i.length-1]===null;)i=i.slice(0,-1),a=a.slice(0,-1),o=o.slice(0,-1)}return r}var Na=4096,Xs=1e6,$s=1e5;function Ma(e,t,n){let r=new Map;for(let c of t)r.set(c.hash,c.parents);let i=new Map;e.forEach((c,x)=>i.set(c.hash,x));let a=Math.min(Na,i.size),o=new Map,s=0,l=c=>{let x=o.get(c);if(x!==void 0)return x;let h=[{hash:c,expanded:!1}],b=new Set,v=[];for(;h.length>0;){let C=h[h.length-1];if(!C.expanded){C.expanded=!0,b.add(C.hash);let E=r.get(C.hash);for(let B=E.length-1;B>=0;B--){let H=E[B];i.has(H)||!r.has(H)||b.has(H)||o.has(H)||h.push({hash:H,expanded:!1})}continue}v.push(C.hash),h.pop()}for(let C of v){if(o.has(C))continue;let E=r.get(C),B,H=E.length>0;for(let j of E){if(i.has(j)){H=!1;break}let Q=o.get(j);if(Q===void 0){H=!1;break}if(B===void 0)B=Q;else if(B!==Q){H=!1;break}}if(H&&B!==void 0){o.set(C,B);continue}let F=[],ee=new Set,q=!1,W=j=>{if(!ee.has(j)){if(F.length>=a||s>=Xs){q=!0;return}ee.add(j),F.push(j),s++}};for(let j of E){if(i.has(j)){W(j);continue}let Q=o.get(j);if(Q===void 0){q=!0;continue}for(let te of Q.ancestors)W(te);Q.unknown&&(q=!0)}o.set(C,{ancestors:F,unknown:q})}return o.get(c)},d=Na,p=$s,f=[],g=[];for(let c=0;c<e.length;c++){let h=e[c].parents,b=[],v=new Map,C=!1,E=H=>{let F=i.get(H);return F!==void 0&&F>c},B=(H,F)=>{let ee=v.get(H);if(ee===void 0){let q=i.get(H)-c+1;if(d===0||p<q){C=!0;return}d--,p-=q,v.set(H,b.length),b.push({hash:H,indirect:F})}else!F&&b[ee].indirect&&(b[ee]={hash:H,indirect:!1})};for(let H of h){if(i.has(H)){E(H)?B(H,!1):C=!0;continue}if(!r.has(H)){C=!0;continue}let F=l(H);(F.ancestors.length===0||F.unknown)&&(C=!0);for(let ee of F.ancestors)E(ee)?B(ee,!0):C=!0}f.push(b),g.push(C)}let k=fr(e,n,f);return g.some(c=>c)?k.map((c,x)=>g[x]===!0?{...c,boundary:!0}:c):k}var Ct=require("react"),fn=14,mr=["#4e9bff","#3fb950","#e0982e","#d05ce3","#e5534b","#2dc6c6","#d29922","#8b949e"];function Ga({row:e,laneCount:t,rowH:n,current:r}){let i=(0,Ct.useId)(),a=Math.max(fn,t*fn),o=p=>p*fn+fn/2,s=n/2,l=mr[e.color%mr.length],d=e.edges.map(p=>{let f=p.kind==="out"?s:0,g=p.kind==="into"?s:n,k=(f+g)/2;return(0,Ct.createElement)("path",{key:`${p.kind}-${p.fromLane}-${p.toLane}-${p.color}`,className:"gp-graph-edge",d:`M ${o(p.fromLane)} ${f} C ${o(p.fromLane)} ${k}, ${o(p.toLane)} ${k}, ${o(p.toLane)} ${g}`,stroke:mr[p.color%mr.length],strokeWidth:1.6,fill:"none",...p.indirect?{strokeDasharray:"7 5","data-indirect":"true"}:{}})});if(e.boundary){let p=o(e.lane)+(e.edges.some(f=>f.kind==="out")?5:0);d.push((0,Ct.createElement)("path",{key:"boundary",className:"gp-graph-boundary",d:`M ${o(e.lane)} ${s} L ${p} ${s+7} V ${Math.min(n-3,s+13)}`,stroke:l,strokeWidth:1.6,strokeDasharray:"3 3",fill:"none"}))}return(0,Ct.createElement)("svg",{className:"gp-graph-svg",width:a,height:n,"aria-hidden":!0},[r?(0,Ct.createElement)("defs",{key:"defs"},(0,Ct.createElement)("mask",{id:i,maskUnits:"userSpaceOnUse",x:0,y:0,width:a,height:n},[(0,Ct.createElement)("rect",{key:"area",x:0,y:0,width:a,height:n,fill:"white"}),(0,Ct.createElement)("circle",{key:"hole",cx:o(e.lane),cy:s,r:6.2,fill:"black"})])):null,(0,Ct.createElement)("g",{key:"edges",...r?{mask:`url(#${i})`}:{}},d),(0,Ct.createElement)("circle",{key:"node",className:`gp-graph-node${r?" gp-graph-node--current":""}`,cx:o(e.lane),cy:s,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,Ct.createElement)("circle",{key:"head-dot",className:"gp-graph-node__dot",cx:o(e.lane),cy:s,r:2.2,fill:l}):null])}function Ks(e){return/^[0-9a-fA-F]{7,40}$/.test(e.trim())}function li(e){let t=e.search?.trim()??"";return!Ks(t)&&(t!==""||(e.author??"")!==""||(e.since??"")!=="")}var hr=10*1024*1024,Tt={maxBytes:{min:16*1024,max:512*1024,default:200*1024},maxOutputTokens:{min:256,max:16384,default:4096},timeoutMs:{min:5e3,max:12e4,default:15e3}},yr=["auto","zh","en"],di="auto",Js={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 Wn(e){let t=e.lastIndexOf(".");return t<0?null:Js[e.slice(t+1).toLowerCase()]??null}function br(e){let t=[],n=new Set;for(let a of e){let o=a.name.split("/").filter(l=>l!=="");if(o.length===0)continue;t.push({segments:o,branch:a});let s="";for(let l=0;l<o.length-1;l++)s=s===""?o[l]:`${s}/${o[l]}`,n.add(s)}let r=new Map,i=[];for(let{segments:a,branch:o}of t){let s=a.join("/"),l=n.has(s),d=i,p="";for(let f=0;f<a.length;f++){let g=a[f];p=p===""?g:`${p}/${g}`;let k=f===a.length-1;if(k&&!l){d.push({kind:"leaf",label:g,path:s,branch:o});break}let c=r.get(p);c===void 0&&(c={kind:"dir",label:g,path:p,self:null,children:[]},r.set(p,c),d.push(c)),k?c.self=o:d=c.children}}return Pa(i)}function Pa(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:Pa(n.children)}})}function Ra(e,t){let n=r=>e.some(i=>i.name===r);return t!==null&&n(t)?t:n("main")?"main":n("master")?"master":null}function La(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 Aa(e,t,n){if(t===null)return null;let r=n===null?["main","master"]:[n,"main","master"];for(let i of r){let a=`${t}/${i}`;if(e.some(o=>o.name===a))return a}return null}function Da(e,t,n){let r=[],i=o=>{if(o===null||r.some(l=>l.name===o))return;let s=e.find(l=>l.name===o);s!==void 0&&r.push(s)};i(t),i(n);let a=new Set(r.map(o=>o.name));return{pinned:r,nodes:br(e.filter(o=>!a.has(o.name)))}}function Fa(e){let t={name:"",path:"",dir:!0,children:[]};for(let n of e){let r=n.path.split("/").filter(o=>o!==""),i=t,a="";for(let o=0;o<r.length;o++){let s=r[o];a=a===""?s:`${a}/${s}`;let l=o===r.length-1,d=i.children.find(p=>p.name===s&&p.dir===!l);d===void 0&&(d={name:s,path:a,dir:!l,children:[],...l?{meta:n.meta}:{}},i.children.push(d)),i=d}}return za(t),Ha(t.children)}function za(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)za(t)}function Ha(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:Ha(n.children)}})}function rn(e,t,n){if(e===null)return"";let r=typeof e=="number"?e:Date.parse(e);if(!Number.isFinite(r))return"";let i=Math.max(0,t-r),a=Math.floor(i/6e4);if(a<1)return n("time.justNow");if(a<60)return n("time.minutesAgo",{n:a});let o=Math.floor(a/60);if(o<24)return n("time.hoursAgo",{n:o});let s=Math.floor(o/24);return n("time.daysAgo",{n:s})}function Qn(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 Yn(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 vr={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 Ba(e,t){return e.some(n=>n.status==="untracked"&&(n.isDirectory?t.startsWith(`${n.path}/`):n.path===t))}var L=require("react");function Ia(e){return/^Binary files .* differ$/m.test(e)||/^GIT binary patch$/m.test(e)}function Oa(e){return Wn(e)!==null}function Xa(e){return/\.svg$/i.test(e)}function js(e){let t=e.split(`
|
|
908
|
+
`),n=[],r=!1;for(let i of t){if(i.startsWith("@@")){r=!0;continue}if(r){if(i.startsWith("diff ")||i.startsWith("index ")){r=!1;continue}i!==""&&n.push(i)}}return n}function $a(e){let t=0,n=0;for(let r of js(e))r.startsWith("+")?t++:r.startsWith("-")&&n++;return{add:t,del:n}}var Vs=/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function Ka(e,t){let n=[],r=e.split(`
|
|
909
|
+
`),i=Number.isFinite(t)&&t>0?t:0,a=0,o=0,s=!0,l=!1,d=0;for(;d<r.length&&!r[d].startsWith("@@");d++);for(;d<r.length;d++){let f=r[d];if(f.startsWith("@@")){let c=Vs.exec(f);if(c){let x=Number(c[1]),h=Number(c[3]),b=x-h;if(s)h>1&&n.push(mn({rightStart:1,count:h-1,delta:b,atStart:!0}));else{let v=h-o;v>0&&n.push(mn({rightStart:o,count:v,delta:b,atStart:!1}))}a=x,o=h,s=!1}n.push({kind:"hunk",leftNo:null,rightNo:null,leftText:null,rightText:null,text:f});continue}if(f.startsWith("\\"))continue;let g=f[0],k=f.slice(1);g==="+"?(n.push({kind:"add",leftNo:null,rightNo:o,leftText:null,rightText:k}),o++,l=!0):g==="-"?(n.push({kind:"del",leftNo:a,rightNo:null,leftText:k,rightText:null}),a++,l=!0):g===" "&&(n.push({kind:"context",leftNo:a,rightNo:o,leftText:k,rightText:k}),a++,o++,l=!0)}let p=i-o+1;return l&&!s&&o>0&&p>0&&n.push(mn({rightStart:o,count:p,delta:a-o,atStart:!1})),qs(n)}function Ja(e,t){let n=e[e.length-1],r=n!==void 0&&n.kind==="gap",i=r?n.gap:void 0,a=r?e[e.length-2]:n,o=a===void 0?null:a.rightNo,s=o!==null&&o>0?o:0,l=Number.isFinite(t)?t-s:0,d=l>0?l:0;if(i===void 0){if(d===0||s===0)return e;let p=a===void 0?null:a.leftNo;return p===null?null:[...e,mn({rightStart:s+1,count:d,delta:p-s,atStart:!1})]}return i.rightStart===s+1&&i.count===d?e:d===0?e.slice(0,-1):[...e.slice(0,-1),mn({rightStart:s+1,count:d,delta:i.delta,atStart:!1})]}function mn(e){return{kind:"gap",leftNo:null,rightNo:null,leftText:null,rightText:null,gap:e}}function qs(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind==="del"){let i=[],a=n;for(;a<e.length&&e[a].kind==="del";)i.push(e[a]),a++;let o=[];for(;a<e.length&&e[a].kind==="add";)o.push(e[a]),a++;let s=Math.max(i.length,o.length);for(let l=0;l<s;l++){let d=i[l],p=o[l];if(d&&p){let f=Us(d.leftText??"",p.rightText??"");t.push({kind:"mod",leftNo:d.leftNo,rightNo:p.rightNo,leftText:d.leftText,rightText:p.rightText,...f!==null?{leftWord:f.left,rightWord:f.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=a}else t.push(r),n++}return t}function Us(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=0;for(;i<n-r&&e[e.length-1-i]===t[t.length-1-i];)i++;return r===0&&i===0?null:{left:[r,e.length-i],right:[r,t.length-i]}}function Ws(e,t,n){return n.map((r,i)=>{let a=t+i;return{kind:"context",leftNo:a+e,rightNo:a,leftText:r,rightText:r}})}var hn=20;function ja(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 Va(e,t,n,r,i,a){let o=e.findIndex(f=>f.kind==="gap"&&f.gap?.rightStart===t);if(o<0)return e.slice();let s=e[o].gap,l=Ws(s.delta,r,i),d=[],p=s.count;if(n==="all"||i.length>=p)d.push(...l);else if(n==="down")d.push(...l),a||d.push(mn({rightStart:s.rightStart+i.length,count:p-i.length,delta:s.delta,atStart:!1}));else{if(i.length===0)return[...e.slice(0,o),...e.slice(o+1)];let f=p-i.length;d.push(mn({rightStart:s.rightStart,count:f,delta:s.delta,atStart:s.atStart})),d.push(...l)}return[...e.slice(0,o),...d,...e.slice(o+1)]}var Rr=require("@deepseek-ai/dsh-client-ui-primitives");function qa(e,t){let n=[[],[],[]],r=0;for(let i of e){let a=r+i.text.length,o=[r,Math.max(r,Math.min(a,t[0])),Math.max(r,Math.min(a,t[1])),a];for(let s=0;s<3;s++){let l=i.text.slice(o[s]-r,o[s+1]-r);l!==""&&n[s].push({text:l,style:i.style})}r=a}return n}function Ua(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 Mn(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 Wa(e,t){let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return n}function Gn(e,t,n,r){let i=e.length-1;if(i<=0)return{first:0,last:0};let a=Wa(e,t-r),o=Math.min(i,Wa(e,t+n+r)+1);return{first:a,last:o}}function wr(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 yn=require("react");function Pn(){let[e,t]=(0,yn.useState)({top:0,height:0}),n=(0,yn.useRef)(null),r=(0,yn.useRef)(null);return{setEl:(0,yn.useCallback)(a=>{if(r.current!==null&&(r.current(),r.current=null),n.current=a,a===null)return;let o=()=>t(l=>{let d=a.scrollTop,p=a.clientHeight;return l.top===d&&l.height===p?l:{top:d,height:p}});o(),a.addEventListener("scroll",o,{passive:!0});let s=typeof ResizeObserver<"u"?new ResizeObserver(o):null;s?.observe(a),r.current=()=>{a.removeEventListener("scroll",o),s?.disconnect()}},[]),viewport:e,elRef:n}}var bt=require("react"),xr=5e3,kr=120;function _r(e,t){let[n,r]=(0,bt.useState)(e);return(0,bt.useEffect)(()=>{let i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}function Sr(e,t){if(t==="")return[];let n=[],r=0;for(;;){let i=e.indexOf(t,r);if(i<0)break;n.push([i,i+t.length]),r=i+t.length}return n}function ci(e,t,n,r,i){if(n>=r)return[];if(e===void 0)return[t.slice(n,r)];let a=[],o=0,s=0;for(let l of e){let d=o+l.text.length,p=Math.max(n,o),f=Math.min(r,d);if(f>p&&a.push((0,bt.createElement)("span",{key:`${i}-${s++}`,style:l.style},l.text.slice(p-o,f-o))),o=d,o>=r)break}return a}function Cr(e,t,n,r,i,a){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(...ci(n,e,s,d,`${r}b${s}`));let f=i!==null&&i[0]===d&&i[1]===p;o.push((0,bt.createElement)("mark",{key:`mk${r}-${d}`,className:`gp-find-hit${f?" gp-find-hit--active":""}`,...f?{ref:a}:{}},ci(n,e,d,p,`mk${r}-${d}`))),s=p}return s<e.length&&o.push(...ci(n,e,s,e.length,`${r}e`)),o}function Tr(e){return(0,bt.createElement)("div",{key:"find",className:"gp-find"},[(0,bt.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,bt.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,bt.createElement)("span",{key:"cnt",className:"gp-find__count"},e.query===""?"":e.matches===0?e.t("files.findNoMatch"):`${e.active+1}/${e.matches}`),(0,bt.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,bt.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,bt.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 an=require("react");var U=require("react");var Rn=require("react"),Qs='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function Er(e,t,n,r){let i=(0,Rn.useRef)(t);(0,Rn.useLayoutEffect)(()=>{i.current=t}),(0,Rn.useEffect)(()=>{let a=document.activeElement instanceof HTMLElement?document.activeElement:null;n?.current?.focus();let o=()=>{let l=e.current;return l===null?[]:[...l.querySelectorAll(Qs)].filter(d=>!d.hasAttribute("disabled")&&d.getClientRects().length>0)},s=l=>{if(l.key==="Escape"){l.stopPropagation(),i.current();return}if(l.key!=="Tab")return;let d=o();if(d.length===0)return;let p=document.activeElement instanceof HTMLElement?document.activeElement:null,f=p===null?-1:d.indexOf(p);l.preventDefault();let g=l.shiftKey?-1:1,k=f===-1?g===-1?d.length-1:0:(f+g+d.length)%d.length;d[k]?.focus()};return window.addEventListener("keydown",s,!0),()=>{window.removeEventListener("keydown",s,!0),(r?.current??a)?.focus()}},[e,n,r])}var ro=require("react-dom");function Ya(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 Za(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 Ys=.1,Zs=8,pi=1.25;function eo(e){return Number.isFinite(e)?Math.min(Zs,Math.max(Ys,e)):1}function ui(e,t,n){return(e+t)*n-t}var Qa=3;function to(e,t){return e*e+t*t>=Qa*Qa}function no(e,t,n,r){return{left:e-n,top:t-r}}var el=300;function Zn({src:e,alt:t,t:n,viewportClass:r,fullscreen:i=!0,onEmptyAreaMouseDown:a}){let o=(0,U.useRef)(null),s=(0,U.useRef)(null),l=(0,U.useRef)(null),[d,p]=(0,U.useState)(null),[f,g]=(0,U.useState)("fit"),[k,c]=(0,U.useState)(null),[x,h]=(0,U.useState)(!1),[b,v]=(0,U.useState)(!1),C=(0,U.useRef)("fit"),E=(0,U.useRef)(null),B=(0,U.useRef)(null),H=(0,U.useRef)(null),F=(0,U.useRef)(0),ee=(0,U.useCallback)(()=>{let D=l.current;return D===null||D.naturalWidth===0||D.clientWidth===0?null:D.clientWidth/D.naturalWidth},[]),q=(0,U.useCallback)((D,M,V)=>{let O=s.current,z=l.current;if(O===null||z===null||z.naturalWidth===0||z.clientWidth===0)return;let Y=z.clientWidth/z.naturalWidth,G=eo(D);if(G===Y)return;let S=O.getBoundingClientRect();E.current={x:M-S.left,y:V-S.top,ratio:G/Y},g(G)},[]),W=(0,U.useCallback)(D=>{let M=s.current,V=ee();if(M===null||V===null)return;let O=M.getBoundingClientRect();q(V*D,O.left+O.width/2,O.top+O.height/2)},[ee,q]),j=(0,U.useCallback)(()=>{let D=s.current;if(D===null)return;let M=D.getBoundingClientRect();q(1,M.left+M.width/2,M.top+M.height/2)},[q]),Q=(0,U.useCallback)(()=>{g("fit")},[]),te=(0,U.useCallback)(()=>{let D=l.current;D===null||D.naturalWidth===0||D.clientWidth===0||c(Math.round(D.clientWidth/D.naturalWidth*100))},[]);(0,U.useLayoutEffect)(()=>{C.current=f,f==="fit"&&te();let D=E.current;E.current=null;let M=s.current;D===null||M===null||(M.scrollLeft=ui(M.scrollLeft,D.x,D.ratio),M.scrollTop=ui(M.scrollTop,D.y,D.ratio))},[f,te]),(0,U.useEffect)(()=>{C.current="fit",E.current=null,B.current=null,g("fit"),p(null),c(null)},[e]),(0,U.useEffect)(()=>{let D=o.current;if(D===null)return;let M=Y=>{if(!Y.ctrlKey)return;Y.cancelable&&Y.preventDefault();let G=l.current;if(G===null||!G.complete||G.naturalWidth===0)return;let S=ee();S!==null&&q(S*Za(Ya(Y)),Y.clientX,Y.clientY)},V=Y=>{let G=Y,S=ee();S!==null&&(G.cancelable&&G.preventDefault(),B.current={base:S,x:G.clientX,y:G.clientY})},O=Y=>{let G=Y,S=B.current;S!==null&&(G.cancelable&&G.preventDefault(),q(S.base*G.scale,S.x,S.y))},z=()=>{B.current=null};return D.addEventListener("wheel",M,{passive:!1}),D.addEventListener("gesturestart",V,{passive:!1}),D.addEventListener("gesturechange",O,{passive:!1}),D.addEventListener("gestureend",z),()=>{D.removeEventListener("wheel",M),D.removeEventListener("gesturestart",V),D.removeEventListener("gesturechange",O),D.removeEventListener("gestureend",z)}},[ee,q]);let re=(0,U.useCallback)(D=>{if(D.button!==0||D.pointerType!=="mouse")return;let M=s.current;if(M===null)return;let{offsetX:V,offsetY:O}=D.nativeEvent;D.target===M&&(V>=M.clientWidth||O>=M.clientHeight)||(H.current={id:D.pointerId,x:D.clientX,y:D.clientY,left:M.scrollLeft,top:M.scrollTop,pan:M.scrollWidth>M.clientWidth||M.scrollHeight>M.clientHeight,moved:!1})},[]);(0,U.useEffect)(()=>{let D=O=>{let z=H.current;z===null||O!==z.id||(z.moved&&(F.current=performance.now()),H.current=null,v(!1))},M=O=>{let z=H.current;if(z===null||O.pointerId!==z.id)return;if(O.buttons===0){D(O.pointerId);return}let Y=O.clientX-z.x,G=O.clientY-z.y;if(!z.moved){if(!to(Y,G))return;z.moved=!0,v(!0)}let S=s.current;if(S===null||!z.pan)return;let R=no(z.left,z.top,Y,G);S.scrollLeft=R.left,S.scrollTop=R.top},V=O=>{D(O.pointerId)};return window.addEventListener("pointermove",M),window.addEventListener("pointerup",V),window.addEventListener("pointercancel",V),()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",V),window.removeEventListener("pointercancel",V)}},[]),(0,U.useEffect)(()=>{let D=s.current;if(D===null||typeof ResizeObserver>"u")return;let M=new ResizeObserver(()=>{C.current==="fit"&&te()});return M.observe(D),()=>M.disconnect()},[te]);let de=(0,U.useCallback)(()=>{let D=l.current;D!==null&&(p({w:D.naturalWidth,h:D.naturalHeight}),C.current==="fit"&&te())},[te]),N=(0,U.useCallback)(()=>{performance.now()-F.current<el||(f==="fit"?j():Q())},[f,j,Q]),se=(0,U.useCallback)(()=>{h(!1)},[]),ce=f==="fit"?k!==null?`${k}%`:"\u2014":`${Math.round(f*100)}%`,ie=f!=="fit"&&d!==null?{width:`${d.w*f}px`,maxWidth:"none",maxHeight:"none"}:void 0,le=d!==null?(0,U.createElement)("div",{key:"bar",className:"gp-zoom__bar",role:"group","aria-label":n("files.zoomBar")},[(0,U.createElement)("button",{key:"out",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomOut"),title:n("files.zoomOut"),onClick:()=>W(1/pi)},"\u2212"),(0,U.createElement)("button",{key:"pct",type:"button",className:"gp-zoom__btn gp-zoom__pct","aria-label":`${ce}\uFF0C${n("files.zoomActual")}`,title:n("files.zoomActual"),onClick:j},ce),(0,U.createElement)("button",{key:"in",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomIn"),title:n("files.zoomIn"),onClick:()=>W(pi)},"+"),(0,U.createElement)("button",{key:"fit",type:"button",className:"gp-zoom__btn gp-zoom__btn--text","aria-pressed":f==="fit",onClick:Q},n("files.zoomFit")),i?(0,U.createElement)("button",{key:"fs",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomFullscreen"),title:n("files.zoomFullscreen"),onClick:()=>h(!0)},"\u2921"):null]):null;return(0,U.createElement)("div",{className:"gp-zoom",ref:o,"data-zoomed":f==="fit"?void 0:"true","data-dragging":b?"true":void 0},[(0,U.createElement)("div",{key:"vp",className:`gp-zoom__scroll ${r}`,ref:s,onPointerDown:re,onMouseDown:a===void 0?void 0:D=>{D.target===D.currentTarget&&a()}},(0,U.createElement)("img",{key:"img",ref:l,className:"gp-zoom__img",src:e,alt:t,style:ie,draggable:!1,onLoad:de,onDoubleClick:N})),le,x?(0,U.createElement)(tl,{key:"lb",src:e,alt:t,t:n,onClose:se}):null])}function tl({src:e,alt:t,t:n,onClose:r}){let i=(0,U.useRef)(null),a=(0,U.useRef)(null);return Er(i,r,a),(0,ro.createPortal)((0,U.createElement)("div",{className:"gp-zl-backdrop",ref:i,role:"dialog","aria-modal":"true","aria-label":n("files.zoomFullscreen")},[(0,U.createElement)("div",{key:"stage",className:"gp-zl-stage"},[(0,U.createElement)("div",{key:"mask",className:"gp-zl-mask","aria-hidden":"true",onMouseDown:r}),(0,U.createElement)("div",{key:"frame",className:"gp-zl-frame"},(0,U.createElement)(Zn,{src:e,alt:t,t:n,viewportClass:"gp-zl-viewport",fullscreen:!1,onEmptyAreaMouseDown:r})),(0,U.createElement)("button",{key:"close",ref:a,type:"button",className:"gp-zl-close","aria-label":n("common.close"),onClick:r},(0,U.createElement)(yt,{size:16}))])]),document.body)}function Nr(e,t,n){let r=n(`diff.${e}`);return(0,an.createElement)("div",{className:`gp-imgcmp__pane gp-imgcmp__pane--${e}`},[(0,an.createElement)("div",{key:"head",className:"gp-imgcmp__head"},r),t===void 0?(0,an.createElement)("div",{key:"missing",className:"gp-imgcmp__missing"},n("diff.imageMissing")):(0,an.createElement)(Zn,{key:"img",src:t,alt:r,t:n,viewportClass:"gp-imgcmp__img"})])}function io({oldUrl:e,newUrl:t,mode:n,t:r}){return n==="before"?(0,an.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},Nr("before",e,r)):n==="after"?(0,an.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},Nr("after",t,r)):(0,an.createElement)("div",{className:"gp-imgcmp"},[Nr("before",e,r),Nr("after",t,r)])}var ao=require("react");var Ot=require("react");function on(e,t,n,r){let i=JSON.stringify(e),a=(0,Ot.useRef)({key:i,visible:t,load:n,onError:r});a.current={key:i,visible:t,load:n,onError:r};let o=(0,Ot.useRef)(!0),s=(0,Ot.useRef)(0),l=(0,Ot.useRef)(null);(0,Ot.useEffect)(()=>(o.current=!0,()=>{o.current=!1,s.current+=1,l.current=null}),[]);let d=(0,Ot.useCallback)(()=>{let p=a.current;if(!o.current||!p.visible||!ht.isVisible())return Promise.resolve();if(l.current?.key===p.key)return l.current.promise;let f=++s.current,g=()=>o.current&&f===s.current&&a.current.key===p.key,k=()=>g()&&a.current.visible&&ht.isVisible(),c=p.load(g,k).catch(()=>{g()&&p.onError()}).finally(()=>{l.current?.promise===c&&(l.current=null)});return l.current={key:p.key,promise:c},c},[]);return(0,Ot.useEffect)(()=>{t&&d()},[i,t,d]),d}function oo(e,t,n,r,i,a){let o=[t,n,r,i],[s,l]=(0,ao.useState)({queryKey:o,value:{kind:"idle"}}),d=p=>p.length===o.length&&p.every((f,g)=>f===o[g]);return on(o,a&&e!==void 0&&t!==void 0&&n!==void 0&&r!==void 0,async p=>{if(e===void 0||t===void 0||n===void 0||r===void 0)return;l(c=>d(c.queryKey)&&c.value.kind==="ready"?c:{queryKey:o,value:{kind:"loading"}});let f=r==="commit"&&i!==void 0?{kind:"image-diff",path:n,base:"commit",commit:i}:r==="staged"?{kind:"image-diff",path:n,base:"staged"}:{kind:"image-diff",path:n,base:"worktree"},g=await e.query({sessionId:t,query:f});if(!p())return;let k=_e(g,"image-diff");l({queryKey:o,value:k!==null?{kind:"ready",res:k}:{kind:"failed"}})},()=>l({queryKey:o,value:{kind:"failed"}})),d(s.queryKey)?s.value:{kind:"idle"}}var Ut=require("react");function Wt({text:e,closeLabel:t,onClose:n,status:r=!1}){return(0,Ut.createElement)("div",{className:"gp-notice",...r?{role:"status"}:{}},[(0,Ut.createElement)("span",{key:"txt",className:"gp-notice__text"},e),(0,Ut.createElement)("button",{key:"close",type:"button",className:"gp-notice__close",title:t,"aria-label":t,onClick:n},(0,Ut.createElement)(yt,{key:"i",size:12}))])}function Mr(){let[e,t]=(0,Ut.useState)(()=>new Set);return(0,Ut.useMemo)(()=>({isDismissed:n=>e.has(n),dismiss:n=>t(r=>r.has(n)?r:new Set(r).add(n))}),[e])}var gi=20,nl=27,rl=29,so=12,il=600,Lr=(0,L.memo)(function({visible:t=!0,text:n,mode:r,path:i,remote:a,sessionId:o,base:s,commit:l,expanded:d,truncated:p,newLines:f,t:g}){let k=Mr(),c=(0,L.useMemo)(()=>Ka(n,f),[n,f]),x=Ia(n),h=(0,Rr.useCodeHighlighter)(i===void 0?void 0:(0,Rr.languageForPath)(i)),b=(0,L.useMemo)(()=>Ua(h),[h]),[v,C]=(0,L.useState)(c),E=(0,L.useRef)(n);(0,L.useEffect)(()=>{if(E.current!==n){E.current=n,C(c);return}C(Z=>Ja(Z,f)??c)},[n,f,c]);let B=ll(v,C,a,o,i,s,l),H=i!==void 0&&Xa(i),[F,ee]=(0,L.useState)("render");(0,L.useEffect)(()=>{ee("render")},[i]);let W=(x||H)&&i!==void 0&&Oa(i)&&a!==void 0&&o!==void 0&&s!==void 0&&(!H||F==="render"),j=oo(W?a:void 0,W?o:void 0,W?i:void 0,W?s:void 0,W?l:void 0,t),[Q,te]=(0,L.useState)(!1),[re,de]=(0,L.useState)(""),[N,se]=(0,L.useState)(!1),[ce,ie]=(0,L.useState)(0),le=(0,L.useRef)(null),D=(0,L.useRef)(null),M=(0,L.useRef)(null);(0,L.useEffect)(()=>{te(!1),de(""),ie(0)},[n,i]);let V=(0,L.useMemo)(()=>r==="unified"?ja(v):null,[r,v]),O=(0,L.useMemo)(()=>r==="before"?cl(v):r==="after"?pl(v):null,[r,v]),z=(0,L.useMemo)(()=>ol(v,V,O),[v,V,O]),Y=(0,L.useMemo)(()=>z.map(Z=>({key:Z.key,text:Z.text.toLowerCase()})),[z]),G=_r(re,kr),S=N?G:G.toLowerCase(),R=N?z:Y,oe=(0,L.useMemo)(()=>sl(R,S),[R,S]);(0,L.useEffect)(()=>{ie(0)},[S]);let ke=oe.length===0?0:Math.min(ce,oe.length-1),Qe=oe.length>0?oe[ke]:null,dt=Qe?.cellKey??null,vt=Qe?.start??-1,rt=(0,L.useMemo)(()=>{let Z=new Map;for(let X of oe){let he=Z.get(X.cellKey)??[];he.push([X.start,X.end]),Z.set(X.cellKey,he)}return Z},[oe]);(0,L.useEffect)(()=>{if(dt===null)return;let Z=requestAnimationFrame(()=>M.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(Z)},[ke,oe,dt,vt]);let De=(0,L.useCallback)(Z=>{ie(X=>oe.length===0?0:(X+Z+oe.length)%oe.length)},[oe.length]);(0,L.useEffect)(()=>{let Z=X=>{if(!((X.ctrlKey||X.metaKey)&&(X.key==="f"||X.key==="F")))return;let he=le.current;he===null||he.offsetParent===null||(X.preventDefault(),te(!0),requestAnimationFrame(()=>D.current?.select()))};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[]);let{setEl:wt,viewport:it,elRef:Gt}=Pn(),gt=(0,L.useRef)(null),[Ke,Ye]=(0,L.useState)(0),[ft,at]=(0,L.useState)(0),ge=(0,L.useRef)({mode:r,rows:v,heights:[]});(ge.current.mode!==r||ge.current.rows!==v)&&(ge.current={mode:r,rows:v,heights:[]});let ve=ge.current.heights,ze=V!==null?V.length:O!==null?O.length:v.length,He=(0,L.useCallback)(Z=>{let X=V!==null?V[Z]??null:O===null?v[Z]??null:null;return X===null?gi:X.kind==="hunk"?nl:X.kind==="gap"?rl:gi},[V,O,v]),Ie=(0,L.useMemo)(()=>{let Z=new Array(ze);for(let X=0;X<ze;X++){let he=ve[X];Z[X]=he!==void 0&&he>0?he:He(X)}return Z},[ze,ve,He,ft]),Ze=(0,L.useMemo)(()=>Mn(Ie),[Ie]),Je=it.height>0?it.height:il,{first:ot,last:Ne}=Gn(Ze,Math.max(0,it.top-Ke),Je,so*gi),Me=dt===null?-1:al(dt),{first:xt,last:kt}=wr({first:ot,last:Ne},Me,ze,so);if((0,L.useLayoutEffect)(()=>{let Z=gt.current,X=Gt.current;if(Z===null||X===null)return;let he=Z.getBoundingClientRect().top-X.getBoundingClientRect().top+X.scrollTop;Math.abs(he-Ke)>.5&&Ye(he);let je=new Map;for(let qe of Z.querySelectorAll("[data-r]")){let st=Number(qe.dataset.r),nt=qe.getBoundingClientRect().height;if(!Number.isFinite(nt)||nt<=0)continue;let lt=je.get(st);(lt===void 0||nt>lt)&&je.set(st,nt)}let Ve=!1;for(let[qe,st]of je){let nt=ve[qe];(nt===void 0||Math.abs(nt-st)>.5)&&(ve[qe]=st,Ve=!0)}Ve&&at(qe=>qe+1)}),W){let Z=(()=>{if(j.kind==="idle"||j.kind==="loading")return(0,L.createElement)("div",{className:"gp-empty"},g("common.loading"));if(j.kind==="ready"){let X=j.res;if(X.tooLarge===!0)return(0,L.createElement)("div",{className:"gp-empty"},g("diff.tooLarge"));if(X.mime!==null&&(X.old!==void 0||X.new!==void 0))return(0,L.createElement)(io,{oldUrl:X.old,newUrl:X.new,mode:r,t:g})}return(0,L.createElement)("div",{className:"gp-empty"},g("diff.binary"))})();return H?lo(F,ee,Z,g):Z}if(x&&!H)return(0,L.createElement)("div",{className:"gp-empty"},g("diff.binary"));let Fe=Q&&S!==""?{perCell:rt,activeKey:dt,activeRange:Qe!==null?[Qe.start,Qe.end]:null,activeRef:M}:null,Pt=(Z,X)=>X>.5?(0,L.createElement)("div",{key:Z,className:"gp-diff__spacer",style:{gridColumn:"1 / -1",height:`${X}px`}}):null,mt=Pt("lead",Ze[xt]),Ee=Pt("tail",Ze[ze]-Ze[kt]),_t=(()=>{if(n.trim()==="")return(0,L.createElement)("div",{className:"gp-empty"},g("diff.empty"));if(O!==null){let X=[mt];for(let he=xt;he<kt;he++){let je=O[he];X.push((0,L.createElement)("div",{key:`n${he}`,className:"gp-diff-no"},je.no??"")),X.push(Pr("gp-diff-cell",`c${he}`,je.text,b,Fe,he))}return X.push(Ee),(0,L.createElement)("div",{className:"gp-diff__single",ref:gt},X)}if(V!==null){let X=[mt];for(let he=xt;he<kt;he++)X.push(...gl(V[he],he,b,B,Fe,g));return X.push(Ee),(0,L.createElement)("div",{className:"gp-diff__unified",ref:gt},X)}let Z=[mt];for(let X=xt;X<kt;X++)Z.push(...ul(v[X],X,b,B,Fe,g));return Z.push(Ee),(0,L.createElement)("div",{className:"gp-diff__side",ref:gt},Z)})(),ae=Q?(0,L.createElement)(Tr,{inputRef:D,query:re,matches:oe.length,active:ke,caseSensitive:N,onChange:de,onToggleCase:()=>se(Z=>!Z),onStep:De,onClose:()=>te(!1),t:g}):null,et=d===!0&&v.some(Z=>Z.kind==="gap"),tt=g("diff.truncated"),Rt=g("diff.expandCapped",{n:2e3}),St=Z=>`${i??""}\0${Z}`,zt=(0,L.createElement)("div",{className:"gp-diff__wrap",ref:le},[ae,p===!0&&!k.isDismissed(St(tt))?(0,L.createElement)(Wt,{key:"truncated",text:tt,closeLabel:g("common.close"),onClose:()=>k.dismiss(St(tt))}):null,et&&!k.isDismissed(St(Rt))?(0,L.createElement)(Wt,{key:"capped",text:Rt,closeLabel:g("common.close"),onClose:()=>k.dismiss(St(Rt))}):null,(0,L.createElement)("div",{key:"scroll",className:"gp-diff__scroll",ref:wt},_t)]);return H?lo(F,ee,zt,g):zt});function al(e){let t=Number(e.slice(1));return Number.isFinite(t)?t:-1}function ol(e,t,n){let r=[];return n!==null?(n.forEach((i,a)=>r.push({key:`c${a}`,text:i.text})),r):t!==null?(t.forEach((i,a)=>{if(i.kind==="hunk"||i.kind==="gap")return;let o=i.rightText??i.leftText??"";o!==""&&r.push({key:`c${a}`,text:o})}),r):(e.forEach((i,a)=>{i.kind==="hunk"||i.kind==="gap"||(i.leftText!==null&&i.leftText!==""&&r.push({key:`l${a}`,text:i.leftText}),i.rightText!==null&&i.rightText!==""&&r.push({key:`r${a}`,text:i.rightText}))}),r)}function sl(e,t){if(t==="")return[];let n=[];for(let r of e)for(let[i,a]of Sr(r.text,t))if(n.push({cellKey:r.key,start:i,end:a}),n.length>=xr)return n;return n}function lo(e,t,n,r){let i=(a,o)=>(0,L.createElement)("button",{key:a,type:"button",className:`gp-seg__btn${e===a?" gp-seg__btn--active":""}`,"aria-pressed":e===a,onClick:()=>t(a)},o);return(0,L.createElement)("div",{className:"gp-svgdiff"},[(0,L.createElement)("div",{key:"bar",className:"gp-svgdiff__bar"},(0,L.createElement)("div",{className:"gp-seg"},[i("render",r("diff.svgRender")),i("source",r("diff.svgSource"))])),(0,L.createElement)("div",{key:"body",className:"gp-svgdiff__body"},n)])}function ll(e,t,n,r,i,a,o){let[s,l]=(0,L.useState)(null),d=(0,L.useRef)(0);(0,L.useEffect)(()=>{d.current+=1,l(null)},[e]);let p=(0,L.useCallback)((f,g)=>{if(n===void 0||r===void 0||i===void 0||a===void 0)return;let k=`${f.rightStart}:${g}`;l(k);let c=++d.current,{start:x,end:h}=dl(f,g),b=a==="commit"&&o!==void 0?{kind:"file-lines",path:i,base:"commit",commit:o,start:x,end:h}:a==="staged"?{kind:"file-lines",path:i,base:"staged",start:x,end:h}:{kind:"file-lines",path:i,base:"worktree",start:x,end:h};n.query({sessionId:r,query:b}).then(v=>{if(c!==d.current)return;let C=_e(v,"file-lines");l(null),C!==null&&t(E=>Va(E,f.rightStart,g,C.start,C.lines,C.eof))}).catch(()=>{c===d.current&&l(null)})},[n,r,i,a,o,t]);return{busy:s,run:p}}function dl(e,t){let n=e.count;return t==="all"||n<=hn?{start:e.rightStart,end:e.rightStart+n-1}:t==="down"?{start:e.rightStart,end:e.rightStart+hn-1}:{start:e.rightStart+n-hn,end:e.rightStart+n-1}}function Gr(e,t=""){return e.map((n,r)=>(0,L.createElement)("span",{key:`${t}${r}`,style:n.style},n.text))}function co(e,t,n,r){if(n===null)return null;let i=n.perCell.get(t);if(i===void 0||i.length===0)return null;let a=n.activeKey===t?n.activeRange:null;return Cr(e,i,r,t,a,n.activeRef)}function Pr(e,t,n,r,i=null,a=-1){let o={key:t,className:e,"data-r":a>=0?a:void 0};if(n==="")return(0,L.createElement)("div",o,"\xA0");let s=r(n)?.[0],l=co(n,t,i,s);return l!==null?(0,L.createElement)("div",o,l):(0,L.createElement)("div",o,s===void 0?n:Gr(s))}function fi(e,t,n,r,i,a,o=null,s=-1){let l={key:t,className:e,"data-r":s>=0?s:void 0},d=a(n)?.[0]??[{text:n,style:{}}],p=co(n,t,o,d);if(p!==null)return(0,L.createElement)("div",l,p);let[f,g,k]=qa(d,r);return(0,L.createElement)("div",l,[...Gr(f,"p"),(0,L.createElement)("span",{key:"w",className:i},g.length===0?"\xA0":Gr(g)),...Gr(k,"s")])}function cl(e){return e.filter(t=>t.leftText!==null).map(t=>({no:t.leftNo,text:t.leftText}))}function pl(e){return e.filter(t=>t.rightText!==null).map(t=>({no:t.rightNo,text:t.rightText}))}function ul(e,t,n,r,i,a){if(e.kind==="hunk")return[(0,L.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[po(e.gap,t,r,a)];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,L.createElement)("div",{key:`l${t}`,className:`gp-diff-cell ${o}`}):e.kind==="mod"&&e.leftWord!==void 0?fi(`gp-diff-cell ${o}`,`l${t}`,e.leftText,e.leftWord,"gp-diff-word gp-diff-word--del",n,i,t):Pr(`gp-diff-cell ${o}`,`l${t}`,e.leftText,n,i,t),d=e.rightText===null?(0,L.createElement)("div",{key:`r${t}`,className:`gp-diff-cell ${s}`}):e.kind==="mod"&&e.rightWord!==void 0?fi(`gp-diff-cell ${s}`,`r${t}`,e.rightText,e.rightWord,"gp-diff-word gp-diff-word--add",n,i,t):Pr(`gp-diff-cell ${s}`,`r${t}`,e.rightText,n,i,t);return[(0,L.createElement)("div",{key:`ln${t}`,className:"gp-diff-no"},e.leftNo??""),l,(0,L.createElement)("div",{key:`rn${t}`,className:"gp-diff-no"},e.rightNo??""),d]}function gl(e,t,n,r,i,a){if(e.kind==="hunk")return[(0,L.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[po(e.gap,t,r,a)];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??"",f=s?e.rightWord:o?e.leftWord:void 0,g=s?"gp-diff-word gp-diff-word--add":"gp-diff-word gp-diff-word--del",k=`gp-diff-cell gp-diff-uni__code ${l}`,c=f!==void 0?fi(k,`c${t}`,p,f,g,n,i,t):Pr(k,`c${t}`,p,n,i,t);return[(0,L.createElement)("div",{key:`ol${t}`,className:"gp-diff-no"},e.leftNo??""),(0,L.createElement)("div",{key:`nl${t}`,className:"gp-diff-no"},e.rightNo??""),(0,L.createElement)("div",{key:`sg${t}`,className:`gp-diff-uni__sign ${l}`},d),c]}function po(e,t,n,r){let i=n.busy===`${e.rightStart}:all`,a=n.busy===`${e.rightStart}:up`,o=n.busy===`${e.rightStart}:down`,s=(p,f,g)=>(0,L.createElement)("button",{key:p,type:"button",className:"gp-gap__btn",disabled:n.busy!==null,onClick:k=>{k.stopPropagation(),n.run(e,p)}},g?r("common.loading"):f),l=[],d=e.count;return d<=hn?l.push(s("all",r("diff.expandGap",{n:d}),i)):(e.atStart||l.push(s("up",r("diff.expandUp",{n:hn}),a)),l.push(s("all",r("diff.expandGap",{n:d}),i)),l.push(s("down",r("diff.expandDown",{n:hn}),o))),(0,L.createElement)("div",{key:`g${t}`,className:"gp-diff-row--gap",style:{gridColumn:"1 / -1"},"data-r":t},l)}function Ar(e){return $a(e)}var ne=require("react");var fl=100;function go(e,t,n,r=!0){let[i,a]=(0,ne.useState)(null),[o,s]=(0,ne.useState)(!1),[l,d]=(0,ne.useState)([]),p=on([t,...n],r,async(f,g)=>{s(!1);let[k,c]=await Promise.all([e.query({sessionId:t,query:{kind:"branches"}}),e.query({sessionId:t,query:{kind:"tags"}})]);if(!f())return;let x=_e(k,"branches"),h=_e(c,"tags");if(x===null){s(!0);return}if(a({current:x.current,defaultBranch:x.defaultBranch,local:x.local,remote:x.remote,tags:h?.tags??i?.tags??[]}),!g())return;let b=await e.query({sessionId:t,query:{kind:"authors"}});if(!f())return;let v=_e(b,"authors");d(v?.authors??[])},()=>s(!0));return{tree:i,treeError:o,authors:l,reload:p}}var uo=2e4;function ml(e,t,n){if(t===void 0)return e;let r=n.map(l=>({hash:l.hash,parents:l.parents})),i=new Set(r.map(l=>l.hash)),a=new Map;for(let l of[...e??[],...t])i.has(l.hash)||(a.delete(l.hash),a.set(l.hash,l.parents));let o=[...a],s=o.length>uo?o.slice(o.length-uo):o;return[...r,...s.map(([l,d])=>({hash:l,parents:d}))]}function fo(e,t,n,r,i,a=!0){let[o,s]=(0,ne.useState)({commits:[],topology:void 0,total:0,appliedFilter:n}),{commits:l,topology:d,total:p,appliedFilter:f}=o,[g,k]=(0,ne.useState)(!1),[c,x]=(0,ne.useState)(!1),h=(0,ne.useRef)(0),b=(0,ne.useRef)(!1),v=(0,ne.useRef)(o),C=(0,ne.useRef)(!1),E=(0,ne.useRef)(()=>!1),B=(0,ne.useRef)(a);B.current=a;let H=(0,ne.useRef)(null),F=(0,ne.useCallback)(async(j,Q,te)=>{if(b.current)return;b.current=!0;let re=h.current;k(!0),x(!1);let de=await e.query({sessionId:t,query:{kind:"history",limit:fl,skip:j,...Q.ref?{ref:Q.ref}:{},...Q.search?{search:Q.search}:{},...Q.author?{author:Q.author}:{},...Q.since?{since:Q.since}:{}}});if(!te()||re!==h.current)return;b.current=!1,k(!1);let N=_e(de,"history");if(N===null){x(!0);return}let se=v.current,ce=j===0?N.commits:[...se.commits,...N.commits],ie={commits:ce,topology:ml(j===0?void 0:se.topology,N.topology,ce),total:N.total,appliedFilter:Q};v.current=ie,C.current=!0,s(ie)},[e,t]),ee=(0,ne.useRef)(n);on([t,...r,n.ref,n.search,n.author,n.since],a,async j=>{h.current+=1,b.current=!1,E.current=j,C.current=!1,ee.current!==n&&(ee.current=n,i(),H.current&&(H.current.scrollTop=0)),await F(0,n,j)},()=>{b.current=!1,k(!1),x(!0)});let q=p<0?!0:l.length<p,W=(0,ne.useCallback)(()=>{if(!B.current||!ht.isVisible()||b.current||!C.current||!q||!E.current())return;let j=E.current;F(l.length,n,j).catch(()=>{j()&&(b.current=!1,k(!1),x(!0))})},[F,l.length,n,q]);return{commits:l,topology:d,appliedFilter:f,total:p,loading:g,listError:c,hasMore:q,listRef:H,loadMore:W}}function mo(e,t,n,r=!0){let[i,a]=(0,ne.useState)(null),[o,s]=(0,ne.useState)(null),[l,d]=(0,ne.useState)(!1),[p,f]=(0,ne.useState)(null),[g,k]=(0,ne.useState)(null),[c,x]=(0,ne.useState)(!1),[h,b]=(0,ne.useState)(n),[v,C]=(0,ne.useState)(!1),E=(0,ne.useRef)(0),B=(0,ne.useRef)(null),H=(0,ne.useRef)(new Map),F=(0,ne.useCallback)((M,V)=>{let O=H.current;for(O.set(M,V);O.size>50;){let z=O.keys().next().value;if(z===void 0)break;O.delete(z)}},[]),ee=(0,ne.useCallback)(()=>{a(null),s(null),B.current=null},[]),q=(0,ne.useCallback)(M=>{B.current===M.hash&&a(M)},[]),W=(0,ne.useCallback)(async M=>{B.current=M.hash,a(M),d(!1),E.current+=1,f(null),k(null),x(!1);let V=H.current.get(M.hash);if(V!==void 0){s(V);return}s(null);let O=await e.query({sessionId:t,query:{kind:"show",ref:M.hash}});if(B.current!==M.hash)return;let z=_e(O,"show");if(z!==null){let Y={commit:z.commit,body:z.body,stats:z.stats,insertions:z.insertions,deletions:z.deletions};F(M.hash,Y),s(Y)}else d(!0)},[e,t,F]),j=(0,ne.useCallback)(async(M,V,O,z=!1)=>{let Y=++E.current;f({path:M,hash:V,shortHash:O}),k(null),x(!1),C(z);let G=await e.query({sessionId:t,query:{kind:"diff",path:M,base:"commit",commit:V,...z?{context:2e3}:{}}});if(Y!==E.current)return;let S=_e(G,"diff");S!==null?k({text:S.text,newLines:S.newLines,truncated:S.truncated}):x(!0)},[e,t]),Q=(0,ne.useCallback)(()=>{E.current+=1,f(null),k(null),x(!1),C(!1)},[]);(0,ne.useEffect)(()=>{if(p===null)return;let M=V=>{V.key==="Escape"&&Q()};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[p,Q]);let[te,re]=(0,ne.useState)(null),[de,N]=(0,ne.useState)(null),se=(0,ne.useRef)(void 0),ce=(0,ne.useRef)(null),ie=(0,ne.useRef)(r);ie.current=r;let le=(0,ne.useCallback)((M,V,O)=>{se.current!==void 0&&clearTimeout(se.current),se.current=setTimeout(()=>{if(!ie.current||!ht.isVisible())return;ce.current=M.hash,re({commit:M,x:V,y:O});let z=H.current.get(M.hash);if(z!==void 0){N(z.body);return}N(null),e.query({sessionId:t,query:{kind:"show",ref:M.hash}}).then(Y=>{if(ce.current!==M.hash)return;let G=_e(Y,"show");G!==null?(F(M.hash,{commit:G.commit,body:G.body,stats:G.stats,insertions:G.insertions,deletions:G.deletions}),N(G.body)):N("")})},260)},[e,t,F]),D=(0,ne.useCallback)(()=>{se.current!==void 0&&clearTimeout(se.current),ce.current=null,re(null),N(null)},[]);return(0,ne.useEffect)(()=>{r||D()},[r,D]),(0,ne.useEffect)(()=>()=>{se.current!==void 0&&clearTimeout(se.current)},[]),{selected:i,detail:o,detailError:l,select:W,resyncSelected:q,clearSelection:ee,fileDiff:p,fileDiffData:g,fileDiffError:c,fileDiffMode:h,setFileDiffMode:b,fileDiffExpanded:v,openFileDiff:j,closeFileDiff:Q,hover:te,hoverBody:de,onHoverEnter:le,onHoverLeave:D}}var At=require("react"),hl=(e,t,n)=>Math.max(t,Math.min(n,e));function yl(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 bl(e,t){try{typeof localStorage<"u"&&localStorage.setItem(e,String(Math.round(t)))}catch{}}function bn(e){let{storageKey:t,initial:n,min:r,reserve:i,edge:a}=e,[o,s]=(0,At.useState)(()=>yl(t,n)),l=(0,At.useRef)(null),d=(0,At.useRef)(null),p=(0,At.useCallback)(g=>{let c=l.current?.parentElement?.clientWidth??Number.MAX_SAFE_INTEGER;d.current={x:g.clientX,w:o,max:Math.max(r,c-i)},g.preventDefault(),typeof document<"u"&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none")},[o,r,i]);(0,At.useEffect)(()=>{if(typeof window>"u")return;let g=c=>{let x=d.current;if(x===null)return;let h=c.clientX-x.x;s(hl(x.w+(a==="end"?h:-h),r,x.max))},k=()=>{d.current!==null&&(d.current=null,typeof document<"u"&&(document.body.style.cursor="",document.body.style.userSelect=""),s(c=>(bl(t,c),c)))};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",k),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",k)}},[a,r,t]);let f=(0,At.createElement)("div",{key:`rz-${t}`,ref:l,className:"gp-resizer",role:"separator","aria-orientation":"vertical",onPointerDown:p});return{width:o,divider:f}}var ho=require("react");function Qt(e,t,n,r,i=!1){return e.map(a=>(0,ho.createElement)("button",{key:a,type:"button",className:`gp-seg__btn${t===a?" gp-seg__btn--active":""}`,...i?{disabled:!0}:{},onClick:()=>n(a)},r(a)))}var Ae=require("react"),yo=require("react-dom"),bo=require("@deepseek-ai/dsh-client-ui-primitives");function vn(e,t,n){switch(e){case"empty-message":return n("error.emptyMessage");case"nothing-to-commit":return n("error.nothingToCommit");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"status-lossy":return n("error.statusLossy");case"stash-switch-failed":return n("error.stashSwitchFailed",{reason:t??""});case"no-branch":return n("error.noBranch");case"invalid-name":case"invalid-index":return n("error.invalidName");case"invalid-path":return n("error.invalidPath");case"timeout":return n("error.timeout");case"cancelled":return n("error.cancelled");default:return t??n("error.generic")}}function Ln(e){return(0,Ae.createElement)("div",{key:"aihint",className:"gp-modal__hint"},e("ops.aiHint"))}function An(e){return(0,Ae.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,Ae.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",onClick:e.onClose},e.t("common.cancel")),(0,Ae.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 Xt(e){return typeof document>"u"?null:(0,Ae.createElement)(vl,e)}function vl({onClose:e,title:t,icon:n,hash:r,body:i,footer:a,overlay:o,portalKey:s,t:l}){let d=o!=null;(0,Ae.useEffect)(()=>{let f=g=>{g.key==="Escape"&&!d&&e()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,d]);let p=(0,Ae.createElement)("div",{className:"gp-modal-backdrop",onClick:f=>{!d&&f.target===f.currentTarget&&e()}},(0,Ae.createElement)("div",{className:"gp-modal gp-modal--sm",role:"dialog","aria-modal":!0},[(0,Ae.createElement)("div",{key:"bar",className:"gp-modal__bar"},[n!==void 0?(0,Ae.createElement)("span",{key:"ic",className:"gp-modal__fileicon"},n):null,(0,Ae.createElement)("span",{key:"title",className:"gp-modal__path"},t),r!==void 0?(0,Ae.createElement)("span",{key:"hash",className:"gp-modal__hash"},r):null,(0,Ae.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),disabled:d,onClick:e},(0,Ae.createElement)(yt,{size:15}))]),(0,Ae.createElement)("div",{key:"body",className:"gp-modal__form"},i),a,o??null]));return(0,yo.createPortal)(p,document.body,s)}function wl(e){return(0,Ae.createElement)("div",{key:"overlay",className:"gp-modal__overlay"},[(0,Ae.createElement)(bo.StateDot,{key:"sp",state:"ongoing",size:26}),(0,Ae.createElement)("div",{key:"lb",className:"gp-modal__overlay-label"},e)])}function pt(e){let t=e.confirmBusy===!0&&e.busyLabel!==void 0;return Xt({onClose:e.onClose,title:e.title,portalKey:"confirm-modal",t:e.t,body:[(0,Ae.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},e.body),e.extra??null,Ln(e.t),e.error!==null?(0,Ae.createElement)("div",{key:"err",className:"gp-feedback"},e.error):null],footer:An({onClose:e.onClose,onConfirm:e.onConfirm,confirmLabel:e.confirmLabel,confirmDisabled:e.confirmBusy===!0,danger:e.danger,t:e.t}),...t?{overlay:wl(e.busyLabel)}:{}})}var fe=require("react");function vo(e,t){return typeof document>"u"?null:(0,fe.createElement)(xl,{target:e,...t})}function xl({target:e,onClose:t,onCreate:n,error:r,t:i}){let[a,o]=(0,fe.useState)(""),[s,l]=(0,fe.useState)(!1),[d,p]=(0,fe.useState)(""),f=()=>{a.trim()!==""&&n(a.trim(),s?d:"")};return Xt({onClose:t,title:i("tag.createTitle"),icon:(0,fe.createElement)(Cn,{size:15}),hash:e.shortHash,portalKey:"tag-create-modal",t:i,body:[(0,fe.createElement)("input",{key:"name",className:"gp-input",placeholder:i("tag.namePlaceholder"),value:a,autoFocus:!0,onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&f()}}),(0,fe.createElement)("label",{key:"ann",className:"gp-modal__check"},[(0,fe.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:s,onChange:()=>l(g=>!g)}),i("tag.annotated")]),s?(0,fe.createElement)("textarea",{key:"msg",className:"gp-input gp-input--area",placeholder:i("tag.messagePlaceholder"),value:d,onChange:g=>p(g.target.value)}):null,Ln(i),r!==null?(0,fe.createElement)("div",{key:"err",className:"gp-feedback"},r):null],footer:An({onClose:t,onConfirm:f,confirmLabel:i("tag.create"),confirmDisabled:a.trim()==="",danger:!1,t:i})})}function wo(e,t){return typeof document>"u"?null:(0,fe.createElement)(kl,{target:e,...t})}function kl({target:e,from:t,dirty:n,lostFiles:r,lostTotal:i,lostTruncated:a,busy:o,error:s,onReset:l,onClose:d,t:p}){let[f,g]=(0,fe.useState)("mixed"),[k,c]=(0,fe.useState)(!1);(0,fe.useEffect)(()=>{f!=="hard"&&c(!1)},[f]);let x=[{value:"mixed",label:"reset.modeMixed",hint:"reset.mixedHint"},{value:"soft",label:"reset.modeSoft",hint:"reset.softHint"},{value:"hard",label:"reset.modeHard",hint:"reset.hardHint"}],h=o||f==="hard"&&!k;return Xt({onClose:d,title:p("reset.title"),icon:(0,fe.createElement)(gr,{size:15}),hash:e.shortHash,portalKey:"reset-modal",t:p,body:[(0,fe.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},p("reset.body",{from:t,to:e.shortHash})),(0,fe.createElement)("div",{key:"modes",className:"gp-reset__modes"},x.map(b=>(0,fe.createElement)("label",{key:b.value,className:`gp-reset__mode${f===b.value?" gp-reset__mode--on":""}${b.value==="hard"?" gp-reset__mode--danger":""}`},[(0,fe.createElement)("input",{key:"r",type:"radio",name:"gp-reset-mode",className:"gp-check",checked:f===b.value,onChange:()=>g(b.value)}),(0,fe.createElement)("span",{key:"tx",className:"gp-reset__modetext"},[(0,fe.createElement)("span",{key:"l",className:"gp-reset__modelabel"},p(b.label)),(0,fe.createElement)("span",{key:"h",className:"gp-reset__modehint"},p(b.hint))])]))),f==="hard"?(0,fe.createElement)("div",{key:"orphan",className:"gp-reset__dirtywarn"},p("reset.hardOrphan")):null,f==="hard"&&i>0?(0,fe.createElement)("div",{key:"lost",className:"gp-reset__lost"},[(0,fe.createElement)("div",{key:"w",className:"gp-reset__warn"},p("reset.hardWarn")),(0,fe.createElement)("ul",{key:"ul",className:"gp-reset__lostlist"},[...r.map(b=>(0,fe.createElement)("li",{key:b,title:b},b)),a?(0,fe.createElement)("li",{key:"_more",className:"gp-reset__lostmore"},p("reset.lostMore")):null])]):null,f==="hard"?(0,fe.createElement)("label",{key:"ack",className:"gp-modal__check gp-reset__ack"},[(0,fe.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:k,onChange:()=>c(b=>!b)}),p(i>0?"reset.hardAck":"reset.hardAckClean")]):null,n?(0,fe.createElement)("div",{key:"dirty",className:"gp-reset__dirtywarn"},p("ops.dirtyWarn")):null,Ln(p),s!==null?(0,fe.createElement)("div",{key:"err",className:"gp-feedback"},s):null],footer:An({onClose:d,onConfirm:()=>void l(f),confirmLabel:p("reset.confirm"),confirmDisabled:h,danger:f==="hard",t:p})})}var Et=require("react");function xo(e,t){return typeof document>"u"?null:(0,Et.createElement)(_l,{target:e,...t})}function _l({target:e,from:t,dirty:n,busy:r,error:i,onConfirm:a,onClose:o,t:s}){let[l,d]=(0,Et.useState)(!1),p=(f,g,k,c)=>(0,Et.createElement)("label",{key:g,className:`gp-bpick__mode${l===f?" gp-bpick__mode--on":""}`},[(0,Et.createElement)("input",{key:"r",type:"radio",name:"gp-switch-mode",className:"gp-check",checked:l===f,onChange:()=>d(f)}),(0,Et.createElement)("span",{key:"tx",className:"gp-bpick__modetext"},[(0,Et.createElement)("span",{key:"l",className:"gp-bpick__modelabel"},k),(0,Et.createElement)("span",{key:"h",className:"gp-bpick__modehint"},c)])]);return pt({title:s("switch.confirmTitle"),body:s("switch.body",{from:t??s("switch.detached"),to:e.name}),extra:(0,Et.createElement)("div",{key:"x",className:"gp-bpick__extra"},[e.createFrom===void 0?null:(0,Et.createElement)("div",{key:"trk",className:"gp-bpick__note"},s("switch.trackingNote",{name:e.name,ref:e.createFrom})),n===0?null:(0,Et.createElement)("div",{key:"dw",className:"gp-bpick__warn"},s("switch.dirtyWarn",{count:n})),n===0?null:(0,Et.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:i,confirmBusy:r,busyLabel:s("switch.switching"),onConfirm:()=>a(l),onClose:o,t:s})}function Sl(e){let t=e.indexOf("/");return t<=0||t===e.length-1?null:{remote:e.slice(0,t),branch:e.slice(t+1)}}function ko(e){let t=new Set(e.local.map(i=>i.name)),n=e.local.map(i=>({key:`local:${i.name}`,group:"local",label:i.name,name:i.name,reused:!1,ahead:i.ahead,behind:i.behind,shortHash:i.shortHash})),r=[];for(let i of e.remote){let a=Sl(i.name);if(a===null)continue;let o=t.has(a.branch);r.push({key:`remote:${i.name}`,group:"remote",label:i.name,name:a.branch,createFrom:o?void 0:i.name,reused:o,ahead:i.ahead,behind:i.behind,shortHash:i.shortHash})}return[...n,...r]}function _o(e,t){return e.name!==t}var xe=require("react");var $e=require("react"),So=require("react-dom"),Cl=140,Tl=260;function $t(e){let t=e?.placement??"above",n=e?.delayMs??Cl,r=e?.maxWidth??Tl,[i,a]=(0,$e.useState)(null),o=(0,$e.useRef)(!1),s=(0,$e.useRef)(void 0),l=(0,$e.useCallback)(()=>{s.current!==void 0&&(clearTimeout(s.current),s.current=void 0),o.current=!1,a(null)},[]),d=(0,$e.useCallback)((h,b)=>{let v=h.getBoundingClientRect(),C=h.closest('.gp-panel[data-layout="compact"]')!==null,E=C?v.left+v.width/2:v.left,B=Math.min(r,Math.max(80,window.innerWidth-16));a(t==="below"?{text:b,left:E,center:C,maxW:B,top:v.bottom+6}:{text:b,left:E,center:C,maxW:B,bottom:Math.max(8,window.innerHeight-v.top+6)})},[t,r]),p=(0,$e.useCallback)((h,b)=>{o.current||(s.current!==void 0&&clearTimeout(s.current),o.current=!1,s.current=setTimeout(()=>d(h,b),n))},[d,n]),f=(0,$e.useCallback)((h,b)=>{s.current!==void 0&&(clearTimeout(s.current),s.current=void 0),o.current=!0,d(h,b)},[d]),g=(0,$e.useRef)(null);(0,$e.useLayoutEffect)(()=>{let h=g.current;if(h===null||i===null)return;let b=8,v=window.innerWidth,C=window.innerHeight,E=h.getBoundingClientRect(),B=i.center===!0?b+E.width/2:b,H=i.center===!0?v-b-E.width/2:v-b-E.width,F=Math.min(Math.max(i.left,B),Math.max(B,H)),ee=Math.max(b,C-b-E.height),q=i.top===void 0?void 0:Math.min(Math.max(i.top,b),ee),W=i.bottom===void 0?void 0:Math.min(Math.max(i.bottom,b),ee);F===i.left&&q===i.top&&W===i.bottom||a(j=>{if(j===null)return j;let Q={...j,left:F};return q!==void 0&&(Q.top=q),W!==void 0&&(Q.bottom=W),Q})},[i]),(0,$e.useEffect)(()=>{if(i===null)return;let h=v=>{let C=v.target;C instanceof Element&&C.closest(".gp-tip")!==null||l()},b=v=>{v.key==="Escape"&&l()};return document.addEventListener("pointerdown",h,!0),document.addEventListener("keydown",b,!0),()=>{document.removeEventListener("pointerdown",h,!0),document.removeEventListener("keydown",b,!0)}},[i,l]);let k=(0,$e.useCallback)(h=>({onMouseEnter:b=>p(b.currentTarget,h),onMouseLeave:()=>{o.current||l()},onFocus:b=>p(b.currentTarget,h),onBlur:()=>{o.current||l()}}),[p,l]),c={left:i?.left??0,maxWidth:i?.maxW??r};i?.top!==void 0&&(c.top=i.top),i?.bottom!==void 0&&(c.bottom=i.bottom);let x=i!==null&&typeof document<"u"?(0,So.createPortal)((0,$e.createElement)("div",{ref:g,className:`gp-tip gp-tip--sb${i.center===!0?" gp-tip--center":""}`,style:c},i.text),document.body):null;return{tipProps:k,tipNode:x,hideTip:l,showTipNow:f}}function Kt(e){return(0,$e.createElement)("span",{className:"gp-tip-wrap",...e.tipProps},e.children)}function Dn(e){return e.hasUpstream===!0&&e.ahead>0&&e.behind===0}function Fn(e){return e.hasUpstream!==!0&&e.branch!==null&&e.unborn!==!0&&e.head!==null&&e.head!==""&&e.remote!==null}function Dr(e){return Dn(e)?"push":Fn(e)?"publish":null}function Co(e,t,n){if(e==="loading"||e===null)return(0,xe.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}),i=r.match(/(\+\d+)\s*\/\s*([-−]\d+)/);if(i===null)return(0,xe.createElement)("div",{className:"gp-pullscope"},r);let a=r.indexOf(i[0]);return(0,xe.createElement)("div",{className:"gp-pullscope"},[r.slice(0,a),(0,xe.createElement)("span",{key:"add",className:"gp-pullscope__add"},i[1])," / ",(0,xe.createElement)("span",{key:"del",className:"gp-pullscope__del"},i[2]),r.slice(a+i[0].length)])}function To(e,t){return Co(e,t,{line:"status.pullScope",loading:"status.pullScopeLoading"})}function Eo(e,t){return Co(e,t,{line:"status.pushScope",loading:"status.pushScopeLoading"})}function El(e){let t=e.replace(/^https?:\/\/[^/]+\//,"").replace(/\/+$/,""),n=t.split("/");return n.length>=2?n.slice(-2).join("/"):t}function mi(e,t){return(0,xe.createElement)(Nl,{snapshot:e,cb:t})}function Nl({snapshot:e,cb:t}){let{t:n}=t,{tipProps:r,tipNode:i,hideTip:a}=$t({placement:"above"}),o=e.remote??null,s=e.hasUpstream===!0,l=(()=>{if(o===null||o.hostKind!=="github")return null;let h=(0,xe.createElement)(va,{size:14});if(o.webUrl===null)return(0,xe.createElement)("span",{key:"r",className:"gp-statusbar__repo gp-statusbar__repo--none","aria-label":o.url,...r(o.url)},(0,xe.createElement)("span",{className:"gp-statusbar__ic"},h));let b=o.host!==null?n("status.openRepoOn",{host:o.host}):n("status.openRepo"),v=`${El(o.webUrl)} \xB7 ${b}`;return(0,xe.createElement)("a",{key:"r",className:"gp-statusbar__repo",href:o.webUrl,target:"_blank",rel:"noreferrer","aria-label":v,...r(v)},(0,xe.createElement)("span",{className:"gp-statusbar__ic"},h))})(),{ahead:d,behind:p,branch:f}=e,g=s&&p>0&&d===0,k=Dr(e),c=(()=>{let h,b="";return f===null?h=n("status.detached"):s?d===0&&p===0?(h=n("status.synced"),b=" gp-statusbar__state--ok"):d>0&&p>0?(h=n("status.diverged",{ahead:d,behind:p}),b=" gp-statusbar__state--warn"):p>0?(h=n("status.behind",{n:p}),b=" gp-statusbar__state--warn"):h=n("status.ahead",{n:d}):h=n("status.noUpstream"),t.syncError!==null?(0,xe.createElement)("span",{key:"error",className:"gp-statusbar__state gp-statusbar__state--warn",role:"alert",title:t.syncError},t.syncError):(0,xe.createElement)("span",{key:"s",className:`gp-statusbar__state${b}`},h)})(),x=[o!==null?(0,xe.createElement)(Kt,{key:"check",tipProps:r(n("status.checkTitle"))},(0,xe.createElement)("button",{type:"button",className:"gp-icon-btn gp-statusbar__btn",disabled:t.syncBusy,"aria-label":n("status.check"),onClick:()=>{a(),t.onCheck()}},(0,xe.createElement)(xa,{size:13}))):null,g?(0,xe.createElement)(Kt,{key:"pull",tipProps:r(n("status.pullTitle"))},(0,xe.createElement)("button",{type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pullBusy,"aria-label":n("status.pullTitle"),onClick:()=>{a(),t.onPull()}},[(0,xe.createElement)(wa,{key:"i",size:12}),n("status.pull")])):null,k==="push"?(0,xe.createElement)(Kt,{key:"push",tipProps:r(n("status.pushTitle"))},(0,xe.createElement)("button",{type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pushBusy,"aria-label":n("status.pushTitle"),onClick:()=>{a(),t.onPush()}},[(0,xe.createElement)(gn,{key:"i",size:12}),n("status.push")])):null,k==="publish"?(0,xe.createElement)(Kt,{key:"publish",tipProps:r(n("status.publishTitle"))},(0,xe.createElement)("button",{type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.publishBusy,"aria-label":n("status.publishTitle"),onClick:()=>{a(),t.onPublish()}},[(0,xe.createElement)(gn,{key:"i",size:12}),n("status.publish")])):null];return(0,xe.createElement)("div",{key:"statusbar",className:`gp-statusbar${t.syncBusy?" gp-statusbar--busy":""}`},[l,(0,xe.createElement)("div",{key:"sync",className:"gp-statusbar__sync"},[c,...x]),i])}var Nt=require("react");function Fr({remote:e,sessionId:t,snapshot:n,onAction:r,onClose:i,t:a,onBusyChange:o}){let s=JSON.stringify([t,n.root,n.branch,n.head]),l=(0,Nt.useRef)(s),d=(0,Nt.useRef)({scope:s,snapshot:n});d.current={scope:s,snapshot:n};let p=(0,Nt.useRef)(!1),f=(0,Nt.useRef)(!1),[g,k]=(0,Nt.useState)("loading"),[c,x]=(0,Nt.useState)(null),[h,b]=(0,Nt.useState)(!1),v=s===l.current;(0,Nt.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]),(0,Nt.useEffect)(()=>{(!v||!Dn(n))&&(f.current||i())},[v,n,h,i]),(0,Nt.useEffect)(()=>{if(!v)return;let E=!0;return k("loading"),(async()=>{try{let B=await e.query({sessionId:t,query:{kind:"push-preview"}});if(!E||d.current.scope!==l.current)return;let H=_e(B,"push-preview");H!==null&&H.hasUpstream?k(H):(k(null),x(B.ok?a("error.generic"):vn(B.error.code,B.error.message,a)))}catch(B){if(!E||d.current.scope!==l.current)return;k(null),x(B instanceof Error?B.message:a("error.generic"))}})(),()=>{E=!1}},[e,t,s,v,a]);let C=async()=>{if(!(f.current||d.current.scope!==l.current||!Dn(d.current.snapshot))){f.current=!0,x(null),b(!0),o?.(!0);try{let E=await r({kind:"push"});if(!p.current)return;E.ok?i():d.current.scope===l.current&&x(E.error??a("error.generic"))}catch(E){p.current&&d.current.scope===l.current&&x(E instanceof Error?E.message:a("error.generic"))}finally{f.current=!1,p.current&&b(!1),o?.(!1)}}};return v?pt({title:a("status.pushConfirmTitle"),body:a("status.pushConfirmBody",{branch:n.branch??"HEAD",ahead:n.ahead}),extra:g===null?null:Eo(g,a),confirmLabel:a("status.pushConfirm"),danger:!1,error:c,confirmBusy:h,busyLabel:a("status.pushing"),onConfirm:()=>void C(),onClose:()=>{f.current||i()},t:a}):null}var Dt=require("react");function zr({snapshot:e,onAction:t,onClose:n,t:r,onBusyChange:i}){let a=JSON.stringify([e.root,e.branch,e.head,e.remote?.name??null]),o=(0,Dt.useRef)(a),s=(0,Dt.useRef)({scope:a,snapshot:e});s.current={scope:a,snapshot:e};let l=(0,Dt.useRef)(!1),d=(0,Dt.useRef)(!1),[p,f]=(0,Dt.useState)(null),[g,k]=(0,Dt.useState)(!1),c=a===o.current,x=e.remote;(0,Dt.useEffect)(()=>(l.current=!0,()=>{l.current=!1}),[]),(0,Dt.useEffect)(()=>{(!c||x===null||!Fn(e))&&(d.current||n())},[c,e,x,g,n]);let h=async()=>{if(d.current||s.current.scope!==o.current)return;let b=s.current.snapshot;if(!(b.remote===null||!Fn(b))){d.current=!0,f(null),k(!0),i?.(!0);try{let v=await t({kind:"publish",remote:b.remote.name});if(!l.current)return;v.ok?n():s.current.scope===o.current&&f(v.error??r("error.generic"))}catch(v){l.current&&s.current.scope===o.current&&f(v instanceof Error?v.message:r("error.generic"))}finally{d.current=!1,l.current&&k(!1),i?.(!1)}}};return c?pt({title:r("status.publishConfirmTitle"),body:r("status.publishConfirmBody",{branch:e.branch??"HEAD",remote:x?.name??"origin"}),confirmLabel:r("status.publishConfirm"),danger:!1,error:p,confirmBusy:g,busyLabel:r("status.publishing"),onConfirm:()=>void h(),onClose:()=>{d.current||n()},t:r}):null}var hi=new Set,No=22,Mo=24,Go=[["","overview.allTime"],["1 day ago","overview.today"],["7 days ago","overview.last7d"],["30 days ago","overview.last30d"]],Ml=30;function Gl(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 Pl=46,Rl=260;function Ll(e,t){let[n,r]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let i=()=>r(e.clientWidth>0&&e.clientWidth<t);i();let a=new ResizeObserver(i);return a.observe(e),()=>a.disconnect()},[e,t]),n}function Po({remote:e,sessionId:t,visible:n=!0,defaultDiffView:r,snapshot:i,onAction:a,onResync:o,compact:s,t:l}){let{signal:d,queryVisible:p,queryKey:f}=lr(t,n,i.root),[g,k]=(0,u.useState)({ref:null,search:"",author:"",since:""}),[c,x]=(0,u.useState)(""),[h,b]=(0,u.useState)(!1),[v,C]=(0,u.useState)(!1),[E,B]=(0,u.useState)(null),H=Ll(E,Rl),[F,ee]=(0,u.useState)(!1),q=(0,u.useId)(),[W,j]=(0,u.useState)(new Set(["tags","remote"])),[Q,te]=(0,u.useState)(0),re=[...f,Q],de=()=>te(_=>_+1),[N,se]=(0,u.useState)(null),[ce,ie]=(0,u.useState)(null),[le,D]=(0,u.useState)(null),[M,V]=(0,u.useState)(null),[O,z]=(0,u.useState)(null),[Y,G]=(0,u.useState)(!1),[S,R]=(0,u.useState)(!1),[oe,ke]=(0,u.useState)(null),[Qe,dt]=(0,u.useState)(!1),[vt,rt]=(0,u.useState)(!1),[De,wt]=(0,u.useState)(!1),[it,Gt]=(0,u.useState)(!1),[gt,Ke]=(0,u.useState)(!1),[Ye,ft]=(0,u.useState)(!1),[at,ge]=(0,u.useState)(null),[ve,ze]=(0,u.useState)("list"),[He,Ie]=(0,u.useState)(null),[Ze,Je]=(0,u.useState)(!1),[ot,Ne]=(0,u.useState)(!1);(0,u.useEffect)(()=>{if(!ot)return;let _=$=>{$.key==="Escape"&&Ne(!1)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[ot]),(0,u.useEffect)(()=>{!s&&ot&&Ne(!1)},[s,ot]),(0,u.useEffect)(()=>{if(!vt){ge(null);return}let _=!0;return ge("loading"),e.query({sessionId:t,query:{kind:"pull-preview"}}).then($=>{if(!_)return;let be=_e($,"pull-preview");ge(be!==null&&be.hasUpstream?{commits:be.commits,files:be.files,insertions:be.insertions,deletions:be.deletions}:null)}),()=>{_=!1}},[vt,e,t]);let{tree:Me,treeError:xt,authors:kt,reload:Fe}=go(e,t,re,p),Pt=(0,u.useMemo)(()=>{let _=new Map;if(Me===null)return _;for(let $ of ko(Me))_o($,Me.current)&&_.set($.key,$);return _},[Me]),mt=i.remote?.name??null,Ee=(0,u.useMemo)(()=>{let _=Me?.local??[],$=Me?.remote??[],be=Me?.defaultBranch??null,cn=Ra(_,be),zi=Aa($,mt,be),Hi=Da(_,Me?.current??null,cn);return{local:Hi.nodes,localPinned:Hi.pinned,localPrimary:cn,remotePrimary:zi,remote:br(La($,zi)),tags:br(Me?.tags??[])}},[Me,mt]),_t=_=>{z(null),Ie(_)},ae=mo(e,t,r,p),{commits:et,topology:tt,appliedFilter:Rt,loading:St,listError:zt,hasMore:Z,listRef:X,loadMore:he}=fo(e,t,g,re,ae.clearSelection,p);(0,u.useEffect)(()=>{let _=setTimeout(()=>k($=>$.search===c?$:{...$,search:c}),300);return()=>clearTimeout(_)},[c]);let je=tt!==void 0||li(Rt),Ve=(0,u.useMemo)(()=>je?Ma(et,tt??[],i.graphStyle):fr(et,i.graphStyle),[et,tt,je,i.graphStyle]),qe=(0,u.useMemo)(()=>Ea(Ve),[Ve]),st=Math.max(fn,qe*fn),nt=s?Pl:Ml,lt=s?`${st}px minmax(0,1fr)`:`${st}px minmax(120px,1fr) 72px 120px 96px`,Jt=()=>{let _=X.current;_===null||!Z||_.scrollTop+_.clientHeight>=_.scrollHeight-240&&he()},Yt=_=>{ae.select(_),s&&ze("detail")},w=(0,u.useMemo)(()=>Date.now(),[et,d.sampledAt]),Ce=(0,u.useMemo)(()=>ae.detail===null?[]:Fa(ae.detail.stats.map(_=>({path:_.path,meta:_.status}))),[ae.detail]),pe=ae.selected,Oe=pe?.hash??null,[Ht,Bt]=(0,u.useState)({hash:null,dirs:hi}),Lt=Ht.hash===Oe?Ht.dirs:hi,jt=(0,u.useCallback)(_=>{Bt($=>{let be=$.hash===Oe?$.dirs:hi,cn=new Set(be);return cn.has(_)?cn.delete(_):cn.add(_),{hash:Oe,dirs:cn}})},[Oe]);(0,u.useEffect)(()=>{if(pe===null)return;let _=et.find($=>$.hash===pe.hash);_!==void 0&&_!==pe&&!Gl(_.refs,pe.refs)&&ae.resyncSelected(_)},[et,pe]);let I=bn({storageKey:"gp.overview.left",initial:200,min:130,reserve:360,edge:"end"}),Ge=bn({storageKey:"gp.overview.right",initial:340,min:190,reserve:360,edge:"start"}),we=_=>k($=>({...$,ref:_})),Be=async(_,$)=>{if(!(N===null||Y)){z(null),G(!0);try{let be=await e.run({sessionId:t,action:{kind:"tag-create",name:_,commit:N.hash,...$.trim()!==""?{message:$}:{}}});be.ok?(se(null),de()):z(vn(be.error.code,be.error.message,l))}finally{G(!1)}}},ye=async _=>{if(!Y){z(null),G(!0);try{let $=await e.run({sessionId:t,action:{kind:"tag-delete",name:_}});$.ok?(ie(null),de()):z(vn($.error.code,$.error.message,l))}finally{G(!1)}}},Re=async()=>{if(!(le===null||Y)){z(null),G(!0);try{let _=await a({kind:"revert",commit:le.hash});_.ok?D(null):z(_.error??l("error.generic"))}finally{G(!1)}}},ct=async _=>{if(!(M===null||Y)){z(null),G(!0);try{let $=await a({kind:"reset",commit:M.hash,mode:_});$.ok?V(null):z($.error??l("error.generic"))}finally{G(!1)}}},Zt=async _=>{if(!(He===null||Ze)){z(null),Je(!0);try{let $=await a({kind:"branch-checkout",name:He.name,...He.createFrom===void 0?{}:{createFrom:He.createFrom},..._?{stashMessage:l("switch.stashMessage",{branch:He.name})}:{}});$.ok?(Ie(null),en(!0)):z($.error??l("error.generic"))}finally{Je(!1)}}},en=async(_=!1)=>{if(!(S||i.remote===null)){_||ke(null),R(!0);try{let $=await a({kind:"fetch"});$.ok?ke(null):_||ke($.error??l("error.generic"))}catch($){_||ke($ instanceof Error?$.message:l("error.generic"))}finally{R(!1)}}},xn=async()=>{if(!Qe){z(null),dt(!0);try{let _=await a({kind:"pull-ff"});_.ok?rt(!1):z(_.error??l("error.generic"))}finally{dt(!1)}}},kn={syncBusy:S,syncError:oe,pullBusy:Qe,pushBusy:De,publishBusy:gt,onCheck:()=>void en(),onPull:()=>{z(null),rt(!0)},onPush:()=>{Dn(i)&&!De&&Gt(!0)},onPublish:()=>{z(null),ft(!0)},t:l},nr=Hl(ae.fileDiff,{visible:p,data:ae.fileDiffData,error:ae.fileDiffError,mode:ae.fileDiffMode,onMode:ae.setFileDiffMode,expanded:ae.fileDiffExpanded,onExpand:_=>{ae.fileDiff!==null&&ae.openFileDiff(ae.fileDiff.path,ae.fileDiff.hash,ae.fileDiff.shortHash,_)},onClose:ae.closeFileDiff,remote:e,sessionId:t,compact:s,t:l}),On=(0,u.useMemo)(()=>[...new Set(i.changes.filter(_=>_.status!=="untracked").map(_=>_.path))],[i.changes]),Xn=[N!==null?vo(N,{onClose:()=>se(null),onCreate:Be,error:O,compact:s,t:l}):null,ce!==null?pt({title:l("tag.deleteTitle"),body:l("tag.deleteConfirm",{name:ce}),confirmLabel:l("tag.deleteTitle"),danger:!0,error:O,confirmBusy:Y,onConfirm:()=>void ye(ce),onClose:()=>ie(null),t:l}):null,le!==null?pt({title:l("revert.title"),body:l("revert.body",{ref:`${le.shortHash} ${le.subject}`})+(i.dirty?`
|
|
910
|
+
|
|
911
|
+
${l("ops.dirtyWarn")}`:""),confirmLabel:l("revert.confirm"),danger:!1,error:O,confirmBusy:Y,onConfirm:()=>void Re(),onClose:()=>D(null),t:l}):null,M!==null?wo(M,{from:i.head??M.shortHash,dirty:i.dirty,lostFiles:On,lostTotal:On.length,lostTruncated:i.truncated,busy:Y,error:O,onReset:ct,onClose:()=>V(null),t:l}):null,vt?pt({title:l("status.pullConfirmTitle"),body:l("status.pullConfirmBody",{branch:i.branch??"HEAD",behind:i.behind}),extra:To(at,l),confirmLabel:l("status.pullConfirm"),danger:!1,error:O,confirmBusy:Qe,busyLabel:l("status.pulling"),onConfirm:()=>void xn(),onClose:()=>rt(!1),t:l}):null,it?(0,u.createElement)(Fr,{key:"push",remote:e,sessionId:t,snapshot:i,onAction:a,onClose:()=>Gt(!1),onBusyChange:wt,t:l}):null,Ye?(0,u.createElement)(zr,{key:"publish",snapshot:i,onAction:a,onClose:()=>ft(!1),onBusyChange:Ke,t:l}):null,He!==null?xo(He,{from:i.branch,dirty:i.dirty?Math.max(1,i.stats.fileCount):0,busy:Ze,error:O,onConfirm:_=>void Zt(_),onClose:()=>Ie(null),t:l}):null],Qr=[{id:"",label:l("overview.allUsers")},...kt.map(_=>({id:_,label:_}))],Yr=Go.map(([_,$])=>({id:_,label:l($)})),Zr=l(Go.find(([_])=>_===g.since)?.[1]??"overview.allTime"),$n=g.author===""?l("overview.allUsers"):g.author,_n=s?(0,u.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":F,...F?{"aria-controls":q}:{},onClick:()=>ee(_=>!_)},(0,u.createElement)("span",{key:"c",className:`gp-toolbar__chev${F?" gp-toolbar__chev--up":""}`},(0,u.createElement)(qt,{size:14,open:!0}))):null,rr=(0,u.createElement)("button",{key:"fetch",type:"button",className:"gp-icon-btn",title:l("overview.fetch"),disabled:S,onClick:()=>void en()},(0,u.createElement)(nn,{size:14})),ir=(0,u.createElement)(yi.Menu,{key:"author",open:h,onClose:()=>b(!1),items:Qr,selectedId:g.author,onSelect:_=>{b(!1),k($=>({...$,author:_}))},align:"start",portal:!0,className:"gp-filter",anchor:qn(h,$n,()=>b(_=>!_))}),ar=(0,u.createElement)(yi.Menu,{key:"since",open:v,onClose:()=>C(!1),items:Yr,selectedId:g.since,onSelect:_=>{C(!1),k($=>({...$,since:_}))},align:"start",portal:!0,className:"gp-filter",anchor:qn(v,Zr,()=>C(_=>!_))}),T=(0,u.createElement)("input",{key:"search",className:"gp-search",placeholder:l(H||s?"overview.searchShort":"overview.search"),value:c,onChange:_=>x(_.target.value)}),J=[ir,ar,rr],ue=s?[(0,u.createElement)("button",{key:"filter",type:"button",className:`gp-btn${g.ref!==null?" gp-btn--primary":""}`,title:l("overview.filterBranch"),onClick:()=>Ne(!0)},[(0,u.createElement)(pa,{key:"ic",size:13}),(0,u.createElement)("span",{key:"l",className:"gp-btn__label"},g.ref??l("overview.filterBranch"))]),T,..._n===null?[]:[_n],...F?[(0,u.createElement)("div",{key:"more",id:q,className:"gp-toolbar__more"},J)]:[]]:[T,...J],Le=(0,u.createElement)("div",{key:"mid",className:"gp-col gp-col--mid gp-history"},[(0,u.createElement)("div",{key:"tb",className:"gp-toolbar",ref:B},ue),(0,u.createElement)("div",{key:"list",className:"gp-history__list",ref:X,onScroll:Jt},et.length===0?(0,u.createElement)("div",{className:"gp-empty"},l(St?"common.loading":zt?"overview.loadFailed":"overview.noResults")):Ve.map(_=>Fl(_,{selected:pe?.hash===_.commit.hash,current:!i.unborn&&i.head!==null&&i.head!==""&&_.commit.hash.startsWith(i.head),gridTpl:lt,laneCount:qe,now:w,compact:s,rowH:nt,onSelect:()=>Yt(_.commit),onHoverEnter:ae.onHoverEnter,onHoverLeave:ae.onHoverLeave,t:l})))]),Xe=_=>ae.detail!==null&&ae.detail.stats.length>0?(0,u.createElement)("div",{className:_},[(0,u.createElement)("span",{key:"f"},l("overview.changeSummary",{files:ae.detail.stats.length})),(0,u.createElement)("span",{key:"sep",className:"gp-detail__summary-sep"},"\xB7"),(0,u.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ae.detail.insertions}`),(0,u.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ae.detail.deletions}`)]):null,dn=pe===null?[(0,u.createElement)("div",{key:"empty",className:"gp-empty"},[(0,u.createElement)(pr,{key:"i",size:20}),l("overview.selectCommit")])]:[(0,u.createElement)("div",{key:"files",className:"gp-detail__files"},ae.detail===null?(0,u.createElement)("div",{className:"gp-empty"},ae.detailError?l("overview.detailFailed"):l("common.loading")):[s?null:Xe("gp-detail__summary"),zl(Ce,{activePath:ae.fileDiff?.path??null,openTitle:l("overview.openFileDiff"),onOpen:_=>{pe!==null&&ae.openFileDiff(_,pe.hash,pe.shortHash)},collapsed:Lt,onToggleDir:jt,expandLabel:l("overview.expandDir"),collapseLabel:l("overview.collapseDir")})]),(0,u.createElement)("div",{key:"msg",className:"gp-detail__msg"},[(0,u.createElement)("div",{key:"subj",className:"gp-detail__subject"},pe.subject),(0,u.createElement)("div",{key:"meta",className:"gp-detail__meta"},[(0,u.createElement)("span",{key:"h",className:"gp-commit-hash"},pe.shortHash),(0,u.createElement)("span",{key:"a"},pe.author),(0,u.createElement)("span",{key:"t"},Yn(pe.dateIso))]),(0,u.createElement)("div",{key:"ops",className:"gp-detail__ops"},(()=>{let _=pe.refs.filter($=>$.kind==="tag");return[_.length>0?(0,u.createElement)("div",{key:"tags",className:"gp-detail__tags"},_.map($=>(0,u.createElement)("span",{key:`tag-${$.name}`,className:"gp-ref-chip gp-ref-chip--tag gp-ref-chip--del",title:$.name},[(0,u.createElement)(Cn,{key:"i",size:11}),(0,u.createElement)("span",{key:"n",className:"gp-detail__tagname"},$.name),(0,u.createElement)("button",{key:"x",type:"button",className:"gp-ref-chip__x",title:l("tag.deleteOne",{name:$.name}),onClick:()=>{z(null),ie($.name)}},(0,u.createElement)(yt,{size:11}))]))):null,(0,u.createElement)("div",{key:"actions",className:"gp-detail__actions"},[(0,u.createElement)("button",{key:"revert",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.revert"),onClick:()=>{z(null),D({hash:pe.hash,shortHash:pe.shortHash,subject:pe.subject})}},[(0,u.createElement)(ya,{key:"i",size:12}),l("overview.revert")]),(0,u.createElement)("button",{key:"reset",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.reset"),onClick:()=>{z(null),o(),V({hash:pe.hash,shortHash:pe.shortHash,subject:pe.subject})}},[(0,u.createElement)(gr,{key:"i",size:12}),l("overview.reset")]),(0,u.createElement)("button",{key:"addtag",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.createTag"),onClick:()=>{z(null),se({hash:pe.hash,shortHash:pe.shortHash})}},[(0,u.createElement)(Cn,{key:"i",size:12}),l("overview.createTag")])])]})()),ae.detail!==null&&ae.detail.body!==""?(0,u.createElement)("pre",{key:"body",className:"gp-detail__body"},ae.detail.body):(0,u.createElement)("div",{key:"nb",className:"gp-empty"},l("overview.noMessage"))])];return s?(0,u.createElement)("div",{className:"gp-overview gp-overview--compact"},[nr,...Xn,ve==="detail"?(0,u.createElement)("div",{key:"detail",className:"gp-col gp-col--mid gp-detail"},[(0,u.createElement)("div",{key:"back",className:"gp-subhead"},[(0,u.createElement)("button",{key:"b",type:"button",className:"gp-subhead__back",onClick:()=>ze("list")},[(0,u.createElement)(Tn,{key:"i",size:14}),l("overview.backToList")]),Xe("gp-detail__summary gp-detail__summary--inline")]),...dn]):Le,mi(i,kn),ot?Dl(Me,xt,g.ref,W,{onFilter:_=>{we(_),Ne(!1)},switchOptions:Pt,onSwitch:_=>{Ne(!1),_t(_)},onToggle:_=>j($=>{let be=new Set($);return be.has(_)?be.delete(_):be.add(_),be}),onRetry:Fe,onClose:()=>Ne(!1),t:l},Ee):null]):(0,u.createElement)("div",{className:"gp-overview"},[nr,...Xn,(0,u.createElement)("div",{key:"left",className:"gp-col gp-col--left",style:{flex:`0 0 ${I.width}px`}},[(0,u.createElement)("div",{key:"scroll",className:"gp-col-left__scroll"},Ro(Me,xt,g.ref,W,{onFilter:_=>we(_),switchOptions:Pt,onSwitch:_t,onToggle:_=>j($=>{let be=new Set($);return be.has(_)?be.delete(_):be.add(_),be}),onRetry:Fe,t:l},Ee)),mi(i,kn)]),I.divider,Le,Ge.divider,(0,u.createElement)("div",{key:"right",className:"gp-col gp-col--right gp-detail",style:{flex:`0 0 ${Ge.width}px`}},dn),Al(ae.hover,ae.hoverBody,l)])}function Al(e,t,n){if(e===null||typeof document>"u")return null;let r=460,i=Math.min(e.x+16,(typeof window<"u"?window.innerWidth:1200)-r-12),a=e.y+14,o=(0,u.createElement)("div",{className:"gp-hovercard",style:{left:i,top:a,maxWidth:r}},[(0,u.createElement)("div",{key:"subj",className:"gp-hovercard__subject"},e.commit.subject),(0,u.createElement)("div",{key:"meta",className:"gp-hovercard__meta"},[(0,u.createElement)("span",{key:"h",className:"gp-commit-hash"},e.commit.shortHash),(0,u.createElement)("span",{key:"a"},e.commit.author),(0,u.createElement)("span",{key:"t"},Yn(e.commit.dateIso))]),t===null?(0,u.createElement)("div",{key:"l",className:"gp-hovercard__loading"},n("common.loading")):t===""?(0,u.createElement)("div",{key:"e",className:"gp-hovercard__loading"},n("overview.noMessage")):(0,u.createElement)("pre",{key:"body",className:"gp-hovercard__body"},t)]);return(0,Hr.createPortal)(o,document.body,"commit-hovercard")}function Ro(e,t,n,r,i,a){if(t)return(0,u.createElement)("div",{className:"gp-empty"},[(0,u.createElement)("span",{key:"m"},i.t("overview.branchesError")),(0,u.createElement)("button",{key:"r",type:"button",className:"gp-btn",style:{marginTop:8},onClick:i.onRetry},i.t("common.retry"))]);if(e===null)return(0,u.createElement)("div",{className:"gp-empty"},i.t("common.loading"));let o=(d,p,f,g,k)=>{let c=d.name,x=g==="local"&&e.current===d.name,h=g==="local"&&a.localPrimary===d.name||g==="remote"&&a.remotePrimary===d.name,b=`gp-branch-row${n===c?" gp-branch-row--active":""}${x?" gp-branch-row--current":""}${h?" gp-branch-row--primary":""}`,v=i.switchOptions.get(`${g}:${d.name}`),C=[x?i.t("overview.currentBranch"):"",h?i.t("overview.primaryBranch"):""].filter(Boolean).join(" \xB7 "),E=x?(0,u.createElement)(Sa,{size:14}):h?(0,u.createElement)(Ca,{size:14}):k,B=(H,F)=>F&&F>0?(0,u.createElement)("span",{key:H,className:"gp-branch-row__sync",title:i.t(H==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:F}),"aria-label":i.t(H==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:F})},[(0,u.createElement)(Ta,{key:"icon",size:12,direction:H}),(0,u.createElement)("span",{key:"count"},F)]):null;return(0,u.createElement)("div",{key:d.name,className:b,style:{paddingLeft:No+f*Mo},title:d.name,"data-current":x?"true":void 0,"data-primary":h?"true":void 0,onClick:()=>i.onFilter(n===c?null:c)},[(0,u.createElement)("span",{key:"i",className:`gp-branch-row__ic${x?" gp-branch-row__ic--current":h?" gp-branch-row__ic--primary":""}`,title:C||void 0,"aria-label":C||void 0},E),(0,u.createElement)("span",{key:"n",className:"gp-tree-name"},p),d.ahead||d.behind?(0,u.createElement)("span",{key:"t",className:"gp-branch-row__track"},[B("ahead",d.ahead),B("behind",d.behind)]):null,v===void 0?null:(0,u.createElement)("button",{key:"sw",type:"button",className:"gp-branch-row__switch",title:i.t(v.createFrom===void 0?"switch.rowTitle":"switch.rowTitleTrack",{name:v.name,ref:v.label}),onClick:H=>{H.stopPropagation(),i.onSwitch(v)}},i.t("switch.action"))])},s=(d,p,f,g,k)=>{for(let c of d){if(c.kind==="leaf"){k.push(o(c.branch,c.label,p,f,g));continue}let x=`${f}:${c.path}`,h=p===0,b=r.has(x)?!h:h;k.push((0,u.createElement)("div",{key:x,className:"gp-branch-row gp-branch-row--dir",style:{paddingLeft:No+p*Mo},title:c.path,role:"button",tabIndex:0,"aria-expanded":b,onClick:()=>i.onToggle(x),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),i.onToggle(x))}},[(0,u.createElement)("span",{key:"c",className:"gp-branch-row__chev"},(0,u.createElement)(qt,{size:11,open:b})),(0,u.createElement)("span",{key:"i",className:"gp-branch-row__ic gp-branch-row__ic--folder"},(0,u.createElement)(ma,{size:13})),(0,u.createElement)("span",{key:"n",className:"gp-tree-name"},c.label)])),b&&(c.self!==null&&k.push(o(c.self,c.path,p+1,f,g)),s(c.children,p+1,f,g,k))}},l=(d,p,f,g,k,c=[])=>{let x=[];if(!r.has(d)){for(let h of c)x.push(o(h,h.name,0,d,g));s(k,0,d,g,x)}return(0,u.createElement)("div",{key:d,className:"gp-branch-group"},[(0,u.createElement)("div",{key:"head",className:"gp-branch-group__head",onClick:()=>i.onToggle(d)},[(0,u.createElement)(qt,{key:"c",size:11,open:!r.has(d)}),`${i.t(p)} (${f})`]),...x])};return(0,u.createElement)("div",{},[(0,u.createElement)("div",{key:"head-row",className:"gp-branch-row",style:{fontWeight:600,justifyContent:"center",padding:"4px 10px"},onClick:()=>i.onFilter(null)},i.t("overview.head")),l("local","overview.local",e.local.length,(0,u.createElement)(ai,{size:13}),a.local,a.localPinned),l("remote","overview.remote",e.remote.length,(0,u.createElement)(ai,{size:13}),a.remote),l("tags","overview.tags",e.tags.length,(0,u.createElement)(Cn,{size:13}),a.tags)])}function Dl(e,t,n,r,i,a){if(typeof document>"u")return null;let o=(0,u.createElement)("div",{className:"gp-sheet-backdrop",onClick:s=>{s.target===s.currentTarget&&i.onClose()}},(0,u.createElement)("div",{className:"gp-sheet",role:"dialog","aria-modal":!0},[(0,u.createElement)("div",{key:"bar",className:"gp-sheet__bar"},[(0,u.createElement)("span",{key:"title",className:"gp-sheet__title"},i.t("overview.filterBranch")),(0,u.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-sheet__close",title:i.t("common.close"),onClick:i.onClose},(0,u.createElement)(yt,{size:15}))]),(0,u.createElement)("div",{key:"body",className:"gp-sheet__body"},Ro(e,t,n,r,i,a))]));return(0,Hr.createPortal)(o,document.body,"branch-filter-sheet")}function Fl(e,t){let n=e.commit,r=n.refs.map(a=>(0,u.createElement)("span",{key:a.name,className:`gp-ref-chip${a.head?" gp-ref-chip--head":""}${a.kind==="remote"?" gp-ref-chip--remote":""}${a.kind==="tag"?" gp-ref-chip--tag":""}`},a.name)),i=(0,u.createElement)("div",{key:"g",className:"gp-graph-cell"},(0,u.createElement)(Ga,{row:e,laneCount:t.laneCount,rowH:t.rowH,current:t.current}));return t.compact?(0,u.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},[i,(0,u.createElement)("div",{key:"tx",className:"gp-commit-lines"},[(0,u.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,u.createElement)("div",{key:"m",className:"gp-commit-sub"},[(0,u.createElement)("span",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,u.createElement)("span",{key:"a",className:"gp-commit-author"},n.author),(0,u.createElement)("span",{key:"d",className:"gp-commit-date"},rn(n.dateIso,t.now,t.t))])])]):(0,u.createElement)("div",{key:n.hash,className:`gp-commit-row${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl},onClick:t.onSelect,onMouseEnter:a=>t.onHoverEnter(n,a.clientX,a.clientY),onMouseLeave:t.onHoverLeave},[i,(0,u.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,u.createElement)("div",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,u.createElement)("div",{key:"a",className:"gp-commit-author"},n.author),(0,u.createElement)("div",{key:"d",className:"gp-commit-date",title:Qn(n.dateIso)},rn(n.dateIso,t.now,t.t))])}function zl(e,t){let n=[],r=(i,a)=>{for(let o of i)if(o.dir){let s=t.collapsed.has(o.path);n.push((0,u.createElement)("div",{key:o.path,className:"gp-tree-row gp-tree-row--dir",style:{paddingLeft:10+a*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,u.createElement)(qt,{key:"c",size:11,open:!s}),(0,u.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)])),s||r(o.children,a+1)}else{let s=String(o.meta??"modified"),l=t.activePath===o.path;n.push((0,u.createElement)("div",{key:o.path,className:`gp-tree-row${l?" gp-tree-row--active":""}`,style:{paddingLeft:10+a*14},title:t.openTitle,onClick:()=>t.onOpen(o.path)},[(0,u.createElement)("span",{key:"st",className:`gp-status-badge ${Nn(s)}`},(vr[s]??s[0]??"M").toUpperCase()),(0,u.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)]))}};return r(e,0),(0,u.createElement)("div",{},n)}function Hl(e,t){if(e===null||typeof document>"u")return null;let{visible:n,data:r,error:i,mode:a,onMode:o,expanded:s,onExpand:l,onClose:d,remote:p,sessionId:f,compact:g,t:k}=t,c=g?["unified","before","after"]:["unified","split","before","after"],x=g&&a==="split"?"unified":a,h=r!==null&&r.text!==""?(()=>{let F=Ar(r.text);return(0,u.createElement)("span",{key:"sum",className:"gp-modal__sum"},[(0,u.createElement)("span",{key:"a",className:"gp-stats__add"},`+${F.add}`),(0,u.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${F.del}`)])})():null,b=(0,u.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${s?" gp-seg__btn--active":""}`,disabled:x!=="split"&&x!=="unified",title:k(s?"diff.collapse":"diff.expandAll"),onClick:()=>l(!s)},k(s?"diff.collapse":"diff.expandAll")),v=(0,u.createElement)("div",{key:"seg",className:"gp-seg"},Qt(c,x,o,F=>k(`diff.${F}`))),C=(0,u.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:k("common.close"),onClick:d},(0,u.createElement)(yt,{size:15})),E=[(0,u.createElement)("span",{key:"fileicon",className:"gp-modal__fileicon"},(0,u.createElement)(fa,{size:15})),(0,u.createElement)("span",{key:"path",className:"gp-modal__path",title:e.path},Bl(e.path)),(0,u.createElement)("span",{key:"hash",className:"gp-modal__hash"},e.shortHash),h,b],B=g?[(0,u.createElement)("div",{key:"brow1",className:"gp-modal__bar-row"},E),(0,u.createElement)("div",{key:"brow2",className:"gp-modal__bar-row gp-modal__bar-row--controls"},[v,C])]:[...E,v,C],H=(0,u.createElement)("div",{className:"gp-modal-backdrop",onClick:F=>{F.target===F.currentTarget&&d()}},(0,u.createElement)("div",{className:"gp-modal",role:"dialog","aria-modal":!0},[(0,u.createElement)("div",{key:"bar",className:"gp-modal__bar"},B),(0,u.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},r===null?(0,u.createElement)("div",{className:"gp-empty"},k(i?"overview.diffFailed":"common.loading")):(0,u.createElement)(Lr,{key:"diff",visible:n,text:r.text,mode:x,path:e.path,remote:p,sessionId:f,base:"commit",commit:e.hash,expanded:s,truncated:r.truncated===!0,newLines:r.newLines,t:k}))]));return(0,Hr.createPortal)(H,document.body,"file-diff-modal")}function Bl(e){let t=e.lastIndexOf("/");return t<0?[(0,u.createElement)("span",{key:"n",className:"gp-modal__name"},e)]:[(0,u.createElement)("span",{key:"d",className:"gp-modal__dir"},e.slice(0,t+1)),(0,u.createElement)("span",{key:"n",className:"gp-modal__name"},e.slice(t+1))]}var y=require("react"),Xo=require("@deepseek-ai/dsh-client-ui-primitives");var Ft=require("react");function Lo(e,t,n,r,i,a){let[o,s]=(0,Ft.useState)([]),[l,d]=(0,Ft.useState)(null),[p,f]=(0,Ft.useState)(null),g=(0,Ft.useRef)(null),k=(0,Ft.useRef)(0);on([t,...a],r,async b=>{let v=await e.query({sessionId:t,query:{kind:"stash-list"}});if(!b())return;let C=_e(v,"stash-list");C!==null?s(C.entries):i()},i);let c=l!==null&&n.changes.some(b=>b.path===l.path);(0,Ft.useEffect)(()=>{l===null||c||(g.current=null,d(null),f(null))},[l,c]);let x=[t,...a,l?.path,l?.base,l?.expand,l?.version];on(x,r&&c,async b=>{if(l===null)return;let v=l,C=await e.query({sessionId:t,query:{kind:"diff",path:v.path,base:v.base,...v.expand?{context:2e3}:{}}});if(!b()||g.current!==v)return;let E=_e(C,"diff");f(E!==null?{text:E.text,newLines:E.newLines,truncated:E.truncated}:{text:"",newLines:0})},()=>f({text:"",newLines:0}));let h=(0,Ft.useCallback)((b,v,C=!1)=>{let E={path:b,base:v,expand:C,version:++k.current};g.current=E,d(E),f(null)},[]);return{stashes:o,diffPath:l,diffData:p,expanded:l?.expand??!1,showDiff:h}}var ut=require("react");function Ao({stats:e,compact:t=!1,showTimes:n=!0,t:r}){let i=Date.now(),{tipProps:a,tipNode:o}=$t({placement:"below",maxWidth:280}),s=[(0,ut.createElement)("span",{key:"files",className:"gp-stats__item"},r("stats.files",{n:e.fileCount})),(0,ut.createElement)("span",{key:"lines",className:"gp-stats__item"},[(0,ut.createElement)("span",{key:"a",className:"gp-stats__add"},`+${e.insertions}`)," ",(0,ut.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${e.deletions}`)])];e.staged>0&&s.push((0,ut.createElement)("span",{key:"st",className:"gp-stats__item"},r("stats.staged",{n:e.staged}))),e.modified>0&&s.push((0,ut.createElement)("span",{key:"mo",className:"gp-stats__item"},r("stats.modified",{n:e.modified}))),e.untracked>0&&s.push((0,ut.createElement)("span",{key:"un",className:"gp-stats__item"},r("stats.untracked",{n:e.untracked}))),e.partial&&s.push((0,ut.createElement)("span",{key:"partial",className:"gp-stats__item gp-stats__partial","aria-label":r("stats.partial"),...a(r("stats.partialHint"))},r("stats.partial")));let l=[];e.lastChangeAt!==null&&l.push((0,ut.createElement)("span",{key:"lc",className:"gp-stats__item",title:Qn(e.lastChangeAt)},r("stats.lastChange",{time:rn(e.lastChangeAt,i,r)}))),e.headCommittedAt!==null&&l.push((0,ut.createElement)("span",{key:"hc",className:"gp-stats__item",title:Qn(e.headCommittedAt)},r("stats.lastCommit",{time:rn(e.headCommittedAt,i,r)})));let d=l.length>0?(0,ut.createElement)("span",{key:"times",className:"gp-stats__times"},l):null;if(!t)return(0,ut.createElement)("div",{className:"gp-stats"},[...d===null?s:[...s,d],o]);let p=n&&d!==null;return(0,ut.createElement)("div",{className:`gp-stats gp-stats--compact${p?" gp-stats--timed":""}`},[(0,ut.createElement)("div",{key:"main",className:"gp-stats__main"},s),p?d:null,o])}function wn(e){return e.path+(e.staged?":s":":w")}function Do(e){return e.endsWith(":s")?"s":e.endsWith(":w")?"w":null}function Br(e){return Do(e)===null?e:e.slice(0,-2)}function Fo(e){let t=new Set,n=new Set,r={w:t,s:n};for(let i of e){let a=Do(i);a!==null&&r[a].add(Br(i))}return{paths:[...t].sort(),stagedOnly:[...n].filter(i=>!t.has(i)).sort()}}function zo(e,t){if(t.length===0)return"none";let n=0;for(let r of t)e.has(wn(r))&&n++;return n===0?"none":n===t.length?"all":"partial"}function Ho(e,t){let n=new Set(e),r=t.length>0&&t.every(i=>n.has(wn(i)));for(let i of t){let a=wn(i);r?n.delete(a):n.add(a)}return n}var zn=require("react");function Bo({paths:e,stagedOnly:t,snapshot:n,busy:r,error:i,onConfirm:a,onClose:o,t:s}){let l=(0,zn.useMemo)(()=>{let p=new Set(e);return n.changes.filter(f=>f.status==="untracked"&&p.has(f.path)).length},[e,n]),d=t.length>0||l>0?(0,zn.createElement)("div",{key:"notes"},[t.length>0?(0,zn.createElement)("div",{key:"staged",className:"gp-modal__confirmtext"},s("changes.discardPickedStaged",{count:t.length})):null,l>0?(0,zn.createElement)("div",{key:"untracked",className:"gp-modal__confirmtext"},s("changes.discardPickedUntracked",{count:l})):null]):null;return pt({title:s("changes.discardPickedTitle"),body:s("changes.discardPickedBody",{count:e.length}),extra:d,confirmLabel:s("changes.discard"),danger:!0,error:i,confirmBusy:r,busyLabel:s("changes.discarding"),onConfirm:a,onClose:o,t:s})}var Ue=require("react");function Io(e){let{snapshot:t,busy:n,t:r}=e,[i,a]=(0,Ue.useState)(!1),o=(0,Ue.useRef)(!1),{tipProps:s,tipNode:l,hideTip:d}=$t({placement:"below"});(0,Ue.useEffect)(()=>{d()},[t,d]);let p=async()=>{if(!o.current){o.current=!0,a(!0);try{await e.onRefresh()}finally{o.current=!1,a(!1)}}},f=n||i,g=Dr(t),k=g==="publish"?"status.publishTitle":"status.pushTitle",c=g===null?"changes.noRemoteTarget":k,x=()=>{g==="publish"?e.onPublish():g==="push"&&e.onPush()},h=(b,v,C,E,B,H="",F)=>(0,Ue.createElement)(Kt,{key:b,tipProps:s(r(F??v))},(0,Ue.createElement)("button",{type:"button",className:`gp-icon-btn gp-changes__${b}${H}`,"aria-label":r(v),disabled:f||E,...b==="refresh"?{"aria-busy":i}:{},onClick:()=>{d(),B()}},(0,Ue.createElement)("span",{"aria-hidden":!0},C)));return(0,Ue.createElement)("div",{className:"gp-toolbar gp-changes__toolbar",role:"group","aria-label":r("changes.actions")},[h("stage-all","changes.stageAll",(0,Ue.createElement)(ua,{size:16}),t.changes.length===0,e.onStageAll),h("unstage-all","changes.unstageAll",(0,Ue.createElement)(ga,{size:16}),t.staged===0,e.onUnstageAll),h("discard-picked","changes.discardPicked",(0,Ue.createElement)(Un,{size:16}),!e.hasDiscardTargets,e.onDiscard),h("discard-all","changes.discardAll",(0,Ue.createElement)(ha,{size:16}),t.modified===0&&t.untracked===0,e.onDiscardAll),h("stash","changes.stash",(0,Ue.createElement)(ur,{size:16}),t.staged===0&&t.modified===0,e.onStash),h("push",k,(0,Ue.createElement)(gn,{size:16}),g===null,x,"",c),h("refresh","changes.refresh",(0,Ue.createElement)(nn,{size:16}),!1,()=>void p(),i?" gp-changes__refresh--busy":""),l])}var bi=28,Oo=26,Il=8,Ol=600;function $o({remote:e,sessionId:t,visible:n=!0,snapshot:r,onAction:i,onRefresh:a,onSetFullChanges:o,compact:s,cramped:l,t:d}){let{queryVisible:p,queryKey:f}=lr(t,n,r.root),[g,k]=(0,y.useState)(new Set),[c,x]=(0,y.useState)(""),[h,b]=(0,y.useState)(!1),[v,C]=(0,y.useState)(!1),[E,B]=(0,y.useState)(!1),[H,F]=(0,y.useState)(!1),[ee,q]=(0,y.useState)(!1),[W,j]=(0,y.useState)(!1),[Q,te]=(0,y.useState)(!1),re=v||H||W||Q,[de,N]=(0,y.useState)(null),[se,ce]=(0,y.useState)(new Set),[ie,le]=(0,y.useState)(null),[D,M]=(0,y.useState)(!1),[V,O]=(0,y.useState)(!1),[z,Y]=(0,y.useState)(!1),{stashes:G,diffPath:S,diffData:R,expanded:oe,showDiff:ke}=Lo(e,t,r,p,()=>N(d("error.generic")),f),[Qe,dt]=(0,y.useState)(()=>r.defaultDiffView),[vt,rt]=(0,y.useState)(!1),[De,wt]=(0,y.useState)(!1),[it,Gt]=(0,y.useState)(!1),[gt,Ke]=(0,y.useState)(null),Ye=Mr(),[ft,at]=(0,y.useState)("list"),[ge,ve]=(0,y.useState)(!1),[ze,He]=(0,y.useState)(!0),[Ie,Ze]=(0,y.useState)(!1),[Je,ot]=(0,y.useState)(null),Ne=(0,y.useRef)(null),Me=(0,y.useRef)(null),xt=(0,y.useCallback)(T=>{Ne.current=T,T!==null&&l&&ge&&T.focus()},[l,ge]),{setEl:kt,viewport:Fe}=Pn(),{tipProps:Pt,tipNode:mt,hideTip:Ee,showTipNow:_t}=$t({placement:"above",maxWidth:300}),ae=(0,y.useMemo)(()=>r.changes.filter(T=>T.staged).sort(vi),[r]),et=(0,y.useMemo)(()=>r.changes.filter(T=>!T.staged&&T.status!=="untracked").sort(vi),[r]),tt=(0,y.useMemo)(()=>r.changes.filter(T=>T.status==="untracked").sort(vi),[r]),Rt=[{key:"staged",labelKey:"changes.groupStaged",items:ae},{key:"unstaged",labelKey:"changes.groupUnstaged",items:et},{key:"untracked",labelKey:"changes.groupUntracked",items:tt}],St={staged:r.stats.staged,unstaged:r.stats.modified,untracked:r.stats.untracked},zt=Rt.filter(T=>T.items.length>0||r.truncated&&St[T.key]>0),{items:Z,tops:X,totalH:he}=(0,y.useMemo)(()=>{let T=[];for(let ue of zt){let Le=r.truncated?St[ue.key]:ue.items.length;if(T.push({kind:"head",g:{key:ue.key,labelKey:ue.labelKey,count:Le,collapsible:ue.items.length>0},items:ue.items}),!se.has(ue.key))for(let Xe of ue.items)T.push({kind:"row",c:Xe})}let J=Mn(T.map(ue=>ue.kind==="head"?Oo:bi));return{items:T,tops:J,totalH:J[T.length]}},[ae,et,tt,se,r.truncated,r.stats]),je=Fe.height>0?Fe.height:Ol,{first:Ve,last:qe}=Gn(X,Fe.top,je,Il*bi);(0,y.useEffect)(()=>{Ee()},[Ve,qe,r,Ee]),(0,y.useEffect)(()=>{k(T=>{if(T.size===0)return T;let J=new Set(r.changes.map(Xe=>wn(Xe))),ue=new Set,Le=!1;for(let Xe of T)J.has(Xe)?ue.add(Xe):Le=!0;return Le?ue:T})},[r]),(0,y.useEffect)(()=>{if(!p||!ht.isVisible()||!h||vt||c.trim()!=="")return;let T=!0;return e.query({sessionId:t,query:{kind:"last-commit-message"}}).then(J=>{let ue=_e(J,"last-commit-message");T&&ue!==null&&(x(ue.message),rt(!0))}),()=>{T=!1}},[h,vt,c,e,t,p]),(0,y.useEffect)(()=>{S===null&&at("list")},[S]),(0,y.useEffect)(()=>{ft==="diff"&&ve(!1)},[ft]),(0,y.useEffect)(()=>{if(!l||!ge||typeof document>"u")return;let T=J=>{if(De)return;let ue=Me.current;ue!==null&&J.target instanceof Node&&ue.contains(J.target)||J.target instanceof Element&&J.target.closest(".gp-notice")!==null||ve(!1)};return document.addEventListener("pointerdown",T),()=>document.removeEventListener("pointerdown",T)},[l,ge,De]);let st=(0,y.useRef)(null),nt=(0,y.useRef)(!1);(0,y.useEffect)(()=>{let T=nt.current;nt.current=l&&ge,l&&T&&!ge&&st.current?.focus({preventScroll:!0})},[l,ge]),(0,y.useEffect)(()=>{le(null)},[r]),(0,y.useEffect)(()=>{Gt(!1)},[r]);let lt=(0,y.useMemo)(()=>Fo(g),[g]);(0,y.useEffect)(()=>{D&<.paths.length===0&&M(!1)},[D,lt]);let Jt=T=>{k(J=>{let ue=new Set(J);return ue.has(T)?ue.delete(T):ue.add(T),ue})},Yt=T=>{k(J=>Ho(J,T))},w=async T=>{if(re)return!1;C(!0),N(null),Ke(null);try{let J=await i(T);return J.ok?!0:(N(J.error??d("error.generic")),!1)}catch(J){return N(J instanceof Error?J.message:d("error.generic")),!1}finally{C(!1)}},Ce=async()=>{let T=c.trim();if(T===""&&!h){N(d("error.emptyMessage"));return}let J=g.size>0?[...new Set([...g].map(Le=>Br(Le)))]:void 0;await w({kind:"commit",message:T,...J?{paths:J}:{},...h?{amend:!0}:{}})&&(x(""),k(new Set),b(!1),rt(!1),ve(!1))},pe=async T=>{await w({kind:"stash-push",...T.trim()!==""?{message:T}:{}})&&Ze(!1)},Oe=(T,J)=>{w({kind:"stash-apply",index:T,sha:J})},Ht=(T,J)=>{w({kind:"stash-pop",index:T,sha:J})},Bt=async(T,J)=>{await w({kind:"stash-drop",index:T,sha:J})&&ot(null)},Lt=async()=>{let T=[...lt.paths];if(T.length===0){M(!1);return}await w({kind:"discard",paths:T})&&M(!1)},jt=async()=>{if(!Q){te(!0),N(null);try{await o(!0)}finally{te(!1)}}},I=async()=>{if(!Q){te(!0);try{await o(!1)}finally{te(!1)}}},Ge=async()=>{await w({kind:"discard-all"})&&O(!1)},we=(T,J)=>{switch(T){case"empty-diff":return d("error.emptyDiff");case"llm-unavailable":return d("error.llmUnavailable");case"suggest-disabled":return d("error.suggestDisabled");case"llm-error":case"llm-output":return J===void 0?d("error.llmFailed"):`${d("error.llmFailed")}: ${J}`;default:return J??d("error.generic")}},Be=async()=>{if(De)return;if(h&&!it&&c.trim()!==""){Gt(!0),N(null),Ke(d("commit.suggestOverwrite"));return}Gt(!1);let T=g.size>0?[...new Set([...g].map(J=>Br(J)))]:void 0;wt(!0),N(null),Ke(null);try{let J=await e.suggest({sessionId:t,...T&&T.length>0?{paths:T}:{}});J.ok?(x(J.value.message),J.value.truncated===!0&&Ke(d("commit.suggestTruncated")),Ne.current?.focus()):N(we(J.error.code,J.error.message))}catch(J){N(J instanceof Error?J.message:d("error.generic"))}finally{wt(!1)}},ye=T=>{ce(J=>{let ue=new Set(J);return ue.has(T)?ue.delete(T):ue.add(T),ue})},Re=R!==null&&R.text!==""?Ar(R.text):null,ct=bn({storageKey:"gp.changes.left",initial:380,min:220,reserve:200,edge:"end"}),Zt=(T,J)=>{ke(T,J),s&&at("diff")},en=s?["unified","before","after"]:["unified","split","before","after"],xn=s&&Qe==="split"?"unified":Qe,kn=c.trim(),nr=kn.split(`
|
|
912
|
+
`)[0]??"",On=re||De||kn==="",Xn=re||De||r.changes.length===0,Qr=(0,y.createElement)("div",{key:"box",className:"gp-commitbox",ref:Me},[(0,y.createElement)("div",{key:"msg",className:`gp-commitbox__msg-wrap${De?" gp-commitbox__msg-wrap--busy":""}`},[(0,y.createElement)("textarea",{key:"ta",className:"gp-commitbox__msg",placeholder:d("commit.placeholder"),value:c,ref:xt,readOnly:De,"aria-busy":De,onChange:T=>x(T.target.value)}),De?(0,y.createElement)("span",{key:"spin",className:"gp-commitbox__spin","aria-hidden":"true"},(0,y.createElement)(Xo.StateDot,{state:"ongoing",size:13})):null]),(0,y.createElement)("div",{key:"row",className:"gp-commitbox__row"},[(0,y.createElement)("label",{key:"amend",className:"gp-commitbox__amend"},[(0,y.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:h,disabled:De,onChange:()=>{b(T=>!T),rt(!1)}}),d("commit.amend")]),(0,y.createElement)("div",{key:"actions",className:"gp-commitbox__actions"},[r.suggestEnabled!==!1?(0,y.createElement)("button",{key:"suggest",type:"button",className:"gp-btn",disabled:Xn,onClick:()=>void Be(),title:d("commit.suggest")},[(0,y.createElement)(si,{key:"ic",size:13}),d(De?"commit.suggesting":"commit.suggest")]):null,(0,y.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary",disabled:On,onClick:()=>void Ce()},d("commit.commit")),l?(0,y.createElement)("button",{key:"fold",type:"button",className:"gp-icon-btn gp-commitbox__fold",disabled:De,title:d("commit.collapse"),"aria-label":d("commit.collapse"),onClick:()=>ve(!1)},(0,y.createElement)(qt,{key:"i",size:13,open:!0})):null])])]),Yr=!l||ge?Qr:(0,y.createElement)("div",{key:"box",className:"gp-commitbar"},[(0,y.createElement)("button",{key:"open",type:"button",className:"gp-commitbar__open",ref:st,title:d("commit.edit"),"aria-label":d("commit.edit"),onClick:()=>ve(!0)},kn===""?(0,y.createElement)("span",{key:"ph",className:"gp-commitbar__ph"},d("commit.placeholder")):(0,y.createElement)("span",{key:"draft",className:"gp-commitbar__draft"},nr)),r.suggestEnabled!==!1?(0,y.createElement)("button",{key:"ai",type:"button",className:"gp-btn gp-commitbar__ai",disabled:Xn,title:d("commit.suggest"),"aria-label":d("commit.suggest"),onClick:()=>{ve(!0),Be()}},[(0,y.createElement)(si,{key:"ic",size:13}),d("commit.ai")]):null,(0,y.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary gp-commitbar__commit",disabled:On,onClick:()=>void Ce()},d("commit.commit"))]),Zr=Fn(r)?(0,y.createElement)("div",{key:"publishbar",className:"gp-publishbar"},(0,y.createElement)("button",{type:"button",className:"gp-btn gp-btn--primary gp-publishbar__btn",disabled:re,title:d("commit.publishTitle"),onClick:()=>{Ee(),q(!0)}},[(0,y.createElement)(gn,{key:"ic",size:13}),d("commit.publish")])):null,$n=d("changes.untrackedCollapsed"),_n=d(r.truncatedReason==="lossy"?"changes.truncatedLossy":r.truncatedReason==="cap"?"changes.truncatedCap":"changes.truncatedUnknown",{n:r.changes.length}),rr=[(0,y.createElement)(Ao,{key:"stats",stats:r.stats,compact:s,showTimes:!l,t:d}),(0,y.createElement)(Io,{key:"toolbar",snapshot:r,busy:re,hasDiscardTargets:lt.paths.length>0,onStageAll:()=>void w({kind:"stage-all"}),onUnstageAll:()=>void w({kind:"unstage-all"}),onDiscard:()=>{N(null),M(!0)},onDiscardAll:()=>{N(null),O(!0)},onStash:()=>{N(null),Ze(!0)},onPush:()=>{Ee(),B(!0)},onPublish:()=>{Ee(),q(!0)},onRefresh:a,t:d}),de!==null?(0,y.createElement)("div",{key:"err",className:"gp-feedback gp-feedback--dismissible"},[(0,y.createElement)("span",{key:"txt",className:"gp-feedback__text"},de),(0,y.createElement)("button",{key:"close",type:"button",className:"gp-feedback__close",title:d("common.close"),"aria-label":d("common.close"),onClick:()=>N(null)},(0,y.createElement)(yt,{key:"i",size:12}))]):null,gt!==null?(0,y.createElement)(Wt,{key:"notice",text:gt,closeLabel:d("common.close"),onClose:()=>Ke(null)}):null,r.untrackedCollapsed===!0&&!Ye.isDismissed($n)?(0,y.createElement)(Wt,{key:"collapsed",status:!0,text:$n,closeLabel:d("common.close"),onClose:()=>Ye.dismiss($n)}):null,r.truncated&&!Ye.isDismissed(_n)?(0,y.createElement)(Wt,{key:"truncated",status:!0,text:_n,closeLabel:d("common.close"),onClose:()=>Ye.dismiss(_n)}):null,(0,y.createElement)("div",{key:"list",className:"gp-changes__list",ref:kt},r.changes.length===0?(0,y.createElement)("div",{className:"gp-empty"},d("changes.noChanges")):(0,y.createElement)("div",{className:"gp-changes__vlist",style:{height:he}},Z.slice(Ve,qe).map((T,J)=>{let ue=Ve+J;if(T.kind==="head"){let _=T.g,$=zo(g,T.items);return(0,y.createElement)("div",{key:`h:${_.key}`,className:"gp-changes__vrow",style:{top:X[ue],height:Oo}},(0,y.createElement)("div",{className:`gp-group-head${_.collapsible?"":" gp-group-head--static"}`,..._.collapsible?{onClick:()=>ye(_.key)}:{}},[_.collapsible?(0,y.createElement)(qt,{key:"chev",size:12,open:!se.has(_.key)}):(0,y.createElement)("span",{key:"chev",className:"gp-group-head__chev-spacer"}),T.items.length>0&&T.items.length>=_.count?(0,y.createElement)("span",{key:"pick",className:"gp-group-head__pick",onClick:be=>be.stopPropagation()},(0,y.createElement)("input",{type:"checkbox",className:"gp-check",checked:$==="all",ref:be=>{be!==null&&(be.indeterminate=$==="partial")},disabled:re,"aria-label":d("changes.selectAllGroup",{group:d(_.labelKey)}),onChange:()=>Yt(T.items)})):null,`${d(_.labelKey)} (${_.count})`]))}let Le=T.c,Xe=wn(Le),dn=Le.staged?"staged":"worktree";return(0,y.createElement)("div",{key:Xe,className:"gp-changes__vrow",style:{top:X[ue],height:bi}},Kl(Le,{selected:g.has(Xe),active:S?.path===Le.path&&S.base===dn,busy:re,armed:ie===Xe,onToggle:()=>Jt(Xe),onOpen:()=>Zt(Le.path,dn),onStage:()=>void w(Le.staged?{kind:"unstage",paths:[Le.path]}:{kind:"stage",paths:[Le.path]}),onDiscard:()=>{ie===Xe?(w({kind:"discard",paths:[Le.path]}),le(null)):le(Xe)},tipProps:Pt,hideTip:Ee,showTipNow:_t,t:d}))}))),r.truncated||z?(0,y.createElement)("div",{key:"expandbar",className:"gp-changes__expandbar"},[(0,y.createElement)("span",{key:"txt",className:"gp-changes__expandbar__text"},Q?d("changes.expanding"):z?d("changes.expandedAll",{n:r.changes.length}):d("changes.truncatedCap",{n:r.changes.length})),Q?null:(0,y.createElement)("button",{key:"btn",type:"button",className:"gp-btn gp-btn--sm",disabled:re,onClick:()=>{let T=!z;(T?jt():I()).then(()=>Y(T))}},d(z?"changes.collapseList":"changes.expandAll"))]):null,G.length>0?(0,y.createElement)("div",{key:"stashes",className:"gp-stash"},[(0,y.createElement)("div",{key:"head",className:"gp-group-head",onClick:()=>He(T=>!T)},[(0,y.createElement)(qt,{key:"chev",size:12,open:!ze}),`${d("stash.section")} (${G.length})`]),ze?null:(0,y.createElement)("div",{key:"items"},G.map(T=>$l(T,{busy:re,onApply:()=>Oe(T.index,T.sha),onPop:()=>Ht(T.index,T.sha),onDrop:()=>{N(null),ot(T)},t:d})))]):null,Zr,Yr],ir=S===null?(0,y.createElement)("div",{className:"gp-empty"},d("changes.selectFile")):(0,y.createElement)("div",{className:"gp-diff"},[(0,y.createElement)("div",{key:"tb",className:`gp-diff__toolbar${s?" gp-diff__toolbar--compact":""}`},(()=>{let T=s?(0,y.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>at("list")},[(0,y.createElement)(Tn,{key:"i",size:14}),d("changes.backToList")]):null,J=(0,y.createElement)("span",{key:"path",className:"gp-diff__path"},S.path),ue=Re?(0,y.createElement)("span",{key:"sum",className:"gp-stats__item",style:{marginLeft:"auto"}},[(0,y.createElement)("span",{key:"a",className:"gp-stats__add"},`+${Re.add}`)," ",(0,y.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${Re.del}`)]):null,Le=(0,y.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${oe?" gp-seg__btn--active":""}`,style:Re||s?{}:{marginLeft:"auto"},disabled:xn!=="split"&&xn!=="unified",title:d(oe?"diff.collapse":"diff.expandAll"),onClick:()=>void ke(S.path,S.base,!oe)},d(oe?"diff.collapse":"diff.expandAll")),Xe=(0,y.createElement)("div",{key:"seg",className:"gp-seg"},Qt(en,xn,dt,dn=>d(`diff.${dn}`)));return s?[(0,y.createElement)("div",{key:"row1",className:"gp-diff__toolbar-row"},[T,J,ue]),(0,y.createElement)("div",{key:"row2",className:"gp-diff__toolbar-row gp-diff__toolbar-row--controls"},[Le,Xe])]:[T,J,ue,Le,Xe]})()),R===null?(0,y.createElement)("div",{key:"scroll",className:"gp-diff__scroll"},(0,y.createElement)("div",{className:"gp-empty"},d("common.loading"))):(0,y.createElement)(Lr,{key:"diff",visible:p,text:R.text,mode:xn,path:S.path,remote:e,sessionId:t,base:S.base,expanded:oe,truncated:R.truncated===!0,newLines:R.newLines,t:d})]),ar=[E?(0,y.createElement)(Fr,{key:"remote-push",remote:e,sessionId:t,snapshot:r,onAction:i,onClose:()=>B(!1),onBusyChange:F,t:d}):null,ee?(0,y.createElement)(zr,{key:"remote-publish",snapshot:r,onAction:i,onClose:()=>q(!1),onBusyChange:j,t:d}):null,Ie?(0,y.createElement)(Xl,{key:"push",onClose:()=>Ze(!1),onStash:pe,error:de,t:d}):null,Je!==null?pt({title:d("stash.dropTitle"),body:d("stash.dropConfirm",{name:Je.message}),confirmLabel:d("stash.drop"),danger:!0,error:de,onConfirm:()=>void Bt(Je.index,Je.sha),onClose:()=>ot(null),t:d}):null,D&<.paths.length>0?(0,y.createElement)(Bo,{key:"discard-picked",paths:lt.paths,stagedOnly:lt.stagedOnly,snapshot:r,busy:re,error:de,onConfirm:()=>void Lt(),onClose:()=>M(!1),t:d}):null,V?pt({title:d("changes.discardAllTitle"),body:d("changes.discardAllBody",{count:r.stats.modified+r.stats.untracked}),extra:(()=>{let T=[];return r.stats.untracked>0&&T.push((0,y.createElement)("div",{key:"untracked",className:"gp-modal__confirmtext"},d("changes.discardAllUntracked",{count:r.stats.untracked}))),r.stats.staged>0&&T.push((0,y.createElement)("div",{key:"staged",className:"gp-modal__confirmtext"},d("changes.discardAllStaged",{count:r.stats.staged}))),T.length>0?(0,y.createElement)("div",{key:"notes"},T):null})(),confirmLabel:d("changes.discard"),danger:!0,error:de,confirmBusy:re,busyLabel:d("changes.discarding"),onConfirm:()=>void Ge(),onClose:()=>O(!1),t:d}):null];return s?(0,y.createElement)("div",{className:"gp-changes gp-changes--compact"},[...ar,mt,ft==="diff"?(0,y.createElement)("div",{key:"right",className:"gp-changes__right"},ir):(0,y.createElement)("div",{key:"left",className:"gp-changes__left"},rr)]):(0,y.createElement)("div",{className:"gp-changes"},[...ar,mt,(0,y.createElement)("div",{key:"left",className:"gp-changes__left",style:{flex:`0 0 ${ct.width}px`}},rr),ct.divider,(0,y.createElement)("div",{key:"right",className:"gp-changes__right"},ir)])}function Xl({onClose:e,onStash:t,error:n,t:r}){let[i,a]=(0,y.useState)("");return Xt({onClose:e,title:r("stash.title"),icon:(0,y.createElement)(ur,{size:15}),portalKey:"stash-push-modal",t:r,body:[(0,y.createElement)("input",{key:"msg",className:"gp-input",placeholder:r("stash.messagePlaceholder"),value:i,autoFocus:!0,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&t(i)}}),Ln(r),n!==null?(0,y.createElement)("div",{key:"err",className:"gp-feedback"},n):null],footer:An({onClose:e,onConfirm:()=>void t(i),confirmLabel:r("stash.save"),confirmDisabled:!1,danger:!1,t:r})})}function $l(e,t){return(0,y.createElement)("div",{key:e.index,className:"gp-stash-row"},[(0,y.createElement)("div",{key:"info",className:"gp-stash-row__info"},[(0,y.createElement)("span",{key:"m",className:"gp-stash-row__msg",title:e.message},e.message),(0,y.createElement)("span",{key:"meta",className:"gp-stash-row__meta"},[e.branch!==null?(0,y.createElement)("span",{key:"b"},t.t("stash.onBranch",{branch:e.branch})):null,e.relTime!==""?(0,y.createElement)("span",{key:"t"},e.relTime):null])]),(0,y.createElement)("div",{key:"act",className:"gp-stash-row__actions"},[(0,y.createElement)("button",{key:"apply",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onApply},t.t("stash.apply")),(0,y.createElement)("button",{key:"pop",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onPop},t.t("stash.pop")),(0,y.createElement)("button",{key:"drop",type:"button",className:"gp-icon-btn",disabled:t.busy,title:t.t("stash.drop"),onClick:t.onDrop},(0,y.createElement)(Un,{size:14}))])])}function vi(e,t){return e.path.localeCompare(t.path)}function Kl(e,t){let n=e.path.split("/").pop()??e.path,r=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,y.createElement)("div",{key:wn(e),className:`gp-file-row${t.active?" gp-file-row--active":""}`,onClick:t.onOpen},[(0,y.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:t.selected,disabled:t.busy,onClick:i=>i.stopPropagation(),onChange:t.onToggle}),(0,y.createElement)("span",{key:"st",className:`gp-status-badge ${Nn(e.status)}`},vr[e.status]??"?"),(0,y.createElement)("span",{key:"nm",className:"gp-tree-name",title:e.path},[n,r?(0,y.createElement)("span",{key:"d",style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6,fontSize:11}},r):null]),(0,y.createElement)("span",{key:"act",className:"gp-file-row__actions"},[(0,y.createElement)(Kt,{key:"stg",tipProps:t.tipProps(e.staged?t.t("changes.unstageTip"):t.t("changes.stageTip"))},(0,y.createElement)("button",{type:"button",className:"gp-icon-btn","aria-label":e.staged?t.t("changes.unstage"):t.t("changes.stage"),disabled:t.busy,onClick:i=>{i.stopPropagation(),t.hideTip(),t.onStage()}},e.staged?"\u2212":"+")),e.staged?null:(0,y.createElement)(Kt,{key:"dis",tipProps:t.tipProps(t.armed?t.t("changes.discardTipArmed"):t.t("changes.discardTip"))},(0,y.createElement)("button",{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,onClick:i=>{if(i.stopPropagation(),t.armed){t.hideTip(),t.onDiscard();return}t.onDiscard(),t.showTipNow(i.currentTarget,t.t("changes.discardTipArmed"))}},(0,y.createElement)("span",{"aria-hidden":!0},(0,y.createElement)(Un,{size:14}))))])])}var m=require("react");var We=require("@deepseek-ai/dsh-client-ui-primitives");var me=require("react");function er(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 Jl={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 Ko(e){return Jl[e]??jl(e)}function jl(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Hn=require("@deepseek-ai/dsh-client-ui-primitives");function Vl(e,t){let n=ql(e.path);if(e.kind==="binary")return t("files.propsTypeBinary");let r=Wn(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 i=(0,Hn.languageForPath)(e.path),o=i!==void 0&&i!==""?Ko(i):e.kind==="tooLarge"?t("files.propsTypeUnread"):t("files.propsTypeText");return n===""?o:t("files.propsTypeFmt",{label:o,ext:n})}function ql(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n+1):""}function sn(e,t,n){return{label:e,value:typeof t=="string"?(0,me.createElement)("span",{},t):t,key:n}}function wi(e,t,n){return(0,me.createElement)("div",{key:n,className:"gp-props__group"},[e!==null?(0,me.createElement)("div",{key:"t",className:"gp-props__group-title"},e):null,...t.map(r=>(0,me.createElement)("div",{key:r.key,className:"gp-props__row"},[(0,me.createElement)("span",{key:"l",className:"gp-props__label"},r.label),(0,me.createElement)("span",{key:"v",className:"gp-props__value"},r.value)]))])}function Jo(e,t,n){return(0,me.createElement)("button",{type:"button",className:"gp-props__copy",title:t,"aria-label":t,onClick:n},(0,me.createElement)("code",{className:"gp-props__mono"},e))}function Ul(e,t,n){let r=[],i=e.filter(a=>a.path===t&&!a.isDirectory);i.some(a=>a.staged)&&r.push((0,me.createElement)("span",{key:"staged",className:"gp-props__badge gp-status--added"},n("files.propsStaged")));for(let a of i)a.staged||a.status==="untracked"||r.push((0,me.createElement)("span",{key:a.status,className:`gp-props__badge ${Nn(a.status)}`},Wl(a.status,n)));return r}function Wl(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 jo({input:e,snapshot:t,onClose:n,t:r}){let[i,a]=(0,me.useState)(null);(0,me.useEffect)(()=>{if(e.kind!=="image"||e.dataUrl===void 0)return;let v=!0,C=new Image;return C.onload=()=>{v&&a({w:C.naturalWidth,h:C.naturalHeight})},C.src=e.dataUrl,()=>{v=!1}},[e.kind,e.dataUrl]);let[o,s]=(0,me.useState)(null),l=(0,me.useRef)(void 0);(0,me.useEffect)(()=>{s(null)},[e.path]),(0,me.useEffect)(()=>()=>{l.current!==void 0&&clearTimeout(l.current)},[]);let d=v=>{(0,Hn.writeClipboard)(v).then(C=>{s(C?"copied":"error"),l.current!==void 0&&clearTimeout(l.current),l.current=setTimeout(()=>s(null),1600)})},p=e.path.lastIndexOf("/"),f=p<0?e.path:e.path.slice(p+1),g=[sn(r("files.propsName"),(0,me.createElement)("span",{className:"gp-props__strong"},f),"name"),sn(r("files.propsType"),Vl(e,r),"type"),sn(r("files.propsRelPath"),Jo(e.path,r("files.propsCopyHint"),()=>d(e.path)),"rel")];if(t!==null){let v=`${t.root}/${e.path}`;g.push(sn(r("files.propsAbsPath"),Jo(v,r("files.propsCopyHint"),()=>d(v)),"abs"))}let k=[];if(e.size!==void 0){let v=e.size>=1024?(0,me.createElement)("span",{},[(0,me.createElement)("span",{key:"h",className:"gp-props__strong"},er(e.size)),(0,me.createElement)("span",{key:"b",className:"gp-props__sub"},r("files.propsSizeBytes",{bytes:e.size.toLocaleString("en-US")}))]):(0,me.createElement)("span",{className:"gp-props__strong"},er(e.size));k.push(sn(r("files.propsSize"),v,"size"))}e.kind==="text"&&e.lines!==void 0&&k.push(sn(r("files.propsLines"),(0,me.createElement)("span",{className:"gp-props__strong"},String(e.lines)),"lines")),i!==null&&k.push(sn(r("files.propsImageSize"),(0,me.createElement)("span",{className:"gp-props__strong"},r("files.propsImageSizeFmt",i)),"dims"));let c=[];e.mtimeMs!==void 0&&c.push(sn(r("files.propsMtime"),(0,me.createElement)("span",{title:rn(e.mtimeMs,Date.now(),r)},Yn(e.mtimeMs)),"mtime"));let x=[wi(null,g,"g-basic"),k.length>0?wi(r("files.propsGroupStats"),k,"g-stats"):null,c.length>0?wi(r("files.propsGroupTime"),c,"g-time"):null],h=[];t!==null&&(h.push(e.ignored?(0,me.createElement)("span",{key:"ig",className:"gp-props__badge gp-props__badge--muted"},r("files.ignored")):Ba(t.changes,e.path)?(0,me.createElement)("span",{key:"un",className:"gp-props__badge gp-props__badge--muted"},r("files.propsUntracked")):(0,me.createElement)("span",{key:"tr",className:"gp-props__badge gp-props__badge--ok"},r("files.propsTrackedYes"))),h.push(...Ul(t.changes,e.path,r)));let b=(0,me.createElement)("div",{key:"status",className:"gp-modal__footer gp-props__statusbar","aria-live":"polite"},[h.length>0?(0,me.createElement)("span",{key:"chips",className:"gp-props__footer-chips"},h):null,o!==null?(0,me.createElement)("span",{key:"fb",className:`gp-props__copied${o==="error"?" gp-props__copied--err":""}`},r(o==="copied"?"files.pathCopied":"files.pathCopyFailed")):null]);return Xt({onClose:n,title:r("files.propsTitle"),icon:(0,me.createElement)(Hn.FileTypeIcon,{path:e.path,size:15}),body:x,footer:b,portalKey:"file-props",t:r})}function xi(e){return e.kind!=="text"?!1:e.size!==void 0?e.size<hr:new TextEncoder().encode(e.content??"").length<hr}function Vo(e){return e.startsWith("/")||/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")}function Ql(e){let t=e.replace(/[/\\]+$/,""),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"))+1;return t.slice(0,n)}function Yl(e,t){if(!(!/^https?:/.test(e)&&!e.startsWith("dsh-app://app/"))&&Vo(t)&&!/^[/\\]{2}/.test(t)&&!/[\x00-\x1f\x7f]/.test(t))return new URL(`api/file?path=${encodeURIComponent(t)}`,e).href}function Zl(e,t,n){let r=n.search(/[?#]/),i;try{i=decodeURIComponent(r===-1?n:n.slice(0,r))}catch{return}if(i.length!==0&&!(!/^[a-z]:[/\\]/i.test(i)&&/^[a-z][a-z\d+.-]*:/i.test(i))){if(!Vo(i)){if(t===void 0)return;i=Ql(t)+i}return Yl(e,i)}}function qo(e,t){return{resolve:n=>Zl(e,t,n)}}function _i(e){let t=e.endsWith("\r")?e.slice(0,-1):e,n=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(t);if(n===null)return null;let r=n[1][0],i=n[2].trim();return r==="`"&&i.includes("`")?null:{marker:r,length:n[1].length,info:i}}function ki(e,t){let n=_i(e);return n!==null&&n.marker===t.marker&&n.length>=t.length&&n.info===""}function ed(e){return/^mermaid(\s|$)/i.test(e)}function Uo(e){let t=e.split(`
|
|
913
|
+
`),n=[],r=[],i=null,a=null,o=!1,s=()=>{if(r.length===0)return;let l=r.join(`
|
|
914
|
+
`);r=[],l!==""&&n.push({kind:"markdown",text:l})};for(let l of t){if(i!==null&&a!==null){ki(l,a)?(n.push({kind:"mermaid",source:i.join(`
|
|
915
|
+
`)}),i=null,a=null):i.push(l);continue}if(a!==null){r.push(l),ki(l,a)&&(a=null);continue}let d=_i(l);if(d!==null&&ed(d.info)){s(),o=!0,i=[],a=d;continue}r.push(l),d!==null&&(a=d)}return i!==null&&n.push({kind:"mermaid",source:i.join(`
|
|
916
|
+
`)}),s(),o?n:[{kind:"markdown",text:e}]}function Wo(e){let t=e.split(`
|
|
917
|
+
`),n=null;return t.map(r=>{if(n!==null)return ki(r,n)&&(n=null),r;let i=_i(r);return i!==null?(n=i,r):td(r)}).join(`
|
|
918
|
+
`)}function td(e){let t=/(`+)[\s\S]*?\1/g,n=/<kbd>([\s\S]*?)<\/kbd>/gi,r=(s,l)=>nd(l),i="",a=0,o;for(;(o=t.exec(e))!==null;)i+=e.slice(a,o.index).replace(n,r),i+=o[0],a=o.index+o[0].length;return i+e.slice(a).replace(n,r)}function nd(e){let t=0;for(let i of e.match(/`+/g)??[])t=Math.max(t,i.length);let n="`".repeat(t+1),r=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${r}${e}${r}${n}`}var Si="dsh-html-ready";function Yo(e){let t=0,n=/<script\b[^>]*>/gi,r;for(;(r=n.exec(e))!==null;){let i=r[0];if(/\bsrc\s*=/i.test(i))continue;let a=/\btype\s*=\s*["']?([^"'\s>]+)/i.exec(i)?.[1]?.toLowerCase();if(a!==void 0&&a!==""&&a!=="module"&&a!=="text/javascript"&&a!=="application/javascript")continue;let o=e.indexOf("<\/script",r.index+i.length);if(o===-1)break;t+=o-(r.index+i.length),n.lastIndex=o}return t}function Zo(e){return`${e}<script>addEventListener("load",function(){requestAnimationFrame(function(){requestAnimationFrame(function(){try{parent.postMessage("${Si}","*")}catch(e){}})})})<\/script>`}var rd="default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; media-src data:; connect-src 'none'; frame-src 'none'; form-action 'none'; base-uri 'none'";function es(e){let t=`<meta http-equiv="Content-Security-Policy" content="${rd}">`,n=/<head(?:\s[^>]*)?>/i.exec(e);if(n!==null&&!Qo(e,n.index)){let o=n.index+n[0].length;return e.slice(0,o)+t+e.slice(o)}let r=/<html(?:\s[^>]*)?>/i.exec(e);if(r!==null&&!Qo(e,r.index)){let o=r.index+r[0].length;return e.slice(0,o)+`<head>${t}</head>`+e.slice(o)}let i=/^\s*<!doctype[^>]*>/i.exec(e),a=i===null?0:i[0].length;return e.slice(0,a)+t+e.slice(a)}function Qo(e,t){let n=e.slice(0,t).toLowerCase();if(n.lastIndexOf("<!--")>n.lastIndexOf("-->"))return!0;let r=n.lastIndexOf("<script");return r===-1?!1:n.indexOf("<\/script",r)===-1}function id(e){return e.length>0&&!/^(?:[a-z][a-z\d+.-]*:|[/\\#?])/i.test(e)&&!e.includes("\0")}function ad(e,t){let n=t.search(/[?#]/),r;try{r=decodeURIComponent(n===-1?t:t.slice(0,n))}catch{return}if(r.length===0||r.includes("\0")||r.includes("\\")||/^(?:[a-z][a-z\d+.-]*:|[/\\])/i.test(r))return;let i=e.lastIndexOf("/"),a=i<0?"":e.slice(0,i+1),o=[];for(let s of(a+r).split("/"))if(!(s===""||s===".")){if(s===".."){if(o.length===0)return;o.pop();continue}o.push(s)}return o.join("/")}async function od(e,t,n,r){if(e.length>64)return null;let i=r,a=[];for(let o of e){let s=ad(t,o.reference);if(s===void 0)return null;let l=await n(s);if(l===null)return null;let d=new TextEncoder().encode(l).byteLength;if(d>4194304||(i+=d,i>33554432))return null;a.push({kind:o.kind,reference:o.reference,text:l})}return a}function sd(e){let t=new TextEncoder().encode(e),n=[];for(let r=0;r<t.length;r+=32768)n.push(String.fromCharCode(...t.subarray(r,r+32768)));return btoa(n.join(""))}function ts(e){return(/<body[^>]*>([\s\S]*)<\/body>/i.exec(e)?.[1]??e).replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<template[\s\S]*?<\/template>/gi," ").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim().length<200}function ld(e,t){return`data:${e==="script"?"text/javascript":"text/css"};base64,${sd(t)}`}function dd(e){if(e.querySelector("base[href]")!==null)return"skip";let t=[],n=new Map;for(let r of e.querySelectorAll("script[src], link[href]")){let i=r.localName==="script",a=r.getAttribute("type")?.trim().toLowerCase()??"";if(i&&!["","text/javascript","application/javascript"].includes(a)||!i&&!(r.getAttribute("rel")??"").toLowerCase().split(/\s+/).includes("stylesheet"))continue;let o=r.getAttribute(i?"src":"href")??"",s=o.search(/[?#]/),l=s===-1?o:o.slice(0,s);if(!id(o)||!(i?/\.js$/i:/\.css$/i).test(l))continue;let d=`${i?"script":"stylesheet"}:${o}`,p=n.get(d);if(p!==void 0){t[p].elements.push(r);continue}if(t.length>=64)return"skip";n.set(d,t.length),t.push({ref:{kind:i?"script":"stylesheet",reference:o},elements:[r]})}return t}function cd(e){return/\s(?:src|href)\s*=/i.test(e)}async function ns(e,t,n){if(typeof DOMParser>"u")return null;let r=new TextEncoder().encode(e).byteLength;if(r>=2097152||!cd(e))return null;let i=new DOMParser().parseFromString(e,"text/html"),a=dd(i);if(a==="skip"||a.length===0)return null;let o=await od(a.map(s=>s.ref),t,n,r);if(o===null)return null;for(let s=0;s<o.length;s+=1){let l=o[s],d=l.kind==="script"?"src":"href",p=ld(l.kind,l.text);for(let f of a[s].elements)f.setAttribute(d,p)}return`<!doctype html>${i.documentElement.outerHTML}`}function pd(e){let t=e.trim().toLowerCase(),n=t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t;return n==="localhost"||n==="::1"?!0:/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)}function rs(e,t=!0){return t&&pd(e)}function Ir(e){return e?{inert:""}:{}}var Te=require("react"),is=require("@deepseek-ai/dsh-client-ui-primitives");function ud(e){return e.kind==="interactive"?{sandbox:"allow-scripts",masked:!0}:{sandbox:"",masked:!1}}var gd=4e3,fd=1500,md=2e4,hd=1e3;function as(e){let{frame:t,title:n,t:r,onStop:i}=e,{sandbox:a,masked:o}=ud(t),[s,l]=(0,Te.useState)(o?"loading":"ready"),d=(0,Te.useRef)(null),p=(0,Te.useRef)(null),[f,g]=(0,Te.useState)(""),[k,c]=(0,Te.useState)(0),x=(0,Te.useRef)(null),h=(0,Te.useCallback)(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null),l("ready")},[]);(0,Te.useEffect)(()=>{if(!o)return;let v=setTimeout(()=>l(E=>E==="ready"?E:"slow"),gd),C=setTimeout(h,md);return()=>{clearTimeout(v),clearTimeout(C)}},[o,h]),(0,Te.useEffect)(()=>{if(!o){x.current=null;return}x.current===null&&(x.current=Date.now());let v=x.current,C=setInterval(()=>c(Math.floor((Date.now()-v)/1e3)),hd);return()=>clearInterval(C)},[o]),(0,Te.useEffect)(()=>{if(!o||s==="ready"){g("");return}let v=r(s==="slow"?"files.htmlRenderingSlow":"files.htmlRendering"),C=requestAnimationFrame(()=>g(v));return()=>cancelAnimationFrame(C)},[o,s,r]),(0,Te.useEffect)(()=>{if(!o)return;let v=C=>{let E=d.current?.contentWindow;E==null||C.source!==E||C.data===Si&&h()};return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[o,h]),(0,Te.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]);let b=(0,Te.useCallback)(()=>{p.current!==null&&clearTimeout(p.current),p.current=setTimeout(h,fd)},[h]);return(0,Te.createElement)("div",{className:"gp-files__html-stage"},[(0,Te.createElement)("iframe",{key:"frame",ref:d,className:"gp-files__html",title:n,sandbox:a,...t.kind==="interactive"?{src:t.src}:{srcDoc:t.srcdoc},referrerPolicy:"no-referrer",...o?{onLoad:b,...Ir(s!=="ready")}:{}}),o?(0,Te.createElement)("div",{key:"mask",className:"gp-files__html-mask","data-state":s,...s==="ready"?{"aria-hidden":"true"}:{}},[(0,Te.createElement)("span",{key:"spin",className:"gp-files__html-mask-spin"},(0,Te.createElement)(is.StateDot,{state:"ongoing",size:20})),(0,Te.createElement)("span",{key:"label",className:"gp-files__html-mask-label",role:"status"},f),s==="slow"?(0,Te.createElement)("span",{key:"elapsed",className:"gp-files__html-mask-elapsed"},r("files.htmlRenderingSeconds",{seconds:k})):null,s==="slow"&&i!==void 0?(0,Te.createElement)("button",{key:"stop",type:"button",className:"gp-files__html-mask-stop",onClick:i},r("files.htmlStopRendering")):null]):null])}var Mt=require("react"),yd=require.async,Ci;function bd(){return Ci??=yd("./client.mermaid.js").then(e=>e,e=>{throw Ci=void 0,e}),Ci}function os(){return typeof document<"u"&&document.body.hasAttribute("data-ds-dark-theme")?"dark":"default"}function ss({source:e,t}){let[n,r]=(0,Mt.useState)(null),[i,a]=(0,Mt.useState)(!1),[o,s]=(0,Mt.useState)(os);return(0,Mt.useEffect)(()=>{if(typeof MutationObserver>"u"||typeof document>"u")return;let l=new MutationObserver(()=>s(os()));return l.observe(document.body,{attributes:!0,attributeFilter:["data-ds-dark-theme"]}),()=>l.disconnect()},[]),(0,Mt.useEffect)(()=>{let l=!0;return r(null),a(!1),bd().then(d=>d.renderMermaid(e,o)).then(d=>{l&&r(d)}).catch(()=>{l&&a(!0)}),()=>{l=!1}},[e,o]),n!==null?(0,Mt.createElement)("div",{className:"gp-mermaid","data-mermaid":"",dangerouslySetInnerHTML:{__html:n}}):i?(0,Mt.createElement)("pre",{className:"gp-mermaid__fallback","data-mermaid-fallback":""},(0,Mt.createElement)("code",null,e)):(0,Mt.createElement)("div",{className:"gp-mermaid gp-mermaid--loading","data-mermaid":"loading",role:"status"},(0,Mt.createElement)("span",{className:"gp-mermaid__loading-text"},t("files.mermaidLoading")))}function ps(e){return/\.(?:md|markdown)$/i.test(e)}function ln(e){return/\.(?:html?|xhtml)$/i.test(e)}function wd(e){return ps(e)||ln(e)}var xd=256*1024,kd=5e3,ls=5e3,Or=20,ds=12,_d=600,Sd=2e3,Cd=1024*1024;function us(e,t){return t<=Sd&&e.length<=Cd}var Ni=6e4,Bn=new Map,Ti=new Map;function Td(e,t){let n=t.file.kind==="loading"?{kind:"idle"}:t.file;Bn.set(e,{state:{...t,file:n},leftAt:Date.now()});let r=Ti.get(e);r!==void 0&&clearTimeout(r),Ti.set(e,setTimeout(()=>{Ti.delete(e);let i=Bn.get(e);i!==void 0&&Date.now()-i.leftAt>=Ni&&Bn.delete(e)},Ni+1e3))}function Ed(e){let t=Bn.get(e);return t===void 0?null:Date.now()-t.leftAt>Ni?(Bn.delete(e),null):t.state}function Mi({remote:e,sessionId:t,compact:n,worktreeGen:r,snapshot:i,t:a}){let o=(0,m.useRef)(void 0);o.current===void 0&&(o.current=Ed(t));let s=o.current,[l,d]=(0,m.useState)(()=>s?.dirs??new Map),[p,f]=(0,m.useState)(()=>s?.open??new Set([""])),[g,k]=(0,m.useState)(()=>s?.selected??null),[c,x]=(0,m.useState)(()=>s?.file??{kind:"idle"}),[h,b]=(0,m.useState)(()=>s?.renderMarkdown??!0),[v,C]=(0,m.useState)(!0),[E,B]=(0,m.useState)(()=>s?.wrap??!0),[H,F]=(0,m.useState)("idle"),[ee,q]=(0,m.useState)("idle"),[W,j]=(0,m.useState)(!1),[Q,te]=(0,m.useState)(!1),[re,de]=(0,m.useState)(!1),N=(0,m.useRef)(null),se=(0,m.useRef)(null),ce=(0,m.useRef)(null),[ie,le]=(0,m.useState)(()=>s?.pane??"tree"),[D,M]=(0,m.useState)(!1),V=(0,m.useRef)(!1),O=(0,m.useRef)(0),z=(0,m.useRef)(new Map),Y=(0,m.useId)(),G=(0,m.useMemo)(()=>({code:{copyLabel:a("files.copy"),copiedLabel:a("files.copied")},footnotes:a("files.footnotes")}),[a]),S=(0,m.useMemo)(()=>c.kind==="text"&&c.absolutePath!==void 0?qo(document.baseURI,c.absolutePath):void 0,[c]),R=(0,m.useMemo)(()=>{if(c.kind==="text")return Uo(c.content).map(I=>I.kind==="mermaid"?I:{kind:"markdown",text:Wo(I.text)})},[c]),oe=(0,m.useRef)(0),ke=v?"interactive":"static",Qe=(0,m.useMemo)(()=>c.kind!=="text"||!ln(c.path)?0:Yo(c.content),[c]),dt=Qe>=524288,[vt,rt]=(0,m.useState)(null),De=(0,m.useMemo)(()=>rs(typeof location>"u"?"":location.hostname),[]),[wt,it]=(0,m.useState)({busy:!1,error:null}),Gt=(0,m.useCallback)(async()=>{if(c.kind!=="text")return;if(it({busy:!0,error:null}),(await e.openFile({sessionId:t,path:c.path})).ok){it({busy:!1,error:null}),b(!1);return}it({busy:!1,error:a("files.htmlOpenFailed")})},[c,e,t,a]),gt=c.kind==="idle"?null:c.path,Ke=dt&&h&&ke==="interactive"&>!==null&&vt!==gt,[Ye,ft]=(0,m.useState)(null),[at,ge]=(0,m.useState)({status:"idle"});(0,m.useEffect)(()=>{if(c.kind!=="text"||!ln(c.path)||!h||ke!=="interactive"||Ke||Ye===c.path){ge(we=>we.status==="idle"?we:{status:"idle"});return}let I=!1;ge({status:"loading",file:c});let Ge=async we=>{let Be=await e.query({sessionId:t,query:{kind:"file-content",path:we}}),ye=_e(Be,"file-content");return ye===null||ye.variant!=="text"||ye.content===void 0||ye.tooLarge===!0?null:ye.content};return ns(c.content,c.path,Ge).then(we=>{I||ge(we===null?{status:"plain",file:c}:{status:"ready",file:c,srcdoc:we})}).catch(()=>{I||ge({status:"plain",file:c})}),()=>{I=!0}},[c,h,ke,e,t,Ke,Ye]);let ve=(0,m.useMemo)(()=>{if(!(c.kind!=="text"||!ln(c.path)||!h||ke!=="interactive")&&!(at.status==="idle"||at.file!==c))return at.status==="ready"?at.srcdoc:at.status==="plain"?c.content:void 0},[c,h,ke,at]),[ze,He]=(0,m.useState)(void 0);(0,m.useEffect)(()=>{if(ve===void 0){He(void 0);return}let I=URL.createObjectURL(new Blob([Zo(ve)],{type:"text/html"}));return He({doc:ve,url:I}),()=>{URL.revokeObjectURL(I)}},[ve]);let Ie=(0,m.useMemo)(()=>{if(!(c.kind!=="text"||!ln(c.path)||!h)){if(ke==="static")return{kind:"static",srcdoc:es(c.content)};if(!(Ke||Ye===c.path))return ze!==void 0&&ze.doc===ve?{kind:"interactive",src:ze.url}:null}},[c,h,ke,ze,ve,Ke,Ye]),Ze=(0,m.useMemo)(()=>ke==="static"&&c.kind==="text"&&ln(c.path)&&h&&ts(c.content),[c,h,ke]),Je=(0,m.useMemo)(()=>!Ze||Ie?.kind!=="static"?void 0:{run:()=>C(!0)},[Ze,Ie]),ot=(0,m.useCallback)(()=>{c.kind==="text"&&(ft(c.path),b(!1))},[c]),Ne=Ie?.kind==="interactive"?ot:void 0;(0,m.useEffect)(()=>{let I=()=>de(document.fullscreenElement===N.current);return document.addEventListener("fullscreenchange",I),()=>document.removeEventListener("fullscreenchange",I)},[]);let Me=(0,m.useCallback)(()=>{document.fullscreenElement!==null&&document.fullscreenElement===N.current&&document.exitFullscreen().catch(()=>{}),te(!1)},[]),xt=(0,m.useCallback)(()=>{let I=N.current;if(I!==null){if(document.fullscreenElement===I){document.exitFullscreen().catch(()=>{});return}I.requestFullscreen().catch(Ge=>{console.warn("git-panel: full screen was refused",Ge)})}},[]),kt=bn({storageKey:"gp.files.left",initial:300,min:180,reserve:220,edge:"end"}),Fe=(0,m.useCallback)((I,Ge=!1)=>{let we=O.current,Be=(z.current.get(I)??0)+1;z.current.set(I,Be);let ye=()=>we===O.current&&z.current.get(I)===Be;return d(Re=>{let ct=Re.get(I);if(ct!==void 0&&(Ge?ct.status==="ready":ct.status!=="error"))return Re;let Zt=new Map(Re);return Zt.set(I,{status:"loading"}),Zt}),e.query({sessionId:t,query:{kind:"dir-list",path:I}}).then(Re=>{if(!ye())return;let ct=_e(Re,"dir-list");d(Zt=>{let en=new Map(Zt);return en.set(I,ct===null?{status:"error"}:{status:"ready",entries:ct.entries,truncated:ct.truncated}),en})}).catch(()=>{ye()&&d(Re=>{let ct=new Map(Re);return ct.set(I,{status:"error"}),ct})})},[e,t]);(0,m.useEffect)(()=>{Fe("")},[Fe]);let Pt=(0,m.useRef)(r);(0,m.useEffect)(()=>{Pt.current!==r&&(Pt.current=r,O.current+=1,z.current.clear(),oe.current+=1,Bn.delete(t),d(new Map),f(new Set([""])),k(null),x({kind:"idle"}),le("tree"),Fe(""))},[r,t,Fe]);let mt=(0,m.useCallback)(I=>{f(Ge=>{let we=new Set(Ge);return we.has(I)?(we.delete(I),we):(we.add(I),l.get(I)===void 0&&Fe(I),we)})},[l,Fe]),Ee=(0,m.useCallback)((I,Ge)=>{let we=++oe.current;return Ge&&x({kind:"loading",path:I}),e.query({sessionId:t,query:{kind:"file-content",path:I}}).then(Be=>{if(we!==oe.current)return;let ye=_e(Be,"file-content");if(ye===null){x({kind:"error",path:I,...Be.ok?{}:{code:Be.error.code}});return}let Re={...ye.size!==void 0?{size:ye.size}:{},...ye.mtimeMs!==void 0?{mtimeMs:ye.mtimeMs}:{}};if(ye.tooLarge===!0){x({kind:"tooLarge",path:I,...Re});return}if(ye.variant==="image"&&ye.dataUrl!==void 0){x({kind:"image",path:I,dataUrl:ye.dataUrl,...Re});return}if(ye.variant==="text"){x({kind:"text",path:I,content:ye.content??"",lines:ye.lines??0,...Re,...ye.absolutePath!==void 0?{absolutePath:ye.absolutePath}:{}});return}x({kind:"binary",path:I,...Re})}).catch(()=>{we===oe.current&&x({kind:"error",path:I})})},[e,t]),_t=(0,m.useCallback)(I=>{k(I),n&&le("preview"),b(!ln(I)),C(!0),F("idle"),q("idle"),j(!1),ft(null),rt(null),Ee(I,!0)},[n,Ee]),ae=(0,m.useCallback)(()=>{if(V.current)return;V.current=!0,M(!0);let I=p;d(Be=>new Map([...Be].filter(([ye])=>I.has(ye))));let Ge=[...I].map(Be=>Fe(Be,!0));g!==null&&Ge.push(Ee(g,!1));let we=()=>{V.current=!1,M(!1)};Promise.all(Ge).then(we,we)},[p,g,Fe,Ee]),et=(0,m.useRef)({dirs:l,open:p,selected:g,file:c,renderMarkdown:h,wrap:E,pane:ie});et.current={dirs:l,open:p,selected:g,file:c,renderMarkdown:h,wrap:E,pane:ie},(0,m.useEffect)(()=>()=>{Td(t,et.current)},[t]);let tt=(0,m.useRef)(!1);(0,m.useEffect)(()=>{tt.current||(tt.current=!0,s!==null&&s.selected!==null&&c.kind==="idle"&&_t(s.selected))},[s,c.kind,_t]);let Rt=(0,m.useMemo)(()=>gs("",0,{dirs:l,open:p,selected:g,toggleDir:mt,selectFile:_t,t:a}),[l,p,g,mt,_t,a]),St=async()=>{if(g===null)return;let I=oe.current,Ge=await(0,We.writeClipboard)(g);I===oe.current&&F(Ge?"copied":"error")},zt=async()=>{if(c.kind!=="text"||!xi(c))return;let I=oe.current,Ge=await(0,We.writeClipboard)(c.content);I===oe.current&&q(Ge?"copied":"error")},Z=(()=>{if(g===null||c.kind!=="text"&&c.kind!=="image"&&c.kind!=="binary"&&c.kind!=="tooLarge")return null;let I=g.lastIndexOf("/"),Ge=I<0?"":g.slice(0,I),we=I<0?g:g.slice(I+1),Be=l.get(Ge),ye=Be?.status==="ready"?Be.entries.find(Re=>!Re.dir&&Re.name===we):void 0;return{path:g,kind:c.kind,...c.size!==void 0?{size:c.size}:{},...c.mtimeMs!==void 0?{mtimeMs:c.mtimeMs}:{},...c.kind==="text"?{lines:c.lines}:{},...c.kind==="image"?{dataUrl:c.dataUrl}:{},ignored:ye?.ignored===!0}})(),X=Q&&g!==null&&c.kind==="text",he=(0,m.createElement)("button",{key:"refresh",type:"button",className:`gp-files__refresh${D?" gp-files__refresh--busy":""}`,title:a("files.refresh"),"aria-label":a("files.refresh"),"aria-busy":D,disabled:D,onClick:()=>ae()},(0,m.createElement)(nn,{size:14})),je=(0,m.createElement)("div",{key:"left",className:"gp-files__tree-wrap",style:n?void 0:{flex:`0 0 ${kt.width}px`},...Ir(X)},[he,(0,m.createElement)("div",{key:"tree",className:"gp-files__tree"},Rt)]),Ve=c.kind==="text"&&wd(c.path),qe=Ve?(0,m.createElement)(We.SegmentedControl,{key:"mode",className:"gp-files__mode-seg",id:Y,label:a("files.previewMode"),value:h?"render":"source",options:[{value:"source",label:a("files.source")},{value:"render",label:a("files.render")}],onChange:I=>{I==="render"&&Ye!==null&&ft(null),b(I==="render")}}):null,st=c.kind==="text"?(0,m.createElement)("button",{key:"full",ref:ce,type:"button",className:"gp-files__props",title:a("files.fullscreen"),"aria-label":a("files.fullscreen"),onClick:()=>te(!0)},(0,m.createElement)(oi,{size:14})):null,nt=c.kind==="text"&&ln(c.path)&&h?(0,m.createElement)("button",{key:"scripts",type:"button",className:"gp-files__props gp-files__scripts",title:a(ke==="interactive"?"files.scriptsOn":"files.scriptsOff"),"aria-label":a("files.runScripts"),"aria-pressed":ke==="interactive",onClick:()=>C(ke!=="interactive")},"JS"):null,lt=c.kind==="text"&&(Ve?!h:!0),Jt=c.kind==="text"?us(c.content,c.lines):!1,Yt=lt?(0,m.createElement)("button",{key:"wrap",type:"button",className:"gp-files__props",title:a(Jt?"files.wrap":"files.wrapDisabled"),"aria-label":a("files.wrap"),"aria-pressed":Jt&&E,disabled:!Jt,onClick:()=>B(I=>!I)},(0,m.createElement)(ca,{size:14})):null,w=(0,m.createElement)("button",{key:"props",type:"button",className:"gp-files__props",title:a("files.propsTitle"),"aria-label":a("files.propsTitle"),disabled:Z===null,onClick:()=>j(!0)},(0,m.createElement)(ka,{size:14})),Ce=n?(0,m.createElement)("div",{key:"bar",className:"gp-files__bar gp-files__bar--compact"},[(0,m.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>le("tree")},[(0,m.createElement)(Tn,{key:"i",size:14}),a("files.backToTree")]),qe,(0,m.createElement)("div",{key:"end",className:"gp-files__bar-end"},[nt,Yt,st,w])]):null,pe=n?null:(0,m.createElement)("div",{key:"bar",className:"gp-files__bar"},[(0,m.createElement)("code",{key:"path",className:"gp-files__path",title:g??""},g??""),qe,(0,m.createElement)("div",{key:"copy",className:"gp-files__copy-group"},[(0,m.createElement)("button",{key:"copy-path",type:"button",className:`gp-files__copy-path${H==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{St()}},a(H==="copied"?"files.pathCopied":H==="error"?"files.pathCopyFailed":"files.copyPath")),xi(c)?(0,m.createElement)("button",{key:"copy-content",type:"button",className:`gp-files__copy-path${ee==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{zt()}},a(ee==="copied"?"files.contentCopied":ee==="error"?"files.contentCopyFailed":"files.copyContent")):null]),nt,Yt,st,w]),Oe=I=>X?{id:`${Y}-${I}-panel`}:{id:`${Y}-${I}-panel`,role:"tabpanel","aria-labelledby":`${Y}-${I}`},Ht=Ve?[(0,m.createElement)("div",{key:"src",...Oe("source"),style:h?{display:"none"}:{display:"contents"}},h?null:Ei(c,!1,E,G,S,R,Ie,Je,Ne,a)),(0,m.createElement)("div",{key:"rnd",...Oe("render"),style:h?{display:"contents"}:{display:"none"}},h?Ei(c,!0,E,G,S,R,Ie,Je,Ne,a):null)]:Ei(c,h,E,G,S,R,Ie,Je,Ne,a),Bt=Ke&&c.kind==="text"?(0,m.createElement)(Nd,{key:"heavy",path:c.path,bytes:Qe,canOpen:De,opening:wt.busy,error:wt.error,onOpen:()=>{Gt()},onRender:()=>{rt(c.path),it({busy:!1,error:null})},onCancel:()=>{b(!1),it({busy:!1,error:null})},t:a}):null,Lt=(0,m.createElement)("div",{key:"right",className:`gp-files__preview${X?" gp-files__preview--full":""}`,...X?{ref:N,role:"dialog","aria-modal":!0,"aria-label":c.kind==="text"?c.path:""}:{}},[X?(0,m.createElement)("div",{key:"fsbar",className:"gp-modal__bar gp-files__fsbar"},[(0,m.createElement)("code",{key:"path",className:"gp-modal__path",title:c.path},c.path),(0,m.createElement)("button",{key:"screen",type:"button",className:"gp-icon-btn gp-files__fs-screen",title:a(re?"files.exitFullscreen":"files.enterFullscreen"),"aria-label":a("files.screenFull"),"aria-pressed":re,onClick:xt},(0,m.createElement)(re?da:oi,{size:15})),(0,m.createElement)("button",{key:"close",ref:se,type:"button",className:"gp-icon-btn gp-modal__close",title:a("common.close"),"aria-label":a("common.close"),onClick:Me},(0,m.createElement)(yt,{size:15}))]):null,X?(0,m.createElement)(Md,{key:"fsfocus",cardRef:N,initialRef:se,restoreRef:ce,onClose:Me}):null,g!==null&&!X?n?Ce:pe:null,Bt,(0,m.createElement)("div",{key:"content",className:"gp-files__preview-content"},Ht),Z!==null&&W?(0,m.createElement)(jo,{key:"props-modal",input:Z,snapshot:i,onClose:()=>j(!1),t:a}):null]),jt=X?(0,m.createElement)("div",{key:"fs-desk",className:"gp-files__fs-backdrop","aria-hidden":"true",onClick:Me}):null;return n?(0,m.createElement)("div",{className:"gp-files gp-files--compact"},[ie==="preview"?Lt:je,jt]):(0,m.createElement)("div",{className:"gp-files"},[je,kt.divider,Lt,jt])}function Ei(e,t,n,r,i,a,o,s,l,d){if(e.kind==="text"&&t&&ps(e.path)&&a!==void 0){let p={labels:r,variant:"body",...i!==void 0?{pathImages:i}:{}};return a.length===1&&a[0].kind==="markdown"?(0,m.createElement)("div",{className:"gp-files__markdown"},(0,m.createElement)(We.MarkdownText,{text:a[0].text,...p})):(0,m.createElement)("div",{className:"gp-files__markdown"},a.map((f,g)=>f.kind==="mermaid"?(0,m.createElement)(ss,{key:g,source:f.source,t:d}):(0,m.createElement)(We.MarkdownText,{key:g,text:f.text,...p})))}return e.kind==="text"&&o!==void 0?o===null?cs(e,n,d):(0,m.createElement)("div",{className:"gp-files__html-wrap"},[s!==void 0?(0,m.createElement)("div",{key:"hint",className:"gp-files__html-note"},[(0,m.createElement)("span",{key:"text",className:"gp-files__html-note-text"},d("files.scriptsSkipped")),(0,m.createElement)("button",{key:"run",type:"button",className:"gp-files__html-note-run",title:d("files.scriptsOff"),onClick:s.run},d("files.runScripts"))]):null,(0,m.createElement)(as,{key:`frame:${o.kind}:${o.kind==="interactive"?o.src:""}`,frame:o,title:e.path,t:d,...l!==void 0?{onStop:l}:{}})]):cs(e,n,d)}function Nd(e){let{t}=e,n=[(0,m.createElement)("div",{key:"wrap","data-gp-heavy-modal":""},[(0,m.createElement)("p",{key:"why",className:"gp-modal__confirmtext"},t("files.htmlHeavyWhy",{size:er(e.bytes)})),(0,m.createElement)("p",{key:"inline",className:"gp-modal__confirmtext"},t("files.htmlHeavyInline")),e.canOpen?null:(0,m.createElement)("p",{key:"remote",className:"gp-modal__confirmtext"},t("files.htmlHeavyRemote")),e.error!==null?(0,m.createElement)("p",{key:"err",className:"gp-feedback",role:"alert"},e.error):null])],r=(0,m.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,m.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",disabled:e.opening,onClick:e.onCancel},t("common.cancel")),e.canOpen?(0,m.createElement)("button",{key:"open",type:"button",className:"gp-btn",disabled:e.opening,onClick:e.onOpen},t(e.opening?"files.htmlOpening":"files.htmlOpenInBrowser")):null,(0,m.createElement)("button",{key:"render",type:"button",className:"gp-btn gp-btn--primary",disabled:e.opening,onClick:e.onRender},t("files.htmlHeavyRun"))]);return Xt({onClose:e.onCancel,title:e.path,portalKey:"file-heavy-preview",body:n,footer:r,t})}function Md(e){return Er(e.cardRef,e.onClose,e.initialRef,e.restoreRef),null}function gs(e,t,n){let r=n.dirs.get(e);if(r===void 0||r.status==="loading")return t===0?[(0,m.createElement)("div",{key:"l",className:"gp-empty"},n.t("common.loading"))]:[(0,m.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,m.createElement)("div",{key:`e${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.loadFailed"))];let i=[];for(let a of r.entries){let o=e===""?a.name:`${e}/${a.name}`;if(a.dir){let s=n.open.has(o);i.push((0,m.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry gp-files__entry--dir${a.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-expanded":s,"aria-label":a.ignored?`${a.name} (${n.t("files.ignored")})`:a.name,onClick:()=>n.toggleDir(o)},[(0,m.createElement)("span",{key:"i",className:"gp-tree-ic"},s?(0,m.createElement)(We.IconFolderOpenRegular,{size:16}):(0,m.createElement)(We.IconFolderCloseRegular,{size:16})),(0,m.createElement)("span",{key:"n",className:"gp-tree-name"},a.name)])),s&&i.push(...gs(o,t+1,n))}else{let s=n.selected===o;i.push((0,m.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry${s?" gp-tree-row--active":""}${a.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-current":s?"true":void 0,"aria-label":a.ignored?`${a.name} (${n.t("files.ignored")})`:a.name,onClick:()=>n.selectFile(o)},[(0,m.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,m.createElement)(We.FileTypeIcon,{path:o,size:16})),(0,m.createElement)("span",{key:"n",className:"gp-tree-name"},a.name)]))}}return r.truncated&&i.push((0,m.createElement)("div",{key:`t${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.truncated"))),i}function cs(e,t,n){switch(e.kind){case"idle":return(0,m.createElement)("div",{className:"gp-empty"},n("files.selectFile"));case"loading":return(0,m.createElement)("div",{className:"gp-empty"},n("common.loading"));case"error":return(0,m.createElement)("div",{className:"gp-empty"},e.code==="file-not-found"?n("files.notFound"):n("files.loadFailed"));case"tooLarge":return(0,m.createElement)("div",{className:"gp-empty"},n("files.tooLarge"));case"binary":return(0,m.createElement)("div",{className:"gp-empty"},n("files.binary"));case"image":return(0,m.createElement)(Zn,{src:e.dataUrl,alt:e.path,t:n,viewportClass:"gp-files__image"});case"text":return(0,m.createElement)(Pd,{content:e.content,path:e.path,wrap:t,t:n})}}function Gd(e,t){if(t==="")return[];let n=[];for(let r=0;r<e.length;r++)for(let[i,a]of Sr(e[r],t))if(n.push({line:r,start:i,end:a}),n.length>=xr)return n;return n}function Pd({content:e,path:t,wrap:n,t:r}){let i=(0,m.useMemo)(()=>{let G=e.split(`
|
|
919
|
+
`);return G.length>0&&G[G.length-1]===""&&G.pop(),G},[e]),a=e.length>xd||i.length>kd,o=a?void 0:(0,We.languageForPath)(t),s=(0,We.useCodeHighlighter)(o),l=(0,m.useMemo)(()=>a?void 0:s(i.join(`
|
|
920
|
+
`)),[a,s,i]),[d,p]=(0,m.useState)(!1),[f,g]=(0,m.useState)(""),[k,c]=(0,m.useState)(!1),[x,h]=(0,m.useState)(0),{setEl:b,viewport:v,elRef:C}=Pn(),E=(0,m.useRef)(null),B=(0,m.useRef)(null);(0,m.useEffect)(()=>{p(!1),g(""),h(0)},[t]);let H=_r(f,kr),F=(0,m.useMemo)(()=>i.map(G=>G.toLowerCase()),[i]),ee=k?H:H.toLowerCase(),q=k?i:F,W=(0,m.useMemo)(()=>Gd(q,ee),[q,ee]);(0,m.useEffect)(()=>{h(0)},[ee]);let j=W.length===0?0:Math.min(x,W.length-1),Q=(0,m.useMemo)(()=>{let G=new Map;for(let S of W){let R=G.get(S.line)??[];R.push([S.start,S.end]),G.set(S.line,R)}return G},[W]);(0,m.useEffect)(()=>{let G=S=>{if(!((S.ctrlKey||S.metaKey)&&(S.key==="f"||S.key==="F")))return;let R=C.current;R===null||R.offsetParent===null||(S.preventDefault(),p(!0),requestAnimationFrame(()=>E.current?.select()))};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[C]);let te=i.length,re=n&&us(e,te),de=(0,m.useMemo)(()=>Mn(new Array(te).fill(Or)),[te]),N=v.height>0?v.height:_d,{first:se,last:ce}=Gn(de,v.top,N,ds*Or),ie=W.length>0?W[j].line:-1,{first:le,last:D}=re?{first:0,last:te}:wr({first:se,last:ce},ie,te,ds);(0,m.useEffect)(()=>{if(ie<0)return;let G=requestAnimationFrame(()=>B.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(G)},[j,W,ie]);let M=(0,m.useCallback)(G=>{h(S=>W.length===0?0:(S+G+W.length)%W.length)},[W.length]),V=W.length>0?W[j]:null,O=d?(0,m.createElement)(Tr,{inputRef:E,query:f,matches:W.length,active:j,caseSensitive:k,onChange:g,onToggleCase:()=>c(G=>!G),onStep:M,onClose:()=>p(!1),t:r}):null,z=a||d?(0,m.createElement)("div",{key:"hd",className:"gp-files__header"},[a?(0,m.createElement)("div",{key:"note",className:"gp-files__note"},r("files.highlightOff")):null,O]):null,Y=[];for(let G=le;G<D;G++)Y.push((0,m.createElement)("div",{key:G,className:"gp-files__row",style:re?void 0:{top:G*Or}},[(0,m.createElement)("div",{key:"n",className:"gp-diff-no"},G+1),Rd(i[G],G,l?.[G],Q.get(G),V,B,r)]));return(0,m.createElement)("div",{className:`gp-files__code gp-diff__scroll${re?" gp-files__code--wrap":" gp-files__code--nowrap"}`,ref:b},[z,(0,m.createElement)("div",{key:"grid",className:"gp-files__single gp-files__single--virt",...re?{}:{style:{height:te*Or}}},Y)])}function Rd(e,t,n,r,i,a,o){if(e==="")return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},"\xA0");if(e.length>ls)return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},[e.slice(0,ls),(0,m.createElement)("span",{key:"trunc",className:"gp-files__trunc"},o("files.lineTruncated"))]);if(r===void 0||r.length===0)return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},n!==void 0?n.map((l,d)=>(0,m.createElement)("span",{key:d,style:l.style},l.text)):e);let s=i!==null&&i.line===t?[i.start,i.end]:null;return(0,m.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},Cr(e,r,n,`c${t}`,s,a))}var Xr=require("react");function fs(e){return e.compact&&e.short}var Dd={compact:!1,short:!1};function ms(e){let[t,n]=(0,Xr.useState)(Dd);return(0,Xr.useLayoutEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=()=>n(a=>{let o=e.clientWidth,s=e.clientHeight,l={compact:o>0&&o<=620,short:s>0&&s<=520};return a.compact===l.compact&&a.short===l.short?a:l});r();let i=new ResizeObserver(r);return i.observe(e),()=>i.disconnect()},[e]),t}function Gi(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}}function $r(){Jn(),setTimeout(()=>{Jn()},1e3)}async function Fd(e,t,n){let r=e.describe();await r.ensure();let i=r.getSnapshot().view;if(i===void 0)return!1;let a=Gi(i.namespaces);if(a===void 0)return!1;let o=await e.get(a).set(t,n);return o&&$r(),o}async function Pi(e,t,n){let r=e.get("configForms");if(r===void 0)return!1;try{return await Fd(r,t,n)}catch{return!1}}function hs(e){return e.get("configForms")!==void 0}var Kr=require("react");function ys(){let[e,t]=(0,Kr.useState)(()=>ht.isVisible());return(0,Kr.useEffect)(()=>{let n=()=>t(ht.isVisible()),r=ht.subscribe(n);return n(),r},[]),e}function bs(e){return e===-1||e===1?e:0}var vs="gp.panel.fontDelta";function xs({ctx:e,sessionId:t,t:n}){let r=ys(),[i,a]=(0,K.useState)(null),o=(0,K.useRef)(0),[s,l]=(0,K.useState)(null),[d,p]=(0,K.useState)(null),f=ms(d),g=f.compact,k=fs(f),c=dr(t),x=pn(e),h=hs(e),b=c.state==="error"&&c.error.code==="git-unavailable",v=c.state==="error"&&(c.error.code==="not-a-git-repo"||c.error.code==="git-unavailable"),C=b&&c.state==="error"&&c.error.isGitRepo===!0,E=v?"files":s!==null&&s.sessionId===t?s.tab:null,B=(0,K.useRef)({tabs:new Set});B.current.sessionId!==t&&(B.current={sessionId:t,tabs:new Set}),E!==null&&B.current.tabs.add(E);let H=B.current.tabs.has("files");(0,K.useEffect)(()=>{if(!It(t))return;if(v){l(null);return}if(s?.sessionId===t)return;let S=Yi(t);if(S!==null){l({sessionId:t,tab:S});return}let R=ta(t);if(R!==null){l({sessionId:t,tab:R});return}c.state==="ready"&&l({sessionId:t,tab:c.snapshot.dirty?"changes":"overview"})},[t,c,v,s?.sessionId]),(0,K.useEffect)(()=>{if(It(t))return Zi(t,S=>l({sessionId:t,tab:S}))},[t]);let F=(0,K.useRef)({tab:null});F.current={sessionId:t,tab:E},(0,K.useEffect)(()=>()=>{let{sessionId:S,tab:R}=F.current;S!==void 0&&R!==null&&ea(S,R)},[]);let ee=r&&It(t),[q,W]=(0,K.useState)(0),[j,Q]=(0,K.useState)(!1),te=async S=>{if(!It(t))return{ok:!1,error:n("error.noCwd")};let R=await x.run({sessionId:t,action:S});return R.ok?(tn(t).accept(R.snapshot),S.kind==="branch-checkout"&&W(oe=>oe+1),{ok:!0}):(S.kind==="branch-checkout"&&S.stashMessage!==void 0&&W(oe=>oe+1),tn(t).resync(),{ok:!1,error:vn(R.error.code,R.error.message,n)})},re=S=>{if(S===N)return;let R=++o.current;a(S),Pi(e,"fontDelta",S).then(oe=>{o.current===R&&(oe||a(null))})},de=c.state==="ready"?bs(c.snapshot.fontDelta):0,N=i??de;(0,K.useEffect)(()=>{i!==null&&de===i&&a(null)},[de,i]);let se=(0,K.useRef)(!1);(0,K.useEffect)(()=>{if(se.current||c.state!=="ready"||de!==0||typeof localStorage>"u")return;let S=localStorage.getItem(vs);if(S===null)return;let R=bs(Number(S));localStorage.removeItem(vs),R!==0&&(se.current=!0,Pi(e,"fontDelta",R))},[e,c,de]);let ce={overview:{full:"tab.overview",short:"tab.overviewShort"},changes:{full:"tab.changes",short:"tab.changesShort"},files:{full:"tab.files",short:"tab.filesShort"}},ie=[{key:"overview",label:n(g?ce.overview.short:ce.overview.full),icon:(0,K.createElement)(pr,{size:14})},{key:"changes",label:n(g?ce.changes.short:ce.changes.full),icon:(0,K.createElement)(sa,{size:14})},{key:"files",label:n(g?ce.files.short:ce.files.full),icon:(0,K.createElement)(ba,{size:14})}],le=v?ie.filter(S=>S.key==="files"):ie,D=(0,K.useId)(),M=le.map(S=>({value:S.key,label:[(0,K.createElement)("span",{key:"i",className:"gp-tab__icon"},S.icon),(0,K.createElement)("span",{key:"l",className:"gp-tab__label"},S.label)],id:`${D}-${S.key}`,panelId:`${D}-${S.key}-panel`})),V=E??le[0]?.key??"overview",O=!It(t)||c.state==="no-cwd"?(0,K.createElement)("div",{className:"gp-empty"},n("error.noCwd")):v?null:c.state==="error"?(0,K.createElement)("div",{className:"gp-empty"},n("pill.unavailable")):c.state==="cold"||c.state==="loading"||E===null?(0,K.createElement)("div",{className:"gp-empty"},n("common.loading")):null,z=S=>{if(O!==null)return S===V?O:null;if(!It(t))return null;if(v)return H?(0,K.createElement)(Mi,{key:t,remote:x,sessionId:t,compact:g,worktreeGen:q,snapshot:null,t:n}):null;if(c.state!=="ready")return null;let R=c.snapshot;return S==="overview"?B.current.tabs.has("overview")?(0,K.createElement)(Po,{key:t,remote:x,sessionId:t,visible:ee&&E==="overview",defaultDiffView:R.defaultDiffView,snapshot:R,onAction:te,onResync:()=>tn(t).resync(),compact:g,t:n}):null:S==="changes"?B.current.tabs.has("changes")?(0,K.createElement)($o,{key:t,remote:x,sessionId:t,visible:ee&&E==="changes",snapshot:R,onAction:te,onRefresh:()=>tn(t).refresh(),onSetFullChanges:oe=>tn(t).setFullChanges(oe),compact:g,cramped:k,t:n}):null:H?(0,K.createElement)(Mi,{key:t,remote:x,sessionId:t,compact:g,worktreeGen:q,snapshot:R,t:n}):null},Y=le.map(S=>(0,K.createElement)("div",{key:S.key,id:`${D}-${S.key}-panel`,role:"tabpanel","aria-labelledby":`${D}-${S.key}`,style:V===S.key?{display:"contents"}:{display:"none"}},z(S.key))),G=C?(0,K.createElement)("div",{className:"gp-files-wrap"},[j?null:(0,K.createElement)(Wt,{key:"notice",text:n("files.gitNotInstalled"),closeLabel:n("common.close"),onClose:()=>Q(!0)}),...Y]):(0,K.createElement)("div",{style:{display:"contents"}},Y);return(0,K.createElement)("div",{className:"gp-panel",ref:p,"data-conversation-composer-overlay":"","data-font-delta":N,"data-layout":g?"compact":"wide"},[(0,K.createElement)("div",{key:"tabs",className:"gp-tabbar"},[(0,K.createElement)(ws.SegmentedTabs,{key:"switcher",className:`gp-tabbar__tabs${le.length===1?" gp-tabbar__tabs--single":""}`,label:n("panel.tabs"),items:M,value:V,onChange:S=>{let R=le.find(oe=>oe.key===S);R!==void 0&&It(t)&&l({sessionId:t,tab:R.key})}}),(0,K.createElement)("div",{key:"trailing",className:"gp-tabbar__trailing"},[g||!h?null:(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":N===-1,onClick:()=>re(-1),"aria-label":n("panel.fontDecrease")},"A\u2212"),(0,K.createElement)("button",{key:"reset",type:"button",className:"gp-font__reset","aria-pressed":N===0,onClick:()=>re(0),"aria-label":n("panel.fontReset")},"A"),(0,K.createElement)("button",{key:"inc",type:"button",className:"gp-font__increase","aria-pressed":N===1,onClick:()=>re(1),"aria-label":n("panel.fontIncrease")},"A+")]),g?null:(0,K.createElement)(zd,{key:"ver",remote:x,t:n})])]),(0,K.createElement)("div",{key:"body",className:"gp-body"},G)])}function zd({remote:e,t}){let[n,r]=(0,K.useState)({kind:"idle"}),{tipProps:i,tipNode:a}=$t({placement:"below",maxWidth:300});(0,K.useEffect)(()=>{let d=!0;return e.version({}).then(p=>{d&&"current"in p&&r(f=>({...f,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,K.createElement)("span",{className:"gp-verbar__status"},t("version.checking")):s===void 0||!s.checkedRemote?null:s.error!==void 0?(0,K.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,K.createElement)("span",{},[(0,K.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,K.createElement)("a",{key:"l",className:"gp-verbar__link",href:s.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:s.current}));return(0,K.createElement)("div",{className:"gp-verbar"},[s!==void 0?(0,K.createElement)("span",{key:"tag",className:"gp-verbar__tag"},`v${s.current}`):null,l,(0,K.createElement)("button",{key:"btn",type:"button",className:"gp-verbar__btn",disabled:n.kind==="checking",onClick:()=>void o()},[(0,K.createElement)("span",{key:"i",className:"gp-tab__icon"},(0,K.createElement)(nn,{size:12})),t("version.check")]),s?.repositoryUrl!==void 0?(0,K.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"),...i(t("version.openRepo"))},(0,K.createElement)(_a,{size:15})):null,a])}var Pe=require("react"),Cs=require("react-dom");var ks="data-gp-tab-dot",In,Ri=null,_s="",jr=null,Jr;function Hd(e){if(typeof document>"u")return null;let t=document.querySelectorAll(Vn);for(let n of t)if((n.textContent??"").trim()===e)return n;return null}function Li(){let e=Hd(_s);if(e===null)return;let t=e.querySelector(`[${ks}]`);if(jr===null){t?.remove();return}let n=`gp-tab-dot gp-tab-dot--${jr}`;if(t!==null){t.className!==n&&(t.className=n);return}let r=document.createElement("span");r.className=n,r.setAttribute(ks,""),r.setAttribute("aria-hidden","true"),e.appendChild(r)}function Bd(){if(typeof document>"u"||typeof MutationObserver>"u")return;let e=document.querySelector(Wi);if(e!==Ri){if(In?.disconnect(),Ri=e,e===null){In=void 0;return}In=new MutationObserver(()=>Li()),In.observe(e,{childList:!0,subtree:!0})}}function Id(){In?.disconnect(),In=void 0,Ri=null}function Ss(e,t,n){if(!(typeof document>"u")){if(n===null){Ai(e);return}Jr=e,_s=t,jr=n,Bd(),Li()}}function Ai(e){Jr!==void 0&&Jr!==e||(Jr=void 0,jr=null,Li(),Id())}function Od(e){let t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function Xd(){let[e,t]=(0,Pe.useState)(!1),[n,r]=(0,Pe.useState)(null),i=(0,Pe.useRef)(null);return(0,Pe.useLayoutEffect)(()=>{if(!e||i.current===null){r(null);return}let s=i.current.getBoundingClientRect();r({left:s.left,bottom:window.innerHeight-s.top+8})},[e]),{bind:{ref:s=>{i.current=s},onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1)},render:s=>!e||n===null||typeof document>"u"?null:(0,Cs.createPortal)((0,Pe.createElement)("div",{className:"gp-tip",style:{left:n.left,bottom:n.bottom}},s.map((l,d)=>(0,Pe.createElement)("div",{key:d,className:d===0?"gp-tip__path":"gp-tip__note"},l))),document.body)}}function $d(e){let[t,n]=(0,Pe.useState)(!1);return(0,Pe.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let i=e.closest("[data-conversation-region]")??document.body,a=()=>n(i.clientWidth>0&&i.clientWidth<Kd);a();let o=new ResizeObserver(a);return o.observe(i),()=>o.disconnect()},[e]),t}var Kd=620;function Ts({sessionId:e,t}){let n=dr(e),r=Xd(),[i,a]=(0,Pe.useState)(null),o=$d(i),s=(0,Pe.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,Pe.useEffect)(()=>{Ss(s.current,d,l);let h=s.current;return()=>{Ai(h)}},[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,Pe.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 f=Od(p.root),g=p.branch??`(${t("pill.detached")})`,k=p.dirty,c=k?"gp-pill--dirty":"gp-pill--synced",x=()=>{if(ra(d)){ia(d);return}It(e)&&Qi(e,k?"changes":"overview"),na(d)};return(0,Pe.createElement)("span",{className:"gp-pill-wrap",ref:a},[(0,Pe.createElement)("button",{key:"btn",type:"button",className:`gp-pill ${c}${o?" gp-pill--compact":""}`,onClick:x,ref:r.bind.ref,onMouseEnter:r.bind.onMouseEnter,onMouseLeave:r.bind.onMouseLeave},[(0,Pe.createElement)("span",{key:"dot",className:"gp-pill__dot","aria-hidden":"true"}),(0,Pe.createElement)("span",{key:"repo",className:"gp-pill__repo"},f),(0,Pe.createElement)("span",{key:"git",className:"gp-pill__git"},["(",(0,Pe.createElement)("span",{key:"b",className:"gp-pill__branch"},g),")"])]),r.render([p.root,t(k?"pill.dirty":"pill.synced")])])}var A=require("react"),Ur=require("@deepseek-ai/dsh-client-ui-primitives");function Es(e,t,n){return t===""?"":e.find(i=>i.id===t)?.models.some(i=>i.id===n)===!0?n:""}function Di(e,t,n,r){if(n==="")return"";let a=e.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.efforts;return a!==void 0&&a.some(o=>o.id===r)?r:""}var Jd="",Vr={min:Tt.maxBytes.min/1024,max:Tt.maxBytes.max/1024},qr={min:Tt.timeoutMs.min/1e3,max:Tt.timeoutMs.max/1e3};function Fi(e,t){return Math.min(t.max,Math.max(t.min,Math.floor(e)))}function jd(e){let t=e.trim();if(t==="")return null;let n=Number(t);return Number.isFinite(n)?n:null}function Ns({ctx:e,t}){let[,n]=(0,A.useState)(0),[r,i]=(0,A.useState)(!1),[a,o]=(0,A.useState)(!1),[s,l]=(0,A.useState)(null),[d,p]=(0,A.useState)(null),[f,g]=(0,A.useState)(null),[k,c]=(0,A.useState)(null),[x,h]=(0,A.useState)(null),[b,v]=(0,A.useState)(null),[C,E]=(0,A.useState)(null),[B,H]=(0,A.useState)(null),[F,ee]=(0,A.useState)(null),[q,W]=(0,A.useState)([]),[j,Q]=(0,A.useState)([]),[te,re]=(0,A.useState)("idle"),[de,N]=(0,A.useState)(null),[se,ce]=(0,A.useState)(!1),[ie,le]=(0,A.useState)(!1),[D,M]=(0,A.useState)(!1),V=()=>{n(w=>w+1)},O=e.get("configForms"),z=(0,A.useMemo)(()=>O?.describe(),[O]);(0,A.useEffect)(()=>{if(z!==void 0)return z.ensure(),z.subscribe(V)},[z]);let Y=z?.getSnapshot().view,G=(0,A.useMemo)(()=>Y===void 0?void 0:Gi(Y.namespaces),[Y]),S=(0,A.useMemo)(()=>O!==void 0&&G!==void 0?O.get(G):void 0,[O,G]);(0,A.useEffect)(()=>{if(S!==void 0)return S.subscribe(V)},[S]);let R=S?.getSnapshot(),oe=S!==void 0&&R!==void 0&&R.status==="ready",ke=z?.getSnapshot().status,Qe=s??(typeof R?.value?.showInputPill=="boolean"?R.value.showInputPill:!0),dt=d??(R?.value?.defaultDiffView==="split"?"split":"unified"),vt=f??(R?.value?.graphStyle==="compact"?"compact":"parallel"),rt=k??(R?.value?.fontDelta===-1||R?.value?.fontDelta===1?R.value.fontDelta:0),De=x??(typeof R?.value?.suggestEnabled=="boolean"?R.value.suggestEnabled:!0),wt=R?.value?.suggestLanguage,it=b??(typeof wt=="string"&&yr.includes(wt)?wt:di),Gt=Fi(typeof R?.value?.suggestMaxBytes=="number"?R.value.suggestMaxBytes/1024:Tt.maxBytes.default/1024,Vr),gt=Fi(typeof R?.value?.suggestMaxOutputTokens=="number"?R.value.suggestMaxOutputTokens:Tt.maxOutputTokens.default,Tt.maxOutputTokens),Ke=Fi(typeof R?.value?.suggestTimeoutMs=="number"?R.value.suggestTimeoutMs/1e3:Tt.timeoutMs.default/1e3,qr),Ye=typeof R?.value?.suggestProvider=="string"?R.value.suggestProvider:"",ft=typeof R?.value?.suggestModel=="string"?R.value.suggestModel:"",at=typeof R?.value?.suggestReasoningEffort=="string"?R.value.suggestReasoningEffort:"",ge=de?.provider??Ye,ve=de!==null?de.model:Ye!==""?ft:"",ze=de!==null?de.effort:at,He=ge!==""&&ve!==""?ze:"",Ie=q.find(w=>w.id===ge),Ze=Ie?.models.find(w=>w.id===ve),Je=Ze?.reasoning?.efforts,ot=()=>{re("loading"),pn(e).query({sessionId:Jd,query:{kind:"model-catalog"}}).then(w=>{let Ce=_e(w,"model-catalog");if(Ce===null){re("error");return}W(Ce.groups),Q(Ce.failures),re("ready")}).catch(()=>{re("error")})};(0,A.useEffect)(()=>{oe&&te==="idle"&&ot()},[oe]);let Ne=async(w,Ce,pe)=>{if(S!==void 0){o(!1),i(!0);try{let Oe=await S.set(w,Ce);pe(),Oe?$r():o(!0)}catch{pe(),o(!0)}finally{i(!1)}}},Me=w=>(l(w),Ne("showInputPill",w,()=>l(null))),xt=w=>w===dt?Promise.resolve():(p(w),Ne("defaultDiffView",w,()=>p(null))),kt=w=>w===vt?Promise.resolve():(g(w),Ne("graphStyle",w,()=>g(null))),Fe=w=>w===rt?Promise.resolve():(c(w),Ne("fontDelta",w,()=>c(null))),Pt=w=>(h(w),Ne("suggestEnabled",w,()=>h(null))),mt=w=>w===it?Promise.resolve():(v(w),Ne("suggestLanguage",w,()=>v(null))),Ee=async(w,Ce,pe)=>{if(S===void 0)return;o(!1),i(!0),N({provider:w,model:Ce,effort:pe});let Oe=!1;try{let Ht=await S.set("suggestProvider",w),Bt=await S.set("suggestModel",Ce),Lt=await S.set("suggestReasoningEffort",pe);Oe=Ht&&Bt&&Lt,Oe?$r():o(!0)}catch{o(!0)}finally{i(!1),(w===""||Ce!==""||!Oe)&&N(null)}},_t=w=>{if(w==="")return Ee("","","");let Ce=Es(q,w,ve),pe=Di(q,w,Ce,ze);return Ee(w,Ce,pe)},ae=w=>{if(w==="")return Ee(ge,"","");let Ce=Di(q,ge,w,ze);return Ee(ge,w,Ce)},et=w=>Ee(ge,ve,w),tt=(w,Ce,pe,Oe,Ht,Bt)=>{let Lt=w===null?null:jd(w);if(Lt===null)return Bt(),Promise.resolve();let jt=Math.min(Ce.max,Math.max(Ce.min,Math.floor(Lt)));return Ht(String(jt)),Ne(Oe,jt*pe,Bt)},Rt=w=>tt(w,Vr,1024,"suggestMaxBytes",E,()=>E(null)),St=w=>tt(w,Tt.maxOutputTokens,1,"suggestMaxOutputTokens",H,()=>H(null)),zt=w=>tt(w,qr,1e3,"suggestTimeoutMs",ee,()=>ee(null)),Z=[{id:"",label:t("cfg.suggestModelSession")},...q.map(w=>({id:w.id,label:w.name}))],X=[{id:"",label:t("cfg.suggestModelPick")},...(Ie?.models??[]).map(w=>({id:w.id,label:w.name}))],he=[{id:"",label:t("cfg.suggestEffortUnset")},...(Je??[]).map(w=>({id:w.id,label:w.name}))],je=(w,Ce,pe,Oe)=>qn(w,Ce,pe,{disabled:Oe,extraClass:"gp-cfg__select-trigger"}),Ve=r||R?.writable===!1,qe=ge===""?t("cfg.suggestModelSession"):q.find(w=>w.id===ge)?.name??ge,st=ve===""?t("cfg.suggestModelPick"):Ze?.name??ve,nt=He===""?t("cfg.suggestEffortUnset"):Je?.find(w=>w.id===He)?.name??He,lt=(0,A.createElement)(Ur.Menu,{key:"provider",open:se,onClose:()=>ce(!1),items:Z,selectedId:ge,onSelect:w=>{ce(!1),_t(w)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:je(se,qe,()=>ce(w=>!w),Ve||te==="loading")}),Jt=(0,A.createElement)(Ur.Menu,{key:"model",open:ie,onClose:()=>le(!1),items:X,selectedId:ve,onSelect:w=>{le(!1),ae(w)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:je(ie,st,()=>le(w=>!w),Ve||Ie===void 0)}),Yt=(0,A.createElement)(Ur.Menu,{key:"effort",open:D,onClose:()=>M(!1),items:he,selectedId:He,onSelect:w=>{M(!1),et(w)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:je(D,nt,()=>M(w=>!w),Ve)});return O===void 0?(0,A.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded")):oe?(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:Qe,disabled:r||R?.writable===!1,onChange:w=>{Me(w.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"},Qt(["unified","split"],dt,w=>{xt(w)},w=>t(w==="unified"?"cfg.diffUnified":"cfg.diffSplit"),r||R?.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"},Qt(["parallel","compact"],vt,w=>{kt(w)},w=>t(w==="parallel"?"cfg.graphParallel":"cfg.graphCompact"),r||R?.writable===!1)),(0,A.createElement)("p",{key:"graphhint",className:"gp-cfg__hint"},t("cfg.graphHint")),(0,A.createElement)("h3",{key:"fonttitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.fontTitle")),(0,A.createElement)("div",{key:"fontseg",className:"gp-seg gp-cfg__seg"},Qt(["smaller","default","larger"],rt===-1?"smaller":rt===1?"larger":"default",w=>{Fe(w==="smaller"?-1:w==="larger"?1:0)},w=>t(w==="smaller"?"cfg.fontSmaller":w==="larger"?"cfg.fontLarger":"cfg.fontDefault"),r||R?.writable===!1)),(0,A.createElement)("p",{key:"fonthint",className:"gp-cfg__hint"},t("cfg.fontHint")),(0,A.createElement)("h3",{key:"sgtitle",className:"gp-cfg__title",style:{marginTop:6}},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:De,disabled:r||R?.writable===!1,onChange:w=>{Pt(w.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")},Qt([...yr],it,w=>{mt(w)},w=>t(w==="auto"?"cfg.suggestLangAuto":w==="zh"?"cfg.suggestLangZh":"cfg.suggestLangEn"),r||R?.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:Vr.min,max:Vr.max,"aria-describedby":"gp-cfg-maxkib-hint",value:C??String(Gt),disabled:r||R?.writable===!1,onChange:w=>{E(w.currentTarget.value)},onBlur:()=>{Rt(C)},onKeyDown:w=>{w.key==="Enter"&&w.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:Tt.maxOutputTokens.min,max:Tt.maxOutputTokens.max,"aria-describedby":"gp-cfg-outtok-hint",value:B??String(gt),disabled:r||R?.writable===!1,onChange:w=>{H(w.currentTarget.value)},onBlur:()=>{St(B)},onKeyDown:w=>{w.key==="Enter"&&w.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:qr.min,max:qr.max,"aria-describedby":"gp-cfg-timeout-hint",value:F??String(Ke),disabled:r||R?.writable===!1,onChange:w=>{ee(w.currentTarget.value)},onBlur:()=>{zt(F)},onKeyDown:w=>{w.key==="Enter"&&w.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)("div",{key:"sgmodel",className:"gp-cfg__menur"},[(0,A.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestModelLabel")),lt]),ge!==""?(0,A.createElement)("div",{key:"sgmodel2",className:"gp-cfg__menur"},[(0,A.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestProviderLabel")),Jt]):null,ge!==""&&ve!==""&&Je!==void 0&&Je.length>0?(0,A.createElement)("div",{key:"sgeffort",className:"gp-cfg__menur"},[(0,A.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestEffortLabel")),Yt]):null,te==="loading"?(0,A.createElement)("p",{key:"sgload",className:"gp-cfg__rangehint"},t("cfg.suggestModelLoading")):te==="error"?(0,A.createElement)("p",{key:"sgerr",className:"gp-cfg__err",role:"alert"},[t("cfg.suggestModelFailed")," ",(0,A.createElement)("button",{key:"retry",type:"button",className:"gp-cfg__retry",onClick:()=>{ot()}},t("cfg.suggestModelRetry"))]):j.length>0?(0,A.createElement)("p",{key:"sgfail",className:"gp-cfg__rangehint"},`${t("cfg.suggestModelFailed")}: ${j.map(w=>w.name).join(", ")}`):q.length===0?(0,A.createElement)("p",{key:"sgempty",className:"gp-cfg__rangehint"},t("cfg.suggestModelEmpty")):null,(0,A.createElement)("p",{key:"sghint2",className:"gp-cfg__hint"},t("cfg.suggestHint")),a?(0,A.createElement)("p",{key:"error",className:"gp-cfg__err",role:"alert"},t("cfg.saveFailed")):null]):ke==="idle"||ke==="loading"?(0,A.createElement)("p",{className:"gp-cfg__hint"},t("common.loading")):(0,A.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded"))}var tr="gitPanel",Vd=["dsh-git-panel","@xbzbing/dsh-git-panel"],qd=["slots","locale","connection"],Ud="dsh-git-panel";function Wd(e){Bi(),ji(e),e.effect(()=>e.locale.register(tr,{zh:Ii,en:Oi})??void 0,"dsh-git-panel: dictionaries");let t=e.locale.bind(tr),n=[],r=i=>{typeof i=="function"&&n.push(i)};r(e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"git-panel",order:30,locale:tr,label:()=>t("panel.tab")},i=>(0,Wr.createElement)(xs,{ctx:e,sessionId:i.sessionId,t})))),r(e.slots.inject("conversation.input.left",()=>e.slots.register({name:"conversation.input.left",id:"git-panel-pill",order:100,locale:tr},i=>(0,Wr.createElement)(Ts,{sessionId:i.sessionId,t}))));for(let i of Vd)r(e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:i,locale:tr},a=>a.view==="summary"?t("cfg.title"):(0,Wr.createElement)(Ns,{ctx:e,t}))));e.effect(()=>{let i=e.on("connection/reset",()=>Jn());return()=>{typeof i=="function"&&i();for(let a of n.splice(0))try{a()}catch{}Ui()}},"dsh-git-panel: lifecycle")}module.exports={name:Ud,inject:qd,apply:Wd};
|
|
795
921
|
return module.exports;
|
|
796
922
|
} });
|