(t0)
| 53 | }; |
| 54 | } |
| 55 | export function DiffDialog(t0) { |
| 56 | const $ = _c(73); |
| 57 | const { |
| 58 | messages, |
| 59 | onDone |
| 60 | } = t0; |
| 61 | const gitDiffData = useDiffData(); |
| 62 | const turnDiffs = useTurnDiffs(messages); |
| 63 | const [viewMode, setViewMode] = useState("list"); |
| 64 | const [selectedIndex, setSelectedIndex] = useState(0); |
| 65 | const [sourceIndex, setSourceIndex] = useState(0); |
| 66 | let t1; |
| 67 | if ($[0] === Symbol.for("react.memo_cache_sentinel")) { |
| 68 | t1 = { |
| 69 | type: "current" |
| 70 | }; |
| 71 | $[0] = t1; |
| 72 | } else { |
| 73 | t1 = $[0]; |
| 74 | } |
| 75 | let t2; |
| 76 | if ($[1] !== turnDiffs) { |
| 77 | t2 = [t1, ...turnDiffs.map(_temp)]; |
| 78 | $[1] = turnDiffs; |
| 79 | $[2] = t2; |
| 80 | } else { |
| 81 | t2 = $[2]; |
| 82 | } |
| 83 | const sources = t2; |
| 84 | const currentSource = sources[sourceIndex]; |
| 85 | const currentTurn = currentSource?.type === "turn" ? currentSource.turn : null; |
| 86 | let t3; |
| 87 | if ($[3] !== currentTurn || $[4] !== gitDiffData) { |
| 88 | t3 = currentTurn ? turnDiffToDiffData(currentTurn) : gitDiffData; |
| 89 | $[3] = currentTurn; |
| 90 | $[4] = gitDiffData; |
| 91 | $[5] = t3; |
| 92 | } else { |
| 93 | t3 = $[5]; |
| 94 | } |
| 95 | const diffData = t3; |
| 96 | const selectedFile = diffData.files[selectedIndex]; |
| 97 | let t4; |
| 98 | if ($[6] !== diffData.hunks || $[7] !== selectedFile) { |
| 99 | t4 = selectedFile ? diffData.hunks.get(selectedFile.path) || [] : []; |
| 100 | $[6] = diffData.hunks; |
| 101 | $[7] = selectedFile; |
| 102 | $[8] = t4; |
| 103 | } else { |
| 104 | t4 = $[8]; |
| 105 | } |
| 106 | const selectedHunks = t4; |
| 107 | let t5; |
| 108 | let t6; |
| 109 | if ($[9] !== sourceIndex || $[10] !== sources.length) { |
| 110 | t5 = () => { |
| 111 | if (sourceIndex >= sources.length) { |
| 112 | setSourceIndex(Math.max(0, sources.length - 1)); |
nothing calls this directly
no test coverage detected