@surething/cockpit 1.0.281 → 1.0.282

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.
Files changed (44) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +7 -7
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/cockpit-build.json +2 -2
  5. package/.next-prod/prerender-manifest.json +3 -3
  6. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  7. package/.next-prod/server/app/_global-error.html +1 -1
  8. package/.next-prod/server/app/_global-error.rsc +1 -1
  9. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  11. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next-prod/server/app/_not-found.html +2 -2
  14. package/.next-prod/server/app/_not-found.rsc +4 -4
  15. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +4 -4
  16. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +4 -4
  17. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
  20. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  21. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  22. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  23. package/.next-prod/server/app-paths-manifest.json +7 -7
  24. package/.next-prod/server/chunks/2493.js +2 -2
  25. package/.next-prod/server/chunks/5591.js +3 -3
  26. package/.next-prod/server/chunks/7438.js +2 -2
  27. package/.next-prod/server/middleware-build-manifest.js +1 -1
  28. package/.next-prod/server/pages/404.html +2 -2
  29. package/.next-prod/server/pages/500.html +1 -1
  30. package/.next-prod/server/server-reference-manifest.json +1 -1
  31. package/.next-prod/static/chunks/{72550-9aedd46bd54f0be7.js → 72550-456b4a8d1b8a0122.js} +2 -2
  32. package/.next-prod/static/chunks/app/{layout-22f49ab92f208f15.js → layout-6641747151f1495e.js} +1 -1
  33. package/.next-prod/static/css/bc059ebeb7cf61ba.css +1 -0
  34. package/.next-prod/trace +15 -15
  35. package/.next-prod/trace-build +1 -1
  36. package/dist/{chunk-N6CFCP2N.mjs → chunk-UIW3QM6E.mjs} +1 -1
  37. package/dist/{chunk-3LSLUAN6.mjs → chunk-YDI26AYY.mjs} +6 -2
  38. package/dist/httpApi.mjs +2 -2
  39. package/dist/scheduledTasks.mjs +1 -1
  40. package/dist/wsServer.mjs +2 -2
  41. package/package.json +3 -3
  42. package/.next-prod/static/css/e33280be1b23649f.css +0 -1
  43. /package/.next-prod/static/{COnpPKy0RckqiixR3j42H → CzzbCJuWzqFF_23NMp7ya}/_buildManifest.js +0 -0
  44. /package/.next-prod/static/{COnpPKy0RckqiixR3j42H → CzzbCJuWzqFF_23NMp7ya}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- exports.id=7438,exports.ids=[7438],exports.modules={208:(a,b,c)=>{"use strict";c.d(b,{A:()=>g});var d=c(529);let e=JSON.parse('{"common":{"save":"Save","cancel":"Cancel","delete":"Delete","close":"Close","minimize":"Minimize","copy":"Copy","edit":"Edit","file":"File","codeMap":"Code Map","diff":"Diff","confirm":"Confirm","loading":"Loading...","search":"Search","refresh":"Refresh","retry":"Retry","submit":"Submit","copied":"Copied","saved":"Saved","failed":"Failed","noMatch":"No matches","noData":"No data","done":"Done","justNow":"just now","minutesAgo":"{{count}}m ago","hoursAgo":"{{count}}h ago","daysAgo":"{{count}}d ago","monthsAgo":"{{count}}mo ago","yearsAgo":"{{count}}y ago","saveFailed":"Save failed","copyFailed":"Copy failed","deleteFailed":"Delete failed","operationFailed":"Operation failed","copiedPath":"Path copied","copyPath":"Copy path","openInConsole":"Open in Console bubble","copyAbsPath":"Copy absolute path","loadMore":"Load more","noResult":"No results","selected":"Selected","selectAll":"Select all","hint":"Notice","confirmBtn":"OK","cancelBtn":"Cancel","preview":"Preview","readable":"Readable","previous":"Previous","next":"Next","all":"All","input":"Input","result":"Result","line":"Line","lines":"lines","running":"Running","connecting":"Connecting","connected":"Connected","connectionFailed":"Connection failed","builtin":"Built-in","global":"Global","project":"Project","current":"Current","code":"Code"},"htmlApps":{"title":"HTML Apps","addTooltip":"Add to HTML panel","added":"Added to HTML panel","alreadyAdded":"Already added","addFailed":"Failed to add","add":"Add","adding":"Adding...","addHtmlApp":"Add HTML app","searchPlaceholder":"Search HTML apps...","pathLabel":"Absolute path to the .html file","invalid":"Invalid","builtin":"Built-in","noDescription":"No description","emptyNoApps":"No custom HTML apps yet.","emptyCreatePrefix":"Use","emptyCreateSuffix":"in chat to create a new app.","addExisting":"add an existing HTML file","viewDocs":"view docs","emptyNoMatch":"No HTML apps match your search."},"skills":{"addTooltip":"Add to Skills panel","added":"Added to Skills panel","alreadyAdded":"Already added","addFailed":"Failed to add","title":"Skills","searchPlaceholder":"Search skills...","clearSearch":"Clear","addSkill":"Add Skill","emptyNoSkills":"No skills yet.","emptyIntroPrefix":"Use","emptyIntroSuffix":"in chat to distil a reusable workflow into a SKILL.md file.","emptyNoMatch":"No skills match your search.","viewDocs":"view docs","pathLabel":"Absolute path to SKILL.md","pathPlaceholder":"/Users/you/.../skills/foo/SKILL.md","add":"Add","adding":"Adding...","invalid":"Invalid","copyPath":"Copy path","noDescription":"No description","previewTitle":"Skill Preview","source":"Source","cannotRead":"File cannot be read."},"toast":{"savedSuccess":"Saved","saveFailed":"Save failed","copiedName":"Copied: {{name}}","copyFailed":"Copy failed","deleteFailed":"Delete failed","operationFailed":"Operation failed","staged":"Staged","stageFailed":"Stage failed","unstaged":"Unstaged","unstageFailed":"Unstage failed","stagedNFiles":"Staged {{count}} files","unstagedNFiles":"Unstaged {{count}} files","discardFailed":"Discard failed","discardedNFiles":"Discarded changes in {{count}} files","deletedFile":"File deleted","discardedChanges":"Changes discarded","pastedFile":"Pasted: {{name}}","pasteFailed":"Paste failed","noFileToPaste":"No file to paste","createdFile":"Created: {{name}}","createFailed":"Create failed","movedToTrash":"Moved to trash: {{name}}","copiedPageUrl":"Page URL copied","copiedDirPath":"Directory path copied","switchedToBranch":"Switched to {{branch}}","switchBranchFailed":"Branch switch failed","loadBranchFailed":"Failed to load branches","copiedCommand":"Copied: {{command}}","copiedMessage":"Message copied","sentToPeer":"Sent to the other pane","sendToPeerFailed":"Failed to send to the other pane","forkFailed":"Failed to fork session","excerptFailed":"Failed to excerpt this turn","turnDeleted":"Turn deleted","deleteTurnFailed":"Failed to delete this turn","copiedUrl":"URL copied","copiedOutput":"Output copied","copiedCmd":"Command copied","copiedComment":"Comment copied","copiedAllComments":"All comments copied","copiedFileContent":"File content copied","copiedQA":"Copied {{count}} Q&A","copiedAllQA":"All Q&A copied","sentQA":"Sent to AI","readFileFailed":"Failed to read file","fileOutsideProject":"File is outside this project — only Markdown, CSV and images can be previewed","reviewCreated":"Review created, link copied","reviewUpdated":"Review updated, link copied","reviewCreateFailed":"Failed to create review","sharingClosed":"Sharing disabled","sharingCloseFailed":"Failed to disable sharing","linkCopied":"Link copied","addCommentFailed":"Failed to add comment","deleteCommentFailed":"Failed to delete comment","editCommentFailed":"Failed to edit comment","addReplyFailed":"Failed to add reply","deleteReplyFailed":"Failed to delete reply","editReplyFailed":"Failed to edit reply","disconnected":"Disconnected: {{id}}","pluginReloading":"Reloading extension...","worktreeCreateSuccess":"Worktree created: {{name}}","worktreeCreateFailed":"Failed to create worktree","worktreeLoadFailed":"Failed to load worktree list","worktreeDeleted":"Worktree deleted","worktreeDeleteFailed":"Failed to delete worktree","worktreeLocked":"Locked","worktreeUnlocked":"Unlocked"},"workspace":{"selectProject":"Select a project to start","searchProjectPath":"Search project path...","loadingProjects":"Loading projects...","projectNotFound":"No projects found","sessions":"{{count}} sessions","loadingSessions":"Loading sessions...","noSessions":"No sessions","loadingText":"Loading...","openProject":"Open Project","expandSidebar":"Expand sidebar","collapseSidebar":"Collapse sidebar","notes":"Notes","skills":"Skills","apps":"Apps","settings":"Settings","help":"Help","updateAvailable":"v{{version}} available","copyUpgradeCommand":"Copy cockpit update","updateNow":"Update now","updating":"Updating…","updateComplete":"Update complete","updateFailed":"Update failed","updateCardPreparing":"Preparing update…","updateCardInstalling":"Downloading and installing","updateCardRepairing":"Repairing native dependency","updateCardUpToDate":"Already on the latest version, v{{version}}","updateCardCopyFix":"Copy fix command","updateCardFixCopied":"Fix command copied","updateCardRollingBack":"Install failed, rolling back","updateCardRestarting":"Restarting Cockpit…","updateCardDone":"Updated to v{{version}}","updateCardElapsed":"{{seconds}}s elapsed","updateCardBaseline":"last time ~{{seconds}}s","updateCardNoLiveStatus":"Live status unavailable; the update is still running","updateCardRolledBack":"Rolled back to the previous version; Cockpit is usable.","updateCardManualHint":"You can retry from a terminal:","updateCardLogHint":"Log: {{path}}","updateRestartNote":"Cockpit will restart in the background.","viewChangelog":"View changelog","serverRestarted":"Cockpit was updated in the background.","reloadNow":"Reload","upgradeCommandCopied":"Copied `cockpit update`","projectNotes":"Project Notes","closeProject":"Close project","bots":"Bots"},"mobile":{"useDesktop":"Desktop","messagePlaceholder":"Message…","send":"Send","stop":"Stop","enableNotifications":"Enable notifications","disableNotifications":"Disable notifications","notifyError":"Could not enable notifications"},"sessions":{"recentSessions":"Recent Sessions","favorites":"Favorite Sessions","noFavorites":"No favorite sessions yet. Click the star in the tab bar to add.","addFavorite":"Add to favorites","removeFavorite":"Remove from favorites","runningCount":"{{count}} running","unreadCount":"{{count}} unread","noSessions":"No sessions yet","running":"Running","done":"Done","editTitle":"Edit title","projectSessions":"Project Sessions","browseAllSessions":"Browse all sessions","sessionList":"Session List","search":"Search","searchSessions":"Search sessions...","searchRecentSessions":"Search recent sessions","loadSessionsFailed":"Failed to load sessions","loadingSessions":"Loading sessions...","noMatchingSessions":"No matching sessions","noSessionsYet":"No sessions yet","projectList":"Project List","openFolder":"Open Folder","loadingHistory":"Loading history..."},"scheduledTasks":{"title":"Scheduled Tasks","aboutToTrigger":"About to trigger","secondsLater":"in {{count}}s","minutesLater":"in {{count}}m","hoursMinutesLater":"in {{h}}h {{m}}m","hoursLater":"in {{h}}h","onceType":"Once ({{minutes}}min)","everyNMinutes":"Every {{minutes}}min","completed":"Completed","paused":"Paused","activeCount":"{{running}} active","pausedCount":"{{paused}} paused","noScheduledTasks":"No scheduled tasks. Click the clock button in the chat input to create one.","lastResult":"Last","runNow":"Run now","deleteFailed":"Failed to delete the task","resume":"Resume","pause":"Pause","completedCount":"Completed ({{count}})","groupPendingReview":"Finished \xb7 to review","groupUpcoming":"Running \xb7 upcoming","openSession":"Open session","selectTaskHint":"Select a task on the left to preview its session messages","noTaskMessages":"No messages in this task\'s session yet","success":"Success","failure":"Failed","createTask":"Create Scheduled Task","editTask":"Edit Scheduled Task","sendMessage":"Message","messagePlaceholder":"Enter message to send...","taskFile":"Task File","taskFilePlaceholder":"/Users/you/project/tasks/daily-report.md","taskFileHint":"Absolute path. On each fire the agent reads this file first and acts on what it describes — edits take effect on the next run.","taskFilePromptHeader":"Read this task file first, then act accordingly:","type":"Type","once":"Once","interval":"Interval","quickSelect":"Quick Select","customCron":"Custom Cron Expression","customMinutes":"Custom minutes","cronPlaceholder":"e.g. 0 9 * * 1-5 (weekdays at 9am)","cronFormat":"Format: min hour day month weekday (e.g. 0 9 * * 1-5)","minutesPlaceholder":"Minutes","limitTimeRange":"Limit execution time range","to":"to","saveBtn":"Save ({{modKey}}↩)","createBtn":"Create ({{modKey}}↩)","5minLater":"In 5 minutes","15minLater":"In 15 minutes","30minLater":"In 30 minutes","1hourLater":"In 1 hour","every15min":"Every 15 min","every30min":"Every 30 min","every1hour":"Every 1 hour","every2hours":"Every 2 hours","daily9am":"Daily 09:00","daily6pm":"Daily 18:00","weeklyMon9am":"Mon 09:00","monthly1st9am":"1st of month 09:00"},"runningTerminals":{"title":"Terminals","status":"{{count}} terminal(s) \xb7 {{projects}} project(s)","keys":"↑↓ select \xb7 Enter open \xb7 Del stop \xb7 Esc close","empty":"No terminals running","currentProject":"current project","stop":"Stop","confirmStop":"Stop this process?","stopping":"Stopping…","stopFailed":"Failed to stop the terminal","notFound":"Couldn\'t find this terminal\'s bubble"},"cron":{"everyNMinutes":"Every {{n}} minutes","everyNHours":"Every {{n}} hours","everyMinute":"Every minute","everyHourAtMin":"Every hour at minute {{m}}","hourlyEveryMin":"{{h}}:xx every minute","daily":"Daily at {{time}}","weekdays":"Weekdays","weekends":"Weekends","dowSun":"Sun","dowMon":"Mon","dowTue":"Tue","dowWed":"Wed","dowThu":"Thu","dowFri":"Fri","dowSat":"Sat","monthPrefix":"","dayOfMonth":"","dayRange":"{{a}}th to {{b}}th","weekdayPrefix":"","weekdayRange":"{{a}} to {{b}}"},"blockViewer":{"empty":{"body":"Select a file in the left tree to see its code map.","hint":"or press ⌘K to search."},"fileMode":{"loading":"Loading…","notFound":"This file is not indexed (unsupported language or beyond the file cap)."},"buildProgress":{"listing":"Listing files…","contexts":"Reading project config…","parsing":"Parsing files","resolving":"Resolving imports…","edges":"Building call graph…","done":"Finishing up…"},"search":{"tooltip":"Search (⌘K)","hint":"Start typing to search","noResults":"No matches","files":"Files","symbols":"Symbols"},"viewerToggle":{"toBlock":"Show code map","toCode":"Back to code view"},"tabs":{"toc":"Functions","history":"Trail"},"toc":{"title":"this file","empty":"No functions detected.","notIndexed":"File not in project graph (unsupported language / not in git tracked set / file cap reached)."},"history":{"title":"recent","empty":"Click an input or output pin to begin tracing.","clear":"Clear history"},"refresh":"Rebuild project graph","retry":"Retry"},"blockDiffViewer":{"loading":"Building code map…","unsupported":"Code map diff is not available for this file type.","unsupportedHint":"Switch back to the regular diff view to read it.","error":"Code map diff failed: {{message}}","noBlockChanges":"No code-map changes (formatting / whitespace only).","noBefore":"(new)","noAfter":"(removed)","kind":{"added":"added","deleted":"deleted","modified":"modified"}},"fileBrowser":{"directoryTree":"Tree","searchTab":"Search","recentTab":"Recent","changesTab":"Status","historyTab":"History","searchFiles":"Search files...","clear":"Clear","exactMatchOn":"Exact match (on)","exactMatchOff":"Exact match (off)","refreshTree":"Refresh directory tree","collapseAll":"Collapse all directories","searchFileContent":"Search file contents...","caseSensitive":"Case sensitive","wholeWord":"Whole word","regex":"Regex","fileTypes":"File types (ts,tsx)","compareMode":"Compare","compareModeOff":"Close branch comparison","compareModeOn":"Compare with selected branch","compareScopeHead":"HEAD","compareScopeWorktree":"Worktree","compareScopeHeadHint":"Compare committed work only","compareScopeWorktreeHint":"Include uncommitted changes (staged / unstaged / untracked)","createFile":"New File","createFileIn":"New File (in {{path}}/)","fileName":"File name...","noRecentFiles":"No recent files","stagingArea":"Staged ({{count}})","changesSummary_one":"{{count}} change","changesSummary_other":"{{count}} changes","noChanges":"No changes in working tree","refreshChanges":"Refresh changes","unstageAll":"Unstage all","noStagedFiles":"No staged files","unstageNFiles":"Unstage {{count}} files","unstageFile":"Unstage","workspace":"Workspace ({{count}})","discardAll":"Discard all","stageAll":"Stage all","noUnstagedChanges":"No unstaged changes","discardNFiles":"Discard changes in {{count}} files","stageNFiles":"Stage {{count}} files","discardChanges":"Discard changes","stageFile":"Stage file","loadingDiff":"Loading diff...","noDiffFiles":"No diff files","nFilesChanged":"{{count}} files changed (vs {{branch}})","nFilesChangedWorktree":"{{count}} files changed (vs {{branch}}, incl. uncommitted)","noDiffFilesHeadHint":"Nothing committed on this branch yet — switch to Worktree to see uncommitted changes","loadingCommits":"Loading commits...","noCommits":"No commits","allLoaded":"All {{count}} records loaded","locateInTree":"Locate in directory tree","unsaved":"Unsaved","saveBeforeSwitch":"Current file has unsaved changes. Save before switching?","saveAndSwitch":"Save and switch","closeEdit":"Close edit (ESC)","closeBtn":"Close","copyFileContent":"Copy file content","toggleJsonReadable":"Toggle JSON readable mode","previewMarkdown":"Preview Markdown","exitPreview":"Exit Preview","collapseAllJson":"Fold","expandAllJson":"Full","viewBlame":"View line-by-line change history","viewDiff":"View changes against HEAD","exitDiff":"Exit Diff","diffLoadFailed":"Failed to load diff","editFile":"Edit file","backToPreview":"Back to preview","cannotPreview":"Cannot preview this file","selectFileToPreview":"Select a file to preview","staged":"Staged","unstaged":"Unstaged","selectFileToViewDiff":"Select a file to view diff","loadingDiffContent":"Loading diff...","clickCompareToLoad":"Click \\"Compare\\" to load branch diff","selectCommitToView":"Select a commit to view details","confirmDelete":"Confirm Delete","confirmDeleteMessage":"Move <file>{{name}}</file> to trash?","nFilesNMatches":"{{files}} files, {{matches}} matches","resultsTruncated":"Results truncated","noContentSearchResults":"No results","enterKeywordToSearch":"Enter keyword to search file contents","searchMinChars":"Search requires at least 2 characters"},"csv":{"table":"Table","raw":"Raw","empty":"Empty table","summary":"{{rows}} rows \xb7 {{cols}} columns","summaryFiltered":"{{rows}} / {{total}} rows matched \xb7 {{cols}} columns","loadMore":"Load more ({{shown}} / {{total}} shown)","filterPlaceholder":"Filter rows…","filterColumn":"Filter column","clearFilter":"Clear filter","allColumns":"All columns","noMatch":"No matching rows","sortHint":"Click to sort (asc / desc / off)"},"codeViewer":{"fileModifiedExternally":"File was modified externally. Saving will overwrite external changes.","useDiskVersion":"Use disk version","forceOverwrite":"Force overwrite","searchPlaceholder":"Search...","caseSensitive":"Case sensitive","wholeWordMatch":"Whole word match","unsavedConfirm":"You have unsaved changes. Close anyway?","discardChanges":"Discard changes","continueEditing":"Continue editing","unsavedExitConfirm":"You have unsaved changes. Exit edit mode?","clickToViewDetails":"Click to view details","clickToViewCommit":"Click to view commit details","nComments":"{{count}} comments","searchChat":"Search chat...","prevShiftEnter":"Previous (Shift+Enter)","nextEnter":"Next (Enter)","closeEsc":"Close (Esc)"},"chat":{"startConversation":"Start a conversation","loadMoreHistory":"Load more...","scrollUpForMore":"↑ Scroll up to load more history","jumpToStart":"Jump to start","jumpToLatest":"Jump to latest","jumpToPrevUserMessage":"Previous user message","jumpToNextUserMessage":"Next user message","recentUserMessages":"Recent user messages","moreUserMessages":"More","userMessage":"User message","recentUserMessageNumber":"Recent user message {{index}} of {{total}}","imageMessage":"Image message","copyMessage":"Copy message","copyImage":"Copy image","copiedImage":"Image copied","forkSession":"Fork session from here","excerptTurn":"Excerpt this turn to a new session","newSession":"New session","continueFromHere":"Continue from here","continueFromHereDesc":"Keep all context through this turn","onlyThisTurn":"Only this turn","onlyThisTurnDesc":"Keep only this question and answer","deleteTurn":"Delete turn","deletingTurn":"Deleting…","deleteTurnConfirm":"Delete this question, answer, and its tool records? This cannot be undone.","deleteTurnConfirmAction":"Delete turn","deleteTurnWhileRunning":"A turn cannot be deleted while the session is running","sendToPeerPane":"Send this message to the other pane","imageN":"Image {{index}}","imagePreview":"Image preview","toolCalls":"{{count}} tool calls","collapse":"▲ Collapse","expand":"▼ Expand","showMore":"Show more","showLess":"Show less","subagent":"Subagent","subagentEmpty":"No subagent transcript found","subagentViewTitle":"View subagent transcript","workflowRun":"Run details","workflowViewTitle":"View workflow run details","workflowEmpty":"No workflow run journal found","workflowAgents":"agents","workflowViewAgent":"View","workflowUngrouped":"Ungrouped","viewQuestions":"View questions","viewAllFileChanges":"View all file changes","requestFailed":"Request failed","cannotReadStream":"Cannot read response stream","errorRetry":"An error occurred, please retry","codexResumeFailed":"Previous session is in use by another Codex client — started a new session; history was not carried over","codexResumeFailedPrevious":"Previous session","codexResumeFailedNew":"New session","placeholder":"Type a message, Enter to send (Shift+Enter for new line, paste images; start a line with / (skill), /@ (skill in a subagent) or @ (bot in a subagent), multiple allowed)","placeholderDisabled":"Generating... you can keep typing (ESC to cancel; if stuck, cancel and resend \'continue\')","imageSizeLimit":"Image size exceeds limit (max 5MB), current: {{size}}MB","viewGitChanges":"View Git changes","viewAllComments":"View all comments","userMessages":"User messages","projectNotes":"Project Notes","scheduledTasks":"Scheduled Tasks","quickInstructions":"Quick Instructions","globalInstructions":"Global Instructions","projectInstructions":"Project Instructions","noQuickInstructions":"No quick instructions yet","addQuickInstruction":"Add quick instruction","quickInstructionPlaceholder":"One-line instruction — Enter to save, Esc to cancel","insertQuickInstruction":"Insert into input (without sending)","addInstructionGroup":"New group","instructionGroupNamePlaceholder":"Group name — Enter to save, Esc to cancel","instructionGroupLabel":"Group","instructionGroupNone":"No group","deleteInstructionGroupConfirm":"Deleting \\"{{name}}\\" also deletes the {{count}} instruction(s) inside it. Continue?","editGlobalInstructions":"Edit global instructions","editProjectInstructions":"Edit project instructions","quickInstructionsMarkdownHint":"One top-level entry per line. Add lines beginning with “- ” after a group name for its instructions. Write \\\\n for a line break inside one instruction.","quickInstructionsMarkdownPlaceholder":"Continue\\nDraw with text\\n- Draw a login flow\\n- Draw a system architecture","quickInstructionsMarkdownError":"Invalid format on line {{line}}.","savingQuickInstructions":"Saving...","saveQuickInstructionsFailed":"Could not save. Your edits are still here; please try again.","context":"Context","output":"Output","copiedCommandTooltip":"Copied!","copyCommandTooltip":"Copy command: {{command}}","executedCommand":"Executed `{{command}}`{{exitInfo}}, output:\\n```\\n{{output}}\\n```","executedCommandFailed":"Failed to execute `{{command}}`: {{error}}","executionMode":"Execution Mode","checkBalance":"Check balance","balanceFailed":"Query failed — check the API key","balanceNeedsKey":"Set a DeepSeek API key first","balanceUnavailable":"Account is not available for requests","balanceEmpty":"No balance returned","openUsagePage":"Open DeepSeek usage console","checkQuota":"Check quota","quotaFailed":"Quota unavailable — check the API key","quotaNeedsKey":"Set an API key first","quotaEmpty":"No quota returned","quotaResetAt":"Resets {{time}}","openProviderConsole":"Open the provider console","planMode":"Plan mode","planModeDesc":"read-only, plans first without edits","planModeOn":"Plan mode on — read-only; send a task to get a plan","planModeOff":"Plan mode off","planModeHint":"Plan mode: read-only exploration that produces a plan without editing. Uncheck and resend to implement.","noHistory":"No history context","noHistoryDesc":"each prompt is independent","noHistoryHint":"No history context: each message is sent to the model on its own, with no prior conversation. The transcript above still records everything.","outputStyle":"Output style","outputStyleNone":"None","noOutputStyles":"No output styles yet — add one with the pencil","editOutputStyles":"Edit output styles","outputStylesMarkdownHint":"Start each style with \\"# Name\\". Everything up to the next \\"# \\" is appended verbatim to the end of the system prompt (multi-line; deeper headings like ## are content).","outputStylesMarkdownPlaceholder":"# Concise\\nAnswer in at most three sentences, no preamble.\\n\\n# Teacher\\nExplain why before how.","outputStylesError":{"content-before-heading":"Line {{line}}: content must come after a \\"# Name\\" heading.","empty-style":"Line {{line}}: a style needs both a name and content.","duplicate-name":"Line {{line}}: duplicate style name."},"planTitle":"Plan (awaiting your review)","approvePlan":"Approve & run","planApproveHint":"No approval dialog here — click to exit plan mode and execute","approvePlanPrompt":"Approved — proceed with the plan above.","maximizePane":"Maximize this pane","restorePane":"Restore both panes","closePane":"Close this pane","singlePane":"Single pane","splitPane":"Split into two panes"},"console":{"enterCommandOrUrl":"Enter a command or URL to start","emptyIntro":"Type any of the following in the input bar to create a bubble:","bubbleCommand":"Command","bubbleInteractive":"Interactive","bubbleBrowser":"Browser","bubbleBrowserNoteIframe":"Some sites block iframe embedding — install Cockpit Bridge under Settings → Browser Extension before opening.","bubbleBrowserNoteCookie":"If a logged-in site first shows as signed out, refresh a few times to restore it.","bubbleDatabase":"Database","bubbleFilePreview":"File preview","loadingMore":"Loading...","loadMoreHistory":"Load more history","quickCommands":"Quick Commands","singleColumn":"Single column","dualColumn":"Dual column","envVars":"Environment Variables","launchShell":"Launch interactive shell","htmlApps":"HTML apps","inputPlaceholder":"Enter command or URL and press Enter... (↑↓ history, Tab complete)","scopeProject":"Project","scopeGlobal":"Global","tabSwitchEscClose":"Tab to switch \xb7 Esc to close","copyOutput":"Copy output","copyCommand":"Copy command","rerun":"Re-run","deleteRecord":"Delete record","searchPlaceholder":"Search...","searchMode":"Search","filterMode":"Filter","prevShiftEnter":"Previous (Shift+Enter)","nextEnter":"Next (Enter)","loadingTerminal":"Loading terminal...","clickToInput":"Click terminal area to type","stdinPlaceholder":"stdin input...","runningText":"Running...","exitCode":"Exit code: {{code}}","totalLines":"{{count}} lines total","globalCommands":"Global Commands","projectCommands":"Project Commands","noCustomCommands":"No custom commands yet","namePlaceholder":"Name","commandPlaceholder":"Command","restoreTooltip":"Restore ({{modKey}}M / ESC)","screenshotting":"Screenshotting...","outputFileDeleted":"[Output file deleted]"},"browser":{"blankPage":"Blank page","copyUrl":"Copy URL","openInNewWindow":"Open in new window","exitMaximize":"Exit maximize ({{modKey}}M)","maximize":"Maximize ({{modKey}}M)","pageLoadFailed":"Page load failed","clickToWake":"Click to wake","sleeping":"Sleeping","loadingPage":"Loading...","loadFailed":"Load failed"},"database":{"connectionFailed":"Connection failed","connected":"Connected","connecting":"Connecting...","refreshTableList":"Refresh table list","filterTable":"T Tables","filterView":"V Views","noTables":"No tables","tabStructure":"Structure","tabData":"Data","tabSql":"SQL","filterActive":"Filter: {{count}} cols","clearAllFilters":"Clear all filters","deleteNRows":"Delete {{count}} rows","confirmDeleteRows":"Confirm delete?","copyCsvSelected":"Copy selected rows as CSV","copyCsvAll":"Export all as CSV","copyJsonSelected":"Copy selected rows as JSON","copyJsonAll":"Export all as JSON","copyCSV":"Copy CSV","CSV":"CSV","copyJSON":"Copy JSON","JSON":"JSON","selectTable":"Select a table","selectTableToView":"Select a table to view structure","selectTableForData":"Select a table to view data","columns":"Columns","colName":"Name","colType":"Type","colNullable":"Nullable","colDefault":"Default","primaryKey":"Primary Key","foreignKeys":"Foreign Keys","indexes":"Indexes","enable":"Enable","commaValues":"Comma-separated values","likePattern":"%pattern%","valuePlaceholder":"Value","apply":"Apply","clearFilter":"Clear","addRow":"+ Add Row","totalRows":"{{count}} rows","rowsAffected":"{{command}} — {{count}} rows affected ({{duration}}ms)","queryRows":"{{count}} rows ({{duration}}ms)","resultTruncated":"[Results truncated to 1000 rows]","sqlPlaceholder":"Enter SQL... ({{modKey}}Enter to execute)","executing":"Executing...","execute":"▶ Execute","deleteRowsFailed":"{{count}} rows failed to delete","inputParams":"Input Parameters","resultLabel":"Result"},"mysql":{"connectionFailed":"Connection failed","connected":"Connected","connecting":"Connecting...","refreshTableList":"Refresh table list","filterTable":"T Tables","filterView":"V Views","noTables":"No tables","tabStructure":"Structure","tabData":"Data","tabSql":"SQL","filterActive":"Filter: {{count}} cols","clearAllFilters":"Clear all filters","deleteNRows":"Delete {{count}} rows","confirmDeleteRows":"Confirm delete?","copyCsvSelected":"Copy selected rows as CSV","copyCsvAll":"Export all as CSV","copyJsonSelected":"Copy selected rows as JSON","copyJsonAll":"Export all as JSON","copyCSV":"Copy CSV","CSV":"CSV","copyJSON":"Copy JSON","JSON":"JSON","selectTable":"Select a table","selectTableToView":"Select a table to view structure","selectTableForData":"Select a table to view data","columns":"Columns","colName":"Name","colType":"Type","colNullable":"Nullable","colDefault":"Default","primaryKey":"Primary Key","foreignKeys":"Foreign Keys","indexes":"Indexes","enable":"Enable","commaValues":"Comma-separated values","likePattern":"%pattern%","valuePlaceholder":"Value","apply":"Apply","clearFilter":"Clear","addRow":"+ Add Row","totalRows":"{{count}} rows","rowsAffected":"{{command}} — {{count}} rows affected ({{duration}}ms)","queryRows":"{{count}} rows ({{duration}}ms)","resultTruncated":"[Results truncated to 1000 rows]","sqlPlaceholder":"Enter SQL... ({{modKey}}Enter to execute)","executing":"Executing...","execute":"▶ Execute","deleteRowsFailed":"{{count}} rows failed to delete"},"redis":{"neverExpires":"Never expires","expired":"Expired","loadFailed":"Load failed","deleteFailed":"Delete failed","saveFailed":"Save failed","scanPlaceholder":"SCAN pattern...","scanSearch":"Search (SCAN)","noKeys":"No keys","loadMore":"Load more...","tabData":"Data","tabInfo":"Info","tabCli":"CLI","selectKey":"Select a key","keyNotExist":"Key does not exist","unsupportedType":"Unsupported type: {{type}}","nItems":"{{total}} items","showingN":"showing {{count}}","nMembers":"{{total}} members","nEntries":"{{total}} entries","cliHint":"Enter Redis commands, e.g. PING, GET key, KEYS *","cliPlaceholder":"Enter command..."},"git":{"switchBranch":"Switch branch","searchBranch":"Search branches...","noBranches":"No branches available","noMatchingBranches":"No matching branches","localBranches":"Local Branches","remoteBranches":"Remote Branches","branchNotFound":"Branch not found","selectBranch":"Select branch...","currentBranch":"Current","notGitRepo":"Current directory is not a Git repository","cannotGetBranches":"Cannot get branch info","getBranchesFailed":"Failed to get branch info","discardAllConfirm":"Discard changes in {{count}} workspace files? This cannot be undone.","worktree":{"title":"Git Worktree","count":"{{count}} worktrees","selectBranch":"Select branch","addWorktree":"+ Add Worktree","confirmDelete":"Confirm Delete","confirmDeleteMsg":"Delete this worktree?","path":"Path:","branch":"Branch:","locked":"Locked","unlock":"Unlock","lock":"Lock","searchBranch":"Search branches...","noBranches":"No available branches"}},"comments":{"addComment":"Add Comment","lineRange":"Line {{start}}-{{end}}","inputPlaceholder":"Enter comment...","newComment":"New comment {{range}}","commentPlaceholder":"Enter comment... ({{modKey}}Enter to submit, Esc to cancel)","nComments":"{{count}} comments","allComments":"All Comments","copyAllComments":"Copy all comments","noComments":"No comments yet","clearAll":"Clear all","totalComments":"{{count}} comments total","aiReply":"AI Reply","noContent":"(no content)","linesCount":"({{count}} lines)","codeRef":"Here are my annotated comments and references:","note":"Note: {{content}}","submitting":"Submitting...","enterSubmit":"Enter to submit \xb7 Shift+Enter for new line","submitComment":"Submit Comment","askAI":"Ask AI","inputQuestion":"Enter your question...","aiGenerating":"Generating, please wait...","enterSend":"Enter to send \xb7 Shift+Enter for new line","sendToAI":"Send to AI","aiResponding":"AI is responding..."},"fileContextMenu":{"createFile":"New File","copyFile":"Copy File","copyFolder":"Copy Folder","pasteHere":"Paste Here","deleteFile":"Delete File","deleteFolder":"Delete Folder","copyRelativePath":"Copy Relative Path","copyAbsolutePath":"Copy Absolute Path","copyRelativeDirPath":"Copy Relative Dir Path","copyAbsoluteDirPath":"Copy Absolute Dir Path","copyFileName":"Copy File Name","copyFolderName":"Copy Folder Name"},"settings":{"title":"Settings","theme":"Theme","themeLight":"Light","themeDark":"Dark","themeSystem":"System","browserExtension":"Browser Extension","extensionInstalled":"Cockpit Bridge installed","extensionNotInstalled":"Cockpit Bridge not installed","extensionDescription":"After installing the Chrome extension, link navigation in iframes will be intercepted: new tab links create new bubbles, page navigation updates the current bubble.","installSteps":"Installation steps:","step1":"1. Open Chrome and navigate to","step2":"2. Enable \\"Developer mode\\" in the top-right corner","step3":"3. Click \\"Load unpacked\\"","step4mac":"4. Press <kbd>Cmd+Shift+G</kbd> → paste the path below → Enter","copyExtensionPath":"Copy extension directory path","reloadExtension":"Reload extension","about":"About","language":"Language","languageAuto":"System","switchDark":"Switch to dark","switchLight":"Switch to light","agentsBundled":"bundled"},"editor":{"placeholder":"Write something... Type / for commands","noteTitle":"{{name}} - Notes","noteUntitled":"Notes","saving":"Saving...","conflictReloaded":"This note was changed elsewhere. Loaded the latest version; your recent unsaved edits were discarded.","linkPlaceholder":"Enter URL...","confirmLink":"Confirm","removeLink":"Remove link","heading1":"Heading 1","heading2":"Heading 2","heading3":"Heading 3","bold":"Bold","italic":"Italic","strikethrough":"Strikethrough","inlineCode":"Inline code","link":"Link","bulletList":"Bullet list","orderedList":"Ordered list","taskList":"Task list","blockquote":"Blockquote","codeBlock":"Code block","table":"Table","horizontalRule":"Horizontal rule","insertRowAbove":"Insert row above","insertRowBelow":"Insert row below","insertColumnLeft":"Insert column left","insertColumnRight":"Insert column right","deleteRow":"Delete row","deleteColumn":"Delete column","deleteTable":"Delete table","deleteCodeBlock":"Delete code block","toc":"TOC","expandToc":"Expand TOC","collapseToc":"Collapse TOC"},"slashCommands":{"heading1":"Heading 1","heading1Desc":"Large heading","heading2":"Heading 2","heading2Desc":"Medium heading","heading3":"Heading 3","heading3Desc":"Small heading","bulletList":"Bullet List","bulletListDesc":"Bulleted list","orderedList":"Ordered List","orderedListDesc":"Numbered list","taskList":"Task List","taskListDesc":"Checkable task list","blockquote":"Blockquote","blockquoteDesc":"Quote block","codeBlock":"Code Block","codeBlockDesc":"Code snippet","table":"Table","tableDesc":"Insert 3\xd73 table","horizontalRule":"Divider","horizontalRuleDesc":"Horizontal divider","link":"Link","linkDesc":"Insert hyperlink"},"commands":{"plan":"Enable plan mode \xb7 /plan <task> to plan it \xb7 /plan off to disable"},"review":{"reviewManagement":"Review Management","allReviews":"All Reviews","noOpenReviews":"No open reviews","viewComments":"View comments","nComments":"{{count}} comments","nDocs":"{{count}} docs","nReviews":"{{count}} reviews","docList":"Document List","allReviewsList":"All Reviews","expandList":"Expand list","collapseList":"Collapse list","closeReview":"Close review","reopenReview":"Reopen","deleteReview":"Delete review","noOpenDocs":"No open documents","noReviews":"No reviews","sharing":"Sharing","notShared":"Not shared","closeSharing":"Disable sharing","enableSharing":"Enable sharing","view":"View","setNickname":"Set your nickname","nicknameHint":"Other reviewers will see this name","nicknamePlaceholder":"Enter nickname","skipForNow":"Skip for now","identitySettings":"Identity Settings","reviewNickname":"Review Nickname","random":"Random","selectTextToComment":"Select text to add comment","selectTextHint":"Select text on the left to add a comment","prevComment":"Previous","nextComment":"Next","commentsCount":"{{count}} comments","commentsNavCount":"{{current}}/{{total}} comments","allCommentsTitle":"All Comments","commentsCountBrief":"{{count}}","closedCount":"{{count}} closed","copyAllComments":"Copy all comments","noComments":"No comments yet","closedComments":"Closed ({{count}})","closedLabel":"Closed","moreReplies":"+{{count}} replies","copyComment":"Copy comment","reopen":"Reopen","closeComment":"Close comment","editComment":"Edit comment","deleteComment":"Delete comment","edited":"(edited)","editReply":"Edit reply","deleteReply":"Delete reply","reply":"Reply","replyPlaceholder":"Add a reply...","selectedText":"Selected text","addCommentPlaceholder":"Add a comment...","enterSubmitHint":"Enter to submit, Shift+Enter for new line","commentBtn":"Comment","reviewNotExist":"Review does not exist or has been deleted","loadFailed":"Load failed","networkError":"Network error","reviewNotFound":"Review not found","checkLink":"Please check the link","updatedAt":"Updated {{date}}","active":"Active","closed":"Closed","viewAllComments":"View all comments","viewCommentBtn":"View Comments","copyLink":"Copy Link","reviewSummary":"Review Comments Summary — {{title}}","totalNComments":"{{count}} comments total","quoteRef":"Quote: \\"{{text}}\\"","commentAuthor":"Comment ({{author}}): {{content}}","replyAuthor":" ↳ {{author}}: {{content}}"},"markdown":{"copied":"✓ Copied","copy":"Copy"},"imagePreview":{"previewImage":"Preview image","deleteImage":"Delete image","copyImage":"Copy image","copiedImage":"Image copied"},"tokenStats":{"title":"Claude Code Token Stats","activeHours":"Active Hours Distribution","hourSessions":"{{h}}:00 — {{count}} sessions","messages":"Messages","toolCalls":"Tool Calls","activityTrend":"Activity Trend","byModel":"By Model","tokenUsage":"Token Usage","equivalentCost":"Equivalent Cost","modelCostDetail":"Model Cost Details","model":"Model","share":"Share","total":"Total","totalSessions":"Total Sessions","totalMessages":"Total Messages","equivalentApiCost":"Equivalent API Cost","longestSession":"Longest Session","firstUse":"First Use","notFound":"~/.claude/stats-cache.json not found","day":"Day","week":"Week","month":"Month"},"toolCall":{"inputParams":"Input Parameters","resultLabel":"Result","inputParamsTitle":"View input parameters","resultTitle":"View result","input":"Input","result":"Result","foldedLines":"... ({{count}} lines)"},"fileEditor":{"unsavedConfirm":"You have unsaved changes. Close anyway?","discardChanges":"Discard changes","continueEditing":"Continue editing","externallyModified":"File was modified externally. Saving will overwrite external changes.","useDiskVersion":"Use disk version","forceOverwrite":"Force overwrite"},"quickFileOpen":{"placeholder":"Type file name to open...","noMatch":"No matching files","recent":"Recent","selectHint":"Select","openHint":"Open","closeHint":"Close"},"envManager":{"title":"Environment Variables","tabScope":"Current Tab Only","globalScope":"Global Environment Variables","varNamePlaceholder":"Variable name (e.g. NODE_ENV)","varValuePlaceholder":"Value (e.g. production)","valuePlaceholder":"Value","noVars":"No environment variables yet. Add one to get started."},"aliasManager":{"title":"Command Aliases","description":"Set shortcut aliases for common commands (global)","aliasPlaceholder":"Alias (e.g. ll)","commandPlaceholder":"Full command (e.g. ls -la)","fullCommandPlaceholder":"Full command","usage":"Usage tip:","usageDesc":"Type an alias to execute the corresponding full command","noAliases":"No command aliases yet. Add one to get started."},"diffViewer":{"fileChanges":"File Changes ({{count}})","expandFull":"Expand to full width","exitFull":"Back to column","toggleFileTree":"Toggle file tree","selectFileToView":"Select a file to view changes","sideBySide":"Side by side","unified":"Unified","viewSplit":"Split","viewUnified":"Unified","previewFile":"Preview file","copiedAll":"Full text copied","compact":"Compact","full":"Full","gap":{"hidden":"{{count}} lines hidden","more":"\xb7\xb7\xb7 more +{{count}} \xb7\xb7\xb7","expandUp":"Expand {{count}} lines up","expandDown":"Expand {{count}} lines down","expandAll":"Click to expand {{count}} lines"},"loadingSnapshots":"Loading snapshots…","noChanges":"No file changes detected in this turn","notViewable":"Binary or oversized file — diff not viewable","externalChange":"Concurrent change from another session/process","reconstructed":"reconstructed","reconstructedHint":"Rebuilt from tool-call parameters — not a disk snapshot","truncated":"Too many files — list truncated","aggregate":"Aggregate","aggregateOn":"View the net change across all calls","aggregateOff":"Back to per-call view","fileChangesAggregate":"File Changes ({{count}}) \xb7 Aggregate","aggregateSummary":"{{count}} files changed (across {{calls}} calls)","aggregateLoading":"Aggregating changes…","aggregateEmpty":"No net change after aggregation","aggregateUnavailable":"No snapshots — cannot aggregate","aggregateFailed":"Aggregation failed","aggregateBaselineSkipped":"Skipped {{count}} baseline-scale call(s)","aggregateBaselineIncluded":"Including {{count}} baseline-scale call(s)","callsBaselineHidden":"Hid {{count}} baseline-scale call(s)","callsBaselineShown":"Showing {{count}} baseline-scale call(s)","aggregateSkippedHint":"These calls touched more than {{threshold}} files — usually a branch switch or rebase rather than authored work. Click to toggle.","imageBefore":"Before","imageAfter":"After","imageAdded":"Added","imageDeleted":"Deleted","imageLoadFailed":"Failed to load image","imageUnavailable":"Image not present in either revision"},"commitDetail":{"title":"Commit Details","hash":"Hash:","author":"Author:","date":"Date:","files":"Files:","nChanges":"{{count}} changes","loadingFiles":"Loading files...","noFileChanges":"No file changes","loadingDiff":"Loading diff...","selectFileToView":"Select a file to view diff"},"askQuestion":{"title":"Questions","nQuestions":"{{count}} questions","checkedN":"{{count}} checked","copyChecked":"Copy {{count}} checked Q&A","copyAll":"Copy all Q&A","sendChecked":"Send {{count}} checked Q&A to AI","sendAll":"Send all Q&A to AI","sendNoChat":"No active chat session","checkToCopy":"Check to copy","custom":"Custom","customPlaceholder":"Enter custom answer...","notSelected":"(not selected)"},"tabBar":{"closeTab":"Close tab","closeAll":"Close all tabs","newTab":"New tab"},"tabManagerTopBar":{"copyPageUrl":"Copy page URL","copyDirPath":"Copy directory path","refreshProject":"Refresh project","openInVSCode":"Open in VS Code","openInCursor":"Open in Cursor","aliasesGlobal":"Command Aliases (Global)","tokenStats":"Token Stats","openSurething":"Open Surething"},"hoverTooltip":{"findReferences":"Find References","search":"Search"},"todoViewer":{"title":"Task List","progress":"{{completed}} / {{total}} done"},"userMessages":{"title":"User Messages","noMessages":"No user messages","searchPlaceholder":"Search user messages…","noResults":"No matching messages","loadFailed":"Failed to load","count":"{{shown}} / {{total}}","jumping":"Loading the turns around this message…"},"shortIdBadge":{"clickToDisconnect":"Click to disconnect","clickToRegister":"Click to register and copy CLI command","setTitle":"Name this bubble (so /cc can find it later)","setTitlePlaceholder":"set title","editTitle":"Edit title","titleSet":"Title: {{title}}","dialogTitle":"Name this bubble","dialogPlaceholder":"e.g. alloydb proxy, staging admin"},"api":{"pathForbidden":"Operation not allowed on this path","deleteForbidden":"Delete not allowed on this path","notAFolder":"Target is not a folder","imageTooLarge":"Image too large to preview","cannotPreviewBinary":"Cannot preview binary file","fileTooLarge":"File too large to preview (over 10MB)","fileModifiedExternally":"File was modified externally"},"folderPicker":{"title":"Open Folder","placeholder":"Type or paste a path, e.g. ~/Work/my-app","open":"Open","showHidden":"Show hidden","hint":"↑↓ select \xb7 Tab/Enter go in \xb7 ⌘/Ctrl+Enter open","empty":"No subfolders","noMatch":"No matching folders","notFound":"Folder not found","notDirectory":"Not a folder","denied":"Permission denied. On macOS, grant access in System Settings › Privacy & Security."},"confirm":{"title":"Notice","ok":"OK","cancel":"Cancel"},"floatingToolbar":{"addComment":"Add Comment","sendToAI":"Send to AI","search":"Search"},"quickReply":{"optionA":"A","optionB":"B","optionC":"C","optionD":"D","allRecommended":"Rest recommended","thisOne":"This one","notThis":"Not this","why":"Why?","elaborate":"Say more","example":"Give an example","start":"Do it","continue":"Continue","ok":"OK","done":"Done","edit":"Edit quick replies","editTitle":"Edit quick replies","editHint":"One line per row; separate phrases with commas. Each phrase is sent to the chat exactly as written.","editPlaceholder":"This one, Not this\\nWhy?, Say more","restoreDefault":"Restore defaults","save":"Save","cancel":"Cancel","customizedFor":"Customizing the {{lang}} phrases — the other language is unaffected.","langEn":"English","langZh":"Chinese","saveFailed":"Failed to save quick replies"},"searchResults":{"title":"Search Results","nMatches":"({{count}} matches)","searching":"Searching...","noResults":"No matches","scopeSelected":"Selected","scopeAll":"All"},"references":{"title":"References","searching":"Searching...","notFound":"No references found"},"gitFileTree":{"noFiles":"No files"},"deps":{"action":"Dependencies","none":"none","symbolMessage":"Analyse the dependencies of {{name}} ({{path}}:{{lines}}).\\n\\nCallers: {{callers}}\\nCalls: {{callees}}\\nExternal: {{externals}}\\n\\nExplain which modules it is coupled to, and which of those dependencies could be narrowed."},"explain":{"action":"Explain","fileMessage":"Explain {{path}}","symbolMessage":"Explain {{name}} ({{path}}:{{lines}})","selectionMessage":"Explain","commitFileMessage":"Explain what git commit {{hash}} changed in {{path}}","compareFileMessage":"Explain the git changes to {{path}} in {{base}}...HEAD","compareFileWorktreeMessage":"Explain the changes to {{path}} relative to {{base}}, including uncommitted work","stagedFileMessage":"Explain the git staged changes to {{path}}","unstagedFileMessage":"Explain the git working tree changes to {{path}}"},"reviewUtils":{"adjectives":["Happy","Brave","Quiet","Bright","Gentle","Agile","Free","Clear","Flying","Relaxed","Lively","Wise","Calm","Alert","Composed","Steady","Cheerful","Warm","Bold","Poised"],"nouns":["Panda","Dolphin","Crane","Snow Leopard","Skylark","Squirrel","Flying Fish","Deer","Bluebird","Silver Fox","Owl","Dragonfly","Firefly","Sea Turtle","Butterfly","Monkey","Red-crowned Crane","Antelope","Swallow","Penguin"]},"bots":{"title":"Bots","search":"Search bots","addExisting":"Add bot","addTooltip":"Add as Bot","emptyNoMatch":"No bots match your search.","emptyNoBots":"No bots of your own yet.","emptyCreatePrefix":"Use","emptyCreateSuffix":"in chat to create one.","emptyAddExisting":"add an existing Bot directory","invalid":"Invalid","builtin":"Built-in","remove":"Remove registration","open":"Open as project","pathPlaceholder":"Absolute path to a Bot directory or its BOT.md","addHint":"The directory must contain a BOT.md. Its files are not changed.","added":"Bot added","alreadyAdded":"Already added","removed":"Bot removed; its files were kept.","loadFailed":"Failed to load bots","saveFailed":"Failed to add bot","removeFailed":"Failed to remove bot"}}'),f=JSON.parse('{"common":{"save":"保存","cancel":"取消","delete":"删除","close":"关闭","minimize":"最小化","copy":"复制","edit":"编辑","file":"文件","codeMap":"代码地图","diff":"Diff","confirm":"确认","loading":"加载中...","search":"搜索","refresh":"刷新","retry":"重试","submit":"提交","copied":"已复制","saved":"已保存","failed":"失败","noMatch":"无匹配","noData":"无数据","done":"完成","justNow":"刚刚","minutesAgo":"{{count}}分钟前","hoursAgo":"{{count}}小时前","daysAgo":"{{count}}天前","monthsAgo":"{{count}}个月前","yearsAgo":"{{count}}年前","saveFailed":"保存失败","copyFailed":"复制失败","deleteFailed":"删除失败","operationFailed":"操作失败","copiedPath":"已复制路径","copyPath":"复制路径","openInConsole":"在 Console 气泡打开","copyAbsPath":"复制绝对路径","loadMore":"加载更多","noResult":"无匹配结果","selected":"已选择","selectAll":"全选","hint":"提示","confirmBtn":"确定","cancelBtn":"取消","preview":"预览","readable":"可读","previous":"上一个","next":"下一个","all":"全部","input":"输入","result":"结果","line":"行","lines":"行","running":"运行中","connecting":"连接中","connected":"已连接","connectionFailed":"连接失败","builtin":"内置","global":"全局","project":"项目","current":"当前","code":"代码"},"htmlApps":{"title":"HTML 应用","addTooltip":"添加到 HTML 面板","added":"已添加到 HTML 面板","alreadyAdded":"已添加过","addFailed":"添加失败","add":"添加","adding":"添加中...","addHtmlApp":"添加 HTML 应用","searchPlaceholder":"搜索 HTML 应用...","pathLabel":".html 文件的绝对路径","invalid":"无效","builtin":"内置","noDescription":"无描述","emptyNoApps":"还没有自定义 HTML 应用。","emptyCreatePrefix":"在聊天里使用","emptyCreateSuffix":"创建新应用。","addExisting":"添加已有 HTML 文件","viewDocs":"查看文档","emptyNoMatch":"没有匹配的 HTML 应用。"},"skills":{"addTooltip":"添加到 Skills 面板","added":"已添加到 Skills 面板","alreadyAdded":"已添加过","addFailed":"添加失败","title":"Skills","searchPlaceholder":"搜索 skills...","clearSearch":"清除","addSkill":"添加 Skill","emptyNoSkills":"还没有 skill。","emptyIntroPrefix":"在聊天里使用","emptyIntroSuffix":"把可复用经验整理成 SKILL.md。","emptyNoMatch":"没有匹配的 skill。","viewDocs":"查看文档","pathLabel":"SKILL.md 的绝对路径","pathPlaceholder":"/Users/you/.../skills/foo/SKILL.md","add":"添加","adding":"添加中...","invalid":"无效","copyPath":"复制路径","noDescription":"无描述","previewTitle":"Skill 预览","source":"源码","cannotRead":"无法读取文件。"},"toast":{"savedSuccess":"已保存","saveFailed":"保存失败","copiedName":"已复制: {{name}}","copyFailed":"复制失败","deleteFailed":"删除失败","operationFailed":"操作失败","staged":"已暂存","stageFailed":"暂存失败","unstaged":"已取消暂存","unstageFailed":"取消暂存失败","stagedNFiles":"已暂存 {{count}} 个文件","unstagedNFiles":"已取消暂存 {{count}} 个文件","discardFailed":"放弃变更失败","discardedNFiles":"已放弃 {{count}} 个文件的变更","deletedFile":"已删除文件","discardedChanges":"已放弃变更","pastedFile":"已粘贴: {{name}}","pasteFailed":"粘贴失败","noFileToPaste":"没有可粘贴的文件","createdFile":"已创建文件: {{name}}","createFailed":"创建失败","movedToTrash":"已移动到回收站: {{name}}","copiedPageUrl":"已复制页面地址","copiedDirPath":"已复制目录路径","switchedToBranch":"已切换到 {{branch}}","switchBranchFailed":"切换分支失败","loadBranchFailed":"加载分支列表失败","copiedCommand":"已复制: {{command}}","copiedMessage":"已复制消息","sentToPeer":"已发送到另一栏","sendToPeerFailed":"发送到另一栏失败","forkFailed":"分叉会话失败","excerptFailed":"摘录本轮失败","turnDeleted":"已删除本轮","deleteTurnFailed":"删除本轮失败","copiedUrl":"已复制网址","copiedOutput":"已复制输出","copiedCmd":"已复制命令","copiedComment":"已复制评论","copiedAllComments":"已复制全部评论","copiedFileContent":"已复制文件内容","copiedQA":"已复制 {{count}} 个问答","copiedAllQA":"已复制所有问答","sentQA":"已发送给 AI","readFileFailed":"读取文件失败","fileOutsideProject":"文件在当前项目之外,仅支持预览 Markdown、CSV 和图片","reviewCreated":"评审已创建,链接已复制","reviewUpdated":"评审已更新,链接已复制","reviewCreateFailed":"创建评审失败","sharingClosed":"已关闭分享","sharingCloseFailed":"关闭分享失败","linkCopied":"链接已复制","addCommentFailed":"添加评论失败","deleteCommentFailed":"删除评论失败","editCommentFailed":"编辑评论失败","addReplyFailed":"添加回复失败","deleteReplyFailed":"删除回复失败","editReplyFailed":"编辑回复失败","disconnected":"已断开: {{id}}","pluginReloading":"插件重载中...","worktreeCreateSuccess":"Worktree 创建成功: {{name}}","worktreeCreateFailed":"创建 worktree 失败","worktreeLoadFailed":"加载 worktree 列表失败","worktreeDeleted":"Worktree 已删除","worktreeDeleteFailed":"删除 worktree 失败","worktreeLocked":"已锁定","worktreeUnlocked":"已解锁"},"workspace":{"selectProject":"选择一个项目开始","searchProjectPath":"搜索项目路径...","loadingProjects":"加载项目中...","projectNotFound":"未找到项目","sessions":"{{count}} 会话","loadingSessions":"加载会话...","noSessions":"无会话记录","loadingText":"加载中...","openProject":"打开项目","expandSidebar":"展开侧边栏","collapseSidebar":"折叠侧边栏","notes":"笔记","skills":"技能","apps":"应用","settings":"设置","help":"帮助","updateAvailable":"新版本 v{{version}} 可用","copyUpgradeCommand":"复制 cockpit update","updateNow":"立即更新","updating":"正在更新…","updateComplete":"更新完成","updateFailed":"更新失败","updateCardPreparing":"正在准备更新…","updateCardInstalling":"正在下载并安装","updateCardRepairing":"正在修复原生依赖","updateCardUpToDate":"已是最新版本 v{{version}}","updateCardCopyFix":"复制修复命令","updateCardFixCopied":"已复制修复命令","updateCardRollingBack":"安装失败,正在回滚","updateCardRestarting":"正在重启 Cockpit…","updateCardDone":"已更新到 v{{version}}","updateCardElapsed":"已用 {{seconds}} 秒","updateCardBaseline":"上次约 {{seconds}} 秒","updateCardNoLiveStatus":"暂时读不到实时状态,更新仍在进行","updateCardRolledBack":"已回滚到原版本,Cockpit 可正常使用。","updateCardManualHint":"可在终端手动重试:","updateCardLogHint":"日志:{{path}}","updateRestartNote":"Cockpit 将在后台重启。","viewChangelog":"查看变更日志","serverRestarted":"Cockpit 已在后台更新。","reloadNow":"刷新","upgradeCommandCopied":"已复制 `cockpit update`","projectNotes":"项目笔记","closeProject":"关闭项目","bots":"机器人"},"mobile":{"useDesktop":"桌面版","messagePlaceholder":"发消息…","send":"发送","stop":"停止","enableNotifications":"开启通知","disableNotifications":"关闭通知","notifyError":"无法开启通知"},"sessions":{"recentSessions":"最近会话","favorites":"收藏会话","noFavorites":"暂无收藏会话,在 Tab 栏点击星标可添加","addFavorite":"收藏此会话","removeFavorite":"取消收藏","runningCount":"{{count}} 运行中","unreadCount":"{{count}} 未读","noSessions":"暂无会话记录","running":"运行中","done":"完成","editTitle":"编辑标题","projectSessions":"项目会话","browseAllSessions":"浏览所有会话","sessionList":"会话列表","search":"搜索","searchSessions":"搜索会话...","searchRecentSessions":"搜索最近会话","loadSessionsFailed":"加载会话失败","loadingSessions":"加载会话中...","noMatchingSessions":"未找到匹配的会话","noSessionsYet":"暂无会话","projectList":"项目列表","openFolder":"打开文件夹","loadingHistory":"加载历史消息..."},"scheduledTasks":{"title":"定时任务","aboutToTrigger":"即将触发","secondsLater":"{{count}}秒后","minutesLater":"{{count}}分钟后","hoursMinutesLater":"{{h}}小时{{m}}分后","hoursLater":"{{h}}小时后","onceType":"一次性 ({{minutes}}分钟)","everyNMinutes":"每{{minutes}}分钟","completed":"已完成","paused":"已暂停","activeCount":"{{running}} 个活跃","pausedCount":"{{paused}} 个暂停","noScheduledTasks":"暂无定时任务,在聊天输入栏点击时钟按钮创建","lastResult":"上次","runNow":"立即运行","deleteFailed":"删除任务失败","resume":"恢复","pause":"暂停","completedCount":"已完成 ({{count}})","groupPendingReview":"运行完成待查看","groupUpcoming":"运行中 \xb7 待运行","openSession":"打开会话","selectTaskHint":"选择左侧任务,查看它的会话消息","noTaskMessages":"该任务的会话暂无消息","success":"成功","failure":"失败","createTask":"创建定时任务","editTask":"编辑定时任务","sendMessage":"发送消息","messagePlaceholder":"输入要发送的消息...","taskFile":"任务文件","taskFilePlaceholder":"/Users/you/project/tasks/daily-report.md","taskFileHint":"填写绝对路径。触发时会让 agent 先读取该文件,再按其中描述执行——文件内容改动下次触发即生效。","taskFilePromptHeader":"请先读取以下任务文件,再据此执行:","type":"类型","once":"一次性","interval":"周期","quickSelect":"快捷选择","customCron":"自定义 Cron 表达式","customMinutes":"自定义分钟数","cronPlaceholder":"例: 0 9 * * 1-5 (工作日9点)","cronFormat":"格式:分 时 日 月 星期(如 0 9 * * 1-5)","minutesPlaceholder":"分钟数","limitTimeRange":"限制执行时段","to":"至","saveBtn":"保存 ({{modKey}}↩)","createBtn":"创建 ({{modKey}}↩)","5minLater":"5 分钟后","15minLater":"15 分钟后","30minLater":"30 分钟后","1hourLater":"1 小时后","every15min":"每 15 分钟","every30min":"每 30 分钟","every1hour":"每 1 小时","every2hours":"每 2 小时","daily9am":"每天 09:00","daily6pm":"每天 18:00","weeklyMon9am":"每周一 09:00","monthly1st9am":"每月 1 号 09:00"},"runningTerminals":{"title":"终端","status":"{{count}} 个终端 \xb7 {{projects}} 个项目","keys":"↑↓ 选择 \xb7 Enter 跳转 \xb7 Del 停止 \xb7 Esc 关闭","empty":"没有正在运行的终端","currentProject":"当前项目","stop":"停止","confirmStop":"停止这个进程?","stopping":"停止中…","stopFailed":"停止终端失败","notFound":"没找到这个终端的气泡"},"cron":{"everyNMinutes":"每 {{n}} 分钟","everyNHours":"每 {{n}} 小时整点","everyMinute":"每分钟","everyHourAtMin":"每小时第 {{m}} 分","hourlyEveryMin":"{{h}} 点每分钟","daily":"每天 {{time}}","weekdays":"工作日","weekends":"周末","dowSun":"日","dowMon":"一","dowTue":"二","dowWed":"三","dowThu":"四","dowFri":"五","dowSat":"六","monthPrefix":"月","dayOfMonth":"号","dayRange":"{{a}}号到{{b}}号","weekdayPrefix":"周","weekdayRange":"周{{a}}到周{{b}}"},"blockViewer":{"empty":{"body":"在左侧文件树选择一个文件,查看它的代码地图。","hint":"或按 ⌘K 搜索。"},"fileMode":{"loading":"加载中…","notFound":"该文件未索引(不支持的语言或超出文件上限)。"},"buildProgress":{"listing":"正在扫描文件…","contexts":"正在读取项目配置…","parsing":"正在解析文件","resolving":"正在解析引用关系…","edges":"正在构建调用图…","done":"即将完成…"},"search":{"tooltip":"搜索 (⌘K)","hint":"开始输入以搜索","noResults":"未找到匹配","files":"文件","symbols":"符号"},"viewerToggle":{"toBlock":"显示代码地图","toCode":"返回代码视图"},"tabs":{"toc":"函数列表","history":"跳转记录"},"toc":{"title":"本文件","empty":"未检测到函数。","notIndexed":"该文件未被项目图收录(扩展未支持 / 不在 git 跟踪集 / 超出文件上限)。"},"history":{"title":"最近","empty":"点击左右两侧的 pin 开始追踪调用链。","clear":"清空历史"},"refresh":"重新构建项目图","retry":"重试"},"blockDiffViewer":{"loading":"正在生成代码地图…","unsupported":"该文件类型暂不支持代码地图 diff","unsupportedHint":"切回常规 diff 视图查看。","error":"代码地图 diff 失败:{{message}}","noBlockChanges":"代码地图无变化(仅格式或空白)。","noBefore":"(新增)","noAfter":"(已删除)","kind":{"added":"新增","deleted":"删除","modified":"修改"}},"fileBrowser":{"directoryTree":"目录树","searchTab":"搜索","recentTab":"最近","changesTab":"变更","historyTab":"历史","searchFiles":"搜索文件...","clear":"清除","exactMatchOn":"全词匹配(已开启)","exactMatchOff":"全词匹配(已关闭)","refreshTree":"刷新目录树","collapseAll":"折叠所有目录","searchFileContent":"搜索文件内容...","caseSensitive":"区分大小写","wholeWord":"完整词","regex":"正则","fileTypes":"文件类型 (ts,tsx)","compareMode":"对比","compareModeOff":"关闭分支对比","compareModeOn":"与选定分支对比","compareScopeHead":"HEAD","compareScopeWorktree":"工作区","compareScopeHeadHint":"仅对比已提交的改动","compareScopeWorktreeHint":"对比包含未提交的改动(已暂存 / 未暂存 / 未跟踪)","createFile":"新建文件","createFileIn":"新建文件 (在 {{path}}/)","fileName":"文件名...","noRecentFiles":"暂无最近浏览的文件","stagingArea":"暂存区 ({{count}})","changesSummary_one":"{{count}} 个变更","changesSummary_other":"{{count}} 个变更","noChanges":"工作区无变更","refreshChanges":"刷新变更列表","unstageAll":"全部取消","noStagedFiles":"无暂存的文件","unstageNFiles":"取消暂存 {{count}} 个文件","unstageFile":"取消暂存","workspace":"工作区 ({{count}})","discardAll":"放弃所有","stageAll":"全部暂存","noUnstagedChanges":"无未暂存的变更","discardNFiles":"放弃 {{count}} 个文件的变更","stageNFiles":"暂存 {{count}} 个文件","discardChanges":"放弃变更","stageFile":"暂存文件","loadingDiff":"加载对比文件中...","noDiffFiles":"无差异文件","nFilesChanged":"{{count}} 个文件变更(vs {{branch}})","nFilesChangedWorktree":"{{count}} 个文件变更(vs {{branch}},含未提交)","noDiffFilesHeadHint":"本分支尚无已提交的改动,切到「工作区」可看到未提交的部分","loadingCommits":"加载提交记录中...","noCommits":"无提交记录","allLoaded":"已加载全部 {{count}} 条记录","locateInTree":"在目录树中定位","unsaved":"未保存","saveBeforeSwitch":"当前文件有未保存的修改,是否保存后切换?","saveAndSwitch":"保存并切换","closeEdit":"关闭编辑 (ESC)","closeBtn":"关闭","copyFileContent":"复制文件内容","toggleJsonReadable":"切换 JSON 可读模式","previewMarkdown":"预览 Markdown 渲染效果","exitPreview":"退出预览","collapseAllJson":"折叠","expandAllJson":"展开","viewBlame":"查看每行代码的修改记录","viewDiff":"查看相对 HEAD 的改动","exitDiff":"退出 Diff","diffLoadFailed":"加载差异失败","editFile":"编辑文件","backToPreview":"返回预览","cannotPreview":"无法预览此文件","selectFileToPreview":"选择文件以预览","staged":"已暂存","unstaged":"未暂存","selectFileToViewDiff":"选择文件查看差异","loadingDiffContent":"加载差异中...","clickCompareToLoad":"点击「对比」加载分支差异","selectCommitToView":"选择提交查看详情","confirmDelete":"确认删除","confirmDeleteMessage":"确定要将 <file>{{name}}</file> 移动到回收站吗?","nFilesNMatches":"{{files}} 个文件,{{matches}} 处匹配","resultsTruncated":"结果已截断","noContentSearchResults":"无匹配结果","enterKeywordToSearch":"输入关键词搜索文件内容","searchMinChars":"搜索内容至少需要 2 个字符"},"csv":{"table":"表格","raw":"原始内容","empty":"空表格","summary":"{{rows}} 行 \xb7 {{cols}} 列","summaryFiltered":"匹配 {{rows}} / {{total}} 行 \xb7 {{cols}} 列","loadMore":"加载更多(已显示 {{shown}} / {{total}})","filterPlaceholder":"筛选内容…","filterColumn":"筛选列","clearFilter":"清除筛选","allColumns":"全部列","noMatch":"没有匹配的行","sortHint":"点击排序(升序 / 降序 / 取消)"},"codeViewer":{"fileModifiedExternally":"文件已被外部修改,保存将覆盖外部更改","useDiskVersion":"使用磁盘版本","forceOverwrite":"强制覆盖","searchPlaceholder":"搜索...","caseSensitive":"区分大小写","wholeWordMatch":"全字匹配","unsavedConfirm":"有未保存的修改,确定关闭?","discardChanges":"放弃修改","continueEditing":"继续编辑","unsavedExitConfirm":"有未保存的修改,确定退出编辑模式?","clickToViewDetails":"点击查看详情","clickToViewCommit":"点击查看 commit 详情","nComments":"{{count}} 条评论","searchChat":"搜索聊天内容...","prevShiftEnter":"上一个 (Shift+Enter)","nextEnter":"下一个 (Enter)","closeEsc":"关闭 (Esc)"},"chat":{"startConversation":"开始对话吧","loadMoreHistory":"加载更多...","scrollUpForMore":"↑ 向上滚动加载更多历史","jumpToStart":"跳转到开始","jumpToLatest":"跳转到最新","jumpToPrevUserMessage":"上一条用户消息","jumpToNextUserMessage":"下一条用户消息","recentUserMessages":"最近的用户消息","moreUserMessages":"更多","userMessage":"用户消息","recentUserMessageNumber":"最近用户消息 {{index}}/{{total}}","imageMessage":"图片消息","copyMessage":"复制消息","copyImage":"复制图片","copiedImage":"已复制图片","forkSession":"从此处分叉会话","excerptTurn":"摘录本轮到新会话","newSession":"新建会话","continueFromHere":"延续到此处","continueFromHereDesc":"保留截至本轮的全部上下文","onlyThisTurn":"仅提取本轮","onlyThisTurnDesc":"只带这一轮问答","deleteTurn":"删除本轮","deletingTurn":"正在删除…","deleteTurnConfirm":"确定删除这一轮的问题、回答及工具记录吗?此操作无法撤销。","deleteTurnConfirmAction":"删除本轮","deleteTurnWhileRunning":"会话运行期间不能删除","sendToPeerPane":"发送本条消息到另一栏","imageN":"图片 {{index}}","imagePreview":"图片预览","toolCalls":"{{count}} 个工具调用","collapse":"▲ 收起","expand":"▼ 展开","showMore":"显示更多","showLess":"收起","subagent":"子代理","subagentEmpty":"未找到子代理消息记录","subagentViewTitle":"查看子代理执行过程","workflowRun":"运行详情","workflowViewTitle":"查看工作流运行详情","workflowEmpty":"未找到工作流运行记录","workflowAgents":"个代理","workflowViewAgent":"查看","workflowUngrouped":"未分组","viewQuestions":"查看提问","viewAllFileChanges":"查看所有文件变更","requestFailed":"请求失败","cannotReadStream":"无法读取响应流","errorRetry":"发生错误,请重试","codexResumeFailed":"原会话被其他 Codex 客户端占用,已新建会话,历史未继承","codexResumeFailedPrevious":"原会话","codexResumeFailedNew":"新会话","placeholder":"输入消息,Enter 发送(Shift+Enter 换行,可粘贴图片;行首 /(skill)、/@(子代理执行 skill)或 @(子代理执行机器人),支持多行多命令)","placeholderDisabled":"生成中... 可继续输入 (ESC 取消;卡住太久可取消后重发「继续」)","imageSizeLimit":"图片大小超过限制(最大 5MB),当前大小: {{size}}MB","viewGitChanges":"查看 Git 变更","viewAllComments":"查看所有评论","userMessages":"用户消息列表","projectNotes":"项目笔记","scheduledTasks":"定时任务","quickInstructions":"快捷指令","globalInstructions":"全局指令","projectInstructions":"项目指令","noQuickInstructions":"暂无快捷指令","addQuickInstruction":"新增快捷指令","quickInstructionPlaceholder":"输入一句话指令,Enter 保存,Esc 取消","insertQuickInstruction":"填入输入框(不发送)","addInstructionGroup":"新增分组","instructionGroupNamePlaceholder":"输入分组名,Enter 保存,Esc 取消","instructionGroupLabel":"所属分组","instructionGroupNone":"不分组","deleteInstructionGroupConfirm":"删除分组「{{name}}」会同时删除组内 {{count}} 条指令,确定继续?","editGlobalInstructions":"编辑全局指令","editProjectInstructions":"编辑项目指令","quickInstructionsMarkdownHint":"一级内容每行一条;分组名称后的「- 」开头行是该分组的子命令;单条指令内的换行用 \\\\n 表示。","quickInstructionsMarkdownPlaceholder":"按推荐实施\\n用文本画图\\n- 画一个登录流程\\n- 画一个系统架构","quickInstructionsMarkdownError":"第 {{line}} 行格式不正确。","savingQuickInstructions":"保存中...","saveQuickInstructionsFailed":"保存失败,修改仍然保留,请重试。","context":"上下文","output":"输出","copiedCommandTooltip":"已复制!","copyCommandTooltip":"复制命令: {{command}}","executedCommand":"执行了 `{{command}}`{{exitInfo}},输出:\\n```\\n{{output}}\\n```","executedCommandFailed":"执行 `{{command}}` 失败:{{error}}","executionMode":"执行模式","checkBalance":"查询余额","balanceFailed":"查询失败,请检查 API Key","balanceNeedsKey":"请先配置 DeepSeek API Key","balanceUnavailable":"账户当前不可用","balanceEmpty":"接口未返回余额","openUsagePage":"打开 DeepSeek 用量控制台","checkQuota":"查询额度","quotaFailed":"额度查询失败,请检查 API Key","quotaNeedsKey":"请先设置 API Key","quotaEmpty":"未返回额度信息","quotaResetAt":"{{time}} 重置","openProviderConsole":"打开服务商控制台","planMode":"计划模式","planModeDesc":"只读,先出计划不改代码","planModeOn":"已开启计划模式——只读;发一个任务即可拿到计划","planModeOff":"已关闭计划模式","planModeHint":"计划模式:只读探索、产出计划但不改文件。取消勾选后重发才会实现。","noHistory":"不带历史上下文","noHistoryDesc":"每次提问均独立","noHistoryHint":"不带历史上下文:每条消息单独发给模型,不带之前的对话。上方的会话记录照常保留。","outputStyle":"输出风格","outputStyleNone":"无","noOutputStyles":"暂无输出风格,点右上角铅笔添加","editOutputStyles":"编辑输出风格","outputStylesMarkdownHint":"每个风格以「# 名称」开头,下面直到下一个「# 」之间的内容原样追加到 System Prompt 末尾(可多行,## 等更深标题视为正文)。","outputStylesMarkdownPlaceholder":"# 简洁\\n回答不超过三句话,不要开场白。\\n\\n# 教学\\n先讲为什么,再讲怎么做。","outputStylesError":{"content-before-heading":"第 {{line}} 行:内容必须写在「# 名称」之后。","empty-style":"第 {{line}} 行:风格需要名称和内容。","duplicate-name":"第 {{line}} 行:风格名称重复。"},"planTitle":"计划(待你确认)","approvePlan":"批准并执行","planApproveHint":"本环境无审批弹窗,点此退出计划模式并执行","approvePlanPrompt":"已批准,按上述计划开始执行。","maximizePane":"放大本栏","restorePane":"还原双栏","closePane":"关闭本栏","singlePane":"切回单栏","splitPane":"并排双栏"},"console":{"enterCommandOrUrl":"输入命令或网址开始使用","emptyIntro":"在下方输入框输入以下内容,即可创建对应气泡:","bubbleCommand":"命令","bubbleInteractive":"交互终端","bubbleBrowser":"浏览器","bubbleBrowserNoteIframe":"部分网站会拦截 iframe 嵌入,请在「设置 → 浏览器插件」安装 Cockpit Bridge 后再打开。","bubbleBrowserNoteCookie":"已登录的网站若首次显示未登录,多刷新几次即可恢复。","bubbleDatabase":"数据库","bubbleFilePreview":"文件预览","loadingMore":"加载中...","loadMoreHistory":"加载更多历史","quickCommands":"快捷命令","singleColumn":"单列布局","dualColumn":"双列布局","envVars":"环境变量","launchShell":"启动交互终端","htmlApps":"HTML 应用","inputPlaceholder":"输入命令或网址并按 Enter... (↑↓ 历史, Tab 补全)","scopeProject":"项目","scopeGlobal":"全局","tabSwitchEscClose":"Tab 切换 \xb7 Esc 关闭","copyOutput":"复制输出","copyCommand":"复制命令","rerun":"重新运行","deleteRecord":"删除记录","searchPlaceholder":"搜索...","searchMode":"搜索","filterMode":"过滤","prevShiftEnter":"上一个 (Shift+Enter)","nextEnter":"下一个 (Enter)","loadingTerminal":"加载终端...","clickToInput":"点击终端区域输入","stdinPlaceholder":"stdin 输入...","runningText":"运行中...","exitCode":"退出代码: {{code}}","totalLines":"共 {{count}} 行","globalCommands":"全局命令","projectCommands":"项目命令","noCustomCommands":"暂无自定义命令","namePlaceholder":"名称","commandPlaceholder":"命令","restoreTooltip":"还原 ({{modKey}}M / ESC)","screenshotting":"截图中...","outputFileDeleted":"[输出文件已删除]"},"browser":{"blankPage":"空白页","copyUrl":"复制网址","openInNewWindow":"在新窗口打开","exitMaximize":"退出最大化 ({{modKey}}M)","maximize":"最大化 ({{modKey}}M)","pageLoadFailed":"页面加载失败","clickToWake":"点击唤醒","sleeping":"已休眠","loadingPage":"加载中...","loadFailed":"加载失败"},"database":{"connectionFailed":"连接失败","connected":"已连接","connecting":"连接中...","refreshTableList":"刷新表列表","filterTable":"T 表","filterView":"V 视图","noTables":"无表","tabStructure":"结构","tabData":"数据","tabSql":"SQL","filterActive":"筛选: {{count}}列","clearAllFilters":"清除所有筛选","deleteNRows":"删除 {{count}} 行","confirmDeleteRows":"确认删除?","copyCsvSelected":"复制选中行为 CSV","copyCsvAll":"导出全表 CSV","copyJsonSelected":"复制选中行为 JSON","copyJsonAll":"导出全表 JSON","copyCSV":"复制 CSV","CSV":"CSV","copyJSON":"复制 JSON","JSON":"JSON","selectTable":"选择左侧表格","selectTableToView":"选择表以查看结构","selectTableForData":"选择表以查看数据","columns":"列","colName":"名称","colType":"类型","colNullable":"可空","colDefault":"默认值","primaryKey":"主键","foreignKeys":"外键","indexes":"索引","enable":"启用","commaValues":"逗号分隔多值","likePattern":"%pattern%","valuePlaceholder":"值","apply":"应用","clearFilter":"清除","addRow":"+ 新增行","totalRows":"{{count}} 行","rowsAffected":"{{command}} — {{count}} 行受影响 ({{duration}}ms)","queryRows":"{{count}} 行 ({{duration}}ms)","resultTruncated":"[结果已截断至1000行]","sqlPlaceholder":"输入 SQL... ({{modKey}}Enter 执行)","executing":"执行中...","execute":"▶ 执行","deleteRowsFailed":"{{count}} 行删除失败","inputParams":"输入参数","resultLabel":"结果"},"mysql":{"connectionFailed":"连接失败","connected":"已连接","connecting":"连接中...","refreshTableList":"刷新表列表","filterTable":"T 表","filterView":"V 视图","noTables":"无表","tabStructure":"结构","tabData":"数据","tabSql":"SQL","filterActive":"筛选: {{count}}列","clearAllFilters":"清除所有筛选","deleteNRows":"删除 {{count}} 行","confirmDeleteRows":"确认删除?","copyCsvSelected":"复制选中行为 CSV","copyCsvAll":"导出全表 CSV","copyJsonSelected":"复制选中行为 JSON","copyJsonAll":"导出全表 JSON","copyCSV":"复制 CSV","CSV":"CSV","copyJSON":"复制 JSON","JSON":"JSON","selectTable":"选择左侧表格","selectTableToView":"选择表以查看结构","selectTableForData":"选择表以查看数据","columns":"列","colName":"名称","colType":"类型","colNullable":"可空","colDefault":"默认值","primaryKey":"主键","foreignKeys":"外键","indexes":"索引","enable":"启用","commaValues":"逗号分隔多值","likePattern":"%pattern%","valuePlaceholder":"值","apply":"应用","clearFilter":"清除","addRow":"+ 新增行","totalRows":"{{count}} 行","rowsAffected":"{{command}} — {{count}} 行受影响 ({{duration}}ms)","queryRows":"{{count}} 行 ({{duration}}ms)","resultTruncated":"[结果已截断至1000行]","sqlPlaceholder":"输入 SQL... ({{modKey}}Enter 执行)","executing":"执行中...","execute":"▶ 执行","deleteRowsFailed":"{{count}} 行删除失败"},"redis":{"neverExpires":"永不过期","expired":"已过期","loadFailed":"加载失败","deleteFailed":"删除失败","saveFailed":"保存失败","scanPlaceholder":"SCAN 模式...","scanSearch":"搜索 (SCAN)","noKeys":"无 key","loadMore":"加载更多...","tabData":"数据","tabInfo":"信息","tabCli":"CLI","selectKey":"选择左侧 Key","keyNotExist":"Key 不存在","unsupportedType":"不支持的类型: {{type}}","nItems":"{{total}} items","showingN":"显示 {{count}}","nMembers":"{{total}} members","nEntries":"{{total}} entries","cliHint":"输入 Redis 命令,如 PING, GET key, KEYS *","cliPlaceholder":"输入命令..."},"git":{"switchBranch":"切换分支","searchBranch":"搜索分支...","noBranches":"无可切换分支","noMatchingBranches":"无匹配分支","localBranches":"本地分支","remoteBranches":"远程分支","branchNotFound":"未找到分支","selectBranch":"选择分支...","currentBranch":"当前","notGitRepo":"当前目录不是 Git 仓库","cannotGetBranches":"无法获取分支信息","getBranchesFailed":"获取分支信息失败","discardAllConfirm":"确定要放弃工作区的 {{count}} 个文件的变更吗?此操作不可恢复。","worktree":{"title":"Git Worktree","count":"{{count}} 个 worktree","selectBranch":"选择分支","addWorktree":"+ 添加 Worktree","confirmDelete":"确认删除","confirmDeleteMsg":"确定要删除 worktree 吗?","path":"路径:","branch":"分支:","locked":"已锁定","unlock":"解锁","lock":"锁定","searchBranch":"搜索分支...","noBranches":"无可用分支"}},"comments":{"addComment":"添加评论","lineRange":"行 {{start}}-{{end}}","inputPlaceholder":"输入评论...","newComment":"新评论 {{range}}","commentPlaceholder":"输入评论... ({{modKey}}Enter 提交, Esc 取消)","nComments":"{{count}} 条评论","allComments":"所有评论","copyAllComments":"复制全部评论","noComments":"暂无评论","clearAll":"清空所有","totalComments":"共 {{count}} 条评论","aiReply":"AI 回复","noContent":"(无内容)","linesCount":"({{count}} 行)","codeRef":"以下是我标注的评论和引用:","note":"备注: {{content}}","submitting":"提交中...","enterSubmit":"Enter 提交 \xb7 Shift+Enter 换行","submitComment":"提交评论","askAI":"提问 AI","inputQuestion":"输入你的问题...","aiGenerating":"正在生成中,请稍候...","enterSend":"Enter 发送 \xb7 Shift+Enter 换行","sendToAI":"发送 AI","aiResponding":"AI 正在响应中..."},"fileContextMenu":{"createFile":"新建文件","copyFile":"复制文件","copyFolder":"复制文件夹","pasteHere":"粘贴到此处","deleteFile":"删除文件","deleteFolder":"删除文件夹","copyRelativePath":"复制相对路径","copyAbsolutePath":"复制绝对路径","copyRelativeDirPath":"复制相对文件夹路径","copyAbsoluteDirPath":"复制绝对文件夹路径","copyFileName":"复制文件名","copyFolderName":"复制文件夹名"},"settings":{"title":"设置","theme":"主题","themeLight":"浅色","themeDark":"深色","themeSystem":"跟随系统","browserExtension":"浏览器插件","extensionInstalled":"Cockpit Bridge 已安装","extensionNotInstalled":"Cockpit Bridge 未安装","extensionDescription":"安装 Chrome 插件后,iframe 内的链接跳转将被拦截:新标签链接创建新气泡,页面内导航更新当前气泡。","installSteps":"安装步骤:","step1":"1. 打开 Chrome 地址栏输入","step2":"2. 开启右上角「开发者模式」","step3":"3. 点击「加载已解压的扩展程序」","step4mac":"4. 按 <kbd>Cmd+Shift+G</kbd> → 粘贴下方路径 → 回车","copyExtensionPath":"复制插件目录路径","reloadExtension":"重载插件","about":"关于","language":"语言","languageAuto":"跟随系统","switchDark":"切换暗色","switchLight":"切换亮色","agentsBundled":"内置"},"editor":{"placeholder":"写点什么... 输入 / 打开快捷命令","noteTitle":"{{name}} - 笔记","noteUntitled":"笔记","saving":"保存中...","conflictReloaded":"笔记已被其他地方修改,已加载最新版本,刚才未保存的编辑已丢弃","linkPlaceholder":"输入链接地址...","confirmLink":"确认","removeLink":"移除链接","heading1":"标题 1","heading2":"标题 2","heading3":"标题 3","bold":"粗体","italic":"斜体","strikethrough":"删除线","inlineCode":"行内代码","link":"链接","bulletList":"无序列表","orderedList":"有序列表","taskList":"待办列表","blockquote":"引用","codeBlock":"代码块","table":"表格","horizontalRule":"分割线","insertRowAbove":"在上方插入行","insertRowBelow":"在下方插入行","insertColumnLeft":"在左侧插入列","insertColumnRight":"在右侧插入列","deleteRow":"删除当前行","deleteColumn":"删除当前列","deleteTable":"删除表格","deleteCodeBlock":"删除代码块","toc":"目录","expandToc":"展开目录","collapseToc":"收起目录"},"slashCommands":{"heading1":"标题 1","heading1Desc":"大标题","heading2":"标题 2","heading2Desc":"中标题","heading3":"标题 3","heading3Desc":"小标题","bulletList":"无序列表","bulletListDesc":"项目符号列表","orderedList":"有序列表","orderedListDesc":"编号列表","taskList":"待办列表","taskListDesc":"可勾选的任务列表","blockquote":"引用","blockquoteDesc":"引用块","codeBlock":"代码块","codeBlockDesc":"代码片段","table":"表格","tableDesc":"插入 3\xd73 表格","horizontalRule":"分割线","horizontalRuleDesc":"水平分割线","link":"链接","linkDesc":"插入超链接"},"commands":{"plan":"开启计划模式 \xb7 /plan <任务> 直接规划该任务 \xb7 /plan off 关闭"},"review":{"reviewManagement":"评审管理","allReviews":"所有评审","noOpenReviews":"暂无开放评审","viewComments":"查看评论","nComments":"{{count}} 条评论","nDocs":"{{count}} 文档","nReviews":"{{count}} 评审","docList":"文档列表","allReviewsList":"所有评审","expandList":"展开列表","collapseList":"折叠列表","closeReview":"关闭评审","reopenReview":"重新开放","deleteReview":"删除评审","noOpenDocs":"暂无开放文档","noReviews":"暂无评审","sharing":"分享中","notShared":"未分享","closeSharing":"关闭分享","enableSharing":"开启分享评审","view":"查看","setNickname":"设置你的昵称","nicknameHint":"其他评审人将看到这个名字","nicknamePlaceholder":"输入昵称","skipForNow":"下次再说","identitySettings":"身份设置","reviewNickname":"评审昵称","random":"随机","selectTextToComment":"选中左侧文本添加评论","selectTextHint":"选中左侧文本即可添加评论","prevComment":"上一条","nextComment":"下一条","commentsCount":"{{count}} 条评论","commentsNavCount":"{{current}}/{{total}} 条评论","allCommentsTitle":"全部评论","commentsCountBrief":"{{count}} 条","closedCount":"{{count}} 条已关闭","copyAllComments":"复制全部评论","noComments":"暂无评论","closedComments":"已关闭 ({{count}})","closedLabel":"已关闭","moreReplies":"+{{count}} 条回复","copyComment":"复制评论","reopen":"重开","closeComment":"关闭评论","editComment":"编辑评论","deleteComment":"删除评论","edited":"(已编辑)","editReply":"编辑回复","deleteReply":"删除回复","reply":"回复","replyPlaceholder":"添加回复...","selectedText":"选中文本","addCommentPlaceholder":"添加评论...","enterSubmitHint":"Enter 提交,Shift+Enter 换行","commentBtn":"评论","reviewNotExist":"评审不存在或已被删除","loadFailed":"加载失败","networkError":"网络错误","reviewNotFound":"评审不存在","checkLink":"请检查链接是否正确","updatedAt":"更新于 {{date}}","active":"开放中","closed":"已关闭","viewAllComments":"查看全部评论","viewCommentBtn":"查看评论","copyLink":"复制链接","reviewSummary":"评审评论汇总 — {{title}}","totalNComments":"共 {{count}} 条评论","quoteRef":"引用: \\"{{text}}\\"","commentAuthor":"评论 ({{author}}): {{content}}","replyAuthor":" ↳ {{author}}: {{content}}"},"markdown":{"copied":"✓ 已复制","copy":"复制"},"imagePreview":{"previewImage":"预览图片","deleteImage":"删除图片","copyImage":"复制图片","copiedImage":"已复制图片"},"tokenStats":{"title":"Claude Code Token 统计","activeHours":"活跃时段分布","hourSessions":"{{h}}:00 — {{count}} 次会话","messages":"消息","toolCalls":"工具调用","activityTrend":"活动趋势","byModel":"按模型","tokenUsage":"Token 用量","equivalentCost":"等效费用","modelCostDetail":"模型费用明细","model":"模型","share":"占比","total":"合计","totalSessions":"总会话","totalMessages":"总消息","equivalentApiCost":"等效 API 费用","longestSession":"最长会话","firstUse":"首次使用","notFound":"未找到 ~/.claude/stats-cache.json","day":"日","week":"周","month":"月"},"toolCall":{"inputParams":"输入参数","resultLabel":"结果","inputParamsTitle":"查看输入参数","resultTitle":"查看结果","input":"输入","result":"结果","foldedLines":"... ({{count}} 行)"},"fileEditor":{"unsavedConfirm":"有未保存的修改,确定关闭?","discardChanges":"放弃修改","continueEditing":"继续编辑","externallyModified":"文件已被外部修改,保存将覆盖外部更改","useDiskVersion":"使用磁盘版本","forceOverwrite":"强制覆盖"},"quickFileOpen":{"placeholder":"输入文件名快速打开...","noMatch":"没有匹配的文件","recent":"最近","selectHint":"选择","openHint":"打开","closeHint":"关闭"},"envManager":{"title":"环境变量管理","tabScope":"当前 Tab 专用","globalScope":"全局环境变量","varNamePlaceholder":"变量名(如 NODE_ENV)","varValuePlaceholder":"值(如 production)","valuePlaceholder":"值","noVars":"还没有环境变量,添加一个试试"},"aliasManager":{"title":"命令别名管理","description":"为常用命令设置快捷别名(全局生效)","aliasPlaceholder":"别名(如 ll)","commandPlaceholder":"完整命令(如 ls -la)","fullCommandPlaceholder":"完整命令","usage":"使用提示:","usageDesc":"输入别名即可执行对应的完整命令","noAliases":"还没有命令别名,添加一个试试"},"diffViewer":{"fileChanges":"文件变更 ({{count}})","expandFull":"扩展到全屏","exitFull":"回到分栏","toggleFileTree":"切换文件目录","selectFileToView":"选择左侧文件查看变更","sideBySide":"并列对比","unified":"统一对比","viewSplit":"双栏","viewUnified":"单栏","previewFile":"预览文件","copiedAll":"已复制全文","compact":"精简","full":"全文","gap":{"hidden":"已隐藏 {{count}} 行","more":"\xb7\xb7\xb7 更多 +{{count}} \xb7\xb7\xb7","expandUp":"向上展开 {{count}} 行","expandDown":"向下展开 {{count}} 行","expandAll":"点击展开 {{count}} 行"},"loadingSnapshots":"正在加载快照…","noChanges":"本轮未检测到文件变更","notViewable":"二进制或超大文件,无法展示 diff","externalChange":"同期其他会话/外部进程的变更","reconstructed":"参数重建","reconstructedHint":"由工具调用参数重建,非磁盘快照","truncated":"文件过多,仅显示部分","aggregate":"汇总","aggregateOn":"查看全部调用的累计变更","aggregateOff":"返回逐次调用","fileChangesAggregate":"文件变更 ({{count}}) \xb7 汇总","aggregateSummary":"{{count}} 个文件变更({{calls}} 次调用累计)","aggregateLoading":"正在汇总变更…","aggregateEmpty":"累计后无净变更","aggregateUnavailable":"无快照,无法汇总","aggregateFailed":"汇总失败","aggregateBaselineSkipped":"已跳过 {{count}} 次基线级调用","aggregateBaselineIncluded":"已计入 {{count}} 次基线级调用","callsBaselineHidden":"已隐藏 {{count}} 次基线级调用","callsBaselineShown":"已显示 {{count}} 次基线级调用","aggregateSkippedHint":"这些调用改动的文件数超过 {{threshold}},通常是切换分支 / rebase 而非编写代码。点击切换是否计入","imageBefore":"变更前","imageAfter":"变更后","imageAdded":"新增","imageDeleted":"已删除","imageLoadFailed":"图片加载失败","imageUnavailable":"该版本无此图片"},"commitDetail":{"title":"提交详情","hash":"哈希:","author":"作者:","date":"日期:","files":"文件:","nChanges":"{{count}} 个变更","loadingFiles":"加载文件中...","noFileChanges":"无文件变更","loadingDiff":"加载差异中...","selectFileToView":"选择文件查看差异"},"askQuestion":{"title":"提问","nQuestions":"{{count}} 个问题","checkedN":"已勾选 {{count}}","copyChecked":"复制勾选的 {{count}} 个问答","copyAll":"复制所有问答","sendChecked":"发送勾选的 {{count}} 个问答给 AI","sendAll":"发送所有问答给 AI","sendNoChat":"没有可用的聊天会话","checkToCopy":"勾选以复制","custom":"自定义","customPlaceholder":"输入自定义回答...","notSelected":"(未选择)"},"tabBar":{"closeTab":"关闭标签","closeAll":"关闭所有标签","newTab":"新建标签"},"tabManagerTopBar":{"copyPageUrl":"复制页面地址","copyDirPath":"复制目录路径","refreshProject":"刷新当前项目","openInVSCode":"在 VS Code 中打开","openInCursor":"在 Cursor 中打开","aliasesGlobal":"命令别名(全局)","tokenStats":"Token 统计","openSurething":"打开 Surething"},"hoverTooltip":{"findReferences":"查找引用","search":"搜索"},"todoViewer":{"title":"任务列表","progress":"{{completed}} / {{total}} 完成"},"userMessages":{"title":"用户消息列表","noMessages":"暂无用户消息","searchPlaceholder":"搜索用户消息…","noResults":"没有匹配的消息","loadFailed":"加载失败","count":"{{shown}} / {{total}} 条","jumping":"正在加载该消息所在的对话…"},"shortIdBadge":{"clickToDisconnect":"点击断开连接","clickToRegister":"点击注册并复制 CLI 命令","setTitle":"给这个气泡命名(便于 /cc 通过 connection list 找到它)","setTitlePlaceholder":"设置标题","editTitle":"编辑标题","titleSet":"标题:{{title}}","dialogTitle":"给气泡命名","dialogPlaceholder":"例如:alloydb 代理、预发管理后台"},"api":{"pathForbidden":"不允许操作此路径","deleteForbidden":"不允许删除此路径","notAFolder":"目标不是文件夹","imageTooLarge":"图片文件过大,无法预览","cannotPreviewBinary":"无法预览二进制文件","fileTooLarge":"文件过大,无法预览(超过 10MB)","fileModifiedExternally":"文件已被外部修改"},"folderPicker":{"title":"打开文件夹","placeholder":"输入或粘贴路径,如 ~/Work/my-app","open":"打开","showHidden":"显示隐藏目录","hint":"↑↓ 选择 \xb7 Tab/回车 进入 \xb7 ⌘/Ctrl+回车 打开","empty":"没有子文件夹","noMatch":"没有匹配的文件夹","notFound":"文件夹不存在","notDirectory":"不是文件夹","denied":"没有访问权限。macOS 上请在 系统设置 › 隐私与安全性 中授权。"},"confirm":{"title":"提示","ok":"确定","cancel":"取消"},"floatingToolbar":{"addComment":"添加评论","sendToAI":"发送 AI","search":"搜索"},"quickReply":{"optionA":"A","optionB":"B","optionC":"C","optionD":"D","allRecommended":"其他按推荐","thisOne":"就这个","notThis":"不要这样","why":"为什么","elaborate":"展开说","example":"举个例子","start":"开始做","continue":"继续","ok":"OK","done":"做完了","edit":"编辑快捷短语","editTitle":"编辑快捷短语","editHint":"一行对应面板的一行,行内用逗号分隔。每个短语会原样发送到对话。","editPlaceholder":"就这个,不要这样\\n为什么,展开说","restoreDefault":"恢复默认","save":"保存","cancel":"取消","customizedFor":"当前编辑的是{{lang}}短语,另一种语言不受影响。","langEn":"英文","langZh":"中文","saveFailed":"保存快捷短语失败"},"searchResults":{"title":"搜索结果","nMatches":"({{count}} 处匹配)","searching":"搜索中...","noResults":"无匹配结果","scopeSelected":"选中","scopeAll":"全部"},"references":{"title":"引用","searching":"搜索中...","notFound":"未找到引用"},"gitFileTree":{"noFiles":"无文件"},"deps":{"action":"依赖关系","none":"无","symbolMessage":"分析 {{name}} ({{path}}:{{lines}}) 的依赖关系。\\n\\n调用者:{{callers}}\\n调用了:{{callees}}\\n外部依赖:{{externals}}\\n\\n请说明它耦合在哪些模块上,以及哪些依赖是可以收敛掉的。"},"explain":{"action":"解释一下","fileMessage":"解释一下 {{path}}","symbolMessage":"解释一下 {{name}} ({{path}}:{{lines}})","selectionMessage":"解释一下","commitFileMessage":"解释一下 git commit {{hash}} 对 {{path}} 的改动","compareFileMessage":"解释一下 git {{base}}...HEAD 中 {{path}} 的改动","compareFileWorktreeMessage":"解释一下 {{path}} 相对 {{base}} 的改动(含未提交的部分)","stagedFileMessage":"解释一下 git 暂存区中 {{path}} 的改动","unstagedFileMessage":"解释一下 git 工作区中 {{path}} 的改动"},"reviewUtils":{"adjectives":["快乐","勇敢","安静","明亮","温柔","灵巧","自由","清澈","飞翔","悠闲","活泼","聪慧","淡定","机敏","从容","坚定","爽朗","和煦","奔放","沉稳"],"nouns":["熊猫","海豚","白鹤","雪豹","云雀","松鼠","飞鱼","梅花鹿","青鸟","银狐","猫头鹰","蜻蜓","萤火虫","海龟","蝴蝶","金丝猴","丹顶鹤","羚羊","燕子","企鹅"]},"bots":{"title":"机器人","search":"搜索机器人","addExisting":"添加机器人","addTooltip":"添加为机器人","emptyNoMatch":"没有匹配的机器人。","emptyNoBots":"还没有你自己的机器人。","emptyCreatePrefix":"在聊天里使用","emptyCreateSuffix":"创建一个。","emptyAddExisting":"添加已有的机器人目录","invalid":"无效","builtin":"内置","remove":"移除注册","open":"作为项目打开","pathPlaceholder":"机器人目录或其 BOT.md 的绝对路径","addHint":"目录中必须包含 BOT.md,不会改动其中的文件。","added":"机器人已添加","alreadyAdded":"已添加过","removed":"已移除机器人注册,目录文件仍保留。","loadFailed":"加载机器人失败","saveFailed":"添加机器人失败","removeFailed":"移除机器人失败"}}');d.Ay.isInitialized||d.Ay.init({resources:{en:{translation:e},zh:{translation:f}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});let g=d.Ay},1512:(a,b,c)=>{"use strict";c.d(b,{H:()=>e});let d=a=>"unread"===a?0:"loading"===a?1:2;function e(a){return[...a].sort((a,b)=>d(a.status)-d(b.status)||b.lastActive-a.lastActive)}},2633:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{d:()=>l});var e=c(48249),f=c(67484),g=c(44384),h=c(73887),i=c(55287);c(57063);var j=c(7833);c(77156),c(33281);var k=a([h,i]);function l({skillId:a,onClose:b}){let{t:c}=(0,g.Bd)(),[d,k]=(0,f.useState)(null),[m,n]=(0,f.useState)(!0),[o,p]=(0,f.useState)("preview"),q=(0,f.useCallback)(async()=>{if(d?.path)try{await navigator.clipboard.writeText(d.path),(0,j.oR)(c("common.copiedPath"),"success")}catch{(0,j.oR)(c("common.copyFailed"),"error")}},[d,c]);return(0,e.jsxs)("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-scrim",onClick:b}),(0,e.jsxs)("div",{className:"relative bg-card rounded-lg shadow-lv3 w-full max-w-[70%] h-[90vh] mx-4 flex flex-col overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border flex-shrink-0",children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-foreground truncate",children:d?.name?`/${d.name}`:c("skills.previewTitle")}),(0,e.jsx)("button",{onClick:q,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:c("skills.copyPath"),children:(0,e.jsxs)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",strokeWidth:2}),(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})})]}),d?.path&&(0,e.jsx)("div",{className:"text-xs text-muted-foreground font-mono truncate mt-0.5",children:d.path})]}),(0,e.jsxs)("div",{className:"flex items-center rounded-md border border-border overflow-hidden text-xs flex-shrink-0",children:[(0,e.jsx)("button",{onClick:()=>p("preview"),className:`px-3 py-1 transition-colors ${"preview"===o?"bg-brand text-white":"text-muted-foreground hover:text-foreground hover:bg-hover"}`,children:c("common.preview")}),(0,e.jsx)("button",{onClick:()=>p("source"),className:`px-3 py-1 transition-colors ${"source"===o?"bg-brand text-white":"text-muted-foreground hover:text-foreground hover:bg-hover"}`,children:c("skills.source")})]}),(0,e.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors flex-shrink-0",title:c("common.close"),children:(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:c("common.loading")}):d&&d.valid?"preview"===o?(0,e.jsx)(h.M,{content:d.content,filePath:d.path,cwd:d.path.slice(0,Math.max(0,d.path.lastIndexOf("/"))),embedded:!0,onClose:b}):(0,e.jsx)("div",{className:"flex-1 overflow-auto",children:(0,e.jsx)(i.XO,{content:d.content,filePath:d.path,className:"min-h-full"})}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:c("skills.cannotRead")})]})]})}[h,i]=k.then?(await k)():k,d()}catch(a){d(a)}})},2929:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{s:()=>W});var e=c(48249),f=c(67484),g=c(7833),h=c(44256),i=c(15273),j=c(14839),k=c(72419),l=c(44218),m=c(49681),n=c(21735),o=c(33740),p=c(55313),q=c(32616),r=c(1619),s=c(18812),t=c(59347),u=c(60251),v=c(85862),w=c(80983),x=c(69424),y=c(57632),z=c(18479),A=c(39247),B=c(60591),C=c(87808),D=c(39238),E=c(90031),F=c(13265),G=c(76306),H=c(5900),I=c(33281),J=c(36688),K=c(41224),L=c(44384),M=a([y,w,D,E,J]);async function N(a,b){if(!navigator.clipboard?.write||"u"<typeof ClipboardItem)throw Error("Clipboard image write is unavailable");try{await navigator.clipboard.write([new ClipboardItem({[a.type]:a})]);return}catch(b){if("image/png"===a.type)throw b}let c=await new Promise((a,c)=>{let d=new Image;d.onload=()=>{let b=document.createElement("canvas");b.width=d.naturalWidth,b.height=d.naturalHeight;let e=b.getContext("2d");e?(e.drawImage(d,0,0),b.toBlob(b=>{b?a(b):c(Error("Could not encode image"))},"image/png")):c(Error("Canvas is unavailable"))},d.onerror=()=>c(Error("Could not load image")),d.src=b});await navigator.clipboard.write([new ClipboardItem({"image/png":c})])}function O({image:a,onClose:b}){let{t:c}=(0,L.Bd)(),d=`data:${a.media_type};base64,${a.data}`,f=async b=>{b.stopPropagation();try{await N(function(a,b){let c=atob(a),d=new Uint8Array(c.length);for(let a=0;a<c.length;a+=1)d[a]=c.charCodeAt(a);return new Blob([d],{type:b})}(a.data,a.media_type),d),(0,g.oR)(c("chat.copiedImage"),"success")}catch{(0,g.oR)(c("common.copyFailed"),"error")}},j=(0,e.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:b,children:[(0,e.jsxs)("div",{className:"absolute top-4 right-4 flex items-center gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:f,className:"w-10 h-10 flex items-center justify-center text-white/80 hover:text-white bg-black/40 hover:bg-black/60 rounded-full transition-colors",title:c("chat.copyImage"),children:(0,e.jsx)(i.A,{className:"w-5 h-5"})}),(0,e.jsx)("button",{type:"button",onClick:b,className:"w-10 h-10 flex items-center justify-center text-white/80 hover:text-white bg-black/40 hover:bg-black/60 rounded-full transition-colors",title:c("common.close"),children:(0,e.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("img",{src:d,alt:c("chat.imagePreview"),className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:a=>a.stopPropagation()})]});return(0,e.jsx)(h.ZL,{children:j})}function P({filePath:a,onClose:b}){let{t:c}=(0,L.Bd)(),d=`/api/file?path=${encodeURIComponent(a)}&raw=true`,f=async b=>{b.stopPropagation();try{let b,e=await fetch(d);if(!e.ok)throw Error("Could not read image");let f=await e.blob(),h=f.type?f:new Blob([f],{type:(b=a.slice(a.lastIndexOf(".")).toLowerCase(),".jpg"===b||".jpeg"===b?"image/jpeg":".png"===b?"image/png":".gif"===b?"image/gif":".webp"===b?"image/webp":".svg"===b?"image/svg+xml":".bmp"===b?"image/bmp":".ico"===b?"image/x-icon":".avif"===b?"image/avif":"image/png")});await N(h,d),(0,g.oR)(c("chat.copiedImage"),"success")}catch{(0,g.oR)(c("common.copyFailed"),"error")}};return(0,e.jsx)(h.ZL,{children:(0,e.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:b,children:[(0,e.jsxs)("div",{className:"absolute top-4 right-4 flex items-center gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:f,className:"w-10 h-10 flex items-center justify-center text-white/80 hover:text-white bg-black/40 hover:bg-black/60 rounded-full transition-colors",title:c("chat.copyImage"),children:(0,e.jsx)(i.A,{className:"w-5 h-5"})}),(0,e.jsx)("button",{type:"button",onClick:b,className:"w-10 h-10 flex items-center justify-center text-white/80 hover:text-white bg-black/40 hover:bg-black/60 rounded-full transition-colors",title:c("common.close"),children:(0,e.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("img",{src:d,alt:a.split("/").pop(),className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:a=>a.stopPropagation()})]})})}function Q(a){let b=a.replace(/\/+$/,"");return b.startsWith("/private/")?b.slice(8):b}[y,w,D,E,J]=M.then?(await M)():M;let S=(0,f.memo)(function({text:a,isAside:b,isUser:c,isStreaming:d,onOpenFileLink:h,onPreviewFile:i,cwd:k}){let{t:l}=(0,L.Bd)(),m=(0,f.useMemo)(()=>{if(c||!h)return;let a=a=>{i&&((0,B.e$)(a)||(0,B.u)(a)||(0,B.Zy)(a))?i(a):(0,g.oR)(l("toast.fileOutsideProject"),"error")};return b=>{let c=function(a,b){let c;if(!a||a.startsWith("#")||/^[a-z][a-z0-9+.-]*:/i.test(a)&&!a.startsWith("file:"))return null;let d=a;try{d=decodeURIComponent(a)}catch{}d.startsWith("file://")&&(d=d.slice(7));let e=d.indexOf("#"),f=e>=0?d.slice(e+1):"",g=e>=0?d.slice(0,e):d,h=g.indexOf("?"),i=h>=0?g.slice(h+1):"";g=h>=0?g.slice(0,h):g;let j=f.match(/^L?(\d+)(?:-L?\d+)?$/i)?.[1],k=i.match(/(?:^|[&;])(?:line|L)=(\d+)(?:$|[&;])/i)?.[1],l=g.match(/:(\d+)(?::\d+)?$/),m=j||k||l?.[1];if(m&&(c=Number(m),l&&(g=g.slice(0,-l[0].length))),!(g=g.trim()))return null;let n=c&&c>0?{lineNumber:c}:{},o=b?Q(b):"";if(g.startsWith("/")){let a=Q(g);return o&&a===o?null:o&&a.startsWith(o+"/")?{rel:(0,B.WU)("",a.slice(o.length+1)),abs:null,...n}:{rel:(0,B.WU)("",a),abs:a,...n}}return g.startsWith("./")||g.startsWith("../")||g.includes("/")||/\.[A-Za-z0-9][A-Za-z0-9_-]*$/.test(g)?{rel:(0,B.WU)("",g),abs:null,...n}:null}(b,k);return!!c&&(c.abs?k?I.t4.runPromise((0,C.r6)(k,c.rel)).then(b=>{b.ok&&b.data?.exists?h({path:c.rel,...c.lineNumber?{lineNumber:c.lineNumber}:{}}):a(c.abs)}).catch(()=>a(c.abs)):a(c.abs):h({path:c.rel,...c.lineNumber?{lineNumber:c.lineNumber}:{}}),!0)}},[k,c,h,i,l]),n=(0,f.useMemo)(()=>{if(!c)return a=>{let b=(0,F.i)(a,window.location.origin);return b?((0,G.V)(b,a),!0):!!m&&m(a)}},[c,m]),o=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(H.T,{content:a,isUser:c,isStreaming:d,onLinkClick:n}),d&&(0,e.jsx)("span",{className:"inline-block w-2 h-4 ml-1 bg-current animate-pulse"})]});return b?(0,e.jsxs)("div",{className:"flex gap-1.5 break-words opacity-65",children:[(0,e.jsx)(j.A,{className:"w-3 h-3 mt-[5px] shrink-0 text-muted-foreground","aria-hidden":!0}),(0,e.jsx)("div",{className:"flex-1 min-w-0",children:o})]}):(0,e.jsx)("div",{className:"break-words",children:o})}),T="28em",U=(0,f.memo)(function({children:a}){let{t:b}=(0,L.Bd)(),[c,d]=(0,f.useState)(!1),[g,h]=(0,f.useState)(!1),i=(0,f.useRef)(null),j=(0,f.useRef)(null),m=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(c)return;let a=j.current,b=m.current;if(!a||!b)return;let d=()=>h(a.scrollHeight>a.clientHeight+1);d();let e=new ResizeObserver(d);return e.observe(b),()=>e.disconnect()},[c]);let n=(0,f.useCallback)(()=>{if(!c)return void d(!0);let a=i.current?.closest("[data-message-id]")??i.current;d(!1),requestAnimationFrame(()=>{a&&a.getBoundingClientRect().top<0&&a.scrollIntoView({block:"start",behavior:"auto"})})},[c]);return(0,e.jsxs)("div",{ref:i,children:[(0,e.jsx)("div",{ref:j,className:c?void 0:"overflow-hidden",style:c?void 0:{maxHeight:T},children:(0,e.jsx)("div",{ref:m,children:a})}),g&&(0,e.jsxs)(e.Fragment,{children:[!c&&(0,e.jsx)("div",{className:"text-muted-foreground leading-none pt-1 select-none",children:"…"}),(0,e.jsxs)("button",{type:"button",onClick:n,className:"mt-1 flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[b(c?"chat.showLess":"chat.showMore"),c?(0,e.jsx)(k.A,{className:"w-3.5 h-3.5"}):(0,e.jsx)(l.A,{className:"w-3.5 h-3.5"})]})]})]})});function R({collapsible:a,children:b}){return a?(0,e.jsx)(U,{children:b}):(0,e.jsx)(e.Fragment,{children:b})}let V=new Map,W=(0,f.memo)(function({message:a,cwd:b,sessionId:c,onFork:d,onDeleteTurn:i,forkSupported:j=!0,onSendToPeer:k,peerSide:C,onApprovePlan:F,isLoading:G,onContentSearch:M,onShowFileDiff:N,onOpenFileLink:Q,disableOverlays:T=!1}){let U,W,X,Y,{t:Z,i18n:$}=(0,L.Bd)(),[_,aa]=(0,f.useState)(null),[ab,ac]=(0,f.useState)(()=>1===(a.toolCalls?.length||0)),[ad,ae]=(0,f.useState)(!1),[af,ag]=(0,f.useState)(!1),[ah,ai]=(0,f.useState)(!1),[aj,ak]=(0,f.useState)(!1),[al,am]=(0,f.useState)(!1),an=(0,f.useRef)(null),ao=(0,f.useRef)(null),ap="user"===a.role,aq=a.images&&a.images.length>0,ar=a.toolCalls?.length||0,as=!!c&&!!b&&!!d&&j,at=!!c&&!!b&&!!i;(0,f.useEffect)(()=>{if(!aj)return;let a=a=>{an.current?.contains(a.target)||ak(!1)},b=a=>{"Escape"===a.key&&(ak(!1),ao.current?.focus())};return document.addEventListener("pointerdown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",a),document.removeEventListener("keydown",b)}},[aj]);let au=(0,f.useMemo)(()=>a.toolCalls?.some(a=>(0,A.h)(a.name))||!1,[a.toolCalls]),av=(0,f.useMemo)(()=>{let b=a.parts;if(!b?.length)return a.content?[{text:a.content,isAside:!1}]:[];let c=-1;b.forEach((a,b)=>{"tool"===a.type&&(c=b)});let d=[];return b.forEach((a,b)=>{"text"===a.type&&d.push({text:a.text,isAside:b<c})}),d},[a.parts,a.content]),aw=(0,f.useMemo)(()=>(0,y.vP)([],a.toolCalls??[],b).length>0,[a.toolCalls,b]),[ax,ay]=(0,f.useState)(!1),az=aw||ax;(0,f.useEffect)(()=>{N&&a.toolCalls?.length&&N(a.id,a.toolCalls,b,c??void 0,!0)},[N,a.id,a.toolCalls,b,c]),(0,f.useEffect)(()=>{if(!au||aw||!b)return;let d=(a.toolCalls??[]).map(a=>a.id).filter(Boolean);if(0===d.length)return;let e=(a.toolCalls??[]).filter(a=>(0,A.h)(a.name)).map(a=>a.id),f=!1,g=null,h=0,i=()=>{I.t4.runPromiseExit((0,z.xK)(b,d,c??void 0)).then(a=>{if(f)return;let b="Success"===a._tag?a.value:[];if(b.length>0)return void ay(!0);let c=new Set(b.map(a=>a.toolId));e.some(a=>!c.has(a))&&h<2&&(h+=1,g=setTimeout(i,2e3))})};return i(),()=>{f=!0,g&&clearTimeout(g)}},[au,aw,b,c,a.toolCalls]);let aA=(0,f.useMemo)(()=>{if(!a.toolCalls)return null;for(let b=a.toolCalls.length-1;b>=0;b--)if("TodoWrite"===a.toolCalls[b].name)return a.toolCalls[b];return null},[a.toolCalls]),aB=(0,f.useMemo)(()=>a.toolCalls?a.toolCalls.filter(a=>"AskUserQuestion"===a.name):[],[a.toolCalls]),aC=(0,f.useMemo)(()=>{if(!a.toolCalls)return null;for(let b=a.toolCalls.length-1;b>=0;b--)if("ExitPlanMode"===a.toolCalls[b].name){let c=a.toolCalls[b].input?.plan;return"string"==typeof c&&c?c:null}return null},[a.toolCalls]),aD=(0,f.useMemo)(()=>a.toolCalls?.filter(a=>"ExitPlanMode"!==a.name)??[],[a.toolCalls]),aE=(0,f.useMemo)(()=>{if(!a.toolCalls)return[];let b=new Set,c=[];for(let d of a.toolCalls)if("Read"===d.name||"Edit"===d.name||"Write"===d.name){let a=d.input.file_path;a&&((0,B.e$)(a)||(0,B.aR)(a)||(0,B.u)(a)||(0,B.Zy)(a))&&!b.has(a)&&(b.add(a),c.push(a))}return c},[a.toolCalls]),aF=(0,f.useMemo)(()=>{if(!a.toolCalls)return[];let b=[];for(let c of a.toolCalls){let a=c.input?.thought;if(a&&"string"==typeof a){let d=a.match(/PREVIOUS:\s*(.*?)\s*→\s*THIS:\s*(.*?)\s*→\s*EXPECT:\s*(.*)/i);d?b.push({previous:d[1].trim(),current:d[2].trim(),expect:d[3].trim(),raw:a,toolName:c.name}):b.push({previous:"",current:a,expect:"",raw:a,toolName:c.name})}}return b},[a.toolCalls]),[aG,aH]=(0,f.useState)(null),[aI,aJ]=(0,f.useState)(null);(0,f.useEffect)(()=>{if(!aG||(0,B.u)(aG))return void queueMicrotask(()=>aJ(null));let a=!1;return I.t4.runPromiseExit((0,K.an)(aG)).then(b=>{a||("Success"===b._tag&&void 0!==b.value.content?aJ(b.value.content):((0,g.oR)(Z("toast.readFileFailed"),"error"),aH(null)))}),()=>{a=!0}},[aG,Z]);let aK=async()=>{if(at&&!G&&!al&&await (0,g.lJ)(Z("chat.deleteTurnConfirm",{defaultValue:"Delete this question, answer, and its tool records? This cannot be undone."}),{title:Z("chat.deleteTurn",{defaultValue:"Delete turn"}),confirmText:Z("chat.deleteTurnConfirmAction",{defaultValue:"Delete turn"}),danger:!0})){am(!0);try{await i(a.id)}finally{am(!1)}}},aL=!!C&&!!k&&!!a.content,aM=(0,f.useMemo)(()=>{var b;let c;if(!a.timestamp)return"";let d=new Date(a.timestamp);return isNaN(d.getTime())?"":(b=$.language,!(c=V.get(b))&&(c=new Intl.DateTimeFormat(b,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),V.set(b,c)),c).format(d)},[a.timestamp,$.language]);if("system"===a.role){let b=a.systemEvent,c=b?.kind==="task-notification"?"failed"===b.status?"⚠️":"stopped"===b.status?"⏹️":"\uD83D\uDD14":"ℹ️",d=b?.detail||a.content;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex justify-center my-2 px-2","data-role":"system",children:(0,e.jsxs)("button",{type:"button",onClick:()=>ai(!0),className:"flex items-center gap-1.5 max-w-[85%] text-[11px] text-muted-foreground bg-secondary/40 border border-border/50 rounded-full px-3 py-1 hover:bg-secondary hover:text-foreground transition-colors cursor-pointer",title:Z("chat.viewDetails",{defaultValue:"Click for details"}),children:[(0,e.jsx)("span",{className:"flex-shrink-0",children:c}),(0,e.jsx)("span",{className:"truncate",children:a.content})]})}),ah&&(0,e.jsx)(h.ZL,{children:(0,e.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-scrim p-4",onClick:()=>ai(!1),children:(0,e.jsxs)("div",{className:"bg-card shadow-lv3 w-full max-w-4xl max-h-[80vh] rounded-lg flex flex-col overflow-hidden",onClick:a=>a.stopPropagation(),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border flex-shrink-0",children:[(0,e.jsxs)("span",{className:"text-sm text-foreground flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:c}),b?.kind==="task-notification"?Z("chat.taskNotification",{defaultValue:"Task notification"}):Z("chat.systemNotice",{defaultValue:"Notice"})]}),(0,e.jsx)("button",{onClick:()=>ai(!1),className:"text-muted-foreground hover:text-foreground px-1.5 py-0.5 rounded hover:bg-hover transition-colors",children:"✕"})]}),(0,e.jsx)("pre",{className:"flex-1 overflow-auto px-4 py-3 text-xs text-foreground whitespace-pre-wrap break-words",children:d})]})})})]})}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:`flex flex-col ${ap?"items-end":"items-start"} mb-4 group`,"data-role":a.role,children:[(0,e.jsx)("div",{className:`relative flex items-start ${ap?"justify-end":"justify-start"} w-full`,children:(0,e.jsxs)("div",{className:`chat-turn px-4 py-2 text-foreground ${ap?"max-w-[80%] bg-muted rounded-2xl rounded-br-md border border-brand/40":"w-full"}`,children:[aq&&(0,e.jsx)("div",{className:`flex flex-wrap gap-2 ${a.content?"mb-2":""}`,children:a.images.map((a,b)=>(0,e.jsx)("div",{className:`relative w-16 h-16 rounded-lg overflow-hidden border border-white/20 ${T?"":"cursor-pointer hover:opacity-90 transition-opacity"}`,onClick:T?void 0:()=>aa(a),children:(0,e.jsx)("img",{src:`data:${a.media_type};base64,${a.data}`,alt:Z("chat.imageN",{index:b+1}),className:"w-full h-full object-cover"})},b))}),av.length>0&&(0,e.jsx)(R,{collapsible:ap,children:(0,e.jsx)("div",{className:"space-y-3",children:av.map((c,d)=>(0,e.jsx)(S,{text:c.text,isAside:c.isAside,isUser:ap,isStreaming:!!a.isStreaming&&d===av.length-1,onOpenFileLink:Q,onPreviewFile:aH,cwd:b},d))})}),aA&&(U=aA.input?.todos,X=(W=Array.isArray(U)?U:[]).filter(a=>"completed"===a.status).length,Y=W.length,(0,e.jsx)("div",{className:`${a.content||aq?"mt-2":""}`,children:(0,e.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden px-3 py-2 space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,e.jsx)("div",{className:"flex-1 h-1 bg-secondary rounded-full overflow-hidden",children:(0,e.jsx)("div",{className:"h-full bg-green-500 rounded-full transition-all duration-300",style:{width:`${Y>0?X/Y*100:0}%`}})}),(0,e.jsxs)("span",{className:"text-[10px] text-muted-foreground flex-shrink-0",children:[X,"/",Y]})]}),W.map((a,b)=>(0,e.jsxs)("div",{className:`flex items-center gap-1.5 ${"completed"===a.status?"opacity-50":""}`,children:["completed"===a.status?(0,e.jsx)(m.A,{className:"w-3 h-3 text-green-11 flex-shrink-0"}):"in_progress"===a.status?(0,e.jsx)(n.A,{className:"w-3 h-3 text-brand flex-shrink-0 animate-spin"}):(0,e.jsx)(o.A,{className:"w-3 h-3 text-muted-foreground flex-shrink-0"}),(0,e.jsx)("span",{className:`text-xs truncate ${"completed"===a.status?"text-muted-foreground":"text-foreground"}`,children:"in_progress"===a.status&&a.activeForm?a.activeForm:a.content})]},b))]})})),aC&&(0,e.jsx)("div",{className:`${a.content||aq||aA?"mt-2":""}`,children:(0,e.jsxs)("div",{className:"border border-brand/40 rounded-lg overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b border-border bg-brand/10",children:[(0,e.jsx)("span",{className:"text-sm",children:"\uD83D\uDCCB"}),(0,e.jsx)("span",{className:"text-xs font-medium text-foreground",children:Z("chat.planTitle",{defaultValue:"Plan (awaiting your review)"})})]}),(0,e.jsx)("div",{className:"px-3 py-2",children:(0,e.jsx)(H.T,{content:aC,isUser:!1})}),F&&(0,e.jsxs)("div",{className:"px-3 py-2 border-t border-border flex items-center justify-between gap-2",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:Z("chat.planApproveHint",{defaultValue:"本环境无审批弹窗,点此退出 Plan 并执行"})}),(0,e.jsxs)("button",{onClick:()=>F(),disabled:G,className:"flex items-center gap-1.5 px-3 py-1 rounded-md bg-brand text-white text-xs font-medium hover:bg-brand/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex-shrink-0",children:[(0,e.jsx)("span",{children:"✓"}),(0,e.jsx)("span",{children:Z("chat.approvePlan",{defaultValue:"批准并执行"})})]})]})]})}),aE.length>0&&(0,e.jsx)("div",{className:`${a.content||aq||aA?"mt-2":""}`,children:(0,e.jsx)("div",{className:"border border-border rounded-lg overflow-hidden px-3 py-2 space-y-0.5",children:aE.map(a=>(0,e.jsxs)("button",{disabled:T,onClick:()=>aH(a),className:"flex items-center gap-1.5 w-full text-left rounded px-1 py-0.5 group/md transition-colors enabled:hover:bg-hover disabled:cursor-default",children:[(0,B.u)(a)?(0,e.jsxs)("svg",{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v14a1 1 0 01-1 1H5a1 1 0 01-1-1V5z"}),(0,e.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4-4 3 3 4-4 5 5"})]}):(0,B.Zy)(a)?(0,e.jsx)("svg",{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6a2 2 0 012-2h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm0 4h16M10 10v10"})}):(0,B.aR)(a)?(0,e.jsx)("svg",{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}):(0,e.jsx)("svg",{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground group-hover/md:text-foreground truncate",children:a.split("/").pop()})]},a))})}),aF.length>0&&(0,e.jsx)("div",{className:`${a.content||aq||aA||aE.length>0?"mt-2":""}`,children:(0,e.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,e.jsxs)("table",{className:"w-full text-xs",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"border-b border-border text-muted-foreground",children:[(0,e.jsx)("th",{className:"px-2 py-1.5 text-left font-medium w-[60px]",children:"Tool"}),(0,e.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Previous"}),(0,e.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Action"}),(0,e.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Expect"})]})}),(0,e.jsx)("tbody",{children:aF.map((a,b)=>(0,e.jsxs)("tr",{className:b<aF.length-1?"border-b border-border/50":"",children:[(0,e.jsx)("td",{className:"px-2 py-1 text-muted-foreground font-mono",children:a.toolName}),(0,e.jsx)("td",{className:"px-2 py-1 text-muted-foreground",children:a.previous||"—"}),(0,e.jsx)("td",{className:"px-2 py-1 text-foreground",children:a.current}),(0,e.jsx)("td",{className:"px-2 py-1 text-muted-foreground",children:a.expect||"—"})]},b))})]})})}),aD.length>0&&(0,e.jsx)("div",{className:`${a.content||aq?"mt-3":""}`,children:ar>0?(0,e.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsxs)("button",{onClick:()=>ac(!ab),className:"flex-1 px-3 py-1.5 flex items-center gap-2 text-left hover:bg-hover transition-colors active:bg-muted",children:[(0,e.jsx)("span",{className:"text-sm",children:"\uD83D\uDD27"}),(0,e.jsx)("span",{className:"font-medium text-foreground",children:Z("chat.toolCalls",{count:aD.length})}),(0,e.jsx)("span",{className:"ml-auto text-muted-foreground text-sm",children:ab?Z("chat.collapse"):Z("chat.expand")})]}),!T&&aB.length>0&&(0,e.jsx)("button",{onClick:()=>ag(!0),className:"px-3 py-1.5 text-muted-foreground hover:text-foreground hover:bg-hover transition-colors border-l border-line-1",title:Z("chat.viewQuestions"),children:(0,e.jsx)(p.A,{className:"w-4 h-4"})}),!T&&az&&(0,e.jsx)("button",{onClick:()=>{N&&a.toolCalls?N(a.id,a.toolCalls,b,c??void 0):ae(!0)},className:"px-3 py-1.5 text-muted-foreground hover:text-foreground hover:bg-hover transition-colors border-l border-line-1",title:Z("chat.viewAllFileChanges"),children:(0,e.jsx)(q.A,{className:"w-4 h-4"})})]}),ab&&(0,e.jsx)("div",{className:"border-t border-line-1",children:aD.map((a,d)=>(0,e.jsx)(w.K,{toolCall:a,cwd:b,sessionId:c,disableOverlays:T},`${a.id}-${d}`))})]}):aD.map((a,d)=>(0,e.jsx)(w.K,{toolCall:a,cwd:b,sessionId:c,disableOverlays:T},`${a.id}-${d}`))})]})}),(aM||a.content||as||at)&&(0,e.jsxs)("div",{className:`flex items-center gap-1 mt-0.5 px-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity ${ap?"flex-row-reverse":""}`,children:[a.content&&(0,e.jsx)("button",{onClick:()=>{a.content&&(navigator.clipboard.writeText(a.content),(0,g.oR)(Z("toast.copiedMessage")))},className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-hover",title:Z("chat.copyMessage"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),as&&(0,e.jsxs)("div",{ref:an,className:"relative",children:[(0,e.jsxs)("button",{ref:ao,type:"button",onClick:()=>ak(a=>!a),className:"flex items-center gap-1 rounded px-1.5 py-1 text-[11px] text-muted-foreground hover:bg-hover hover:text-foreground","aria-expanded":aj,title:Z("chat.newSession"),children:[(0,e.jsx)(r.A,{className:"h-3.5 w-3.5"}),(0,e.jsx)("span",{children:Z("chat.newSession")}),(0,e.jsx)(l.A,{className:`h-3 w-3 transition-transform ${aj?"rotate-180":""}`})]}),aj&&(0,e.jsxs)("div",{role:"group","aria-label":Z("chat.newSession"),className:`absolute bottom-full z-50 mb-1 w-56 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lv2 ${ap?"right-0":"left-0"}`,children:[(0,e.jsxs)("button",{type:"button",onClick:()=>{as&&(ak(!1),d(a.id,"prefix"))},className:"flex w-full items-start gap-2 rounded-md px-2.5 py-2 text-left hover:bg-hover focus-visible:bg-hover focus-visible:outline-none",children:[(0,e.jsx)(r.A,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block text-xs font-medium",children:Z("chat.continueFromHere")}),(0,e.jsx)("span",{className:"mt-0.5 block text-[11px] leading-4 text-muted-foreground",children:Z("chat.continueFromHereDesc")})]})]}),(0,e.jsxs)("button",{type:"button",onClick:()=>{as&&(ak(!1),d(a.id,"single"))},className:"flex w-full items-start gap-2 rounded-md px-2.5 py-2 text-left hover:bg-hover focus-visible:bg-hover focus-visible:outline-none",children:[(0,e.jsx)(s.A,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block text-xs font-medium",children:Z("chat.onlyThisTurn")}),(0,e.jsx)("span",{className:"mt-0.5 block text-[11px] leading-4 text-muted-foreground",children:Z("chat.onlyThisTurnDesc")})]})]})]})]}),at&&(0,e.jsxs)("button",{type:"button",onClick:aK,disabled:G||al,className:"flex items-center gap-1 rounded px-1.5 py-1 text-[11px] text-muted-foreground hover:bg-red-3 hover:text-red-11 disabled:cursor-not-allowed disabled:opacity-40",title:G?Z("chat.deleteTurnWhileRunning"):Z("chat.deleteTurn"),children:[(0,e.jsx)(t.A,{className:"h-3.5 w-3.5"}),(0,e.jsx)("span",{children:al?Z("chat.deletingTurn"):Z("chat.deleteTurn")})]}),aL&&(0,e.jsx)("button",{onClick:()=>{aL&&k(a.content)},className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-hover",title:Z("chat.sendToPeerPane"),children:"right"===C?(0,e.jsx)(u.A,{className:"w-4 h-4"}):(0,e.jsx)(v.A,{className:"w-4 h-4"})}),aM&&(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground mx-1",children:aM})]})]}),_&&(0,e.jsx)(O,{image:_,onClose:()=>aa(null)}),ad&&a.toolCalls&&(0,e.jsx)(y.zB,{toolCalls:a.toolCalls,cwd:b,sessionId:c??void 0,onClose:()=>ae(!1),onContentSearch:M}),af&&aB.length>0&&(0,e.jsx)(x.$,{toolCalls:aB,onClose:()=>ag(!1)}),aG&&(0,B.u)(aG)&&(0,e.jsx)(P,{filePath:aG,onClose:()=>aH(null)}),aG&&!(0,B.u)(aG)&&null!==aI&&((0,B.aR)(aG)?(0,e.jsx)(D.N,{filePath:aG,content:aI,cwd:b,onClose:()=>aH(null),onContentSearch:M}):(0,B.Zy)(aG)?(0,e.jsx)(E.s,{filePath:aG,content:aI,onClose:()=>aH(null)}):(0,e.jsx)(J.x,{filePath:aG,content:aI,cwd:b||"",onClose:()=>aH(null)}))]})});d()}catch(a){d(a)}})},3033:(a,b,c)=>{"use strict";c.d(b,{w:()=>r});var d=c(48249),e=c(67484),f=c(44384);c(33281);var g=c(83768),h=c(57063);c(41224);var i=c(92545);let j={"claude-fable-5-1":{input:10,output:50,cacheRead:.25,cacheWrite:12.5},"claude-mythos-5-1":{input:10,output:50,cacheRead:.25,cacheWrite:12.5},"claude-fable-5":{input:10,output:50,cacheRead:1,cacheWrite:12.5},"claude-mythos-5":{input:10,output:50,cacheRead:1,cacheWrite:12.5},"claude-opus-5-5":{input:4,output:20,cacheRead:.2,cacheWrite:5},"claude-opus-5":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-8":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-7":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-6":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-5":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-sonnet-5-5":{input:2,output:10,cacheRead:.2,cacheWrite:2.5},"claude-sonnet-5":{input:2,output:10,cacheRead:.2,cacheWrite:2.5},"claude-sonnet-4-6":{input:3,output:15,cacheRead:.3,cacheWrite:3.75},"claude-sonnet-4-5":{input:3,output:15,cacheRead:.3,cacheWrite:3.75},"claude-haiku-4-5":{input:1,output:5,cacheRead:.1,cacheWrite:1.25}},k={input:3,output:15,cacheRead:.3,cacheWrite:3.75},l={light:["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"],dark:["#3987e5","#d95926","#199e70","#c98500","#d55181","#008300","#9085e9","#e66767"]},m={light:{messages:"#2a78d6",toolCalls:"#1baf7a",messagesRgb:"42, 120, 214"},dark:{messages:"#3987e5",toolCalls:"#199e70",messagesRgb:"57, 135, 229"}};function n(a){return a>=1e9?`${(a/1e9).toFixed(1)}B`:a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function o(a){return a>=1e3?`$${a.toFixed(0)}`:a>=100?`$${a.toFixed(1)}`:`$${a.toFixed(2)}`}function p({data:a,height:b=200,formatValue:c=n}){let f=(0,e.useRef)(null),g=(0,e.useRef)(null),[h,i]=(0,e.useState)(null),j=(0,e.useRef)([]);(0,e.useCallback)(()=>{let d=f.current,e=g.current;if(!d||!e)return;let h=window.devicePixelRatio||1,i=e.getBoundingClientRect().width;d.width=i*h,d.height=b*h,d.style.width=`${i}px`,d.style.height=`${b}px`;let k=d.getContext("2d");k.scale(h,h),k.clearRect(0,0,i,b);let{labels:l,datasets:m}=a;if(0===l.length)return;let n=i-50-12,o=b-8-28,p=function(a){if(a<=0)return 1;let b=Math.pow(10,Math.floor(Math.log10(a))),c=a/b;return c<=1?b:c<=2?2*b:c<=5?5*b:10*b}(Math.max(1,...l.map((a,b)=>m.reduce((a,c)=>a+c.data[b],0))));k.fillStyle=getComputedStyle(d).getPropertyValue("color")||"#888",k.font="10px ui-monospace, monospace",k.textAlign="right",k.textBaseline="middle";for(let a=0;a<=4;a++){var q;let b=p/4*a,e=8+o-b/p*o;k.fillText(c(b),44,e),k.strokeStyle=(q="--line-2",getComputedStyle(d).getPropertyValue(q).trim()||"#333"),k.lineWidth=.5,k.beginPath(),k.moveTo(50,e),k.lineTo(50+n,e),k.stroke()}let r=n/l.length,s=Math.max(4,Math.min(.6*r,32)),t=[];l.forEach((a,b)=>{let c=50+b*r+(r-s)/2,e=0;m.forEach(d=>{var f,g,h,i,j,l;let m=d.data[b];if(m<=0)return;let n=Math.max(1,m/p*o),q=8+o-e-n;k.fillStyle=d.color,f=k,g=c,h=q,i=s,l=2,(j=n)<1||(l=Math.min(l,j/2,i/2),f.beginPath(),f.moveTo(g+l,h),f.lineTo(g+i-l,h),f.quadraticCurveTo(g+i,h,g+i,h+l),f.lineTo(g+i,h+j-l),f.quadraticCurveTo(g+i,h+j,g+i-l,h+j),f.lineTo(g+l,h+j),f.quadraticCurveTo(g,h+j,g,h+j-l),f.lineTo(g,h+l),f.quadraticCurveTo(g,h,g+l,h),f.fill()),t.push({x:c,y:q,w:s,h:n,label:a,value:m,dataset:d.label,color:d.color}),e+=n}),k.fillStyle=getComputedStyle(d).getPropertyValue("color")||"#888",k.font="9px ui-monospace, monospace",k.textAlign="center",k.textBaseline="top",b%(l.length>20?Math.ceil(l.length/15):1)==0&&k.fillText(a,c+s/2,8+o+6)}),j.current=t},[a,b,c]);let k=(0,e.useCallback)(a=>{let b=f.current?.getBoundingClientRect();if(!b)return;let d=a.clientX-b.left,e=a.clientY-b.top,g=j.current.find(a=>d>=a.x&&d<=a.x+a.w&&e>=a.y&&e<=a.y+a.h);g?i({x:a.clientX-b.left,y:g.y-4,content:`${g.dataset}: ${c(g.value)}`}):i(null)},[c]);return(0,d.jsxs)("div",{ref:g,className:"relative w-full text-muted-foreground",children:[(0,d.jsx)("canvas",{ref:f,className:"w-full",style:{height:b},onMouseMove:k,onMouseLeave:()=>i(null)}),h&&(0,d.jsx)("div",{className:"absolute pointer-events-none bg-popover text-popover-foreground text-[10px] px-2 py-1 rounded shadow-lv2 border border-border whitespace-nowrap z-10",style:{left:h.x,top:h.y,transform:"translate(-50%, -100%)"},children:h.content})]})}function q({hourCounts:a}){let{t:b}=(0,f.Bd)(),{resolvedTheme:c}=(0,g.DP)(),e=m[c],h=Math.max(1,...Object.values(a)),i=Array.from({length:24},(a,b)=>b);return(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:b("tokenStats.activeHours")}),(0,d.jsx)("div",{className:"flex gap-[2px] items-end h-16",children:i.map(c=>{let f=a[String(c)]||0,g=f/h;return(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-0.5",title:b("tokenStats.hourSessions",{h:c,count:f}),children:[(0,d.jsx)("div",{className:"w-full rounded-sm transition-all",style:{height:`${Math.max(2,48*g)}px`,backgroundColor:g>0?`rgba(${e.messagesRgb}, ${.2+.8*g})`:"var(--muted)"}}),c%3==0&&(0,d.jsx)("span",{className:"text-[8px] text-muted-foreground",children:c})]},c)})})]})}function r({isOpen:a,onClose:b}){var c;let t,u,{t:v}=(0,f.Bd)(),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!0),[A,B]=(0,e.useState)("day"),[C,D]=(0,e.useState)("tokens"),[E,F]=(0,e.useState)(null),{resolvedTheme:G}=(0,g.DP)(),H=(0,e.useMemo)(()=>{var a;let b,c,d=Object.keys(w?.modelUsage||{}).filter(a=>!a.startsWith("<")),e=new Map;for(let a of w?.dailyModelTokens||[])for(let[b,c]of Object.entries(a.tokensByModel)){let d=e.get(b);c>0&&(!d||a.date<d)&&e.set(b,a.date)}return a=[...d].sort((a,b)=>(e.get(a)??"￿").localeCompare(e.get(b)??"￿")||a.localeCompare(b)),b=l[G],c={},a.forEach((a,d)=>{c[a]=b[d%b.length]}),c},[w,G]),I=(0,e.useMemo)(()=>w?.modelUsage?Object.entries(w.modelUsage).filter(([a])=>!a.startsWith("<")).map(([a,b])=>{let c;return{id:a,label:(0,i.J)(a),color:H[a],usage:b,cost:(c=function(a){let b=a.replace(/-\d{8}$/,""),c=j[b];if(c)return c;let d=b.toLowerCase();return d.includes("fable")||d.includes("mythos")?{input:10,output:50,cacheRead:1,cacheWrite:12.5}:d.includes("opus")?{input:5,output:25,cacheRead:.5,cacheWrite:6.25}:d.includes("haiku")?{input:1,output:5,cacheRead:.1,cacheWrite:1.25}:k}(a),b.inputTokens/1e6*c.input+b.outputTokens/1e6*c.output+b.cacheReadInputTokens/1e6*c.cacheRead+b.cacheCreationInputTokens/1e6*c.cacheWrite),totalTokens:b.inputTokens+b.outputTokens+b.cacheReadInputTokens+b.cacheCreationInputTokens}}).sort((a,b)=>b.cost-a.cost):[],[w,H]),J=(0,e.useMemo)(()=>I.reduce((a,b)=>a+b.cost,0),[I]),K=(0,e.useMemo)(()=>I.map(a=>a.id),[I]),L=(0,e.useMemo)(()=>{let a={};for(let b of I)a[b.id]=b.totalTokens>0?b.cost/b.totalTokens:0;return a},[I]),{activityChart:M,tokenChart:N,costChart:O}=(0,e.useMemo)(()=>{let a=w?.dailyActivity||[],b=w?.dailyModelTokens||[];if("day"===A){let c=a.slice(-60),d=b.slice(-60),e={labels:c.map(a=>a.date.slice(5)),datasets:[{label:v("tokenStats.messages"),data:c.map(a=>a.messageCount),color:m[G].messages},{label:v("tokenStats.toolCalls"),data:c.map(a=>a.toolCallCount),color:m[G].toolCalls}]},f=d.map(a=>a.date.slice(5));return{activityChart:e,tokenChart:{labels:f,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:d.map(b=>b.tokensByModel[a]||0),color:H[a]}))},costChart:{labels:f,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:d.map(b=>(b.tokensByModel[a]||0)*(L[a]||0)),color:H[a]}))}}}if("week"===A){let c=function(a,b){let c=new Map;for(let b of a){let a=new Date(b.date),d=new Date(a);d.setDate(a.getDate()-a.getDay());let e=d.toISOString().slice(0,10),f=e.slice(5);c.has(e)||c.set(e,{label:f,messages:0,sessions:0,tools:0,tokensByModel:{}});let g=c.get(e);g.messages+=b.messageCount,g.sessions+=b.sessionCount,g.tools+=b.toolCallCount}for(let a of b){let b=new Date(a.date),d=new Date(b);d.setDate(b.getDate()-b.getDay());let e=d.toISOString().slice(0,10);c.has(e)||c.set(e,{label:e.slice(5),messages:0,sessions:0,tools:0,tokensByModel:{}});let f=c.get(e);for(let[b,c]of Object.entries(a.tokensByModel))f.tokensByModel[b]=(f.tokensByModel[b]||0)+c}return Array.from(c.values()).sort((a,b)=>a.label.localeCompare(b.label))}(a,b),d=c.map(a=>a.label),e={labels:d,datasets:[{label:v("tokenStats.messages"),data:c.map(a=>a.messages),color:m[G].messages},{label:v("tokenStats.toolCalls"),data:c.map(a=>a.tools),color:m[G].toolCalls}]};return{activityChart:e,tokenChart:{labels:d,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:c.map(b=>b.tokensByModel[a]||0),color:H[a]}))},costChart:{labels:d,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:c.map(b=>(b.tokensByModel[a]||0)*(L[a]||0)),color:H[a]}))}}}let c=function(a,b){let c=new Map;for(let b of a){let a=b.date.slice(0,7);c.has(a)||c.set(a,{label:a,messages:0,sessions:0,tools:0,tokensByModel:{}});let d=c.get(a);d.messages+=b.messageCount,d.sessions+=b.sessionCount,d.tools+=b.toolCallCount}for(let a of b){let b=a.date.slice(0,7);c.has(b)||c.set(b,{label:b,messages:0,sessions:0,tools:0,tokensByModel:{}});let d=c.get(b);for(let[b,c]of Object.entries(a.tokensByModel))d.tokensByModel[b]=(d.tokensByModel[b]||0)+c}return Array.from(c.values()).sort((a,b)=>a.label.localeCompare(b.label))}(a,b),d=c.map(a=>a.label),e={labels:d,datasets:[{label:v("tokenStats.messages"),data:c.map(a=>a.messages),color:m[G].messages},{label:v("tokenStats.toolCalls"),data:c.map(a=>a.tools),color:m[G].toolCalls}]};return{activityChart:e,tokenChart:{labels:d,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:c.map(b=>b.tokensByModel[a]||0),color:H[a]}))},costChart:{labels:d,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:c.map(b=>(b.tokensByModel[a]||0)*(L[a]||0)),color:H[a]}))}}},[w,A,K,L,H,v]),P=E&&H[E]?E:null,Q=(0,e.useMemo)(()=>{let a="tokens"===C?N:O;return P?{...a,datasets:a.datasets.filter(a=>a.id===P)}:a},[N,O,C,P]);if((0,h.E)(b,a),!a)return null;let R=[{key:"day",label:v("tokenStats.day")},{key:"week",label:v("tokenStats.week")},{key:"month",label:v("tokenStats.month")}];return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-scrim",onClick:b}),(0,d.jsxs)("div",{className:"relative bg-card rounded-xl shadow-lv3 w-full max-w-4xl mx-4 max-h-[90vh] flex flex-col overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-foreground",children:v("tokenStats.title")}),(0,d.jsx)("div",{className:"flex bg-muted rounded-md p-0.5",children:R.map(a=>(0,d.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${A===a.key?"bg-background text-foreground shadow-lv1":"text-muted-foreground hover:text-foreground"}`,onClick:()=>B(a.key),children:a.label},a.key))})]}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto px-6 py-5 space-y-6",children:y?(0,d.jsx)("div",{className:"text-center text-muted-foreground py-12",children:v("common.loading")}):w?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid grid-cols-5 gap-3",children:[(0,d.jsx)(s,{label:v("tokenStats.totalSessions"),value:String(w.totalSessions??0)}),(0,d.jsx)(s,{label:v("tokenStats.totalMessages"),value:n(w.totalMessages??0)}),(0,d.jsx)(s,{label:v("tokenStats.equivalentApiCost"),value:o(J),highlight:!0}),(0,d.jsx)(s,{label:v("tokenStats.longestSession"),value:w.longestSession?(t=Math.floor((c=w.longestSession.duration)/36e5),u=Math.floor(c%36e5/6e4),t>0?`${t}h ${u}m`:`${u}m`):"-"}),(0,d.jsx)(s,{label:v("tokenStats.firstUse"),value:w.firstSessionDate?w.firstSessionDate.slice(0,10):"-"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:v("tokenStats.activityTrend")}),(0,d.jsxs)("div",{className:"flex items-center gap-3 text-[10px]",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:m[G].messages}}),v("tokenStats.messages")]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:m[G].toolCalls}}),v("tokenStats.toolCalls")]})]})]}),(0,d.jsx)("div",{className:"border border-border rounded-lg p-3 bg-muted/20",children:(0,d.jsx)(p,{data:M,height:180})})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:v("tokenStats.byModel")}),(0,d.jsxs)("div",{className:"flex bg-muted rounded-md p-0.5",children:[(0,d.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${"tokens"===C?"bg-background text-foreground shadow-lv1":"text-muted-foreground hover:text-foreground"}`,onClick:()=>D("tokens"),children:v("tokenStats.tokenUsage")}),(0,d.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${"cost"===C?"bg-background text-foreground shadow-lv1":"text-muted-foreground hover:text-foreground"}`,onClick:()=>D("cost"),children:v("tokenStats.equivalentCost")})]})]}),(0,d.jsx)("div",{className:"flex items-center gap-3 text-[10px] flex-wrap",children:I.map(a=>(0,d.jsxs)("button",{onClick:()=>F(P===a.id?null:a.id),className:`flex items-center gap-1 rounded-sm transition-opacity hover:opacity-100 ${P&&P!==a.id?"opacity-40":""}`,children:[(0,d.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:a.color}}),a.label]},a.id))})]}),(0,d.jsx)("div",{className:"border border-border rounded-lg p-3 bg-muted/20",children:(0,d.jsx)(p,{data:Q,height:180,formatValue:"tokens"===C?n:o})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:v("tokenStats.modelCostDetail")}),(0,d.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,d.jsxs)("table",{className:"w-full text-xs",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{className:"bg-muted/50 text-muted-foreground",children:[(0,d.jsx)("th",{className:"text-left px-3 py-2 font-medium",children:v("tokenStats.model")}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Input"}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Output"}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Cache Read"}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Cache Write"}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:v("tokenStats.share")}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:v("tokenStats.equivalentCost")})]})}),(0,d.jsxs)("tbody",{children:[I.map(a=>(0,d.jsxs)("tr",{className:"border-t border-border",children:[(0,d.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:a.color}}),a.label]})}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(a.usage.inputTokens)}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(a.usage.outputTokens)}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(a.usage.cacheReadInputTokens)}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(a.usage.cacheCreationInputTokens)}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:J>0?`${(a.cost/J*100).toFixed(1)}%`:"-"}),(0,d.jsx)("td",{className:"px-3 py-2 text-right font-medium text-foreground",children:o(a.cost)})]},a.id)),(0,d.jsxs)("tr",{className:"border-t-2 border-border bg-muted/30",children:[(0,d.jsx)("td",{className:"px-3 py-2 font-medium text-foreground",children:v("tokenStats.total")}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(I.reduce((a,b)=>a+b.usage.inputTokens,0))}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(I.reduce((a,b)=>a+b.usage.outputTokens,0))}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(I.reduce((a,b)=>a+b.usage.cacheReadInputTokens,0))}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(I.reduce((a,b)=>a+b.usage.cacheCreationInputTokens,0))}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:"100%"}),(0,d.jsx)("td",{className:"px-3 py-2 text-right font-bold text-foreground",children:o(J)})]})]})]})})]}),w.hourCounts&&Object.keys(w.hourCounts).length>0&&(0,d.jsx)("div",{className:"border border-border rounded-lg p-3 bg-muted/20",children:(0,d.jsx)(q,{hourCounts:w.hourCounts})})]}):(0,d.jsx)("div",{className:"text-center text-muted-foreground py-12",children:v("tokenStats.notFound")})})]})]})}function s({label:a,value:b,highlight:c}){return(0,d.jsxs)("div",{className:"bg-muted/30 rounded-lg px-3 py-2.5",children:[(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground",children:a}),(0,d.jsx)("div",{className:`text-sm font-semibold mt-0.5 ${c?"text-brand":"text-foreground"}`,children:b})]})}},3588:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{TabBar:()=>p});var e=c(48249),f=c(67484),g=c(40311),h=c(41233),i=c(63565),j=c(32753),k=c(72529),l=c(44256),m=c(44384);function n({number:a,status:b,statusLabel:c,isActive:d,pinned:f,bot:i}){let j="normal"!==b?(0,g.JQ)(b,d):f?"border-transparent bg-amber-9 text-black/80":d?"border-transparent bg-brand/25 text-brand":"border-transparent bg-muted-foreground/25 text-foreground/75";return(0,e.jsx)(h.w,{wash:j,ring:(0,g.QV)(b),bot:i,role:"normal"!==b?"status":void 0,ariaLabel:i?[c,`Bot session: @${i}`].filter(Boolean).join(" \xb7 "):c,ariaHidden:"normal"===b&&!i,children:a})}function o({onNewTab:a,onNewCodexTab:b,onNewKimiTab:c,onNewGlmTab:d,onNewOllamaTab:g,onNewDeepseekTab:h}){let[j,k]=(0,f.useState)(!1),m=(0,f.useRef)(null),n=(0,f.useRef)(null),[p,q]=(0,f.useState)({top:0,right:0}),r=(0,l.F2)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{ref:m,onClick:()=>{if(!j&&m.current){let a=m.current.getBoundingClientRect(),b=r?.getBoundingClientRect(),c=b?.left??0,d=b?.top??0,e=b?.width??window.innerWidth;q({top:a.bottom+4-d,right:e-(a.right-c)})}k(a=>!a)},className:"flex-shrink-0 p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:"New tab",children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),j&&(0,e.jsx)(l.ZL,{children:(0,e.jsx)("div",{ref:n,className:"fixed z-[9999] bg-popover border border-border rounded-lg shadow-lv2 py-1 min-w-[140px]",style:{top:p.top,right:p.right},children:i.CX.map(f=>(0,e.jsxs)("button",{onClick:()=>{k(!1),"codex"===f?b?.():"kimi"===f?c?.():"glm"===f?d?.():"ollama"===f?g?.():"deepseek"===f?h?.():a()},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-brand/10 transition-colors whitespace-nowrap",children:[(0,e.jsx)(i.eV,{engine:f,className:"h-3.5 w-3.5"}),i.H[f]]},f))})})]})}function p({tabs:a,selectedTabId:b,unreadTabs:c,globalLoadingTabs:d,dragTabIndex:f,dragOverTabIndex:g,isPinned:h,onSwitchTab:i,onCloseTab:l,onCloseAllTabs:q,onNewTab:r,onNewCodexTab:s,onNewKimiTab:t,onNewGlmTab:u,onNewOllamaTab:v,onNewDeepseekTab:w,onOpenProjectSessions:x,onDragStart:y,onDragOver:z,onDrop:A,onDragEnd:B,sideBySide:C,onToggleSideBySide:D}){let{t:E}=(0,m.Bd)();return(0,e.jsx)("div",{className:"border-b border-border bg-card shrink-0",children:(0,e.jsxs)("div",{className:"flex items-center px-2 gap-1 overflow-x-auto",children:[a.map((a,m)=>{let o=a.id===b,p=h?.(a.id)??!1,q=a.isLoading||d.has(a.id)?"loading":c.has(a.id)&&!o?"unread":"normal";return(0,e.jsx)(k.m,{content:a.title,delay:200,className:"flex-1 min-w-16 max-w-[260px]",children:(0,e.jsxs)("div",{draggable:!0,onDragStart:()=>y(m),onDragOver:a=>z(a,m),onDrop:()=>A(m),onDragEnd:B,className:`group flex items-center gap-1 px-3 py-1.5 text-sm cursor-pointer rounded-t-lg border-t-[1.5px] transition-colors ${o?"border-brand bg-slate-4 text-foreground font-medium":"border-transparent text-muted-foreground hover:bg-secondary/50"} ${f===m?"opacity-50":""} ${g===m?"border-l-2 border-brand":""}`,onClick:()=>i(a.id),children:[(0,e.jsx)("div",{className:"h-4 w-4 -translate-x-1 flex-shrink-0",children:(0,e.jsx)(n,{number:m+1,status:q,statusLabel:"loading"===q?E("sessions.running"):"unread"===q?E("sessions.done"):void 0,isActive:o,pinned:p,bot:a.bot})}),(0,e.jsx)("span",{className:"flex-1 min-w-0 truncate",children:a.title}),(0,e.jsxs)("span",{className:"relative ml-1 h-4 w-4 translate-x-1 shrink-0",children:[(0,e.jsx)("span",{className:"absolute inset-0 inline-flex items-center justify-center transition-opacity group-hover:opacity-0 group-focus-within:opacity-0",children:(0,e.jsx)(j.S,{engine:a.engine,size:"sm"})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),l(a.id)},className:"absolute inset-0 flex items-center justify-center rounded opacity-0 transition-opacity hover:bg-muted group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","data-tooltip":E("tabBar.closeTab"),"aria-label":E("tabBar.closeTab"),children:(0,e.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]})},a.id)}),(0,e.jsx)(o,{onNewTab:r,onNewCodexTab:s,onNewKimiTab:t,onNewGlmTab:u,onNewOllamaTab:v,onNewDeepseekTab:w}),q&&(0,e.jsx)("button",{onClick:q,className:"flex-shrink-0 p-1.5 text-muted-foreground hover:text-destructive hover:bg-hover rounded transition-colors",title:E("tabBar.closeAll"),"aria-label":E("tabBar.closeAll"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),x&&(0,e.jsx)("button",{onClick:x,className:"flex-shrink-0 p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:E("sessions.projectSessions"),"aria-label":E("sessions.projectSessions"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),D&&(0,e.jsx)("button",{onClick:D,className:"flex-shrink-0 p-1.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors",title:C?E("chat.singlePane"):E("chat.splitPane"),"aria-label":C?E("chat.singlePane"):E("chat.splitPane"),"aria-pressed":C,children:(0,e.jsxs)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2",strokeWidth:2}),!C&&(0,e.jsx)("path",{strokeWidth:2,d:"M12 4v16"})]})})]})})}d()}catch(a){d(a)}})},4263:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$:()=>g});var e=c(12629),f=a([e]);e=(f.then?(await f)():f)[0];let h="/tree-sitter",i=null,j=new Map;async function g(a){let b,c=await (!(b=j.get(a))&&(b=(async()=>(await (!i&&(i=e.Parser.init({locateFile:a=>`${h}/${a}`})),i),e.Language.load(`${h}/tree-sitter-${a}.wasm`)))(),j.set(a,b)),b),d=new e.Parser;return d.setLanguage(c),d}d()}catch(a){d(a)}})},4325:(a,b,c)=>{"use strict";c.d(b,{$2:()=>u,N4:()=>k,_I:()=>t,fX:()=>l,fZ:()=>m});let d="cockpit update",e={visible:!1,stage:"preparing",startedAt:0,baselineMs:null,installedVersion:null,upToDate:!1,error:null,rolledBack:!1,fixCommand:d,logPath:null,live:!1},f="cockpit:update-seen-at",g=e,h=new Set,i=!1;function j(a){g={...g,...a},h.forEach(a=>a())}function k(a){return h.add(a),()=>h.delete(a)}function l(){return g}function m(){try{window.localStorage.setItem(f,String(Date.now()))}catch{}j({visible:!1})}let n=a=>new Promise(b=>setTimeout(b,a));async function o(){try{let a=await fetch("/api/health",{cache:"no-store",signal:AbortSignal.timeout(2e3)});if(!a.ok)return null;let b=await a.json();return{pid:"number"==typeof b.pid?b.pid:null,version:b.version??null}}catch{return null}}async function p(){try{let a=await fetch("/api/update-state",{cache:"no-store",signal:AbortSignal.timeout(2e3)});if(!a.ok)return{state:null,logPath:null};let b=await a.json();return{state:b.state??null,logPath:b.logPath??null}}catch{return{state:null,logPath:null}}}async function q(a){try{let b=await fetch(`http://127.0.0.1:${a}/`,{cache:"no-store",signal:AbortSignal.timeout(1500)});if(!b.ok)return null;return await b.json()}catch{return null}}function r(a){switch(a){case"installing":return"installing";case"repairing":return"repairing";case"rolling-back":return"rolling-back";case"restarting":case"done":return"restarting";default:return"preparing"}}function s(a,b={}){j({stage:"failed",error:a,...b})}async function t(){if(!i){i=!0,j({...e,visible:!0,stage:"preparing",startedAt:Date.now()});try{let a=await p();j({baselineMs:a.state?.installMs??a.state?.prevInstallMs??null,logPath:a.logPath});let b=await o(),c=b?.pid??null,e=b?.version??null,f=await fetch("/api/update",{method:"POST"});if(!f.ok){let a=await f.json().catch(()=>({}));s(a.error??`HTTP ${f.status}`);return}let h=await f.json().catch(()=>({})),i=h.statusPort??null;j({logPath:h.logPath??g.logPath});let k=0,l=null!==i,m=Date.now()+3e5;for(;Date.now()<m;){if(await n(1e3),l&&null!==i){let a=await q(i);if(a){if(k=0,j({live:!0}),"failed"===a.phase)return void s(a.error??"install failed",{rolledBack:!0===a.rolledBack,fixCommand:a.fixCommand??d,live:!0});j({stage:r(a.phase),installedVersion:a.installed??g.installedVersion,baselineMs:g.baselineMs??a.prevInstallMs??null})}else++k>=3&&(l=!1,j({live:!1}))}let a=await o();if(a?.pid!=null&&(null===c||a.pid!==c)){let{state:b}=await p();if(b?.phase==="failed")return void s(b.error??"update failed",{rolledBack:!0===b.rolledBack,fixCommand:b.fixCommand??d});let c=a.version??g.installedVersion;j({stage:"done",installedVersion:c,upToDate:null!==c&&c===e});return}}s("timeout")}catch(a){s(a instanceof Error?a.message:String(a))}finally{i=!1}}}async function u(){if(i||g.visible)return;let{state:a,logPath:b}=await p();if(!a?.phase||"done"===a.phase)return;let c=a.startedAt??0,h=a.installMs??a.prevInstallMs??null;if("failed"===a.phase){let g=0;try{g=Number(window.localStorage.getItem(f))||0}catch{}if((a.finishedAt??0)<=g)return;j({...e,visible:!0,stage:"failed",startedAt:c,baselineMs:h,error:a.error??"unknown error",rolledBack:!0===a.rolledBack,fixCommand:a.fixCommand??d,logPath:b});return}if(!(!c||Date.now()-c>6e5)){i=!0,j({...e,visible:!0,stage:r(a.phase),startedAt:c,baselineMs:h,logPath:b});try{let a=c+3e5;for(;Date.now()<a;){await n(1e3);let{state:a}=await p();if(a?.phase){if("failed"===a.phase)return void s(a.error??"install failed",{rolledBack:!0===a.rolledBack,fixCommand:a.fixCommand??d});if("done"===a.phase)return void j({stage:"done",installedVersion:a.installed??null,upToDate:!0===a.unchanged});j({stage:r(a.phase)})}}s("timeout")}finally{i=!1}}}},4462:(a,b,c)=>{"use strict";c.d(b,{EmptyState:()=>f});var d=c(48249),e=c(44384);function f({onBrowseProjects:a}){let{t:b}=(0,e.Bd)();return(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-5 bg-card",children:[(0,d.jsx)("svg",{className:"w-14 h-14 text-muted-foreground/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"})}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("workspace.selectProject")}),(0,d.jsxs)("button",{onClick:a,className:"flex items-center gap-2 px-4 py-2 text-sm rounded-lg bg-primary text-primary-foreground hover:opacity-90 transition-opacity",children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m3-3H9m-4 7h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),b("workspace.openProject")]})]})}},4857:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e});var d=c(67484);function e(){let a=(0,d.useRef)([]),b=(0,d.useRef)([]),c=(0,d.useCallback)(c=>{a.current.push(c),a.current.length>50&&(a.current=a.current.slice(-50)),b.current=[]},[]),e=(0,d.useCallback)(c=>{if(0===a.current.length)return null;let d=a.current.pop();return b.current.push(c),b.current.length>50&&(b.current=b.current.slice(-50)),d},[]),f=(0,d.useCallback)(c=>{if(0===b.current.length)return null;let d=b.current.pop();return a.current.push(c),a.current.length>50&&(a.current=a.current.slice(-50)),d},[]);return{push:c,goBack:e,goForward:f,canGoBack:(0,d.useCallback)(()=>a.current.length>0,[]),canGoForward:(0,d.useCallback)(()=>b.current.length>0,[])}}},5585:(a,b,c)=>{"use strict";c.d(b,{Providers:()=>p});var d=c(48249),e=c(29491),f=c(83768),g=c(7833),h=c(67484),i=c(74429);function j(){let[a,b]=(0,h.useState)(null);(0,h.useRef)(null).current=a,(0,h.useRef)(null);let c=(0,h.useRef)(null),[e,f]=(0,h.useState)({left:0,top:0}),[g,j]=(0,h.useState)(!1);return g&&a?(0,i.createPortal)((0,d.jsx)("div",{ref:c,className:"fixed z-[9999] max-w-[min(80vw,64rem)] px-2 py-1 bg-tooltip text-tooltip-foreground text-xs font-mono rounded shadow-lv3 border border-line-1 whitespace-pre-wrap break-words pointer-events-none",style:{left:e.left,top:e.top},children:a.text}),document.body):null}var k=c(44384),l=c(4325);c(29939);let m=new Set(["preparing","installing","repairing","rolling-back","restarting"]);function n(){return(0,d.jsxs)("svg",{className:"h-4 w-4 flex-shrink-0 animate-spin text-brand",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:4}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function o(){let{t:a}=(0,k.Bd)(),b=(0,h.useSyncExternalStore)(l.N4,l.fX,l.fX),[c,e]=(0,h.useState)(()=>Date.now());(0,h.useRef)(!1);let{stale:f}=function(){let[a,b]=(0,h.useState)(!1);return{stale:a}}(),[i,j]=(0,h.useState)(!1),[o,p]=(0,h.useState)(!1),q=b.visible&&m.has(b.stage),r=(0,h.useCallback)(()=>{navigator.clipboard.writeText(b.fixCommand),(0,g.oR)(a("workspace.updateCardFixCopied"))},[b.fixCommand,a]),s=!b.visible&&f&&!i;if(!o||!b.visible&&!s)return null;let t=b.startedAt?Math.max(0,Math.round((c-b.startedAt)/1e3)):0,u=b.baselineMs?Math.round(b.baselineMs/1e3):null,v=s||"done"===b.stage,w=s||!m.has(b.stage),x=v&&!b.upToDate,y=s?a("workspace.serverRestarted"):(()=>{switch(b.stage){case"preparing":return a("workspace.updateCardPreparing");case"installing":return a("workspace.updateCardInstalling");case"repairing":return a("workspace.updateCardRepairing");case"rolling-back":return a("workspace.updateCardRollingBack");case"restarting":return a("workspace.updateCardRestarting");case"done":if(!b.installedVersion)return a("workspace.updateComplete");return b.upToDate?a("workspace.updateCardUpToDate",{version:b.installedVersion}):a("workspace.updateCardDone",{version:b.installedVersion});case"failed":return a("workspace.updateFailed")}})();return(0,d.jsx)("div",{className:"fixed top-4 right-4 z-[110] w-80 rounded-lg border border-border\n bg-background/95 p-3 shadow-lv2 backdrop-blur",role:"status","aria-live":"polite",children:(0,d.jsxs)("div",{className:"flex items-start gap-2.5",children:[q?(0,d.jsx)(n,{}):v?(0,d.jsx)("svg",{className:"h-4 w-4 flex-shrink-0 text-brand",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):(0,d.jsx)("svg",{className:"h-4 w-4 flex-shrink-0 text-destructive",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"text-sm text-foreground",children:y}),q&&(0,d.jsxs)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:[a("workspace.updateCardElapsed",{seconds:t}),null!==u&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",a("workspace.updateCardBaseline",{seconds:u})]})]}),q&&!b.live&&(0,d.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground/80",children:a("workspace.updateCardNoLiveStatus")}),q&&(0,d.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:a("workspace.updateRestartNote")}),!s&&"failed"===b.stage&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"mt-1 break-words text-[11px] leading-snug text-muted-foreground",children:b.error}),b.rolledBack&&(0,d.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:a("workspace.updateCardRolledBack")}),(0,d.jsx)("div",{className:"mt-2 text-[11px] leading-snug text-muted-foreground",children:a("workspace.updateCardManualHint")}),(0,d.jsx)("code",{className:"mt-1 block break-all rounded bg-hover px-2 py-1.5 text-[11px]\n leading-snug text-foreground",children:b.fixCommand}),(0,d.jsx)("button",{type:"button",onClick:r,className:"mt-1.5 w-full rounded-md border border-border px-2.5 py-1.5 text-xs\n text-foreground transition-colors hover:bg-hover",children:a("workspace.updateCardCopyFix")}),b.logPath&&(0,d.jsx)("div",{className:"mt-1.5 break-all text-[11px] leading-snug text-muted-foreground/80",children:a("workspace.updateCardLogHint",{path:b.logPath})})]}),x&&(0,d.jsx)("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-2 w-full rounded-md bg-primary px-2.5 py-1.5 text-xs\n text-primary-foreground transition-opacity hover:opacity-90",children:a("workspace.reloadNow")})]}),w&&(0,d.jsx)("button",{type:"button",onClick:()=>{j(!0),s||(0,l.fZ)()},"aria-label":a("common.close"),className:"-mr-1 -mt-1 rounded p-1 text-muted-foreground transition-colors hover:bg-hover",children:(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}function p({children:a}){return(0,d.jsx)(e.I18nProvider,{children:(0,d.jsx)(f.NP,{children:(0,d.jsxs)(g.tE,{children:[a,(0,d.jsx)(j,{}),(0,d.jsx)(o,{})]})})})}},5900:(a,b,c)=>{"use strict";c.d(b,{T:()=>D});var d=c(48249),e=c(98051),f=c(38368),g=c(33972),h=c(10841),i=c(99773),j=c(36513);c(55583),c(87023);var k=c(50757),l=c(27454),m=c(37752),n=c(67484),o=c(64676),p=c(83768),q=c(15466),r=c(49216);function s(a){return{type:"tableCell",children:[{type:"text",value:a}]}}let t=[c(4014).A,function(){return a=>{let b=a.children;for(let a=0;a<b.length;a++){let c=b[a];if("yaml"!==c.type)continue;let d=null;try{let a=r.Ay.load(c.value??"");a&&"object"==typeof a&&!Array.isArray(a)&&(d=a)}catch{d=null}let e=d?Object.entries(d):[];if(0===e.length){b.splice(a,1),a--;continue}let f={type:"tableRow",children:[s("Field"),s("Value")]},g=e.map(([a,b])=>({type:"tableRow",children:[s(a),s(function(a){if(null==a)return"";if("string"==typeof a)return a.replace(/\s*\n\s*/g," ").trim();if("number"==typeof a||"boolean"==typeof a)return String(a);try{return JSON.stringify(a)}catch{return String(a)}}(b))]}));b[a]={type:"table",align:["left","left"],children:[f,...g]}}}}];function u(a){return!(!a.trim()||/\n[ \t]*\n/.test(a)||a.includes("$"))}function v(a){if(!a.includes("\\(")&&!a.includes("\\["))return a;let b=[],c=a=>(b.push(a),`\u0000MATHMASK${b.length-1}\u0000`);return a.replace(/```[\s\S]*?```/g,c).replace(/~~~[\s\S]*?~~~/g,c).replace(/`[^`\n]+`/g,c).replace(/\\\[([^\u0000]*?)\\\]/g,(a,b)=>u(b)?`$$${b}$$`:a).replace(/\\\(([^\u0000]*?)\\\)/g,(a,b)=>u(b)?`$${b}$`:a).replace(/\u0000MATHMASK(\d+)\u0000/g,(a,c)=>b[+c])}let w=[...t,f.A,g.A,function(){return(a,b)=>{let c=String(b?.value??"");c&&function a(b,c){let d=b.children;if(d)for(let e=0;e<d.length;e++)c(d[e],e,b),a(d[e],c)}(a,(a,b,d)=>{var e;if("inlineMath"!==a.type)return;let f=a.position?.start?.offset,g=a.position?.end?.offset;void 0!==f&&void 0!==g&&(e=a.value??"","$$"!==c.slice(f,f+2)&&(!e||/^\s|\s$/.test(e)||/\d/.test(c[f-1]??"")||/\d/.test(c[g]??"")||0)&&(d.children[b]={type:"text",value:c.slice(f,g),position:a.position}))})}},h.jb],x=[...t,f.A,h.jb],y=[i.A,j.A],z=[i.A];function A(a){let b=[],c=a=>(b.push(a),` MASK${b.length-1} `);return a.replace(/```[\s\S]*?```/g,a=>c(a)).replace(/~~~[\s\S]*?~~~/g,a=>c(a)).replace(/^(\|.+\|)$/gm,a=>/^\|[\s:|-]+\|$/.test(a)?a:a.replace(/`([^`]*)`/g,(a,b)=>b.includes("|")?"`"+b.replace(/\|/g,"\\|")+"`":a)).replace(/ MASK(\d+) /g,(a,c)=>b[+c])}let B=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clippath","defs","ellipse","g","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan","use"]);function C(a){let b=[],c=a=>(b.push(a),`\u0000MASK${b.length-1}\u0000`);return a.replace(/```[\s\S]*?```/g,a=>c(a)).replace(/~~~[\s\S]*?~~~/g,a=>c(a)).replace(/`[^`\n]+`/g,a=>c(a)).replace(/<\/?([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(a,b)=>{let c=b.toLowerCase();return B.has(c)||c.includes("-")?a:a.replace(/</g,"&lt;").replace(/>/g,"&gt;")}).replace(/\u0000MASK(\d+)\u0000/g,(a,c)=>b[+c])}let D=(0,n.memo)(function({content:a,isUser:b=!1,isStreaming:c=!1,enableMath:f=!0,isDark:g,rehypePlugins:h,onLinkClick:i,basePath:j}){let r=(0,p.Ql)(),s=g??r?.resolvedTheme==="dark",t=(0,n.useRef)(null),u=(0,n.useMemo)(()=>({code({className:a,children:b,node:c,...e}){let f=/language-(\w+)/.exec(a||"");if(!("string"==typeof b||"number"==typeof b||Array.isArray(b)&&b.every(a=>"string"==typeof a||"number"==typeof a)))return(0,d.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent font-mono",...e,children:b});let g=String(b);if(!f&&!a&&!g.includes("\n"))return(0,d.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent font-mono",...e,children:b});let h=g.replace(/\n$/,""),i=f?.[1]||"text",j=Number(e["data-source-start"])||0,n=j?j+1:0,o=0;return(0,d.jsx)(k.A,{style:s?l.A:m.A,language:i,PreTag:"div",className:"md-figure",customStyle:{margin:"1.35em 0",borderRadius:"0.375rem",fontSize:"0.92em"},wrapLines:!0,lineProps:()=>{let a=n+o;return o++,{"data-source-start":a,"data-source-end":a,style:{display:"block"}}},children:h})},p:({children:a,node:b,...c})=>(0,d.jsx)("p",{...c,children:a}),h1:({children:a,node:b,...c})=>(0,d.jsx)("h1",{...c,children:a}),h2:({children:a,node:b,...c})=>(0,d.jsx)("h2",{...c,children:a}),h3:({children:a,node:b,...c})=>(0,d.jsx)("h3",{...c,children:a}),ul:({children:a,node:b,...c})=>(0,d.jsx)("ul",{className:"list-disc",...c,children:a}),ol:({children:a,node:b,...c})=>(0,d.jsx)("ol",{className:"list-decimal",...c,children:a}),li:({children:a,node:b,...c})=>(0,d.jsx)("li",{...c,children:a}),blockquote:({children:a,node:b,...c})=>(0,d.jsx)("blockquote",{className:"border-l-2 border-border pl-4 text-muted-foreground",...c,children:a}),a:({href:a,children:b,node:c,...e})=>(0,d.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline",...e,onClick:b=>{if(a){if(a.startsWith("#")){(0,q.O)(t.current,a.slice(1))&&b.preventDefault();return}i?.(a)&&b.preventDefault()}},children:b}),table:({children:a,node:b,...c})=>(0,d.jsx)("div",{className:"md-figure overflow-x-auto",...c,children:(0,d.jsx)("table",{className:"min-w-full border border-border",children:a})}),thead:({children:a,node:b,...c})=>(0,d.jsx)("thead",{className:"bg-accent",...c,children:a}),th:({children:a,node:b,...c})=>(0,d.jsx)("th",{className:"px-4 py-2 text-left font-semibold border-b border-border",...c,children:a}),td:({children:a,node:b,...c})=>(0,d.jsx)("td",{className:"px-4 py-2 border-b border-border",...c,children:a}),hr:({node:a,...b})=>(0,d.jsx)("hr",{className:"border-border",...b}),img:({src:a,alt:b,node:c,height:e,width:f,style:g,...h})=>{let i=j&&"string"==typeof a?(0,o.xh)(a,j):a;if(!(e||f||g))return(0,d.jsx)("img",{src:i,alt:b||"",className:"max-w-full h-auto rounded-lg my-3",...h});let k=a=>a?/^\d+$/.test(String(a))?`${a}px`:String(a):void 0,l={...g,height:k(e)??g?.height,width:k(f)??g?.width};return(0,d.jsx)("img",{src:i,alt:b||"",style:l,className:"inline-block align-middle",...h})},strong:({children:a,node:b,...c})=>(0,d.jsx)("strong",{className:"font-bold",...c,children:a}),em:({children:a,node:b,...c})=>(0,d.jsx)("em",{className:"italic",...c,children:a}),del:({children:a,node:b,...c})=>(0,d.jsx)("del",{className:"line-through",...c,children:a})}),[s,i,j]),B=f?w:x,D=f?y:z,E=(0,n.useMemo)(()=>{if(b||c)return C(a);let d=C(A(!function(a){if(/^\|[\s:|-]+\|$/m.test(a))return!1;if(/[┌┐└┘│─├┤┬┴┼╔╗╚╝║═╭╮╯╰▲▼◀▶△▽◁▷]/.test(a)||/\+[-=]{2,}\+/.test(a))return!0;let b=a.split("\n").filter(a=>/^\s*\||\|\s*$/.test(a));if(b.length>=3){let a=b.map(a=>(a.match(/\|/g)||[]).length);return!a.every(b=>b===a[0])||!(a[0]>=3)}return!1}(a)||/^```[\s\S]*```$/m.test(a.trim())?a:"```text\n"+a.trim()+"\n```"));return f?v(d):d},[a,b,c,f]),F=(0,n.useMemo)(()=>h?.length?[...D,...h]:D,[h,D]);if(b)return(0,d.jsx)("div",{className:"reading-measure whitespace-pre-wrap break-words",children:a});if(c){let b=a.lastIndexOf("\n");if(-1===b)return(0,d.jsx)("div",{className:"reading-measure whitespace-pre-wrap break-words",children:a});let c=a.slice(0,b+1),g=a.slice(b+1);return(0,d.jsxs)("div",{className:"markdown-body",ref:t,children:[(0,d.jsx)(e.oz,{remarkPlugins:B,rehypePlugins:D,components:u,children:f?v(C(A(c))):C(A(c))}),g&&(0,d.jsx)("span",{className:"md-tail whitespace-pre-wrap",children:g})]})}return(0,d.jsx)("div",{className:"markdown-body",ref:t,children:(0,d.jsx)(e.oz,{remarkPlugins:B,rehypePlugins:F,components:u,children:E})})})},6478:(a,b,c)=>{"use strict";c.d(b,{P:()=>j});var d=c(67484),e=c(44384),f=c(7833),g=c(33281),h=c(47276),i=c(35857);function j(){let{t:a}=(0,e.Bd)();return(0,d.useCallback)(async b=>{let c=await g.t4.runPromiseExit((0,h.ot)(b));if("Success"===c._tag)c.value.alreadyExists?(0,f.oR)(a("htmlApps.alreadyAdded"),"info"):((0,f.oR)(a("htmlApps.added"),"success"),(0,i.N)());else{let b="Fail"===c.cause._tag?c.cause.error:null,d=b?.cause,e=d instanceof Error?d.message:a("htmlApps.addFailed");(0,f.oR)(e,"error")}},[a])}},6612:(a,b,c)=>{"use strict";c.d(b,{TabManager:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TabManager() from the server but TabManager is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/TabManager.tsx","TabManager")},6662:(a,b,c)=>{"use strict";c.d(b,{W:()=>j});var d=c(67484),e=c(9804),f=c(79606),g=c(33281),h=c(87808),i=c(25419);function j({cwd:a}){let[b,c]=(0,d.useState)([]),[k,l]=(0,d.useState)(null),[m,n]=(0,d.useState)(new Set),[o,p]=(0,d.useState)([]),[q,r]=(0,d.useState)(null),[s,t]=(0,d.useState)(null),[u,v]=(0,d.useState)(new Set),[w,x]=(0,d.useState)(null),[y,z]=(0,d.useState)(""),[A,B]=(0,d.useState)(!1),[C,D]=(0,d.useState)(null),[E,F]=(0,d.useState)(!0),[G,H]=(0,d.useState)(!1),[I,J]=(0,d.useState)(null),K=(0,d.useRef)(null),[L,M]=(0,d.useState)(!1),[N,O]=(0,d.useState)(null),[P,Q]=(0,d.useState)("center"),[R,S]=(0,d.useState)(null),[T,U]=(0,d.useState)(null),[V,W]=(0,d.useState)(!1),[X,Y]=(0,d.useState)([]),[Z,$]=(0,d.useState)(!1),[_,aa]=(0,d.useState)(null),[ab,ac]=(0,d.useState)(null),[ad,ae]=(0,d.useState)(!0),[af,ag]=(0,d.useState)(!1),[ah,ai]=(0,d.useState)(!1),aj=(0,d.useMemo)(()=>o.map(a=>a.path).filter(Boolean),[o]),ak=(0,d.useMemo)(()=>(0,e.v3)(aj),[aj]),al=(0,d.useMemo)(()=>new Set((0,e.tW)(ak)),[ak]),am=(0,d.useMemo)(()=>y?k?(0,e.KH)(k,y,A):(0,e.q3)(b,y,A):null,[b,k,y,A]),an=w??u,ao=(0,d.useRef)(null),ap=(0,d.useCallback)(b=>{ao.current&&clearTimeout(ao.current),ao.current=setTimeout(()=>{g.t4.runFork((0,h.Ft)(a,Array.from(b)).pipe(f.sFT(a=>f.OH5(()=>console.error("Error saving expanded paths:",a))),f.NWQ(()=>f.rIH)))},500)},[a]),aq=(0,d.useCallback)(async()=>{F(!0),J(null),await g.t4.runPromise((0,h.mP)(a).pipe(f.YWq({onSuccess:a=>{a.error?J(a.error):(c(a.files??[]),a.expandedPaths&&Array.isArray(a.expandedPaths)&&v(new Set(a.expandedPaths)))},onFailure:a=>{console.error("Error loading files:",a),J("Failed to load files")}}))),F(!1)},[a]),ar=(0,d.useCallback)(()=>{g.t4.runPromise((0,h.DZ)(a).pipe(f.YWq({onSuccess:a=>{a.paths&&l(a.paths)},onFailure:a=>{console.error("Error loading file index:",a)}})))},[a]),as=(0,d.useCallback)(async b=>{n(a=>new Set([...a,b])),await g.t4.runPromise((0,h.gZ)(a,b).pipe(f.YWq({onSuccess:a=>{a.children&&c(c=>{if(!b){let b=new Map(c.map(a=>[a.path,a]));return a.children.map(a=>{let c=b.get(a.path);return c?.children&&a.isDirectory?{...a,children:c.children}:a})}let d=structuredClone(c),f=(0,e.MB)(d,b);return f&&(f.children=a.children),d})},onFailure:a=>{console.error("Error loading directory:",a)}}))),n(a=>{let c=new Set(a);return c.delete(b),c})},[a]);(0,d.useRef)(m).current=m;let at=(0,d.useCallback)(async()=>{await g.t4.runPromise((0,h.r9)(a).pipe(f.YWq({onSuccess:a=>p(a.files??[]),onFailure:a=>console.error("Error loading recent files:",a)})))},[a]),au=(0,d.useCallback)(async b=>{p(a=>{let c=a.filter(a=>a.path!==b);return[{path:b},...c].slice(0,15)}),await g.t4.runPromise((0,h.YW)(a,b).pipe(f.sFT(a=>f.OH5(()=>console.error("Error adding to recent files:",a))),f.NWQ(()=>f.rIH)))},[a]),av=(0,d.useCallback)((b,c,d,e)=>{p(a=>a.map(a=>a.path===b?{...a,scrollLine:c,cursorLine:d,cursorCol:e}:a)),g.t4.runFork((0,h.YW)(a,b,{scrollLine:c,cursorLine:d,cursorCol:e}).pipe(f.NWQ(()=>f.rIH)))},[a]),aw=(0,d.useCallback)(a=>o.find(b=>b.path===a),[o]),ax=(0,d.useCallback)(async b=>{let c=b||q;c&&($(!0),aa(null),await g.t4.runPromise((0,h.eE)(a,c).pipe(f.YWq({onSuccess:a=>{a.error?aa(a.error):Y(a.blame??[])},onFailure:a=>{console.error("Error loading blame:",a),aa("Failed to load blame info")}}))),$(!1))},[a,q]),ay=(0,d.useCallback)(async b=>{H(!0),t(null),W(!1),Y([]),aa(null),ac(null);let c=f.JkU(function*(){let c=yield*(0,h.r6)(a,b);if(!c.ok)return{type:"error",message:c.data?.error||"Failed to stat file"};let d=c.data??{};if(!d.exists)return{type:"error",message:"File not found"};if("dir"===d.kind)return{type:"error",message:"Path is a directory"};switch(d.category){case"image":return{type:"image",size:d.size,mtime:d.mtimeMs,...d.isSymlink?{isSymlink:!0,symlinkTarget:d.symlinkTarget}:{}};case"pdf":return{type:"pdf",size:d.size,mtime:d.mtimeMs,...d.isSymlink?{isSymlink:!0,symlinkTarget:d.symlinkTarget}:{}};case"binary":return{type:"binary",message:"Cannot preview binary file",size:d.size,mtime:d.mtimeMs};case"too-large":return{type:"error",message:"File too large to preview",size:d.size,mtime:d.mtimeMs};default:{let c=yield*(0,i.K)(a,b);if(409===c.status)return{type:"binary",message:c.data?.error||"Cannot preview binary file",size:d.size,mtime:d.mtimeMs};if(!c.ok)return{type:"error",message:c.data?.error||"Failed to load file"};let e=c.data??{};return{type:"text",content:e.content,size:e.size,mtime:e.mtimeMs,...e.isSymlink?{isSymlink:!0,symlinkTarget:e.symlinkTarget}:{}}}}});await g.t4.runPromise(c.pipe(f.YWq({onSuccess:a=>t(a),onFailure:a=>{console.error("Error loading file content:",a),t({type:"error",message:"Failed to load file"})}}))),au(b),ax(b),H(!1)},[a,au,ax]),az=(0,d.useCallback)(()=>{V?W(!1):(W(!0),0===X.length&&ax())},[V,X.length,ax]),aA=(0,d.useCallback)((a,b)=>{if(!a)return;if(r(a),O(b??null),null==b){let b=o.find(b=>b.path===a);b?.scrollLine?(O(b.scrollLine),Q("start"),S(b.cursorLine??null),U(b.cursorCol??null)):(Q("center"),S(null),U(null))}else Q("center"),S(null),U(null);ay(a);let c=a.split("/");if(c.length>1){let a=[];for(let b=1;b<c.length;b++)a.push(c.slice(0,b).join("/"));v(b=>{let c=new Set(b),d=!1;for(let b of a)c.has(b)||(c.add(b),d=!0);return d&&ap(c),d?c:b})}},[ay,ap,o]),aB=(0,d.useCallback)(a=>{if(w)x(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c});else{let c=!u.has(a);if(v(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),ap(c),c}),c){let c=(0,e.MB)(b,a);c&&c.isDirectory&&!c.children&&as(a)}}},[w,ap,u,b,as]);return{files:b,setFiles:c,fileIndex:k,setFileIndex:l,loadingDirs:m,expandedPaths:u,setExpandedPaths:v,searchTreeExpandedPaths:w,setSearchTreeExpandedPaths:x,effectiveExpandedPaths:an,searchQuery:y,setSearchQuery:z,searchExactMatch:A,setSearchDirExact:B,matchedPaths:am,creatingItem:C,setCreatingItem:D,isLoadingFiles:E,fileError:I,searchInputRef:K,shouldScrollToSelected:L,setShouldScrollToSelected:M,targetLineNumber:N,setTargetLineNumber:O,targetScrollAlign:P,setTargetScrollAlign:Q,initialCursorLine:R,initialCursorCol:T,setInitialCursorLine:S,setInitialCursorCol:U,selectedPath:q,setSelectedPath:r,fileContent:s,setFileContent:t,isLoadingContent:G,recentFiles:o,recentFilePaths:aj,setRecentFiles:p,recentFilesTree:ak,recentTreeDirPaths:al,showBlame:V,setShowBlame:W,blameLines:X,isLoadingBlame:Z,blameError:_,blameSelectedCommit:ab,setBlameSelectedCommit:ac,previewMarkdown:ad,setPreviewMarkdown:ae,previewHtml:af,setPreviewHtml:ag,showEditor:ah,setShowEditor:ai,saveExpandedPaths:ap,loadFiles:aq,loadFileIndex:ar,loadDirectory:as,loadRecentFiles:at,addToRecentFiles:au,updateRecentFilePosition:av,getRecentFilePosition:aw,loadFileContent:ay,loadBlame:ax,handleToggleBlame:az,handleSelectFile:aA,handleToggle:aB}}},6900:(a,b,c)=>{"use strict";c.d(b,{x:()=>m});var d=c(48249),e=c(67484),f=c(44384),g=c(7833),h=c(33281),i=c(85655),j=c(9804),k=c(57031),l=c(88214);function m({isOpen:a,onClose:b,cwd:c}){let n,{t:o}=(0,f.Bd)(),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)([]),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)(!1),N=(0,e.useCallback)((a,b)=>a?._tag==="Fail"&&a.error?.cause instanceof Error?a.error.cause.message:o(b),[o]),O=(0,e.useCallback)(async()=>{w(!0);let a=await h.t4.runPromiseExit((0,i.FK)(c));if("Success"===a._tag){let b=a.value;q(b.worktrees),s(b.nextPath),u(b.nextRandomWord),b.gitUserName&&E(b.gitUserName)}else console.error("Failed to load worktrees:",a.cause),(0,g.oR)(o("toast.worktreeLoadFailed"),"error");w(!1)},[c,o]),P=(0,e.useCallback)(a=>{let{local:b,remote:c}=a;return c.includes("origin/main")?"origin/main":c.includes("origin/master")?"origin/master":b.includes("main")?"main":b.includes("master")?"master":c.length>0?c[0]:b.length>0?b[0]:"main"},[]),Q=async()=>{if(!r)return;let a="origin/main",b=await h.t4.runPromiseExit((0,i.r4)(c));"Success"===b._tag&&(a=P(b.value));let d=t||function(){let a="bcdfghjklmnprstvwz",b=["a","e","i","o","u","ai","au","ea","ee","ia","io","oa","oo","ou","ui"],c="";for(let d=0;d<2;d++)c+=a[Math.floor(Math.random()*a.length)],c+=b[Math.floor(Math.random()*b.length)];return c}(),e=D?`${D}/${d}`:d;y(!0);let f=await h.t4.runPromiseExit((0,i.CM)({action:"add",cwd:c,path:r,newBranch:e,baseBranch:a}));"Success"===f._tag?((0,g.oR)(o("toast.worktreeCreateSuccess",{name:e}),"success"),O()):(console.error("Failed to create worktree:",f.cause),(0,g.oR)(N(f.cause,"toast.worktreeCreateFailed"),"error")),y(!1)},R=async()=>{M(!0),K(""),G(!0);let a=await h.t4.runPromiseExit((0,i.r4)(c));if("Success"===a._tag){let b=a.value,c=b.local??[],d=b.remote??[],e=new Set(p.map(a=>a.branch).filter(Boolean));I([...c.filter(a=>!e.has(a)),...d.filter(a=>!e.has(a)&&!c.includes(a.replace(/^origin\//,"")))])}else(0,g.oR)(o("toast.loadBranchFailed"),"error");M(!1)},S=async a=>{if(!r)return;G(!1),y(!0);let b=await h.t4.runPromiseExit((0,i.CM)({action:"add",cwd:c,path:r,branch:a}));"Success"===b._tag?((0,g.oR)(o("toast.worktreeCreateSuccess",{name:a}),"success"),O()):(console.error("Failed to create worktree:",b.cause),(0,g.oR)(N(b.cause,"toast.worktreeCreateFailed"),"error")),y(!1)},T=async()=>{if(!z)return;C(!0);let a=await h.t4.runPromiseExit((0,i.CM)({action:"remove",cwd:c,path:z.path}));"Success"===a._tag?((0,g.oR)(o("toast.worktreeDeleted"),"success"),A(null),O()):(console.error("Failed to delete worktree:",a.cause),(0,g.oR)(N(a.cause,"toast.worktreeDeleteFailed"),"error")),C(!1)},U=async a=>{let b=a.isLocked?"unlock":"lock",d=await h.t4.runPromiseExit((0,i.CM)({action:b,cwd:c,path:a.path}));"Success"===d._tag?((0,g.oR)(a.isLocked?o("toast.worktreeUnlocked"):o("toast.worktreeLocked"),"success"),O()):(console.error("Failed to toggle lock:",d.cause),(0,g.oR)(N(d.cause,"toast.operationFailed"),"error"))};return a?(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-scrim",onClick:b,children:(0,d.jsxs)("div",{className:"bg-card rounded-lg shadow-lv3 w-[480px] max-h-[80vh] flex flex-col",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between flex-shrink-0",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Git Worktrees"}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:o("common.close"),children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:v?(0,d.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,d.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):(0,d.jsx)("div",{className:"space-y-2",children:p.map(a=>{let e,f=a.path===c;return(0,d.jsxs)("div",{className:`group p-3 rounded-lg border transition-colors ${f?"border-brand bg-brand/5":"border-border hover:bg-hover cursor-pointer"}`,onClick:()=>{a.path!==c&&((0,k.F)(l.n.OpenProject,{cwd:a.path}),b())},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${f?"bg-brand":"bg-muted-foreground/30"}`}),(0,d.jsx)("span",{className:"font-medium text-foreground truncate",children:a.branch||(a.isDetached?"detached":"unknown")}),a.isLocked&&(0,d.jsx)("span",{className:"text-amber-11",title:o("git.worktree.locked"),children:"\uD83D\uDD12"}),f&&(0,d.jsxs)("span",{className:"text-xs text-brand",children:["(",o("common.current"),")"]})]}),(0,d.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:!f&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),U(a)},className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-secondary rounded transition-colors",title:a.isLocked?o("git.worktree.unlock"):o("git.worktree.lock"),children:a.isLocked?(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"})}):(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),A(a)},className:"p-1.5 text-muted-foreground hover:text-red-11 hover:bg-secondary rounded transition-colors",title:o("common.delete"),children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})})]}),(0,d.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 pl-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:a.path}),null!=a.createdAt&&(e=(0,j.fw)(a.createdAt/1e3),(0,d.jsx)("span",{className:`text-xs flex-shrink-0 ${"just now"===e?"text-brand":"text-muted-foreground/70"}`,"data-tooltip":new Date(a.createdAt).toLocaleString(),children:e}))]}),a.isDetached&&(0,d.jsx)("div",{className:"mt-1 text-xs text-amber-11 pl-4",children:"(detached HEAD)"})]},a.path)})})}),F&&(0,d.jsxs)("div",{className:"border-t border-border px-4 py-3 flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,d.jsx)("input",{value:J,onChange:a=>K(a.target.value),placeholder:o("git.worktree.searchBranch"),className:"flex-1 bg-secondary text-sm text-foreground rounded px-2.5 py-1.5 outline-none",autoFocus:!0,autoComplete:"off",spellCheck:"false"}),(0,d.jsx)("button",{onClick:()=>G(!1),className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1.5",children:o("common.cancel")})]}),(0,d.jsx)("div",{className:"max-h-[200px] overflow-y-auto space-y-0.5",children:L?(0,d.jsx)("div",{className:"text-xs text-muted-foreground text-center py-4",children:o("common.loading")}):0===(n=H.filter(a=>a.toLowerCase().includes(J.toLowerCase()))).length?(0,d.jsx)("div",{className:"text-xs text-muted-foreground text-center py-4",children:o("git.worktree.noBranches")}):n.map(a=>(0,d.jsx)("button",{onClick:()=>S(a),className:"w-full text-left px-2.5 py-1.5 text-sm rounded hover:bg-hover transition-colors truncate",children:(0,d.jsx)("span",{className:`${a.startsWith("origin/")?"text-muted-foreground":"text-foreground"}`,children:a})},a))})]}),(0,d.jsxs)("div",{className:"px-4 py-3 border-t border-border flex items-center justify-between flex-shrink-0",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:o("git.worktree.count",{count:p.length})}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{onClick:R,disabled:!r||x,className:`px-3 py-1.5 text-sm rounded transition-colors ${r&&!x?"bg-secondary text-foreground hover:bg-hover":"bg-secondary text-muted-foreground cursor-not-allowed"}`,children:o("git.worktree.selectBranch")}),(0,d.jsx)("button",{onClick:Q,disabled:!r||x,className:`px-3 py-1.5 text-sm rounded transition-colors ${r&&!x?"bg-brand text-white hover:bg-brand/90":"bg-secondary text-muted-foreground cursor-not-allowed"}`,children:x?(0,d.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):o("git.worktree.addWorktree")})]})]}),z&&(0,d.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-scrim rounded-lg",onClick:()=>A(null),children:(0,d.jsxs)("div",{className:"bg-card rounded-lg shadow-lv3 w-[360px] p-4",onClick:a=>a.stopPropagation(),children:[(0,d.jsx)("div",{className:"text-sm font-medium text-foreground mb-3",children:o("git.worktree.confirmDelete")}),(0,d.jsxs)("div",{className:"text-sm text-muted-foreground mb-4",children:[(0,d.jsx)("p",{className:"mb-2",children:o("git.worktree.confirmDeleteMsg")}),(0,d.jsxs)("p",{className:"text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:o("git.worktree.path")}),(0,d.jsx)("span",{className:"text-foreground",children:z.path})]}),(0,d.jsxs)("p",{className:"text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:o("git.worktree.branch")}),(0,d.jsx)("span",{className:"text-foreground",children:z.branch||"detached"})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)("button",{onClick:()=>A(null),className:"px-3 py-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:o("common.cancel")}),(0,d.jsx)("button",{onClick:T,disabled:B,className:"px-3 py-1.5 text-sm bg-red-9 text-white rounded hover:bg-red-10 transition-colors disabled:opacity-50",children:B?(0,d.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):o("common.delete")})]})]})})]})}):null}},7031:(a,b,c)=>{"use strict";c.d(b,{H:()=>g,r:()=>h});var d=c(48249),e=c(67484);let f=(0,e.createContext)(null);function g({value:a,children:b}){return(0,d.jsx)(f.Provider,{value:a,children:b})}function h(){return(0,e.useContext)(f)}},7093:(a,b,c)=>{"use strict";c.d(b,{S:()=>g,q:()=>f});let d=[/(^|\/)__tests__\//,/(^|\/)tests?\//,/\.(test|spec)\.[^/]+$/],e=[/\.(md|mdx)$/i,/(^|\/)docs\//,/(^|\/)README[^/]*$/i,/(^|\/)LICENSE[^/]*$/i,/(^|\/)CHANGELOG[^/]*$/i];function f(a){return d.some(b=>b.test(a))?"test":e.some(b=>b.test(a))?"docs":null}function g(a){if(0===a.length)return null;let b=f(a[0]);return null===b?null:a.every(a=>f(a)===b)?b:null}},7122:(a,b,c)=>{"use strict";c.d(b,{Ee:()=>m,SU:()=>j,ft:()=>l,iN:()=>k});var d=c(48249),e=c(67484),f=c(44384),g=c(74429),h=c(7833);let i=(0,e.createContext)(null);function j({container:a,children:b}){return(0,d.jsx)(i.Provider,{value:a,children:b})}function k(){return(0,e.useContext)(i)}function l({x:a,y:b,path:c,cwd:j,isDirectory:k,onClose:m,onCreateFile:n,onDelete:o,onRefresh:p,onCopyFile:q,onPaste:r,onExplain:s,explainDisabled:t}){let{t:u}=(0,f.Bd)(),v=(0,e.useRef)(null),w=(0,e.useContext)(i),x=c.split("/").pop()||c,y=`${j}/${c}`,z=c.includes("/")?c.substring(0,c.lastIndexOf("/")):"",A=z?`${j}/${z}`:j,B=k?c:z,C=k?y:A,[D,E]=(0,e.useState)({x:0,y:0}),F=(0,e.useCallback)(async(a,b)=>{try{await navigator.clipboard.writeText(a),(0,h.oR)(u("toast.copiedName",{name:b}),"success")}catch{(0,h.oR)(u("toast.copyFailed"),"error")}m()},[m,u]),G=k?c:z,H=!!s&&!k,I=[{label:u("fileContextMenu.copyRelativePath"),value:c},{label:u("fileContextMenu.copyAbsolutePath"),value:y},{label:u("fileContextMenu.copyRelativeDirPath"),value:B||"."},{label:u("fileContextMenu.copyAbsoluteDirPath"),value:C},{label:k?u("fileContextMenu.copyFolderName"):u("fileContextMenu.copyFileName"),value:x}],J=(0,d.jsxs)("div",{ref:v,className:"absolute z-[200] bg-card border border-border rounded-lg shadow-lv2 py-1 w-fit whitespace-nowrap",style:{left:D.x,top:D.y},children:[H&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",disabled:t,title:t?u("comments.aiResponding"):void 0,onClick:()=>{m(),s(c)},children:u("explain.action")}),H&&(0,d.jsx)("div",{className:"my-1 border-t border-border"}),n&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors",onClick:()=>{m(),n(G)},children:u("fileContextMenu.createFile")}),q&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors",onClick:()=>{m(),q(c)},children:k?u("fileContextMenu.copyFolder"):u("fileContextMenu.copyFile")}),r&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors",onClick:()=>{m(),r(G)},children:u("fileContextMenu.pasteHere")}),o&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-destructive hover:bg-hover transition-colors",onClick:()=>{m(),o(c,k,x)},children:k?u("fileContextMenu.deleteFolder"):u("fileContextMenu.deleteFile")}),!!(n||q||r||o)&&(0,d.jsx)("div",{className:"my-1 border-t border-border"}),I.map((a,b)=>(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors",onClick:()=>F(a.value,a.label),children:a.label},b))]});return w?(0,g.createPortal)(J,w):J}function m(){let[a,b]=(0,e.useState)(null);return{contextMenu:a,showContextMenu:(0,e.useCallback)((a,c,d)=>{a.preventDefault(),a.stopPropagation(),b({x:a.clientX,y:a.clientY,path:c,isDirectory:d})},[]),hideContextMenu:(0,e.useCallback)(()=>{b(null)},[])}}},7833:(a,b,c)=>{"use strict";c.d(b,{dj:()=>h,lJ:()=>l,oR:()=>n,tE:()=>i});var d=c(48249),e=c(67484),f=c(208);let g=(0,e.createContext)(null);function h(){let a=(0,e.useContext)(g);if(!a)throw Error("useToast must be used within a ToastProvider");return a}function i({children:a}){let[b,c]=(0,e.useState)([]),f=(0,e.useCallback)((a,b="success")=>{let d=`toast-${Date.now()}`;c(c=>[...c,{id:d,message:a,type:b}])},[]),h=(0,e.useCallback)(a=>{c(b=>b.filter(b=>b.id!==a))},[]);return(0,d.jsxs)(g.Provider,{value:{showToast:f},children:[a,(0,d.jsx)(j,{toasts:b,onRemove:h})]})}function j({toasts:a,onRemove:b}){return(0,d.jsx)("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-[100] flex flex-col items-center gap-2 max-w-[26rem]",children:a.map(a=>(0,d.jsx)(k,{toast:a,onRemove:b},a.id))})}function k({toast:a,onRemove:b}){let c={success:"bg-green-9",error:"bg-red-9",info:"bg-brand"}[a.type],e={success:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),error:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),info:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}[a.type];return(0,d.jsxs)("div",{className:`${c} text-white px-4 py-3 rounded-lg shadow-lv2 flex items-center gap-3 min-w-[200px] animate-slide-in`,style:{animation:"slideIn 0.3s ease-out"},children:[e,(0,d.jsx)("span",{className:"text-sm",children:a.message}),(0,d.jsx)("button",{onClick:()=>b(a.id),className:"ml-auto p-1 hover:bg-white/20 rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}function l(a,b){let{title:c=f.A.t("confirm.title",{defaultValue:"Confirm"}),confirmText:d=f.A.t("confirm.ok",{defaultValue:"OK"}),cancelText:e=f.A.t("confirm.cancel",{defaultValue:"Cancel"}),danger:g=!1}=b||{};return new Promise(b=>{let f=document.createElement("div");f.className="fixed inset-0 z-[200] flex items-center justify-center",f.style.animation="confirmFadeIn 0.15s ease-out";let h=a=>{f.style.animation="confirmFadeOut 0.12s ease-in",f.addEventListener("animationend",()=>{document.body.removeChild(f),b(a)},{once:!0})};f.addEventListener("mousedown",a=>{a.target===f&&h(!1)});let i=a=>{"Escape"===a.key?(a.stopPropagation(),document.removeEventListener("keydown",i,!0),h(!1)):"Enter"===a.key&&(a.stopPropagation(),document.removeEventListener("keydown",i,!0),h(!0))};document.addEventListener("keydown",i,!0),f.innerHTML=`
1
+ exports.id=7438,exports.ids=[7438],exports.modules={208:(a,b,c)=>{"use strict";c.d(b,{A:()=>g});var d=c(529);let e=JSON.parse('{"common":{"save":"Save","cancel":"Cancel","delete":"Delete","close":"Close","minimize":"Minimize","copy":"Copy","edit":"Edit","file":"File","codeMap":"Code Map","diff":"Diff","confirm":"Confirm","loading":"Loading...","search":"Search","refresh":"Refresh","retry":"Retry","submit":"Submit","copied":"Copied","saved":"Saved","failed":"Failed","noMatch":"No matches","noData":"No data","done":"Done","justNow":"just now","minutesAgo":"{{count}}m ago","hoursAgo":"{{count}}h ago","daysAgo":"{{count}}d ago","monthsAgo":"{{count}}mo ago","yearsAgo":"{{count}}y ago","saveFailed":"Save failed","copyFailed":"Copy failed","deleteFailed":"Delete failed","operationFailed":"Operation failed","copiedPath":"Path copied","copyPath":"Copy path","openInConsole":"Open in Console bubble","copyAbsPath":"Copy absolute path","loadMore":"Load more","noResult":"No results","selected":"Selected","selectAll":"Select all","hint":"Notice","confirmBtn":"OK","cancelBtn":"Cancel","preview":"Preview","readable":"Readable","previous":"Previous","next":"Next","all":"All","input":"Input","result":"Result","line":"Line","lines":"lines","running":"Running","connecting":"Connecting","connected":"Connected","connectionFailed":"Connection failed","builtin":"Built-in","global":"Global","project":"Project","current":"Current","code":"Code"},"htmlApps":{"title":"HTML Apps","addTooltip":"Add to HTML panel","added":"Added to HTML panel","alreadyAdded":"Already added","addFailed":"Failed to add","add":"Add","adding":"Adding...","addHtmlApp":"Add HTML app","searchPlaceholder":"Search HTML apps...","pathLabel":"Absolute path to the .html file","invalid":"Invalid","builtin":"Built-in","noDescription":"No description","emptyNoApps":"No custom HTML apps yet.","emptyCreatePrefix":"Use","emptyCreateSuffix":"in chat to create a new app.","addExisting":"add an existing HTML file","viewDocs":"view docs","emptyNoMatch":"No HTML apps match your search."},"skills":{"addTooltip":"Add to Skills panel","added":"Added to Skills panel","alreadyAdded":"Already added","addFailed":"Failed to add","title":"Skills","searchPlaceholder":"Search skills...","clearSearch":"Clear","addSkill":"Add Skill","emptyNoSkills":"No skills yet.","emptyIntroPrefix":"Use","emptyIntroSuffix":"in chat to distil a reusable workflow into a SKILL.md file.","emptyNoMatch":"No skills match your search.","viewDocs":"view docs","pathLabel":"Absolute path to SKILL.md","pathPlaceholder":"/Users/you/.../skills/foo/SKILL.md","add":"Add","adding":"Adding...","invalid":"Invalid","copyPath":"Copy path","noDescription":"No description","previewTitle":"Skill Preview","source":"Source","cannotRead":"File cannot be read."},"toast":{"savedSuccess":"Saved","saveFailed":"Save failed","copiedName":"Copied: {{name}}","copyFailed":"Copy failed","deleteFailed":"Delete failed","operationFailed":"Operation failed","staged":"Staged","stageFailed":"Stage failed","unstaged":"Unstaged","unstageFailed":"Unstage failed","stagedNFiles":"Staged {{count}} files","unstagedNFiles":"Unstaged {{count}} files","discardFailed":"Discard failed","discardedNFiles":"Discarded changes in {{count}} files","deletedFile":"File deleted","discardedChanges":"Changes discarded","pastedFile":"Pasted: {{name}}","pasteFailed":"Paste failed","noFileToPaste":"No file to paste","createdFile":"Created: {{name}}","createFailed":"Create failed","movedToTrash":"Moved to trash: {{name}}","copiedPageUrl":"Page URL copied","copiedDirPath":"Directory path copied","switchedToBranch":"Switched to {{branch}}","switchBranchFailed":"Branch switch failed","loadBranchFailed":"Failed to load branches","copiedCommand":"Copied: {{command}}","copiedMessage":"Message copied","sentToPeer":"Sent to the other pane","sendToPeerFailed":"Failed to send to the other pane","forkFailed":"Failed to fork session","excerptFailed":"Failed to excerpt this turn","turnDeleted":"Turn deleted","deleteTurnFailed":"Failed to delete this turn","copiedUrl":"URL copied","copiedOutput":"Output copied","copiedCmd":"Command copied","copiedComment":"Comment copied","copiedAllComments":"All comments copied","copiedFileContent":"File content copied","copiedQA":"Copied {{count}} Q&A","copiedAllQA":"All Q&A copied","sentQA":"Sent to AI","readFileFailed":"Failed to read file","fileOutsideProject":"File is outside this project — only Markdown, CSV and images can be previewed","reviewCreated":"Review created, link copied","reviewUpdated":"Review updated, link copied","reviewCreateFailed":"Failed to create review","sharingClosed":"Sharing disabled","sharingCloseFailed":"Failed to disable sharing","linkCopied":"Link copied","addCommentFailed":"Failed to add comment","deleteCommentFailed":"Failed to delete comment","editCommentFailed":"Failed to edit comment","addReplyFailed":"Failed to add reply","deleteReplyFailed":"Failed to delete reply","editReplyFailed":"Failed to edit reply","disconnected":"Disconnected: {{id}}","pluginReloading":"Reloading extension...","worktreeCreateSuccess":"Worktree created: {{name}}","worktreeCreateFailed":"Failed to create worktree","worktreeLoadFailed":"Failed to load worktree list","worktreeDeleted":"Worktree deleted","worktreeDeleteFailed":"Failed to delete worktree","worktreeLocked":"Locked","worktreeUnlocked":"Unlocked"},"workspace":{"selectProject":"Select a project to start","searchProjectPath":"Search project path...","loadingProjects":"Loading projects...","projectNotFound":"No projects found","sessions":"{{count}} sessions","loadingSessions":"Loading sessions...","noSessions":"No sessions","loadingText":"Loading...","openProject":"Open Project","expandSidebar":"Expand sidebar","collapseSidebar":"Collapse sidebar","notes":"Notes","skills":"Skills","apps":"Apps","settings":"Settings","help":"Help","updateAvailable":"v{{version}} available","copyUpgradeCommand":"Copy cockpit update","updateNow":"Update now","updating":"Updating…","updateComplete":"Update complete","updateFailed":"Update failed","updateCardPreparing":"Preparing update…","updateCardInstalling":"Downloading and installing","updateCardRepairing":"Repairing native dependency","updateCardUpToDate":"Already on the latest version, v{{version}}","updateCardCopyFix":"Copy fix command","updateCardFixCopied":"Fix command copied","updateCardRollingBack":"Install failed, rolling back","updateCardRestarting":"Restarting Cockpit…","updateCardDone":"Updated to v{{version}}","updateCardElapsed":"{{seconds}}s elapsed","updateCardBaseline":"last time ~{{seconds}}s","updateCardNoLiveStatus":"Live status unavailable; the update is still running","updateCardRolledBack":"Rolled back to the previous version; Cockpit is usable.","updateCardManualHint":"You can retry from a terminal:","updateCardLogHint":"Log: {{path}}","updateRestartNote":"Cockpit will restart in the background.","viewChangelog":"View changelog","serverRestarted":"Cockpit was updated in the background.","reloadNow":"Reload","upgradeCommandCopied":"Copied `cockpit update`","projectNotes":"Project Notes","closeProject":"Close project","bots":"Bots"},"mobile":{"useDesktop":"Desktop","messagePlaceholder":"Message…","send":"Send","stop":"Stop","enableNotifications":"Enable notifications","disableNotifications":"Disable notifications","notifyError":"Could not enable notifications"},"sessions":{"recentSessions":"Recent Sessions","favorites":"Favorite Sessions","noFavorites":"No favorite sessions yet. Click the star in the tab bar to add.","addFavorite":"Add to favorites","removeFavorite":"Remove from favorites","runningCount":"{{count}} running","unreadCount":"{{count}} unread","noSessions":"No sessions yet","running":"Running","done":"Done","editTitle":"Edit title","projectSessions":"Project Sessions","browseAllSessions":"Browse all sessions","sessionList":"Session List","search":"Search","searchSessions":"Search sessions...","searchRecentSessions":"Search recent sessions","loadSessionsFailed":"Failed to load sessions","loadingSessions":"Loading sessions...","noMatchingSessions":"No matching sessions","noSessionsYet":"No sessions yet","projectList":"Project List","openFolder":"Open Folder","loadingHistory":"Loading history..."},"scheduledTasks":{"title":"Scheduled Tasks","aboutToTrigger":"About to trigger","secondsLater":"in {{count}}s","minutesLater":"in {{count}}m","hoursMinutesLater":"in {{h}}h {{m}}m","hoursLater":"in {{h}}h","onceType":"Once ({{minutes}}min)","everyNMinutes":"Every {{minutes}}min","completed":"Completed","paused":"Paused","activeCount":"{{running}} active","pausedCount":"{{paused}} paused","noScheduledTasks":"No scheduled tasks. Click the clock button in the chat input to create one.","lastResult":"Last","runNow":"Run now","deleteFailed":"Failed to delete the task","resume":"Resume","pause":"Pause","completedCount":"Completed ({{count}})","groupPendingReview":"Finished \xb7 to review","groupUpcoming":"Running \xb7 upcoming","openSession":"Open session","selectTaskHint":"Select a task on the left to preview its session messages","noTaskMessages":"No messages in this task\'s session yet","success":"Success","failure":"Failed","createTask":"Create Scheduled Task","editTask":"Edit Scheduled Task","sendMessage":"Message","messagePlaceholder":"Enter message to send...","taskFile":"Task File","taskFilePlaceholder":"/Users/you/project/tasks/daily-report.md","taskFileHint":"Absolute path. On each fire the agent reads this file first and acts on what it describes — edits take effect on the next run.","taskFilePromptHeader":"Read this task file first, then act accordingly:","type":"Type","once":"Once","interval":"Interval","quickSelect":"Quick Select","customCron":"Custom Cron Expression","customMinutes":"Custom minutes","cronPlaceholder":"e.g. 0 9 * * 1-5 (weekdays at 9am)","cronFormat":"Format: min hour day month weekday (e.g. 0 9 * * 1-5)","minutesPlaceholder":"Minutes","limitTimeRange":"Limit execution time range","to":"to","saveBtn":"Save ({{modKey}}↩)","createBtn":"Create ({{modKey}}↩)","5minLater":"In 5 minutes","15minLater":"In 15 minutes","30minLater":"In 30 minutes","1hourLater":"In 1 hour","every15min":"Every 15 min","every30min":"Every 30 min","every1hour":"Every 1 hour","every2hours":"Every 2 hours","daily9am":"Daily 09:00","daily6pm":"Daily 18:00","weeklyMon9am":"Mon 09:00","monthly1st9am":"1st of month 09:00"},"runningTerminals":{"title":"Terminals","status":"{{count}} terminal(s) \xb7 {{projects}} project(s)","keys":"↑↓ select \xb7 Enter open \xb7 Del stop \xb7 Esc close","empty":"No terminals running","currentProject":"current project","stop":"Stop","confirmStop":"Stop this process?","stopping":"Stopping…","stopFailed":"Failed to stop the terminal","notFound":"Couldn\'t find this terminal\'s bubble"},"cron":{"everyNMinutes":"Every {{n}} minutes","everyNHours":"Every {{n}} hours","everyMinute":"Every minute","everyHourAtMin":"Every hour at minute {{m}}","hourlyEveryMin":"{{h}}:xx every minute","daily":"Daily at {{time}}","weekdays":"Weekdays","weekends":"Weekends","dowSun":"Sun","dowMon":"Mon","dowTue":"Tue","dowWed":"Wed","dowThu":"Thu","dowFri":"Fri","dowSat":"Sat","monthPrefix":"","dayOfMonth":"","dayRange":"{{a}}th to {{b}}th","weekdayPrefix":"","weekdayRange":"{{a}} to {{b}}"},"blockViewer":{"empty":{"body":"Select a file in the left tree to see its code map.","hint":"or press ⌘K to search."},"fileMode":{"loading":"Loading…","notFound":"This file is not indexed (unsupported language or beyond the file cap)."},"buildProgress":{"listing":"Listing files…","contexts":"Reading project config…","parsing":"Parsing files","resolving":"Resolving imports…","edges":"Building call graph…","done":"Finishing up…"},"search":{"tooltip":"Search (⌘K)","hint":"Start typing to search","noResults":"No matches","files":"Files","symbols":"Symbols"},"viewerToggle":{"toBlock":"Show code map","toCode":"Back to code view"},"tabs":{"toc":"Functions","history":"Trail"},"toc":{"title":"this file","empty":"No functions detected.","notIndexed":"File not in project graph (unsupported language / not in git tracked set / file cap reached)."},"history":{"title":"recent","empty":"Click an input or output pin to begin tracing.","clear":"Clear history"},"refresh":"Rebuild project graph","retry":"Retry"},"blockDiffViewer":{"loading":"Building code map…","unsupported":"Code map diff is not available for this file type.","unsupportedHint":"Switch back to the regular diff view to read it.","error":"Code map diff failed: {{message}}","noBlockChanges":"No code-map changes (formatting / whitespace only).","noBefore":"(new)","noAfter":"(removed)","kind":{"added":"added","deleted":"deleted","modified":"modified"}},"fileBrowser":{"directoryTree":"Tree","searchTab":"Search","recentTab":"Recent","changesTab":"Status","historyTab":"History","searchFiles":"Search files...","clear":"Clear","exactMatchOn":"Exact match (on)","exactMatchOff":"Exact match (off)","refreshTree":"Refresh directory tree","collapseAll":"Collapse all directories","searchFileContent":"Search file contents...","caseSensitive":"Case sensitive","wholeWord":"Whole word","regex":"Regex","fileTypes":"File types (ts,tsx)","compareMode":"Compare","compareModeOff":"Close branch comparison","compareModeOn":"Compare with selected branch","compareScopeHead":"HEAD","compareScopeWorktree":"Worktree","compareScopeHeadHint":"Compare committed work only","compareScopeWorktreeHint":"Include uncommitted changes (staged / unstaged / untracked)","createFile":"New File","createFileIn":"New File (in {{path}}/)","fileName":"File name...","noRecentFiles":"No recent files","stagingArea":"Staged ({{count}})","changesSummary_one":"{{count}} change","changesSummary_other":"{{count}} changes","noChanges":"No changes in working tree","refreshChanges":"Refresh changes","unstageAll":"Unstage all","noStagedFiles":"No staged files","unstageNFiles":"Unstage {{count}} files","unstageFile":"Unstage","workspace":"Workspace ({{count}})","discardAll":"Discard all","stageAll":"Stage all","noUnstagedChanges":"No unstaged changes","discardNFiles":"Discard changes in {{count}} files","stageNFiles":"Stage {{count}} files","discardChanges":"Discard changes","stageFile":"Stage file","loadingDiff":"Loading diff...","noDiffFiles":"No diff files","nFilesChanged":"{{count}} files changed (vs {{branch}})","nFilesChangedWorktree":"{{count}} files changed (vs {{branch}}, incl. uncommitted)","noDiffFilesHeadHint":"Nothing committed on this branch yet — switch to Worktree to see uncommitted changes","loadingCommits":"Loading commits...","noCommits":"No commits","allLoaded":"All {{count}} records loaded","locateInTree":"Locate in directory tree","unsaved":"Unsaved","saveBeforeSwitch":"Current file has unsaved changes. Save before switching?","saveAndSwitch":"Save and switch","closeEdit":"Close edit (ESC)","closeBtn":"Close","copyFileContent":"Copy file content","toggleJsonReadable":"Toggle JSON readable mode","previewMarkdown":"Preview Markdown","exitPreview":"Exit Preview","collapseAllJson":"Fold","expandAllJson":"Full","viewBlame":"View line-by-line change history","viewDiff":"View changes against HEAD","exitDiff":"Exit Diff","diffLoadFailed":"Failed to load diff","editFile":"Edit file","backToPreview":"Back to preview","cannotPreview":"Cannot preview this file","selectFileToPreview":"Select a file to preview","staged":"Staged","unstaged":"Unstaged","selectFileToViewDiff":"Select a file to view diff","loadingDiffContent":"Loading diff...","clickCompareToLoad":"Click \\"Compare\\" to load branch diff","selectCommitToView":"Select a commit to view details","confirmDelete":"Confirm Delete","confirmDeleteMessage":"Move <file>{{name}}</file> to trash?","nFilesNMatches":"{{files}} files, {{matches}} matches","resultsTruncated":"Results truncated","noContentSearchResults":"No results","enterKeywordToSearch":"Enter keyword to search file contents","searchMinChars":"Search requires at least 2 characters"},"csv":{"table":"Table","raw":"Raw","empty":"Empty table","summary":"{{rows}} rows \xb7 {{cols}} columns","summaryFiltered":"{{rows}} / {{total}} rows matched \xb7 {{cols}} columns","loadMore":"Load more ({{shown}} / {{total}} shown)","filterPlaceholder":"Filter rows…","filterColumn":"Filter column","clearFilter":"Clear filter","allColumns":"All columns","noMatch":"No matching rows","sortHint":"Click to sort (asc / desc / off)"},"codeViewer":{"fileModifiedExternally":"File was modified externally. Saving will overwrite external changes.","useDiskVersion":"Use disk version","forceOverwrite":"Force overwrite","searchPlaceholder":"Search...","caseSensitive":"Case sensitive","wholeWordMatch":"Whole word match","unsavedConfirm":"You have unsaved changes. Close anyway?","discardChanges":"Discard changes","continueEditing":"Continue editing","unsavedExitConfirm":"You have unsaved changes. Exit edit mode?","clickToViewDetails":"Click to view details","clickToViewCommit":"Click to view commit details","nComments":"{{count}} comments","searchChat":"Search chat...","prevShiftEnter":"Previous (Shift+Enter)","nextEnter":"Next (Enter)","closeEsc":"Close (Esc)"},"chat":{"startConversation":"Start a conversation","loadMoreHistory":"Load more...","scrollUpForMore":"↑ Scroll up to load more history","jumpToStart":"Jump to start","jumpToLatest":"Jump to latest","jumpToPrevUserMessage":"Previous user message","jumpToNextUserMessage":"Next user message","recentUserMessages":"Recent user messages","moreUserMessages":"More","userMessage":"User message","recentUserMessageNumber":"Recent user message {{index}} of {{total}}","imageMessage":"Image message","copyMessage":"Copy message","copyImage":"Copy image","copiedImage":"Image copied","forkSession":"Fork session from here","excerptTurn":"Excerpt this turn to a new session","newSession":"New session","continueFromHere":"Continue from here","continueFromHereDesc":"Keep all context through this turn","onlyThisTurn":"Only this turn","onlyThisTurnDesc":"Keep only this question and answer","deleteTurn":"Delete turn","deletingTurn":"Deleting…","deleteTurnConfirm":"Delete this question, answer, and its tool records? This cannot be undone.","deleteTurnConfirmAction":"Delete turn","deleteTurnWhileRunning":"A turn cannot be deleted while the session is running","sendToPeerPane":"Send this message to the other pane","imageN":"Image {{index}}","imagePreview":"Image preview","toolCalls":"{{count}} tool calls","collapse":"▲ Collapse","expand":"▼ Expand","showMore":"Show more","showLess":"Show less","subagent":"Subagent","subagentEmpty":"No subagent transcript found","subagentViewTitle":"View subagent transcript","workflowRun":"Run details","workflowViewTitle":"View workflow run details","workflowEmpty":"No workflow run journal found","workflowAgents":"agents","workflowViewAgent":"View","workflowUngrouped":"Ungrouped","viewQuestions":"View questions","viewAllFileChanges":"View all file changes","requestFailed":"Request failed","cannotReadStream":"Cannot read response stream","errorRetry":"An error occurred, please retry","codexResumeFailed":"Previous session is in use by another Codex client — started a new session; history was not carried over","codexResumeFailedPrevious":"Previous session","codexResumeFailedNew":"New session","placeholder":"Type a message, Enter to send (Shift+Enter for new line, paste images; start a line with / (skill), /@ (skill in a subagent) or @ (bot in a subagent), multiple allowed)","placeholderDisabled":"Generating... you can keep typing (ESC to cancel; if stuck, cancel and resend \'continue\')","imageSizeLimit":"Image size exceeds limit (max 5MB), current: {{size}}MB","viewGitChanges":"View Git changes","viewAllComments":"View all comments","userMessages":"User messages","projectNotes":"Project Notes","scheduledTasks":"Scheduled Tasks","quickInstructions":"Quick Instructions","globalInstructions":"Global Instructions","projectInstructions":"Project Instructions","noQuickInstructions":"No quick instructions yet","addQuickInstruction":"Add quick instruction","quickInstructionPlaceholder":"One-line instruction — Enter to save, Esc to cancel","insertQuickInstruction":"Insert into input (without sending)","addInstructionGroup":"New group","instructionGroupNamePlaceholder":"Group name — Enter to save, Esc to cancel","instructionGroupLabel":"Group","instructionGroupNone":"No group","deleteInstructionGroupConfirm":"Deleting \\"{{name}}\\" also deletes the {{count}} instruction(s) inside it. Continue?","editGlobalInstructions":"Edit global instructions","editProjectInstructions":"Edit project instructions","quickInstructionsMarkdownHint":"One top-level entry per line. Add lines beginning with “- ” after a group name for its instructions. Write \\\\n for a line break inside one instruction.","quickInstructionsMarkdownPlaceholder":"Continue\\nDraw with text\\n- Draw a login flow\\n- Draw a system architecture","quickInstructionsMarkdownError":"Invalid format on line {{line}}.","savingQuickInstructions":"Saving...","saveQuickInstructionsFailed":"Could not save. Your edits are still here; please try again.","context":"Context","output":"Output","copiedCommandTooltip":"Copied!","copyCommandTooltip":"Copy command: {{command}}","executedCommand":"Executed `{{command}}`{{exitInfo}}, output:\\n```\\n{{output}}\\n```","executedCommandFailed":"Failed to execute `{{command}}`: {{error}}","executionMode":"Execution Mode","checkBalance":"Check balance","balanceFailed":"Query failed — check the API key","balanceNeedsKey":"Set a DeepSeek API key first","balanceUnavailable":"Account is not available for requests","balanceEmpty":"No balance returned","openUsagePage":"Open DeepSeek usage console","checkQuota":"Check quota","quotaFailed":"Quota unavailable — check the API key","quotaNeedsKey":"Set an API key first","quotaEmpty":"No quota returned","quotaResetAt":"Resets {{time}}","openProviderConsole":"Open the provider console","planMode":"Plan mode","planModeDesc":"read-only, plans first without edits","planModeOn":"Plan mode on — read-only; send a task to get a plan","planModeOff":"Plan mode off","planModeHint":"Plan mode: read-only exploration that produces a plan without editing. Uncheck and resend to implement.","noHistory":"No history context","noHistoryDesc":"each prompt is independent","noHistoryHint":"No history context: each message is sent to the model on its own, with no prior conversation. The transcript above still records everything.","outputStyle":"Output style","outputStyleNone":"None","noOutputStyles":"No output styles yet — add one with the pencil","editOutputStyles":"Edit output styles","outputStylesMarkdownHint":"Start each style with \\"# Name\\". Everything up to the next \\"# \\" is appended verbatim to the end of the system prompt (multi-line; deeper headings like ## are content).","outputStylesMarkdownPlaceholder":"# Concise\\nAnswer in at most three sentences, no preamble.\\n\\n# Teacher\\nExplain why before how.","outputStylesError":{"content-before-heading":"Line {{line}}: content must come after a \\"# Name\\" heading.","empty-style":"Line {{line}}: a style needs both a name and content.","duplicate-name":"Line {{line}}: duplicate style name."},"planTitle":"Plan (awaiting your review)","approvePlan":"Approve & run","planApproveHint":"No approval dialog here — click to exit plan mode and execute","approvePlanPrompt":"Approved — proceed with the plan above.","maximizePane":"Maximize this pane","restorePane":"Restore both panes","closePane":"Close this pane","singlePane":"Single pane","splitPane":"Split into two panes"},"console":{"enterCommandOrUrl":"Enter a command or URL to start","emptyIntro":"Type any of the following in the input bar to create a bubble:","bubbleCommand":"Command","bubbleInteractive":"Interactive","bubbleBrowser":"Browser","bubbleBrowserNoteIframe":"Some sites block iframe embedding — install Cockpit Bridge under Settings → Browser Extension before opening.","bubbleBrowserNoteCookie":"If a logged-in site first shows as signed out, refresh a few times to restore it.","bubbleDatabase":"Database","bubbleFilePreview":"File preview","loadingMore":"Loading...","loadMoreHistory":"Load more history","quickCommands":"Quick Commands","singleColumn":"Single column","dualColumn":"Dual column","envVars":"Environment Variables","launchShell":"Launch interactive shell","htmlApps":"HTML apps","inputPlaceholder":"Enter command or URL and press Enter... (↑↓ history, Tab complete)","scopeProject":"Project","scopeGlobal":"Global","tabSwitchEscClose":"Tab to switch \xb7 Esc to close","copyOutput":"Copy output","copyCommand":"Copy command","rerun":"Re-run","deleteRecord":"Delete record","searchPlaceholder":"Search...","searchMode":"Search","filterMode":"Filter","prevShiftEnter":"Previous (Shift+Enter)","nextEnter":"Next (Enter)","loadingTerminal":"Loading terminal...","clickToInput":"Click terminal area to type","stdinPlaceholder":"stdin input...","runningText":"Running...","exitCode":"Exit code: {{code}}","totalLines":"{{count}} lines total","globalCommands":"Global Commands","projectCommands":"Project Commands","noCustomCommands":"No custom commands yet","namePlaceholder":"Name","commandPlaceholder":"Command","restoreTooltip":"Restore ({{modKey}}M / ESC)","screenshotting":"Screenshotting...","outputFileDeleted":"[Output file deleted]"},"browser":{"blankPage":"Blank page","copyUrl":"Copy URL","openInNewWindow":"Open in new window","exitMaximize":"Exit maximize ({{modKey}}M)","maximize":"Maximize ({{modKey}}M)","pageLoadFailed":"Page load failed","clickToWake":"Click to wake","sleeping":"Sleeping","loadingPage":"Loading...","loadFailed":"Load failed"},"database":{"connectionFailed":"Connection failed","connected":"Connected","connecting":"Connecting...","refreshTableList":"Refresh table list","filterTable":"T Tables","filterView":"V Views","noTables":"No tables","tabStructure":"Structure","tabData":"Data","tabSql":"SQL","filterActive":"Filter: {{count}} cols","clearAllFilters":"Clear all filters","deleteNRows":"Delete {{count}} rows","confirmDeleteRows":"Confirm delete?","copyCsvSelected":"Copy selected rows as CSV","copyCsvAll":"Export all as CSV","copyJsonSelected":"Copy selected rows as JSON","copyJsonAll":"Export all as JSON","copyCSV":"Copy CSV","CSV":"CSV","copyJSON":"Copy JSON","JSON":"JSON","selectTable":"Select a table","selectTableToView":"Select a table to view structure","selectTableForData":"Select a table to view data","columns":"Columns","colName":"Name","colType":"Type","colNullable":"Nullable","colDefault":"Default","primaryKey":"Primary Key","foreignKeys":"Foreign Keys","indexes":"Indexes","enable":"Enable","commaValues":"Comma-separated values","likePattern":"%pattern%","valuePlaceholder":"Value","apply":"Apply","clearFilter":"Clear","addRow":"+ Add Row","totalRows":"{{count}} rows","rowsAffected":"{{command}} — {{count}} rows affected ({{duration}}ms)","queryRows":"{{count}} rows ({{duration}}ms)","resultTruncated":"[Results truncated to 1000 rows]","sqlPlaceholder":"Enter SQL... ({{modKey}}Enter to execute)","executing":"Executing...","execute":"▶ Execute","deleteRowsFailed":"{{count}} rows failed to delete","inputParams":"Input Parameters","resultLabel":"Result"},"mysql":{"connectionFailed":"Connection failed","connected":"Connected","connecting":"Connecting...","refreshTableList":"Refresh table list","filterTable":"T Tables","filterView":"V Views","noTables":"No tables","tabStructure":"Structure","tabData":"Data","tabSql":"SQL","filterActive":"Filter: {{count}} cols","clearAllFilters":"Clear all filters","deleteNRows":"Delete {{count}} rows","confirmDeleteRows":"Confirm delete?","copyCsvSelected":"Copy selected rows as CSV","copyCsvAll":"Export all as CSV","copyJsonSelected":"Copy selected rows as JSON","copyJsonAll":"Export all as JSON","copyCSV":"Copy CSV","CSV":"CSV","copyJSON":"Copy JSON","JSON":"JSON","selectTable":"Select a table","selectTableToView":"Select a table to view structure","selectTableForData":"Select a table to view data","columns":"Columns","colName":"Name","colType":"Type","colNullable":"Nullable","colDefault":"Default","primaryKey":"Primary Key","foreignKeys":"Foreign Keys","indexes":"Indexes","enable":"Enable","commaValues":"Comma-separated values","likePattern":"%pattern%","valuePlaceholder":"Value","apply":"Apply","clearFilter":"Clear","addRow":"+ Add Row","totalRows":"{{count}} rows","rowsAffected":"{{command}} — {{count}} rows affected ({{duration}}ms)","queryRows":"{{count}} rows ({{duration}}ms)","resultTruncated":"[Results truncated to 1000 rows]","sqlPlaceholder":"Enter SQL... ({{modKey}}Enter to execute)","executing":"Executing...","execute":"▶ Execute","deleteRowsFailed":"{{count}} rows failed to delete"},"redis":{"neverExpires":"Never expires","expired":"Expired","loadFailed":"Load failed","deleteFailed":"Delete failed","saveFailed":"Save failed","scanPlaceholder":"SCAN pattern...","scanSearch":"Search (SCAN)","noKeys":"No keys","loadMore":"Load more...","tabData":"Data","tabInfo":"Info","tabCli":"CLI","selectKey":"Select a key","keyNotExist":"Key does not exist","unsupportedType":"Unsupported type: {{type}}","nItems":"{{total}} items","showingN":"showing {{count}}","nMembers":"{{total}} members","nEntries":"{{total}} entries","cliHint":"Enter Redis commands, e.g. PING, GET key, KEYS *","cliPlaceholder":"Enter command..."},"git":{"switchBranch":"Switch branch","searchBranch":"Search branches...","noBranches":"No branches available","noMatchingBranches":"No matching branches","localBranches":"Local Branches","remoteBranches":"Remote Branches","branchNotFound":"Branch not found","selectBranch":"Select branch...","currentBranch":"Current","notGitRepo":"Current directory is not a Git repository","cannotGetBranches":"Cannot get branch info","getBranchesFailed":"Failed to get branch info","discardAllConfirm":"Discard changes in {{count}} workspace files? This cannot be undone.","worktree":{"title":"Git Worktree","count":"{{count}} worktrees","selectBranch":"Select branch","addWorktree":"+ Add Worktree","confirmDelete":"Confirm Delete","confirmDeleteMsg":"Delete this worktree?","path":"Path:","branch":"Branch:","locked":"Locked","unlock":"Unlock","lock":"Lock","searchBranch":"Search branches...","noBranches":"No available branches"}},"comments":{"addComment":"Add Comment","lineRange":"Line {{start}}-{{end}}","inputPlaceholder":"Enter comment...","newComment":"New comment {{range}}","commentPlaceholder":"Enter comment... ({{modKey}}Enter to submit, Esc to cancel)","nComments":"{{count}} comments","allComments":"All Comments","copyAllComments":"Copy all comments","noComments":"No comments yet","clearAll":"Clear all","totalComments":"{{count}} comments total","aiReply":"AI Reply","noContent":"(no content)","linesCount":"({{count}} lines)","codeRef":"Here are my annotated comments and references:","note":"Note: {{content}}","submitting":"Submitting...","enterSubmit":"Enter to submit \xb7 Shift+Enter for new line","submitComment":"Submit Comment","askAI":"Ask AI","inputQuestion":"Enter your question...","aiGenerating":"Generating, please wait...","enterSend":"Enter to send \xb7 Shift+Enter for new line","sendToAI":"Send to AI","aiResponding":"AI is responding..."},"fileContextMenu":{"createFile":"New File","copyFile":"Copy File","copyFolder":"Copy Folder","pasteHere":"Paste Here","deleteFile":"Delete File","deleteFolder":"Delete Folder","copyRelativePath":"Copy Relative Path","copyAbsolutePath":"Copy Absolute Path","copyRelativeDirPath":"Copy Relative Dir Path","copyAbsoluteDirPath":"Copy Absolute Dir Path","copyFileName":"Copy File Name","copyFolderName":"Copy Folder Name"},"settings":{"title":"Settings","theme":"Theme","themeLight":"Light","themeDark":"Dark","themeSystem":"System","browserExtension":"Browser Extension","extensionInstalled":"Cockpit Bridge installed","extensionNotInstalled":"Cockpit Bridge not installed","extensionDescription":"After installing the Chrome extension, link navigation in iframes will be intercepted: new tab links create new bubbles, page navigation updates the current bubble.","installSteps":"Installation steps:","step1":"1. Open Chrome and navigate to","step2":"2. Enable \\"Developer mode\\" in the top-right corner","step3":"3. Click \\"Load unpacked\\"","step4mac":"4. Press <kbd>Cmd+Shift+G</kbd> → paste the path below → Enter","copyExtensionPath":"Copy extension directory path","reloadExtension":"Reload extension","about":"About","language":"Language","languageAuto":"System","switchDark":"Switch to dark","switchLight":"Switch to light","agentsBundled":"bundled"},"editor":{"placeholder":"Write something... Type / for commands","noteTitle":"{{name}} - Notes","noteUntitled":"Notes","saving":"Saving...","conflictReloaded":"This note was changed elsewhere. Loaded the latest version; your recent unsaved edits were discarded.","linkPlaceholder":"Enter URL...","confirmLink":"Confirm","removeLink":"Remove link","heading1":"Heading 1","heading2":"Heading 2","heading3":"Heading 3","bold":"Bold","italic":"Italic","strikethrough":"Strikethrough","inlineCode":"Inline code","link":"Link","bulletList":"Bullet list","orderedList":"Ordered list","taskList":"Task list","blockquote":"Blockquote","codeBlock":"Code block","table":"Table","horizontalRule":"Horizontal rule","insertRowAbove":"Insert row above","insertRowBelow":"Insert row below","insertColumnLeft":"Insert column left","insertColumnRight":"Insert column right","deleteRow":"Delete row","deleteColumn":"Delete column","deleteTable":"Delete table","deleteCodeBlock":"Delete code block","toc":"TOC","expandToc":"Expand TOC","collapseToc":"Collapse TOC"},"slashCommands":{"heading1":"Heading 1","heading1Desc":"Large heading","heading2":"Heading 2","heading2Desc":"Medium heading","heading3":"Heading 3","heading3Desc":"Small heading","bulletList":"Bullet List","bulletListDesc":"Bulleted list","orderedList":"Ordered List","orderedListDesc":"Numbered list","taskList":"Task List","taskListDesc":"Checkable task list","blockquote":"Blockquote","blockquoteDesc":"Quote block","codeBlock":"Code Block","codeBlockDesc":"Code snippet","table":"Table","tableDesc":"Insert 3\xd73 table","horizontalRule":"Divider","horizontalRuleDesc":"Horizontal divider","link":"Link","linkDesc":"Insert hyperlink"},"commands":{"plan":"Enable plan mode \xb7 /plan <task> to plan it \xb7 /plan off to disable"},"review":{"reviewManagement":"Review Management","allReviews":"All Reviews","noOpenReviews":"No open reviews","viewComments":"View comments","nComments":"{{count}} comments","nDocs":"{{count}} docs","nReviews":"{{count}} reviews","docList":"Document List","allReviewsList":"All Reviews","expandList":"Expand list","collapseList":"Collapse list","closeReview":"Close review","reopenReview":"Reopen","deleteReview":"Delete review","noOpenDocs":"No open documents","noReviews":"No reviews","sharing":"Sharing","notShared":"Not shared","closeSharing":"Disable sharing","enableSharing":"Enable sharing","view":"View","setNickname":"Set your nickname","nicknameHint":"Other reviewers will see this name","nicknamePlaceholder":"Enter nickname","skipForNow":"Skip for now","identitySettings":"Identity Settings","reviewNickname":"Review Nickname","random":"Random","selectTextToComment":"Select text to add comment","selectTextHint":"Select text on the left to add a comment","prevComment":"Previous","nextComment":"Next","commentsCount":"{{count}} comments","commentsNavCount":"{{current}}/{{total}} comments","allCommentsTitle":"All Comments","commentsCountBrief":"{{count}}","closedCount":"{{count}} closed","copyAllComments":"Copy all comments","noComments":"No comments yet","closedComments":"Closed ({{count}})","closedLabel":"Closed","moreReplies":"+{{count}} replies","copyComment":"Copy comment","reopen":"Reopen","closeComment":"Close comment","editComment":"Edit comment","deleteComment":"Delete comment","edited":"(edited)","editReply":"Edit reply","deleteReply":"Delete reply","reply":"Reply","replyPlaceholder":"Add a reply...","selectedText":"Selected text","addCommentPlaceholder":"Add a comment...","enterSubmitHint":"Enter to submit, Shift+Enter for new line","commentBtn":"Comment","reviewNotExist":"Review does not exist or has been deleted","loadFailed":"Load failed","networkError":"Network error","reviewNotFound":"Review not found","checkLink":"Please check the link","updatedAt":"Updated {{date}}","active":"Active","closed":"Closed","viewAllComments":"View all comments","viewCommentBtn":"View Comments","copyLink":"Copy Link","reviewSummary":"Review Comments Summary — {{title}}","totalNComments":"{{count}} comments total","quoteRef":"Quote: \\"{{text}}\\"","commentAuthor":"Comment ({{author}}): {{content}}","replyAuthor":" ↳ {{author}}: {{content}}"},"markdown":{"copied":"✓ Copied","copy":"Copy"},"imagePreview":{"previewImage":"Preview image","deleteImage":"Delete image","copyImage":"Copy image","copiedImage":"Image copied"},"tokenStats":{"title":"Claude Code Token Stats","activeHours":"Active Hours Distribution","hourSessions":"{{h}}:00 — {{count}} sessions","messages":"Messages","toolCalls":"Tool Calls","activityTrend":"Activity Trend","byModel":"By Model","tokenUsage":"Token Usage","equivalentCost":"Equivalent Cost","modelCostDetail":"Model Cost Details","model":"Model","share":"Share","total":"Total","totalSessions":"Total Sessions","totalMessages":"Total Messages","equivalentApiCost":"Equivalent API Cost","longestSession":"Longest Session","firstUse":"First Use","notFound":"~/.claude/stats-cache.json not found","day":"Day","week":"Week","month":"Month"},"toolCall":{"inputParams":"Input Parameters","resultLabel":"Result","inputParamsTitle":"View input parameters","resultTitle":"View result","input":"Input","result":"Result","foldedLines":"... ({{count}} lines)"},"fileEditor":{"unsavedConfirm":"You have unsaved changes. Close anyway?","discardChanges":"Discard changes","continueEditing":"Continue editing","externallyModified":"File was modified externally. Saving will overwrite external changes.","useDiskVersion":"Use disk version","forceOverwrite":"Force overwrite"},"quickFileOpen":{"placeholder":"Type file name to open...","noMatch":"No matching files","recent":"Recent","selectHint":"Select","openHint":"Open","closeHint":"Close"},"envManager":{"title":"Environment Variables","tabScope":"Current Tab Only","globalScope":"Global Environment Variables","varNamePlaceholder":"Variable name (e.g. NODE_ENV)","varValuePlaceholder":"Value (e.g. production)","valuePlaceholder":"Value","noVars":"No environment variables yet. Add one to get started."},"aliasManager":{"title":"Command Aliases","description":"Set shortcut aliases for common commands (global)","aliasPlaceholder":"Alias (e.g. ll)","commandPlaceholder":"Full command (e.g. ls -la)","fullCommandPlaceholder":"Full command","usage":"Usage tip:","usageDesc":"Type an alias to execute the corresponding full command","noAliases":"No command aliases yet. Add one to get started."},"diffViewer":{"fileChanges":"File Changes ({{count}})","expandFull":"Expand to full width","exitFull":"Back to column","toggleFileTree":"Toggle file tree","selectFileToView":"Select a file to view changes","sideBySide":"Side by side","unified":"Unified","viewSplit":"Split","viewUnified":"Unified","previewFile":"Preview file","copiedAll":"Full text copied","compact":"Compact","full":"Full","gap":{"hidden":"{{count}} lines hidden","more":"\xb7\xb7\xb7 more +{{count}} \xb7\xb7\xb7","expandUp":"Expand {{count}} lines up","expandDown":"Expand {{count}} lines down","expandAll":"Click to expand {{count}} lines"},"loadingSnapshots":"Loading snapshots…","noChanges":"No file changes detected in this turn","notViewable":"Binary or oversized file — diff not viewable","externalChange":"Concurrent change from another session/process","reconstructed":"reconstructed","reconstructedHint":"Rebuilt from tool-call parameters — not a disk snapshot","truncated":"Too many files — list truncated","aggregate":"Aggregate","aggregateOn":"View the net change across all calls","aggregateOff":"Back to per-call view","fileChangesAggregate":"File Changes ({{count}}) \xb7 Aggregate","aggregateSummary":"{{count}} files changed (across {{calls}} calls)","aggregateLoading":"Aggregating changes…","aggregateEmpty":"No net change after aggregation","aggregateUnavailable":"No snapshots — cannot aggregate","aggregateFailed":"Aggregation failed","aggregateBaselineSkipped":"Skipped {{count}} baseline-scale call(s)","aggregateBaselineIncluded":"Including {{count}} baseline-scale call(s)","callsBaselineHidden":"Hid {{count}} baseline-scale call(s)","callsBaselineShown":"Showing {{count}} baseline-scale call(s)","aggregateSkippedHint":"These calls touched more than {{threshold}} files — usually a branch switch or rebase rather than authored work. Click to toggle.","imageBefore":"Before","imageAfter":"After","imageAdded":"Added","imageDeleted":"Deleted","imageLoadFailed":"Failed to load image","imageUnavailable":"Image not present in either revision"},"commitDetail":{"title":"Commit Details","hash":"Hash:","author":"Author:","date":"Date:","files":"Files:","nChanges":"{{count}} changes","loadingFiles":"Loading files...","noFileChanges":"No file changes","loadingDiff":"Loading diff...","selectFileToView":"Select a file to view diff"},"askQuestion":{"title":"Questions","nQuestions":"{{count}} questions","checkedN":"{{count}} checked","copyChecked":"Copy {{count}} checked Q&A","copyAll":"Copy all Q&A","sendChecked":"Send {{count}} checked Q&A to AI","sendAll":"Send all Q&A to AI","sendNoChat":"No active chat session","checkToCopy":"Check to copy","custom":"Custom","customPlaceholder":"Enter custom answer...","notSelected":"(not selected)"},"tabBar":{"closeTab":"Close tab","closeAll":"Close all tabs","newTab":"New tab"},"tabManagerTopBar":{"copyPageUrl":"Copy page URL","copyDirPath":"Copy directory path","refreshProject":"Refresh project","openInVSCode":"Open in VS Code","openInCursor":"Open in Cursor","aliasesGlobal":"Command Aliases (Global)","tokenStats":"Token Stats","openSurething":"Open Surething"},"hoverTooltip":{"findReferences":"Find References","search":"Search"},"todoViewer":{"title":"Task List","progress":"{{completed}} / {{total}} done"},"userMessages":{"title":"User Messages","noMessages":"No user messages","searchPlaceholder":"Search user messages…","noResults":"No matching messages","loadFailed":"Failed to load","count":"{{shown}} / {{total}}","jumping":"Loading the turns around this message…"},"shortIdBadge":{"clickToDisconnect":"Click to disconnect","clickToRegister":"Click to register and copy CLI command","setTitle":"Name this bubble (so /cc can find it later)","setTitlePlaceholder":"set title","editTitle":"Edit title","titleSet":"Title: {{title}}","dialogTitle":"Name this bubble","dialogPlaceholder":"e.g. alloydb proxy, staging admin"},"api":{"pathForbidden":"Operation not allowed on this path","deleteForbidden":"Delete not allowed on this path","notAFolder":"Target is not a folder","imageTooLarge":"Image too large to preview","cannotPreviewBinary":"Cannot preview binary file","fileTooLarge":"File too large to preview (over 10MB)","fileModifiedExternally":"File was modified externally"},"folderPicker":{"title":"Open Folder","placeholder":"Type or paste a path, e.g. ~/Work/my-app","open":"Open","showHidden":"Show hidden","hint":"↑↓ select \xb7 Tab/Enter go in \xb7 ⌘/Ctrl+Enter open","empty":"No subfolders","noMatch":"No matching folders","notFound":"Folder not found","notDirectory":"Not a folder","denied":"Permission denied. On macOS, grant access in System Settings › Privacy & Security."},"confirm":{"title":"Notice","ok":"OK","cancel":"Cancel"},"floatingToolbar":{"addComment":"Add Comment","sendToAI":"Send to AI","search":"Search"},"quickReply":{"optionA":"A","optionB":"B","optionC":"C","optionD":"D","allRecommended":"Rest recommended","thisOne":"This one","notThis":"Not this","why":"Why?","elaborate":"Say more","example":"Give an example","start":"Do it","continue":"Continue","ok":"OK","done":"Done","edit":"Edit quick replies","editTitle":"Edit quick replies","editHint":"One line per row; separate phrases with commas. Each phrase is sent to the chat exactly as written.","editPlaceholder":"This one, Not this\\nWhy?, Say more","restoreDefault":"Restore defaults","save":"Save","cancel":"Cancel","customizedFor":"Customizing the {{lang}} phrases — the other language is unaffected.","langEn":"English","langZh":"Chinese","saveFailed":"Failed to save quick replies"},"searchResults":{"title":"Search Results","nMatches":"({{count}} matches)","searching":"Searching...","noResults":"No matches","scopeSelected":"Selected","scopeAll":"All"},"references":{"title":"References","searching":"Searching...","notFound":"No references found"},"gitFileTree":{"noFiles":"No files"},"deps":{"action":"Dependencies","none":"none","symbolMessage":"Analyse the dependencies of {{name}} ({{path}}:{{lines}}).\\n\\nCallers: {{callers}}\\nCalls: {{callees}}\\nExternal: {{externals}}\\n\\nExplain which modules it is coupled to, and which of those dependencies could be narrowed."},"explain":{"action":"Explain","fileMessage":"Explain {{path}}","symbolMessage":"Explain {{name}} ({{path}}:{{lines}})","selectionMessage":"Explain","commitFileMessage":"Explain what git commit {{hash}} changed in {{path}}","compareFileMessage":"Explain the git changes to {{path}} in {{base}}...HEAD","compareFileWorktreeMessage":"Explain the changes to {{path}} relative to {{base}}, including uncommitted work","stagedFileMessage":"Explain the git staged changes to {{path}}","unstagedFileMessage":"Explain the git working tree changes to {{path}}"},"reviewUtils":{"adjectives":["Happy","Brave","Quiet","Bright","Gentle","Agile","Free","Clear","Flying","Relaxed","Lively","Wise","Calm","Alert","Composed","Steady","Cheerful","Warm","Bold","Poised"],"nouns":["Panda","Dolphin","Crane","Snow Leopard","Skylark","Squirrel","Flying Fish","Deer","Bluebird","Silver Fox","Owl","Dragonfly","Firefly","Sea Turtle","Butterfly","Monkey","Red-crowned Crane","Antelope","Swallow","Penguin"]},"bots":{"title":"Bots","search":"Search bots","addExisting":"Add bot","addTooltip":"Add as Bot","emptyNoMatch":"No bots match your search.","emptyNoBots":"No bots of your own yet.","emptyCreatePrefix":"Use","emptyCreateSuffix":"in chat to create one.","emptyAddExisting":"add an existing Bot directory","invalid":"Invalid","builtin":"Built-in","remove":"Remove registration","open":"Open as project","pathPlaceholder":"Absolute path to a Bot directory or its BOT.md","addHint":"The directory must contain a BOT.md. Its files are not changed.","added":"Bot added","alreadyAdded":"Already added","removed":"Bot removed; its files were kept.","loadFailed":"Failed to load bots","saveFailed":"Failed to add bot","removeFailed":"Failed to remove bot"}}'),f=JSON.parse('{"common":{"save":"保存","cancel":"取消","delete":"删除","close":"关闭","minimize":"最小化","copy":"复制","edit":"编辑","file":"文件","codeMap":"代码地图","diff":"Diff","confirm":"确认","loading":"加载中...","search":"搜索","refresh":"刷新","retry":"重试","submit":"提交","copied":"已复制","saved":"已保存","failed":"失败","noMatch":"无匹配","noData":"无数据","done":"完成","justNow":"刚刚","minutesAgo":"{{count}}分钟前","hoursAgo":"{{count}}小时前","daysAgo":"{{count}}天前","monthsAgo":"{{count}}个月前","yearsAgo":"{{count}}年前","saveFailed":"保存失败","copyFailed":"复制失败","deleteFailed":"删除失败","operationFailed":"操作失败","copiedPath":"已复制路径","copyPath":"复制路径","openInConsole":"在 Console 气泡打开","copyAbsPath":"复制绝对路径","loadMore":"加载更多","noResult":"无匹配结果","selected":"已选择","selectAll":"全选","hint":"提示","confirmBtn":"确定","cancelBtn":"取消","preview":"预览","readable":"可读","previous":"上一个","next":"下一个","all":"全部","input":"输入","result":"结果","line":"行","lines":"行","running":"运行中","connecting":"连接中","connected":"已连接","connectionFailed":"连接失败","builtin":"内置","global":"全局","project":"项目","current":"当前","code":"代码"},"htmlApps":{"title":"HTML 应用","addTooltip":"添加到 HTML 面板","added":"已添加到 HTML 面板","alreadyAdded":"已添加过","addFailed":"添加失败","add":"添加","adding":"添加中...","addHtmlApp":"添加 HTML 应用","searchPlaceholder":"搜索 HTML 应用...","pathLabel":".html 文件的绝对路径","invalid":"无效","builtin":"内置","noDescription":"无描述","emptyNoApps":"还没有自定义 HTML 应用。","emptyCreatePrefix":"在聊天里使用","emptyCreateSuffix":"创建新应用。","addExisting":"添加已有 HTML 文件","viewDocs":"查看文档","emptyNoMatch":"没有匹配的 HTML 应用。"},"skills":{"addTooltip":"添加到 Skills 面板","added":"已添加到 Skills 面板","alreadyAdded":"已添加过","addFailed":"添加失败","title":"Skills","searchPlaceholder":"搜索 skills...","clearSearch":"清除","addSkill":"添加 Skill","emptyNoSkills":"还没有 skill。","emptyIntroPrefix":"在聊天里使用","emptyIntroSuffix":"把可复用经验整理成 SKILL.md。","emptyNoMatch":"没有匹配的 skill。","viewDocs":"查看文档","pathLabel":"SKILL.md 的绝对路径","pathPlaceholder":"/Users/you/.../skills/foo/SKILL.md","add":"添加","adding":"添加中...","invalid":"无效","copyPath":"复制路径","noDescription":"无描述","previewTitle":"Skill 预览","source":"源码","cannotRead":"无法读取文件。"},"toast":{"savedSuccess":"已保存","saveFailed":"保存失败","copiedName":"已复制: {{name}}","copyFailed":"复制失败","deleteFailed":"删除失败","operationFailed":"操作失败","staged":"已暂存","stageFailed":"暂存失败","unstaged":"已取消暂存","unstageFailed":"取消暂存失败","stagedNFiles":"已暂存 {{count}} 个文件","unstagedNFiles":"已取消暂存 {{count}} 个文件","discardFailed":"放弃变更失败","discardedNFiles":"已放弃 {{count}} 个文件的变更","deletedFile":"已删除文件","discardedChanges":"已放弃变更","pastedFile":"已粘贴: {{name}}","pasteFailed":"粘贴失败","noFileToPaste":"没有可粘贴的文件","createdFile":"已创建文件: {{name}}","createFailed":"创建失败","movedToTrash":"已移动到回收站: {{name}}","copiedPageUrl":"已复制页面地址","copiedDirPath":"已复制目录路径","switchedToBranch":"已切换到 {{branch}}","switchBranchFailed":"切换分支失败","loadBranchFailed":"加载分支列表失败","copiedCommand":"已复制: {{command}}","copiedMessage":"已复制消息","sentToPeer":"已发送到另一栏","sendToPeerFailed":"发送到另一栏失败","forkFailed":"分叉会话失败","excerptFailed":"摘录本轮失败","turnDeleted":"已删除本轮","deleteTurnFailed":"删除本轮失败","copiedUrl":"已复制网址","copiedOutput":"已复制输出","copiedCmd":"已复制命令","copiedComment":"已复制评论","copiedAllComments":"已复制全部评论","copiedFileContent":"已复制文件内容","copiedQA":"已复制 {{count}} 个问答","copiedAllQA":"已复制所有问答","sentQA":"已发送给 AI","readFileFailed":"读取文件失败","fileOutsideProject":"文件在当前项目之外,仅支持预览 Markdown、CSV 和图片","reviewCreated":"评审已创建,链接已复制","reviewUpdated":"评审已更新,链接已复制","reviewCreateFailed":"创建评审失败","sharingClosed":"已关闭分享","sharingCloseFailed":"关闭分享失败","linkCopied":"链接已复制","addCommentFailed":"添加评论失败","deleteCommentFailed":"删除评论失败","editCommentFailed":"编辑评论失败","addReplyFailed":"添加回复失败","deleteReplyFailed":"删除回复失败","editReplyFailed":"编辑回复失败","disconnected":"已断开: {{id}}","pluginReloading":"插件重载中...","worktreeCreateSuccess":"Worktree 创建成功: {{name}}","worktreeCreateFailed":"创建 worktree 失败","worktreeLoadFailed":"加载 worktree 列表失败","worktreeDeleted":"Worktree 已删除","worktreeDeleteFailed":"删除 worktree 失败","worktreeLocked":"已锁定","worktreeUnlocked":"已解锁"},"workspace":{"selectProject":"选择一个项目开始","searchProjectPath":"搜索项目路径...","loadingProjects":"加载项目中...","projectNotFound":"未找到项目","sessions":"{{count}} 会话","loadingSessions":"加载会话...","noSessions":"无会话记录","loadingText":"加载中...","openProject":"打开项目","expandSidebar":"展开侧边栏","collapseSidebar":"折叠侧边栏","notes":"笔记","skills":"技能","apps":"应用","settings":"设置","help":"帮助","updateAvailable":"新版本 v{{version}} 可用","copyUpgradeCommand":"复制 cockpit update","updateNow":"立即更新","updating":"正在更新…","updateComplete":"更新完成","updateFailed":"更新失败","updateCardPreparing":"正在准备更新…","updateCardInstalling":"正在下载并安装","updateCardRepairing":"正在修复原生依赖","updateCardUpToDate":"已是最新版本 v{{version}}","updateCardCopyFix":"复制修复命令","updateCardFixCopied":"已复制修复命令","updateCardRollingBack":"安装失败,正在回滚","updateCardRestarting":"正在重启 Cockpit…","updateCardDone":"已更新到 v{{version}}","updateCardElapsed":"已用 {{seconds}} 秒","updateCardBaseline":"上次约 {{seconds}} 秒","updateCardNoLiveStatus":"暂时读不到实时状态,更新仍在进行","updateCardRolledBack":"已回滚到原版本,Cockpit 可正常使用。","updateCardManualHint":"可在终端手动重试:","updateCardLogHint":"日志:{{path}}","updateRestartNote":"Cockpit 将在后台重启。","viewChangelog":"查看变更日志","serverRestarted":"Cockpit 已在后台更新。","reloadNow":"刷新","upgradeCommandCopied":"已复制 `cockpit update`","projectNotes":"项目笔记","closeProject":"关闭项目","bots":"机器人"},"mobile":{"useDesktop":"桌面版","messagePlaceholder":"发消息…","send":"发送","stop":"停止","enableNotifications":"开启通知","disableNotifications":"关闭通知","notifyError":"无法开启通知"},"sessions":{"recentSessions":"最近会话","favorites":"收藏会话","noFavorites":"暂无收藏会话,在 Tab 栏点击星标可添加","addFavorite":"收藏此会话","removeFavorite":"取消收藏","runningCount":"{{count}} 运行中","unreadCount":"{{count}} 未读","noSessions":"暂无会话记录","running":"运行中","done":"完成","editTitle":"编辑标题","projectSessions":"项目会话","browseAllSessions":"浏览所有会话","sessionList":"会话列表","search":"搜索","searchSessions":"搜索会话...","searchRecentSessions":"搜索最近会话","loadSessionsFailed":"加载会话失败","loadingSessions":"加载会话中...","noMatchingSessions":"未找到匹配的会话","noSessionsYet":"暂无会话","projectList":"项目列表","openFolder":"打开文件夹","loadingHistory":"加载历史消息..."},"scheduledTasks":{"title":"定时任务","aboutToTrigger":"即将触发","secondsLater":"{{count}}秒后","minutesLater":"{{count}}分钟后","hoursMinutesLater":"{{h}}小时{{m}}分后","hoursLater":"{{h}}小时后","onceType":"一次性 ({{minutes}}分钟)","everyNMinutes":"每{{minutes}}分钟","completed":"已完成","paused":"已暂停","activeCount":"{{running}} 个活跃","pausedCount":"{{paused}} 个暂停","noScheduledTasks":"暂无定时任务,在聊天输入栏点击时钟按钮创建","lastResult":"上次","runNow":"立即运行","deleteFailed":"删除任务失败","resume":"恢复","pause":"暂停","completedCount":"已完成 ({{count}})","groupPendingReview":"运行完成待查看","groupUpcoming":"运行中 \xb7 待运行","openSession":"打开会话","selectTaskHint":"选择左侧任务,查看它的会话消息","noTaskMessages":"该任务的会话暂无消息","success":"成功","failure":"失败","createTask":"创建定时任务","editTask":"编辑定时任务","sendMessage":"发送消息","messagePlaceholder":"输入要发送的消息...","taskFile":"任务文件","taskFilePlaceholder":"/Users/you/project/tasks/daily-report.md","taskFileHint":"填写绝对路径。触发时会让 agent 先读取该文件,再按其中描述执行——文件内容改动下次触发即生效。","taskFilePromptHeader":"请先读取以下任务文件,再据此执行:","type":"类型","once":"一次性","interval":"周期","quickSelect":"快捷选择","customCron":"自定义 Cron 表达式","customMinutes":"自定义分钟数","cronPlaceholder":"例: 0 9 * * 1-5 (工作日9点)","cronFormat":"格式:分 时 日 月 星期(如 0 9 * * 1-5)","minutesPlaceholder":"分钟数","limitTimeRange":"限制执行时段","to":"至","saveBtn":"保存 ({{modKey}}↩)","createBtn":"创建 ({{modKey}}↩)","5minLater":"5 分钟后","15minLater":"15 分钟后","30minLater":"30 分钟后","1hourLater":"1 小时后","every15min":"每 15 分钟","every30min":"每 30 分钟","every1hour":"每 1 小时","every2hours":"每 2 小时","daily9am":"每天 09:00","daily6pm":"每天 18:00","weeklyMon9am":"每周一 09:00","monthly1st9am":"每月 1 号 09:00"},"runningTerminals":{"title":"终端","status":"{{count}} 个终端 \xb7 {{projects}} 个项目","keys":"↑↓ 选择 \xb7 Enter 跳转 \xb7 Del 停止 \xb7 Esc 关闭","empty":"没有正在运行的终端","currentProject":"当前项目","stop":"停止","confirmStop":"停止这个进程?","stopping":"停止中…","stopFailed":"停止终端失败","notFound":"没找到这个终端的气泡"},"cron":{"everyNMinutes":"每 {{n}} 分钟","everyNHours":"每 {{n}} 小时整点","everyMinute":"每分钟","everyHourAtMin":"每小时第 {{m}} 分","hourlyEveryMin":"{{h}} 点每分钟","daily":"每天 {{time}}","weekdays":"工作日","weekends":"周末","dowSun":"日","dowMon":"一","dowTue":"二","dowWed":"三","dowThu":"四","dowFri":"五","dowSat":"六","monthPrefix":"月","dayOfMonth":"号","dayRange":"{{a}}号到{{b}}号","weekdayPrefix":"周","weekdayRange":"周{{a}}到周{{b}}"},"blockViewer":{"empty":{"body":"在左侧文件树选择一个文件,查看它的代码地图。","hint":"或按 ⌘K 搜索。"},"fileMode":{"loading":"加载中…","notFound":"该文件未索引(不支持的语言或超出文件上限)。"},"buildProgress":{"listing":"正在扫描文件…","contexts":"正在读取项目配置…","parsing":"正在解析文件","resolving":"正在解析引用关系…","edges":"正在构建调用图…","done":"即将完成…"},"search":{"tooltip":"搜索 (⌘K)","hint":"开始输入以搜索","noResults":"未找到匹配","files":"文件","symbols":"符号"},"viewerToggle":{"toBlock":"显示代码地图","toCode":"返回代码视图"},"tabs":{"toc":"函数列表","history":"跳转记录"},"toc":{"title":"本文件","empty":"未检测到函数。","notIndexed":"该文件未被项目图收录(扩展未支持 / 不在 git 跟踪集 / 超出文件上限)。"},"history":{"title":"最近","empty":"点击左右两侧的 pin 开始追踪调用链。","clear":"清空历史"},"refresh":"重新构建项目图","retry":"重试"},"blockDiffViewer":{"loading":"正在生成代码地图…","unsupported":"该文件类型暂不支持代码地图 diff","unsupportedHint":"切回常规 diff 视图查看。","error":"代码地图 diff 失败:{{message}}","noBlockChanges":"代码地图无变化(仅格式或空白)。","noBefore":"(新增)","noAfter":"(已删除)","kind":{"added":"新增","deleted":"删除","modified":"修改"}},"fileBrowser":{"directoryTree":"目录树","searchTab":"搜索","recentTab":"最近","changesTab":"变更","historyTab":"历史","searchFiles":"搜索文件...","clear":"清除","exactMatchOn":"全词匹配(已开启)","exactMatchOff":"全词匹配(已关闭)","refreshTree":"刷新目录树","collapseAll":"折叠所有目录","searchFileContent":"搜索文件内容...","caseSensitive":"区分大小写","wholeWord":"完整词","regex":"正则","fileTypes":"文件类型 (ts,tsx)","compareMode":"对比","compareModeOff":"关闭分支对比","compareModeOn":"与选定分支对比","compareScopeHead":"HEAD","compareScopeWorktree":"工作区","compareScopeHeadHint":"仅对比已提交的改动","compareScopeWorktreeHint":"对比包含未提交的改动(已暂存 / 未暂存 / 未跟踪)","createFile":"新建文件","createFileIn":"新建文件 (在 {{path}}/)","fileName":"文件名...","noRecentFiles":"暂无最近浏览的文件","stagingArea":"暂存区 ({{count}})","changesSummary_one":"{{count}} 个变更","changesSummary_other":"{{count}} 个变更","noChanges":"工作区无变更","refreshChanges":"刷新变更列表","unstageAll":"全部取消","noStagedFiles":"无暂存的文件","unstageNFiles":"取消暂存 {{count}} 个文件","unstageFile":"取消暂存","workspace":"工作区 ({{count}})","discardAll":"放弃所有","stageAll":"全部暂存","noUnstagedChanges":"无未暂存的变更","discardNFiles":"放弃 {{count}} 个文件的变更","stageNFiles":"暂存 {{count}} 个文件","discardChanges":"放弃变更","stageFile":"暂存文件","loadingDiff":"加载对比文件中...","noDiffFiles":"无差异文件","nFilesChanged":"{{count}} 个文件变更(vs {{branch}})","nFilesChangedWorktree":"{{count}} 个文件变更(vs {{branch}},含未提交)","noDiffFilesHeadHint":"本分支尚无已提交的改动,切到「工作区」可看到未提交的部分","loadingCommits":"加载提交记录中...","noCommits":"无提交记录","allLoaded":"已加载全部 {{count}} 条记录","locateInTree":"在目录树中定位","unsaved":"未保存","saveBeforeSwitch":"当前文件有未保存的修改,是否保存后切换?","saveAndSwitch":"保存并切换","closeEdit":"关闭编辑 (ESC)","closeBtn":"关闭","copyFileContent":"复制文件内容","toggleJsonReadable":"切换 JSON 可读模式","previewMarkdown":"预览 Markdown 渲染效果","exitPreview":"退出预览","collapseAllJson":"折叠","expandAllJson":"展开","viewBlame":"查看每行代码的修改记录","viewDiff":"查看相对 HEAD 的改动","exitDiff":"退出 Diff","diffLoadFailed":"加载差异失败","editFile":"编辑文件","backToPreview":"返回预览","cannotPreview":"无法预览此文件","selectFileToPreview":"选择文件以预览","staged":"已暂存","unstaged":"未暂存","selectFileToViewDiff":"选择文件查看差异","loadingDiffContent":"加载差异中...","clickCompareToLoad":"点击「对比」加载分支差异","selectCommitToView":"选择提交查看详情","confirmDelete":"确认删除","confirmDeleteMessage":"确定要将 <file>{{name}}</file> 移动到回收站吗?","nFilesNMatches":"{{files}} 个文件,{{matches}} 处匹配","resultsTruncated":"结果已截断","noContentSearchResults":"无匹配结果","enterKeywordToSearch":"输入关键词搜索文件内容","searchMinChars":"搜索内容至少需要 2 个字符"},"csv":{"table":"表格","raw":"原始内容","empty":"空表格","summary":"{{rows}} 行 \xb7 {{cols}} 列","summaryFiltered":"匹配 {{rows}} / {{total}} 行 \xb7 {{cols}} 列","loadMore":"加载更多(已显示 {{shown}} / {{total}})","filterPlaceholder":"筛选内容…","filterColumn":"筛选列","clearFilter":"清除筛选","allColumns":"全部列","noMatch":"没有匹配的行","sortHint":"点击排序(升序 / 降序 / 取消)"},"codeViewer":{"fileModifiedExternally":"文件已被外部修改,保存将覆盖外部更改","useDiskVersion":"使用磁盘版本","forceOverwrite":"强制覆盖","searchPlaceholder":"搜索...","caseSensitive":"区分大小写","wholeWordMatch":"全字匹配","unsavedConfirm":"有未保存的修改,确定关闭?","discardChanges":"放弃修改","continueEditing":"继续编辑","unsavedExitConfirm":"有未保存的修改,确定退出编辑模式?","clickToViewDetails":"点击查看详情","clickToViewCommit":"点击查看 commit 详情","nComments":"{{count}} 条评论","searchChat":"搜索聊天内容...","prevShiftEnter":"上一个 (Shift+Enter)","nextEnter":"下一个 (Enter)","closeEsc":"关闭 (Esc)"},"chat":{"startConversation":"开始对话吧","loadMoreHistory":"加载更多...","scrollUpForMore":"↑ 向上滚动加载更多历史","jumpToStart":"跳转到开始","jumpToLatest":"跳转到最新","jumpToPrevUserMessage":"上一条用户消息","jumpToNextUserMessage":"下一条用户消息","recentUserMessages":"最近的用户消息","moreUserMessages":"更多","userMessage":"用户消息","recentUserMessageNumber":"最近用户消息 {{index}}/{{total}}","imageMessage":"图片消息","copyMessage":"复制消息","copyImage":"复制图片","copiedImage":"已复制图片","forkSession":"从此处分叉会话","excerptTurn":"摘录本轮到新会话","newSession":"新建会话","continueFromHere":"延续到此处","continueFromHereDesc":"保留截至本轮的全部上下文","onlyThisTurn":"仅提取本轮","onlyThisTurnDesc":"只带这一轮问答","deleteTurn":"删除本轮","deletingTurn":"正在删除…","deleteTurnConfirm":"确定删除这一轮的问题、回答及工具记录吗?此操作无法撤销。","deleteTurnConfirmAction":"删除本轮","deleteTurnWhileRunning":"会话运行期间不能删除","sendToPeerPane":"发送本条消息到另一栏","imageN":"图片 {{index}}","imagePreview":"图片预览","toolCalls":"{{count}} 个工具调用","collapse":"▲ 收起","expand":"▼ 展开","showMore":"显示更多","showLess":"收起","subagent":"子代理","subagentEmpty":"未找到子代理消息记录","subagentViewTitle":"查看子代理执行过程","workflowRun":"运行详情","workflowViewTitle":"查看工作流运行详情","workflowEmpty":"未找到工作流运行记录","workflowAgents":"个代理","workflowViewAgent":"查看","workflowUngrouped":"未分组","viewQuestions":"查看提问","viewAllFileChanges":"查看所有文件变更","requestFailed":"请求失败","cannotReadStream":"无法读取响应流","errorRetry":"发生错误,请重试","codexResumeFailed":"原会话被其他 Codex 客户端占用,已新建会话,历史未继承","codexResumeFailedPrevious":"原会话","codexResumeFailedNew":"新会话","placeholder":"输入消息,Enter 发送(Shift+Enter 换行,可粘贴图片;行首 /(skill)、/@(子代理执行 skill)或 @(子代理执行机器人),支持多行多命令)","placeholderDisabled":"生成中... 可继续输入 (ESC 取消;卡住太久可取消后重发「继续」)","imageSizeLimit":"图片大小超过限制(最大 5MB),当前大小: {{size}}MB","viewGitChanges":"查看 Git 变更","viewAllComments":"查看所有评论","userMessages":"用户消息列表","projectNotes":"项目笔记","scheduledTasks":"定时任务","quickInstructions":"快捷指令","globalInstructions":"全局指令","projectInstructions":"项目指令","noQuickInstructions":"暂无快捷指令","addQuickInstruction":"新增快捷指令","quickInstructionPlaceholder":"输入一句话指令,Enter 保存,Esc 取消","insertQuickInstruction":"填入输入框(不发送)","addInstructionGroup":"新增分组","instructionGroupNamePlaceholder":"输入分组名,Enter 保存,Esc 取消","instructionGroupLabel":"所属分组","instructionGroupNone":"不分组","deleteInstructionGroupConfirm":"删除分组「{{name}}」会同时删除组内 {{count}} 条指令,确定继续?","editGlobalInstructions":"编辑全局指令","editProjectInstructions":"编辑项目指令","quickInstructionsMarkdownHint":"一级内容每行一条;分组名称后的「- 」开头行是该分组的子命令;单条指令内的换行用 \\\\n 表示。","quickInstructionsMarkdownPlaceholder":"按推荐实施\\n用文本画图\\n- 画一个登录流程\\n- 画一个系统架构","quickInstructionsMarkdownError":"第 {{line}} 行格式不正确。","savingQuickInstructions":"保存中...","saveQuickInstructionsFailed":"保存失败,修改仍然保留,请重试。","context":"上下文","output":"输出","copiedCommandTooltip":"已复制!","copyCommandTooltip":"复制命令: {{command}}","executedCommand":"执行了 `{{command}}`{{exitInfo}},输出:\\n```\\n{{output}}\\n```","executedCommandFailed":"执行 `{{command}}` 失败:{{error}}","executionMode":"执行模式","checkBalance":"查询余额","balanceFailed":"查询失败,请检查 API Key","balanceNeedsKey":"请先配置 DeepSeek API Key","balanceUnavailable":"账户当前不可用","balanceEmpty":"接口未返回余额","openUsagePage":"打开 DeepSeek 用量控制台","checkQuota":"查询额度","quotaFailed":"额度查询失败,请检查 API Key","quotaNeedsKey":"请先设置 API Key","quotaEmpty":"未返回额度信息","quotaResetAt":"{{time}} 重置","openProviderConsole":"打开服务商控制台","planMode":"计划模式","planModeDesc":"只读,先出计划不改代码","planModeOn":"已开启计划模式——只读;发一个任务即可拿到计划","planModeOff":"已关闭计划模式","planModeHint":"计划模式:只读探索、产出计划但不改文件。取消勾选后重发才会实现。","noHistory":"不带历史上下文","noHistoryDesc":"每次提问均独立","noHistoryHint":"不带历史上下文:每条消息单独发给模型,不带之前的对话。上方的会话记录照常保留。","outputStyle":"输出风格","outputStyleNone":"无","noOutputStyles":"暂无输出风格,点右上角铅笔添加","editOutputStyles":"编辑输出风格","outputStylesMarkdownHint":"每个风格以「# 名称」开头,下面直到下一个「# 」之间的内容原样追加到 System Prompt 末尾(可多行,## 等更深标题视为正文)。","outputStylesMarkdownPlaceholder":"# 简洁\\n回答不超过三句话,不要开场白。\\n\\n# 教学\\n先讲为什么,再讲怎么做。","outputStylesError":{"content-before-heading":"第 {{line}} 行:内容必须写在「# 名称」之后。","empty-style":"第 {{line}} 行:风格需要名称和内容。","duplicate-name":"第 {{line}} 行:风格名称重复。"},"planTitle":"计划(待你确认)","approvePlan":"批准并执行","planApproveHint":"本环境无审批弹窗,点此退出计划模式并执行","approvePlanPrompt":"已批准,按上述计划开始执行。","maximizePane":"放大本栏","restorePane":"还原双栏","closePane":"关闭本栏","singlePane":"切回单栏","splitPane":"并排双栏"},"console":{"enterCommandOrUrl":"输入命令或网址开始使用","emptyIntro":"在下方输入框输入以下内容,即可创建对应气泡:","bubbleCommand":"命令","bubbleInteractive":"交互终端","bubbleBrowser":"浏览器","bubbleBrowserNoteIframe":"部分网站会拦截 iframe 嵌入,请在「设置 → 浏览器插件」安装 Cockpit Bridge 后再打开。","bubbleBrowserNoteCookie":"已登录的网站若首次显示未登录,多刷新几次即可恢复。","bubbleDatabase":"数据库","bubbleFilePreview":"文件预览","loadingMore":"加载中...","loadMoreHistory":"加载更多历史","quickCommands":"快捷命令","singleColumn":"单列布局","dualColumn":"双列布局","envVars":"环境变量","launchShell":"启动交互终端","htmlApps":"HTML 应用","inputPlaceholder":"输入命令或网址并按 Enter... (↑↓ 历史, Tab 补全)","scopeProject":"项目","scopeGlobal":"全局","tabSwitchEscClose":"Tab 切换 \xb7 Esc 关闭","copyOutput":"复制输出","copyCommand":"复制命令","rerun":"重新运行","deleteRecord":"删除记录","searchPlaceholder":"搜索...","searchMode":"搜索","filterMode":"过滤","prevShiftEnter":"上一个 (Shift+Enter)","nextEnter":"下一个 (Enter)","loadingTerminal":"加载终端...","clickToInput":"点击终端区域输入","stdinPlaceholder":"stdin 输入...","runningText":"运行中...","exitCode":"退出代码: {{code}}","totalLines":"共 {{count}} 行","globalCommands":"全局命令","projectCommands":"项目命令","noCustomCommands":"暂无自定义命令","namePlaceholder":"名称","commandPlaceholder":"命令","restoreTooltip":"还原 ({{modKey}}M / ESC)","screenshotting":"截图中...","outputFileDeleted":"[输出文件已删除]"},"browser":{"blankPage":"空白页","copyUrl":"复制网址","openInNewWindow":"在新窗口打开","exitMaximize":"退出最大化 ({{modKey}}M)","maximize":"最大化 ({{modKey}}M)","pageLoadFailed":"页面加载失败","clickToWake":"点击唤醒","sleeping":"已休眠","loadingPage":"加载中...","loadFailed":"加载失败"},"database":{"connectionFailed":"连接失败","connected":"已连接","connecting":"连接中...","refreshTableList":"刷新表列表","filterTable":"T 表","filterView":"V 视图","noTables":"无表","tabStructure":"结构","tabData":"数据","tabSql":"SQL","filterActive":"筛选: {{count}}列","clearAllFilters":"清除所有筛选","deleteNRows":"删除 {{count}} 行","confirmDeleteRows":"确认删除?","copyCsvSelected":"复制选中行为 CSV","copyCsvAll":"导出全表 CSV","copyJsonSelected":"复制选中行为 JSON","copyJsonAll":"导出全表 JSON","copyCSV":"复制 CSV","CSV":"CSV","copyJSON":"复制 JSON","JSON":"JSON","selectTable":"选择左侧表格","selectTableToView":"选择表以查看结构","selectTableForData":"选择表以查看数据","columns":"列","colName":"名称","colType":"类型","colNullable":"可空","colDefault":"默认值","primaryKey":"主键","foreignKeys":"外键","indexes":"索引","enable":"启用","commaValues":"逗号分隔多值","likePattern":"%pattern%","valuePlaceholder":"值","apply":"应用","clearFilter":"清除","addRow":"+ 新增行","totalRows":"{{count}} 行","rowsAffected":"{{command}} — {{count}} 行受影响 ({{duration}}ms)","queryRows":"{{count}} 行 ({{duration}}ms)","resultTruncated":"[结果已截断至1000行]","sqlPlaceholder":"输入 SQL... ({{modKey}}Enter 执行)","executing":"执行中...","execute":"▶ 执行","deleteRowsFailed":"{{count}} 行删除失败","inputParams":"输入参数","resultLabel":"结果"},"mysql":{"connectionFailed":"连接失败","connected":"已连接","connecting":"连接中...","refreshTableList":"刷新表列表","filterTable":"T 表","filterView":"V 视图","noTables":"无表","tabStructure":"结构","tabData":"数据","tabSql":"SQL","filterActive":"筛选: {{count}}列","clearAllFilters":"清除所有筛选","deleteNRows":"删除 {{count}} 行","confirmDeleteRows":"确认删除?","copyCsvSelected":"复制选中行为 CSV","copyCsvAll":"导出全表 CSV","copyJsonSelected":"复制选中行为 JSON","copyJsonAll":"导出全表 JSON","copyCSV":"复制 CSV","CSV":"CSV","copyJSON":"复制 JSON","JSON":"JSON","selectTable":"选择左侧表格","selectTableToView":"选择表以查看结构","selectTableForData":"选择表以查看数据","columns":"列","colName":"名称","colType":"类型","colNullable":"可空","colDefault":"默认值","primaryKey":"主键","foreignKeys":"外键","indexes":"索引","enable":"启用","commaValues":"逗号分隔多值","likePattern":"%pattern%","valuePlaceholder":"值","apply":"应用","clearFilter":"清除","addRow":"+ 新增行","totalRows":"{{count}} 行","rowsAffected":"{{command}} — {{count}} 行受影响 ({{duration}}ms)","queryRows":"{{count}} 行 ({{duration}}ms)","resultTruncated":"[结果已截断至1000行]","sqlPlaceholder":"输入 SQL... ({{modKey}}Enter 执行)","executing":"执行中...","execute":"▶ 执行","deleteRowsFailed":"{{count}} 行删除失败"},"redis":{"neverExpires":"永不过期","expired":"已过期","loadFailed":"加载失败","deleteFailed":"删除失败","saveFailed":"保存失败","scanPlaceholder":"SCAN 模式...","scanSearch":"搜索 (SCAN)","noKeys":"无 key","loadMore":"加载更多...","tabData":"数据","tabInfo":"信息","tabCli":"CLI","selectKey":"选择左侧 Key","keyNotExist":"Key 不存在","unsupportedType":"不支持的类型: {{type}}","nItems":"{{total}} items","showingN":"显示 {{count}}","nMembers":"{{total}} members","nEntries":"{{total}} entries","cliHint":"输入 Redis 命令,如 PING, GET key, KEYS *","cliPlaceholder":"输入命令..."},"git":{"switchBranch":"切换分支","searchBranch":"搜索分支...","noBranches":"无可切换分支","noMatchingBranches":"无匹配分支","localBranches":"本地分支","remoteBranches":"远程分支","branchNotFound":"未找到分支","selectBranch":"选择分支...","currentBranch":"当前","notGitRepo":"当前目录不是 Git 仓库","cannotGetBranches":"无法获取分支信息","getBranchesFailed":"获取分支信息失败","discardAllConfirm":"确定要放弃工作区的 {{count}} 个文件的变更吗?此操作不可恢复。","worktree":{"title":"Git Worktree","count":"{{count}} 个 worktree","selectBranch":"选择分支","addWorktree":"+ 添加 Worktree","confirmDelete":"确认删除","confirmDeleteMsg":"确定要删除 worktree 吗?","path":"路径:","branch":"分支:","locked":"已锁定","unlock":"解锁","lock":"锁定","searchBranch":"搜索分支...","noBranches":"无可用分支"}},"comments":{"addComment":"添加评论","lineRange":"行 {{start}}-{{end}}","inputPlaceholder":"输入评论...","newComment":"新评论 {{range}}","commentPlaceholder":"输入评论... ({{modKey}}Enter 提交, Esc 取消)","nComments":"{{count}} 条评论","allComments":"所有评论","copyAllComments":"复制全部评论","noComments":"暂无评论","clearAll":"清空所有","totalComments":"共 {{count}} 条评论","aiReply":"AI 回复","noContent":"(无内容)","linesCount":"({{count}} 行)","codeRef":"以下是我标注的评论和引用:","note":"备注: {{content}}","submitting":"提交中...","enterSubmit":"Enter 提交 \xb7 Shift+Enter 换行","submitComment":"提交评论","askAI":"提问 AI","inputQuestion":"输入你的问题...","aiGenerating":"正在生成中,请稍候...","enterSend":"Enter 发送 \xb7 Shift+Enter 换行","sendToAI":"发送 AI","aiResponding":"AI 正在响应中..."},"fileContextMenu":{"createFile":"新建文件","copyFile":"复制文件","copyFolder":"复制文件夹","pasteHere":"粘贴到此处","deleteFile":"删除文件","deleteFolder":"删除文件夹","copyRelativePath":"复制相对路径","copyAbsolutePath":"复制绝对路径","copyRelativeDirPath":"复制相对文件夹路径","copyAbsoluteDirPath":"复制绝对文件夹路径","copyFileName":"复制文件名","copyFolderName":"复制文件夹名"},"settings":{"title":"设置","theme":"主题","themeLight":"浅色","themeDark":"深色","themeSystem":"跟随系统","browserExtension":"浏览器插件","extensionInstalled":"Cockpit Bridge 已安装","extensionNotInstalled":"Cockpit Bridge 未安装","extensionDescription":"安装 Chrome 插件后,iframe 内的链接跳转将被拦截:新标签链接创建新气泡,页面内导航更新当前气泡。","installSteps":"安装步骤:","step1":"1. 打开 Chrome 地址栏输入","step2":"2. 开启右上角「开发者模式」","step3":"3. 点击「加载已解压的扩展程序」","step4mac":"4. 按 <kbd>Cmd+Shift+G</kbd> → 粘贴下方路径 → 回车","copyExtensionPath":"复制插件目录路径","reloadExtension":"重载插件","about":"关于","language":"语言","languageAuto":"跟随系统","switchDark":"切换暗色","switchLight":"切换亮色","agentsBundled":"内置"},"editor":{"placeholder":"写点什么... 输入 / 打开快捷命令","noteTitle":"{{name}} - 笔记","noteUntitled":"笔记","saving":"保存中...","conflictReloaded":"笔记已被其他地方修改,已加载最新版本,刚才未保存的编辑已丢弃","linkPlaceholder":"输入链接地址...","confirmLink":"确认","removeLink":"移除链接","heading1":"标题 1","heading2":"标题 2","heading3":"标题 3","bold":"粗体","italic":"斜体","strikethrough":"删除线","inlineCode":"行内代码","link":"链接","bulletList":"无序列表","orderedList":"有序列表","taskList":"待办列表","blockquote":"引用","codeBlock":"代码块","table":"表格","horizontalRule":"分割线","insertRowAbove":"在上方插入行","insertRowBelow":"在下方插入行","insertColumnLeft":"在左侧插入列","insertColumnRight":"在右侧插入列","deleteRow":"删除当前行","deleteColumn":"删除当前列","deleteTable":"删除表格","deleteCodeBlock":"删除代码块","toc":"目录","expandToc":"展开目录","collapseToc":"收起目录"},"slashCommands":{"heading1":"标题 1","heading1Desc":"大标题","heading2":"标题 2","heading2Desc":"中标题","heading3":"标题 3","heading3Desc":"小标题","bulletList":"无序列表","bulletListDesc":"项目符号列表","orderedList":"有序列表","orderedListDesc":"编号列表","taskList":"待办列表","taskListDesc":"可勾选的任务列表","blockquote":"引用","blockquoteDesc":"引用块","codeBlock":"代码块","codeBlockDesc":"代码片段","table":"表格","tableDesc":"插入 3\xd73 表格","horizontalRule":"分割线","horizontalRuleDesc":"水平分割线","link":"链接","linkDesc":"插入超链接"},"commands":{"plan":"开启计划模式 \xb7 /plan <任务> 直接规划该任务 \xb7 /plan off 关闭"},"review":{"reviewManagement":"评审管理","allReviews":"所有评审","noOpenReviews":"暂无开放评审","viewComments":"查看评论","nComments":"{{count}} 条评论","nDocs":"{{count}} 文档","nReviews":"{{count}} 评审","docList":"文档列表","allReviewsList":"所有评审","expandList":"展开列表","collapseList":"折叠列表","closeReview":"关闭评审","reopenReview":"重新开放","deleteReview":"删除评审","noOpenDocs":"暂无开放文档","noReviews":"暂无评审","sharing":"分享中","notShared":"未分享","closeSharing":"关闭分享","enableSharing":"开启分享评审","view":"查看","setNickname":"设置你的昵称","nicknameHint":"其他评审人将看到这个名字","nicknamePlaceholder":"输入昵称","skipForNow":"下次再说","identitySettings":"身份设置","reviewNickname":"评审昵称","random":"随机","selectTextToComment":"选中左侧文本添加评论","selectTextHint":"选中左侧文本即可添加评论","prevComment":"上一条","nextComment":"下一条","commentsCount":"{{count}} 条评论","commentsNavCount":"{{current}}/{{total}} 条评论","allCommentsTitle":"全部评论","commentsCountBrief":"{{count}} 条","closedCount":"{{count}} 条已关闭","copyAllComments":"复制全部评论","noComments":"暂无评论","closedComments":"已关闭 ({{count}})","closedLabel":"已关闭","moreReplies":"+{{count}} 条回复","copyComment":"复制评论","reopen":"重开","closeComment":"关闭评论","editComment":"编辑评论","deleteComment":"删除评论","edited":"(已编辑)","editReply":"编辑回复","deleteReply":"删除回复","reply":"回复","replyPlaceholder":"添加回复...","selectedText":"选中文本","addCommentPlaceholder":"添加评论...","enterSubmitHint":"Enter 提交,Shift+Enter 换行","commentBtn":"评论","reviewNotExist":"评审不存在或已被删除","loadFailed":"加载失败","networkError":"网络错误","reviewNotFound":"评审不存在","checkLink":"请检查链接是否正确","updatedAt":"更新于 {{date}}","active":"开放中","closed":"已关闭","viewAllComments":"查看全部评论","viewCommentBtn":"查看评论","copyLink":"复制链接","reviewSummary":"评审评论汇总 — {{title}}","totalNComments":"共 {{count}} 条评论","quoteRef":"引用: \\"{{text}}\\"","commentAuthor":"评论 ({{author}}): {{content}}","replyAuthor":" ↳ {{author}}: {{content}}"},"markdown":{"copied":"✓ 已复制","copy":"复制"},"imagePreview":{"previewImage":"预览图片","deleteImage":"删除图片","copyImage":"复制图片","copiedImage":"已复制图片"},"tokenStats":{"title":"Claude Code Token 统计","activeHours":"活跃时段分布","hourSessions":"{{h}}:00 — {{count}} 次会话","messages":"消息","toolCalls":"工具调用","activityTrend":"活动趋势","byModel":"按模型","tokenUsage":"Token 用量","equivalentCost":"等效费用","modelCostDetail":"模型费用明细","model":"模型","share":"占比","total":"合计","totalSessions":"总会话","totalMessages":"总消息","equivalentApiCost":"等效 API 费用","longestSession":"最长会话","firstUse":"首次使用","notFound":"未找到 ~/.claude/stats-cache.json","day":"日","week":"周","month":"月"},"toolCall":{"inputParams":"输入参数","resultLabel":"结果","inputParamsTitle":"查看输入参数","resultTitle":"查看结果","input":"输入","result":"结果","foldedLines":"... ({{count}} 行)"},"fileEditor":{"unsavedConfirm":"有未保存的修改,确定关闭?","discardChanges":"放弃修改","continueEditing":"继续编辑","externallyModified":"文件已被外部修改,保存将覆盖外部更改","useDiskVersion":"使用磁盘版本","forceOverwrite":"强制覆盖"},"quickFileOpen":{"placeholder":"输入文件名快速打开...","noMatch":"没有匹配的文件","recent":"最近","selectHint":"选择","openHint":"打开","closeHint":"关闭"},"envManager":{"title":"环境变量管理","tabScope":"当前 Tab 专用","globalScope":"全局环境变量","varNamePlaceholder":"变量名(如 NODE_ENV)","varValuePlaceholder":"值(如 production)","valuePlaceholder":"值","noVars":"还没有环境变量,添加一个试试"},"aliasManager":{"title":"命令别名管理","description":"为常用命令设置快捷别名(全局生效)","aliasPlaceholder":"别名(如 ll)","commandPlaceholder":"完整命令(如 ls -la)","fullCommandPlaceholder":"完整命令","usage":"使用提示:","usageDesc":"输入别名即可执行对应的完整命令","noAliases":"还没有命令别名,添加一个试试"},"diffViewer":{"fileChanges":"文件变更 ({{count}})","expandFull":"扩展到全屏","exitFull":"回到分栏","toggleFileTree":"切换文件目录","selectFileToView":"选择左侧文件查看变更","sideBySide":"并列对比","unified":"统一对比","viewSplit":"双栏","viewUnified":"单栏","previewFile":"预览文件","copiedAll":"已复制全文","compact":"精简","full":"全文","gap":{"hidden":"已隐藏 {{count}} 行","more":"\xb7\xb7\xb7 更多 +{{count}} \xb7\xb7\xb7","expandUp":"向上展开 {{count}} 行","expandDown":"向下展开 {{count}} 行","expandAll":"点击展开 {{count}} 行"},"loadingSnapshots":"正在加载快照…","noChanges":"本轮未检测到文件变更","notViewable":"二进制或超大文件,无法展示 diff","externalChange":"同期其他会话/外部进程的变更","reconstructed":"参数重建","reconstructedHint":"由工具调用参数重建,非磁盘快照","truncated":"文件过多,仅显示部分","aggregate":"汇总","aggregateOn":"查看全部调用的累计变更","aggregateOff":"返回逐次调用","fileChangesAggregate":"文件变更 ({{count}}) \xb7 汇总","aggregateSummary":"{{count}} 个文件变更({{calls}} 次调用累计)","aggregateLoading":"正在汇总变更…","aggregateEmpty":"累计后无净变更","aggregateUnavailable":"无快照,无法汇总","aggregateFailed":"汇总失败","aggregateBaselineSkipped":"已跳过 {{count}} 次基线级调用","aggregateBaselineIncluded":"已计入 {{count}} 次基线级调用","callsBaselineHidden":"已隐藏 {{count}} 次基线级调用","callsBaselineShown":"已显示 {{count}} 次基线级调用","aggregateSkippedHint":"这些调用改动的文件数超过 {{threshold}},通常是切换分支 / rebase 而非编写代码。点击切换是否计入","imageBefore":"变更前","imageAfter":"变更后","imageAdded":"新增","imageDeleted":"已删除","imageLoadFailed":"图片加载失败","imageUnavailable":"该版本无此图片"},"commitDetail":{"title":"提交详情","hash":"哈希:","author":"作者:","date":"日期:","files":"文件:","nChanges":"{{count}} 个变更","loadingFiles":"加载文件中...","noFileChanges":"无文件变更","loadingDiff":"加载差异中...","selectFileToView":"选择文件查看差异"},"askQuestion":{"title":"提问","nQuestions":"{{count}} 个问题","checkedN":"已勾选 {{count}}","copyChecked":"复制勾选的 {{count}} 个问答","copyAll":"复制所有问答","sendChecked":"发送勾选的 {{count}} 个问答给 AI","sendAll":"发送所有问答给 AI","sendNoChat":"没有可用的聊天会话","checkToCopy":"勾选以复制","custom":"自定义","customPlaceholder":"输入自定义回答...","notSelected":"(未选择)"},"tabBar":{"closeTab":"关闭标签","closeAll":"关闭所有标签","newTab":"新建标签"},"tabManagerTopBar":{"copyPageUrl":"复制页面地址","copyDirPath":"复制目录路径","refreshProject":"刷新当前项目","openInVSCode":"在 VS Code 中打开","openInCursor":"在 Cursor 中打开","aliasesGlobal":"命令别名(全局)","tokenStats":"Token 统计","openSurething":"打开 Surething"},"hoverTooltip":{"findReferences":"查找引用","search":"搜索"},"todoViewer":{"title":"任务列表","progress":"{{completed}} / {{total}} 完成"},"userMessages":{"title":"用户消息列表","noMessages":"暂无用户消息","searchPlaceholder":"搜索用户消息…","noResults":"没有匹配的消息","loadFailed":"加载失败","count":"{{shown}} / {{total}} 条","jumping":"正在加载该消息所在的对话…"},"shortIdBadge":{"clickToDisconnect":"点击断开连接","clickToRegister":"点击注册并复制 CLI 命令","setTitle":"给这个气泡命名(便于 /cc 通过 connection list 找到它)","setTitlePlaceholder":"设置标题","editTitle":"编辑标题","titleSet":"标题:{{title}}","dialogTitle":"给气泡命名","dialogPlaceholder":"例如:alloydb 代理、预发管理后台"},"api":{"pathForbidden":"不允许操作此路径","deleteForbidden":"不允许删除此路径","notAFolder":"目标不是文件夹","imageTooLarge":"图片文件过大,无法预览","cannotPreviewBinary":"无法预览二进制文件","fileTooLarge":"文件过大,无法预览(超过 10MB)","fileModifiedExternally":"文件已被外部修改"},"folderPicker":{"title":"打开文件夹","placeholder":"输入或粘贴路径,如 ~/Work/my-app","open":"打开","showHidden":"显示隐藏目录","hint":"↑↓ 选择 \xb7 Tab/回车 进入 \xb7 ⌘/Ctrl+回车 打开","empty":"没有子文件夹","noMatch":"没有匹配的文件夹","notFound":"文件夹不存在","notDirectory":"不是文件夹","denied":"没有访问权限。macOS 上请在 系统设置 › 隐私与安全性 中授权。"},"confirm":{"title":"提示","ok":"确定","cancel":"取消"},"floatingToolbar":{"addComment":"添加评论","sendToAI":"发送 AI","search":"搜索"},"quickReply":{"optionA":"A","optionB":"B","optionC":"C","optionD":"D","allRecommended":"其他按推荐","thisOne":"就这个","notThis":"不要这样","why":"为什么","elaborate":"展开说","example":"举个例子","start":"开始做","continue":"继续","ok":"OK","done":"做完了","edit":"编辑快捷短语","editTitle":"编辑快捷短语","editHint":"一行对应面板的一行,行内用逗号分隔。每个短语会原样发送到对话。","editPlaceholder":"就这个,不要这样\\n为什么,展开说","restoreDefault":"恢复默认","save":"保存","cancel":"取消","customizedFor":"当前编辑的是{{lang}}短语,另一种语言不受影响。","langEn":"英文","langZh":"中文","saveFailed":"保存快捷短语失败"},"searchResults":{"title":"搜索结果","nMatches":"({{count}} 处匹配)","searching":"搜索中...","noResults":"无匹配结果","scopeSelected":"选中","scopeAll":"全部"},"references":{"title":"引用","searching":"搜索中...","notFound":"未找到引用"},"gitFileTree":{"noFiles":"无文件"},"deps":{"action":"依赖关系","none":"无","symbolMessage":"分析 {{name}} ({{path}}:{{lines}}) 的依赖关系。\\n\\n调用者:{{callers}}\\n调用了:{{callees}}\\n外部依赖:{{externals}}\\n\\n请说明它耦合在哪些模块上,以及哪些依赖是可以收敛掉的。"},"explain":{"action":"解释一下","fileMessage":"解释一下 {{path}}","symbolMessage":"解释一下 {{name}} ({{path}}:{{lines}})","selectionMessage":"解释一下","commitFileMessage":"解释一下 git commit {{hash}} 对 {{path}} 的改动","compareFileMessage":"解释一下 git {{base}}...HEAD 中 {{path}} 的改动","compareFileWorktreeMessage":"解释一下 {{path}} 相对 {{base}} 的改动(含未提交的部分)","stagedFileMessage":"解释一下 git 暂存区中 {{path}} 的改动","unstagedFileMessage":"解释一下 git 工作区中 {{path}} 的改动"},"reviewUtils":{"adjectives":["快乐","勇敢","安静","明亮","温柔","灵巧","自由","清澈","飞翔","悠闲","活泼","聪慧","淡定","机敏","从容","坚定","爽朗","和煦","奔放","沉稳"],"nouns":["熊猫","海豚","白鹤","雪豹","云雀","松鼠","飞鱼","梅花鹿","青鸟","银狐","猫头鹰","蜻蜓","萤火虫","海龟","蝴蝶","金丝猴","丹顶鹤","羚羊","燕子","企鹅"]},"bots":{"title":"机器人","search":"搜索机器人","addExisting":"添加机器人","addTooltip":"添加为机器人","emptyNoMatch":"没有匹配的机器人。","emptyNoBots":"还没有你自己的机器人。","emptyCreatePrefix":"在聊天里使用","emptyCreateSuffix":"创建一个。","emptyAddExisting":"添加已有的机器人目录","invalid":"无效","builtin":"内置","remove":"移除注册","open":"作为项目打开","pathPlaceholder":"机器人目录或其 BOT.md 的绝对路径","addHint":"目录中必须包含 BOT.md,不会改动其中的文件。","added":"机器人已添加","alreadyAdded":"已添加过","removed":"已移除机器人注册,目录文件仍保留。","loadFailed":"加载机器人失败","saveFailed":"添加机器人失败","removeFailed":"移除机器人失败"}}');d.Ay.isInitialized||d.Ay.init({resources:{en:{translation:e},zh:{translation:f}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});let g=d.Ay},1512:(a,b,c)=>{"use strict";c.d(b,{H:()=>e});let d=a=>"unread"===a?0:"loading"===a?1:2;function e(a){return[...a].sort((a,b)=>d(a.status)-d(b.status)||b.lastActive-a.lastActive)}},2633:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{d:()=>l});var e=c(48249),f=c(67484),g=c(44384),h=c(73887),i=c(55287);c(57063);var j=c(7833);c(77156),c(33281);var k=a([h,i]);function l({skillId:a,onClose:b}){let{t:c}=(0,g.Bd)(),[d,k]=(0,f.useState)(null),[m,n]=(0,f.useState)(!0),[o,p]=(0,f.useState)("preview"),q=(0,f.useCallback)(async()=>{if(d?.path)try{await navigator.clipboard.writeText(d.path),(0,j.oR)(c("common.copiedPath"),"success")}catch{(0,j.oR)(c("common.copyFailed"),"error")}},[d,c]);return(0,e.jsxs)("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-scrim",onClick:b}),(0,e.jsxs)("div",{className:"relative bg-card rounded-lg shadow-lv3 w-full max-w-[70%] h-[90vh] mx-4 flex flex-col overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border flex-shrink-0",children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-foreground truncate",children:d?.name?`/${d.name}`:c("skills.previewTitle")}),(0,e.jsx)("button",{onClick:q,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:c("skills.copyPath"),children:(0,e.jsxs)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",strokeWidth:2}),(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})})]}),d?.path&&(0,e.jsx)("div",{className:"text-xs text-muted-foreground font-mono truncate mt-0.5",children:d.path})]}),(0,e.jsxs)("div",{className:"flex items-center rounded-md border border-border overflow-hidden text-xs flex-shrink-0",children:[(0,e.jsx)("button",{onClick:()=>p("preview"),className:`px-3 py-1 transition-colors ${"preview"===o?"bg-brand text-white":"text-muted-foreground hover:text-foreground hover:bg-hover"}`,children:c("common.preview")}),(0,e.jsx)("button",{onClick:()=>p("source"),className:`px-3 py-1 transition-colors ${"source"===o?"bg-brand text-white":"text-muted-foreground hover:text-foreground hover:bg-hover"}`,children:c("skills.source")})]}),(0,e.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors flex-shrink-0",title:c("common.close"),children:(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:c("common.loading")}):d&&d.valid?"preview"===o?(0,e.jsx)(h.M,{content:d.content,filePath:d.path,cwd:d.path.slice(0,Math.max(0,d.path.lastIndexOf("/"))),embedded:!0,onClose:b}):(0,e.jsx)("div",{className:"flex-1 overflow-auto",children:(0,e.jsx)(i.XO,{content:d.content,filePath:d.path,className:"min-h-full"})}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:c("skills.cannotRead")})]})]})}[h,i]=k.then?(await k)():k,d()}catch(a){d(a)}})},2929:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{s:()=>W});var e=c(48249),f=c(67484),g=c(7833),h=c(44256),i=c(15273),j=c(14839),k=c(72419),l=c(44218),m=c(49681),n=c(21735),o=c(33740),p=c(55313),q=c(32616),r=c(1619),s=c(18812),t=c(59347),u=c(60251),v=c(85862),w=c(80983),x=c(69424),y=c(57632),z=c(18479),A=c(39247),B=c(60591),C=c(87808),D=c(39238),E=c(90031),F=c(13265),G=c(76306),H=c(5900),I=c(33281),J=c(36688),K=c(41224),L=c(44384),M=a([y,w,D,E,J]);async function N(a,b){if(!navigator.clipboard?.write||"u"<typeof ClipboardItem)throw Error("Clipboard image write is unavailable");try{await navigator.clipboard.write([new ClipboardItem({[a.type]:a})]);return}catch(b){if("image/png"===a.type)throw b}let c=await new Promise((a,c)=>{let d=new Image;d.onload=()=>{let b=document.createElement("canvas");b.width=d.naturalWidth,b.height=d.naturalHeight;let e=b.getContext("2d");e?(e.drawImage(d,0,0),b.toBlob(b=>{b?a(b):c(Error("Could not encode image"))},"image/png")):c(Error("Canvas is unavailable"))},d.onerror=()=>c(Error("Could not load image")),d.src=b});await navigator.clipboard.write([new ClipboardItem({"image/png":c})])}function O({image:a,onClose:b}){let{t:c}=(0,L.Bd)(),d=`data:${a.media_type};base64,${a.data}`,f=async b=>{b.stopPropagation();try{await N(function(a,b){let c=atob(a),d=new Uint8Array(c.length);for(let a=0;a<c.length;a+=1)d[a]=c.charCodeAt(a);return new Blob([d],{type:b})}(a.data,a.media_type),d),(0,g.oR)(c("chat.copiedImage"),"success")}catch{(0,g.oR)(c("common.copyFailed"),"error")}},j=(0,e.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:b,children:[(0,e.jsxs)("div",{className:"absolute top-4 right-4 flex items-center gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:f,className:"w-10 h-10 flex items-center justify-center text-white/80 hover:text-white bg-black/40 hover:bg-black/60 rounded-full transition-colors",title:c("chat.copyImage"),children:(0,e.jsx)(i.A,{className:"w-5 h-5"})}),(0,e.jsx)("button",{type:"button",onClick:b,className:"w-10 h-10 flex items-center justify-center text-white/80 hover:text-white bg-black/40 hover:bg-black/60 rounded-full transition-colors",title:c("common.close"),children:(0,e.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("img",{src:d,alt:c("chat.imagePreview"),className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:a=>a.stopPropagation()})]});return(0,e.jsx)(h.ZL,{children:j})}function P({filePath:a,onClose:b}){let{t:c}=(0,L.Bd)(),d=`/api/file?path=${encodeURIComponent(a)}&raw=true`,f=async b=>{b.stopPropagation();try{let b,e=await fetch(d);if(!e.ok)throw Error("Could not read image");let f=await e.blob(),h=f.type?f:new Blob([f],{type:(b=a.slice(a.lastIndexOf(".")).toLowerCase(),".jpg"===b||".jpeg"===b?"image/jpeg":".png"===b?"image/png":".gif"===b?"image/gif":".webp"===b?"image/webp":".svg"===b?"image/svg+xml":".bmp"===b?"image/bmp":".ico"===b?"image/x-icon":".avif"===b?"image/avif":"image/png")});await N(h,d),(0,g.oR)(c("chat.copiedImage"),"success")}catch{(0,g.oR)(c("common.copyFailed"),"error")}};return(0,e.jsx)(h.ZL,{children:(0,e.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:b,children:[(0,e.jsxs)("div",{className:"absolute top-4 right-4 flex items-center gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:f,className:"w-10 h-10 flex items-center justify-center text-white/80 hover:text-white bg-black/40 hover:bg-black/60 rounded-full transition-colors",title:c("chat.copyImage"),children:(0,e.jsx)(i.A,{className:"w-5 h-5"})}),(0,e.jsx)("button",{type:"button",onClick:b,className:"w-10 h-10 flex items-center justify-center text-white/80 hover:text-white bg-black/40 hover:bg-black/60 rounded-full transition-colors",title:c("common.close"),children:(0,e.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("img",{src:d,alt:a.split("/").pop(),className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:a=>a.stopPropagation()})]})})}function Q(a){let b=a.replace(/\/+$/,"");return b.startsWith("/private/")?b.slice(8):b}[y,w,D,E,J]=M.then?(await M)():M;let S=(0,f.memo)(function({text:a,isAside:b,isUser:c,isStreaming:d,onOpenFileLink:h,onPreviewFile:i,cwd:k}){let{t:l}=(0,L.Bd)(),m=(0,f.useMemo)(()=>{if(c||!h)return;let a=a=>{i&&((0,B.e$)(a)||(0,B.u)(a)||(0,B.Zy)(a))?i(a):(0,g.oR)(l("toast.fileOutsideProject"),"error")};return b=>{let c=function(a,b){let c;if(!a||a.startsWith("#")||/^[a-z][a-z0-9+.-]*:/i.test(a)&&!a.startsWith("file:"))return null;let d=a;try{d=decodeURIComponent(a)}catch{}d.startsWith("file://")&&(d=d.slice(7));let e=d.indexOf("#"),f=e>=0?d.slice(e+1):"",g=e>=0?d.slice(0,e):d,h=g.indexOf("?"),i=h>=0?g.slice(h+1):"";g=h>=0?g.slice(0,h):g;let j=f.match(/^L?(\d+)(?:-L?\d+)?$/i)?.[1],k=i.match(/(?:^|[&;])(?:line|L)=(\d+)(?:$|[&;])/i)?.[1],l=g.match(/:(\d+)(?::\d+)?$/),m=j||k||l?.[1];if(m&&(c=Number(m),l&&(g=g.slice(0,-l[0].length))),!(g=g.trim()))return null;let n=c&&c>0?{lineNumber:c}:{},o=b?Q(b):"";if(g.startsWith("/")){let a=Q(g);return o&&a===o?null:o&&a.startsWith(o+"/")?{rel:(0,B.WU)("",a.slice(o.length+1)),abs:null,...n}:{rel:(0,B.WU)("",a),abs:a,...n}}return g.startsWith("./")||g.startsWith("../")||g.includes("/")||/\.[A-Za-z0-9][A-Za-z0-9_-]*$/.test(g)?{rel:(0,B.WU)("",g),abs:null,...n}:null}(b,k);return!!c&&(c.abs?k?I.t4.runPromise((0,C.r6)(k,c.rel)).then(b=>{b.ok&&b.data?.exists?h({path:c.rel,...c.lineNumber?{lineNumber:c.lineNumber}:{}}):a(c.abs)}).catch(()=>a(c.abs)):a(c.abs):h({path:c.rel,...c.lineNumber?{lineNumber:c.lineNumber}:{}}),!0)}},[k,c,h,i,l]),n=(0,f.useMemo)(()=>{if(!c)return a=>{let b=(0,F.i)(a,window.location.origin);return b?((0,G.V)(b,a),!0):!!m&&m(a)}},[c,m]),o=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(H.T,{content:a,isUser:c,isStreaming:d,onLinkClick:n}),d&&(0,e.jsx)("span",{className:"inline-block w-2 h-4 ml-1 bg-current animate-pulse"})]});return b?(0,e.jsxs)("div",{className:"flex gap-1.5 break-words opacity-65",children:[(0,e.jsx)(j.A,{className:"w-3 h-3 mt-[5px] shrink-0 text-muted-foreground","aria-hidden":!0}),(0,e.jsx)("div",{className:"flex-1 min-w-0",children:o})]}):(0,e.jsx)("div",{className:"break-words",children:o})}),T="28em",U=(0,f.memo)(function({children:a}){let{t:b}=(0,L.Bd)(),[c,d]=(0,f.useState)(!1),[g,h]=(0,f.useState)(!1),i=(0,f.useRef)(null),j=(0,f.useRef)(null),m=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(c)return;let a=j.current,b=m.current;if(!a||!b)return;let d=()=>h(a.scrollHeight>a.clientHeight+1);d();let e=new ResizeObserver(d);return e.observe(b),()=>e.disconnect()},[c]);let n=(0,f.useCallback)(()=>{if(!c)return void d(!0);let a=i.current?.closest("[data-message-id]")??i.current;d(!1),requestAnimationFrame(()=>{a&&a.getBoundingClientRect().top<0&&a.scrollIntoView({block:"start",behavior:"auto"})})},[c]);return(0,e.jsxs)("div",{ref:i,children:[(0,e.jsx)("div",{ref:j,className:c?void 0:"overflow-hidden",style:c?void 0:{maxHeight:T},children:(0,e.jsx)("div",{ref:m,children:a})}),g&&(0,e.jsxs)(e.Fragment,{children:[!c&&(0,e.jsx)("div",{className:"text-muted-foreground leading-none pt-1 select-none",children:"…"}),(0,e.jsxs)("button",{type:"button",onClick:n,className:"mt-1 flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[b(c?"chat.showLess":"chat.showMore"),c?(0,e.jsx)(k.A,{className:"w-3.5 h-3.5"}):(0,e.jsx)(l.A,{className:"w-3.5 h-3.5"})]})]})]})});function R({collapsible:a,children:b}){return a?(0,e.jsx)(U,{children:b}):(0,e.jsx)(e.Fragment,{children:b})}let V=new Map,W=(0,f.memo)(function({message:a,cwd:b,sessionId:c,onFork:d,onDeleteTurn:i,forkSupported:j=!0,onSendToPeer:k,peerSide:C,onApprovePlan:F,isLoading:G,onContentSearch:M,onShowFileDiff:N,onOpenFileLink:Q,disableOverlays:T=!1}){let U,W,X,Y,{t:Z,i18n:$}=(0,L.Bd)(),[_,aa]=(0,f.useState)(null),[ab,ac]=(0,f.useState)(()=>1===(a.toolCalls?.length||0)),[ad,ae]=(0,f.useState)(!1),[af,ag]=(0,f.useState)(!1),[ah,ai]=(0,f.useState)(!1),[aj,ak]=(0,f.useState)(!1),[al,am]=(0,f.useState)(!1),an=(0,f.useRef)(null),ao=(0,f.useRef)(null),ap="user"===a.role,aq=a.images&&a.images.length>0,ar=a.toolCalls?.length||0,as=!!c&&!!b&&!!d&&j,at=!!c&&!!b&&!!i;(0,f.useEffect)(()=>{if(!aj)return;let a=a=>{an.current?.contains(a.target)||ak(!1)},b=a=>{"Escape"===a.key&&(ak(!1),ao.current?.focus())};return document.addEventListener("pointerdown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",a),document.removeEventListener("keydown",b)}},[aj]);let au=(0,f.useMemo)(()=>a.toolCalls?.some(a=>(0,A.h)(a.name))||!1,[a.toolCalls]),av=(0,f.useMemo)(()=>{let b=a.parts;if(!b?.length)return a.content?[{text:a.content,isAside:!1}]:[];let c=-1;b.forEach((a,b)=>{"tool"===a.type&&(c=b)});let d=[];return b.forEach((a,b)=>{"text"===a.type&&d.push({text:a.text,isAside:b<c})}),d},[a.parts,a.content]),aw=(0,f.useMemo)(()=>(0,y.vP)([],a.toolCalls??[],b).length>0,[a.toolCalls,b]),[ax,ay]=(0,f.useState)(!1),az=aw||ax;(0,f.useEffect)(()=>{N&&a.toolCalls?.length&&N(a.id,a.toolCalls,b,c??void 0,!0)},[N,a.id,a.toolCalls,b,c]),(0,f.useEffect)(()=>{if(!au||aw||!b)return;let d=(a.toolCalls??[]).map(a=>a.id).filter(Boolean);if(0===d.length)return;let e=(a.toolCalls??[]).filter(a=>(0,A.h)(a.name)).map(a=>a.id),f=!1,g=null,h=0,i=()=>{I.t4.runPromiseExit((0,z.xK)(b,d,c??void 0)).then(a=>{if(f)return;let b="Success"===a._tag?a.value:[];if(b.length>0)return void ay(!0);let c=new Set(b.map(a=>a.toolId));e.some(a=>!c.has(a))&&h<2&&(h+=1,g=setTimeout(i,2e3))})};return i(),()=>{f=!0,g&&clearTimeout(g)}},[au,aw,b,c,a.toolCalls]);let aA=(0,f.useMemo)(()=>{if(!a.toolCalls)return null;for(let b=a.toolCalls.length-1;b>=0;b--)if("TodoWrite"===a.toolCalls[b].name)return a.toolCalls[b];return null},[a.toolCalls]),aB=(0,f.useMemo)(()=>a.toolCalls?a.toolCalls.filter(a=>"AskUserQuestion"===a.name):[],[a.toolCalls]),aC=(0,f.useMemo)(()=>{if(!a.toolCalls)return null;for(let b=a.toolCalls.length-1;b>=0;b--)if("ExitPlanMode"===a.toolCalls[b].name){let c=a.toolCalls[b].input?.plan;return"string"==typeof c&&c?c:null}return null},[a.toolCalls]),aD=(0,f.useMemo)(()=>a.toolCalls?.filter(a=>"ExitPlanMode"!==a.name)??[],[a.toolCalls]),aE=(0,f.useMemo)(()=>{if(!a.toolCalls)return[];let b=new Set,c=[];for(let d of a.toolCalls)if("Read"===d.name||"Edit"===d.name||"Write"===d.name){let a=d.input.file_path;a&&((0,B.e$)(a)||(0,B.aR)(a)||(0,B.u)(a)||(0,B.Zy)(a))&&!b.has(a)&&(b.add(a),c.push(a))}return c},[a.toolCalls]),aF=(0,f.useMemo)(()=>{if(!a.toolCalls)return[];let b=[];for(let c of a.toolCalls){let a=c.input?.thought;if(a&&"string"==typeof a){let d=a.match(/PREVIOUS:\s*(.*?)\s*→\s*THIS:\s*(.*?)\s*→\s*EXPECT:\s*(.*)/i);d?b.push({previous:d[1].trim(),current:d[2].trim(),expect:d[3].trim(),raw:a,toolName:c.name}):b.push({previous:"",current:a,expect:"",raw:a,toolName:c.name})}}return b},[a.toolCalls]),[aG,aH]=(0,f.useState)(null),[aI,aJ]=(0,f.useState)(null);(0,f.useEffect)(()=>{if(!aG||(0,B.u)(aG))return void queueMicrotask(()=>aJ(null));let a=!1;return I.t4.runPromiseExit((0,K.an)(aG)).then(b=>{a||("Success"===b._tag&&void 0!==b.value.content?aJ(b.value.content):((0,g.oR)(Z("toast.readFileFailed"),"error"),aH(null)))}),()=>{a=!0}},[aG,Z]);let aK=async()=>{if(at&&!G&&!al&&await (0,g.lJ)(Z("chat.deleteTurnConfirm",{defaultValue:"Delete this question, answer, and its tool records? This cannot be undone."}),{title:Z("chat.deleteTurn",{defaultValue:"Delete turn"}),confirmText:Z("chat.deleteTurnConfirmAction",{defaultValue:"Delete turn"}),danger:!0})){am(!0);try{await i(a.id)}finally{am(!1)}}},aL=!!C&&!!k&&!!a.content,aM=(0,f.useMemo)(()=>{var b;let c;if(!a.timestamp)return"";let d=new Date(a.timestamp);return isNaN(d.getTime())?"":(b=$.language,!(c=V.get(b))&&(c=new Intl.DateTimeFormat(b,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),V.set(b,c)),c).format(d)},[a.timestamp,$.language]);if("system"===a.role){let b=a.systemEvent,c=b?.kind==="task-notification"?"failed"===b.status?"⚠️":"stopped"===b.status?"⏹️":"\uD83D\uDD14":"ℹ️",d=b?.detail||a.content;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex justify-center my-2 px-2","data-role":"system",children:(0,e.jsxs)("button",{type:"button",onClick:()=>ai(!0),className:"flex items-center gap-1.5 max-w-[85%] text-[11px] text-muted-foreground bg-secondary/40 border border-border/50 rounded-full px-3 py-1 hover:bg-secondary hover:text-foreground transition-colors cursor-pointer",title:Z("chat.viewDetails",{defaultValue:"Click for details"}),children:[(0,e.jsx)("span",{className:"flex-shrink-0",children:c}),(0,e.jsx)("span",{className:"truncate",children:a.content})]})}),ah&&(0,e.jsx)(h.ZL,{children:(0,e.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-scrim p-4",onClick:()=>ai(!1),children:(0,e.jsxs)("div",{className:"bg-card shadow-lv3 w-full max-w-4xl max-h-[80vh] rounded-lg flex flex-col overflow-hidden",onClick:a=>a.stopPropagation(),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border flex-shrink-0",children:[(0,e.jsxs)("span",{className:"text-sm text-foreground flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:c}),b?.kind==="task-notification"?Z("chat.taskNotification",{defaultValue:"Task notification"}):Z("chat.systemNotice",{defaultValue:"Notice"})]}),(0,e.jsx)("button",{onClick:()=>ai(!1),className:"text-muted-foreground hover:text-foreground px-1.5 py-0.5 rounded hover:bg-hover transition-colors",children:"✕"})]}),(0,e.jsx)("pre",{className:"flex-1 overflow-auto px-4 py-3 text-xs text-foreground whitespace-pre-wrap break-words",children:d})]})})})]})}return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:`flex flex-col ${ap?"items-end":"items-start"} mb-4 group`,"data-role":a.role,children:[(0,e.jsx)("div",{className:`relative flex items-start ${ap?"justify-end":"justify-start"} w-full`,children:(0,e.jsxs)("div",{className:`chat-turn px-4 py-2 text-foreground ${ap?"max-w-[80%] bg-muted rounded-2xl rounded-br-md border border-brand/40":"w-full"}`,children:[aq&&(0,e.jsx)("div",{className:`flex flex-wrap gap-2 ${a.content?"mb-2":""}`,children:a.images.map((a,b)=>(0,e.jsx)("div",{className:`relative w-16 h-16 rounded-lg overflow-hidden border border-white/20 ${T?"":"cursor-pointer hover:opacity-90 transition-opacity"}`,onClick:T?void 0:()=>aa(a),children:(0,e.jsx)("img",{src:`data:${a.media_type};base64,${a.data}`,alt:Z("chat.imageN",{index:b+1}),className:"w-full h-full object-cover"})},b))}),av.length>0&&(0,e.jsx)(R,{collapsible:ap,children:(0,e.jsx)("div",{className:"space-y-3",children:av.map((c,d)=>(0,e.jsx)(S,{text:c.text,isAside:c.isAside,isUser:ap,isStreaming:!!a.isStreaming&&d===av.length-1,onOpenFileLink:Q,onPreviewFile:aH,cwd:b},d))})}),aA&&(U=aA.input?.todos,X=(W=Array.isArray(U)?U:[]).filter(a=>"completed"===a.status).length,Y=W.length,(0,e.jsx)("div",{className:`${a.content||aq?"mt-2":""}`,children:(0,e.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden px-3 py-2 space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,e.jsx)("div",{className:"flex-1 h-1 bg-secondary rounded-full overflow-hidden",children:(0,e.jsx)("div",{className:"h-full bg-green-500 rounded-full transition-all duration-300",style:{width:`${Y>0?X/Y*100:0}%`}})}),(0,e.jsxs)("span",{className:"text-[10px] text-muted-foreground flex-shrink-0",children:[X,"/",Y]})]}),W.map((a,b)=>(0,e.jsxs)("div",{className:`flex items-center gap-1.5 ${"completed"===a.status?"opacity-50":""}`,children:["completed"===a.status?(0,e.jsx)(m.A,{className:"w-3 h-3 text-green-11 flex-shrink-0"}):"in_progress"===a.status?(0,e.jsx)(n.A,{className:"w-3 h-3 text-brand flex-shrink-0 animate-spin"}):(0,e.jsx)(o.A,{className:"w-3 h-3 text-muted-foreground flex-shrink-0"}),(0,e.jsx)("span",{className:`text-xs truncate ${"completed"===a.status?"text-muted-foreground":"text-foreground"}`,children:"in_progress"===a.status&&a.activeForm?a.activeForm:a.content})]},b))]})})),aC&&(0,e.jsx)("div",{className:`${a.content||aq||aA?"mt-2":""}`,children:(0,e.jsxs)("div",{className:"border border-brand/40 rounded-lg overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b border-border bg-brand/10",children:[(0,e.jsx)("span",{className:"text-sm",children:"\uD83D\uDCCB"}),(0,e.jsx)("span",{className:"text-xs font-medium text-foreground",children:Z("chat.planTitle",{defaultValue:"Plan (awaiting your review)"})})]}),(0,e.jsx)("div",{className:"px-3 py-2",children:(0,e.jsx)(H.T,{content:aC,isUser:!1})}),F&&(0,e.jsxs)("div",{className:"px-3 py-2 border-t border-border flex items-center justify-between gap-2",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:Z("chat.planApproveHint",{defaultValue:"本环境无审批弹窗,点此退出 Plan 并执行"})}),(0,e.jsxs)("button",{onClick:()=>F(),disabled:G,className:"flex items-center gap-1.5 px-3 py-1 rounded-md bg-brand text-white text-xs font-medium hover:bg-brand/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex-shrink-0",children:[(0,e.jsx)("span",{children:"✓"}),(0,e.jsx)("span",{children:Z("chat.approvePlan",{defaultValue:"批准并执行"})})]})]})]})}),aE.length>0&&(0,e.jsx)("div",{className:`${a.content||aq||aA?"mt-2":""}`,children:(0,e.jsx)("div",{className:"border border-border rounded-lg overflow-hidden px-3 py-2 space-y-0.5",children:aE.map(a=>(0,e.jsxs)("button",{disabled:T,onClick:()=>aH(a),className:"flex items-center gap-1.5 w-full text-left rounded px-1 py-0.5 group/md transition-colors enabled:hover:bg-hover disabled:cursor-default",children:[(0,B.u)(a)?(0,e.jsxs)("svg",{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v14a1 1 0 01-1 1H5a1 1 0 01-1-1V5z"}),(0,e.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4-4 3 3 4-4 5 5"})]}):(0,B.Zy)(a)?(0,e.jsx)("svg",{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6a2 2 0 012-2h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm0 4h16M10 10v10"})}):(0,B.aR)(a)?(0,e.jsx)("svg",{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}):(0,e.jsx)("svg",{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground group-hover/md:text-foreground truncate",children:a.split("/").pop()})]},a))})}),aF.length>0&&(0,e.jsx)("div",{className:`${a.content||aq||aA||aE.length>0?"mt-2":""}`,children:(0,e.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,e.jsxs)("table",{className:"w-full text-xs",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"border-b border-border text-muted-foreground",children:[(0,e.jsx)("th",{className:"px-2 py-1.5 text-left font-medium w-[60px]",children:"Tool"}),(0,e.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Previous"}),(0,e.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Action"}),(0,e.jsx)("th",{className:"px-2 py-1.5 text-left font-medium",children:"Expect"})]})}),(0,e.jsx)("tbody",{children:aF.map((a,b)=>(0,e.jsxs)("tr",{className:b<aF.length-1?"border-b border-border/50":"",children:[(0,e.jsx)("td",{className:"px-2 py-1 text-muted-foreground font-mono",children:a.toolName}),(0,e.jsx)("td",{className:"px-2 py-1 text-muted-foreground",children:a.previous||"—"}),(0,e.jsx)("td",{className:"px-2 py-1 text-foreground",children:a.current}),(0,e.jsx)("td",{className:"px-2 py-1 text-muted-foreground",children:a.expect||"—"})]},b))})]})})}),aD.length>0&&(0,e.jsx)("div",{className:`${a.content||aq?"mt-3":""}`,children:ar>0?(0,e.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsxs)("button",{onClick:()=>ac(!ab),className:"flex-1 px-3 py-1.5 flex items-center gap-2 text-left hover:bg-hover transition-colors active:bg-muted",children:[(0,e.jsx)("span",{className:"text-sm",children:"\uD83D\uDD27"}),(0,e.jsx)("span",{className:"font-medium text-foreground",children:Z("chat.toolCalls",{count:aD.length})}),(0,e.jsx)("span",{className:"ml-auto text-muted-foreground text-sm",children:ab?Z("chat.collapse"):Z("chat.expand")})]}),!T&&aB.length>0&&(0,e.jsx)("button",{onClick:()=>ag(!0),className:"px-3 py-1.5 text-muted-foreground hover:text-foreground hover:bg-hover transition-colors border-l border-line-1",title:Z("chat.viewQuestions"),children:(0,e.jsx)(p.A,{className:"w-4 h-4"})}),!T&&az&&(0,e.jsx)("button",{onClick:()=>{N&&a.toolCalls?N(a.id,a.toolCalls,b,c??void 0):ae(!0)},className:"px-3 py-1.5 text-muted-foreground hover:text-foreground hover:bg-hover transition-colors border-l border-line-1",title:Z("chat.viewAllFileChanges"),children:(0,e.jsx)(q.A,{className:"w-4 h-4"})})]}),ab&&(0,e.jsx)("div",{className:"border-t border-line-1",children:aD.map((a,d)=>(0,e.jsx)(w.K,{toolCall:a,cwd:b,sessionId:c,disableOverlays:T},`${a.id}-${d}`))})]}):aD.map((a,d)=>(0,e.jsx)(w.K,{toolCall:a,cwd:b,sessionId:c,disableOverlays:T},`${a.id}-${d}`))})]})}),(aM||a.content||as||at)&&(0,e.jsxs)("div",{className:`flex items-center gap-1 mt-0.5 px-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity ${ap?"flex-row-reverse":""}`,children:[a.content&&(0,e.jsx)("button",{onClick:()=>{a.content&&(navigator.clipboard.writeText(a.content),(0,g.oR)(Z("toast.copiedMessage")))},className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-hover",title:Z("chat.copyMessage"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),as&&(0,e.jsxs)("div",{ref:an,className:"relative",children:[(0,e.jsxs)("button",{ref:ao,type:"button",onClick:()=>ak(a=>!a),className:"flex items-center gap-1 rounded px-1.5 py-1 text-[11px] text-muted-foreground hover:bg-hover hover:text-foreground","aria-expanded":aj,title:Z("chat.newSession"),children:[(0,e.jsx)(r.A,{className:"h-3.5 w-3.5"}),(0,e.jsx)("span",{children:Z("chat.newSession")}),(0,e.jsx)(l.A,{className:`h-3 w-3 transition-transform ${aj?"rotate-180":""}`})]}),aj&&(0,e.jsxs)("div",{role:"group","aria-label":Z("chat.newSession"),className:`absolute bottom-full z-50 mb-1 w-56 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lv2 ${ap?"right-0":"left-0"}`,children:[(0,e.jsxs)("button",{type:"button",onClick:()=>{as&&(ak(!1),d(a.id,"prefix"))},className:"flex w-full items-start gap-2 rounded-md px-2.5 py-2 text-left hover:bg-hover focus-visible:bg-hover focus-visible:outline-none",children:[(0,e.jsx)(r.A,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block text-xs font-medium",children:Z("chat.continueFromHere")}),(0,e.jsx)("span",{className:"mt-0.5 block text-[11px] leading-4 text-muted-foreground",children:Z("chat.continueFromHereDesc")})]})]}),(0,e.jsxs)("button",{type:"button",onClick:()=>{as&&(ak(!1),d(a.id,"single"))},className:"flex w-full items-start gap-2 rounded-md px-2.5 py-2 text-left hover:bg-hover focus-visible:bg-hover focus-visible:outline-none",children:[(0,e.jsx)(s.A,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block text-xs font-medium",children:Z("chat.onlyThisTurn")}),(0,e.jsx)("span",{className:"mt-0.5 block text-[11px] leading-4 text-muted-foreground",children:Z("chat.onlyThisTurnDesc")})]})]})]})]}),at&&(0,e.jsxs)("button",{type:"button",onClick:aK,disabled:G||al,className:"flex items-center gap-1 rounded px-1.5 py-1 text-[11px] text-muted-foreground hover:bg-red-3 hover:text-red-11 disabled:cursor-not-allowed disabled:opacity-40",title:G?Z("chat.deleteTurnWhileRunning"):Z("chat.deleteTurn"),children:[(0,e.jsx)(t.A,{className:"h-3.5 w-3.5"}),(0,e.jsx)("span",{children:al?Z("chat.deletingTurn"):Z("chat.deleteTurn")})]}),aL&&(0,e.jsx)("button",{onClick:()=>{aL&&k(a.content)},className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-hover",title:Z("chat.sendToPeerPane"),children:"right"===C?(0,e.jsx)(u.A,{className:"w-4 h-4"}):(0,e.jsx)(v.A,{className:"w-4 h-4"})}),aM&&(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground mx-1",children:aM})]})]}),_&&(0,e.jsx)(O,{image:_,onClose:()=>aa(null)}),ad&&a.toolCalls&&(0,e.jsx)(y.zB,{toolCalls:a.toolCalls,cwd:b,sessionId:c??void 0,onClose:()=>ae(!1),onContentSearch:M}),af&&aB.length>0&&(0,e.jsx)(x.$,{toolCalls:aB,onClose:()=>ag(!1)}),aG&&(0,B.u)(aG)&&(0,e.jsx)(P,{filePath:aG,onClose:()=>aH(null)}),aG&&!(0,B.u)(aG)&&null!==aI&&((0,B.aR)(aG)?(0,e.jsx)(D.N,{filePath:aG,content:aI,cwd:b,onClose:()=>aH(null),onContentSearch:M}):(0,B.Zy)(aG)?(0,e.jsx)(E.s,{filePath:aG,content:aI,onClose:()=>aH(null)}):(0,e.jsx)(J.x,{filePath:aG,content:aI,cwd:b||"",onClose:()=>aH(null)}))]})});d()}catch(a){d(a)}})},3033:(a,b,c)=>{"use strict";c.d(b,{w:()=>r});var d=c(48249),e=c(67484),f=c(44384);c(33281);var g=c(83768),h=c(57063);c(41224);var i=c(92545);let j={"claude-fable-5-1":{input:10,output:50,cacheRead:.25,cacheWrite:12.5},"claude-mythos-5-1":{input:10,output:50,cacheRead:.25,cacheWrite:12.5},"claude-fable-5":{input:10,output:50,cacheRead:1,cacheWrite:12.5},"claude-mythos-5":{input:10,output:50,cacheRead:1,cacheWrite:12.5},"claude-opus-5-5":{input:4,output:20,cacheRead:.2,cacheWrite:5},"claude-opus-5":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-8":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-7":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-6":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-opus-4-5":{input:5,output:25,cacheRead:.5,cacheWrite:6.25},"claude-sonnet-5-5":{input:2,output:10,cacheRead:.2,cacheWrite:2.5},"claude-sonnet-5":{input:2,output:10,cacheRead:.2,cacheWrite:2.5},"claude-sonnet-4-6":{input:3,output:15,cacheRead:.3,cacheWrite:3.75},"claude-sonnet-4-5":{input:3,output:15,cacheRead:.3,cacheWrite:3.75},"claude-haiku-5-5":{input:.1,output:.5,cacheRead:.01,cacheWrite:.125},"claude-haiku-4-5":{input:1,output:5,cacheRead:.1,cacheWrite:1.25}},k={input:3,output:15,cacheRead:.3,cacheWrite:3.75},l={light:["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"],dark:["#3987e5","#d95926","#199e70","#c98500","#d55181","#008300","#9085e9","#e66767"]},m={light:{messages:"#2a78d6",toolCalls:"#1baf7a",messagesRgb:"42, 120, 214"},dark:{messages:"#3987e5",toolCalls:"#199e70",messagesRgb:"57, 135, 229"}};function n(a){return a>=1e9?`${(a/1e9).toFixed(1)}B`:a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function o(a){return a>=1e3?`$${a.toFixed(0)}`:a>=100?`$${a.toFixed(1)}`:`$${a.toFixed(2)}`}function p({data:a,height:b=200,formatValue:c=n}){let f=(0,e.useRef)(null),g=(0,e.useRef)(null),[h,i]=(0,e.useState)(null),j=(0,e.useRef)([]);(0,e.useCallback)(()=>{let d=f.current,e=g.current;if(!d||!e)return;let h=window.devicePixelRatio||1,i=e.getBoundingClientRect().width;d.width=i*h,d.height=b*h,d.style.width=`${i}px`,d.style.height=`${b}px`;let k=d.getContext("2d");k.scale(h,h),k.clearRect(0,0,i,b);let{labels:l,datasets:m}=a;if(0===l.length)return;let n=i-50-12,o=b-8-28,p=function(a){if(a<=0)return 1;let b=Math.pow(10,Math.floor(Math.log10(a))),c=a/b;return c<=1?b:c<=2?2*b:c<=5?5*b:10*b}(Math.max(1,...l.map((a,b)=>m.reduce((a,c)=>a+c.data[b],0))));k.fillStyle=getComputedStyle(d).getPropertyValue("color")||"#888",k.font="10px ui-monospace, monospace",k.textAlign="right",k.textBaseline="middle";for(let a=0;a<=4;a++){var q;let b=p/4*a,e=8+o-b/p*o;k.fillText(c(b),44,e),k.strokeStyle=(q="--line-2",getComputedStyle(d).getPropertyValue(q).trim()||"#333"),k.lineWidth=.5,k.beginPath(),k.moveTo(50,e),k.lineTo(50+n,e),k.stroke()}let r=n/l.length,s=Math.max(4,Math.min(.6*r,32)),t=[];l.forEach((a,b)=>{let c=50+b*r+(r-s)/2,e=0;m.forEach(d=>{var f,g,h,i,j,l;let m=d.data[b];if(m<=0)return;let n=Math.max(1,m/p*o),q=8+o-e-n;k.fillStyle=d.color,f=k,g=c,h=q,i=s,l=2,(j=n)<1||(l=Math.min(l,j/2,i/2),f.beginPath(),f.moveTo(g+l,h),f.lineTo(g+i-l,h),f.quadraticCurveTo(g+i,h,g+i,h+l),f.lineTo(g+i,h+j-l),f.quadraticCurveTo(g+i,h+j,g+i-l,h+j),f.lineTo(g+l,h+j),f.quadraticCurveTo(g,h+j,g,h+j-l),f.lineTo(g,h+l),f.quadraticCurveTo(g,h,g+l,h),f.fill()),t.push({x:c,y:q,w:s,h:n,label:a,value:m,dataset:d.label,color:d.color}),e+=n}),k.fillStyle=getComputedStyle(d).getPropertyValue("color")||"#888",k.font="9px ui-monospace, monospace",k.textAlign="center",k.textBaseline="top",b%(l.length>20?Math.ceil(l.length/15):1)==0&&k.fillText(a,c+s/2,8+o+6)}),j.current=t},[a,b,c]);let k=(0,e.useCallback)(a=>{let b=f.current?.getBoundingClientRect();if(!b)return;let d=a.clientX-b.left,e=a.clientY-b.top,g=j.current.find(a=>d>=a.x&&d<=a.x+a.w&&e>=a.y&&e<=a.y+a.h);g?i({x:a.clientX-b.left,y:g.y-4,content:`${g.dataset}: ${c(g.value)}`}):i(null)},[c]);return(0,d.jsxs)("div",{ref:g,className:"relative w-full text-muted-foreground",children:[(0,d.jsx)("canvas",{ref:f,className:"w-full",style:{height:b},onMouseMove:k,onMouseLeave:()=>i(null)}),h&&(0,d.jsx)("div",{className:"absolute pointer-events-none bg-popover text-popover-foreground text-[10px] px-2 py-1 rounded shadow-lv2 border border-border whitespace-nowrap z-10",style:{left:h.x,top:h.y,transform:"translate(-50%, -100%)"},children:h.content})]})}function q({hourCounts:a}){let{t:b}=(0,f.Bd)(),{resolvedTheme:c}=(0,g.DP)(),e=m[c],h=Math.max(1,...Object.values(a)),i=Array.from({length:24},(a,b)=>b);return(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:b("tokenStats.activeHours")}),(0,d.jsx)("div",{className:"flex gap-[2px] items-end h-16",children:i.map(c=>{let f=a[String(c)]||0,g=f/h;return(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-0.5",title:b("tokenStats.hourSessions",{h:c,count:f}),children:[(0,d.jsx)("div",{className:"w-full rounded-sm transition-all",style:{height:`${Math.max(2,48*g)}px`,backgroundColor:g>0?`rgba(${e.messagesRgb}, ${.2+.8*g})`:"var(--muted)"}}),c%3==0&&(0,d.jsx)("span",{className:"text-[8px] text-muted-foreground",children:c})]},c)})})]})}function r({isOpen:a,onClose:b}){var c;let t,u,{t:v}=(0,f.Bd)(),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!0),[A,B]=(0,e.useState)("day"),[C,D]=(0,e.useState)("tokens"),[E,F]=(0,e.useState)(null),{resolvedTheme:G}=(0,g.DP)(),H=(0,e.useMemo)(()=>{var a;let b,c,d=Object.keys(w?.modelUsage||{}).filter(a=>!a.startsWith("<")),e=new Map;for(let a of w?.dailyModelTokens||[])for(let[b,c]of Object.entries(a.tokensByModel)){let d=e.get(b);c>0&&(!d||a.date<d)&&e.set(b,a.date)}return a=[...d].sort((a,b)=>(e.get(a)??"￿").localeCompare(e.get(b)??"￿")||a.localeCompare(b)),b=l[G],c={},a.forEach((a,d)=>{c[a]=b[d%b.length]}),c},[w,G]),I=(0,e.useMemo)(()=>w?.modelUsage?Object.entries(w.modelUsage).filter(([a])=>!a.startsWith("<")).map(([a,b])=>{let c;return{id:a,label:(0,i.J)(a),color:H[a],usage:b,cost:(c=function(a){let b=a.replace(/-\d{8}$/,""),c=j[b];if(c)return c;let d=b.toLowerCase();return d.includes("fable")||d.includes("mythos")?{input:10,output:50,cacheRead:1,cacheWrite:12.5}:d.includes("opus")?{input:5,output:25,cacheRead:.5,cacheWrite:6.25}:d.includes("haiku")?{input:1,output:5,cacheRead:.1,cacheWrite:1.25}:k}(a),b.inputTokens/1e6*c.input+b.outputTokens/1e6*c.output+b.cacheReadInputTokens/1e6*c.cacheRead+b.cacheCreationInputTokens/1e6*c.cacheWrite),totalTokens:b.inputTokens+b.outputTokens+b.cacheReadInputTokens+b.cacheCreationInputTokens}}).sort((a,b)=>b.cost-a.cost):[],[w,H]),J=(0,e.useMemo)(()=>I.reduce((a,b)=>a+b.cost,0),[I]),K=(0,e.useMemo)(()=>I.map(a=>a.id),[I]),L=(0,e.useMemo)(()=>{let a={};for(let b of I)a[b.id]=b.totalTokens>0?b.cost/b.totalTokens:0;return a},[I]),{activityChart:M,tokenChart:N,costChart:O}=(0,e.useMemo)(()=>{let a=w?.dailyActivity||[],b=w?.dailyModelTokens||[];if("day"===A){let c=a.slice(-60),d=b.slice(-60),e={labels:c.map(a=>a.date.slice(5)),datasets:[{label:v("tokenStats.messages"),data:c.map(a=>a.messageCount),color:m[G].messages},{label:v("tokenStats.toolCalls"),data:c.map(a=>a.toolCallCount),color:m[G].toolCalls}]},f=d.map(a=>a.date.slice(5));return{activityChart:e,tokenChart:{labels:f,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:d.map(b=>b.tokensByModel[a]||0),color:H[a]}))},costChart:{labels:f,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:d.map(b=>(b.tokensByModel[a]||0)*(L[a]||0)),color:H[a]}))}}}if("week"===A){let c=function(a,b){let c=new Map;for(let b of a){let a=new Date(b.date),d=new Date(a);d.setDate(a.getDate()-a.getDay());let e=d.toISOString().slice(0,10),f=e.slice(5);c.has(e)||c.set(e,{label:f,messages:0,sessions:0,tools:0,tokensByModel:{}});let g=c.get(e);g.messages+=b.messageCount,g.sessions+=b.sessionCount,g.tools+=b.toolCallCount}for(let a of b){let b=new Date(a.date),d=new Date(b);d.setDate(b.getDate()-b.getDay());let e=d.toISOString().slice(0,10);c.has(e)||c.set(e,{label:e.slice(5),messages:0,sessions:0,tools:0,tokensByModel:{}});let f=c.get(e);for(let[b,c]of Object.entries(a.tokensByModel))f.tokensByModel[b]=(f.tokensByModel[b]||0)+c}return Array.from(c.values()).sort((a,b)=>a.label.localeCompare(b.label))}(a,b),d=c.map(a=>a.label),e={labels:d,datasets:[{label:v("tokenStats.messages"),data:c.map(a=>a.messages),color:m[G].messages},{label:v("tokenStats.toolCalls"),data:c.map(a=>a.tools),color:m[G].toolCalls}]};return{activityChart:e,tokenChart:{labels:d,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:c.map(b=>b.tokensByModel[a]||0),color:H[a]}))},costChart:{labels:d,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:c.map(b=>(b.tokensByModel[a]||0)*(L[a]||0)),color:H[a]}))}}}let c=function(a,b){let c=new Map;for(let b of a){let a=b.date.slice(0,7);c.has(a)||c.set(a,{label:a,messages:0,sessions:0,tools:0,tokensByModel:{}});let d=c.get(a);d.messages+=b.messageCount,d.sessions+=b.sessionCount,d.tools+=b.toolCallCount}for(let a of b){let b=a.date.slice(0,7);c.has(b)||c.set(b,{label:b,messages:0,sessions:0,tools:0,tokensByModel:{}});let d=c.get(b);for(let[b,c]of Object.entries(a.tokensByModel))d.tokensByModel[b]=(d.tokensByModel[b]||0)+c}return Array.from(c.values()).sort((a,b)=>a.label.localeCompare(b.label))}(a,b),d=c.map(a=>a.label),e={labels:d,datasets:[{label:v("tokenStats.messages"),data:c.map(a=>a.messages),color:m[G].messages},{label:v("tokenStats.toolCalls"),data:c.map(a=>a.tools),color:m[G].toolCalls}]};return{activityChart:e,tokenChart:{labels:d,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:c.map(b=>b.tokensByModel[a]||0),color:H[a]}))},costChart:{labels:d,datasets:K.map(a=>({id:a,label:(0,i.J)(a),data:c.map(b=>(b.tokensByModel[a]||0)*(L[a]||0)),color:H[a]}))}}},[w,A,K,L,H,v]),P=E&&H[E]?E:null,Q=(0,e.useMemo)(()=>{let a="tokens"===C?N:O;return P?{...a,datasets:a.datasets.filter(a=>a.id===P)}:a},[N,O,C,P]);if((0,h.E)(b,a),!a)return null;let R=[{key:"day",label:v("tokenStats.day")},{key:"week",label:v("tokenStats.week")},{key:"month",label:v("tokenStats.month")}];return(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,d.jsx)("div",{className:"absolute inset-0 bg-scrim",onClick:b}),(0,d.jsxs)("div",{className:"relative bg-card rounded-xl shadow-lv3 w-full max-w-4xl mx-4 max-h-[90vh] flex flex-col overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-foreground",children:v("tokenStats.title")}),(0,d.jsx)("div",{className:"flex bg-muted rounded-md p-0.5",children:R.map(a=>(0,d.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${A===a.key?"bg-background text-foreground shadow-lv1":"text-muted-foreground hover:text-foreground"}`,onClick:()=>B(a.key),children:a.label},a.key))})]}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto px-6 py-5 space-y-6",children:y?(0,d.jsx)("div",{className:"text-center text-muted-foreground py-12",children:v("common.loading")}):w?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"grid grid-cols-5 gap-3",children:[(0,d.jsx)(s,{label:v("tokenStats.totalSessions"),value:String(w.totalSessions??0)}),(0,d.jsx)(s,{label:v("tokenStats.totalMessages"),value:n(w.totalMessages??0)}),(0,d.jsx)(s,{label:v("tokenStats.equivalentApiCost"),value:o(J),highlight:!0}),(0,d.jsx)(s,{label:v("tokenStats.longestSession"),value:w.longestSession?(t=Math.floor((c=w.longestSession.duration)/36e5),u=Math.floor(c%36e5/6e4),t>0?`${t}h ${u}m`:`${u}m`):"-"}),(0,d.jsx)(s,{label:v("tokenStats.firstUse"),value:w.firstSessionDate?w.firstSessionDate.slice(0,10):"-"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:v("tokenStats.activityTrend")}),(0,d.jsxs)("div",{className:"flex items-center gap-3 text-[10px]",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:m[G].messages}}),v("tokenStats.messages")]}),(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:m[G].toolCalls}}),v("tokenStats.toolCalls")]})]})]}),(0,d.jsx)("div",{className:"border border-border rounded-lg p-3 bg-muted/20",children:(0,d.jsx)(p,{data:M,height:180})})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:v("tokenStats.byModel")}),(0,d.jsxs)("div",{className:"flex bg-muted rounded-md p-0.5",children:[(0,d.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${"tokens"===C?"bg-background text-foreground shadow-lv1":"text-muted-foreground hover:text-foreground"}`,onClick:()=>D("tokens"),children:v("tokenStats.tokenUsage")}),(0,d.jsx)("button",{className:`px-2.5 py-0.5 text-[11px] rounded transition-colors ${"cost"===C?"bg-background text-foreground shadow-lv1":"text-muted-foreground hover:text-foreground"}`,onClick:()=>D("cost"),children:v("tokenStats.equivalentCost")})]})]}),(0,d.jsx)("div",{className:"flex items-center gap-3 text-[10px] flex-wrap",children:I.map(a=>(0,d.jsxs)("button",{onClick:()=>F(P===a.id?null:a.id),className:`flex items-center gap-1 rounded-sm transition-opacity hover:opacity-100 ${P&&P!==a.id?"opacity-40":""}`,children:[(0,d.jsx)("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{backgroundColor:a.color}}),a.label]},a.id))})]}),(0,d.jsx)("div",{className:"border border-border rounded-lg p-3 bg-muted/20",children:(0,d.jsx)(p,{data:Q,height:180,formatValue:"tokens"===C?n:o})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:v("tokenStats.modelCostDetail")}),(0,d.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,d.jsxs)("table",{className:"w-full text-xs",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{className:"bg-muted/50 text-muted-foreground",children:[(0,d.jsx)("th",{className:"text-left px-3 py-2 font-medium",children:v("tokenStats.model")}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Input"}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Output"}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Cache Read"}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:"Cache Write"}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:v("tokenStats.share")}),(0,d.jsx)("th",{className:"text-right px-3 py-2 font-medium",children:v("tokenStats.equivalentCost")})]})}),(0,d.jsxs)("tbody",{children:[I.map(a=>(0,d.jsxs)("tr",{className:"border-t border-border",children:[(0,d.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:a.color}}),a.label]})}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(a.usage.inputTokens)}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(a.usage.outputTokens)}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(a.usage.cacheReadInputTokens)}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(a.usage.cacheCreationInputTokens)}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:J>0?`${(a.cost/J*100).toFixed(1)}%`:"-"}),(0,d.jsx)("td",{className:"px-3 py-2 text-right font-medium text-foreground",children:o(a.cost)})]},a.id)),(0,d.jsxs)("tr",{className:"border-t-2 border-border bg-muted/30",children:[(0,d.jsx)("td",{className:"px-3 py-2 font-medium text-foreground",children:v("tokenStats.total")}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(I.reduce((a,b)=>a+b.usage.inputTokens,0))}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(I.reduce((a,b)=>a+b.usage.outputTokens,0))}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(I.reduce((a,b)=>a+b.usage.cacheReadInputTokens,0))}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:n(I.reduce((a,b)=>a+b.usage.cacheCreationInputTokens,0))}),(0,d.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground",children:"100%"}),(0,d.jsx)("td",{className:"px-3 py-2 text-right font-bold text-foreground",children:o(J)})]})]})]})})]}),w.hourCounts&&Object.keys(w.hourCounts).length>0&&(0,d.jsx)("div",{className:"border border-border rounded-lg p-3 bg-muted/20",children:(0,d.jsx)(q,{hourCounts:w.hourCounts})})]}):(0,d.jsx)("div",{className:"text-center text-muted-foreground py-12",children:v("tokenStats.notFound")})})]})]})}function s({label:a,value:b,highlight:c}){return(0,d.jsxs)("div",{className:"bg-muted/30 rounded-lg px-3 py-2.5",children:[(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground",children:a}),(0,d.jsx)("div",{className:`text-sm font-semibold mt-0.5 ${c?"text-brand":"text-foreground"}`,children:b})]})}},3588:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{TabBar:()=>p});var e=c(48249),f=c(67484),g=c(40311),h=c(41233),i=c(63565),j=c(32753),k=c(72529),l=c(44256),m=c(44384);function n({number:a,status:b,statusLabel:c,isActive:d,pinned:f,bot:i}){let j="normal"!==b?(0,g.JQ)(b,d):f?"border-transparent bg-amber-9 text-black/80":d?"border-transparent bg-brand/25 text-brand":"border-transparent bg-muted-foreground/25 text-foreground/75";return(0,e.jsx)(h.w,{wash:j,ring:(0,g.QV)(b),bot:i,role:"normal"!==b?"status":void 0,ariaLabel:i?[c,`Bot session: @${i}`].filter(Boolean).join(" \xb7 "):c,ariaHidden:"normal"===b&&!i,children:a})}function o({onNewTab:a,onNewCodexTab:b,onNewKimiTab:c,onNewGlmTab:d,onNewOllamaTab:g,onNewDeepseekTab:h}){let[j,k]=(0,f.useState)(!1),m=(0,f.useRef)(null),n=(0,f.useRef)(null),[p,q]=(0,f.useState)({top:0,right:0}),r=(0,l.F2)();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{ref:m,onClick:()=>{if(!j&&m.current){let a=m.current.getBoundingClientRect(),b=r?.getBoundingClientRect(),c=b?.left??0,d=b?.top??0,e=b?.width??window.innerWidth;q({top:a.bottom+4-d,right:e-(a.right-c)})}k(a=>!a)},className:"flex-shrink-0 p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:"New tab",children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),j&&(0,e.jsx)(l.ZL,{children:(0,e.jsx)("div",{ref:n,className:"fixed z-[9999] bg-popover border border-border rounded-lg shadow-lv2 py-1 min-w-[140px]",style:{top:p.top,right:p.right},children:i.CX.map(f=>(0,e.jsxs)("button",{onClick:()=>{k(!1),"codex"===f?b?.():"kimi"===f?c?.():"glm"===f?d?.():"ollama"===f?g?.():"deepseek"===f?h?.():a()},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-brand/10 transition-colors whitespace-nowrap",children:[(0,e.jsx)(i.eV,{engine:f,className:"h-3.5 w-3.5"}),i.H[f]]},f))})})]})}function p({tabs:a,selectedTabId:b,unreadTabs:c,globalLoadingTabs:d,dragTabIndex:f,dragOverTabIndex:g,isPinned:h,onSwitchTab:i,onCloseTab:l,onCloseAllTabs:q,onNewTab:r,onNewCodexTab:s,onNewKimiTab:t,onNewGlmTab:u,onNewOllamaTab:v,onNewDeepseekTab:w,onOpenProjectSessions:x,onDragStart:y,onDragOver:z,onDrop:A,onDragEnd:B,sideBySide:C,onToggleSideBySide:D}){let{t:E}=(0,m.Bd)();return(0,e.jsx)("div",{className:"border-b border-border bg-card shrink-0",children:(0,e.jsxs)("div",{className:"flex items-center px-2 gap-1 overflow-x-auto",children:[a.map((a,m)=>{let o=a.id===b,p=h?.(a.id)??!1,q=a.isLoading||d.has(a.id)?"loading":c.has(a.id)&&!o?"unread":"normal";return(0,e.jsx)(k.m,{content:a.title,delay:200,className:"flex-1 min-w-16 max-w-[260px]",children:(0,e.jsxs)("div",{draggable:!0,onDragStart:()=>y(m),onDragOver:a=>z(a,m),onDrop:()=>A(m),onDragEnd:B,className:`group flex items-center gap-1 px-3 py-1.5 text-sm cursor-pointer rounded-t-lg border-t-[1.5px] transition-colors ${o?"border-brand bg-slate-4 text-foreground font-medium":"border-transparent text-muted-foreground hover:bg-secondary/50"} ${f===m?"opacity-50":""} ${g===m?"border-l-2 border-brand":""}`,onClick:()=>i(a.id),children:[(0,e.jsx)("div",{className:"h-4 w-4 -translate-x-1 flex-shrink-0",children:(0,e.jsx)(n,{number:m+1,status:q,statusLabel:"loading"===q?E("sessions.running"):"unread"===q?E("sessions.done"):void 0,isActive:o,pinned:p,bot:a.bot})}),(0,e.jsx)("span",{className:"flex-1 min-w-0 truncate",children:a.title}),(0,e.jsxs)("span",{className:"relative ml-1 h-4 w-4 translate-x-1 shrink-0",children:[(0,e.jsx)("span",{className:"absolute inset-0 inline-flex items-center justify-center transition-opacity group-hover:opacity-0 group-focus-within:opacity-0",children:(0,e.jsx)(j.S,{engine:a.engine,size:"sm"})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),l(a.id)},className:"absolute inset-0 flex items-center justify-center rounded opacity-0 transition-opacity hover:bg-muted group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","data-tooltip":E("tabBar.closeTab"),"aria-label":E("tabBar.closeTab"),children:(0,e.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]})},a.id)}),(0,e.jsx)(o,{onNewTab:r,onNewCodexTab:s,onNewKimiTab:t,onNewGlmTab:u,onNewOllamaTab:v,onNewDeepseekTab:w}),q&&(0,e.jsx)("button",{onClick:q,className:"flex-shrink-0 p-1.5 text-muted-foreground hover:text-destructive hover:bg-hover rounded transition-colors",title:E("tabBar.closeAll"),"aria-label":E("tabBar.closeAll"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),x&&(0,e.jsx)("button",{onClick:x,className:"flex-shrink-0 p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:E("sessions.projectSessions"),"aria-label":E("sessions.projectSessions"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),D&&(0,e.jsx)("button",{onClick:D,className:"flex-shrink-0 p-1.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors",title:C?E("chat.singlePane"):E("chat.splitPane"),"aria-label":C?E("chat.singlePane"):E("chat.splitPane"),"aria-pressed":C,children:(0,e.jsxs)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2",strokeWidth:2}),!C&&(0,e.jsx)("path",{strokeWidth:2,d:"M12 4v16"})]})})]})})}d()}catch(a){d(a)}})},4263:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$:()=>g});var e=c(12629),f=a([e]);e=(f.then?(await f)():f)[0];let h="/tree-sitter",i=null,j=new Map;async function g(a){let b,c=await (!(b=j.get(a))&&(b=(async()=>(await (!i&&(i=e.Parser.init({locateFile:a=>`${h}/${a}`})),i),e.Language.load(`${h}/tree-sitter-${a}.wasm`)))(),j.set(a,b)),b),d=new e.Parser;return d.setLanguage(c),d}d()}catch(a){d(a)}})},4325:(a,b,c)=>{"use strict";c.d(b,{$2:()=>u,N4:()=>k,_I:()=>t,fX:()=>l,fZ:()=>m});let d="cockpit update",e={visible:!1,stage:"preparing",startedAt:0,baselineMs:null,installedVersion:null,upToDate:!1,error:null,rolledBack:!1,fixCommand:d,logPath:null,live:!1},f="cockpit:update-seen-at",g=e,h=new Set,i=!1;function j(a){g={...g,...a},h.forEach(a=>a())}function k(a){return h.add(a),()=>h.delete(a)}function l(){return g}function m(){try{window.localStorage.setItem(f,String(Date.now()))}catch{}j({visible:!1})}let n=a=>new Promise(b=>setTimeout(b,a));async function o(){try{let a=await fetch("/api/health",{cache:"no-store",signal:AbortSignal.timeout(2e3)});if(!a.ok)return null;let b=await a.json();return{pid:"number"==typeof b.pid?b.pid:null,version:b.version??null}}catch{return null}}async function p(){try{let a=await fetch("/api/update-state",{cache:"no-store",signal:AbortSignal.timeout(2e3)});if(!a.ok)return{state:null,logPath:null};let b=await a.json();return{state:b.state??null,logPath:b.logPath??null}}catch{return{state:null,logPath:null}}}async function q(a){try{let b=await fetch(`http://127.0.0.1:${a}/`,{cache:"no-store",signal:AbortSignal.timeout(1500)});if(!b.ok)return null;return await b.json()}catch{return null}}function r(a){switch(a){case"installing":return"installing";case"repairing":return"repairing";case"rolling-back":return"rolling-back";case"restarting":case"done":return"restarting";default:return"preparing"}}function s(a,b={}){j({stage:"failed",error:a,...b})}async function t(){if(!i){i=!0,j({...e,visible:!0,stage:"preparing",startedAt:Date.now()});try{let a=await p();j({baselineMs:a.state?.installMs??a.state?.prevInstallMs??null,logPath:a.logPath});let b=await o(),c=b?.pid??null,e=b?.version??null,f=await fetch("/api/update",{method:"POST"});if(!f.ok){let a=await f.json().catch(()=>({}));s(a.error??`HTTP ${f.status}`);return}let h=await f.json().catch(()=>({})),i=h.statusPort??null;j({logPath:h.logPath??g.logPath});let k=0,l=null!==i,m=Date.now()+3e5;for(;Date.now()<m;){if(await n(1e3),l&&null!==i){let a=await q(i);if(a){if(k=0,j({live:!0}),"failed"===a.phase)return void s(a.error??"install failed",{rolledBack:!0===a.rolledBack,fixCommand:a.fixCommand??d,live:!0});j({stage:r(a.phase),installedVersion:a.installed??g.installedVersion,baselineMs:g.baselineMs??a.prevInstallMs??null})}else++k>=3&&(l=!1,j({live:!1}))}let a=await o();if(a?.pid!=null&&(null===c||a.pid!==c)){let{state:b}=await p();if(b?.phase==="failed")return void s(b.error??"update failed",{rolledBack:!0===b.rolledBack,fixCommand:b.fixCommand??d});let c=a.version??g.installedVersion;j({stage:"done",installedVersion:c,upToDate:null!==c&&c===e});return}}s("timeout")}catch(a){s(a instanceof Error?a.message:String(a))}finally{i=!1}}}async function u(){if(i||g.visible)return;let{state:a,logPath:b}=await p();if(!a?.phase||"done"===a.phase)return;let c=a.startedAt??0,h=a.installMs??a.prevInstallMs??null;if("failed"===a.phase){let g=0;try{g=Number(window.localStorage.getItem(f))||0}catch{}if((a.finishedAt??0)<=g)return;j({...e,visible:!0,stage:"failed",startedAt:c,baselineMs:h,error:a.error??"unknown error",rolledBack:!0===a.rolledBack,fixCommand:a.fixCommand??d,logPath:b});return}if(!(!c||Date.now()-c>6e5)){i=!0,j({...e,visible:!0,stage:r(a.phase),startedAt:c,baselineMs:h,logPath:b});try{let a=c+3e5;for(;Date.now()<a;){await n(1e3);let{state:a}=await p();if(a?.phase){if("failed"===a.phase)return void s(a.error??"install failed",{rolledBack:!0===a.rolledBack,fixCommand:a.fixCommand??d});if("done"===a.phase)return void j({stage:"done",installedVersion:a.installed??null,upToDate:!0===a.unchanged});j({stage:r(a.phase)})}}s("timeout")}finally{i=!1}}}},4462:(a,b,c)=>{"use strict";c.d(b,{EmptyState:()=>f});var d=c(48249),e=c(44384);function f({onBrowseProjects:a}){let{t:b}=(0,e.Bd)();return(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-5 bg-card",children:[(0,d.jsx)("svg",{className:"w-14 h-14 text-muted-foreground/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"})}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:b("workspace.selectProject")}),(0,d.jsxs)("button",{onClick:a,className:"flex items-center gap-2 px-4 py-2 text-sm rounded-lg bg-primary text-primary-foreground hover:opacity-90 transition-opacity",children:[(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m3-3H9m-4 7h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),b("workspace.openProject")]})]})}},4857:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e});var d=c(67484);function e(){let a=(0,d.useRef)([]),b=(0,d.useRef)([]),c=(0,d.useCallback)(c=>{a.current.push(c),a.current.length>50&&(a.current=a.current.slice(-50)),b.current=[]},[]),e=(0,d.useCallback)(c=>{if(0===a.current.length)return null;let d=a.current.pop();return b.current.push(c),b.current.length>50&&(b.current=b.current.slice(-50)),d},[]),f=(0,d.useCallback)(c=>{if(0===b.current.length)return null;let d=b.current.pop();return a.current.push(c),a.current.length>50&&(a.current=a.current.slice(-50)),d},[]);return{push:c,goBack:e,goForward:f,canGoBack:(0,d.useCallback)(()=>a.current.length>0,[]),canGoForward:(0,d.useCallback)(()=>b.current.length>0,[])}}},5585:(a,b,c)=>{"use strict";c.d(b,{Providers:()=>p});var d=c(48249),e=c(29491),f=c(83768),g=c(7833),h=c(67484),i=c(74429);function j(){let[a,b]=(0,h.useState)(null);(0,h.useRef)(null).current=a,(0,h.useRef)(null);let c=(0,h.useRef)(null),[e,f]=(0,h.useState)({left:0,top:0}),[g,j]=(0,h.useState)(!1);return g&&a?(0,i.createPortal)((0,d.jsx)("div",{ref:c,className:"fixed z-[9999] max-w-[min(80vw,64rem)] px-2 py-1 bg-tooltip text-tooltip-foreground text-xs font-mono rounded shadow-lv3 border border-line-1 whitespace-pre-wrap break-words pointer-events-none",style:{left:e.left,top:e.top},children:a.text}),document.body):null}var k=c(44384),l=c(4325);c(29939);let m=new Set(["preparing","installing","repairing","rolling-back","restarting"]);function n(){return(0,d.jsxs)("svg",{className:"h-4 w-4 flex-shrink-0 animate-spin text-brand",fill:"none",viewBox:"0 0 24 24",children:[(0,d.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:4}),(0,d.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function o(){let{t:a}=(0,k.Bd)(),b=(0,h.useSyncExternalStore)(l.N4,l.fX,l.fX),[c,e]=(0,h.useState)(()=>Date.now());(0,h.useRef)(!1);let{stale:f}=function(){let[a,b]=(0,h.useState)(!1);return{stale:a}}(),[i,j]=(0,h.useState)(!1),[o,p]=(0,h.useState)(!1),q=b.visible&&m.has(b.stage),r=(0,h.useCallback)(()=>{navigator.clipboard.writeText(b.fixCommand),(0,g.oR)(a("workspace.updateCardFixCopied"))},[b.fixCommand,a]),s=!b.visible&&f&&!i;if(!o||!b.visible&&!s)return null;let t=b.startedAt?Math.max(0,Math.round((c-b.startedAt)/1e3)):0,u=b.baselineMs?Math.round(b.baselineMs/1e3):null,v=s||"done"===b.stage,w=s||!m.has(b.stage),x=v&&!b.upToDate,y=s?a("workspace.serverRestarted"):(()=>{switch(b.stage){case"preparing":return a("workspace.updateCardPreparing");case"installing":return a("workspace.updateCardInstalling");case"repairing":return a("workspace.updateCardRepairing");case"rolling-back":return a("workspace.updateCardRollingBack");case"restarting":return a("workspace.updateCardRestarting");case"done":if(!b.installedVersion)return a("workspace.updateComplete");return b.upToDate?a("workspace.updateCardUpToDate",{version:b.installedVersion}):a("workspace.updateCardDone",{version:b.installedVersion});case"failed":return a("workspace.updateFailed")}})();return(0,d.jsx)("div",{className:"fixed top-4 right-4 z-[110] w-80 rounded-lg border border-border\n bg-background/95 p-3 shadow-lv2 backdrop-blur",role:"status","aria-live":"polite",children:(0,d.jsxs)("div",{className:"flex items-start gap-2.5",children:[q?(0,d.jsx)(n,{}):v?(0,d.jsx)("svg",{className:"h-4 w-4 flex-shrink-0 text-brand",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):(0,d.jsx)("svg",{className:"h-4 w-4 flex-shrink-0 text-destructive",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"text-sm text-foreground",children:y}),q&&(0,d.jsxs)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:[a("workspace.updateCardElapsed",{seconds:t}),null!==u&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",a("workspace.updateCardBaseline",{seconds:u})]})]}),q&&!b.live&&(0,d.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground/80",children:a("workspace.updateCardNoLiveStatus")}),q&&(0,d.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:a("workspace.updateRestartNote")}),!s&&"failed"===b.stage&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"mt-1 break-words text-[11px] leading-snug text-muted-foreground",children:b.error}),b.rolledBack&&(0,d.jsx)("div",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:a("workspace.updateCardRolledBack")}),(0,d.jsx)("div",{className:"mt-2 text-[11px] leading-snug text-muted-foreground",children:a("workspace.updateCardManualHint")}),(0,d.jsx)("code",{className:"mt-1 block break-all rounded bg-hover px-2 py-1.5 text-[11px]\n leading-snug text-foreground",children:b.fixCommand}),(0,d.jsx)("button",{type:"button",onClick:r,className:"mt-1.5 w-full rounded-md border border-border px-2.5 py-1.5 text-xs\n text-foreground transition-colors hover:bg-hover",children:a("workspace.updateCardCopyFix")}),b.logPath&&(0,d.jsx)("div",{className:"mt-1.5 break-all text-[11px] leading-snug text-muted-foreground/80",children:a("workspace.updateCardLogHint",{path:b.logPath})})]}),x&&(0,d.jsx)("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-2 w-full rounded-md bg-primary px-2.5 py-1.5 text-xs\n text-primary-foreground transition-opacity hover:opacity-90",children:a("workspace.reloadNow")})]}),w&&(0,d.jsx)("button",{type:"button",onClick:()=>{j(!0),s||(0,l.fZ)()},"aria-label":a("common.close"),className:"-mr-1 -mt-1 rounded p-1 text-muted-foreground transition-colors hover:bg-hover",children:(0,d.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}function p({children:a}){return(0,d.jsx)(e.I18nProvider,{children:(0,d.jsx)(f.NP,{children:(0,d.jsxs)(g.tE,{children:[a,(0,d.jsx)(j,{}),(0,d.jsx)(o,{})]})})})}},5900:(a,b,c)=>{"use strict";c.d(b,{T:()=>D});var d=c(48249),e=c(98051),f=c(38368),g=c(33972),h=c(10841),i=c(99773),j=c(36513);c(55583),c(87023);var k=c(50757),l=c(27454),m=c(37752),n=c(67484),o=c(64676),p=c(83768),q=c(15466),r=c(49216);function s(a){return{type:"tableCell",children:[{type:"text",value:a}]}}let t=[c(4014).A,function(){return a=>{let b=a.children;for(let a=0;a<b.length;a++){let c=b[a];if("yaml"!==c.type)continue;let d=null;try{let a=r.Ay.load(c.value??"");a&&"object"==typeof a&&!Array.isArray(a)&&(d=a)}catch{d=null}let e=d?Object.entries(d):[];if(0===e.length){b.splice(a,1),a--;continue}let f={type:"tableRow",children:[s("Field"),s("Value")]},g=e.map(([a,b])=>({type:"tableRow",children:[s(a),s(function(a){if(null==a)return"";if("string"==typeof a)return a.replace(/\s*\n\s*/g," ").trim();if("number"==typeof a||"boolean"==typeof a)return String(a);try{return JSON.stringify(a)}catch{return String(a)}}(b))]}));b[a]={type:"table",align:["left","left"],children:[f,...g]}}}}];function u(a){return!(!a.trim()||/\n[ \t]*\n/.test(a)||a.includes("$"))}function v(a){if(!a.includes("\\(")&&!a.includes("\\["))return a;let b=[],c=a=>(b.push(a),`\u0000MATHMASK${b.length-1}\u0000`);return a.replace(/```[\s\S]*?```/g,c).replace(/~~~[\s\S]*?~~~/g,c).replace(/`[^`\n]+`/g,c).replace(/\\\[([^\u0000]*?)\\\]/g,(a,b)=>u(b)?`$$${b}$$`:a).replace(/\\\(([^\u0000]*?)\\\)/g,(a,b)=>u(b)?`$${b}$`:a).replace(/\u0000MATHMASK(\d+)\u0000/g,(a,c)=>b[+c])}let w=[...t,f.A,g.A,function(){return(a,b)=>{let c=String(b?.value??"");c&&function a(b,c){let d=b.children;if(d)for(let e=0;e<d.length;e++)c(d[e],e,b),a(d[e],c)}(a,(a,b,d)=>{var e;if("inlineMath"!==a.type)return;let f=a.position?.start?.offset,g=a.position?.end?.offset;void 0!==f&&void 0!==g&&(e=a.value??"","$$"!==c.slice(f,f+2)&&(!e||/^\s|\s$/.test(e)||/\d/.test(c[f-1]??"")||/\d/.test(c[g]??"")||0)&&(d.children[b]={type:"text",value:c.slice(f,g),position:a.position}))})}},h.jb],x=[...t,f.A,h.jb],y=[i.A,j.A],z=[i.A];function A(a){let b=[],c=a=>(b.push(a),` MASK${b.length-1} `);return a.replace(/```[\s\S]*?```/g,a=>c(a)).replace(/~~~[\s\S]*?~~~/g,a=>c(a)).replace(/^(\|.+\|)$/gm,a=>/^\|[\s:|-]+\|$/.test(a)?a:a.replace(/`([^`]*)`/g,(a,b)=>b.includes("|")?"`"+b.replace(/\|/g,"\\|")+"`":a)).replace(/ MASK(\d+) /g,(a,c)=>b[+c])}let B=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clippath","defs","ellipse","g","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan","use"]);function C(a){let b=[],c=a=>(b.push(a),`\u0000MASK${b.length-1}\u0000`);return a.replace(/```[\s\S]*?```/g,a=>c(a)).replace(/~~~[\s\S]*?~~~/g,a=>c(a)).replace(/`[^`\n]+`/g,a=>c(a)).replace(/<\/?([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(a,b)=>{let c=b.toLowerCase();return B.has(c)||c.includes("-")?a:a.replace(/</g,"&lt;").replace(/>/g,"&gt;")}).replace(/\u0000MASK(\d+)\u0000/g,(a,c)=>b[+c])}let D=(0,n.memo)(function({content:a,isUser:b=!1,isStreaming:c=!1,enableMath:f=!0,isDark:g,rehypePlugins:h,onLinkClick:i,basePath:j}){let r=(0,p.Ql)(),s=g??r?.resolvedTheme==="dark",t=(0,n.useRef)(null),u=(0,n.useMemo)(()=>({code({className:a,children:b,node:c,...e}){let f=/language-(\w+)/.exec(a||"");if(!("string"==typeof b||"number"==typeof b||Array.isArray(b)&&b.every(a=>"string"==typeof a||"number"==typeof a)))return(0,d.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent font-mono",...e,children:b});let g=String(b);if(!f&&!a&&!g.includes("\n"))return(0,d.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent font-mono",...e,children:b});let h=g.replace(/\n$/,""),i=f?.[1]||"text",j=Number(e["data-source-start"])||0,n=j?j+1:0,o=0;return(0,d.jsx)(k.A,{style:s?l.A:m.A,language:i,PreTag:"div",className:"md-figure",customStyle:{margin:"1.35em 0",borderRadius:"0.375rem",fontSize:"0.92em"},wrapLines:!0,lineProps:()=>{let a=n+o;return o++,{"data-source-start":a,"data-source-end":a,style:{display:"block"}}},children:h})},p:({children:a,node:b,...c})=>(0,d.jsx)("p",{...c,children:a}),h1:({children:a,node:b,...c})=>(0,d.jsx)("h1",{...c,children:a}),h2:({children:a,node:b,...c})=>(0,d.jsx)("h2",{...c,children:a}),h3:({children:a,node:b,...c})=>(0,d.jsx)("h3",{...c,children:a}),ul:({children:a,node:b,...c})=>(0,d.jsx)("ul",{className:"list-disc",...c,children:a}),ol:({children:a,node:b,...c})=>(0,d.jsx)("ol",{className:"list-decimal",...c,children:a}),li:({children:a,node:b,...c})=>(0,d.jsx)("li",{...c,children:a}),blockquote:({children:a,node:b,...c})=>(0,d.jsx)("blockquote",{className:"border-l-2 border-border pl-4 text-muted-foreground",...c,children:a}),a:({href:a,children:b,node:c,...e})=>(0,d.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline",...e,onClick:b=>{if(a){if(a.startsWith("#")){(0,q.O)(t.current,a.slice(1))&&b.preventDefault();return}i?.(a)&&b.preventDefault()}},children:b}),table:({children:a,node:b,...c})=>(0,d.jsx)("div",{className:"md-figure overflow-x-auto",...c,children:(0,d.jsx)("table",{className:"min-w-full border border-border",children:a})}),thead:({children:a,node:b,...c})=>(0,d.jsx)("thead",{className:"bg-accent",...c,children:a}),th:({children:a,node:b,...c})=>(0,d.jsx)("th",{className:"px-4 py-2 text-left font-semibold border-b border-border",...c,children:a}),td:({children:a,node:b,...c})=>(0,d.jsx)("td",{className:"px-4 py-2 border-b border-border",...c,children:a}),hr:({node:a,...b})=>(0,d.jsx)("hr",{className:"border-border",...b}),img:({src:a,alt:b,node:c,height:e,width:f,style:g,...h})=>{let i=j&&"string"==typeof a?(0,o.xh)(a,j):a;if(!(e||f||g))return(0,d.jsx)("img",{src:i,alt:b||"",className:"max-w-full h-auto rounded-lg my-3",...h});let k=a=>a?/^\d+$/.test(String(a))?`${a}px`:String(a):void 0,l={...g,height:k(e)??g?.height,width:k(f)??g?.width};return(0,d.jsx)("img",{src:i,alt:b||"",style:l,className:"inline-block align-middle",...h})},strong:({children:a,node:b,...c})=>(0,d.jsx)("strong",{className:"font-bold",...c,children:a}),em:({children:a,node:b,...c})=>(0,d.jsx)("em",{className:"italic",...c,children:a}),del:({children:a,node:b,...c})=>(0,d.jsx)("del",{className:"line-through",...c,children:a})}),[s,i,j]),B=f?w:x,D=f?y:z,E=(0,n.useMemo)(()=>{if(b||c)return C(a);let d=C(A(!function(a){if(/^\|[\s:|-]+\|$/m.test(a))return!1;if(/[┌┐└┘│─├┤┬┴┼╔╗╚╝║═╭╮╯╰▲▼◀▶△▽◁▷]/.test(a)||/\+[-=]{2,}\+/.test(a))return!0;let b=a.split("\n").filter(a=>/^\s*\||\|\s*$/.test(a));if(b.length>=3){let a=b.map(a=>(a.match(/\|/g)||[]).length);return!a.every(b=>b===a[0])||!(a[0]>=3)}return!1}(a)||/^```[\s\S]*```$/m.test(a.trim())?a:"```text\n"+a.trim()+"\n```"));return f?v(d):d},[a,b,c,f]),F=(0,n.useMemo)(()=>h?.length?[...D,...h]:D,[h,D]);if(b)return(0,d.jsx)("div",{className:"reading-measure whitespace-pre-wrap break-words",children:a});if(c){let b=a.lastIndexOf("\n");if(-1===b)return(0,d.jsx)("div",{className:"reading-measure whitespace-pre-wrap break-words",children:a});let c=a.slice(0,b+1),g=a.slice(b+1);return(0,d.jsxs)("div",{className:"markdown-body",ref:t,children:[(0,d.jsx)(e.oz,{remarkPlugins:B,rehypePlugins:D,components:u,children:f?v(C(A(c))):C(A(c))}),g&&(0,d.jsx)("span",{className:"md-tail whitespace-pre-wrap",children:g})]})}return(0,d.jsx)("div",{className:"markdown-body",ref:t,children:(0,d.jsx)(e.oz,{remarkPlugins:B,rehypePlugins:F,components:u,children:E})})})},6478:(a,b,c)=>{"use strict";c.d(b,{P:()=>j});var d=c(67484),e=c(44384),f=c(7833),g=c(33281),h=c(47276),i=c(35857);function j(){let{t:a}=(0,e.Bd)();return(0,d.useCallback)(async b=>{let c=await g.t4.runPromiseExit((0,h.ot)(b));if("Success"===c._tag)c.value.alreadyExists?(0,f.oR)(a("htmlApps.alreadyAdded"),"info"):((0,f.oR)(a("htmlApps.added"),"success"),(0,i.N)());else{let b="Fail"===c.cause._tag?c.cause.error:null,d=b?.cause,e=d instanceof Error?d.message:a("htmlApps.addFailed");(0,f.oR)(e,"error")}},[a])}},6612:(a,b,c)=>{"use strict";c.d(b,{TabManager:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TabManager() from the server but TabManager is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/TabManager.tsx","TabManager")},6662:(a,b,c)=>{"use strict";c.d(b,{W:()=>j});var d=c(67484),e=c(9804),f=c(79606),g=c(33281),h=c(87808),i=c(25419);function j({cwd:a}){let[b,c]=(0,d.useState)([]),[k,l]=(0,d.useState)(null),[m,n]=(0,d.useState)(new Set),[o,p]=(0,d.useState)([]),[q,r]=(0,d.useState)(null),[s,t]=(0,d.useState)(null),[u,v]=(0,d.useState)(new Set),[w,x]=(0,d.useState)(null),[y,z]=(0,d.useState)(""),[A,B]=(0,d.useState)(!1),[C,D]=(0,d.useState)(null),[E,F]=(0,d.useState)(!0),[G,H]=(0,d.useState)(!1),[I,J]=(0,d.useState)(null),K=(0,d.useRef)(null),[L,M]=(0,d.useState)(!1),[N,O]=(0,d.useState)(null),[P,Q]=(0,d.useState)("center"),[R,S]=(0,d.useState)(null),[T,U]=(0,d.useState)(null),[V,W]=(0,d.useState)(!1),[X,Y]=(0,d.useState)([]),[Z,$]=(0,d.useState)(!1),[_,aa]=(0,d.useState)(null),[ab,ac]=(0,d.useState)(null),[ad,ae]=(0,d.useState)(!0),[af,ag]=(0,d.useState)(!1),[ah,ai]=(0,d.useState)(!1),aj=(0,d.useMemo)(()=>o.map(a=>a.path).filter(Boolean),[o]),ak=(0,d.useMemo)(()=>(0,e.v3)(aj),[aj]),al=(0,d.useMemo)(()=>new Set((0,e.tW)(ak)),[ak]),am=(0,d.useMemo)(()=>y?k?(0,e.KH)(k,y,A):(0,e.q3)(b,y,A):null,[b,k,y,A]),an=w??u,ao=(0,d.useRef)(null),ap=(0,d.useCallback)(b=>{ao.current&&clearTimeout(ao.current),ao.current=setTimeout(()=>{g.t4.runFork((0,h.Ft)(a,Array.from(b)).pipe(f.sFT(a=>f.OH5(()=>console.error("Error saving expanded paths:",a))),f.NWQ(()=>f.rIH)))},500)},[a]),aq=(0,d.useCallback)(async()=>{F(!0),J(null),await g.t4.runPromise((0,h.mP)(a).pipe(f.YWq({onSuccess:a=>{a.error?J(a.error):(c(a.files??[]),a.expandedPaths&&Array.isArray(a.expandedPaths)&&v(new Set(a.expandedPaths)))},onFailure:a=>{console.error("Error loading files:",a),J("Failed to load files")}}))),F(!1)},[a]),ar=(0,d.useCallback)(()=>{g.t4.runPromise((0,h.DZ)(a).pipe(f.YWq({onSuccess:a=>{a.paths&&l(a.paths)},onFailure:a=>{console.error("Error loading file index:",a)}})))},[a]),as=(0,d.useCallback)(async b=>{n(a=>new Set([...a,b])),await g.t4.runPromise((0,h.gZ)(a,b).pipe(f.YWq({onSuccess:a=>{a.children&&c(c=>{if(!b){let b=new Map(c.map(a=>[a.path,a]));return a.children.map(a=>{let c=b.get(a.path);return c?.children&&a.isDirectory?{...a,children:c.children}:a})}let d=structuredClone(c),f=(0,e.MB)(d,b);return f&&(f.children=a.children),d})},onFailure:a=>{console.error("Error loading directory:",a)}}))),n(a=>{let c=new Set(a);return c.delete(b),c})},[a]);(0,d.useRef)(m).current=m;let at=(0,d.useCallback)(async()=>{await g.t4.runPromise((0,h.r9)(a).pipe(f.YWq({onSuccess:a=>p(a.files??[]),onFailure:a=>console.error("Error loading recent files:",a)})))},[a]),au=(0,d.useCallback)(async b=>{p(a=>{let c=a.filter(a=>a.path!==b);return[{path:b},...c].slice(0,15)}),await g.t4.runPromise((0,h.YW)(a,b).pipe(f.sFT(a=>f.OH5(()=>console.error("Error adding to recent files:",a))),f.NWQ(()=>f.rIH)))},[a]),av=(0,d.useCallback)((b,c,d,e)=>{p(a=>a.map(a=>a.path===b?{...a,scrollLine:c,cursorLine:d,cursorCol:e}:a)),g.t4.runFork((0,h.YW)(a,b,{scrollLine:c,cursorLine:d,cursorCol:e}).pipe(f.NWQ(()=>f.rIH)))},[a]),aw=(0,d.useCallback)(a=>o.find(b=>b.path===a),[o]),ax=(0,d.useCallback)(async b=>{let c=b||q;c&&($(!0),aa(null),await g.t4.runPromise((0,h.eE)(a,c).pipe(f.YWq({onSuccess:a=>{a.error?aa(a.error):Y(a.blame??[])},onFailure:a=>{console.error("Error loading blame:",a),aa("Failed to load blame info")}}))),$(!1))},[a,q]),ay=(0,d.useCallback)(async b=>{H(!0),t(null),W(!1),Y([]),aa(null),ac(null);let c=f.JkU(function*(){let c=yield*(0,h.r6)(a,b);if(!c.ok)return{type:"error",message:c.data?.error||"Failed to stat file"};let d=c.data??{};if(!d.exists)return{type:"error",message:"File not found"};if("dir"===d.kind)return{type:"error",message:"Path is a directory"};switch(d.category){case"image":return{type:"image",size:d.size,mtime:d.mtimeMs,...d.isSymlink?{isSymlink:!0,symlinkTarget:d.symlinkTarget}:{}};case"pdf":return{type:"pdf",size:d.size,mtime:d.mtimeMs,...d.isSymlink?{isSymlink:!0,symlinkTarget:d.symlinkTarget}:{}};case"binary":return{type:"binary",message:"Cannot preview binary file",size:d.size,mtime:d.mtimeMs};case"too-large":return{type:"error",message:"File too large to preview",size:d.size,mtime:d.mtimeMs};default:{let c=yield*(0,i.K)(a,b);if(409===c.status)return{type:"binary",message:c.data?.error||"Cannot preview binary file",size:d.size,mtime:d.mtimeMs};if(!c.ok)return{type:"error",message:c.data?.error||"Failed to load file"};let e=c.data??{};return{type:"text",content:e.content,size:e.size,mtime:e.mtimeMs,...e.isSymlink?{isSymlink:!0,symlinkTarget:e.symlinkTarget}:{}}}}});await g.t4.runPromise(c.pipe(f.YWq({onSuccess:a=>t(a),onFailure:a=>{console.error("Error loading file content:",a),t({type:"error",message:"Failed to load file"})}}))),au(b),ax(b),H(!1)},[a,au,ax]),az=(0,d.useCallback)(()=>{V?W(!1):(W(!0),0===X.length&&ax())},[V,X.length,ax]),aA=(0,d.useCallback)((a,b)=>{if(!a)return;if(r(a),O(b??null),null==b){let b=o.find(b=>b.path===a);b?.scrollLine?(O(b.scrollLine),Q("start"),S(b.cursorLine??null),U(b.cursorCol??null)):(Q("center"),S(null),U(null))}else Q("center"),S(null),U(null);ay(a);let c=a.split("/");if(c.length>1){let a=[];for(let b=1;b<c.length;b++)a.push(c.slice(0,b).join("/"));v(b=>{let c=new Set(b),d=!1;for(let b of a)c.has(b)||(c.add(b),d=!0);return d&&ap(c),d?c:b})}},[ay,ap,o]),aB=(0,d.useCallback)(a=>{if(w)x(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c});else{let c=!u.has(a);if(v(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),ap(c),c}),c){let c=(0,e.MB)(b,a);c&&c.isDirectory&&!c.children&&as(a)}}},[w,ap,u,b,as]);return{files:b,setFiles:c,fileIndex:k,setFileIndex:l,loadingDirs:m,expandedPaths:u,setExpandedPaths:v,searchTreeExpandedPaths:w,setSearchTreeExpandedPaths:x,effectiveExpandedPaths:an,searchQuery:y,setSearchQuery:z,searchExactMatch:A,setSearchDirExact:B,matchedPaths:am,creatingItem:C,setCreatingItem:D,isLoadingFiles:E,fileError:I,searchInputRef:K,shouldScrollToSelected:L,setShouldScrollToSelected:M,targetLineNumber:N,setTargetLineNumber:O,targetScrollAlign:P,setTargetScrollAlign:Q,initialCursorLine:R,initialCursorCol:T,setInitialCursorLine:S,setInitialCursorCol:U,selectedPath:q,setSelectedPath:r,fileContent:s,setFileContent:t,isLoadingContent:G,recentFiles:o,recentFilePaths:aj,setRecentFiles:p,recentFilesTree:ak,recentTreeDirPaths:al,showBlame:V,setShowBlame:W,blameLines:X,isLoadingBlame:Z,blameError:_,blameSelectedCommit:ab,setBlameSelectedCommit:ac,previewMarkdown:ad,setPreviewMarkdown:ae,previewHtml:af,setPreviewHtml:ag,showEditor:ah,setShowEditor:ai,saveExpandedPaths:ap,loadFiles:aq,loadFileIndex:ar,loadDirectory:as,loadRecentFiles:at,addToRecentFiles:au,updateRecentFilePosition:av,getRecentFilePosition:aw,loadFileContent:ay,loadBlame:ax,handleToggleBlame:az,handleSelectFile:aA,handleToggle:aB}}},6900:(a,b,c)=>{"use strict";c.d(b,{x:()=>m});var d=c(48249),e=c(67484),f=c(44384),g=c(7833),h=c(33281),i=c(85655),j=c(9804),k=c(57031),l=c(88214);function m({isOpen:a,onClose:b,cwd:c}){let n,{t:o}=(0,f.Bd)(),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)([]),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)(!1),N=(0,e.useCallback)((a,b)=>a?._tag==="Fail"&&a.error?.cause instanceof Error?a.error.cause.message:o(b),[o]),O=(0,e.useCallback)(async()=>{w(!0);let a=await h.t4.runPromiseExit((0,i.FK)(c));if("Success"===a._tag){let b=a.value;q(b.worktrees),s(b.nextPath),u(b.nextRandomWord),b.gitUserName&&E(b.gitUserName)}else console.error("Failed to load worktrees:",a.cause),(0,g.oR)(o("toast.worktreeLoadFailed"),"error");w(!1)},[c,o]),P=(0,e.useCallback)(a=>{let{local:b,remote:c}=a;return c.includes("origin/main")?"origin/main":c.includes("origin/master")?"origin/master":b.includes("main")?"main":b.includes("master")?"master":c.length>0?c[0]:b.length>0?b[0]:"main"},[]),Q=async()=>{if(!r)return;let a="origin/main",b=await h.t4.runPromiseExit((0,i.r4)(c));"Success"===b._tag&&(a=P(b.value));let d=t||function(){let a="bcdfghjklmnprstvwz",b=["a","e","i","o","u","ai","au","ea","ee","ia","io","oa","oo","ou","ui"],c="";for(let d=0;d<2;d++)c+=a[Math.floor(Math.random()*a.length)],c+=b[Math.floor(Math.random()*b.length)];return c}(),e=D?`${D}/${d}`:d;y(!0);let f=await h.t4.runPromiseExit((0,i.CM)({action:"add",cwd:c,path:r,newBranch:e,baseBranch:a}));"Success"===f._tag?((0,g.oR)(o("toast.worktreeCreateSuccess",{name:e}),"success"),O()):(console.error("Failed to create worktree:",f.cause),(0,g.oR)(N(f.cause,"toast.worktreeCreateFailed"),"error")),y(!1)},R=async()=>{M(!0),K(""),G(!0);let a=await h.t4.runPromiseExit((0,i.r4)(c));if("Success"===a._tag){let b=a.value,c=b.local??[],d=b.remote??[],e=new Set(p.map(a=>a.branch).filter(Boolean));I([...c.filter(a=>!e.has(a)),...d.filter(a=>!e.has(a)&&!c.includes(a.replace(/^origin\//,"")))])}else(0,g.oR)(o("toast.loadBranchFailed"),"error");M(!1)},S=async a=>{if(!r)return;G(!1),y(!0);let b=await h.t4.runPromiseExit((0,i.CM)({action:"add",cwd:c,path:r,branch:a}));"Success"===b._tag?((0,g.oR)(o("toast.worktreeCreateSuccess",{name:a}),"success"),O()):(console.error("Failed to create worktree:",b.cause),(0,g.oR)(N(b.cause,"toast.worktreeCreateFailed"),"error")),y(!1)},T=async()=>{if(!z)return;C(!0);let a=await h.t4.runPromiseExit((0,i.CM)({action:"remove",cwd:c,path:z.path}));"Success"===a._tag?((0,g.oR)(o("toast.worktreeDeleted"),"success"),A(null),O()):(console.error("Failed to delete worktree:",a.cause),(0,g.oR)(N(a.cause,"toast.worktreeDeleteFailed"),"error")),C(!1)},U=async a=>{let b=a.isLocked?"unlock":"lock",d=await h.t4.runPromiseExit((0,i.CM)({action:b,cwd:c,path:a.path}));"Success"===d._tag?((0,g.oR)(a.isLocked?o("toast.worktreeUnlocked"):o("toast.worktreeLocked"),"success"),O()):(console.error("Failed to toggle lock:",d.cause),(0,g.oR)(N(d.cause,"toast.operationFailed"),"error"))};return a?(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-scrim",onClick:b,children:(0,d.jsxs)("div",{className:"bg-card rounded-lg shadow-lv3 w-[480px] max-h-[80vh] flex flex-col",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between flex-shrink-0",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Git Worktrees"}),(0,d.jsx)("button",{onClick:b,className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:o("common.close"),children:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:v?(0,d.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,d.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):(0,d.jsx)("div",{className:"space-y-2",children:p.map(a=>{let e,f=a.path===c;return(0,d.jsxs)("div",{className:`group p-3 rounded-lg border transition-colors ${f?"border-brand bg-brand/5":"border-border hover:bg-hover cursor-pointer"}`,onClick:()=>{a.path!==c&&((0,k.F)(l.n.OpenProject,{cwd:a.path}),b())},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${f?"bg-brand":"bg-muted-foreground/30"}`}),(0,d.jsx)("span",{className:"font-medium text-foreground truncate",children:a.branch||(a.isDetached?"detached":"unknown")}),a.isLocked&&(0,d.jsx)("span",{className:"text-amber-11",title:o("git.worktree.locked"),children:"\uD83D\uDD12"}),f&&(0,d.jsxs)("span",{className:"text-xs text-brand",children:["(",o("common.current"),")"]})]}),(0,d.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:!f&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),U(a)},className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-secondary rounded transition-colors",title:a.isLocked?o("git.worktree.unlock"):o("git.worktree.lock"),children:a.isLocked?(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"})}):(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),(0,d.jsx)("button",{onClick:b=>{b.stopPropagation(),A(a)},className:"p-1.5 text-muted-foreground hover:text-red-11 hover:bg-secondary rounded transition-colors",title:o("common.delete"),children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})})]}),(0,d.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 pl-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:a.path}),null!=a.createdAt&&(e=(0,j.fw)(a.createdAt/1e3),(0,d.jsx)("span",{className:`text-xs flex-shrink-0 ${"just now"===e?"text-brand":"text-muted-foreground/70"}`,"data-tooltip":new Date(a.createdAt).toLocaleString(),children:e}))]}),a.isDetached&&(0,d.jsx)("div",{className:"mt-1 text-xs text-amber-11 pl-4",children:"(detached HEAD)"})]},a.path)})})}),F&&(0,d.jsxs)("div",{className:"border-t border-border px-4 py-3 flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,d.jsx)("input",{value:J,onChange:a=>K(a.target.value),placeholder:o("git.worktree.searchBranch"),className:"flex-1 bg-secondary text-sm text-foreground rounded px-2.5 py-1.5 outline-none",autoFocus:!0,autoComplete:"off",spellCheck:"false"}),(0,d.jsx)("button",{onClick:()=>G(!1),className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1.5",children:o("common.cancel")})]}),(0,d.jsx)("div",{className:"max-h-[200px] overflow-y-auto space-y-0.5",children:L?(0,d.jsx)("div",{className:"text-xs text-muted-foreground text-center py-4",children:o("common.loading")}):0===(n=H.filter(a=>a.toLowerCase().includes(J.toLowerCase()))).length?(0,d.jsx)("div",{className:"text-xs text-muted-foreground text-center py-4",children:o("git.worktree.noBranches")}):n.map(a=>(0,d.jsx)("button",{onClick:()=>S(a),className:"w-full text-left px-2.5 py-1.5 text-sm rounded hover:bg-hover transition-colors truncate",children:(0,d.jsx)("span",{className:`${a.startsWith("origin/")?"text-muted-foreground":"text-foreground"}`,children:a})},a))})]}),(0,d.jsxs)("div",{className:"px-4 py-3 border-t border-border flex items-center justify-between flex-shrink-0",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:o("git.worktree.count",{count:p.length})}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{onClick:R,disabled:!r||x,className:`px-3 py-1.5 text-sm rounded transition-colors ${r&&!x?"bg-secondary text-foreground hover:bg-hover":"bg-secondary text-muted-foreground cursor-not-allowed"}`,children:o("git.worktree.selectBranch")}),(0,d.jsx)("button",{onClick:Q,disabled:!r||x,className:`px-3 py-1.5 text-sm rounded transition-colors ${r&&!x?"bg-brand text-white hover:bg-brand/90":"bg-secondary text-muted-foreground cursor-not-allowed"}`,children:x?(0,d.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):o("git.worktree.addWorktree")})]})]}),z&&(0,d.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-scrim rounded-lg",onClick:()=>A(null),children:(0,d.jsxs)("div",{className:"bg-card rounded-lg shadow-lv3 w-[360px] p-4",onClick:a=>a.stopPropagation(),children:[(0,d.jsx)("div",{className:"text-sm font-medium text-foreground mb-3",children:o("git.worktree.confirmDelete")}),(0,d.jsxs)("div",{className:"text-sm text-muted-foreground mb-4",children:[(0,d.jsx)("p",{className:"mb-2",children:o("git.worktree.confirmDeleteMsg")}),(0,d.jsxs)("p",{className:"text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:o("git.worktree.path")}),(0,d.jsx)("span",{className:"text-foreground",children:z.path})]}),(0,d.jsxs)("p",{className:"text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:o("git.worktree.branch")}),(0,d.jsx)("span",{className:"text-foreground",children:z.branch||"detached"})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)("button",{onClick:()=>A(null),className:"px-3 py-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:o("common.cancel")}),(0,d.jsx)("button",{onClick:T,disabled:B,className:"px-3 py-1.5 text-sm bg-red-9 text-white rounded hover:bg-red-10 transition-colors disabled:opacity-50",children:B?(0,d.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):o("common.delete")})]})]})})]})}):null}},7031:(a,b,c)=>{"use strict";c.d(b,{H:()=>g,r:()=>h});var d=c(48249),e=c(67484);let f=(0,e.createContext)(null);function g({value:a,children:b}){return(0,d.jsx)(f.Provider,{value:a,children:b})}function h(){return(0,e.useContext)(f)}},7093:(a,b,c)=>{"use strict";c.d(b,{S:()=>g,q:()=>f});let d=[/(^|\/)__tests__\//,/(^|\/)tests?\//,/\.(test|spec)\.[^/]+$/],e=[/\.(md|mdx)$/i,/(^|\/)docs\//,/(^|\/)README[^/]*$/i,/(^|\/)LICENSE[^/]*$/i,/(^|\/)CHANGELOG[^/]*$/i];function f(a){return d.some(b=>b.test(a))?"test":e.some(b=>b.test(a))?"docs":null}function g(a){if(0===a.length)return null;let b=f(a[0]);return null===b?null:a.every(a=>f(a)===b)?b:null}},7122:(a,b,c)=>{"use strict";c.d(b,{Ee:()=>m,SU:()=>j,ft:()=>l,iN:()=>k});var d=c(48249),e=c(67484),f=c(44384),g=c(74429),h=c(7833);let i=(0,e.createContext)(null);function j({container:a,children:b}){return(0,d.jsx)(i.Provider,{value:a,children:b})}function k(){return(0,e.useContext)(i)}function l({x:a,y:b,path:c,cwd:j,isDirectory:k,onClose:m,onCreateFile:n,onDelete:o,onRefresh:p,onCopyFile:q,onPaste:r,onExplain:s,explainDisabled:t}){let{t:u}=(0,f.Bd)(),v=(0,e.useRef)(null),w=(0,e.useContext)(i),x=c.split("/").pop()||c,y=`${j}/${c}`,z=c.includes("/")?c.substring(0,c.lastIndexOf("/")):"",A=z?`${j}/${z}`:j,B=k?c:z,C=k?y:A,[D,E]=(0,e.useState)({x:0,y:0}),F=(0,e.useCallback)(async(a,b)=>{try{await navigator.clipboard.writeText(a),(0,h.oR)(u("toast.copiedName",{name:b}),"success")}catch{(0,h.oR)(u("toast.copyFailed"),"error")}m()},[m,u]),G=k?c:z,H=!!s&&!k,I=[{label:u("fileContextMenu.copyRelativePath"),value:c},{label:u("fileContextMenu.copyAbsolutePath"),value:y},{label:u("fileContextMenu.copyRelativeDirPath"),value:B||"."},{label:u("fileContextMenu.copyAbsoluteDirPath"),value:C},{label:k?u("fileContextMenu.copyFolderName"):u("fileContextMenu.copyFileName"),value:x}],J=(0,d.jsxs)("div",{ref:v,className:"absolute z-[200] bg-card border border-border rounded-lg shadow-lv2 py-1 w-fit whitespace-nowrap",style:{left:D.x,top:D.y},children:[H&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",disabled:t,title:t?u("comments.aiResponding"):void 0,onClick:()=>{m(),s(c)},children:u("explain.action")}),H&&(0,d.jsx)("div",{className:"my-1 border-t border-border"}),n&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors",onClick:()=>{m(),n(G)},children:u("fileContextMenu.createFile")}),q&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors",onClick:()=>{m(),q(c)},children:k?u("fileContextMenu.copyFolder"):u("fileContextMenu.copyFile")}),r&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors",onClick:()=>{m(),r(G)},children:u("fileContextMenu.pasteHere")}),o&&(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-destructive hover:bg-hover transition-colors",onClick:()=>{m(),o(c,k,x)},children:k?u("fileContextMenu.deleteFolder"):u("fileContextMenu.deleteFile")}),!!(n||q||r||o)&&(0,d.jsx)("div",{className:"my-1 border-t border-border"}),I.map((a,b)=>(0,d.jsx)("button",{className:"block w-full px-3 py-1.5 text-left text-sm text-foreground hover:bg-hover transition-colors",onClick:()=>F(a.value,a.label),children:a.label},b))]});return w?(0,g.createPortal)(J,w):J}function m(){let[a,b]=(0,e.useState)(null);return{contextMenu:a,showContextMenu:(0,e.useCallback)((a,c,d)=>{a.preventDefault(),a.stopPropagation(),b({x:a.clientX,y:a.clientY,path:c,isDirectory:d})},[]),hideContextMenu:(0,e.useCallback)(()=>{b(null)},[])}}},7833:(a,b,c)=>{"use strict";c.d(b,{dj:()=>h,lJ:()=>l,oR:()=>n,tE:()=>i});var d=c(48249),e=c(67484),f=c(208);let g=(0,e.createContext)(null);function h(){let a=(0,e.useContext)(g);if(!a)throw Error("useToast must be used within a ToastProvider");return a}function i({children:a}){let[b,c]=(0,e.useState)([]),f=(0,e.useCallback)((a,b="success")=>{let d=`toast-${Date.now()}`;c(c=>[...c,{id:d,message:a,type:b}])},[]),h=(0,e.useCallback)(a=>{c(b=>b.filter(b=>b.id!==a))},[]);return(0,d.jsxs)(g.Provider,{value:{showToast:f},children:[a,(0,d.jsx)(j,{toasts:b,onRemove:h})]})}function j({toasts:a,onRemove:b}){return(0,d.jsx)("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-[100] flex flex-col items-center gap-2 max-w-[26rem]",children:a.map(a=>(0,d.jsx)(k,{toast:a,onRemove:b},a.id))})}function k({toast:a,onRemove:b}){let c={success:"bg-green-9",error:"bg-red-9",info:"bg-brand"}[a.type],e={success:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),error:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),info:(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}[a.type];return(0,d.jsxs)("div",{className:`${c} text-white px-4 py-3 rounded-lg shadow-lv2 flex items-center gap-3 min-w-[200px] animate-slide-in`,style:{animation:"slideIn 0.3s ease-out"},children:[e,(0,d.jsx)("span",{className:"text-sm",children:a.message}),(0,d.jsx)("button",{onClick:()=>b(a.id),className:"ml-auto p-1 hover:bg-white/20 rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}function l(a,b){let{title:c=f.A.t("confirm.title",{defaultValue:"Confirm"}),confirmText:d=f.A.t("confirm.ok",{defaultValue:"OK"}),cancelText:e=f.A.t("confirm.cancel",{defaultValue:"Cancel"}),danger:g=!1}=b||{};return new Promise(b=>{let f=document.createElement("div");f.className="fixed inset-0 z-[200] flex items-center justify-center",f.style.animation="confirmFadeIn 0.15s ease-out";let h=a=>{f.style.animation="confirmFadeOut 0.12s ease-in",f.addEventListener("animationend",()=>{document.body.removeChild(f),b(a)},{once:!0})};f.addEventListener("mousedown",a=>{a.target===f&&h(!1)});let i=a=>{"Escape"===a.key?(a.stopPropagation(),document.removeEventListener("keydown",i,!0),h(!1)):"Enter"===a.key&&(a.stopPropagation(),document.removeEventListener("keydown",i,!0),h(!0))};document.addEventListener("keydown",i,!0),f.innerHTML=`
2
2
  <div class="fixed inset-0 bg-scrim"></div>
3
3
  <div class="relative bg-card border border-border rounded-xl shadow-lv3 p-6 max-w-sm w-full mx-4" style="animation: confirmScaleIn 0.15s ease-out">
4
4
  <div class="text-base font-medium text-foreground mb-2">${c}</div>
@@ -727,7 +727,7 @@ ${f}`),bV(h,c)}else bV(aH("chat.executedCommandFailed",{command:e,error:g.cause}
727
727
  try { if (ws) ws.close(); } catch (e) {}
728
728
  });
729
729
  })();
730
- `;function f(a){return/^([/\\]|[A-Za-z]:)/.test(a)}function g(a){return f(a)||(0,d.P)(a)}function h(a,b){let c=a.replace(/[/\\]+$/,"");return b?`${c}/${b}`:c}function i(a,b){let c,d=(c=Math.max(a.lastIndexOf("/"),a.lastIndexOf("\\")))<0?"":0===c?"/":a.slice(0,c);return g(a)?d:b?h(b,d):d}function j(a,b){return g(a)||!!b}let k="/apps/local/",l="/apps/builtin/";function m(a,b){let c=a.trim();return k+n(g(c)?c:h(b??"",c)).replace(/\\/g,"/").split("/").map(encodeURIComponent).join("/").replace(/^\//,"")}function n(a){let b=/^[A-Za-z]:/.exec(a)?.[0]??"",c=b?a.slice(b.length):a,d=/^[/\\]/.test(c),e=[];for(let a of c.split(/[/\\]/))if(a&&"."!==a){if(".."===a){e.length&&".."!==e[e.length-1]?e.pop():d||b||e.push("..");continue}e.push(a)}return b+(d||b?"/":"")+e.join("/")}let o=/^([a-z][a-z0-9+.-]*:|\/\/|\/)/i;function p(a,b,c){let d=a.trim();if(!d||o.test(d)||!j(b,c))return a;let e=f(b)?b:h(c,b),g=d.search(/[?#]/),i=g<0?d:d.slice(0,g),k=g<0?"":d.slice(g);if(!i)return a;let l=i;try{l=decodeURIComponent(i)}catch{}return m(n(h(e,l)))+k}let q=[{chip:"*.md",exts:["md"]},{chip:"*.png/jpg/gif/webp/svg",exts:["png","jpg","jpeg","gif","webp","svg"]},{chip:"*.pdf",exts:["pdf"]},{chip:"*.json",exts:["json"]},{chip:"*.csv",exts:["csv"]},{chip:"*.tsv",exts:["tsv"]}],r=RegExp(`\\.(${q.flatMap(a=>a.exts).join("|")})$`,"i"),s=q.map(a=>a.chip);function t(a){return r.test(a.trim())}function u(a,b){let c=a.trim();return l+"file-viewer/index.html?file="+encodeURIComponent(n(g(c)?c:h(b??"",c)).replace(/\\/g,"/"))}function v(a,b){try{let c=new URL(a,b);if(!c.pathname.startsWith(l)&&!c.pathname.startsWith(k))return a;return"localhost"===c.hostname&&(c.hostname="127.0.0.1"),c.toString()}catch{return a}}function w(a,b){let c=a=>JSON.stringify(a).replace(/</g,"\\u003c"),d="<script>"+e.replaceAll("__CWD__",c(b.cwd)).replaceAll("__WS_URL__",c(b.wsUrl??""))+"<\/script>",f=a.match(/<head[^>]*>/i);if(f&&void 0!==f.index){let b=f.index+f[0].length;return a.slice(0,b)+d+a.slice(b)}let g=a.match(/<html[^>]*>/i);if(g&&void 0!==g.index){let b=g.index+g[0].length;return a.slice(0,b)+d+a.slice(b)}return d+a}},65139:(a,b,c)=>{"use strict";c.d(b,{BV:()=>i,NR:()=>u,Yd:()=>x,kn:()=>j,oJ:()=>p});var d=c(48249),e=c(67484),f=c(44256),g=c(63565),h=c(92545);let i="claude-opus-5-5",j="gpt-6.1-sol",k=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"Extra High"},{id:"max",label:"Max"},{id:"ultracode",label:"Ultracode"},{id:"ultrathink",label:"Ultrathink"}],l=[{id:"claude-sonnet-5-5",label:"Claude Sonnet 5.5",effort:["low","medium","high","xhigh","max","ultracode","ultrathink"],defaultEffort:"medium"},{id:"claude-sonnet-5",label:"Claude Sonnet 5",effort:["low","medium","high","xhigh","max","ultrathink"],defaultEffort:"high"},{id:"claude-opus-5-5",label:"Claude Opus 5.5",effort:["low","medium","high","xhigh","max","ultracode","ultrathink"],defaultEffort:"medium",fast:!0},{id:"claude-opus-5",label:"Claude Opus 5",effort:["low","medium","high","xhigh","max","ultracode","ultrathink"],defaultEffort:"high",fast:!0},{id:"claude-fable-5-1",label:"Claude Fable 5.1",effort:["low","medium","high","xhigh","max","ultracode","ultrathink"],defaultEffort:"high"},{id:"claude-haiku-4-5",label:"Claude Haiku 4.5",thinking:!0}],m=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"Extra High"},{id:"max",label:"Max"},{id:"ultra",label:"Ultra"}],n=[{id:"gpt-6-astra",label:"GPT-6-Astra",reasoning:["low","medium","high","xhigh","max","ultra"],defaultReasoning:"low"},{id:"gpt-6.1-sol",label:"GPT-6.1-Sol",reasoning:["low","medium","high","xhigh","max","ultra"],defaultReasoning:"low"},{id:"gpt-6-sol",label:"GPT-6-Sol",reasoning:["low","medium","high","xhigh","max","ultra"],defaultReasoning:"medium"},{id:"gpt-6-luna",label:"GPT-6-Luna",reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"medium"},{id:"gpt-5.6-sol",label:"GPT-5.6-Sol",reasoning:["low","medium","high","xhigh","max","ultra"],defaultReasoning:"low"}];function o(a){return n.find(b=>b.id===a)?.defaultReasoning??"low"}function p(a,b){let c=n.find(b=>b.id===a)?.reasoning;return b&&(!c||c.includes(b))?b:o(a)}function q(a,b){return a.find(a=>a.id===b)?.label??b}function r(a){return l.find(b=>b.id===a)?.fast===!0}function s(a){return l.find(b=>b.id===a)?.thinking===!0}function t(a){let b=l.find(b=>b.id===a);return b?b.defaultEffort:"high"}function u(a,b){let c=l.find(b=>b.id===a),d=c?.effort;return b&&(!c||d?.includes(b))?b:t(a)}function v({value:a,selected:b,label:c,defaultValue:e,onSelect:f}){return(0,d.jsxs)("button",{type:"button",onClick:()=>f(a),className:`flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition-colors ${b?g.yI:"text-muted-foreground hover:bg-hover hover:text-foreground"}`,children:[(0,d.jsx)("span",{className:"mt-0.5",children:(0,d.jsx)(g.hG,{selected:b})}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:c}),(0,d.jsx)("span",{className:"shrink-0",children:e&&(0,d.jsx)("span",{className:"rounded bg-muted px-1.5 text-[10px] font-medium text-muted-foreground",children:"Default"})})]})}function w({title:a,selected:b,value:c,items:h,onSelect:i,icon:j,testId:k}){let l=(0,e.useRef)(null),m=(0,e.useRef)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)({top:0,left:0}),r=(0,f.F2)();return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(g.XY,{buttonRef:l,label:c,labelMaxWidth:"max-w-[180px]",title:`${a}: ${c}`,onClick:()=>{n||(()=>{let a=l.current?.getBoundingClientRect();if(!a)return;let b=r?.getBoundingClientRect(),c=b?.left??0,d=b?.top??0;q({top:a.bottom+4-d,left:a.left-c})})(),o(a=>!a)},icon:j,testId:k}),n&&(0,d.jsx)(f.ZL,{children:(0,d.jsxs)("div",{ref:m,className:`${g.ys} min-w-[190px]`,style:{top:p.top,left:p.left},children:[(0,d.jsx)("div",{className:"px-3 pb-1 text-[11px] font-medium text-muted-foreground",children:a}),(0,d.jsx)("div",{className:"flex flex-col",children:h.map(a=>(0,d.jsx)(v,{value:a.id,selected:b===a.id,label:a.label,defaultValue:a.defaultValue,onSelect:a=>{i(a),o(!1)}},a.id))})]})})]})}function x(a){let b,c,e,f=a.engine??"claude",v=a.claudeModel??i,x=t(v),y=(b=l.find(a=>a.id===v)?.effort)?b.map(a=>k.find(b=>b.id===a)??{id:a,label:a}):[],z=u(v,a.claudeEffort),A=a.claudeFastMode??!1,B=a.claudeThinking??!1,C=a.codexModel??j,D=o(C),E=(c=n.find(a=>a.id===C)?.reasoning)?c.map(a=>m.find(b=>b.id===a)??{id:a,label:a}):m,F=p(C,a.codexReasoningEffort);return"claude"!==f?(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-1","data-agent-model-traits":!0,children:[(0,d.jsx)(w,{title:"Model",selected:C,value:n.find(a=>a.id===C)?.label??(0,h.U)(C),items:n.map(a=>({id:a.id,label:a.label,defaultValue:a.id===j})),onSelect:b=>{a.onCodexModelChange?.(b),a.onCodexReasoningEffortChange?.(o(b))},icon:(0,d.jsx)(g.eV,{engine:"codex"}),testId:"codex-model-picker"}),(0,d.jsx)(w,{title:"Reasoning",selected:F,value:q(m,F),items:E.map(a=>({...a,defaultValue:a.id===D})),onSelect:b=>a.onCodexReasoningEffortChange?.(b),testId:"codex-reasoning-picker"})]}):(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-1","data-agent-model-traits":!0,children:[(0,d.jsx)(w,{title:"Model",selected:v,value:(e=l.find(a=>a.id===v))?e.label:v.startsWith("claude-")?`Claude ${(0,h.J)(v)}`:v,items:l.map(a=>({id:a.id,label:a.label,defaultValue:a.id===i})),onSelect:b=>{a.onClaudeModelChange?.(b);let c=t(b);c&&a.onClaudeEffortChange?.(c),r(b)||a.onClaudeFastModeChange?.(!1),s(b)||a.onClaudeThinkingChange?.(!1)},icon:(0,d.jsx)(g.eV,{engine:"claude"}),testId:"claude-model-picker"}),z&&y.length>0&&(0,d.jsx)(w,{title:"Reasoning",selected:z,value:q(k,z),items:y.map(a=>({...a,defaultValue:a.id===x})),onSelect:b=>a.onClaudeEffortChange?.(b),testId:"claude-reasoning-picker"}),r(v)&&(0,d.jsx)(w,{title:"Fast Mode",selected:A?"on":"off",value:A?"Fast On":"Fast Off",items:[{id:"on",label:"On"},{id:"off",label:"Off",defaultValue:!0}],onSelect:b=>a.onClaudeFastModeChange?.("on"===b),testId:"claude-fast-mode-picker"}),s(v)&&(0,d.jsx)(w,{title:"Thinking",selected:B?"on":"off",value:B?"Thinking On":"Thinking Off",items:[{id:"on",label:"On"},{id:"off",label:"Off",defaultValue:!0}],onSelect:b=>a.onClaudeThinkingChange?.("on"===b),testId:"claude-thinking-picker"})]})}},65395:(a,b,c)=>{"use strict";c.d(b,{useTabState:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call reconcileStatusTabIds() from the server but reconcileStatusTabIds is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/useTabState.ts","reconcileStatusTabIds"),(0,d.registerClientReference)(function(){throw Error("Attempted to call repairPanes() from the server but repairPanes is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/useTabState.ts","repairPanes");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call useTabState() from the server but useTabState is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/useTabState.ts","useTabState")},65484:(a,b,c)=>{"use strict";c.d(b,{Cq:()=>n,D0:()=>q,DZ:()=>i,H7:()=>o,Kl:()=>w,M5:()=>h,Or:()=>k,Q1:()=>u,QW:()=>p,Wr:()=>j,Yn:()=>r,b2:()=>v,em:()=>t,fz:()=>s,zF:()=>m});var d=c(79606),e=c(71192);let f=(a,b)=>d.$mh({try:async()=>{let c=await fetch(a,b);if(!c.ok)throw Error(`HTTP ${c.status}`);return await c.json()},catch:c=>new e.uV({message:`${b?.method??"GET"} ${a} failed`,cause:c})}),g=(a,b)=>f(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),h=()=>f("/api/settings"),i=a=>f("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),j=()=>f("/api/version"),k=()=>f("/api/extension/version"),l=a=>a?`/api/note?cwd=${encodeURIComponent(a)}`:"/api/note",m=a=>f(l(a)),n=(a,b,c)=>d.$mh({try:async()=>{let d=l(a),e=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:b,baseMtime:c})});if(409===e.status){let a=await e.json();return{conflict:!0,content:a.content??"",mtime:a.mtime}}if(!e.ok)throw Error(`HTTP ${e.status}`);return{conflict:!1,mtime:(await e.json()).mtime}},catch:b=>new e.uV({message:`POST ${l(a)} failed`,cause:b})}),o=()=>f("/api/sessions/projects"),p=a=>f(`/api/sessions/projects/${encodeURIComponent(a)}`),q=a=>f(`/api/project-settings?cwd=${encodeURIComponent(a)}`),r=a=>g("/api/project-settings",a),s=a=>f(`/api/fs/dirs?path=${encodeURIComponent(a)}`),t=a=>g("/api/open-vscode",{cwd:a}),u=a=>g("/api/open-cursor",{cwd:a}),v=a=>f(`/api/git/worktree?cwd=${encodeURIComponent(a)}`),w=a=>g("/api/git/worktree",a)},65543:(a,b,c)=>{"use strict";c.d(b,{_:()=>e});let d=new Set(["function","class","method"]);function e(a){return d.has(a.kind)}},67045:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(48249);function e({error:a,reset:b}){return(0,d.jsx)("html",{children:(0,d.jsx)("body",{children:(0,d.jsxs)("div",{style:{padding:"2rem",fontFamily:"system-ui, sans-serif"},children:[(0,d.jsx)("h2",{children:"Something went wrong"}),(0,d.jsx)("p",{style:{color:"#666"},children:a.message}),(0,d.jsx)("button",{onClick:b,style:{marginTop:"1rem",padding:"0.5rem 1rem",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #ccc",background:"#fff"},children:"Try again"})]})})})}},69424:(a,b,c)=>{"use strict";c.d(b,{$:()=>s});var d=c(48249),e=c(67484),f=c(44384),g=c(57063),h=c(7833),i=c(44256),j=c(74118),k=c(15273),l=c(46674),m=c(99941),n=c(44643),o=c(32026),p=c(11732),q=c(75513);function r(a){let b=a.input?.questions||[],c=a.input?.answers||{},d={};if(a.result)try{let b=JSON.parse(a.result);b?.answers&&(d=b.answers)}catch{}return{questions:b,answers:{...c,...d}}}function s({toolCalls:a,onClose:b}){let{t:c}=(0,f.Bd)(),t=(0,q.nH)(),[u,v]=(0,e.useState)({}),[w,x]=(0,e.useState)({}),[y,z]=(0,e.useState)({}),[A,B]=(0,e.useState)({});(0,g.E)(b);let C=a.reduce((a,b)=>{let{questions:c}=r(b);return a+c.length},0),D=Object.values(A).filter(Boolean).length,E=(0,e.useCallback)((a,b)=>{v(c=>({...c,[a]:b})),x(b=>({...b,[a]:!1}))},[]),F=(0,e.useCallback)(a=>{x(b=>{let c=!b[a];if(c){let b=y[a]||"";b&&v(c=>({...c,[a]:b}))}return{...b,[a]:c}})},[y]),G=(0,e.useCallback)((a,b)=>{z(c=>({...c,[a]:b})),b&&v(c=>({...c,[a]:b}))},[]),H=(0,e.useCallback)(a=>{B(b=>({...b,[a]:!b[a]}))},[]),I=(0,e.useCallback)(()=>{let b=D>0,d=[];return a.forEach((a,e)=>{let{questions:f}=r(a);f.forEach((a,f)=>{let g=`${e}-${f}`;if(b&&!A[g])return;let h=u[g];d.push(`Q: ${a.question}`),d.push(`A: ${h||c("askQuestion.notSelected")}`),d.push("")})}),d.join("\n").trim()},[a,u,A,D,c]),J=(0,e.useCallback)(()=>{navigator.clipboard.writeText(I()),(0,h.oR)(D>0?c("toast.copiedQA",{count:D}):c("toast.copiedAllQA"))},[I,D,c]),K=(0,e.useCallback)(()=>{t?(t.sendMessage(I()),(0,h.oR)(c("toast.sentQA")),b()):(0,h.oR)(c("askQuestion.sendNoChat"))},[t,I,b,c]),L=(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-scrim p-4",onClick:b,children:(0,d.jsxs)("div",{className:"bg-card rounded-lg shadow-lv3 w-full max-w-6xl h-[90vh] flex flex-col overflow-hidden",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground",children:c("askQuestion.title")}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c("askQuestion.nQuestions",{count:C}),D>0&&` \xb7 ${c("askQuestion.checkedN",{count:D})}`]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{onClick:K,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:D>0?c("askQuestion.sendChecked",{count:D}):c("askQuestion.sendAll"),children:(0,d.jsx)(j.A,{className:"w-4 h-4"})}),(0,d.jsx)("button",{onClick:J,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:D>0?c("askQuestion.copyChecked",{count:D}):c("askQuestion.copyAll"),children:(0,d.jsx)(k.A,{className:"w-4 h-4"})}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",children:(0,d.jsx)(l.A,{className:"w-5 h-5"})})]})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-6",children:a.map((b,e)=>{let{questions:f}=r(b);return f.map((b,g)=>{let h=`${e}-${g}`,i=u[h],j=w[h]||!1,k=A[h]||!1;return(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("button",{onClick:()=>H(h),className:"mt-0.5 flex-shrink-0 p-0.5 rounded hover:bg-hover transition-colors",title:c("askQuestion.checkToCopy"),children:k?(0,d.jsx)(m.A,{className:"w-4 h-4 text-brand"}):(0,d.jsx)(n.A,{className:"w-4 h-4 text-muted-foreground"})}),b.header&&(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-brand/10 text-brand flex-shrink-0 mt-0.5",children:b.header}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:b.question})]}),(0,d.jsxs)("div",{className:"space-y-1 ml-7",children:[b.options.map((a,b)=>{let c=i===a.label&&!j;return(0,d.jsxs)("button",{onClick:()=>E(h,a.label),className:`flex items-start gap-2 px-2.5 py-1.5 rounded-md transition-colors w-full text-left cursor-pointer hover:bg-hover ${c?"bg-brand/10 hover:bg-brand/15":""}`,children:[(0,d.jsx)("div",{className:"mt-0.5 flex-shrink-0",children:c?(0,d.jsx)(o.A,{className:"w-3.5 h-3.5 text-brand"}):(0,d.jsx)("div",{className:"w-3.5 h-3.5 rounded-full border border-muted-foreground"})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:`text-sm ${c?"text-foreground font-medium":"text-foreground"}`,children:a.label}),a.description&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:a.description})]})]},b)}),(0,d.jsxs)("button",{onClick:()=>F(h),className:`flex items-start gap-2 px-2.5 py-1.5 rounded-md transition-colors w-full text-left cursor-pointer hover:bg-hover ${j?"bg-brand/10 hover:bg-brand/15":""}`,children:[(0,d.jsx)("div",{className:"mt-0.5 flex-shrink-0",children:j?(0,d.jsx)(o.A,{className:"w-3.5 h-3.5 text-brand"}):(0,d.jsx)("div",{className:"w-3.5 h-3.5 rounded-full border border-muted-foreground"})}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(p.A,{className:"w-3.5 h-3.5 text-muted-foreground"}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:c("askQuestion.custom")})]})]}),j&&(0,d.jsx)("div",{className:"ml-6 mt-1",children:(0,d.jsx)("input",{type:"text",autoFocus:!0,value:y[h]||"",onChange:a=>G(h,a.target.value),placeholder:c("askQuestion.customPlaceholder"),className:"w-full px-3 py-1.5 text-sm bg-background border border-border rounded-md focus:outline-none focus:ring-1 focus:ring-brand text-foreground"})})]}),(e!==a.length-1||g!==f.length-1)&&(0,d.jsx)("div",{className:"border-b border-border/50 mt-3"})]},h)})})})]})});return(0,d.jsx)(i.ZL,{children:L})}},69606:(a,b,c)=>{"use strict";c.d(b,{A:()=>g});var d=c(48249),e=c(18921),f=c(60591);function g({preview:a,onClose:b,search:c,preRef:h}){return(0,d.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-scrim",onClick:b,children:(0,d.jsxs)("div",{className:"bg-card rounded-lg shadow-lv3 w-full max-w-[90%] h-[90%] flex flex-col",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border flex-shrink-0",children:[(0,d.jsx)("span",{className:"text-sm text-muted-foreground font-mono truncate",children:a.filePath}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)(e._,{search:c}),(0,d.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4 bg-secondary",children:(0,d.jsx)("pre",{ref:h,className:"whitespace-pre-wrap break-words font-mono text-foreground",style:{fontSize:"0.8125rem",lineHeight:"1.5"},children:(0,f.xb)(a.content)})})]})})}},70151:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{g:()=>ak});var e=c(48249),f=c(67484),g=c.n(f),h=c(74429),i=c(8410),j=c(44256),k=c(33281),l=c(87808),m=c(25419),n=c(85655),o=c(21538),p=c(35208),q=c(74691),r=c(60333),s=c(7833),t=c(24724),u=c(20586),v=c(7122),w=c(55287),x=c(60591),y=c(19593),z=c(64825),A=c(66400),B=c(86588),C=c(64676),D=c(6478),E=c(59865),F=c(93321),G=c(9804),H=c(73887),I=c(40893),J=c(92608),K=c(94239),L=c(29939),M=c(23860),N=c(7031),O=c(72899),P=c(25667),Q=c(57014),R=c(69606),S=c(46242),T=c(21787),U=c(94308),V=c(53036),W=c(91975),X=c(6662),Y=c(20291),Z=c(58904),$=c(61632),_=c(41357),aa=c(76855),ab=c(4857),ac=c(44384),ad=c(18921),ae=c(28797),af=c(23881),ag=c(21672),ah=c(21482),ai=c(94192),aj=a([o,P,p,H,w,Q]);[o,P,p,H,w,Q]=aj.then?(await aj)():aj;let ak=g().memo(function({onClose:a,cwd:b,initialTab:c="tree",tabSwitchTrigger:d,initialSearchQuery:g,searchQueryTrigger:aj,fileOpenRequest:ak}){let al,am,an,ao,ap,aq,ar,{t:as}=(0,ac.Bd)(),at=(0,N.r)(),au=(0,f.useCallback)(a=>{at?.sendMessage(as("explain.fileMessage",{path:a}))},[at,as]),av=(0,f.useCallback)(a=>{at?.sendMessage(as("explain.stagedFileMessage",{path:a}))},[at,as]),aw=(0,f.useCallback)(a=>{at?.sendMessage(as("explain.unstagedFileMessage",{path:a}))},[at,as]),ax=(0,D.P)(),ay=(0,E.U)(),az=(0,F.Q)(),{activeView:aA,onViewChange:aB}=(0,ai.R8)(),[aC,aD]=(0,f.useState)(c),[aE,aF]=(0,f.useState)("code"),aG=(0,f.useRef)(null),aH=(0,f.useRef)(!1),[aI,aJ]=(0,f.useState)(null),[aK,aL]=(0,f.useState)(null),[aM,aN]=(0,f.useState)(!1),aO=(0,f.useRef)(1),aP=(0,f.useRef)(null),[aQ,aR]=(0,f.useState)(null),aS=(0,f.useRef)(null),[aT,aU]=(0,f.useState)({isDirty:!1,isSaving:!1}),[aV,aW]=(0,f.useState)(!1),[aX,aY]=(0,f.useState)(null),[aZ,a$]=(0,f.useState)(null),[a_,a0]=(0,f.useState)("compact"),[a1,a2]=(0,f.useState)("unified"),[a3,a4]=(0,f.useState)("full"),[a5,a6]=(0,f.useState)("unified"),[a7,a8]=(0,f.useState)(320),a9=(0,f.useRef)(null),ba=(0,f.useCallback)(a=>{"mouse"===a.pointerType&&0===a.button&&(a.preventDefault(),a9.current={startX:a.clientX,startWidth:a7},a.currentTarget.setPointerCapture(a.pointerId))},[a7]),bb=(0,f.useCallback)(a=>{let b=a9.current;if(!b)return;let c=b.startWidth+(a.clientX-b.startX);a8(Math.min(480,Math.max(320,c)))},[]),bc=(0,f.useCallback)(a=>{a9.current&&(a9.current=null,a.currentTarget.hasPointerCapture(a.pointerId)&&a.currentTarget.releasePointerCapture(a.pointerId))},[]),bd=(0,f.useRef)(null),be=(0,ad.o)(bd),bf=(0,f.useRef)(null),bg=(0,ad.o)(bf),bh=(0,aa.Sn)(b),bi=(0,aa.Xm)(b),bj=(0,aa.po)(b),bk=(0,ab.Q)(),bl=(0,M.F)(),bm=(0,X.W)({cwd:b});(0,aa.JL)(b,bm.selectedPath);let bn=(0,f.useMemo)(()=>{let a=bm.fileContent,b=bm.selectedPath;return a&&"text"===a.type&&"string"==typeof a.content&&b&&(0,x.Hz)(b)?(0,x.xb)(a.content,x.cG):null},[bm.fileContent,bm.selectedPath]),[bo,bp]=(0,f.useState)({version:0,collapsed:!1}),bq=(0,Y.p)({cwd:b,onSearchComplete:()=>aW(!0)}),br=(0,Z.e)({cwd:b,addToRecentFiles:bm.addToRecentFiles}),bs=(0,f.useMemo)(()=>{let a=new Set;if(br.status){for(let b of br.status.staged)a.add(b.path);for(let b of br.status.unstaged)a.add(b.path)}return a},[br.status]),bt=(0,f.useMemo)(()=>{let a=new Map;if(br.status){for(let b of br.status.staged)a.set(b.path,"staged");for(let b of br.status.unstaged)a.set(b.path,"unstaged")}return a},[br.status]),bu=(0,$.y)({cwd:b,addToRecentFiles:bm.addToRecentFiles}),bv=bu.compareFileDiff,bw=bv?.filePath??"",bx=(0,f.useMemo)(()=>{if(!bv||bv.isDeleted)return;let a={content:bv.newContent,filePath:bv.filePath};return(0,x.e$)(bv.filePath)?()=>a$(a):bv.filePath.endsWith(".json")?()=>aY(a):void 0},[bv]),by=(0,f.useCallback)(()=>a$(null),[]),bz=(0,f.useCallback)(()=>aY(null),[]),bA=(0,f.useMemo)(()=>{let a=0,b=0;for(let c of bu.compareFiles)a+=c.additions,b+=c.deletions;return{additions:a,deletions:b}},[bu.compareFiles]),bB=(0,f.useCallback)(a=>{at?.sendMessage(as("worktree"===bu.compareDiffMode?"explain.compareFileWorktreeMessage":"explain.compareFileMessage",{base:bu.compareBaseBranch,path:a}))},[at,as,bu.compareBaseBranch,bu.compareDiffMode]),bC=(0,f.useRef)(!1),bD=(0,f.useCallback)(a=>{bm.setFileContent(b=>b?.type==="text"?{...b,content:a}:b),bm.showEditor||(bC.current=!0,bm.setShowEditor(!0))},[bm]),bE=(0,f.useCallback)(a=>{bm.setShowEditor(!0)},[bm]),bF=(0,f.useCallback)(async()=>{if(!bm.fileContent||"text"!==bm.fileContent.type||!bm.fileContent.content)return;let a=await k.t4.runPromiseExit((0,l.OJ)({cwd:b,path:bm.selectedPath,content:bm.fileContent.content}));try{if("Failure"===a._tag||!a.value.ok)throw Error("Failed to save file");let b=a.value.data?.mtime;b&&bm.setFileContent(a=>a?.type==="text"?{...a,mtime:b}:a),(0,s.oR)(as("toast.savedSuccess"),"success")}catch{(0,s.oR)(as("toast.saveFailed"),"error")}},[b,bm]),bG=(0,f.useCallback)(()=>{if(!bm.selectedPath)return;let a=aO.current,b=aP.current;a>0&&bm.updateRecentFilePosition(bm.selectedPath,a,b?b.cursorLine+1:a,b?b.cursorCol+1:1)},[bm]),bH=(0,f.useCallback)(async(a,b)=>{let c=a!==bm.selectedPath;if(c&&bm.showEditor){if(aT.isDirty&&(!await (0,s.lJ)(as("fileBrowser.saveBeforeSwitch"),{confirmText:as("fileBrowser.saveAndSwitch"),cancelText:as("common.cancel")})||(await aS.current?.save(),aS.current?.isDirty)))return;bm.setShowEditor(!1)}c&&bG(),bm.handleSelectFile(a,b)},[bm,bG,aT.isDirty,as]),bI=(0,f.useMemo)(()=>{let a=bq.contentSearchResults;if(0===a.length)return{files:[],expandDirs:new Set,matchMap:new Map};let b=new Map,c=[];for(let d of a)b.set(d.path,d),c.push(d.path);let d=(0,G.v3)(c),e=new Set((0,G.tW)(d));return{files:d,expandDirs:e,matchMap:b}},[bq.contentSearchResults]),[bJ,bK]=(0,f.useState)(new Set),bL=(0,f.useCallback)(a=>{bK(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),bM=(0,f.useCallback)(a=>{if(a.isDirectory)return null;let b=bI.matchMap.get(a.path);return b?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:b.matches.length}):null},[bI.matchMap]),bN=aV&&bq.contentSearchResults.length>0,[bO,bP]=(0,f.useState)("selected"),bQ=!!bm.selectedPath&&null!==(0,ae.c)(bm.selectedPath),[bR,bS]=(0,f.useState)(!1),bT=(0,f.useCallback)(async(a,c)=>{if(!bm.selectedPath||!bQ)return;let d=await bh.goToDefinition(bm.selectedPath,a,c);if(0===d.length)return;let e=d[0],f=b.endsWith("/")?b:b+"/",g=e.file.startsWith(f)?e.file.slice(f.length):e.file;bk.push({filePath:bm.selectedPath,lineNumber:aO.current}),g===bm.selectedPath?bm.setTargetLineNumber(e.line):bH(g,e.line)},[bm,b,bQ,bh,bk]),bU=(0,f.useCallback)((a,b,c,d,e)=>{a&&null!==(0,ae.c)(a)&&(bS(b),bi.onTokenMouseEnter(a,c,d,e))},[bi]),bV=(0,f.useCallback)((a,b,c)=>{bQ&&bU(bm.selectedPath,!1,a,b,c)},[bm.selectedPath,bQ,bU]),bW=(0,f.useCallback)(a=>{let c=b.endsWith("/")?b:b+"/",d=a.file.startsWith(c)?a.file.slice(c.length):a.file;bm.selectedPath&&bk.push({filePath:bm.selectedPath,lineNumber:aO.current}),d===bm.selectedPath?bm.setTargetLineNumber(a.line):bH(d,a.line)},[bm,b,bk]),bX=(0,f.useMemo)(()=>{if(!br.status)return null;let a=new Map,b=a=>{switch(a){case"modified":default:return"M";case"added":case"untracked":return"A";case"deleted":return"D";case"renamed":return"R"}};for(let c of br.status.staged)a.set(c.path,b(c.status));for(let c of br.status.unstaged)a.set(c.path,b(c.status));return a},[br.status]),bY=(0,f.useMemo)(()=>{if(!br.status)return null;let a=new Map;for(let b of br.status.staged)"renamed"===b.status&&b.oldPath&&a.set(b.path,b.oldPath);return a},[br.status]),bZ=(0,f.useCallback)(a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)},[bq.setContentSearchQuery,bq.performContentSearch]),b$=(0,_.H)({cwd:b,selectedPath:bm.selectedPath,gitStatusMap:bX,renameOldPaths:bY,isText:bm.fileContent?.type==="text",refreshKey:bm.fileContent?.mtime}),b_="tree"===aC&&b$.showDiff,b0=(0,f.useCallback)(a=>{aD(a),bm.setBlameSelectedCommit(null),"history"===a&&bu.selectedBranch&&bu.loadCommits(bu.selectedBranch)},[bm,bu.selectedBranch,bu.loadCommits]);(0,f.useCallback)(()=>{if(!bm.selectedPath)return;let a={filePath:bm.selectedPath,lineNumber:aO.current},b=bk.goBack(a);b&&(b.filePath===bm.selectedPath?bm.setTargetLineNumber(b.lineNumber):bH(b.filePath,b.lineNumber))},[bm,bk]),(0,f.useCallback)(()=>{if(!bm.selectedPath)return;let a={filePath:bm.selectedPath,lineNumber:aO.current},b=bk.goForward(a);b&&(b.filePath===bm.selectedPath?bm.setTargetLineNumber(b.lineNumber):bH(b.filePath,b.lineNumber))},[bm,bk]);let b1=(0,f.useCallback)(async a=>{let c=a.split("/").pop()||a,d=await k.t4.runPromiseExit((0,l.__)({cwd:b,path:a}));"Success"===d._tag?(0,s.oR)(as("toast.copiedName",{name:c}),"success"):(0,s.oR)(as("toast.copyFailed"),"error")},[b,as]),b2=(0,f.useCallback)(async a=>{let c=await k.t4.runPromiseExit((0,l.dt)());if("Success"!==c._tag||!c.value.path)return void(0,s.oR)(as("toast.noFileToPaste"),"info");let d=c.value.path,e=await k.t4.runPromiseExit((0,l.Nn)({cwd:b,targetDir:a,sourceAbsPath:d}));if("Success"===e._tag)(0,s.oR)(as("toast.pastedFile",{name:e.value.newName}),"success"),bm.loadDirectory(a),bm.loadFileIndex();else{let a="Fail"===e.cause._tag?e.cause.error:null,b=a?.cause,c=b instanceof Error?b.message:as("toast.pasteFailed");(0,s.oR)(c,"error")}},[b,bm,as]);(0,f.useRef)(0),(0,f.useRef)(bl),(0,f.useRef)(aC),(0,f.useRef)(!1);let b3=(0,f.useRef)(bu.selectedBranch);b3.current=bu.selectedBranch;let b4=(0,f.useRef)(bm.selectedPath);b4.current=bm.selectedPath;let b5=(0,f.useRef)(bm.fileContent?.type);b5.current=bm.fileContent?.type;let b6=(0,f.useCallback)(async a=>{try{let{data:c}=a;if(!Array.isArray(c))return;let d=c.some(a=>"git"===a.type),e=c.some(a=>"file"===a.type),f=[];if((e||d)&&(f.push(k.t4.runPromise((0,l.mP)(b)).then(a=>{a.error||bm.setFiles(b=>(0,G.HR)(a.files??[],b))}).catch(()=>{})),f.push(k.t4.runPromise((0,l.DZ)(b)).then(a=>{a.paths&&bm.setFileIndex(a.paths)}).catch(()=>{})),f.push(k.t4.runPromise((0,l.r9)(b)).then(a=>{bm.setRecentFiles(a.files??[])}).catch(()=>{}))),d||e){f.push(k.t4.runPromise((0,n.lv)(b)).then(a=>{br.setStatus(a);let b=(0,u.Do)(a.staged),c=(0,u.Do)(a.unstaged);br.setStagedTree(b),br.setUnstagedTree(c)}).catch(()=>{})),br.refreshDiff(),bu.refreshCompare(),d&&bu.loadBranches();let a=b3.current;a&&f.push(k.t4.runPromise((0,n.Bj)(b,a,G.B_)).then(a=>{let b=a.commits??[];bu.setCommits(b),bu.setHasMoreCommits(b.length>=G.B_)}).catch(()=>{}))}let g=b4.current,h=b5.current;g&&"text"===h&&f.push(k.t4.runPromise((0,m.K)(b,g)).then(a=>{let b=a.ok?a.data:null;b&&"string"==typeof b.content&&bm.setFileContent({type:"text",content:b.content,size:b.size,mtime:b.mtimeMs,...b.isSymlink?{isSymlink:!0,symlinkTarget:b.symlinkTarget}:{}})}).catch(()=>{})),await Promise.all(f)}catch(a){console.error("File watch handler error:",a)}},[b]);(0,L.h)({url:`/ws/watch?cwd=${encodeURIComponent(b)}`,onMessage:b6,enabled:bl});let b7=(0,f.useCallback)(a=>{bH(a),bm.setShouldScrollToSelected(!0),aD("tree")},[bm,bH]);(0,f.useRef)(bH),(0,f.useRef)(null);let{setPreviewMarkdown:b8,setShouldScrollToSelected:b9}=bm,ca=(0,f.useCallback)(({focalFile:a})=>a&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{onClick:c=>{c.stopPropagation(),navigator.clipboard.writeText(`${b}/${a}`),(0,s.oR)(as("common.copiedPath"))},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors flex-shrink-0",title:as("common.copyAbsPath"),children:(0,e.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),b7(a)},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors flex-shrink-0",title:as("fileBrowser.locateInTree"),children:(0,e.jsxs)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10",strokeWidth:2}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3",strokeWidth:2}),(0,e.jsx)("path",{strokeLinecap:"round",strokeWidth:2,d:"M12 2v4m0 12v4M2 12h4m12 0h4"})]})})]}),[b,b7,as]),cb=(0,f.useCallback)(({focalFile:a})=>"tree"===aC&&b$.canDiff&&a===bm.selectedPath?(0,e.jsxs)(e.Fragment,{children:[b$.showDiff&&(0,e.jsx)(q.y,{value:a3,onChange:a4}),(0,e.jsx)("button",{onClick:b$.toggleDiff,className:`px-1.5 py-0.5 text-xs rounded transition-colors ${b$.showDiff?"bg-brand text-white":"text-muted-foreground hover:bg-hover"}`,title:b$.showDiff?as("fileBrowser.exitDiff"):as("fileBrowser.viewDiff"),children:as("common.diff")})]}):null,[aC,b$.canDiff,b$.showDiff,b$.toggleDiff,bm.selectedPath,a3,as]),[cc,cd]=(0,f.useState)(null),ce=(0,f.useCallback)((a,b)=>{bm.setPreviewMarkdown(!0),b7(a),cd(b),b&&setTimeout(()=>cd(null),400)},[bm,b7]);return(0,e.jsxs)(v.SU,{container:aI,children:[(0,e.jsxs)("div",{ref:aG,className:"bg-card w-full h-full flex flex-col relative",children:[(0,e.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex-shrink-0 flex flex-col overflow-hidden",style:{width:a7},children:[(0,e.jsxs)("div",{className:"flex border-b border-border",children:[(0,e.jsx)("button",{onClick:()=>b0("tree"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"tree"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.directoryTree")}),(0,e.jsx)("button",{onClick:()=>b0("search"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"search"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.searchTab")}),(0,e.jsx)("button",{onClick:()=>b0("recent"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"recent"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.recentTab")}),(0,e.jsx)("button",{onClick:()=>b0("status"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"status"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.changesTab")}),(0,e.jsx)("button",{onClick:()=>b0("history"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"history"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.historyTab")})]}),"tree"===aC&&(0,e.jsxs)("div",{className:"p-2 border-b border-border flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"flex-1 relative",children:[(0,e.jsx)("input",{ref:bm.searchInputRef,type:"text",value:bm.searchQuery,onChange:a=>bm.setSearchQuery(a.target.value),placeholder:as("fileBrowser.searchFiles"),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),bm.searchQuery&&(0,e.jsx)("button",{onClick:()=>{bm.setSearchQuery(""),bm.searchInputRef.current?.focus()},className:"absolute right-1.5 top-1/2 -translate-y-1/2 p-0.5 text-foreground-subtle hover:text-foreground rounded-sm transition-colors",title:as("fileBrowser.clear"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("button",{onClick:()=>bm.setSearchDirExact(a=>!a),className:`px-1 py-0.5 rounded transition-colors text-xs font-mono font-bold border ${bm.searchExactMatch?"border-brand text-brand bg-brand/10":"border-transparent text-muted-foreground hover:text-foreground hover:bg-hover"}`,title:bm.searchExactMatch?as("fileBrowser.exactMatchOn"):as("fileBrowser.exactMatchOff"),children:"ab"}),(0,e.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:()=>bm.loadFiles(),className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:as("fileBrowser.refreshTree"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),(0,e.jsx)("button",{onClick:()=>bm.searchTreeExpandedPaths?bm.setSearchTreeExpandedPaths(new Set):bm.setExpandedPaths(new Set),className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:as("fileBrowser.collapseAll"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})})]})]}),"search"===aC&&(0,e.jsxs)("div",{className:"p-2 border-b border-border space-y-2",children:[(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsxs)("div",{className:"flex-1 relative",children:[(0,e.jsx)("input",{ref:bq.contentSearchInputRef,type:"text",value:bq.contentSearchQuery,onChange:a=>bq.setContentSearchQuery(a.target.value),onKeyDown:a=>{"Enter"===a.key&&bq.performContentSearch(bq.contentSearchQuery)},placeholder:as("fileBrowser.searchFileContent"),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),bq.contentSearchQuery&&(0,e.jsx)("button",{onClick:()=>{bq.setContentSearchQuery(""),bq.contentSearchInputRef.current?.focus()},className:"absolute right-1.5 top-1/2 -translate-y-1/2 p-0.5 text-foreground-subtle hover:text-foreground rounded-sm transition-colors",title:as("fileBrowser.clear"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("button",{onClick:()=>bq.performContentSearch(bq.contentSearchQuery),disabled:bq.isSearching||!bq.contentSearchQuery.trim(),className:"px-3 py-1.5 text-sm bg-brand text-white rounded hover:bg-brand/90 disabled:opacity-50 disabled:cursor-not-allowed",children:bq.isSearching?"...":as("common.search")})]}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs",children:[(0,e.jsxs)("label",{className:"flex items-center gap-1 cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:bq.searchOptions.caseSensitive,onChange:a=>bq.setSearchOptions(b=>({...b,caseSensitive:a.target.checked})),className:"w-3 h-3"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:as("fileBrowser.caseSensitive")})]}),(0,e.jsxs)("label",{className:"flex items-center gap-1 cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:bq.searchOptions.wholeWord,onChange:a=>bq.setSearchOptions(b=>({...b,wholeWord:a.target.checked})),className:"w-3 h-3"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:as("fileBrowser.wholeWord")})]}),(0,e.jsxs)("label",{className:"flex items-center gap-1 cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:bq.searchOptions.regex,onChange:a=>bq.setSearchOptions(b=>({...b,regex:a.target.checked})),className:"w-3 h-3"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:as("fileBrowser.regex")})]}),(0,e.jsx)("input",{type:"text",value:bq.searchOptions.fileType,onChange:a=>bq.setSearchOptions(b=>({...b,fileType:a.target.value})),placeholder:as("fileBrowser.fileTypes"),className:"w-24 px-2 py-0.5 text-xs border border-border rounded bg-card text-foreground"})]})]}),"history"===aC&&(0,e.jsx)("div",{className:"p-3 border-b border-border",children:bu.compareMode?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0 px-3 py-1.5 text-sm border border-border rounded bg-secondary text-foreground flex items-center gap-2",children:[(0,e.jsx)("svg",{className:"w-4 h-4 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),(0,e.jsx)("span",{className:"flex-1 min-w-0 truncate",children:bu.branches?.current||"HEAD"}),(0,e.jsx)("div",{className:"flex flex-shrink-0 items-center rounded border border-border overflow-hidden text-xs",children:["head","worktree"].map(a=>(0,e.jsx)("button",{onClick:()=>bu.setCompareDiffMode(a),className:`px-1.5 py-0.5 transition-colors ${bu.compareDiffMode===a?"bg-brand text-white":"text-muted-foreground hover:text-foreground hover:bg-hover"}`,title:as("head"===a?"fileBrowser.compareScopeHeadHint":"fileBrowser.compareScopeWorktreeHint"),children:as("head"===a?"fileBrowser.compareScopeHead":"fileBrowser.compareScopeWorktree")},a))})]}),(0,e.jsx)("button",{onClick:()=>bu.toggleCompareMode(!1),className:"flex-shrink-0 px-2.5 py-1.5 text-xs font-medium rounded-lg transition-colors bg-brand text-white",title:as("fileBrowser.compareModeOff"),children:as("fileBrowser.compareMode")})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0 pl-1",children:"vs"}),(0,e.jsx)("div",{className:"flex-1 min-w-0",children:(0,e.jsx)(U.e,{branches:bu.branches,selectedBranch:bu.compareBaseBranch,onSelect:a=>{bu.setCompareBaseBranch(a),bu.loadCompareFiles(a)},isLoading:bu.isLoadingBranches,pinnedBranches:["origin/main",...bu.upstreamBranch&&"origin/main"!==bu.upstreamBranch?[bu.upstreamBranch]:[]]})})]})]}):(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("div",{className:"flex-1 min-w-0",children:(0,e.jsx)(U.e,{branches:bu.branches,selectedBranch:bu.selectedBranch,onSelect:a=>{bu.setSelectedBranch(a)},isLoading:bu.isLoadingBranches,pinnedBranches:["origin/main",...bu.upstreamBranch&&"origin/main"!==bu.upstreamBranch?[bu.upstreamBranch]:[]]})}),(0,e.jsx)("button",{onClick:()=>bu.toggleCompareMode(!0),className:"flex-shrink-0 px-2.5 py-1.5 text-xs font-medium rounded-lg transition-colors text-muted-foreground hover:text-foreground hover:bg-hover border border-border",title:as("fileBrowser.compareModeOn"),children:as("fileBrowser.compareMode")})]})}),(0,e.jsxs)("div",{className:"flex-1 overflow-hidden flex flex-col",children:[(0,e.jsxs)("div",{className:`flex-1 flex flex-col min-h-0 ${"tree"===aC?"":"hidden"}`,children:[bm.creatingItem&&(0,e.jsxs)("div",{className:"px-2 py-1.5 border-b border-border flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:bm.creatingItem.parentPath?as("fileBrowser.createFileIn",{path:bm.creatingItem.parentPath}):as("fileBrowser.createFile")}),(0,e.jsx)("input",{type:"text",autoFocus:!0,placeholder:as("fileBrowser.fileName"),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-ring",onCompositionStart:()=>{aH.current=!0},onCompositionEnd:()=>{aH.current=!1},onKeyDown:async a=>{if("Enter"===a.key){if(aH.current)return;let c=a.target.value.trim();if(!c)return;let d=bm.creatingItem.parentPath,e=d?`${d}/${c}`:c,f=await k.t4.runPromiseExit((0,l.OJ)({cwd:b,path:e,content:""}));if("Success"===f._tag&&f.value.ok)(0,s.oR)(as("toast.createdFile",{name:c}),"success"),bm.setCreatingItem(null),bm.loadDirectory(d),bm.loadFileIndex(),d&&bm.setExpandedPaths(a=>new Set([...a,d])),bH(e);else if("Success"===f._tag){let a=f.value.data?.error;(0,s.oR)(a||as("toast.createFailed"),"error")}else(0,s.oR)(as("toast.createFailed"),"error")}else"Escape"===a.key&&bm.setCreatingItem(null)},onBlur:()=>bm.setCreatingItem(null)})]}),bm.isLoadingFiles&&0===bm.files.length?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("common.loading")}):bm.fileError?(0,e.jsx)("div",{className:"p-4 text-center text-red-11 text-sm",children:bm.fileError}):(0,e.jsx)(t.h,{files:bm.files,selectedPath:bm.selectedPath,expandedPaths:bm.effectiveExpandedPaths,matchedPaths:bm.matchedPaths,gitStatusMap:bX,loadingDirs:bm.loadingDirs,onSelect:a=>{bm.setShouldScrollToSelected(!1),bH(a)},onToggle:bm.handleToggle,cwd:b,shouldScrollToSelected:bm.shouldScrollToSelected,onScrolledToSelected:()=>bm.setShouldScrollToSelected(!1),onCreateFile:a=>bm.setCreatingItem({type:"file",parentPath:a}),onDelete:(a,b,c)=>aL({path:a,isDirectory:b,name:c}),onRefresh:()=>bm.loadFiles(),onCopyFile:b1,onPaste:b2,onExplain:at?au:void 0,explainDisabled:at?.isLoading})]}),(0,e.jsx)("div",{className:`flex-1 flex flex-col min-h-0 ${"search"===aC?"":"hidden"}`,children:bq.isSearching?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):bq.searchError?(0,e.jsx)("div",{className:"p-4 text-center text-red-11 text-sm",children:bq.searchError}):0===bq.contentSearchResults.length?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:bq.contentSearchQuery?as("fileBrowser.noContentSearchResults"):as("fileBrowser.enterKeywordToSearch")}):(0,e.jsxs)("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:[bq.searchStats&&(0,e.jsxs)("div",{className:"px-3 py-1.5 text-xs text-muted-foreground border-b border-border flex-shrink-0",children:[as("fileBrowser.nFilesNMatches",{files:bq.searchStats.totalFiles,matches:bq.searchStats.totalMatches}),bq.searchStats.truncated&&(0,e.jsxs)("span",{className:"text-amber-11 ml-1",children:["(",as("fileBrowser.resultsTruncated"),")"]})]}),(0,e.jsx)(t.h,{files:bI.files,selectedPath:bm.selectedPath,expandedPaths:bJ,onSelect:a=>{let b=bI.matchMap.get(a);bH(a,b?.matches[0]?.lineNumber),aV||aW(!0)},onToggle:bL,cwd:b,onExplain:at?au:void 0,explainDisabled:at?.isLoading,renderActions:bM,className:"flex-1 overflow-y-auto py-1 min-w-max"})]})}),(0,e.jsx)("div",{className:`flex-1 flex flex-col min-h-0 ${"recent"===aC?"":"hidden"}`,children:0===bm.recentFiles.length?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("fileBrowser.noRecentFiles")}):(0,e.jsx)(t.h,{files:bm.recentFilesTree,selectedPath:bm.selectedPath,expandedPaths:bm.recentTreeDirPaths,onSelect:bH,onToggle:G.tE,cwd:b,onExplain:at?au:void 0,explainDisabled:at?.isLoading})}),(0,e.jsx)("div",{className:`flex-1 flex flex-col min-h-0 ${"status"===aC?"":"hidden"}`,children:br.statusLoading?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):br.statusError?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center p-4",children:(0,e.jsx)("span",{className:"text-red-11 text-sm",children:br.statusError})}):(0,e.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[(0,e.jsxs)("div",{className:"border-b border-border",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-secondary",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:as("fileBrowser.stagingArea",{count:br.status?.staged.length||0})}),(0,e.jsx)("button",{onClick:()=>br.fetchStatus(),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:as("fileBrowser.refreshChanges"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]}),(br.status?.staged.length||0)>0&&(0,e.jsx)("button",{onClick:br.handleUnstageAll,className:"text-sm text-amber-11 hover:text-amber-10 hover:underline",children:as("fileBrowser.unstageAll")})]}),(0,e.jsx)(u.VO,{files:br.stagedTree,selectedPath:br.statusSelectedFile?.type==="staged"?br.statusSelectedFile.file.path:null,expandedPaths:br.stagedExpandedPaths,onSelect:a=>a.file&&br.handleStatusFileSelect(a.file,"staged"),onToggle:br.handleStagedToggle,cwd:b,showChangeClass:!0,hideIndicatorsOnHover:!0,emptyMessage:as("fileBrowser.noStagedFiles"),className:"py-1",onExplain:at?av:void 0,explainDisabled:at?.isLoading,renderActions:a=>{if(a.isDirectory){let b=(0,u.wI)(a);return 0===b.length?null:(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),br.handleUnstageFiles(b.map(a=>a.path))},className:"hidden group-hover:block p-0.5 text-amber-11 hover:text-amber-10 hover:bg-amber-9/10 dark:hover:bg-amber-9/20 rounded transition-colors",title:as("fileBrowser.unstageNFiles",{count:b.length}),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})})}return(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),br.handleUnstage(a.path)},className:"hidden group-hover:block p-0.5 text-amber-11 hover:text-amber-10 hover:bg-amber-9/10 dark:hover:bg-amber-9/20 rounded transition-colors",title:as("fileBrowser.unstageFile"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})})}})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-secondary",children:[(0,e.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:as("fileBrowser.workspace",{count:br.status?.unstaged.length||0})}),(br.status?.unstaged.length||0)>0&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("button",{onClick:br.handleDiscardAll,className:"text-sm text-red-11 hover:text-red-10 hover:underline",children:as("fileBrowser.discardAll")}),(0,e.jsx)("button",{onClick:br.handleStageAll,className:"text-sm text-green-11 hover:text-green-10 hover:underline",children:as("fileBrowser.stageAll")})]})]}),(0,e.jsx)(u.VO,{files:br.unstagedTree,selectedPath:br.statusSelectedFile?.type==="unstaged"?br.statusSelectedFile.file.path:null,expandedPaths:br.unstagedExpandedPaths,onSelect:a=>a.file&&br.handleStatusFileSelect(a.file,"unstaged"),onToggle:br.handleUnstagedToggle,cwd:b,showChangeClass:!0,hideIndicatorsOnHover:!0,emptyMessage:as("fileBrowser.noUnstagedChanges"),className:"py-1",onExplain:at?aw:void 0,explainDisabled:at?.isLoading,renderActions:a=>{if(a.isDirectory){let b=(0,u.wI)(a);if(0===b.length)return null;let c=b.map(a=>a.file).filter(Boolean);return(0,e.jsxs)("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),br.handleDiscardFiles(c)},className:"p-0.5 text-red-11 hover:text-red-10 hover:bg-red-9/10 dark:hover:bg-red-9/20 rounded transition-colors",title:as("fileBrowser.discardNFiles",{count:b.length}),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}),(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),br.handleStageFiles(b.map(a=>a.path))},className:"p-0.5 text-green-11 hover:text-green-10 hover:bg-green-9/10 dark:hover:bg-green-9/20 rounded transition-colors",title:as("fileBrowser.stageNFiles",{count:b.length}),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})}return a.file?(0,e.jsxs)("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),br.handleDiscardFile(a.file)},className:"p-0.5 text-red-11 hover:text-red-10 hover:bg-red-9/10 dark:hover:bg-red-9/20 rounded transition-colors",title:as("fileBrowser.discardChanges"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),br.handleStage(a.path)},className:"p-0.5 text-green-11 hover:text-green-10 hover:bg-green-9/10 dark:hover:bg-green-9/20 rounded transition-colors",title:as("fileBrowser.stageFile"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]}):null}})]})]})}),(0,e.jsx)("div",{className:`flex-1 flex flex-col min-h-0 ${"history"===aC?"":"hidden"}`,children:bu.historyError?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("svg",{className:"w-16 h-16 mx-auto text-foreground-faint mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),(0,e.jsx)("p",{className:"text-muted-foreground",children:bu.historyError})]})}):bu.compareMode?(0,e.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:bu.isLoadingCompareFiles?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("fileBrowser.loadingDiff")}):0===bu.compareFiles.length?(0,e.jsxs)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:[(0,e.jsx)("div",{children:as("fileBrowser.noDiffFiles")}),"head"===bu.compareDiffMode&&(0,e.jsx)("button",{onClick:()=>bu.setCompareDiffMode("worktree"),className:"mt-2 text-xs text-brand hover:underline",children:as("fileBrowser.noDiffFilesHeadHint")})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border",children:[(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:as("worktree"===bu.compareDiffMode?"fileBrowser.nFilesChangedWorktree":"fileBrowser.nFilesChanged",{count:bu.compareFiles.length,branch:bu.compareBaseBranch})}),(0,e.jsxs)("span",{className:"flex flex-shrink-0 items-center gap-1.5 text-xs tabular-nums",children:[(0,e.jsxs)("span",{className:"text-green-11",children:["+",bA.additions]}),(0,e.jsxs)("span",{className:"text-red-11",children:["-",bA.deletions]})]})]}),(0,e.jsx)(u.VO,{files:bu.compareFileTree,expandedPaths:bu.compareExpandedPaths,onToggle:bu.handleCompareToggle,selectedPath:bu.compareSelectedFile?.path||null,onSelect:a=>{a.file&&bu.handleSelectCompareFile(a.file)},cwd:b,showChanges:!0,showChangeClass:!0,onExplain:at?bB:void 0,explainDisabled:at?.isLoading})]})}):(0,e.jsx)("div",{ref:bu.commitListRef,className:"flex-1 overflow-y-auto",onScroll:bu.handleCommitListScroll,children:bu.isLoadingCommits?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("fileBrowser.loadingCommits")}):0===bu.commits.length?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("fileBrowser.noCommits")}):(0,e.jsxs)(e.Fragment,{children:[bu.commits.map(a=>(0,e.jsxs)("div",{onClick:()=>bu.handleSelectCommit(a),className:`px-3 py-2 border-b border-border cursor-pointer hover:bg-hover ${bu.selectedCommit?.hash===a.hash?"bg-brand/10":""}`,children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[a.changeClass&&(0,e.jsx)(i.N,{cls:a.changeClass}),(0,e.jsx)("span",{className:"font-mono text-xs text-brand",children:a.shortHash}),(0,e.jsxs)("span",{className:"text-xs text-foreground-subtle","data-tooltip":a.date,children:[a.relativeDate," \xb7 ",(0,G.r6)(a.date)]})]}),(0,e.jsx)("div",{className:"text-sm text-foreground truncate mt-0.5","data-tooltip":a.subject,children:a.subject}),(0,e.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:a.author})]},a.hash)),bu.isLoadingMore&&(0,e.jsx)("div",{className:"p-3 text-center",children:(0,e.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin"})}),!bu.hasMoreCommits&&bu.commits.length>0&&(0,e.jsx)("div",{className:"p-3 text-center text-xs text-foreground-subtle",children:as("fileBrowser.allLoaded",{count:bu.commits.length})})]})})})]})]}),(0,e.jsx)("div",{onPointerDown:ba,onPointerMove:bb,onPointerUp:bc,onPointerCancel:bc,className:"w-[5px] flex-shrink-0 relative cursor-col-resize group",children:(0,e.jsx)("div",{className:"absolute inset-y-0 left-1/2 -translate-x-1/2 w-px bg-border group-hover:bg-brand transition-colors"})}),(0,e.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden relative",children:[("tree"===aC||"search"===aC||"recent"===aC)&&(bm.blameSelectedCommit?(0,e.jsx)(o.n,{isOpen:!0,onClose:()=>bm.setBlameSelectedCommit(null),commit:bm.blameSelectedCommit,cwd:b,embedded:!0,initialFilePath:bm.selectedPath||void 0,onLocateInTree:b7,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):"map"===aE?b_&&b$.diff?(0,e.jsx)(P.r,{cwd:b,filePath:b$.diff.filePath,oldContent:b$.diff.oldContent,newContent:b$.diff.newContent,isNew:b$.diff.isNew,isDeleted:b$.diff.isDeleted,changedFiles:bs,fileGitStatusMap:bt,compact:"compact"===a3,enableComments:!0,onSwitchToCode:()=>aF("code"),onContentSearch:bZ,headerExtraLeft:ca,headerExtraRight:cb}):(0,e.jsx)(O.O,{cwd:b,highlightedFilePath:bm.selectedPath,changedFiles:bs,onSwitchToCode:()=>aF("code"),enableComments:!0,onContentSearch:bZ,headerExtraLeft:ca,headerExtraRight:cb}):bm.selectedPath?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"px-4 py-2 border-b border-border flex-shrink-0 flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 min-w-0",children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground truncate",children:bm.selectedPath}),(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),navigator.clipboard.writeText(`${b}/${bm.selectedPath}`),(0,s.oR)(as("common.copiedPath"))},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors flex-shrink-0",title:as("common.copyAbsPath"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),b7(bm.selectedPath)},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors flex-shrink-0",title:as("fileBrowser.locateInTree"),children:(0,e.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10",strokeWidth:2}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3",strokeWidth:2}),(0,e.jsx)("path",{strokeLinecap:"round",strokeWidth:2,d:"M12 2v4m0 12v4M2 12h4m12 0h4"})]})})]}),(0,e.jsx)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:bm.showEditor?(0,e.jsxs)(e.Fragment,{children:[aT.isDirty&&(0,e.jsx)("span",{className:"text-xs text-amber-11",children:as("fileBrowser.unsaved")}),(0,e.jsx)("button",{onClick:()=>aS.current?.save(),disabled:!aT.isDirty||aT.isSaving,className:`px-1.5 py-0.5 text-xs rounded transition-colors ${aT.isDirty&&!aT.isSaving?"bg-brand text-white hover:bg-brand/90":"bg-secondary text-muted-foreground cursor-not-allowed"}`,children:aT.isSaving?(0,e.jsx)("span",{className:"inline-block w-3 h-3 border-2 border-current border-t-transparent rounded-full animate-spin"}):as("common.save")}),(0,e.jsx)("button",{onClick:()=>aS.current?.close(),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("fileBrowser.closeEdit"),children:as("fileBrowser.closeBtn")})]}):b_?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(q.y,{value:a3,onChange:a4}),(0,e.jsx)(r.q,{value:a5,onChange:a6}),!(0,x.e$)(bm.selectedPath)&&!(0,x.aR)(bm.selectedPath)&&!(0,x.Hz)(bm.selectedPath)&&!(0,x.Zy)(bm.selectedPath)&&(0,e.jsx)("button",{onClick:()=>aF("map"),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("blockViewer.viewerToggle.toBlock"),children:as("common.codeMap")}),(0,e.jsx)("button",{onClick:b$.toggleDiff,className:"px-1.5 py-0.5 text-xs rounded transition-colors bg-brand text-white",children:as("fileBrowser.exitDiff")})]}):(0,e.jsxs)(e.Fragment,{children:["tree"===aC&&b$.canDiff&&(0,e.jsx)("button",{onClick:b$.toggleDiff,className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("fileBrowser.viewDiff"),children:as("common.diff")}),bm.fileContent?.type==="text"&&(0,x.e$)(bm.selectedPath)&&(0,e.jsx)(J.ShareReviewToggle,{content:bm.fileContent.content||"",sourceFile:bm.selectedPath&&b&&bm.selectedPath.startsWith(b)?bm.selectedPath.slice(b.endsWith("/")?b.length:b.length+1):bm.selectedPath||""}),bm.fileContent?.type==="text"&&(0,x.Hz)(bm.selectedPath)&&bm.previewMarkdown&&!bm.showBlame&&(0,e.jsx)("div",{className:"flex items-center gap-0.5 rounded border border-border overflow-hidden",children:[!0,!1].map(a=>(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),bp(b=>({version:b.version+1,collapsed:a}))},className:`px-2 py-0.5 text-xs transition-colors ${bo.collapsed===a?"bg-brand text-white":"text-muted-foreground hover:bg-hover"}`,children:as(a?"fileBrowser.collapseAllJson":"fileBrowser.expandAllJson")},String(a)))}),bm.fileContent?.type==="text"&&((0,x.e$)(bm.selectedPath)||(0,x.aR)(bm.selectedPath)||(0,x.Hz)(bm.selectedPath)||(0,x.Zy)(bm.selectedPath))&&(am=(al=(0,x.aR)(bm.selectedPath))?bm.previewHtml:bm.previewMarkdown,(0,e.jsx)("button",{onClick:()=>al?bm.setPreviewHtml(a=>!a):bm.setPreviewMarkdown(a=>!a),className:`px-1.5 py-0.5 text-xs rounded transition-colors ${am?"bg-brand text-white":"text-muted-foreground hover:bg-hover"}`,children:am?as("fileBrowser.exitPreview"):as("common.preview")})),bm.fileContent?.type==="text"&&((0,x.C_)(bm.selectedPath||"")||(0,x.OG)(bm.selectedPath||""))&&(ao=(an=bm.selectedPath||"").startsWith("/")?an:b?`${b.replace(/\/$/,"")}/${an}`:an,ap=(0,x.OG)(an),(0,e.jsx)("button",{onClick:()=>void(ap?az(ao):ay(ao)),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover flex items-center",title:as(ap?"bots.addTooltip":"skills.addTooltip"),children:(0,e.jsx)(z.A,{className:"w-3.5 h-3.5"})})),bm.fileContent?.type==="text"&&(0,x.aR)(bm.selectedPath)&&(ar=(aq=bm.selectedPath||"").startsWith("/")?aq:b?`${b.replace(/\/$/,"")}/${aq}`:aq,(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{onClick:()=>ax(ar),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover flex items-center",title:as("htmlApps.addTooltip"),children:(0,e.jsx)(z.A,{className:"w-3.5 h-3.5"})}),(0,e.jsx)("button",{onClick:()=>window.dispatchEvent(new CustomEvent("console-open-browser",{detail:{url:ar}})),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover flex items-center",title:as("common.openInConsole"),children:(0,e.jsx)(A.A,{className:"w-3.5 h-3.5"})}),(0,e.jsx)("button",{onClick:()=>{let a=(0,C.Xe)(ar);window.open((0,C.PB)(a,window.location.origin),"_blank")},className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover flex items-center",title:as("browser.openInNewWindow"),children:(0,e.jsx)(B.A,{className:"w-3.5 h-3.5"})})]})),bm.fileContent?.type==="text"&&!(bm.previewMarkdown&&((0,x.e$)(bm.selectedPath)||(0,x.Hz)(bm.selectedPath)||(0,x.Zy)(bm.selectedPath))||bm.previewHtml&&(0,x.aR)(bm.selectedPath))&&(0,e.jsx)("button",{onClick:bm.handleToggleBlame,disabled:bm.isLoadingBlame,className:`px-1.5 py-0.5 text-xs rounded transition-colors ${bm.showBlame?"bg-brand text-white":"text-muted-foreground hover:bg-hover"} disabled:opacity-50`,title:as("fileBrowser.viewBlame"),children:bm.isLoadingBlame?(0,e.jsx)("span",{className:"inline-block w-3 h-3 border border-current border-t-transparent rounded-full animate-spin"}):"Blame"}),bm.fileContent?.type==="text"&&!(bm.previewMarkdown&&((0,x.e$)(bm.selectedPath)||(0,x.Hz)(bm.selectedPath)||(0,x.Zy)(bm.selectedPath))||bm.previewHtml&&(0,x.aR)(bm.selectedPath))&&(0,e.jsx)("button",{onClick:()=>bm.setShowEditor(!0),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("fileBrowser.editFile"),children:as("common.edit")}),bm.fileContent?.type==="text"&&bm.fileContent.content&&(0,e.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(bm.fileContent.content),(0,s.oR)(as("toast.copiedFileContent"))},className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("fileBrowser.copyFileContent"),children:as("common.copy")}),bm.fileContent?.type==="text"&&!(0,x.e$)(bm.selectedPath)&&!(0,x.aR)(bm.selectedPath)&&!(0,x.Hz)(bm.selectedPath)&&!(0,x.Zy)(bm.selectedPath)&&(0,e.jsx)("button",{onClick:()=>aF("map"),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("blockViewer.viewerToggle.toBlock"),children:as("common.codeMap")})]})})]}),(0,e.jsx)("div",{className:"flex-1 overflow-hidden",children:bm.isLoadingContent?(0,e.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):bm.fileContent?"text"===bm.fileContent.type&&"string"==typeof bm.fileContent.content?b_?b$.isLoadingDiff&&!b$.diff?(0,e.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):b$.diff?"unified"===a5?(0,e.jsx)(p.xU,{oldContent:b$.diff.oldContent,newContent:b$.diff.newContent,filePath:b$.diff.filePath,cwd:b,enableComments:!0,compact:"compact"===a3,onContentSearch:bZ,onTokenHover:(a,b,c)=>bU(b$.diff?.filePath,!0,a,b,c),onTokenHoverLeave:bi.onTokenMouseLeave,onTokenHoverCancel:bi.clearHover}):(0,e.jsx)(p.xZ,{oldContent:b$.diff.oldContent,newContent:b$.diff.newContent,filePath:b$.diff.filePath,isNew:b$.diff.isNew,isDeleted:b$.diff.isDeleted,cwd:b,enableComments:!0,compact:"compact"===a3,onContentSearch:bZ,onTokenHover:(a,b,c)=>bU(b$.diff?.filePath,!0,a,b,c),onTokenHoverLeave:bi.onTokenMouseLeave,onTokenHoverCancel:bi.clearHover}):(0,e.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("p",{children:as("fileBrowser.diffLoadFailed")}),(0,e.jsx)("button",{onClick:b$.toggleDiff,className:"mt-2 text-brand hover:underline text-sm",children:as("fileBrowser.exitDiff")})]})}):bm.showBlame&&bm.blameError?(0,e.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("p",{className:"text-red-11",children:bm.blameError}),(0,e.jsx)("button",{onClick:()=>bm.setShowBlame(!1),className:"mt-2 text-brand hover:underline text-sm",children:as("fileBrowser.backToPreview")})]})}):bm.showBlame&&0===bm.blameLines.length&&bm.isLoadingBlame?(0,e.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):bm.previewMarkdown&&(0,x.Hz)(bm.selectedPath)&&!bm.showBlame?(0,e.jsxs)("div",{className:"h-full flex flex-col bg-background text-foreground",children:[(0,e.jsx)(ad._,{search:be}),(0,e.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,e.jsx)("pre",{ref:bd,className:"whitespace-pre-wrap break-words font-mono",style:{fontSize:"0.8125rem",lineHeight:"1.5"},children:(0,e.jsx)(x.d9.Provider,{value:bo,children:bn})})})]}):bm.previewMarkdown&&(0,x.Zy)(bm.selectedPath)&&!bm.showBlame?(0,e.jsx)(y.C0,{content:bm.fileContent.content,filePath:bm.selectedPath,className:"h-full"}):bm.previewMarkdown&&(0,x.e$)(bm.selectedPath)&&!bm.showBlame?(0,e.jsx)("div",{className:"h-full flex flex-col",children:(0,e.jsx)(H.M,{content:bm.fileContent.content,filePath:bm.selectedPath,cwd:b,embedded:!0,onLocalMdLink:ce,scrollToAnchor:cc})}):bm.previewHtml&&(0,x.aR)(bm.selectedPath)&&!bm.showBlame?(0,e.jsx)(I.O,{content:bm.fileContent.content,filePath:bm.selectedPath,cwd:b,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):(0,e.jsx)(w.Cv,{ref:aS,content:bm.fileContent.content,filePath:bm.selectedPath,cwd:b,enableComments:!0,scrollToLine:aQ??bm.targetLineNumber,scrollToLineAlign:null!=aQ?"start":bm.targetScrollAlign,onScrollToLineComplete:()=>{aR(null),bm.setTargetLineNumber(null)},highlightKeyword:"search"===aC?bq.contentSearchQuery:null,visibleLineRef:aO,viStateRef:aP,initialCursorLine:bm.initialCursorLine,initialCursorCol:bm.initialCursorCol,onInitialCursorSet:()=>{bm.setInitialCursorLine(null),bm.setInitialCursorCol(null)},onCmdClick:bQ?bT:void 0,onTokenHover:bQ?bV:void 0,onTokenHoverLeave:bQ?bi.onTokenMouseLeave:void 0,onTokenHoverCancel:bQ?bi.clearHover:void 0,blameLines:bm.showBlame&&bm.blameLines.length>0?bm.blameLines:void 0,inlineBlameLines:bm.blameLines.length>0?bm.blameLines:void 0,onSelectCommit:bm.setBlameSelectedCommit,editable:bm.showEditor,initialMtime:bm.fileContent.mtime,onEditorClose:a=>{bm.setShowEditor(!1),aR(a)},onSaved:()=>{let a=aO.current??1;bm.loadFileContent(bm.selectedPath),bm.setShowEditor(!1),aR(a)},onEditorStateChange:aU,viMode:!0,onContentMutate:bD,onEnterInsertMode:bE,onViSave:bF,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):"image"===bm.fileContent.type&&bm.selectedPath?(0,e.jsx)(V.I,{cwd:b,path:bm.selectedPath,refreshKey:bm.fileContent.mtime,alt:bm.selectedPath}):"pdf"===bm.fileContent.type&&bm.selectedPath?(0,e.jsx)(W.t,{cwd:b,path:bm.selectedPath,refreshKey:bm.fileContent.mtime}):(0,e.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("svg",{className:"w-16 h-16 mx-auto text-foreground-faint mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,e.jsx)("p",{children:bm.fileContent.message||as("fileBrowser.cannotPreview")})]})}):(0,e.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:as("fileBrowser.selectFileToPreview")})})]}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("svg",{className:"w-16 h-16 mx-auto text-foreground-faint mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,e.jsx)("p",{children:as("fileBrowser.selectFileToPreview")})]})})),"status"===aC&&(br.statusSelectedFile&&br.statusDiff?(0,e.jsx)(Q.m,{cwd:b,selected:br.statusSelectedFile,diff:br.statusDiff,showMarkdownPreview:br.showStatusDiffPreview,setShowMarkdownPreview:br.setShowStatusDiffPreview,changedFiles:bs,fileGitStatusMap:bt,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)},locateInTree:b7,setJsonPreview:aY,onTokenHover:(a,b,c)=>bU(br.statusDiff?.filePath,!0,a,b,c),onTokenHoverLeave:bi.onTokenMouseLeave,onTokenHoverCancel:bi.clearHover}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-foreground-subtle",children:(0,e.jsx)("span",{children:as("fileBrowser.selectFileToViewDiff")})})),"history"===aC&&!bu.historyError&&(bu.compareMode?bu.isLoadingCompareDiff?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:as("fileBrowser.loadingDiffContent")}):bu.compareFileDiff?(0,e.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden relative",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-border flex-shrink-0",children:[(0,e.jsx)(T.d,{cwd:b,filePath:bu.compareFileDiff.filePath,onLocateInTree:b7}),!(0,G.u)(bu.compareFileDiff.filePath)&&(0,e.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,e.jsx)(q.y,{value:a_,onChange:a0}),(0,e.jsx)(r.q,{value:a1,onChange:a2})]})]}),(0,e.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,G.u)(bu.compareFileDiff.filePath)?(0,e.jsx)(S.M,{cwd:b,filePath:bu.compareFileDiff.filePath,oldRev:bu.compareFileDiff.oldRev??(bu.compareFileDiff.isNew?null:bu.compareBaseBranch),newRev:"worktree"===bu.compareDiffMode?null:bu.compareFileDiff.newRev??(bu.compareFileDiff.isDeleted?null:"HEAD"),newNode:bu.compareFileDiff.newWorktree?(0,e.jsx)(V.I,{cwd:b,path:bu.compareFileDiff.filePath}):void 0}):"unified"===a1?(0,e.jsx)(p.xU,{oldContent:bu.compareFileDiff.oldContent,newContent:bu.compareFileDiff.newContent,filePath:bu.compareFileDiff.filePath,cwd:b,enableComments:!0,compact:"compact"===a_,onPreview:bx,previewLabel:bw.endsWith(".json")?as("common.readable"):as("common.preview"),onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):(0,e.jsx)(p.xZ,{oldContent:bu.compareFileDiff.oldContent,newContent:bu.compareFileDiff.newContent,filePath:bu.compareFileDiff.filePath,isNew:bu.compareFileDiff.isNew,isDeleted:bu.compareFileDiff.isDeleted,cwd:b,enableComments:!0,compact:"compact"===a_,onPreview:bx,previewLabel:bw.endsWith(".json")?as("common.readable"):as("common.preview"),onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}})}),aZ&&(0,e.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-scrim",onClick:()=>a$(null),children:(0,e.jsx)("div",{className:"bg-card rounded-lg shadow-lv3 w-full max-w-[90%] h-full flex flex-col",onClick:a=>a.stopPropagation(),children:(0,e.jsx)(H.M,{content:aZ.content,filePath:aZ.filePath,cwd:b,onClose:by})})})]}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-foreground-subtle",children:(0,e.jsx)("span",{children:bu.compareFiles.length>0?as("fileBrowser.selectFileToViewDiff"):as("fileBrowser.clickCompareToLoad")})}):bu.selectedCommit?(0,e.jsx)(o.n,{isOpen:!0,onClose:()=>bu.setSelectedCommit(null),commit:bu.selectedCommit,cwd:b,embedded:!0,onLocateInTree:b7,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-foreground-subtle",children:(0,e.jsx)("span",{children:as("fileBrowser.selectCommitToView")})})),aX&&(0,e.jsx)(R.A,{preview:aX,onClose:bz,search:bg,preRef:bf})]})]}),aM&&(0,e.jsx)(K.c,{files:bm.files,fileIndex:bm.fileIndex,recentFiles:bm.recentFilePaths,onSelectFile:a=>{bH(a),bm.setShouldScrollToSelected(!0),aD("tree")},onClose:()=>aN(!1)}),(bN||bj.visible)&&(0,e.jsxs)("div",{className:`flex ${bj.visible&&bN?"":"flex-col"}`,children:[bN&&(0,e.jsx)("div",{className:bj.visible?"flex-1 min-w-0 border-r border-border":"",children:(0,e.jsx)(ah.D,{results:bq.contentSearchResults,loading:bq.isSearching,totalMatches:bq.searchStats?.totalMatches??0,onSelect:(a,b)=>{bm.selectedPath&&bk.push({filePath:bm.selectedPath,lineNumber:aO.current}),aF("code"),bH(a,b)},onClose:()=>aW(!1),scope:bO,onScopeChange:bP,selectedPath:bm.selectedPath})}),bj.visible&&(0,e.jsx)("div",{className:bN?"flex-1 min-w-0":"",children:(0,e.jsx)(ag.D,{references:bj.references,loading:bj.loading,onSelect:bW,onClose:bj.closeReferences})})]})]}),aK&&(0,e.jsx)(j.ZL,{children:(0,e.jsx)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-scrim",onClick:()=>aL(null),children:(0,e.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-lv3 p-4 max-w-sm w-full mx-4",onClick:a=>a.stopPropagation(),children:[(0,e.jsx)("h3",{className:"text-sm font-medium text-foreground mb-2",children:as("fileBrowser.confirmDelete")}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:as("fileBrowser.confirmDeleteMessage",{name:aK.name}).split(/<\/?file>/g).map((a,b)=>1===b?(0,e.jsx)("span",{className:"font-mono text-foreground",children:a},b):a)}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)("button",{onClick:()=>aL(null),className:"px-3 py-1.5 text-sm rounded border border-border hover:bg-hover transition-colors",children:as("common.cancel")}),(0,e.jsx)("button",{onClick:async()=>{let{path:a,name:c}=aK;aL(null);let d=await k.t4.runPromiseExit((0,l.VK)({cwd:b,path:a}));if("Success"===d._tag){(0,s.oR)(as("toast.movedToTrash",{name:c}),"success");let b=a.includes("/")?a.substring(0,a.lastIndexOf("/")):"";bm.loadDirectory(b),bm.loadFileIndex(),bm.selectedPath===a&&bH("")}else{let a="Fail"===d.cause._tag?d.cause.error:null,b=a?.cause,c=b instanceof Error?b.message:as("toast.deleteFailed");(0,s.oR)(c,"error")}},className:"px-3 py-1.5 text-sm rounded bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors",children:as("common.delete")})]})]})})}),bi.hoverInfo&&aI&&(0,h.createPortal)((0,e.jsx)(af.s,{ref:bi.setTooltipEl,displayString:bi.hoverInfo.displayString,documentation:bi.hoverInfo.documentation,x:bi.hoverInfo.x,y:bi.hoverInfo.y,container:aI,onMouseEnter:bi.onCardMouseEnter,onMouseLeave:bi.onCardMouseLeave,onFindReferences:bR?void 0:()=>{let{filePath:a,line:b,column:c}=bi.hoverInfo;bi.clearHover(),bj.findReferences(a,b,c)},onSearch:a=>{bi.clearHover(),aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)},onExplain:at?a=>{let{filePath:b,line:c}=bi.hoverInfo;bi.clearHover(),at.sendMessage(as("explain.symbolMessage",{name:a,path:b,lines:String(c)}))}:void 0,explainDisabled:at?.isLoading}),aI)]})});d()}catch(a){d(a)}})},70440:(a,b,c)=>{"use strict";function d(){return[{type:"image/x-icon",sizes:"16x16",url:"/favicon.ico?a49a3c8f7b751288"}]}c.r(b),c.d(b,{default:()=>d})},70596:(a,b,c)=>{"use strict";c.d(b,{t:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({x:a,y:b,comment:c,container:h,onClose:i,onUpdateComment:j,onDeleteComment:k}){let{t:l}=(0,f.Bd)(),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(c.content),q=(0,e.useRef)(null),[r,s]=(0,e.useState)({x:0,y:0}),t=async()=>{o.trim()&&(await j(c.id,o.trim()),n(!1))},u=async()=>{await k(c.id),i()};return(0,d.jsx)("div",{ref:q,className:"absolute z-[200] w-96 bg-card border border-border rounded-lg shadow-lv2 overflow-hidden",style:{left:r.x,top:r.y},children:(0,d.jsx)("div",{className:"p-3",children:m?(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("textarea",{value:o,onChange:a=>p(a.target.value),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card resize-none focus:outline-none focus:ring-1 focus:ring-ring",rows:3,autoFocus:!0,onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||(a.preventDefault(),t()),"Escape"===a.key&&(n(!1),p(c.content))}}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{onClick:()=>{n(!1),p(c.content)},className:"px-2 py-1 text-xs text-muted-foreground hover:text-foreground",children:l("common.cancel")}),(0,d.jsx)("button",{onClick:t,className:"px-2 py-1 text-xs bg-brand text-white rounded hover:bg-brand/90",children:l("common.save")})]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:c.content}),(0,d.jsxs)("div",{className:"mt-2 flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:l("comments.lineRange",{start:c.startLine,end:c.endLine})}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)("button",{onClick:()=>n(!0),className:"p-1 rounded hover:bg-hover text-muted-foreground",title:l("common.edit"),children:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,d.jsx)("button",{onClick:u,className:"p-1 rounded hover:bg-hover text-muted-foreground hover:text-red-9",title:l("common.delete"),children:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})]})})})}},71192:(a,b,c)=>{"use strict";c.d(b,{m_:()=>f,uV:()=>e});var d=c(81218);class e extends d.rN("AppError"){}d.rN("DBError"),d.rN("WSError"),d.rN("FSError"),d.rN("AgentError"),d.rN("ValidationError");class f extends d.rN("NotFoundError"){}d.rN("PermissionError")},71697:(a,b,c)=>{"use strict";c.d(b,{V:()=>k,n:()=>j});var d=c(48249),e=c(67484),f=c(44384);c(59336);var g=c(15332);c(81608);var h=c(33281),i=c(41224);function j({value:a,onChange:b,textareaRef:c,extraCommands:d}){let[f,k]=(0,e.useState)(a.length),[l,m]=(0,e.useState)([]),[n,o]=(0,e.useState)([]),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(0),[t,u]=(0,e.useState)(()=>a.length>0),v=(0,e.useRef)(null);(0,e.useCallback)(async()=>{let a=await h.t4.runPromiseExit((0,i.l1)());if("Success"===a._tag){let b=a.value.skills??a.value;o((Array.isArray(b)?b:[]).filter(a=>a.valid&&!!a.name).map(a=>({name:`/${a.name}`,description:a.description||"",source:"skill",skillPath:a.path,argumentHint:a.argumentHint})))}else console.error("Failed to load skills:",a.cause)},[]),(0,e.useCallback)(async()=>{let a=await h.t4.runPromiseExit((0,g.jm)());"Success"===a._tag?q(a.value.flatMap(a=>a.valid?[{name:`@${a.name}`,description:a.description,source:"bot"}]:[])):console.error("Failed to load bots:",a.cause)},[]);let w=(0,e.useMemo)(()=>{let b=0===f?0:a.lastIndexOf("\n",f-1)+1,c=a.indexOf("\n",f),d=-1===c?a.length:c;return{text:a.slice(b,d),start:b,end:d}},[a,f]),x=(0,e.useMemo)(()=>{let a=w.text.match(/^\s*(\/@|\/|@)([a-zA-Z0-9-]*)$/);return a?{marker:a[1],verb:a[2].toLowerCase()}:null},[w.text]),y=(0,e.useMemo)(()=>{if(!x)return[];let{verb:a}=x,b=b=>b.name.slice(1).toLowerCase().startsWith(a);return"@"===x.marker?p.filter(b):[...(d??[]).filter(b),...l.filter(b),...n.filter(b)]},[x,d,l,n,p]),z=!t&&!!x&&y.length>0;(0,e.useRef)(a);let A=(0,e.useCallback)(a=>{k(a.selectionStart??0)},[]),B=(0,e.useCallback)(d=>{let e=x?.marker??"/",f=`${e}${d.name.slice(1)} `,g=a.slice(0,w.start),h=a.slice(w.end),i=g.length+f.length;b(g+f+h),k(i),requestAnimationFrame(()=>{let a=c.current;a&&(a.focus(),a.setSelectionRange(i,i))})},[a,w,x,b,c]),C=(0,e.useCallback)(a=>{if(a.nativeEvent.isComposing||!z||0===y.length)return!1;let b=()=>{a.preventDefault(),a.stopPropagation()};return"ArrowDown"===a.key?(b(),s(a=>(a+1)%y.length),!0):"ArrowUp"===a.key?(b(),s(a=>(a-1+y.length)%y.length),!0):"Enter"===a.key||"Tab"===a.key?(b(),B(y[r]),!0):"Escape"===a.key&&(b(),u(!0),!0)},[z,y,r,B]);return{isOpen:z,items:y,selectedIndex:r,marker:x?.marker??"/",listRef:v,selectCommand:B,handleKeyDown:C,trackCaret:A}}function k({ac:a,className:b=""}){let{t:c}=(0,f.Bd)(),{isOpen:e,items:g,selectedIndex:h,marker:i,listRef:j,selectCommand:l}=a;return e&&0!==g.length?(0,d.jsx)("div",{ref:j,className:`overflow-y-auto bg-card border border-border rounded-lg shadow-lv2 ${b}`,children:g.map((a,b)=>{let e=b>0?g[b-1]:null,f="skill"===a.source&&(!e||"skill"!==e.source),j="bot"===a.source&&(!e||"bot"!==e.source),k="builtin"===a.source&&0===b;return(0,d.jsxs)("div",{children:[k&&(0,d.jsx)("div",{className:"px-4 py-1 text-[10px] uppercase tracking-wider text-muted-foreground bg-muted/40",children:"Commands"}),f&&(0,d.jsx)("div",{className:"px-4 py-1 text-[10px] uppercase tracking-wider text-muted-foreground bg-muted/40",children:"Skills"}),j&&(0,d.jsx)("div",{className:"px-4 py-1 text-[10px] uppercase tracking-wider text-muted-foreground bg-muted/40",children:"Bots"}),(0,d.jsxs)("div",{onClick:()=>l(a),className:`px-4 py-2 cursor-pointer ${b===h?"bg-brand/10":"hover:bg-hover"}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"font-mono text-sm font-medium text-foreground",children:i+a.name.slice(1)}),(0,d.jsx)("span",{className:"flex-1 text-sm text-muted-foreground truncate",children:"builtin"===a.source?c(`commands.${a.name.slice(1)}`,{defaultValue:a.description}):a.description}),(0,d.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded ${(a=>{switch(a){case"builtin":return"bg-brand/15 text-brand dark:bg-brand/25 dark:text-teal-11";case"skill":return"bg-purple-9/15 text-purple-11 dark:bg-purple-9/25 dark:text-purple-11";case"bot":return"bg-teal-9/15 text-teal-11 dark:bg-teal-9/25 dark:text-teal-11"}})(a.source)}`,children:(a=>{switch(a){case"builtin":return c("common.builtin");case"skill":return"Skill";case"bot":return"Bot"}})(a.source)})]}),"skill"===a.source&&a.argumentHint&&(0,d.jsx)("div",{className:"font-mono text-xs text-muted-foreground mt-0.5 pl-0 truncate",children:a.argumentHint})]})]},a.name)})}):null}},72399:(a,b,c)=>{"use strict";c.d(b,{ProjectSidebar:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ProjectSidebar() from the server but ProjectSidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/ProjectSidebar.tsx","ProjectSidebar")},72529:(a,b,c)=>{"use strict";c.d(b,{m:()=>f});var d=c(48249),e=c(67484);function f({content:a,children:b,className:c}){if(c)return(0,d.jsx)("div",{"data-tooltip":a,className:c,children:b});let g=e.Children.toArray(b);if(1===g.length&&(0,e.isValidElement)(g[0])){let b=g[0];return(0,e.cloneElement)(b,{"data-tooltip":a})}return(0,d.jsx)("div",{"data-tooltip":a,style:{display:"contents"},children:b})}},72899:(a,b,c)=>{"use strict";c.d(b,{O:()=>ab});var d=c(48249),e=c(67484),f=c(44384),g=c(10316),h=c(46674),i=c(80600),j=c(69924);c(33281),c(85655),c(87808);var k=c(33982),l=c(34622),m=c(34948),n=c(26875),o=c(87148),p=c(82633);function q({kind:a,qname:b,className:c}){let e=`${(function(a,b){if("__file__"===b||"__preamble__"===b||b&&b.startsWith("__heading_"))return"text-muted-foreground/60";switch(a){case"function":case"method":return"text-violet-11";case"class":return"text-amber-11";case"interface":return"text-blue-11";default:return"text-muted-foreground/60"}})(a,b)} ${c??""}`.trim();if("__file__"===b)return(0,d.jsx)(i.A,{className:e});if("__preamble__"===b)return(0,d.jsx)(k.A,{className:e});if(b&&b.startsWith("__heading_"))return(0,d.jsx)(l.A,{className:e});switch(a){case"function":case"method":return(0,d.jsx)(m.A,{className:e});case"class":return(0,d.jsx)(n.A,{className:e});case"interface":return(0,d.jsx)(o.A,{className:e});default:return(0,d.jsx)(p.A,{className:e})}}var r=c(85984),s=c(29939);function t({cwd:a}){let{t:b}=(0,f.Bd)(),[c,g]=(0,e.useState)(null),h=(0,e.useCallback)(b=>{b?.type==="graphProgress"&&b.data&&b.data.cwd===a&&g(b.data)},[a]);(0,s.h)({url:`/ws/watch?cwd=${encodeURIComponent(a)}`,onMessage:h});let i=(0,e.useRef)("");if(c?.currentFile&&(i.current=c.currentFile),!c)return(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:b("blockViewer.fileMode.loading","Loading…")});let j=b(`blockViewer.buildProgress.${c.phase}`,u[c.phase]),k=Math.max(0,Math.min(100,Math.round(c.percent)));return(0,d.jsx)("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-8",children:(0,d.jsxs)("div",{className:"w-full max-w-md flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-baseline justify-between text-xs text-muted-foreground",children:[(0,d.jsx)("span",{children:j}),(0,d.jsx)("span",{className:"tabular-nums",children:"parsing"===c.phase&&c.filesTotal>0?`${c.filesDone} / ${c.filesTotal}`:`${k}%`})]}),(0,d.jsx)("div",{className:"h-1 w-full overflow-hidden rounded-full bg-muted",children:(0,d.jsx)("div",{className:"h-full rounded-full bg-primary transition-[width] duration-150 ease-linear",style:{width:`${k}%`}})}),(0,d.jsx)("div",{className:"h-4 truncate text-left font-mono text-[11px] leading-4 text-muted-foreground/70",dir:"rtl",title:"done"===c.phase?"":i.current,children:"done"===c.phase?"":i.current})]})})}let u={listing:"Listing files…",contexts:"Reading project config…",parsing:"Parsing files",resolving:"Resolving imports…",edges:"Building call graph…",done:"Finishing up…"};var v=c(7031),w=c(74754),x=c(91579),y=c(83768),z=c(36984),A=c(72529);function B({entries:a,onSelect:b,onClear:c}){let{t:e}=(0,f.Bd)();return(0,d.jsxs)("div",{className:"flex-1 min-h-0 bg-card flex flex-col","data-testid":"function-history-drawer",children:[(0,d.jsxs)("div",{className:"flex-shrink-0 px-2 py-1.5 border-b border-border flex items-center justify-between gap-1",children:[(0,d.jsx)("div",{className:"flex items-center text-xs text-muted-foreground font-mono min-w-0",children:(0,d.jsx)("span",{className:"truncate",children:0===a.length?e("blockViewer.history.title"):`${e("blockViewer.history.title")} \xb7 ${a.length}/15`})}),a.length>0&&(0,d.jsx)(A.m,{content:e("blockViewer.history.clear"),children:(0,d.jsx)("button",{onClick:c,className:"flex-shrink-0 text-muted-foreground hover:text-foreground p-0.5 rounded hover:bg-secondary",children:(0,d.jsx)(h.A,{className:"w-3 h-3"})})})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:0===a.length?(0,d.jsx)("div",{className:"px-3 py-4 text-[10px] text-muted-foreground/60 italic leading-relaxed",children:e("blockViewer.history.empty")}):a.map((a,c)=>{var e;let f;return(0,d.jsx)(A.m,{content:`${a.qname} \xb7 ${a.filePath}`,children:(0,d.jsxs)("button",{onClick:()=>b(a),className:"w-full text-left px-2 py-1.5 border-b border-border/50 hover:transition-colors group flex items-start gap-1.5",children:[(0,d.jsx)(q,{kind:a.kind??"unknown",qname:a.qname,className:"w-3 h-3 mt-0.5 flex-shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-xs font-mono font-medium truncate",children:a.name}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/70 truncate",children:[(f=(e=a.filePath).lastIndexOf("/"))>=0?e.slice(f+1):e,a.kind&&(0,d.jsxs)("span",{className:"ml-1 opacity-60",children:["\xb7 ",a.kind]})]})]})]})},`${a.filePath}::${a.qname}::${c}`)})})]})}function C(a,b){let c=a.filter(a=>a.filePath!==b.filePath||a.qname!==b.qname),d=[b,...c];return d.length>15?d.slice(0,15):d}var D=c(65543);function E({functions:a,counts:b,totalLines:c,currentQname:g,onSelect:h,notIndexed:i,onRebuild:j}){let{t:k}=(0,f.Bd)(),l=(0,e.useMemo)(()=>a.filter(D._),[a]);return(0,d.jsxs)("div",{className:"flex-1 min-h-0 bg-card flex flex-col","data-testid":"file-toc-section",children:[(0,d.jsxs)("div",{className:"flex-shrink-0 px-2 py-1.5 border-b border-border text-xs text-muted-foreground font-mono truncate",children:[k("blockViewer.toc.title"),l.length>0&&` \xb7 ${l.length}`,null!=c&&` \xb7 ${c} ${k("common.lines")}`]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:0===l.length?i?(0,d.jsxs)("div",{className:"px-3 py-4 text-[10px] text-muted-foreground/80 leading-relaxed flex flex-col gap-2",children:[(0,d.jsx)("span",{className:"italic",children:k("blockViewer.toc.notIndexed")}),j&&(0,d.jsx)("button",{type:"button",onClick:j,className:"self-start px-2 py-1 rounded border border-border bg-secondary/60 hover:bg-secondary text-[10px] text-foreground transition-colors",children:k("blockViewer.refresh")})]}):(0,d.jsx)("div",{className:"px-3 py-4 text-[10px] text-muted-foreground/60 italic leading-relaxed",children:k("blockViewer.toc.empty")}):l.map(a=>{let c=g===a.qualifiedName,e=b?.get(a.qualifiedName),f=e?[e.in>0&&["in",e.in,"text-amber-11/80"],e.out>0&&["out",e.out,"text-green-11/80"],e.self>0&&["self",e.self,"text-muted-foreground/60"]].filter(Boolean):[];return(0,d.jsx)(A.m,{content:`${a.qualifiedName} \xb7 L${a.startLine}`,children:(0,d.jsxs)("button",{onClick:()=>h(a.qualifiedName,a.startLine),className:`w-full text-left px-2 py-1 transition-colors flex items-start gap-1.5 min-w-0 ${c?"bg-brand/15 hover:bg-brand/20":"hover:bg-secondary/60"}`,children:[(0,d.jsx)(q,{kind:a.kind,qname:a.qualifiedName,className:"w-3 h-3 flex-shrink-0 mt-0.5"}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1.5 min-w-0",children:[(0,d.jsx)("span",{className:`flex-1 min-w-0 text-xs font-mono truncate ${c?"font-semibold text-brand":""}`,children:a.name}),(0,d.jsx)("span",{className:"flex-shrink-0 text-[10px] text-muted-foreground/50 tabular-nums",children:a.endLine-a.startLine+1})]}),f.length>0&&(0,d.jsx)("span",{className:"block text-[10px] font-mono truncate",children:f.map(([a,b,c],e)=>(0,d.jsxs)("span",{className:c,children:[e>0&&(0,d.jsx)("span",{className:"text-muted-foreground/30",children:" \xb7 "}),a," ",b]},a))})]})]})},a.qualifiedName)})})]})}var F=c(37690),G=c(22341);function H({comments:a,startLine:b,endLine:c,lineHeight:e,bodyTopOffset:f,rowOf:g,onCommentClick:h}){let i=new Map;for(let d of a){if(d.endLine<b||d.endLine>c)continue;let a=i.get(d.endLine);a?a.push(d):i.set(d.endLine,[d])}return 0===i.size?null:(0,d.jsx)("div",{className:"absolute top-0 right-0 bottom-0 w-6 pointer-events-none",children:Array.from(i.entries()).map(([a,c])=>{let i=g?g(a):a-b,j=c[0],k=c.length-1;return(0,d.jsx)(A.m,{content:1===c.length?j.content:`${c.length} comments — click to view`,children:(0,d.jsxs)("button",{onClick:a=>h(j,a),className:"pointer-events-auto absolute right-1 w-4 h-4 rounded-full bg-amber-9/70 hover:bg-amber-11 text-white flex items-center justify-center shadow-lv1 transition-colors",style:{top:`${f+i*e+e/2-8}px`},children:[(0,d.jsx)(G.A,{className:"w-2.5 h-2.5"}),k>0&&(0,d.jsx)("span",{className:"absolute -top-1 -right-1 bg-amber-11 text-white rounded-full text-[8px] leading-none w-3 h-3 flex items-center justify-center",children:k+1})]})},a)})})}function I(a,b){for(let c=0;c<a.blocks.length;c++){let d=a.blocks[c];if(b>=d.startLine&&b<=d.endLine)return a.prefix[c]+(b-d.startLine)}return null}function J({addedLines:a,blockRanges:b,viewportRange:c,onJumpToLine:f}){let g,h=(0,e.useRef)(null),i=(0,e.useMemo)(()=>(function(a){let b=[...a].sort((a,b)=>a.startLine-b.startLine),c=[0];for(let a of b){let b=Math.max(0,a.endLine-a.startLine+1);c.push(c[c.length-1]+b)}return{blocks:b,prefix:c,total:c[c.length-1]}})(b),[b]),j=(0,e.useMemo)(()=>{if(i.total<=0||0===a.size)return[];let b=[];for(let c of a){let a=i.blocks.find(a=>c>=a.startLine&&c<=a.endLine);a&&b.push({line:c,qname:a.qname})}b.sort((a,b)=>a.line-b.line);let c=[],d=null;for(let a of b)d&&a.line===d.end+1&&a.qname===d.qname?d.end=a.line:(d&&c.push(d),d={start:a.line,end:a.line,qname:a.qname});return d&&c.push(d),c},[a,i]);if(i.total<=0)return null;let k=(a,b)=>{let c=I(i,a),d=I(i,b);return null===c||null===d?null:{top:c/i.total*100,heightPct:(d-c+1)/i.total*100}};return(0,d.jsxs)("div",{ref:h,onClick:a=>{let b=h.current;if(!b)return;let c=b.getBoundingClientRect();if(c.height<=0)return;let d=function(a,b){if(a.total<=0)return null;let c=Math.max(0,Math.min(a.total-1,b));for(let b=0;b<a.blocks.length;b++){let d=a.prefix[b],e=a.prefix[b+1];if(c>=d&&c<e){let e=a.blocks[b];return{qname:e.qname,line:e.startLine+Math.round(c-d)}}}return null}(i,(a.clientY-c.top)/c.height*i.total);if(!d)return;let e=d.line,g=j.find(a=>a.qname===d.qname&&e>=a.start&&e<=a.end);if(g)return void f(g.qname,e);if(j.length>0){let a=Math.max(2,Math.round(.05*i.total)),b=I(i,e);if(null!==b){let c=null,d=1/0;for(let a of j){let e=I(i,a.start),f=I(i,a.end);if(null===e||null===f)continue;let g=b<e?e-b:b>f?b-f:0;g<d&&(c=a,d=g)}if(c&&d<=a){let a=e<c.start?c.start:e>c.end?c.end:e;f(c.qname,a);return}}}let k=i.blocks.find(a=>a.qname===d.qname);k&&f(k.qname,k.startLine)},className:"w-4 flex-shrink-0 bg-secondary border-l border-border relative cursor-pointer",title:"Diff minimap — click to jump",children:[j.map(a=>{let b=k(a.start,a.end);return b?(0,d.jsx)("div",{className:"absolute left-0 right-0 bg-green-9 pointer-events-none",style:{top:`${b.top}%`,height:`${b.heightPct}%`,minHeight:"2px"}},`run:${a.qname}:${a.start}-${a.end}`):null}),c&&c.end>=c.start&&((g=k(c.start,c.end))?(0,d.jsx)("div",{className:"absolute left-0 right-0 bg-muted/60 border-y border-border pointer-events-none",style:{top:`${g.top}%`,height:`${Math.max(1.2,g.heightPct)}%`}}):null)]})}var K=c(73414),L=c(41051),M=c(42140),N=c(70596);function O(a){let b=a.lastIndexOf("/");return b>=0?a.slice(b+1):a}function P(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let Q="flex-shrink-0 h-4 leading-4 px-1.5 rounded text-[10px] text-brand hover:bg-brand/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent";function R({symbol:a,fileSource:b,hasChange:c,onHighlighted:g,comments:h,onCommentClick:i,addedLines:j,upstream:k,downstream:l,fold:m,onExpandGap:n}){let{resolvedTheme:o}=(0,y.DP)(),{t:p}=(0,f.Bd)(),r=(0,v.r)(),s=(k?.length??0)+(l?.length??0)>0;(0,e.useMemo)(()=>(0,z.sQ)(a.filePath),[a.filePath]);let[t,u]=(0,e.useState)(null),[w,x]=(0,e.useState)(null),A=(0,e.useMemo)(()=>{if(!t)return null;let b=b=>{let c=t[b-a.startLine]??"",d=j?.has(b)?" bg-green-9/15":"";return`<div class="flex${d}" style="min-width:max-content" data-line="${b}"><span class="select-none pr-3 text-muted-foreground/60 tabular-nums" style="min-width:3.2rem;text-align:right">${b}</span><span class="whitespace-pre">${c}</span></div>`};return m?m.segments.map(a=>{if("gap"===a.kind){var c;let b,d,e;return c=a.startLine,d=P(p("diffViewer.gap.hidden",{count:b=a.endLine-c+1})),e=P(p("diffViewer.gap.expandAll",{count:b})),`<div class="flex items-center cursor-pointer select-none hover:bg-hover" style="min-width:max-content;height:${U}px" data-fold-gap="${c}" title="${e}"><span class="select-none pr-3 text-muted-foreground/40" style="min-width:3.2rem;text-align:right">⋯</span><span class="text-[10px] text-muted-foreground/60 whitespace-pre">${d}</span></div>`}let d="";for(let c=a.startLine;c<=a.endLine;c++)d+=b(c);return d}).join(""):t.map((c,d)=>b(a.startLine+d)).join("")},[t,m,j,a.startLine,p]),B=(0,e.useCallback)(b=>{if(!n)return;let c=b.target,d=c?.closest?.("[data-fold-gap]");if(!d)return;let e=Number(d.getAttribute("data-fold-gap"));Number.isFinite(e)&&n(a.qualifiedName,e)},[n,a.qualifiedName]);return(0,d.jsxs)("div",{className:"flex-1 min-w-0 bg-card border border-border rounded overflow-hidden relative",children:[(0,d.jsxs)("div",{"data-block-header":!0,className:"flex items-center gap-1.5 px-2 py-1.5 border-b border-border text-xs",children:[(0,d.jsx)(q,{kind:a.kind,qname:a.qualifiedName,className:"w-3.5 h-3.5 flex-shrink-0"}),!a.qualifiedName.startsWith("__code_")&&(0,d.jsxs)("span",{className:"font-mono truncate min-w-0",children:[(0,d.jsx)("span",{className:"font-medium",children:a.name}),void 0!==a.params&&(0,d.jsxs)("span",{className:"text-muted-foreground/80",children:["(",a.params.join(", "),")"]})]}),(0,d.jsxs)("span",{className:"text-[10px] text-muted-foreground/70 flex-shrink-0",children:["unknown"!==a.kind&&`${a.kind} \xb7 `,a.endLine-a.startLine+1," ",p("common.lines")]}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>r.sendMessage(p("explain.symbolMessage",{name:a.name,path:a.filePath,lines:`${a.startLine}-${a.endLine}`})),disabled:r.isLoading,title:r.isLoading?p("comments.aiResponding"):void 0,className:Q,children:p("explain.action")}),s&&(0,d.jsx)("button",{onClick:()=>r.sendMessage(p("deps.symbolMessage",{name:a.name,path:a.filePath,lines:`${a.startLine}-${a.endLine}`,...function(a,b,c){let d=a=>{switch(a.kind){case"cross":case"self":return`${a.external.name} (${a.external.filePath})`;case"method":return`${a.receiverName}.${a.methodName}()`;case"ext":return null}},e=a=>{let b=a.map(d).filter(a=>null!==a);return b.length?b.join(", "):c},f=new Map;for(let a of b){if("ext"!==a.kind)continue;let b=f.get(a.packageSpec);b?b.push(a.name):f.set(a.packageSpec,[a.name])}let g=[...f].map(([a,b])=>`${a} (${b.join(", ")})`);return{callers:e(a),callees:e(b),externals:g.length?g.join("; "):c}}(k??[],l??[],p("deps.none"))})),disabled:r.isLoading,title:r.isLoading?p("comments.aiResponding"):void 0,className:Q,children:p("deps.action")})]}),(0,d.jsx)("span",{className:"flex-1"}),c&&(0,d.jsx)("span",{className:"flex-shrink-0 w-2 h-2 rounded-full bg-amber-11","data-tooltip":"File has uncommitted change"})]}),(0,d.jsxs)("div",{"data-block-body":!0,className:"text-[11px] font-mono px-2 py-2 overflow-auto",style:{lineHeight:`${U}px`},onClick:B,children:[!b&&(0,d.jsx)("span",{className:"text-muted-foreground",children:"Loading…"}),w&&(0,d.jsx)("span",{className:"text-red-11",children:w}),A&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:A}})]}),h&&h.length>0&&i&&(0,d.jsx)(H,{comments:h,startLine:a.startLine,endLine:a.endLine,lineHeight:U,bodyTopOffset:V+W,rowOf:m?.rowOf,onCommentClick:i})]})}function S({side:a,pin:b,accent:c,onClick:e}){let f,g,h,i,j,k,l,m=b.lines.length;"ext"===b.kind?(f="bg-secondary/30 border-border/50 hover:border-muted-foreground/60",g="ext",h="text-muted-foreground/60",i=b.name,j=b.packageSpec,k="external",l=b.packageSpec):"method"===b.kind?(f="bg-secondary/30 border-border/50 hover:border-muted-foreground/60",g="method",h="text-muted-foreground/60",i=`${b.receiverName}.${b.methodName}`,j=null,k="method (unresolved)",l=m>0?`at line${m>1?"s":""} ${b.lines.join(", ")}`:""):"self"===b.kind?(f="bg-secondary/40 border-border hover:border-muted-foreground",g="self",h="text-muted-foreground/70",i=b.external.name,j=null,k="same-file",l=m>0?`at line${m>1?"s":""} ${b.lines.join(", ")}`:""):(f="in"===a?"bg-amber-9/15 border-amber-9/40 hover:border-amber-11":"bg-green-9/15 border-green-9/40 hover:border-green-11",g=a,h="in"===a?"text-amber-11":"text-green-11",i=b.external.name,j=O(b.external.filePath),k="in"===a?"caller":"callee",l=b.external.filePath);let n=c&&"ext"!==b.kind&&"method"!==b.kind?" ring-1 ring-amber-9/70 ring-offset-0":"";return(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),e()},className:`${f}${n} w-full text-left border rounded px-1.5 py-0.5 text-[10px] font-mono cursor-pointer transition-colors block`,"data-tooltip":`${k} \xb7 ${i}${l?" \xb7 "+l:""}`,children:(0,d.jsxs)("span",{className:"block h-[26px] leading-[13px] overflow-hidden",children:[(0,d.jsx)("span",{className:`${h} float-left mr-1.5 text-[9px] uppercase tracking-wider font-semibold`,children:g}),(j||m>1)&&(0,d.jsxs)("span",{className:"float-right clear-both ml-1.5 max-w-[60%] truncate text-muted-foreground/70",children:[j,m>1&&(0,d.jsxs)("span",{className:"text-muted-foreground/60",children:[j?" ":"","\xb7",m,"\xd7"]})]}),(0,d.jsx)("span",{className:"font-medium break-all",children:i})]})})}let T="w-44 @min-[900px]:w-52 @min-[1100px]:w-60 @min-[1400px]:w-72 @min-[1800px]:w-80 @min-[2400px]:w-96",U=18,V=29,W=8;function X(a,b){switch(b.kind){case"cross":return`${a}:x:${b.external.filePath}::${b.external.qualifiedName}`;case"self":return`${a}:s:${b.external.filePath}::${b.external.qualifiedName}`;case"ext":return`${a}:e:${b.packageSpec}::${b.name}`;case"method":return`${a}:m:${b.receiverName}::${b.methodName}`}}function Y(a,b){return"ext"!==a.kind&&"method"!==a.kind&&(b?.has(a.external.qualifiedName)??!1)}function Z(a){return{filePath:a.filePath,qname:a.qualifiedName,name:a.name,kind:a.kind}}function $({symbol:a,fileSource:b,hasChange:c,upstream:e,downstream:f,onPinClick:g,onHighlighted:h,comments:i,onCommentClick:j,accentQnames:k,addedLines:l,fold:m,onExpandGap:n}){let o=function(a,b,c){if(0===a.length)return[];let d=a.map((a,c)=>{var d,e;return{i:c,line:(d=a.lines[0]??b.startLine,e=b.startLine,Math.max(e,Math.min(b.endLine,d)))}});d.sort((a,b)=>a.line-b.line||a.i-b.i);let e=Array(a.length).fill(0),f=-1/0;for(let{i:a,line:g}of d){let d=Math.max(V+W+(c?c.rowOf(g):g-b.startLine)*U,f);e[a]=d,f=d+34}return e}(f,a,m);return(0,d.jsxs)("div",{"data-block-qname":a.qualifiedName,"data-start-line":a.startLine,"data-end-line":a.endLine,className:"flex gap-2 items-stretch scroll-mt-2",children:[(0,d.jsx)("div",{className:`${T} flex-shrink-0 flex flex-col gap-1 pt-1`,children:0===e.length?(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/40 italic px-1.5",children:"no callers"}):e.map(b=>(0,d.jsx)(S,{side:"in",pin:b,accent:Y(b,k),onClick:()=>g(b,a)},X("in",b)))}),(0,d.jsx)(R,{symbol:a,fileSource:b,hasChange:c,onHighlighted:h,comments:i,onCommentClick:j,addedLines:l,upstream:e,downstream:f,fold:m,onExpandGap:n}),(0,d.jsx)("div",{className:`${T} flex-shrink-0 relative`,children:0===f.length?(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/40 italic px-1.5 pt-1",children:"no callees"}):f.map((b,c)=>(0,d.jsx)("div",{className:"absolute left-0 right-0",style:{top:`${o[c]}px`},children:(0,d.jsx)(S,{side:"out",pin:b,accent:Y(b,k),onClick:()=>g(b,a)})},X("out",b)))})]})}function _({cwd:a,onSelect:b,onClose:c}){let{t:i}=(0,f.Bd)(),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)({files:[],symbols:[]}),[n,o]=(0,e.useState)(0),[p,q]=(0,e.useState)(!1),r=(0,e.useMemo)(()=>[...l.files,...l.symbols],[l]),s=(0,e.useCallback)(a=>{if("Escape"===a.key)return void c();if(0!==r.length){if("ArrowDown"===a.key)a.preventDefault(),o(a=>Math.min(a+1,r.length-1));else if("ArrowUp"===a.key)a.preventDefault(),o(a=>Math.max(a-1,0));else if("Enter"===a.key){a.preventDefault();let c=r[n];c&&b(c)}}},[r,n,c,b]);return(0,d.jsx)("div",{className:"absolute inset-0 bg-background/40 z-20 flex items-start justify-center pt-24",onClick:c,children:(0,d.jsxs)("div",{className:"w-[480px] max-w-[80%] bg-card border border-border rounded shadow-lv3 overflow-hidden",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border",children:[(0,d.jsx)(g.A,{className:"w-4 h-4 text-muted-foreground"}),(0,d.jsx)("input",{autoFocus:!0,value:j,onChange:a=>k(a.target.value),onKeyDown:s,placeholder:i("blockViewer.search.hint","Start typing to search"),className:"flex-1 bg-transparent border-0 outline-none text-sm"}),p&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"…"}),(0,d.jsx)("button",{onClick:c,className:"text-muted-foreground hover:text-foreground",children:(0,d.jsx)(h.A,{className:"w-3.5 h-3.5"})})]}),(0,d.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[0===r.length&&j&&!p&&(0,d.jsx)("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("blockViewer.search.noResults","No matches")}),(0,d.jsx)(aa,{label:i("blockViewer.search.files","Files"),hits:l.files,startIdx:0,activeIdx:n,onSelect:b,setActive:o}),(0,d.jsx)(aa,{label:i("blockViewer.search.symbols","Symbols"),hits:l.symbols,startIdx:l.files.length,activeIdx:n,onSelect:b,setActive:o})]})]})})}function aa({label:a,hits:b,startIdx:c,activeIdx:e,onSelect:f,setActive:g}){return 0===b.length?null:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-muted-foreground bg-secondary/40",children:a}),b.map((a,b)=>{let h=c+b,j=h===e;return(0,d.jsxs)("button",{onMouseEnter:()=>g(h),onClick:()=>f(a),className:`w-full text-left px-3 py-1.5 text-xs flex items-start gap-2 ${j?"bg-secondary":"hover:bg-secondary/60"}`,children:["file"===a.type?(0,d.jsx)(i.A,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0 text-muted-foreground"}):(0,d.jsx)(q,{kind:a.target.kind,qname:a.target.qualifiedName,className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"font-mono truncate",children:a.label}),a.hint&&(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground truncate",children:a.hint})]})]},`${a.type}:${a.label}:${b}`)})]})}function ab({cwd:a,highlightedFilePath:b,changedFiles:c,onSwitchToCode:g,enableComments:h=!1,onContentSearch:i,onFocalChange:j,qnameFilter:k,qnameFilterFile:l,accentQnames:m,accentFile:n,addedLines:o,addedLinesFile:p,compact:q=!1,headerExtraLeft:s,headerExtraRight:u}){let{t:y}=(0,f.Bd)(),[z,A]=(0,e.useState)("toc"),[D,G]=(0,e.useState)(null),H=D??b??null,{state:I,refresh:P}=(0,r.V)(a,H),[Q,R]=(0,e.useState)(null),S=(0,e.useMemo)(()=>Q?Q.content.split("\n").length:null,[Q]);(0,e.useRef)(null);let[U,V]=(0,e.useState)([]),[W,X]=(0,e.useState)(!1),[Y,aa]=(0,e.useState)(null),ae=(0,e.useRef)(0);(0,e.useRef)(0);let[af,ag]=(0,e.useState)(()=>new Set);"ready"===I.state&&I.data.filePath;let ah=(0,e.useCallback)(a=>{ag(b=>{if(b.has(a))return b;let c=new Set(b);return c.add(a),c})},[]),ai=(0,e.useCallback)((a,b)=>{if("ext"===a.kind||"method"===a.kind){let a=b.filePath;if(!a)return;ae.current+=1,aa({filePath:a,qname:"__imports__",nonce:ae.current});return}let c=Z(b),d=Z(a.external);V(a=>C(C(a,c),d)),G(d.filePath),ae.current+=1,aa({filePath:d.filePath,qname:d.qname,nonce:ae.current})},[]),aj=(0,e.useCallback)(a=>{G(a.filePath),ae.current+=1,aa({filePath:a.filePath,qname:a.qname,nonce:ae.current})},[]),ak=(0,e.useCallback)(a=>{X(!1),G(a.target.filePath),"symbol"===a.type&&(ae.current+=1,aa({filePath:a.target.filePath,qname:a.target.qualifiedName,line:a.target.startLine,nonce:ae.current}))},[]),al=(0,e.useCallback)((a,b)=>{H&&(ae.current+=1,aa({filePath:H,qname:a,line:b,nonce:ae.current}))},[H]),[am,an]=(0,e.useState)(()=>new Set),ao=(0,e.useCallback)((a,b)=>{an(c=>{let d=new Set(c);return d.add(`${H}#${a}#${b}`),d})},[H]),[ap,aq]=(0,e.useState)(null),[ar,as]=(0,e.useState)(null),at=(0,e.useMemo)(()=>{if("ready"!==I.state||!ar)return null;let a=I.data.functions;if(0===a.length)return null;let b=(ar.start+ar.end)/2;for(let c of a)if(c.startLine<=b&&b<=c.endLine)return c.qualifiedName;let c=null;for(let b of a)b.startLine<=ar.start&&(!c||b.startLine>c.startLine)&&(c=b);return c?.qualifiedName??null},[I,ar]),au=h&&!!a&&!!H,av=(0,v.r)(),{comments:aw,addComment:ax,updateComment:ay,deleteComment:az,refresh:aA}=(0,w._)({cwd:a,filePath:H??""}),[aB,aC]=(0,e.useState)(null),{toolbarRef:aD,bumpRef:aE,clearToolbar:aF}=(0,F.L)({enabled:au,container:aB,resolveLineRange:a=>{if(!document.contains(a))return null;let b=a.nodeType===Node.TEXT_NODE?a.parentElement:a,c=b?.closest("[data-line]");if(!c||!aB||!aB.contains(c))return null;let d=c.getAttribute("data-line");if(!d)return null;let e=parseInt(d,10);return Number.isFinite(e)?{start:e,end:e}:null},buildLineSnapshot:({start:a,end:b})=>{let c=Q?.content;return c?c.split("\n").slice(a-1,b).join("\n"):""}}),[aG,aH]=(0,e.useState)(null),[aI,aJ]=(0,e.useState)(null),[aK,aL]=(0,e.useState)(null),aM=(0,e.useCallback)(()=>{let a=aD.current;a&&(aH({x:a.x,y:a.y,range:a.range,selectedText:a.selectedText,lineSnapshot:a.lineSnapshot}),aF())},[aF,aD]),aN=(0,e.useCallback)(()=>{let a=aD.current;a&&(aJ({x:a.x,y:a.y,range:a.range,selectedText:a.selectedText,lineSnapshot:a.lineSnapshot}),aF())},[aF,aD]),aO=(0,e.useCallback)(()=>{let a=aD.current;a&&av&&H&&(aF(),(0,x.Ff)(av.sendMessage,{filePath:H,startLine:a.range.start,endLine:a.range.end,codeContent:a.lineSnapshot},y("explain.selectionMessage")))},[av,H,aF,aD,y]),aP=(0,e.useCallback)(()=>{let a=aD.current;if(!a||!i)return;let b=a.selectedText.trim();aF(),b&&i(b)},[i,aF,aD]),aQ=(0,e.useCallback)(async a=>{aG&&(await ax(aG.range.start,aG.range.end,a,aG.selectedText),aH(null))},[aG,ax]),aR=(0,e.useCallback)(async(b,c)=>{if(av&&a&&H)try{let d=(await (0,x.$3)(a)).map(a=>({filePath:a.filePath,startLine:a.startLine,endLine:a.endLine,codeContent:a.codeContent,note:a.content||void 0}));d.push({filePath:H,startLine:b.range.start,endLine:b.range.end,codeContent:b.lineSnapshot});let e=(0,x.Gw)(d,c);av.sendMessage(e),await (0,x.RP)(a),aA()}catch(a){console.error("[BlockViewer] send to AI failed:",a)}},[av,a,H,aA]),aS=(0,e.useCallback)(a=>{aI&&aR(aI,a)},[aI,aR]),aT=(0,e.useCallback)(a=>{aG&&aR(aG,a)},[aG,aR]),aU=(0,e.useCallback)((a,b)=>{b.stopPropagation(),aL({comment:a,x:b.clientX,y:b.clientY}),aF(),aH(null),aJ(null)},[aF]);if(!H)return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(ad,{focalFile:null,fileCount:null,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,refreshDisabled:!0,extraLeft:s,extraRight:u}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center text-sm text-muted-foreground gap-2 px-4 text-center",children:[(0,d.jsx)("span",{children:y("blockViewer.empty.body","Select a file in the left tree to see its function call graph.")}),(0,d.jsx)("span",{className:"text-xs",children:y("blockViewer.empty.hint","or press ⌘K to search.")})]}),W&&(0,d.jsx)(_,{cwd:a,onSelect:ak,onClose:()=>X(!1)})]});if("idle"===I.state||"loading"===I.state)return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(ad,{focalFile:H,fileCount:null,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,refreshDisabled:!0,extraLeft:s,extraRight:u}),(0,d.jsx)(t,{cwd:a})]});if("notFound"===I.state)return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(ad,{focalFile:H,fileCount:null,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,extraLeft:s,extraRight:u}),(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground px-4 text-center",children:y("blockViewer.fileMode.notFound","This file is not indexed (unsupported language or beyond the file cap).")}),W&&(0,d.jsx)(_,{cwd:a,onSelect:ak,onClose:()=>X(!1)})]});if("error"===I.state)return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(ad,{focalFile:H,fileCount:null,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,extraLeft:s,extraRight:u}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-sm",children:[(0,d.jsx)("span",{className:"text-red-11",children:I.message}),(0,d.jsx)("button",{onClick:P,className:"px-3 py-1 rounded bg-secondary hover:bg-secondary/80",children:y("blockViewer.retry","Retry")})]})]});let aV=I.data,aW=aV.functions;if(0===aW.length&&Q){let a=Math.max(1,S??1);aW=[{filePath:aV.filePath,qualifiedName:"__file__",name:O(aV.filePath),kind:"unknown",startLine:1,endLine:a}]}let aX=l&&l===aV.filePath,aY=n&&n===aV.filePath,aZ=p&&p===aV.filePath;aX&&k&&(aW=aW.filter(a=>k.has(a.qualifiedName)));let a$=aY?m:void 0,a_=aZ?o:void 0,a0=new Map;if(q&&a_)for(let a of aW)a0.set(a.qualifiedName,function(a,b,c,d,e=K.aj){if(b<a)return null;let f=[];for(let d of c)d>=a&&d<=b&&f.push(d);f.sort((a,b)=>a-b);let g=[];for(let c of f){let d=Math.max(a,c-e),f=Math.min(b,c+e),h=g[g.length-1];h&&d<=h.endLine+1?f>h.endLine&&(h.endLine=f):g.push({startLine:d,endLine:f})}let h=[],i=a;for(let a of g)a.startLine>i&&h.push({startLine:i,endLine:a.startLine-1}),i=a.endLine+1;i<=b&&h.push({startLine:i,endLine:b});let j=[],k=[];for(let a of h)a.endLine-a.startLine+1<2||d(a.startLine)?k.push(a):j.push(a);if(0===j.length)return null;g=function(a){let b=[...a].sort((a,b)=>a.startLine-b.startLine),c=[];for(let a of b){let b=c[c.length-1];b&&a.startLine<=b.endLine+1?a.endLine>b.endLine&&(b.endLine=a.endLine):c.push({...a})}return c}([...g,...k]);let l=[];for(let a of[...g.map(a=>({kind:"lines",...a})),...j.map(a=>({kind:"gap",...a}))].sort((a,b)=>a.startLine-b.startLine))l.push(a);let m=[],n=0;for(let a of l)m.push(n),n+="gap"===a.kind?1:a.endLine-a.startLine+1;let o=n;return{segments:l,visibleRuns:g,hiddenCount:j.reduce((a,b)=>a+(b.endLine-b.startLine+1),0),rowOf:b=>{for(let a=0;a<l.length;a++){let c=l[a];if(b<c.startLine)break;if(b<=c.endLine)return"gap"===c.kind?m[a]:m[a]+(b-c.startLine)}return b<a?0:Math.max(0,o-1)}}}(a.startLine,a.endLine,a_,b=>am.has(`${aV.filePath}#${a.qualifiedName}#${b}`)));let a1=ac(aV.upstreamCalls),a2=ac(aV.downstreamCalls),a3=new Map(aW.map(a=>[a.qualifiedName,a])),a4=new Map,a5=new Map;for(let a of aV.intraCalls){let b=a3.get(a.to),c=a3.get(a.from);if(b){let c=a4.get(a.from),d={kind:"self",external:b,lines:a.lines};c?c.push(d):a4.set(a.from,[d])}if(c){let b=a5.get(a.to),d={kind:"self",external:c,lines:a.lines};b?b.push(d):a5.set(a.to,[d])}}let a6=new Map;for(let a of aV.externalCalls??[]){let b=a6.get(a.focalQname),c={kind:"ext",name:a.external.name,packageSpec:a.external.packageSpec,lines:a.lines};b?b.push(c):a6.set(a.focalQname,[c])}let a7=new Map;for(let a of aV.methodCalls??[]){let b=a7.get(a.focalQname),c={kind:"method",receiverName:a.receiverName,methodName:a.methodName,lines:a.lines};b?b.push(c):a7.set(a.focalQname,[c])}let a8=new Map;for(let a of aW){let b=a.qualifiedName,c={in:a1.get(b)?.length??0,out:a2.get(b)?.length??0,self:(a5.get(b)?.length??0)+(a4.get(b)?.length??0)};(c.in||c.out||c.self)&&a8.set(b,c)}let a9=c.has(aV.filePath);return(0,d.jsxs)("div",{className:"h-full flex flex-col relative",children:[(0,d.jsx)(ad,{focalFile:H,fileCount:aV.fileCount,functionCount:aV.functions.length,upstreamCount:aV.upstreamCalls.length,downstreamCount:aV.downstreamCalls.length,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,extraLeft:s,extraRight:u}),(0,d.jsxs)("div",{ref:aC,className:"@container flex-1 relative min-h-0 flex",children:[(0,d.jsxs)("div",{className:`${T} flex-shrink-0 border-r border-border flex flex-col`,children:[(0,d.jsx)("div",{className:"flex-shrink-0 flex border-b border-border",children:[["toc",y("blockViewer.tabs.toc")],["history",y("blockViewer.tabs.history")]].map(([a,b])=>(0,d.jsx)("button",{onClick:()=>A(a),className:`flex-1 px-2 py-1.5 text-xs font-medium transition-colors ${z===a?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground"}`,children:b},a))}),(0,d.jsx)("div",{className:"toc"===z?"flex-1 min-h-0 flex flex-col":"hidden",children:(0,d.jsx)(E,{functions:aW,counts:a8,totalLines:S,currentQname:at,onSelect:al,notIndexed:aV.notIndexed,onRebuild:P})}),(0,d.jsx)("div",{className:"history"===z?"flex-1 min-h-0 flex flex-col":"hidden",children:(0,d.jsx)(B,{entries:U,onSelect:aj,onClear:()=>V([])})})]}),(0,d.jsx)("div",{ref:aq,className:"@container flex-1 min-w-0 overflow-auto",children:(0,d.jsx)("div",{className:"flex flex-col gap-3 p-3",children:aW.map(a=>{let b,c,e,f,g,h;return(0,d.jsx)($,{symbol:a,fileSource:Q?.content??null,hasChange:a9,upstream:(b=a1.get(a.qualifiedName),c=a5.get(a.qualifiedName),[...(b??[]).map(a=>({kind:"cross",external:a.external,lines:a.lines})),...c??[]]),downstream:(e=a2.get(a.qualifiedName),f=a4.get(a.qualifiedName),g=a7.get(a.qualifiedName),h=a6.get(a.qualifiedName),[...(e??[]).map(a=>({kind:"cross",external:a.external,lines:a.lines})),...f??[],...g??[],...h??[]]),onPinClick:ai,onHighlighted:ah,comments:au?aw:void 0,onCommentClick:au?aU:void 0,accentQnames:a$,addedLines:a_,fold:a0.get(a.qualifiedName),onExpandGap:ao},`${a.qualifiedName}#${a.startLine}`)})})}),au&&aB&&(0,d.jsx)(L.fS,{floatingToolbarRef:aD,bumpRef:aE,container:aB,onAddComment:aM,onSendToAI:aN,onSearch:i?aP:void 0,onExplain:av&&H?aO:void 0,isChatLoading:av?.isLoading}),au&&aG&&(0,d.jsx)(M.t,{x:aG.x,y:aG.y,range:aG.range,filePath:H??void 0,lineSnapshot:aG.lineSnapshot,container:aB,onSubmit:aQ,onSendToAI:av&&H?aT:void 0,onClose:()=>aH(null),isChatLoading:av?.isLoading}),au&&aI&&H&&(0,d.jsx)(M.G,{x:aI.x,y:aI.y,range:aI.range,filePath:H,lineSnapshot:aI.lineSnapshot,container:aB,onSubmit:aS,onClose:()=>aJ(null),isChatLoading:av?.isLoading}),au&&aK&&(0,d.jsx)(N.t,{x:aK.x,y:aK.y,comment:aK.comment,container:aB,onClose:()=>aL(null),onUpdateComment:ay,onDeleteComment:az}),a_&&a_.size>0&&aW.length>0&&(0,d.jsx)(J,{addedLines:a_,blockRanges:aW.flatMap(a=>{let b=a0.get(a.qualifiedName);return b?b.visibleRuns.map(b=>({qname:a.qualifiedName,startLine:b.startLine,endLine:b.endLine})):[{qname:a.qualifiedName,startLine:a.startLine,endLine:a.endLine}]}),viewportRange:ar,onJumpToLine:al}),W&&(0,d.jsx)(_,{cwd:a,onSelect:ak,onClose:()=>X(!1)})]})]})}function ac(a){let b=new Map;for(let c of a){let a=b.get(c.focalQname);if(!a){b.set(c.focalQname,[c]);continue}a.some(a=>a.external.filePath===c.external.filePath&&a.external.qualifiedName===c.external.qualifiedName)||a.push(c)}return b}function ad({focalFile:a,fileCount:b,functionCount:c,upstreamCount:e,downstreamCount:h,onSwitchToCode:i,onSearch:k,onRefresh:l,refreshDisabled:m,extraLeft:n,extraRight:o}){let{t:p}=(0,f.Bd)(),q={focalFile:a,blockCount:c??0,upstreamCount:e??0,downstreamCount:h??0};return(0,d.jsxs)("div",{className:"flex-shrink-0 px-3 py-2 border-b border-border flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0 text-xs text-muted-foreground font-mono",children:[(0,d.jsx)("span",{className:"truncate min-w-0",children:a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"text-foreground",children:a}),"number"==typeof c&&(0,d.jsxs)("span",{className:"ml-2",children:["\xb7 ",c," blocks"]}),"number"==typeof e&&"number"==typeof h&&(0,d.jsxs)("span",{className:"ml-2",children:["\xb7 ",e," in \xb7 ",h," out"]})]}):(0,d.jsx)("span",{children:null!==b?`${b} files`:"…"})}),n&&(0,d.jsx)("span",{className:"flex items-center gap-1 flex-shrink-0",children:n(q)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[o&&(0,d.jsx)("span",{className:"flex items-center gap-1",children:o(q)}),(0,d.jsxs)("button",{onClick:k,className:"text-xs px-2 py-1 rounded hover:bg-secondary text-muted-foreground hover:text-foreground flex items-center gap-1","data-tooltip":p("blockViewer.search.tooltip","Search (⌘K)"),children:[(0,d.jsx)(g.A,{className:"w-3 h-3"})," ⌘K"]}),(0,d.jsx)("button",{onClick:l,disabled:m,className:"text-xs px-2 py-1 rounded hover:bg-secondary text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:hover:bg-transparent","data-tooltip":p("blockViewer.refresh","Rebuild project graph"),children:(0,d.jsx)(j.A,{className:"w-3 h-3"})}),i&&(0,d.jsx)("button",{onClick:i,className:"text-xs px-2 py-1 rounded hover:bg-secondary text-muted-foreground hover:text-foreground",children:p("common.code","Code")})]})]})}},73414:(a,b,c)=>{"use strict";c.d(b,{YO:()=>e,aj:()=>d,pU:()=>f});let d=3,e=20;function f(a,b,c,g=[]){let h=a.length,i=c=>"unchanged"!==a[c].type||"unchanged"!==b[c].type,j=new Set;for(let a=0;a<h;a++){if(!i(a))continue;let b=Math.max(0,a-d),c=Math.min(h-1,a+d);for(let a=b;a<=c;a++)j.add(a)}let k=[];for(let a=0;a<h;a++){if(j.has(a))continue;let b=a;for(;a<h&&!j.has(a);)a++;k.push({id:k.length,startIdx:b,endIdx:a-1}),a--}for(let a of k){let b=c.get(a.id)??{topRevealed:0,bottomRevealed:0},d=a.endIdx-a.startIdx+1,e=Math.max(0,Math.min(b.topRevealed,d)),f=Math.max(0,Math.min(b.bottomRevealed,d-e));for(let b=a.startIdx;b<a.startIdx+e;b++)j.add(b);for(let b=a.endIdx-f+1;b<=a.endIdx;b++)j.add(b)}let l=[];for(let a=0;a<h;a++){let c;if(j.has(a)){l.push({kind:"diff",idx:a});continue}let d=a;for(;a<h&&!j.has(a);)a++;let f=a-1;a--;let i=k.find(a=>a.startIdx<=d&&f<=a.endIdx);if(!i)continue;let m=f-d+1,n=Math.min(e,m);if(g.length>0&&f+1<h)for(let a=f+1;a<h;a++){let d=b[a].lineNum;if(!(d<=0)){c=function(a,b){let c=null;for(let d of a)d.startLine<=b&&b<=d.endLine&&(!c||d.endLine-d.startLine<c.endLine-c.startLine)&&(c=d);return c}(g,d)??void 0;break}}l.push({kind:"gap-expand",gapId:i.id,direction:"up",revealCount:n}),l.push({kind:"gap-label",gapId:i.id,hiddenCount:m,enclosingFn:c}),l.push({kind:"gap-expand",gapId:i.id,direction:"down",revealCount:n})}return{rows:l,gaps:k}}},73887:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{M:()=>B});var e=c(48249),f=c(67484),g=c(44384),h=c(64825),i=c(74429),j=c(7122),k=c(7833),l=c(41051),m=c(42140),n=c(70596),o=c(74754),p=c(7031),q=c(91579),r=c(208),s=c(5900),t=c(64676),u=c(84835);c(15466);var v=c(60591),w=c(59865),x=c(93321),y=c(24680),z=c(92608),A=c(37690);let a=[u.W];function B({content:b,filePath:c,cwd:d,onClose:u,sourceFile:C,embedded:D=!1,onLocalMdLink:E,scrollToAnchor:F}){let G=C||(d&&c.startsWith(d)?c.slice(d.endsWith("/")?d.length:d.length+1):c),{t:H}=(0,g.Bd)(),I=(0,j.iN)(),J=(0,p.r)(),K=(0,w.U)(),L=(0,x.Q)(),{comments:M,addComment:N,updateComment:O,deleteComment:P,refresh:Q}=(0,o._)({cwd:d,filePath:c}),[R,S]=(0,f.useState)(!1),[T,U]=(0,f.useState)(null),[V,W]=(0,f.useState)(null),[X,Y]=(0,f.useState)(null),Z=(0,f.useMemo)(()=>b.split("\n"),[b]),$=(0,f.useMemo)(()=>(0,t.J4)(c,d),[c,d]),[_,aa]=(0,f.useState)(null),ab=(0,f.useRef)(null),ac=(0,f.useRef)({onLocalMdLink:E,sourceFile:G});ac.current={onLocalMdLink:E,sourceFile:G};let ad=(0,f.useRef)(a=>{let{onLocalMdLink:b,sourceFile:c}=ac.current;if(!b||/^[a-z][a-z0-9+.-]*:/i.test(a))return!1;let d=a.indexOf("#"),e=d>=0?a.slice(0,d):a,f=d>=0?a.slice(d+1):null;if(!e)return!1;let g=e;try{g=decodeURIComponent(e)}catch{}return!!(0,v.e$)(g)&&(b((0,v.WU)(c,g),f),!0)}).current,{toolbarRef:ae,bumpRef:af,clearToolbar:ag}=(0,A.L)({enabled:!0,container:_,resolveLineRange:a=>{let b=function(a){let b=a.nodeType===Node.TEXT_NODE?a.parentElement:a;if(!b||!("closest"in b))return null;let c=b.closest("[data-source-start]");if(!c)return null;let d=c.getAttribute("data-source-start"),e=c.getAttribute("data-source-end");return d&&e?{start:parseInt(d,10),end:parseInt(e,10)}:null}(a);return b?{start:b.start,end:b.end}:null},buildLineSnapshot:({start:a,end:b})=>{let c=Math.max(0,a-1),d=Math.min(Z.length,b);return Z.slice(c,d).join("\n")}}),ah=(0,f.useCallback)(()=>{let a=ae.current;a&&(U({x:a.x,y:a.y,range:a.range,selectedText:a.selectedText,lineSnapshot:a.lineSnapshot}),ag())},[ag,ae]),ai=(0,f.useCallback)(()=>{let a=ae.current;a&&(W({x:a.x,y:a.y,range:a.range,selectedText:a.selectedText,lineSnapshot:a.lineSnapshot}),ag())},[ag,ae]),aj=(0,f.useCallback)(()=>{let a=ae.current;a&&J&&(ag(),(0,q.Ff)(J.sendMessage,{filePath:c,startLine:a.range.start,endLine:a.range.end,codeContent:a.lineSnapshot},r.A.t("explain.selectionMessage")))},[J,c,ag,ae]),ak=(0,f.useCallback)(async a=>{T&&(await N(T.range.start,T.range.end,a,T.selectedText),U(null))},[T,N]),al=(0,f.useCallback)(async(a,b)=>{if(J)try{let e=await (0,q.$3)(d),f=[];for(let a of e)f.push({filePath:a.filePath,startLine:a.startLine,endLine:a.endLine,codeContent:a.codeContent,note:a.content||void 0});f.push({filePath:c,startLine:a.range.start,endLine:a.range.end,codeContent:a.lineSnapshot});let g=(0,q.Gw)(f,b);J.sendMessage(g),await (0,q.RP)(d),Q()}catch(a){console.error("Failed to send to AI:",a)}},[J,c,d,Q]),am=(0,f.useCallback)(a=>{V&&al(V,a)},[V,al]),an=(0,f.useCallback)(a=>{T&&al(T,a)},[T,al]);(0,f.useMemo)(()=>{if(0===M.length)return[];let a=new Map;for(let b of M){let c=`${b.startLine}-${b.endLine}`;a.has(c)||a.set(c,[]),a.get(c).push(b)}return Array.from(a.entries()).map(([a,b])=>({key:a,startLine:b[0].startLine,endLine:b[0].endLine,comments:b}))},[M]);let[ao,ap]=(0,f.useState)([]);return(0,e.jsxs)(e.Fragment,{children:[!D&&(0,e.jsxs)("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between gap-3 flex-shrink-0",children:[(0,e.jsxs)("span",{className:"text-sm font-medium text-foreground truncate min-w-0 flex-1 cursor-pointer hover:text-brand transition-colors",style:{direction:"rtl",textAlign:"left"},"data-tooltip":c,onClick:()=>{navigator.clipboard.writeText(c),(0,k.oR)(H("common.copiedPath"))},children:["‎",c]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(z.ShareReviewToggle,{content:b,sourceFile:G}),((0,v.C_)(c)||(0,v.OG)(c))&&(0,e.jsx)("button",{onClick:()=>{let a=c.startsWith("/")||!d?c:`${d.replace(/\/$/,"")}/${c}`;(0,v.OG)(c)?L(a):K(a)},className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:H((0,v.OG)(c)?"bots.addTooltip":"skills.addTooltip"),children:(0,e.jsx)(h.A,{className:"w-4 h-4"})}),(0,e.jsx)("button",{onClick:u,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:H("common.close"),children:(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,e.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,e.jsx)(y.l,{content:b,containerRef:ab}),(0,e.jsxs)("div",{className:"flex-1 overflow-auto relative",ref:ab,children:[(0,e.jsx)("div",{className:"p-6",children:(0,e.jsx)(s.T,{content:b,basePath:$,rehypePlugins:a,onLinkClick:ad})}),ao.map(({key:a,top:b,comments:c})=>(0,e.jsx)("div",{className:"absolute right-3 cursor-pointer z-10",style:{top:b},onClick:a=>{a.stopPropagation(),Y({comment:c[0],x:a.clientX,y:a.clientY})},children:(0,e.jsx)("div",{className:"w-5 h-5 rounded-full bg-amber-500/80 text-white text-xs flex items-center justify-center shadow-lv1 hover:bg-amber-500 transition-colors",children:c.length})},a))]})]}),R&&I&&(0,i.createPortal)((0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.fS,{floatingToolbarRef:ae,bumpRef:af,container:I,onAddComment:ah,onSendToAI:ai,onExplain:J?aj:void 0,isChatLoading:J?.isLoading}),T&&(0,e.jsx)(m.t,{x:T.x,y:T.y,range:T.range,filePath:c,lineSnapshot:T.lineSnapshot,container:I,onSubmit:ak,onSendToAI:J?an:void 0,onClose:()=>U(null),isChatLoading:J?.isLoading}),V&&(0,e.jsx)(m.G,{x:V.x,y:V.y,range:V.range,filePath:c,lineSnapshot:V.lineSnapshot,container:I,onSubmit:am,onClose:()=>W(null),isChatLoading:J?.isLoading}),X&&(0,e.jsx)(n.t,{x:X.x,y:X.y,comment:X.comment,container:I,onClose:()=>Y(null),onUpdateComment:O,onDeleteComment:P})]}),I)]})}d()}catch(a){d(a)}})},74228:(a,b,c)=>{"use strict";c.d(b,{S:()=>g,l:()=>h});var d=c(48249),e=c(40311),f=c(41233);function g(a){return"loading"===a||"unread"===a?a:"normal"}function h({projectNumber:a,sessionNumber:b,coordinate:c,status:g="normal",statusLabel:i,bot:j,className:k=""}){if(c){let[d,e]=c.split(".");a??=d,b??=e}if(null==a&&null==b&&"normal"!==g&&(b="\xb7"),null==a&&null==b)return null;let l=[a,b].filter(a=>null!=a).join(".");return(0,d.jsxs)("span",{className:`inline-flex items-center gap-1 font-mono text-[9px] font-medium leading-none tabular-nums flex-shrink-0 ${k}`,"aria-label":i?`${l} \xb7 ${i}`:l,children:[null!=a&&(0,d.jsx)("span",{className:`flex h-4 w-4 items-center justify-center border rounded-[4px] ${(0,e.ci)("normal",!1)}`,children:a}),null!=b&&(0,d.jsx)(f.w,{wash:(0,e.JQ)(g,!1),ring:(0,e.QV)(g),bot:j,title:i,children:b})]})}},74542:(a,b,c)=>{"use strict";c.d(b,{b:()=>f});var d=c(48249),e=c(67484);function f({lines:a,containerRef:b}){let c=(0,e.useRef)(null),[g,h]=(0,e.useState)({top:0,height:0});if(0===a.length)return null;let i=100/a.length;return(0,d.jsxs)("div",{ref:c,className:"w-4 flex-shrink-0 bg-secondary border-l border-border relative cursor-pointer",onClick:a=>{let d=b.current,e=c.current;if(!d||!e)return;let f=e.getBoundingClientRect(),g=(a.clientY-f.top)/f.height*d.scrollHeight-d.clientHeight/2;d.scrollTo({top:Math.max(0,g),behavior:"smooth"})},children:[a.map((a,b)=>"unchanged"!==a.type&&(0,d.jsx)("div",{className:`absolute left-0 right-0 ${"removed"===a.type?"bg-red-9":"bg-green-9"}`,style:{top:`${b*i}%`,height:`${Math.max(i,.5)}%`,minHeight:"2px"}},b)),(0,d.jsx)("div",{className:"absolute left-0 right-0 bg-muted/60 border-y border-border",style:{top:`${g.top}px`,height:`${Math.max(g.height,10)}px`}})]})}},74691:(a,b,c)=>{"use strict";c.d(b,{y:()=>f});var d=c(48249),e=c(44384);function f({value:a,onChange:b,className:c}){let{t:g}=(0,e.Bd)();return(0,d.jsx)("div",{className:`flex items-center gap-0.5 rounded border border-border overflow-hidden ${c??""}`,children:["compact","full"].map(c=>(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),b(c)},className:`px-2 py-0.5 text-xs transition-colors ${a===c?"bg-brand text-white":"text-muted-foreground hover:bg-hover"}`,children:g("compact"===c?"diffViewer.compact":"diffViewer.full")},c))})}},74754:(a,b,c)=>{"use strict";c.d(b,{_:()=>h});var d=c(67484),e=c(91579),f=c(33281),g=c(89800);function h({cwd:a,filePath:b}){let[c,i]=(0,d.useState)([]),[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(null),n=(0,d.useCallback)(async()=>{if(!a||!b)return;k(!0),m(null);let c=await f.t4.runPromiseExit((0,g.lb)(a,b));if("Success"===c._tag)i(c.value.comments??[]);else{let a="Fail"===c.cause._tag?c.cause.error:null,b=a?.cause;m(b instanceof Error?b.message:"Failed to load comments")}k(!1)},[a,b]),o=(0,d.useCallback)(async(c,d,h,j)=>{let k=await f.t4.runPromiseExit((0,g.BC)({cwd:a,filePath:b,startLine:c,endLine:d,content:h,...j?{selectedText:j}:{}}));if("Success"===k._tag&&k.value.comment){let a=k.value.comment;return i(b=>[...b,a]),(0,e.Cm)(),a}return"Failure"===k._tag&&console.error("Failed to add comment:",k.cause),null},[a,b]),p=(0,d.useCallback)(async(b,c)=>{let d=await f.t4.runPromiseExit((0,g.vv)(a,b,c));if("Success"===d._tag&&d.value.comment){let a=d.value.comment;return i(c=>c.map(c=>c.id===b?a:c)),!0}return"Failure"===d._tag&&console.error("Failed to update comment:",d.cause),!1},[a]),q=(0,d.useCallback)(async b=>{let c=await f.t4.runPromiseExit((0,g.Tu)(a,b));return"Success"===c._tag?(i(a=>a.filter(a=>a.id!==b)),(0,e.Cm)(),!0):(console.error("Failed to delete comment:",c.cause),!1)},[a]),r=(0,d.useCallback)(a=>c.filter(b=>a>=b.startLine&&a<=b.endLine),[c]);return{comments:c,isLoading:j,error:l,addComment:o,updateComment:p,deleteComment:q,refresh:n,getCommentsForLine:r}}},74837:(a,b,c)=>{"use strict";c.d(b,{NoteToolbar:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call NoteToolbar() from the server but NoteToolbar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/NoteToolbar.tsx","NoteToolbar")},74991:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{I:()=>t});var e=c(48249),f=c(67484),g=c(44384),h=c(29588),i=c(7833),j=c(15819);c(33281);var k=c(13054),l=c(30458),m=c(36688),n=c(32753),o=c(74228),p=c(15790);c(41224);var q=a([p,m]);function r(a){return a.engine||"claude"}function s(a){return a.lastFiredAt??a.createdAt}[p,m]=q.then?(await q)():q;let u=[{key:"pendingReview",labelKey:"scheduledTasks.groupPendingReview"},{key:"upcoming",labelKey:"scheduledTasks.groupUpcoming"},{key:"paused",labelKey:"scheduledTasks.paused"}];function t({collapsed:a,tasks:b,unreadCount:c,sessionNumbers:d,onSwitchProject:q,onPause:v,onResume:w,onTrigger:x,onDelete:y,onMarkRead:z,onUpdateTask:A}){let{t:B}=(0,g.Bd)(),[C,D]=(0,f.useState)(!1),[E,F]=(0,f.useState)(null),G=(0,f.useRef)(null),H=(0,f.useRef)(null),[I,J]=(0,f.useState)(null),K=(0,f.useCallback)(()=>{F(null),G.current=null,J(null)},[]),[L,M]=(0,f.useState)(null),[N,O]=(0,f.useState)(null),[P,Q]=(0,f.useState)(null),[R,S]=(0,f.useState)(null),T=b.filter(a=>!a.completed),U=T.filter(a=>!a.paused).length,V=(0,f.useMemo)(()=>(function(a){let b=[],c=[],d=[];for(let e of a)e.unread||e.completed?b.push(e):e.paused?d.push(e):c.push(e);return b.sort((a,b)=>Number(!!b.unread)-Number(!!a.unread)||s(b)-s(a)),c.sort((a,b)=>(a.nextFireTime||Number.MAX_SAFE_INTEGER)-(b.nextFireTime||Number.MAX_SAFE_INTEGER)),d.sort((a,b)=>s(b)-s(a)),{pendingReview:b,upcoming:c,paused:d}})(b),[b]),W=P?b.find(a=>a.id===P)??null:null,[,X]=(0,f.useState)(0),Y=(0,f.useCallback)(()=>{M(null),O(null)},[]),Z=(0,f.useCallback)(async a=>{let b=!!a.taskFile;try{await navigator.clipboard.writeText(b?a.taskFile:a.message),(0,i.oR)(B(b?"common.copiedPath":"toast.copiedMessage"),"success")}catch{(0,i.oR)(B("common.copyFailed"),"error")}},[B]),$=(0,f.useCallback)(()=>{D(!1),Q(null)},[]),_=(0,f.useCallback)(a=>{q(a.cwd,a.sessionId),a.unread&&z(a.id),$()},[q,z,$]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{onClick:()=>D(!0),className:`relative flex items-center gap-2 px-2 py-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-hover transition-colors ${a?"w-full justify-center":"w-full"}`,title:a?B("scheduledTasks.title"):void 0,children:[(0,e.jsx)(h.A,{className:"w-5 h-5 flex-shrink-0"}),!a&&(0,e.jsx)("span",{className:"text-sm flex-1 text-left",children:B("scheduledTasks.title")}),c>0?(0,e.jsx)("span",{className:`min-w-[18px] h-[18px] px-1 bg-orange-11/15 text-orange-11 text-xs font-medium rounded-full flex items-center justify-center ${a?"absolute -top-1 -right-1":""}`,children:c}):a&&b.length>0?(0,e.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 text-muted-foreground text-xs font-medium rounded-full flex items-center justify-center bg-popover border border-border",children:b.length}):null]}),C&&(0,e.jsxs)("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-scrim",onClick:$}),(0,e.jsxs)("div",{className:j.aO,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-foreground",children:B("scheduledTasks.title")}),T.length>0&&(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[B("scheduledTasks.activeCount",{running:U}),T.length-U>0?` \xb7 ${B("scheduledTasks.pausedCount",{paused:T.length-U})}`:""]})]}),(0,e.jsx)("button",{onClick:$,className:"p-1 text-foreground-subtle hover:text-foreground hover:bg-hover rounded transition-colors",children:(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("div",{className:"flex-1 flex min-h-0",children:0===b.length?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:B("scheduledTasks.noScheduledTasks")})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"w-full md:w-[360px] min-h-0 flex-shrink-0 md:border-r border-border overflow-y-auto",children:(0,e.jsx)("div",{className:"p-3 space-y-4",children:u.map(({key:a,labelKey:b})=>{let c=V[a];return 0===c.length?null:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"sticky top-0 z-10 -mx-3 px-3 py-1 bg-card text-[11px] font-medium text-muted-foreground",children:[B(b)," (",c.length,")"]}),(0,e.jsx)("div",{className:"mt-1 space-y-2",children:c.map(a=>{let b,c;return b=a.id===P,(0,e.jsxs)("div",{onClick:()=>Q(a.id),onMouseLeave:()=>S(b=>b===a.id?null:b),className:`group p-3 rounded border cursor-pointer transition-all hover:border-brand hover:shadow-lv2 ${b?"border-brand bg-brand/5 shadow-lv2":a.unread?"border-brand/40 bg-brand/5":"border-border"} ${a.completed?"opacity-70":""}`,children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)(n.S,{engine:r(a),tooltip:(c=r(a),a.model?`${c} \xb7 ${a.model}`:c)}),(0,e.jsx)("h4",{className:"text-xs font-medium text-foreground truncate flex-1","data-tooltip":a.cwd,children:(0,k.P_)(a.cwd)}),(0,e.jsx)(o.l,{coordinate:d?.[`${a.cwd}
730
+ `;function f(a){return/^([/\\]|[A-Za-z]:)/.test(a)}function g(a){return f(a)||(0,d.P)(a)}function h(a,b){let c=a.replace(/[/\\]+$/,"");return b?`${c}/${b}`:c}function i(a,b){let c,d=(c=Math.max(a.lastIndexOf("/"),a.lastIndexOf("\\")))<0?"":0===c?"/":a.slice(0,c);return g(a)?d:b?h(b,d):d}function j(a,b){return g(a)||!!b}let k="/apps/local/",l="/apps/builtin/";function m(a,b){let c=a.trim();return k+n(g(c)?c:h(b??"",c)).replace(/\\/g,"/").split("/").map(encodeURIComponent).join("/").replace(/^\//,"")}function n(a){let b=/^[A-Za-z]:/.exec(a)?.[0]??"",c=b?a.slice(b.length):a,d=/^[/\\]/.test(c),e=[];for(let a of c.split(/[/\\]/))if(a&&"."!==a){if(".."===a){e.length&&".."!==e[e.length-1]?e.pop():d||b||e.push("..");continue}e.push(a)}return b+(d||b?"/":"")+e.join("/")}let o=/^([a-z][a-z0-9+.-]*:|\/\/|\/)/i;function p(a,b,c){let d=a.trim();if(!d||o.test(d)||!j(b,c))return a;let e=f(b)?b:h(c,b),g=d.search(/[?#]/),i=g<0?d:d.slice(0,g),k=g<0?"":d.slice(g);if(!i)return a;let l=i;try{l=decodeURIComponent(i)}catch{}return m(n(h(e,l)))+k}let q=[{chip:"*.md",exts:["md"]},{chip:"*.png/jpg/gif/webp/svg",exts:["png","jpg","jpeg","gif","webp","svg"]},{chip:"*.pdf",exts:["pdf"]},{chip:"*.json",exts:["json"]},{chip:"*.csv",exts:["csv"]},{chip:"*.tsv",exts:["tsv"]}],r=RegExp(`\\.(${q.flatMap(a=>a.exts).join("|")})$`,"i"),s=q.map(a=>a.chip);function t(a){return r.test(a.trim())}function u(a,b){let c=a.trim();return l+"file-viewer/index.html?file="+encodeURIComponent(n(g(c)?c:h(b??"",c)).replace(/\\/g,"/"))}function v(a,b){try{let c=new URL(a,b);if(!c.pathname.startsWith(l)&&!c.pathname.startsWith(k))return a;return"localhost"===c.hostname&&(c.hostname="127.0.0.1"),c.toString()}catch{return a}}function w(a,b){let c=a=>JSON.stringify(a).replace(/</g,"\\u003c"),d="<script>"+e.replaceAll("__CWD__",c(b.cwd)).replaceAll("__WS_URL__",c(b.wsUrl??""))+"<\/script>",f=a.match(/<head[^>]*>/i);if(f&&void 0!==f.index){let b=f.index+f[0].length;return a.slice(0,b)+d+a.slice(b)}let g=a.match(/<html[^>]*>/i);if(g&&void 0!==g.index){let b=g.index+g[0].length;return a.slice(0,b)+d+a.slice(b)}return d+a}},65139:(a,b,c)=>{"use strict";c.d(b,{BV:()=>i,NR:()=>u,Yd:()=>x,kn:()=>j,oJ:()=>p});var d=c(48249),e=c(67484),f=c(44256),g=c(63565),h=c(92545);let i="claude-opus-5-5",j="gpt-6.1-sol",k=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"Extra High"},{id:"max",label:"Max"},{id:"ultracode",label:"Ultracode"},{id:"ultrathink",label:"Ultrathink"}],l=[{id:"claude-sonnet-5-5",label:"Claude Sonnet 5.5",effort:["low","medium","high","xhigh","max","ultracode","ultrathink"],defaultEffort:"medium"},{id:"claude-sonnet-5",label:"Claude Sonnet 5",effort:["low","medium","high","xhigh","max","ultrathink"],defaultEffort:"high"},{id:"claude-opus-5-5",label:"Claude Opus 5.5",effort:["low","medium","high","xhigh","max","ultracode","ultrathink"],defaultEffort:"medium",fast:!0},{id:"claude-opus-5",label:"Claude Opus 5",effort:["low","medium","high","xhigh","max","ultracode","ultrathink"],defaultEffort:"high",fast:!0},{id:"claude-fable-5-1",label:"Claude Fable 5.1",effort:["low","medium","high","xhigh","max","ultracode","ultrathink"],defaultEffort:"high"},{id:"claude-haiku-5-5",label:"Claude Haiku 5.5",effort:["low","medium","high","xhigh","max","ultracode","ultrathink"],defaultEffort:"medium"},{id:"claude-haiku-4-5",label:"Claude Haiku 4.5",thinking:!0}],m=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"Extra High"},{id:"max",label:"Max"},{id:"ultra",label:"Ultra"}],n=[{id:"gpt-6-astra",label:"GPT-6-Astra",reasoning:["low","medium","high","xhigh","max","ultra"],defaultReasoning:"low"},{id:"gpt-6.1-sol",label:"GPT-6.1-Sol",reasoning:["low","medium","high","xhigh","max","ultra"],defaultReasoning:"low"},{id:"gpt-6-sol",label:"GPT-6-Sol",reasoning:["low","medium","high","xhigh","max","ultra"],defaultReasoning:"medium"},{id:"gpt-6-luna",label:"GPT-6-Luna",reasoning:["low","medium","high","xhigh","max"],defaultReasoning:"medium"},{id:"gpt-5.6-sol",label:"GPT-5.6-Sol",reasoning:["low","medium","high","xhigh","max","ultra"],defaultReasoning:"low"}];function o(a){return n.find(b=>b.id===a)?.defaultReasoning??"low"}function p(a,b){let c=n.find(b=>b.id===a)?.reasoning;return b&&(!c||c.includes(b))?b:o(a)}function q(a,b){return a.find(a=>a.id===b)?.label??b}function r(a){return l.find(b=>b.id===a)?.fast===!0}function s(a){return l.find(b=>b.id===a)?.thinking===!0}function t(a){let b=l.find(b=>b.id===a);return b?b.defaultEffort:"high"}function u(a,b){let c=l.find(b=>b.id===a),d=c?.effort;return b&&(!c||d?.includes(b))?b:t(a)}function v({value:a,selected:b,label:c,defaultValue:e,onSelect:f}){return(0,d.jsxs)("button",{type:"button",onClick:()=>f(a),className:`flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition-colors ${b?g.yI:"text-muted-foreground hover:bg-hover hover:text-foreground"}`,children:[(0,d.jsx)("span",{className:"mt-0.5",children:(0,d.jsx)(g.hG,{selected:b})}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:c}),(0,d.jsx)("span",{className:"shrink-0",children:e&&(0,d.jsx)("span",{className:"rounded bg-muted px-1.5 text-[10px] font-medium text-muted-foreground",children:"Default"})})]})}function w({title:a,selected:b,value:c,items:h,onSelect:i,icon:j,testId:k}){let l=(0,e.useRef)(null),m=(0,e.useRef)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)({top:0,left:0}),r=(0,f.F2)();return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(g.XY,{buttonRef:l,label:c,labelMaxWidth:"max-w-[180px]",title:`${a}: ${c}`,onClick:()=>{n||(()=>{let a=l.current?.getBoundingClientRect();if(!a)return;let b=r?.getBoundingClientRect(),c=b?.left??0,d=b?.top??0;q({top:a.bottom+4-d,left:a.left-c})})(),o(a=>!a)},icon:j,testId:k}),n&&(0,d.jsx)(f.ZL,{children:(0,d.jsxs)("div",{ref:m,className:`${g.ys} min-w-[190px]`,style:{top:p.top,left:p.left},children:[(0,d.jsx)("div",{className:"px-3 pb-1 text-[11px] font-medium text-muted-foreground",children:a}),(0,d.jsx)("div",{className:"flex flex-col",children:h.map(a=>(0,d.jsx)(v,{value:a.id,selected:b===a.id,label:a.label,defaultValue:a.defaultValue,onSelect:a=>{i(a),o(!1)}},a.id))})]})})]})}function x(a){let b,c,e,f=a.engine??"claude",v=a.claudeModel??i,x=t(v),y=(b=l.find(a=>a.id===v)?.effort)?b.map(a=>k.find(b=>b.id===a)??{id:a,label:a}):[],z=u(v,a.claudeEffort),A=a.claudeFastMode??!1,B=a.claudeThinking??!1,C=a.codexModel??j,D=o(C),E=(c=n.find(a=>a.id===C)?.reasoning)?c.map(a=>m.find(b=>b.id===a)??{id:a,label:a}):m,F=p(C,a.codexReasoningEffort);return"claude"!==f?(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-1","data-agent-model-traits":!0,children:[(0,d.jsx)(w,{title:"Model",selected:C,value:n.find(a=>a.id===C)?.label??(0,h.U)(C),items:n.map(a=>({id:a.id,label:a.label,defaultValue:a.id===j})),onSelect:b=>{a.onCodexModelChange?.(b),a.onCodexReasoningEffortChange?.(o(b))},icon:(0,d.jsx)(g.eV,{engine:"codex"}),testId:"codex-model-picker"}),(0,d.jsx)(w,{title:"Reasoning",selected:F,value:q(m,F),items:E.map(a=>({...a,defaultValue:a.id===D})),onSelect:b=>a.onCodexReasoningEffortChange?.(b),testId:"codex-reasoning-picker"})]}):(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-1","data-agent-model-traits":!0,children:[(0,d.jsx)(w,{title:"Model",selected:v,value:(e=l.find(a=>a.id===v))?e.label:v.startsWith("claude-")?`Claude ${(0,h.J)(v)}`:v,items:l.map(a=>({id:a.id,label:a.label,defaultValue:a.id===i})),onSelect:b=>{a.onClaudeModelChange?.(b);let c=t(b);c&&a.onClaudeEffortChange?.(c),r(b)||a.onClaudeFastModeChange?.(!1),s(b)||a.onClaudeThinkingChange?.(!1)},icon:(0,d.jsx)(g.eV,{engine:"claude"}),testId:"claude-model-picker"}),z&&y.length>0&&(0,d.jsx)(w,{title:"Reasoning",selected:z,value:q(k,z),items:y.map(a=>({...a,defaultValue:a.id===x})),onSelect:b=>a.onClaudeEffortChange?.(b),testId:"claude-reasoning-picker"}),r(v)&&(0,d.jsx)(w,{title:"Fast Mode",selected:A?"on":"off",value:A?"Fast On":"Fast Off",items:[{id:"on",label:"On"},{id:"off",label:"Off",defaultValue:!0}],onSelect:b=>a.onClaudeFastModeChange?.("on"===b),testId:"claude-fast-mode-picker"}),s(v)&&(0,d.jsx)(w,{title:"Thinking",selected:B?"on":"off",value:B?"Thinking On":"Thinking Off",items:[{id:"on",label:"On"},{id:"off",label:"Off",defaultValue:!0}],onSelect:b=>a.onClaudeThinkingChange?.("on"===b),testId:"claude-thinking-picker"})]})}},65395:(a,b,c)=>{"use strict";c.d(b,{useTabState:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call reconcileStatusTabIds() from the server but reconcileStatusTabIds is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/useTabState.ts","reconcileStatusTabIds"),(0,d.registerClientReference)(function(){throw Error("Attempted to call repairPanes() from the server but repairPanes is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/useTabState.ts","repairPanes");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call useTabState() from the server but useTabState is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/useTabState.ts","useTabState")},65484:(a,b,c)=>{"use strict";c.d(b,{Cq:()=>n,D0:()=>q,DZ:()=>i,H7:()=>o,Kl:()=>w,M5:()=>h,Or:()=>k,Q1:()=>u,QW:()=>p,Wr:()=>j,Yn:()=>r,b2:()=>v,em:()=>t,fz:()=>s,zF:()=>m});var d=c(79606),e=c(71192);let f=(a,b)=>d.$mh({try:async()=>{let c=await fetch(a,b);if(!c.ok)throw Error(`HTTP ${c.status}`);return await c.json()},catch:c=>new e.uV({message:`${b?.method??"GET"} ${a} failed`,cause:c})}),g=(a,b)=>f(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),h=()=>f("/api/settings"),i=a=>f("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),j=()=>f("/api/version"),k=()=>f("/api/extension/version"),l=a=>a?`/api/note?cwd=${encodeURIComponent(a)}`:"/api/note",m=a=>f(l(a)),n=(a,b,c)=>d.$mh({try:async()=>{let d=l(a),e=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:b,baseMtime:c})});if(409===e.status){let a=await e.json();return{conflict:!0,content:a.content??"",mtime:a.mtime}}if(!e.ok)throw Error(`HTTP ${e.status}`);return{conflict:!1,mtime:(await e.json()).mtime}},catch:b=>new e.uV({message:`POST ${l(a)} failed`,cause:b})}),o=()=>f("/api/sessions/projects"),p=a=>f(`/api/sessions/projects/${encodeURIComponent(a)}`),q=a=>f(`/api/project-settings?cwd=${encodeURIComponent(a)}`),r=a=>g("/api/project-settings",a),s=a=>f(`/api/fs/dirs?path=${encodeURIComponent(a)}`),t=a=>g("/api/open-vscode",{cwd:a}),u=a=>g("/api/open-cursor",{cwd:a}),v=a=>f(`/api/git/worktree?cwd=${encodeURIComponent(a)}`),w=a=>g("/api/git/worktree",a)},65543:(a,b,c)=>{"use strict";c.d(b,{_:()=>e});let d=new Set(["function","class","method"]);function e(a){return d.has(a.kind)}},67045:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(48249);function e({error:a,reset:b}){return(0,d.jsx)("html",{children:(0,d.jsx)("body",{children:(0,d.jsxs)("div",{style:{padding:"2rem",fontFamily:"system-ui, sans-serif"},children:[(0,d.jsx)("h2",{children:"Something went wrong"}),(0,d.jsx)("p",{style:{color:"#666"},children:a.message}),(0,d.jsx)("button",{onClick:b,style:{marginTop:"1rem",padding:"0.5rem 1rem",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #ccc",background:"#fff"},children:"Try again"})]})})})}},69424:(a,b,c)=>{"use strict";c.d(b,{$:()=>s});var d=c(48249),e=c(67484),f=c(44384),g=c(57063),h=c(7833),i=c(44256),j=c(74118),k=c(15273),l=c(46674),m=c(99941),n=c(44643),o=c(32026),p=c(11732),q=c(75513);function r(a){let b=a.input?.questions||[],c=a.input?.answers||{},d={};if(a.result)try{let b=JSON.parse(a.result);b?.answers&&(d=b.answers)}catch{}return{questions:b,answers:{...c,...d}}}function s({toolCalls:a,onClose:b}){let{t:c}=(0,f.Bd)(),t=(0,q.nH)(),[u,v]=(0,e.useState)({}),[w,x]=(0,e.useState)({}),[y,z]=(0,e.useState)({}),[A,B]=(0,e.useState)({});(0,g.E)(b);let C=a.reduce((a,b)=>{let{questions:c}=r(b);return a+c.length},0),D=Object.values(A).filter(Boolean).length,E=(0,e.useCallback)((a,b)=>{v(c=>({...c,[a]:b})),x(b=>({...b,[a]:!1}))},[]),F=(0,e.useCallback)(a=>{x(b=>{let c=!b[a];if(c){let b=y[a]||"";b&&v(c=>({...c,[a]:b}))}return{...b,[a]:c}})},[y]),G=(0,e.useCallback)((a,b)=>{z(c=>({...c,[a]:b})),b&&v(c=>({...c,[a]:b}))},[]),H=(0,e.useCallback)(a=>{B(b=>({...b,[a]:!b[a]}))},[]),I=(0,e.useCallback)(()=>{let b=D>0,d=[];return a.forEach((a,e)=>{let{questions:f}=r(a);f.forEach((a,f)=>{let g=`${e}-${f}`;if(b&&!A[g])return;let h=u[g];d.push(`Q: ${a.question}`),d.push(`A: ${h||c("askQuestion.notSelected")}`),d.push("")})}),d.join("\n").trim()},[a,u,A,D,c]),J=(0,e.useCallback)(()=>{navigator.clipboard.writeText(I()),(0,h.oR)(D>0?c("toast.copiedQA",{count:D}):c("toast.copiedAllQA"))},[I,D,c]),K=(0,e.useCallback)(()=>{t?(t.sendMessage(I()),(0,h.oR)(c("toast.sentQA")),b()):(0,h.oR)(c("askQuestion.sendNoChat"))},[t,I,b,c]),L=(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-scrim p-4",onClick:b,children:(0,d.jsxs)("div",{className:"bg-card rounded-lg shadow-lv3 w-full max-w-6xl h-[90vh] flex flex-col overflow-hidden",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground",children:c("askQuestion.title")}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c("askQuestion.nQuestions",{count:C}),D>0&&` \xb7 ${c("askQuestion.checkedN",{count:D})}`]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{onClick:K,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:D>0?c("askQuestion.sendChecked",{count:D}):c("askQuestion.sendAll"),children:(0,d.jsx)(j.A,{className:"w-4 h-4"})}),(0,d.jsx)("button",{onClick:J,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:D>0?c("askQuestion.copyChecked",{count:D}):c("askQuestion.copyAll"),children:(0,d.jsx)(k.A,{className:"w-4 h-4"})}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",children:(0,d.jsx)(l.A,{className:"w-5 h-5"})})]})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-6",children:a.map((b,e)=>{let{questions:f}=r(b);return f.map((b,g)=>{let h=`${e}-${g}`,i=u[h],j=w[h]||!1,k=A[h]||!1;return(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("button",{onClick:()=>H(h),className:"mt-0.5 flex-shrink-0 p-0.5 rounded hover:bg-hover transition-colors",title:c("askQuestion.checkToCopy"),children:k?(0,d.jsx)(m.A,{className:"w-4 h-4 text-brand"}):(0,d.jsx)(n.A,{className:"w-4 h-4 text-muted-foreground"})}),b.header&&(0,d.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-brand/10 text-brand flex-shrink-0 mt-0.5",children:b.header}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:b.question})]}),(0,d.jsxs)("div",{className:"space-y-1 ml-7",children:[b.options.map((a,b)=>{let c=i===a.label&&!j;return(0,d.jsxs)("button",{onClick:()=>E(h,a.label),className:`flex items-start gap-2 px-2.5 py-1.5 rounded-md transition-colors w-full text-left cursor-pointer hover:bg-hover ${c?"bg-brand/10 hover:bg-brand/15":""}`,children:[(0,d.jsx)("div",{className:"mt-0.5 flex-shrink-0",children:c?(0,d.jsx)(o.A,{className:"w-3.5 h-3.5 text-brand"}):(0,d.jsx)("div",{className:"w-3.5 h-3.5 rounded-full border border-muted-foreground"})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:`text-sm ${c?"text-foreground font-medium":"text-foreground"}`,children:a.label}),a.description&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:a.description})]})]},b)}),(0,d.jsxs)("button",{onClick:()=>F(h),className:`flex items-start gap-2 px-2.5 py-1.5 rounded-md transition-colors w-full text-left cursor-pointer hover:bg-hover ${j?"bg-brand/10 hover:bg-brand/15":""}`,children:[(0,d.jsx)("div",{className:"mt-0.5 flex-shrink-0",children:j?(0,d.jsx)(o.A,{className:"w-3.5 h-3.5 text-brand"}):(0,d.jsx)("div",{className:"w-3.5 h-3.5 rounded-full border border-muted-foreground"})}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(p.A,{className:"w-3.5 h-3.5 text-muted-foreground"}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:c("askQuestion.custom")})]})]}),j&&(0,d.jsx)("div",{className:"ml-6 mt-1",children:(0,d.jsx)("input",{type:"text",autoFocus:!0,value:y[h]||"",onChange:a=>G(h,a.target.value),placeholder:c("askQuestion.customPlaceholder"),className:"w-full px-3 py-1.5 text-sm bg-background border border-border rounded-md focus:outline-none focus:ring-1 focus:ring-brand text-foreground"})})]}),(e!==a.length-1||g!==f.length-1)&&(0,d.jsx)("div",{className:"border-b border-border/50 mt-3"})]},h)})})})]})});return(0,d.jsx)(i.ZL,{children:L})}},69606:(a,b,c)=>{"use strict";c.d(b,{A:()=>g});var d=c(48249),e=c(18921),f=c(60591);function g({preview:a,onClose:b,search:c,preRef:h}){return(0,d.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-scrim",onClick:b,children:(0,d.jsxs)("div",{className:"bg-card rounded-lg shadow-lv3 w-full max-w-[90%] h-[90%] flex flex-col",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border flex-shrink-0",children:[(0,d.jsx)("span",{className:"text-sm text-muted-foreground font-mono truncate",children:a.filePath}),(0,d.jsx)("button",{onClick:b,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,d.jsx)(e._,{search:c}),(0,d.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4 bg-secondary",children:(0,d.jsx)("pre",{ref:h,className:"whitespace-pre-wrap break-words font-mono text-foreground",style:{fontSize:"0.8125rem",lineHeight:"1.5"},children:(0,f.xb)(a.content)})})]})})}},70151:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{g:()=>ak});var e=c(48249),f=c(67484),g=c.n(f),h=c(74429),i=c(8410),j=c(44256),k=c(33281),l=c(87808),m=c(25419),n=c(85655),o=c(21538),p=c(35208),q=c(74691),r=c(60333),s=c(7833),t=c(24724),u=c(20586),v=c(7122),w=c(55287),x=c(60591),y=c(19593),z=c(64825),A=c(66400),B=c(86588),C=c(64676),D=c(6478),E=c(59865),F=c(93321),G=c(9804),H=c(73887),I=c(40893),J=c(92608),K=c(94239),L=c(29939),M=c(23860),N=c(7031),O=c(72899),P=c(25667),Q=c(57014),R=c(69606),S=c(46242),T=c(21787),U=c(94308),V=c(53036),W=c(91975),X=c(6662),Y=c(20291),Z=c(58904),$=c(61632),_=c(41357),aa=c(76855),ab=c(4857),ac=c(44384),ad=c(18921),ae=c(28797),af=c(23881),ag=c(21672),ah=c(21482),ai=c(94192),aj=a([o,P,p,H,w,Q]);[o,P,p,H,w,Q]=aj.then?(await aj)():aj;let ak=g().memo(function({onClose:a,cwd:b,initialTab:c="tree",tabSwitchTrigger:d,initialSearchQuery:g,searchQueryTrigger:aj,fileOpenRequest:ak}){let al,am,an,ao,ap,aq,ar,{t:as}=(0,ac.Bd)(),at=(0,N.r)(),au=(0,f.useCallback)(a=>{at?.sendMessage(as("explain.fileMessage",{path:a}))},[at,as]),av=(0,f.useCallback)(a=>{at?.sendMessage(as("explain.stagedFileMessage",{path:a}))},[at,as]),aw=(0,f.useCallback)(a=>{at?.sendMessage(as("explain.unstagedFileMessage",{path:a}))},[at,as]),ax=(0,D.P)(),ay=(0,E.U)(),az=(0,F.Q)(),{activeView:aA,onViewChange:aB}=(0,ai.R8)(),[aC,aD]=(0,f.useState)(c),[aE,aF]=(0,f.useState)("code"),aG=(0,f.useRef)(null),aH=(0,f.useRef)(!1),[aI,aJ]=(0,f.useState)(null),[aK,aL]=(0,f.useState)(null),[aM,aN]=(0,f.useState)(!1),aO=(0,f.useRef)(1),aP=(0,f.useRef)(null),[aQ,aR]=(0,f.useState)(null),aS=(0,f.useRef)(null),[aT,aU]=(0,f.useState)({isDirty:!1,isSaving:!1}),[aV,aW]=(0,f.useState)(!1),[aX,aY]=(0,f.useState)(null),[aZ,a$]=(0,f.useState)(null),[a_,a0]=(0,f.useState)("compact"),[a1,a2]=(0,f.useState)("unified"),[a3,a4]=(0,f.useState)("full"),[a5,a6]=(0,f.useState)("unified"),[a7,a8]=(0,f.useState)(320),a9=(0,f.useRef)(null),ba=(0,f.useCallback)(a=>{"mouse"===a.pointerType&&0===a.button&&(a.preventDefault(),a9.current={startX:a.clientX,startWidth:a7},a.currentTarget.setPointerCapture(a.pointerId))},[a7]),bb=(0,f.useCallback)(a=>{let b=a9.current;if(!b)return;let c=b.startWidth+(a.clientX-b.startX);a8(Math.min(480,Math.max(320,c)))},[]),bc=(0,f.useCallback)(a=>{a9.current&&(a9.current=null,a.currentTarget.hasPointerCapture(a.pointerId)&&a.currentTarget.releasePointerCapture(a.pointerId))},[]),bd=(0,f.useRef)(null),be=(0,ad.o)(bd),bf=(0,f.useRef)(null),bg=(0,ad.o)(bf),bh=(0,aa.Sn)(b),bi=(0,aa.Xm)(b),bj=(0,aa.po)(b),bk=(0,ab.Q)(),bl=(0,M.F)(),bm=(0,X.W)({cwd:b});(0,aa.JL)(b,bm.selectedPath);let bn=(0,f.useMemo)(()=>{let a=bm.fileContent,b=bm.selectedPath;return a&&"text"===a.type&&"string"==typeof a.content&&b&&(0,x.Hz)(b)?(0,x.xb)(a.content,x.cG):null},[bm.fileContent,bm.selectedPath]),[bo,bp]=(0,f.useState)({version:0,collapsed:!1}),bq=(0,Y.p)({cwd:b,onSearchComplete:()=>aW(!0)}),br=(0,Z.e)({cwd:b,addToRecentFiles:bm.addToRecentFiles}),bs=(0,f.useMemo)(()=>{let a=new Set;if(br.status){for(let b of br.status.staged)a.add(b.path);for(let b of br.status.unstaged)a.add(b.path)}return a},[br.status]),bt=(0,f.useMemo)(()=>{let a=new Map;if(br.status){for(let b of br.status.staged)a.set(b.path,"staged");for(let b of br.status.unstaged)a.set(b.path,"unstaged")}return a},[br.status]),bu=(0,$.y)({cwd:b,addToRecentFiles:bm.addToRecentFiles}),bv=bu.compareFileDiff,bw=bv?.filePath??"",bx=(0,f.useMemo)(()=>{if(!bv||bv.isDeleted)return;let a={content:bv.newContent,filePath:bv.filePath};return(0,x.e$)(bv.filePath)?()=>a$(a):bv.filePath.endsWith(".json")?()=>aY(a):void 0},[bv]),by=(0,f.useCallback)(()=>a$(null),[]),bz=(0,f.useCallback)(()=>aY(null),[]),bA=(0,f.useMemo)(()=>{let a=0,b=0;for(let c of bu.compareFiles)a+=c.additions,b+=c.deletions;return{additions:a,deletions:b}},[bu.compareFiles]),bB=(0,f.useCallback)(a=>{at?.sendMessage(as("worktree"===bu.compareDiffMode?"explain.compareFileWorktreeMessage":"explain.compareFileMessage",{base:bu.compareBaseBranch,path:a}))},[at,as,bu.compareBaseBranch,bu.compareDiffMode]),bC=(0,f.useRef)(!1),bD=(0,f.useCallback)(a=>{bm.setFileContent(b=>b?.type==="text"?{...b,content:a}:b),bm.showEditor||(bC.current=!0,bm.setShowEditor(!0))},[bm]),bE=(0,f.useCallback)(a=>{bm.setShowEditor(!0)},[bm]),bF=(0,f.useCallback)(async()=>{if(!bm.fileContent||"text"!==bm.fileContent.type||!bm.fileContent.content)return;let a=await k.t4.runPromiseExit((0,l.OJ)({cwd:b,path:bm.selectedPath,content:bm.fileContent.content}));try{if("Failure"===a._tag||!a.value.ok)throw Error("Failed to save file");let b=a.value.data?.mtime;b&&bm.setFileContent(a=>a?.type==="text"?{...a,mtime:b}:a),(0,s.oR)(as("toast.savedSuccess"),"success")}catch{(0,s.oR)(as("toast.saveFailed"),"error")}},[b,bm]),bG=(0,f.useCallback)(()=>{if(!bm.selectedPath)return;let a=aO.current,b=aP.current;a>0&&bm.updateRecentFilePosition(bm.selectedPath,a,b?b.cursorLine+1:a,b?b.cursorCol+1:1)},[bm]),bH=(0,f.useCallback)(async(a,b)=>{let c=a!==bm.selectedPath;if(c&&bm.showEditor){if(aT.isDirty&&(!await (0,s.lJ)(as("fileBrowser.saveBeforeSwitch"),{confirmText:as("fileBrowser.saveAndSwitch"),cancelText:as("common.cancel")})||(await aS.current?.save(),aS.current?.isDirty)))return;bm.setShowEditor(!1)}c&&bG(),bm.handleSelectFile(a,b)},[bm,bG,aT.isDirty,as]),bI=(0,f.useMemo)(()=>{let a=bq.contentSearchResults;if(0===a.length)return{files:[],expandDirs:new Set,matchMap:new Map};let b=new Map,c=[];for(let d of a)b.set(d.path,d),c.push(d.path);let d=(0,G.v3)(c),e=new Set((0,G.tW)(d));return{files:d,expandDirs:e,matchMap:b}},[bq.contentSearchResults]),[bJ,bK]=(0,f.useState)(new Set),bL=(0,f.useCallback)(a=>{bK(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),bM=(0,f.useCallback)(a=>{if(a.isDirectory)return null;let b=bI.matchMap.get(a.path);return b?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:b.matches.length}):null},[bI.matchMap]),bN=aV&&bq.contentSearchResults.length>0,[bO,bP]=(0,f.useState)("selected"),bQ=!!bm.selectedPath&&null!==(0,ae.c)(bm.selectedPath),[bR,bS]=(0,f.useState)(!1),bT=(0,f.useCallback)(async(a,c)=>{if(!bm.selectedPath||!bQ)return;let d=await bh.goToDefinition(bm.selectedPath,a,c);if(0===d.length)return;let e=d[0],f=b.endsWith("/")?b:b+"/",g=e.file.startsWith(f)?e.file.slice(f.length):e.file;bk.push({filePath:bm.selectedPath,lineNumber:aO.current}),g===bm.selectedPath?bm.setTargetLineNumber(e.line):bH(g,e.line)},[bm,b,bQ,bh,bk]),bU=(0,f.useCallback)((a,b,c,d,e)=>{a&&null!==(0,ae.c)(a)&&(bS(b),bi.onTokenMouseEnter(a,c,d,e))},[bi]),bV=(0,f.useCallback)((a,b,c)=>{bQ&&bU(bm.selectedPath,!1,a,b,c)},[bm.selectedPath,bQ,bU]),bW=(0,f.useCallback)(a=>{let c=b.endsWith("/")?b:b+"/",d=a.file.startsWith(c)?a.file.slice(c.length):a.file;bm.selectedPath&&bk.push({filePath:bm.selectedPath,lineNumber:aO.current}),d===bm.selectedPath?bm.setTargetLineNumber(a.line):bH(d,a.line)},[bm,b,bk]),bX=(0,f.useMemo)(()=>{if(!br.status)return null;let a=new Map,b=a=>{switch(a){case"modified":default:return"M";case"added":case"untracked":return"A";case"deleted":return"D";case"renamed":return"R"}};for(let c of br.status.staged)a.set(c.path,b(c.status));for(let c of br.status.unstaged)a.set(c.path,b(c.status));return a},[br.status]),bY=(0,f.useMemo)(()=>{if(!br.status)return null;let a=new Map;for(let b of br.status.staged)"renamed"===b.status&&b.oldPath&&a.set(b.path,b.oldPath);return a},[br.status]),bZ=(0,f.useCallback)(a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)},[bq.setContentSearchQuery,bq.performContentSearch]),b$=(0,_.H)({cwd:b,selectedPath:bm.selectedPath,gitStatusMap:bX,renameOldPaths:bY,isText:bm.fileContent?.type==="text",refreshKey:bm.fileContent?.mtime}),b_="tree"===aC&&b$.showDiff,b0=(0,f.useCallback)(a=>{aD(a),bm.setBlameSelectedCommit(null),"history"===a&&bu.selectedBranch&&bu.loadCommits(bu.selectedBranch)},[bm,bu.selectedBranch,bu.loadCommits]);(0,f.useCallback)(()=>{if(!bm.selectedPath)return;let a={filePath:bm.selectedPath,lineNumber:aO.current},b=bk.goBack(a);b&&(b.filePath===bm.selectedPath?bm.setTargetLineNumber(b.lineNumber):bH(b.filePath,b.lineNumber))},[bm,bk]),(0,f.useCallback)(()=>{if(!bm.selectedPath)return;let a={filePath:bm.selectedPath,lineNumber:aO.current},b=bk.goForward(a);b&&(b.filePath===bm.selectedPath?bm.setTargetLineNumber(b.lineNumber):bH(b.filePath,b.lineNumber))},[bm,bk]);let b1=(0,f.useCallback)(async a=>{let c=a.split("/").pop()||a,d=await k.t4.runPromiseExit((0,l.__)({cwd:b,path:a}));"Success"===d._tag?(0,s.oR)(as("toast.copiedName",{name:c}),"success"):(0,s.oR)(as("toast.copyFailed"),"error")},[b,as]),b2=(0,f.useCallback)(async a=>{let c=await k.t4.runPromiseExit((0,l.dt)());if("Success"!==c._tag||!c.value.path)return void(0,s.oR)(as("toast.noFileToPaste"),"info");let d=c.value.path,e=await k.t4.runPromiseExit((0,l.Nn)({cwd:b,targetDir:a,sourceAbsPath:d}));if("Success"===e._tag)(0,s.oR)(as("toast.pastedFile",{name:e.value.newName}),"success"),bm.loadDirectory(a),bm.loadFileIndex();else{let a="Fail"===e.cause._tag?e.cause.error:null,b=a?.cause,c=b instanceof Error?b.message:as("toast.pasteFailed");(0,s.oR)(c,"error")}},[b,bm,as]);(0,f.useRef)(0),(0,f.useRef)(bl),(0,f.useRef)(aC),(0,f.useRef)(!1);let b3=(0,f.useRef)(bu.selectedBranch);b3.current=bu.selectedBranch;let b4=(0,f.useRef)(bm.selectedPath);b4.current=bm.selectedPath;let b5=(0,f.useRef)(bm.fileContent?.type);b5.current=bm.fileContent?.type;let b6=(0,f.useCallback)(async a=>{try{let{data:c}=a;if(!Array.isArray(c))return;let d=c.some(a=>"git"===a.type),e=c.some(a=>"file"===a.type),f=[];if((e||d)&&(f.push(k.t4.runPromise((0,l.mP)(b)).then(a=>{a.error||bm.setFiles(b=>(0,G.HR)(a.files??[],b))}).catch(()=>{})),f.push(k.t4.runPromise((0,l.DZ)(b)).then(a=>{a.paths&&bm.setFileIndex(a.paths)}).catch(()=>{})),f.push(k.t4.runPromise((0,l.r9)(b)).then(a=>{bm.setRecentFiles(a.files??[])}).catch(()=>{}))),d||e){f.push(k.t4.runPromise((0,n.lv)(b)).then(a=>{br.setStatus(a);let b=(0,u.Do)(a.staged),c=(0,u.Do)(a.unstaged);br.setStagedTree(b),br.setUnstagedTree(c)}).catch(()=>{})),br.refreshDiff(),bu.refreshCompare(),d&&bu.loadBranches();let a=b3.current;a&&f.push(k.t4.runPromise((0,n.Bj)(b,a,G.B_)).then(a=>{let b=a.commits??[];bu.setCommits(b),bu.setHasMoreCommits(b.length>=G.B_)}).catch(()=>{}))}let g=b4.current,h=b5.current;g&&"text"===h&&f.push(k.t4.runPromise((0,m.K)(b,g)).then(a=>{let b=a.ok?a.data:null;b&&"string"==typeof b.content&&bm.setFileContent({type:"text",content:b.content,size:b.size,mtime:b.mtimeMs,...b.isSymlink?{isSymlink:!0,symlinkTarget:b.symlinkTarget}:{}})}).catch(()=>{})),await Promise.all(f)}catch(a){console.error("File watch handler error:",a)}},[b]);(0,L.h)({url:`/ws/watch?cwd=${encodeURIComponent(b)}`,onMessage:b6,enabled:bl});let b7=(0,f.useCallback)(a=>{bH(a),bm.setShouldScrollToSelected(!0),aD("tree")},[bm,bH]);(0,f.useRef)(bH),(0,f.useRef)(null);let{setPreviewMarkdown:b8,setShouldScrollToSelected:b9}=bm,ca=(0,f.useCallback)(({focalFile:a})=>a&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{onClick:c=>{c.stopPropagation(),navigator.clipboard.writeText(`${b}/${a}`),(0,s.oR)(as("common.copiedPath"))},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors flex-shrink-0",title:as("common.copyAbsPath"),children:(0,e.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),b7(a)},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors flex-shrink-0",title:as("fileBrowser.locateInTree"),children:(0,e.jsxs)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10",strokeWidth:2}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3",strokeWidth:2}),(0,e.jsx)("path",{strokeLinecap:"round",strokeWidth:2,d:"M12 2v4m0 12v4M2 12h4m12 0h4"})]})})]}),[b,b7,as]),cb=(0,f.useCallback)(({focalFile:a})=>"tree"===aC&&b$.canDiff&&a===bm.selectedPath?(0,e.jsxs)(e.Fragment,{children:[b$.showDiff&&(0,e.jsx)(q.y,{value:a3,onChange:a4}),(0,e.jsx)("button",{onClick:b$.toggleDiff,className:`px-1.5 py-0.5 text-xs rounded transition-colors ${b$.showDiff?"bg-brand text-white":"text-muted-foreground hover:bg-hover"}`,title:b$.showDiff?as("fileBrowser.exitDiff"):as("fileBrowser.viewDiff"),children:as("common.diff")})]}):null,[aC,b$.canDiff,b$.showDiff,b$.toggleDiff,bm.selectedPath,a3,as]),[cc,cd]=(0,f.useState)(null),ce=(0,f.useCallback)((a,b)=>{bm.setPreviewMarkdown(!0),b7(a),cd(b),b&&setTimeout(()=>cd(null),400)},[bm,b7]);return(0,e.jsxs)(v.SU,{container:aI,children:[(0,e.jsxs)("div",{ref:aG,className:"bg-card w-full h-full flex flex-col relative",children:[(0,e.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex-shrink-0 flex flex-col overflow-hidden",style:{width:a7},children:[(0,e.jsxs)("div",{className:"flex border-b border-border",children:[(0,e.jsx)("button",{onClick:()=>b0("tree"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"tree"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.directoryTree")}),(0,e.jsx)("button",{onClick:()=>b0("search"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"search"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.searchTab")}),(0,e.jsx)("button",{onClick:()=>b0("recent"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"recent"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.recentTab")}),(0,e.jsx)("button",{onClick:()=>b0("status"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"status"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.changesTab")}),(0,e.jsx)("button",{onClick:()=>b0("history"),className:`flex-1 px-2 py-2 text-sm font-medium transition-colors ${"history"===aC?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground dark:hover:text-foreground"}`,children:as("fileBrowser.historyTab")})]}),"tree"===aC&&(0,e.jsxs)("div",{className:"p-2 border-b border-border flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"flex-1 relative",children:[(0,e.jsx)("input",{ref:bm.searchInputRef,type:"text",value:bm.searchQuery,onChange:a=>bm.setSearchQuery(a.target.value),placeholder:as("fileBrowser.searchFiles"),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),bm.searchQuery&&(0,e.jsx)("button",{onClick:()=>{bm.setSearchQuery(""),bm.searchInputRef.current?.focus()},className:"absolute right-1.5 top-1/2 -translate-y-1/2 p-0.5 text-foreground-subtle hover:text-foreground rounded-sm transition-colors",title:as("fileBrowser.clear"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("button",{onClick:()=>bm.setSearchDirExact(a=>!a),className:`px-1 py-0.5 rounded transition-colors text-xs font-mono font-bold border ${bm.searchExactMatch?"border-brand text-brand bg-brand/10":"border-transparent text-muted-foreground hover:text-foreground hover:bg-hover"}`,title:bm.searchExactMatch?as("fileBrowser.exactMatchOn"):as("fileBrowser.exactMatchOff"),children:"ab"}),(0,e.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:()=>bm.loadFiles(),className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:as("fileBrowser.refreshTree"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),(0,e.jsx)("button",{onClick:()=>bm.searchTreeExpandedPaths?bm.setSearchTreeExpandedPaths(new Set):bm.setExpandedPaths(new Set),className:"p-1.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:as("fileBrowser.collapseAll"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})})]})]}),"search"===aC&&(0,e.jsxs)("div",{className:"p-2 border-b border-border space-y-2",children:[(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsxs)("div",{className:"flex-1 relative",children:[(0,e.jsx)("input",{ref:bq.contentSearchInputRef,type:"text",value:bq.contentSearchQuery,onChange:a=>bq.setContentSearchQuery(a.target.value),onKeyDown:a=>{"Enter"===a.key&&bq.performContentSearch(bq.contentSearchQuery)},placeholder:as("fileBrowser.searchFileContent"),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),bq.contentSearchQuery&&(0,e.jsx)("button",{onClick:()=>{bq.setContentSearchQuery(""),bq.contentSearchInputRef.current?.focus()},className:"absolute right-1.5 top-1/2 -translate-y-1/2 p-0.5 text-foreground-subtle hover:text-foreground rounded-sm transition-colors",title:as("fileBrowser.clear"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("button",{onClick:()=>bq.performContentSearch(bq.contentSearchQuery),disabled:bq.isSearching||!bq.contentSearchQuery.trim(),className:"px-3 py-1.5 text-sm bg-brand text-white rounded hover:bg-brand/90 disabled:opacity-50 disabled:cursor-not-allowed",children:bq.isSearching?"...":as("common.search")})]}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs",children:[(0,e.jsxs)("label",{className:"flex items-center gap-1 cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:bq.searchOptions.caseSensitive,onChange:a=>bq.setSearchOptions(b=>({...b,caseSensitive:a.target.checked})),className:"w-3 h-3"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:as("fileBrowser.caseSensitive")})]}),(0,e.jsxs)("label",{className:"flex items-center gap-1 cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:bq.searchOptions.wholeWord,onChange:a=>bq.setSearchOptions(b=>({...b,wholeWord:a.target.checked})),className:"w-3 h-3"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:as("fileBrowser.wholeWord")})]}),(0,e.jsxs)("label",{className:"flex items-center gap-1 cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:bq.searchOptions.regex,onChange:a=>bq.setSearchOptions(b=>({...b,regex:a.target.checked})),className:"w-3 h-3"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:as("fileBrowser.regex")})]}),(0,e.jsx)("input",{type:"text",value:bq.searchOptions.fileType,onChange:a=>bq.setSearchOptions(b=>({...b,fileType:a.target.value})),placeholder:as("fileBrowser.fileTypes"),className:"w-24 px-2 py-0.5 text-xs border border-border rounded bg-card text-foreground"})]})]}),"history"===aC&&(0,e.jsx)("div",{className:"p-3 border-b border-border",children:bu.compareMode?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0 px-3 py-1.5 text-sm border border-border rounded bg-secondary text-foreground flex items-center gap-2",children:[(0,e.jsx)("svg",{className:"w-4 h-4 text-muted-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),(0,e.jsx)("span",{className:"flex-1 min-w-0 truncate",children:bu.branches?.current||"HEAD"}),(0,e.jsx)("div",{className:"flex flex-shrink-0 items-center rounded border border-border overflow-hidden text-xs",children:["head","worktree"].map(a=>(0,e.jsx)("button",{onClick:()=>bu.setCompareDiffMode(a),className:`px-1.5 py-0.5 transition-colors ${bu.compareDiffMode===a?"bg-brand text-white":"text-muted-foreground hover:text-foreground hover:bg-hover"}`,title:as("head"===a?"fileBrowser.compareScopeHeadHint":"fileBrowser.compareScopeWorktreeHint"),children:as("head"===a?"fileBrowser.compareScopeHead":"fileBrowser.compareScopeWorktree")},a))})]}),(0,e.jsx)("button",{onClick:()=>bu.toggleCompareMode(!1),className:"flex-shrink-0 px-2.5 py-1.5 text-xs font-medium rounded-lg transition-colors bg-brand text-white",title:as("fileBrowser.compareModeOff"),children:as("fileBrowser.compareMode")})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0 pl-1",children:"vs"}),(0,e.jsx)("div",{className:"flex-1 min-w-0",children:(0,e.jsx)(U.e,{branches:bu.branches,selectedBranch:bu.compareBaseBranch,onSelect:a=>{bu.setCompareBaseBranch(a),bu.loadCompareFiles(a)},isLoading:bu.isLoadingBranches,pinnedBranches:["origin/main",...bu.upstreamBranch&&"origin/main"!==bu.upstreamBranch?[bu.upstreamBranch]:[]]})})]})]}):(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("div",{className:"flex-1 min-w-0",children:(0,e.jsx)(U.e,{branches:bu.branches,selectedBranch:bu.selectedBranch,onSelect:a=>{bu.setSelectedBranch(a)},isLoading:bu.isLoadingBranches,pinnedBranches:["origin/main",...bu.upstreamBranch&&"origin/main"!==bu.upstreamBranch?[bu.upstreamBranch]:[]]})}),(0,e.jsx)("button",{onClick:()=>bu.toggleCompareMode(!0),className:"flex-shrink-0 px-2.5 py-1.5 text-xs font-medium rounded-lg transition-colors text-muted-foreground hover:text-foreground hover:bg-hover border border-border",title:as("fileBrowser.compareModeOn"),children:as("fileBrowser.compareMode")})]})}),(0,e.jsxs)("div",{className:"flex-1 overflow-hidden flex flex-col",children:[(0,e.jsxs)("div",{className:`flex-1 flex flex-col min-h-0 ${"tree"===aC?"":"hidden"}`,children:[bm.creatingItem&&(0,e.jsxs)("div",{className:"px-2 py-1.5 border-b border-border flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:bm.creatingItem.parentPath?as("fileBrowser.createFileIn",{path:bm.creatingItem.parentPath}):as("fileBrowser.createFile")}),(0,e.jsx)("input",{type:"text",autoFocus:!0,placeholder:as("fileBrowser.fileName"),className:"flex-1 px-2 py-1 text-sm border border-border rounded bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-ring",onCompositionStart:()=>{aH.current=!0},onCompositionEnd:()=>{aH.current=!1},onKeyDown:async a=>{if("Enter"===a.key){if(aH.current)return;let c=a.target.value.trim();if(!c)return;let d=bm.creatingItem.parentPath,e=d?`${d}/${c}`:c,f=await k.t4.runPromiseExit((0,l.OJ)({cwd:b,path:e,content:""}));if("Success"===f._tag&&f.value.ok)(0,s.oR)(as("toast.createdFile",{name:c}),"success"),bm.setCreatingItem(null),bm.loadDirectory(d),bm.loadFileIndex(),d&&bm.setExpandedPaths(a=>new Set([...a,d])),bH(e);else if("Success"===f._tag){let a=f.value.data?.error;(0,s.oR)(a||as("toast.createFailed"),"error")}else(0,s.oR)(as("toast.createFailed"),"error")}else"Escape"===a.key&&bm.setCreatingItem(null)},onBlur:()=>bm.setCreatingItem(null)})]}),bm.isLoadingFiles&&0===bm.files.length?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("common.loading")}):bm.fileError?(0,e.jsx)("div",{className:"p-4 text-center text-red-11 text-sm",children:bm.fileError}):(0,e.jsx)(t.h,{files:bm.files,selectedPath:bm.selectedPath,expandedPaths:bm.effectiveExpandedPaths,matchedPaths:bm.matchedPaths,gitStatusMap:bX,loadingDirs:bm.loadingDirs,onSelect:a=>{bm.setShouldScrollToSelected(!1),bH(a)},onToggle:bm.handleToggle,cwd:b,shouldScrollToSelected:bm.shouldScrollToSelected,onScrolledToSelected:()=>bm.setShouldScrollToSelected(!1),onCreateFile:a=>bm.setCreatingItem({type:"file",parentPath:a}),onDelete:(a,b,c)=>aL({path:a,isDirectory:b,name:c}),onRefresh:()=>bm.loadFiles(),onCopyFile:b1,onPaste:b2,onExplain:at?au:void 0,explainDisabled:at?.isLoading})]}),(0,e.jsx)("div",{className:`flex-1 flex flex-col min-h-0 ${"search"===aC?"":"hidden"}`,children:bq.isSearching?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):bq.searchError?(0,e.jsx)("div",{className:"p-4 text-center text-red-11 text-sm",children:bq.searchError}):0===bq.contentSearchResults.length?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:bq.contentSearchQuery?as("fileBrowser.noContentSearchResults"):as("fileBrowser.enterKeywordToSearch")}):(0,e.jsxs)("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:[bq.searchStats&&(0,e.jsxs)("div",{className:"px-3 py-1.5 text-xs text-muted-foreground border-b border-border flex-shrink-0",children:[as("fileBrowser.nFilesNMatches",{files:bq.searchStats.totalFiles,matches:bq.searchStats.totalMatches}),bq.searchStats.truncated&&(0,e.jsxs)("span",{className:"text-amber-11 ml-1",children:["(",as("fileBrowser.resultsTruncated"),")"]})]}),(0,e.jsx)(t.h,{files:bI.files,selectedPath:bm.selectedPath,expandedPaths:bJ,onSelect:a=>{let b=bI.matchMap.get(a);bH(a,b?.matches[0]?.lineNumber),aV||aW(!0)},onToggle:bL,cwd:b,onExplain:at?au:void 0,explainDisabled:at?.isLoading,renderActions:bM,className:"flex-1 overflow-y-auto py-1 min-w-max"})]})}),(0,e.jsx)("div",{className:`flex-1 flex flex-col min-h-0 ${"recent"===aC?"":"hidden"}`,children:0===bm.recentFiles.length?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("fileBrowser.noRecentFiles")}):(0,e.jsx)(t.h,{files:bm.recentFilesTree,selectedPath:bm.selectedPath,expandedPaths:bm.recentTreeDirPaths,onSelect:bH,onToggle:G.tE,cwd:b,onExplain:at?au:void 0,explainDisabled:at?.isLoading})}),(0,e.jsx)("div",{className:`flex-1 flex flex-col min-h-0 ${"status"===aC?"":"hidden"}`,children:br.statusLoading?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):br.statusError?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center p-4",children:(0,e.jsx)("span",{className:"text-red-11 text-sm",children:br.statusError})}):(0,e.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[(0,e.jsxs)("div",{className:"border-b border-border",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-secondary",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:as("fileBrowser.stagingArea",{count:br.status?.staged.length||0})}),(0,e.jsx)("button",{onClick:()=>br.fetchStatus(),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:as("fileBrowser.refreshChanges"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]}),(br.status?.staged.length||0)>0&&(0,e.jsx)("button",{onClick:br.handleUnstageAll,className:"text-sm text-amber-11 hover:text-amber-10 hover:underline",children:as("fileBrowser.unstageAll")})]}),(0,e.jsx)(u.VO,{files:br.stagedTree,selectedPath:br.statusSelectedFile?.type==="staged"?br.statusSelectedFile.file.path:null,expandedPaths:br.stagedExpandedPaths,onSelect:a=>a.file&&br.handleStatusFileSelect(a.file,"staged"),onToggle:br.handleStagedToggle,cwd:b,showChangeClass:!0,hideIndicatorsOnHover:!0,emptyMessage:as("fileBrowser.noStagedFiles"),className:"py-1",onExplain:at?av:void 0,explainDisabled:at?.isLoading,renderActions:a=>{if(a.isDirectory){let b=(0,u.wI)(a);return 0===b.length?null:(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),br.handleUnstageFiles(b.map(a=>a.path))},className:"hidden group-hover:block p-0.5 text-amber-11 hover:text-amber-10 hover:bg-amber-9/10 dark:hover:bg-amber-9/20 rounded transition-colors",title:as("fileBrowser.unstageNFiles",{count:b.length}),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})})}return(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),br.handleUnstage(a.path)},className:"hidden group-hover:block p-0.5 text-amber-11 hover:text-amber-10 hover:bg-amber-9/10 dark:hover:bg-amber-9/20 rounded transition-colors",title:as("fileBrowser.unstageFile"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})})}})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-secondary",children:[(0,e.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:as("fileBrowser.workspace",{count:br.status?.unstaged.length||0})}),(br.status?.unstaged.length||0)>0&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("button",{onClick:br.handleDiscardAll,className:"text-sm text-red-11 hover:text-red-10 hover:underline",children:as("fileBrowser.discardAll")}),(0,e.jsx)("button",{onClick:br.handleStageAll,className:"text-sm text-green-11 hover:text-green-10 hover:underline",children:as("fileBrowser.stageAll")})]})]}),(0,e.jsx)(u.VO,{files:br.unstagedTree,selectedPath:br.statusSelectedFile?.type==="unstaged"?br.statusSelectedFile.file.path:null,expandedPaths:br.unstagedExpandedPaths,onSelect:a=>a.file&&br.handleStatusFileSelect(a.file,"unstaged"),onToggle:br.handleUnstagedToggle,cwd:b,showChangeClass:!0,hideIndicatorsOnHover:!0,emptyMessage:as("fileBrowser.noUnstagedChanges"),className:"py-1",onExplain:at?aw:void 0,explainDisabled:at?.isLoading,renderActions:a=>{if(a.isDirectory){let b=(0,u.wI)(a);if(0===b.length)return null;let c=b.map(a=>a.file).filter(Boolean);return(0,e.jsxs)("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),br.handleDiscardFiles(c)},className:"p-0.5 text-red-11 hover:text-red-10 hover:bg-red-9/10 dark:hover:bg-red-9/20 rounded transition-colors",title:as("fileBrowser.discardNFiles",{count:b.length}),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}),(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),br.handleStageFiles(b.map(a=>a.path))},className:"p-0.5 text-green-11 hover:text-green-10 hover:bg-green-9/10 dark:hover:bg-green-9/20 rounded transition-colors",title:as("fileBrowser.stageNFiles",{count:b.length}),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})}return a.file?(0,e.jsxs)("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),br.handleDiscardFile(a.file)},className:"p-0.5 text-red-11 hover:text-red-10 hover:bg-red-9/10 dark:hover:bg-red-9/20 rounded transition-colors",title:as("fileBrowser.discardChanges"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),br.handleStage(a.path)},className:"p-0.5 text-green-11 hover:text-green-10 hover:bg-green-9/10 dark:hover:bg-green-9/20 rounded transition-colors",title:as("fileBrowser.stageFile"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]}):null}})]})]})}),(0,e.jsx)("div",{className:`flex-1 flex flex-col min-h-0 ${"history"===aC?"":"hidden"}`,children:bu.historyError?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("svg",{className:"w-16 h-16 mx-auto text-foreground-faint mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),(0,e.jsx)("p",{className:"text-muted-foreground",children:bu.historyError})]})}):bu.compareMode?(0,e.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:bu.isLoadingCompareFiles?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("fileBrowser.loadingDiff")}):0===bu.compareFiles.length?(0,e.jsxs)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:[(0,e.jsx)("div",{children:as("fileBrowser.noDiffFiles")}),"head"===bu.compareDiffMode&&(0,e.jsx)("button",{onClick:()=>bu.setCompareDiffMode("worktree"),className:"mt-2 text-xs text-brand hover:underline",children:as("fileBrowser.noDiffFilesHeadHint")})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border",children:[(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:as("worktree"===bu.compareDiffMode?"fileBrowser.nFilesChangedWorktree":"fileBrowser.nFilesChanged",{count:bu.compareFiles.length,branch:bu.compareBaseBranch})}),(0,e.jsxs)("span",{className:"flex flex-shrink-0 items-center gap-1.5 text-xs tabular-nums",children:[(0,e.jsxs)("span",{className:"text-green-11",children:["+",bA.additions]}),(0,e.jsxs)("span",{className:"text-red-11",children:["-",bA.deletions]})]})]}),(0,e.jsx)(u.VO,{files:bu.compareFileTree,expandedPaths:bu.compareExpandedPaths,onToggle:bu.handleCompareToggle,selectedPath:bu.compareSelectedFile?.path||null,onSelect:a=>{a.file&&bu.handleSelectCompareFile(a.file)},cwd:b,showChanges:!0,showChangeClass:!0,onExplain:at?bB:void 0,explainDisabled:at?.isLoading})]})}):(0,e.jsx)("div",{ref:bu.commitListRef,className:"flex-1 overflow-y-auto",onScroll:bu.handleCommitListScroll,children:bu.isLoadingCommits?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("fileBrowser.loadingCommits")}):0===bu.commits.length?(0,e.jsx)("div",{className:"p-4 text-center text-muted-foreground text-sm",children:as("fileBrowser.noCommits")}):(0,e.jsxs)(e.Fragment,{children:[bu.commits.map(a=>(0,e.jsxs)("div",{onClick:()=>bu.handleSelectCommit(a),className:`px-3 py-2 border-b border-border cursor-pointer hover:bg-hover ${bu.selectedCommit?.hash===a.hash?"bg-brand/10":""}`,children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[a.changeClass&&(0,e.jsx)(i.N,{cls:a.changeClass}),(0,e.jsx)("span",{className:"font-mono text-xs text-brand",children:a.shortHash}),(0,e.jsxs)("span",{className:"text-xs text-foreground-subtle","data-tooltip":a.date,children:[a.relativeDate," \xb7 ",(0,G.r6)(a.date)]})]}),(0,e.jsx)("div",{className:"text-sm text-foreground truncate mt-0.5","data-tooltip":a.subject,children:a.subject}),(0,e.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:a.author})]},a.hash)),bu.isLoadingMore&&(0,e.jsx)("div",{className:"p-3 text-center",children:(0,e.jsx)("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin"})}),!bu.hasMoreCommits&&bu.commits.length>0&&(0,e.jsx)("div",{className:"p-3 text-center text-xs text-foreground-subtle",children:as("fileBrowser.allLoaded",{count:bu.commits.length})})]})})})]})]}),(0,e.jsx)("div",{onPointerDown:ba,onPointerMove:bb,onPointerUp:bc,onPointerCancel:bc,className:"w-[5px] flex-shrink-0 relative cursor-col-resize group",children:(0,e.jsx)("div",{className:"absolute inset-y-0 left-1/2 -translate-x-1/2 w-px bg-border group-hover:bg-brand transition-colors"})}),(0,e.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden relative",children:[("tree"===aC||"search"===aC||"recent"===aC)&&(bm.blameSelectedCommit?(0,e.jsx)(o.n,{isOpen:!0,onClose:()=>bm.setBlameSelectedCommit(null),commit:bm.blameSelectedCommit,cwd:b,embedded:!0,initialFilePath:bm.selectedPath||void 0,onLocateInTree:b7,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):"map"===aE?b_&&b$.diff?(0,e.jsx)(P.r,{cwd:b,filePath:b$.diff.filePath,oldContent:b$.diff.oldContent,newContent:b$.diff.newContent,isNew:b$.diff.isNew,isDeleted:b$.diff.isDeleted,changedFiles:bs,fileGitStatusMap:bt,compact:"compact"===a3,enableComments:!0,onSwitchToCode:()=>aF("code"),onContentSearch:bZ,headerExtraLeft:ca,headerExtraRight:cb}):(0,e.jsx)(O.O,{cwd:b,highlightedFilePath:bm.selectedPath,changedFiles:bs,onSwitchToCode:()=>aF("code"),enableComments:!0,onContentSearch:bZ,headerExtraLeft:ca,headerExtraRight:cb}):bm.selectedPath?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"px-4 py-2 border-b border-border flex-shrink-0 flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 min-w-0",children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground truncate",children:bm.selectedPath}),(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),navigator.clipboard.writeText(`${b}/${bm.selectedPath}`),(0,s.oR)(as("common.copiedPath"))},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors flex-shrink-0",title:as("common.copyAbsPath"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),b7(bm.selectedPath)},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-hover transition-colors flex-shrink-0",title:as("fileBrowser.locateInTree"),children:(0,e.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10",strokeWidth:2}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3",strokeWidth:2}),(0,e.jsx)("path",{strokeLinecap:"round",strokeWidth:2,d:"M12 2v4m0 12v4M2 12h4m12 0h4"})]})})]}),(0,e.jsx)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:bm.showEditor?(0,e.jsxs)(e.Fragment,{children:[aT.isDirty&&(0,e.jsx)("span",{className:"text-xs text-amber-11",children:as("fileBrowser.unsaved")}),(0,e.jsx)("button",{onClick:()=>aS.current?.save(),disabled:!aT.isDirty||aT.isSaving,className:`px-1.5 py-0.5 text-xs rounded transition-colors ${aT.isDirty&&!aT.isSaving?"bg-brand text-white hover:bg-brand/90":"bg-secondary text-muted-foreground cursor-not-allowed"}`,children:aT.isSaving?(0,e.jsx)("span",{className:"inline-block w-3 h-3 border-2 border-current border-t-transparent rounded-full animate-spin"}):as("common.save")}),(0,e.jsx)("button",{onClick:()=>aS.current?.close(),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("fileBrowser.closeEdit"),children:as("fileBrowser.closeBtn")})]}):b_?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(q.y,{value:a3,onChange:a4}),(0,e.jsx)(r.q,{value:a5,onChange:a6}),!(0,x.e$)(bm.selectedPath)&&!(0,x.aR)(bm.selectedPath)&&!(0,x.Hz)(bm.selectedPath)&&!(0,x.Zy)(bm.selectedPath)&&(0,e.jsx)("button",{onClick:()=>aF("map"),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("blockViewer.viewerToggle.toBlock"),children:as("common.codeMap")}),(0,e.jsx)("button",{onClick:b$.toggleDiff,className:"px-1.5 py-0.5 text-xs rounded transition-colors bg-brand text-white",children:as("fileBrowser.exitDiff")})]}):(0,e.jsxs)(e.Fragment,{children:["tree"===aC&&b$.canDiff&&(0,e.jsx)("button",{onClick:b$.toggleDiff,className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("fileBrowser.viewDiff"),children:as("common.diff")}),bm.fileContent?.type==="text"&&(0,x.e$)(bm.selectedPath)&&(0,e.jsx)(J.ShareReviewToggle,{content:bm.fileContent.content||"",sourceFile:bm.selectedPath&&b&&bm.selectedPath.startsWith(b)?bm.selectedPath.slice(b.endsWith("/")?b.length:b.length+1):bm.selectedPath||""}),bm.fileContent?.type==="text"&&(0,x.Hz)(bm.selectedPath)&&bm.previewMarkdown&&!bm.showBlame&&(0,e.jsx)("div",{className:"flex items-center gap-0.5 rounded border border-border overflow-hidden",children:[!0,!1].map(a=>(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),bp(b=>({version:b.version+1,collapsed:a}))},className:`px-2 py-0.5 text-xs transition-colors ${bo.collapsed===a?"bg-brand text-white":"text-muted-foreground hover:bg-hover"}`,children:as(a?"fileBrowser.collapseAllJson":"fileBrowser.expandAllJson")},String(a)))}),bm.fileContent?.type==="text"&&((0,x.e$)(bm.selectedPath)||(0,x.aR)(bm.selectedPath)||(0,x.Hz)(bm.selectedPath)||(0,x.Zy)(bm.selectedPath))&&(am=(al=(0,x.aR)(bm.selectedPath))?bm.previewHtml:bm.previewMarkdown,(0,e.jsx)("button",{onClick:()=>al?bm.setPreviewHtml(a=>!a):bm.setPreviewMarkdown(a=>!a),className:`px-1.5 py-0.5 text-xs rounded transition-colors ${am?"bg-brand text-white":"text-muted-foreground hover:bg-hover"}`,children:am?as("fileBrowser.exitPreview"):as("common.preview")})),bm.fileContent?.type==="text"&&((0,x.C_)(bm.selectedPath||"")||(0,x.OG)(bm.selectedPath||""))&&(ao=(an=bm.selectedPath||"").startsWith("/")?an:b?`${b.replace(/\/$/,"")}/${an}`:an,ap=(0,x.OG)(an),(0,e.jsx)("button",{onClick:()=>void(ap?az(ao):ay(ao)),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover flex items-center",title:as(ap?"bots.addTooltip":"skills.addTooltip"),children:(0,e.jsx)(z.A,{className:"w-3.5 h-3.5"})})),bm.fileContent?.type==="text"&&(0,x.aR)(bm.selectedPath)&&(ar=(aq=bm.selectedPath||"").startsWith("/")?aq:b?`${b.replace(/\/$/,"")}/${aq}`:aq,(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("button",{onClick:()=>ax(ar),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover flex items-center",title:as("htmlApps.addTooltip"),children:(0,e.jsx)(z.A,{className:"w-3.5 h-3.5"})}),(0,e.jsx)("button",{onClick:()=>window.dispatchEvent(new CustomEvent("console-open-browser",{detail:{url:ar}})),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover flex items-center",title:as("common.openInConsole"),children:(0,e.jsx)(A.A,{className:"w-3.5 h-3.5"})}),(0,e.jsx)("button",{onClick:()=>{let a=(0,C.Xe)(ar);window.open((0,C.PB)(a,window.location.origin),"_blank")},className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover flex items-center",title:as("browser.openInNewWindow"),children:(0,e.jsx)(B.A,{className:"w-3.5 h-3.5"})})]})),bm.fileContent?.type==="text"&&!(bm.previewMarkdown&&((0,x.e$)(bm.selectedPath)||(0,x.Hz)(bm.selectedPath)||(0,x.Zy)(bm.selectedPath))||bm.previewHtml&&(0,x.aR)(bm.selectedPath))&&(0,e.jsx)("button",{onClick:bm.handleToggleBlame,disabled:bm.isLoadingBlame,className:`px-1.5 py-0.5 text-xs rounded transition-colors ${bm.showBlame?"bg-brand text-white":"text-muted-foreground hover:bg-hover"} disabled:opacity-50`,title:as("fileBrowser.viewBlame"),children:bm.isLoadingBlame?(0,e.jsx)("span",{className:"inline-block w-3 h-3 border border-current border-t-transparent rounded-full animate-spin"}):"Blame"}),bm.fileContent?.type==="text"&&!(bm.previewMarkdown&&((0,x.e$)(bm.selectedPath)||(0,x.Hz)(bm.selectedPath)||(0,x.Zy)(bm.selectedPath))||bm.previewHtml&&(0,x.aR)(bm.selectedPath))&&(0,e.jsx)("button",{onClick:()=>bm.setShowEditor(!0),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("fileBrowser.editFile"),children:as("common.edit")}),bm.fileContent?.type==="text"&&bm.fileContent.content&&(0,e.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(bm.fileContent.content),(0,s.oR)(as("toast.copiedFileContent"))},className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("fileBrowser.copyFileContent"),children:as("common.copy")}),bm.fileContent?.type==="text"&&!(0,x.e$)(bm.selectedPath)&&!(0,x.aR)(bm.selectedPath)&&!(0,x.Hz)(bm.selectedPath)&&!(0,x.Zy)(bm.selectedPath)&&(0,e.jsx)("button",{onClick:()=>aF("map"),className:"px-1.5 py-0.5 text-xs rounded transition-colors text-muted-foreground hover:bg-hover",title:as("blockViewer.viewerToggle.toBlock"),children:as("common.codeMap")})]})})]}),(0,e.jsx)("div",{className:"flex-1 overflow-hidden",children:bm.isLoadingContent?(0,e.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):bm.fileContent?"text"===bm.fileContent.type&&"string"==typeof bm.fileContent.content?b_?b$.isLoadingDiff&&!b$.diff?(0,e.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):b$.diff?"unified"===a5?(0,e.jsx)(p.xU,{oldContent:b$.diff.oldContent,newContent:b$.diff.newContent,filePath:b$.diff.filePath,cwd:b,enableComments:!0,compact:"compact"===a3,onContentSearch:bZ,onTokenHover:(a,b,c)=>bU(b$.diff?.filePath,!0,a,b,c),onTokenHoverLeave:bi.onTokenMouseLeave,onTokenHoverCancel:bi.clearHover}):(0,e.jsx)(p.xZ,{oldContent:b$.diff.oldContent,newContent:b$.diff.newContent,filePath:b$.diff.filePath,isNew:b$.diff.isNew,isDeleted:b$.diff.isDeleted,cwd:b,enableComments:!0,compact:"compact"===a3,onContentSearch:bZ,onTokenHover:(a,b,c)=>bU(b$.diff?.filePath,!0,a,b,c),onTokenHoverLeave:bi.onTokenMouseLeave,onTokenHoverCancel:bi.clearHover}):(0,e.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("p",{children:as("fileBrowser.diffLoadFailed")}),(0,e.jsx)("button",{onClick:b$.toggleDiff,className:"mt-2 text-brand hover:underline text-sm",children:as("fileBrowser.exitDiff")})]})}):bm.showBlame&&bm.blameError?(0,e.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("p",{className:"text-red-11",children:bm.blameError}),(0,e.jsx)("button",{onClick:()=>bm.setShowBlame(!1),className:"mt-2 text-brand hover:underline text-sm",children:as("fileBrowser.backToPreview")})]})}):bm.showBlame&&0===bm.blameLines.length&&bm.isLoadingBlame?(0,e.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,e.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):bm.previewMarkdown&&(0,x.Hz)(bm.selectedPath)&&!bm.showBlame?(0,e.jsxs)("div",{className:"h-full flex flex-col bg-background text-foreground",children:[(0,e.jsx)(ad._,{search:be}),(0,e.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,e.jsx)("pre",{ref:bd,className:"whitespace-pre-wrap break-words font-mono",style:{fontSize:"0.8125rem",lineHeight:"1.5"},children:(0,e.jsx)(x.d9.Provider,{value:bo,children:bn})})})]}):bm.previewMarkdown&&(0,x.Zy)(bm.selectedPath)&&!bm.showBlame?(0,e.jsx)(y.C0,{content:bm.fileContent.content,filePath:bm.selectedPath,className:"h-full"}):bm.previewMarkdown&&(0,x.e$)(bm.selectedPath)&&!bm.showBlame?(0,e.jsx)("div",{className:"h-full flex flex-col",children:(0,e.jsx)(H.M,{content:bm.fileContent.content,filePath:bm.selectedPath,cwd:b,embedded:!0,onLocalMdLink:ce,scrollToAnchor:cc})}):bm.previewHtml&&(0,x.aR)(bm.selectedPath)&&!bm.showBlame?(0,e.jsx)(I.O,{content:bm.fileContent.content,filePath:bm.selectedPath,cwd:b,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):(0,e.jsx)(w.Cv,{ref:aS,content:bm.fileContent.content,filePath:bm.selectedPath,cwd:b,enableComments:!0,scrollToLine:aQ??bm.targetLineNumber,scrollToLineAlign:null!=aQ?"start":bm.targetScrollAlign,onScrollToLineComplete:()=>{aR(null),bm.setTargetLineNumber(null)},highlightKeyword:"search"===aC?bq.contentSearchQuery:null,visibleLineRef:aO,viStateRef:aP,initialCursorLine:bm.initialCursorLine,initialCursorCol:bm.initialCursorCol,onInitialCursorSet:()=>{bm.setInitialCursorLine(null),bm.setInitialCursorCol(null)},onCmdClick:bQ?bT:void 0,onTokenHover:bQ?bV:void 0,onTokenHoverLeave:bQ?bi.onTokenMouseLeave:void 0,onTokenHoverCancel:bQ?bi.clearHover:void 0,blameLines:bm.showBlame&&bm.blameLines.length>0?bm.blameLines:void 0,inlineBlameLines:bm.blameLines.length>0?bm.blameLines:void 0,onSelectCommit:bm.setBlameSelectedCommit,editable:bm.showEditor,initialMtime:bm.fileContent.mtime,onEditorClose:a=>{bm.setShowEditor(!1),aR(a)},onSaved:()=>{let a=aO.current??1;bm.loadFileContent(bm.selectedPath),bm.setShowEditor(!1),aR(a)},onEditorStateChange:aU,viMode:!0,onContentMutate:bD,onEnterInsertMode:bE,onViSave:bF,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):"image"===bm.fileContent.type&&bm.selectedPath?(0,e.jsx)(V.I,{cwd:b,path:bm.selectedPath,refreshKey:bm.fileContent.mtime,alt:bm.selectedPath}):"pdf"===bm.fileContent.type&&bm.selectedPath?(0,e.jsx)(W.t,{cwd:b,path:bm.selectedPath,refreshKey:bm.fileContent.mtime}):(0,e.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("svg",{className:"w-16 h-16 mx-auto text-foreground-faint mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,e.jsx)("p",{children:bm.fileContent.message||as("fileBrowser.cannotPreview")})]})}):(0,e.jsx)("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:as("fileBrowser.selectFileToPreview")})})]}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("svg",{className:"w-16 h-16 mx-auto text-foreground-faint mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,e.jsx)("p",{children:as("fileBrowser.selectFileToPreview")})]})})),"status"===aC&&(br.statusSelectedFile&&br.statusDiff?(0,e.jsx)(Q.m,{cwd:b,selected:br.statusSelectedFile,diff:br.statusDiff,showMarkdownPreview:br.showStatusDiffPreview,setShowMarkdownPreview:br.setShowStatusDiffPreview,changedFiles:bs,fileGitStatusMap:bt,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)},locateInTree:b7,setJsonPreview:aY,onTokenHover:(a,b,c)=>bU(br.statusDiff?.filePath,!0,a,b,c),onTokenHoverLeave:bi.onTokenMouseLeave,onTokenHoverCancel:bi.clearHover}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-foreground-subtle",children:(0,e.jsx)("span",{children:as("fileBrowser.selectFileToViewDiff")})})),"history"===aC&&!bu.historyError&&(bu.compareMode?bu.isLoadingCompareDiff?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:as("fileBrowser.loadingDiffContent")}):bu.compareFileDiff?(0,e.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden relative",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-border flex-shrink-0",children:[(0,e.jsx)(T.d,{cwd:b,filePath:bu.compareFileDiff.filePath,onLocateInTree:b7}),!(0,G.u)(bu.compareFileDiff.filePath)&&(0,e.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,e.jsx)(q.y,{value:a_,onChange:a0}),(0,e.jsx)(r.q,{value:a1,onChange:a2})]})]}),(0,e.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,G.u)(bu.compareFileDiff.filePath)?(0,e.jsx)(S.M,{cwd:b,filePath:bu.compareFileDiff.filePath,oldRev:bu.compareFileDiff.oldRev??(bu.compareFileDiff.isNew?null:bu.compareBaseBranch),newRev:"worktree"===bu.compareDiffMode?null:bu.compareFileDiff.newRev??(bu.compareFileDiff.isDeleted?null:"HEAD"),newNode:bu.compareFileDiff.newWorktree?(0,e.jsx)(V.I,{cwd:b,path:bu.compareFileDiff.filePath}):void 0}):"unified"===a1?(0,e.jsx)(p.xU,{oldContent:bu.compareFileDiff.oldContent,newContent:bu.compareFileDiff.newContent,filePath:bu.compareFileDiff.filePath,cwd:b,enableComments:!0,compact:"compact"===a_,onPreview:bx,previewLabel:bw.endsWith(".json")?as("common.readable"):as("common.preview"),onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):(0,e.jsx)(p.xZ,{oldContent:bu.compareFileDiff.oldContent,newContent:bu.compareFileDiff.newContent,filePath:bu.compareFileDiff.filePath,isNew:bu.compareFileDiff.isNew,isDeleted:bu.compareFileDiff.isDeleted,cwd:b,enableComments:!0,compact:"compact"===a_,onPreview:bx,previewLabel:bw.endsWith(".json")?as("common.readable"):as("common.preview"),onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}})}),aZ&&(0,e.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-scrim",onClick:()=>a$(null),children:(0,e.jsx)("div",{className:"bg-card rounded-lg shadow-lv3 w-full max-w-[90%] h-full flex flex-col",onClick:a=>a.stopPropagation(),children:(0,e.jsx)(H.M,{content:aZ.content,filePath:aZ.filePath,cwd:b,onClose:by})})})]}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-foreground-subtle",children:(0,e.jsx)("span",{children:bu.compareFiles.length>0?as("fileBrowser.selectFileToViewDiff"):as("fileBrowser.clickCompareToLoad")})}):bu.selectedCommit?(0,e.jsx)(o.n,{isOpen:!0,onClose:()=>bu.setSelectedCommit(null),commit:bu.selectedCommit,cwd:b,embedded:!0,onLocateInTree:b7,onContentSearch:a=>{aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)}}):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-foreground-subtle",children:(0,e.jsx)("span",{children:as("fileBrowser.selectCommitToView")})})),aX&&(0,e.jsx)(R.A,{preview:aX,onClose:bz,search:bg,preRef:bf})]})]}),aM&&(0,e.jsx)(K.c,{files:bm.files,fileIndex:bm.fileIndex,recentFiles:bm.recentFilePaths,onSelectFile:a=>{bH(a),bm.setShouldScrollToSelected(!0),aD("tree")},onClose:()=>aN(!1)}),(bN||bj.visible)&&(0,e.jsxs)("div",{className:`flex ${bj.visible&&bN?"":"flex-col"}`,children:[bN&&(0,e.jsx)("div",{className:bj.visible?"flex-1 min-w-0 border-r border-border":"",children:(0,e.jsx)(ah.D,{results:bq.contentSearchResults,loading:bq.isSearching,totalMatches:bq.searchStats?.totalMatches??0,onSelect:(a,b)=>{bm.selectedPath&&bk.push({filePath:bm.selectedPath,lineNumber:aO.current}),aF("code"),bH(a,b)},onClose:()=>aW(!1),scope:bO,onScopeChange:bP,selectedPath:bm.selectedPath})}),bj.visible&&(0,e.jsx)("div",{className:bN?"flex-1 min-w-0":"",children:(0,e.jsx)(ag.D,{references:bj.references,loading:bj.loading,onSelect:bW,onClose:bj.closeReferences})})]})]}),aK&&(0,e.jsx)(j.ZL,{children:(0,e.jsx)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-scrim",onClick:()=>aL(null),children:(0,e.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-lv3 p-4 max-w-sm w-full mx-4",onClick:a=>a.stopPropagation(),children:[(0,e.jsx)("h3",{className:"text-sm font-medium text-foreground mb-2",children:as("fileBrowser.confirmDelete")}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:as("fileBrowser.confirmDeleteMessage",{name:aK.name}).split(/<\/?file>/g).map((a,b)=>1===b?(0,e.jsx)("span",{className:"font-mono text-foreground",children:a},b):a)}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)("button",{onClick:()=>aL(null),className:"px-3 py-1.5 text-sm rounded border border-border hover:bg-hover transition-colors",children:as("common.cancel")}),(0,e.jsx)("button",{onClick:async()=>{let{path:a,name:c}=aK;aL(null);let d=await k.t4.runPromiseExit((0,l.VK)({cwd:b,path:a}));if("Success"===d._tag){(0,s.oR)(as("toast.movedToTrash",{name:c}),"success");let b=a.includes("/")?a.substring(0,a.lastIndexOf("/")):"";bm.loadDirectory(b),bm.loadFileIndex(),bm.selectedPath===a&&bH("")}else{let a="Fail"===d.cause._tag?d.cause.error:null,b=a?.cause,c=b instanceof Error?b.message:as("toast.deleteFailed");(0,s.oR)(c,"error")}},className:"px-3 py-1.5 text-sm rounded bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors",children:as("common.delete")})]})]})})}),bi.hoverInfo&&aI&&(0,h.createPortal)((0,e.jsx)(af.s,{ref:bi.setTooltipEl,displayString:bi.hoverInfo.displayString,documentation:bi.hoverInfo.documentation,x:bi.hoverInfo.x,y:bi.hoverInfo.y,container:aI,onMouseEnter:bi.onCardMouseEnter,onMouseLeave:bi.onCardMouseLeave,onFindReferences:bR?void 0:()=>{let{filePath:a,line:b,column:c}=bi.hoverInfo;bi.clearHover(),bj.findReferences(a,b,c)},onSearch:a=>{bi.clearHover(),aD("search"),bq.setContentSearchQuery(a),bq.performContentSearch(a)},onExplain:at?a=>{let{filePath:b,line:c}=bi.hoverInfo;bi.clearHover(),at.sendMessage(as("explain.symbolMessage",{name:a,path:b,lines:String(c)}))}:void 0,explainDisabled:at?.isLoading}),aI)]})});d()}catch(a){d(a)}})},70440:(a,b,c)=>{"use strict";function d(){return[{type:"image/x-icon",sizes:"16x16",url:"/favicon.ico?a49a3c8f7b751288"}]}c.r(b),c.d(b,{default:()=>d})},70596:(a,b,c)=>{"use strict";c.d(b,{t:()=>g});var d=c(48249),e=c(67484),f=c(44384);function g({x:a,y:b,comment:c,container:h,onClose:i,onUpdateComment:j,onDeleteComment:k}){let{t:l}=(0,f.Bd)(),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(c.content),q=(0,e.useRef)(null),[r,s]=(0,e.useState)({x:0,y:0}),t=async()=>{o.trim()&&(await j(c.id,o.trim()),n(!1))},u=async()=>{await k(c.id),i()};return(0,d.jsx)("div",{ref:q,className:"absolute z-[200] w-96 bg-card border border-border rounded-lg shadow-lv2 overflow-hidden",style:{left:r.x,top:r.y},children:(0,d.jsx)("div",{className:"p-3",children:m?(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("textarea",{value:o,onChange:a=>p(a.target.value),className:"w-full px-2 py-1.5 text-sm border border-border rounded bg-card resize-none focus:outline-none focus:ring-1 focus:ring-ring",rows:3,autoFocus:!0,onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||(a.preventDefault(),t()),"Escape"===a.key&&(n(!1),p(c.content))}}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{onClick:()=>{n(!1),p(c.content)},className:"px-2 py-1 text-xs text-muted-foreground hover:text-foreground",children:l("common.cancel")}),(0,d.jsx)("button",{onClick:t,className:"px-2 py-1 text-xs bg-brand text-white rounded hover:bg-brand/90",children:l("common.save")})]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:c.content}),(0,d.jsxs)("div",{className:"mt-2 flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:l("comments.lineRange",{start:c.startLine,end:c.endLine})}),(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)("button",{onClick:()=>n(!0),className:"p-1 rounded hover:bg-hover text-muted-foreground",title:l("common.edit"),children:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,d.jsx)("button",{onClick:u,className:"p-1 rounded hover:bg-hover text-muted-foreground hover:text-red-9",title:l("common.delete"),children:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})]})})})}},71192:(a,b,c)=>{"use strict";c.d(b,{m_:()=>f,uV:()=>e});var d=c(81218);class e extends d.rN("AppError"){}d.rN("DBError"),d.rN("WSError"),d.rN("FSError"),d.rN("AgentError"),d.rN("ValidationError");class f extends d.rN("NotFoundError"){}d.rN("PermissionError")},71697:(a,b,c)=>{"use strict";c.d(b,{V:()=>k,n:()=>j});var d=c(48249),e=c(67484),f=c(44384);c(59336);var g=c(15332);c(81608);var h=c(33281),i=c(41224);function j({value:a,onChange:b,textareaRef:c,extraCommands:d}){let[f,k]=(0,e.useState)(a.length),[l,m]=(0,e.useState)([]),[n,o]=(0,e.useState)([]),[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(0),[t,u]=(0,e.useState)(()=>a.length>0),v=(0,e.useRef)(null);(0,e.useCallback)(async()=>{let a=await h.t4.runPromiseExit((0,i.l1)());if("Success"===a._tag){let b=a.value.skills??a.value;o((Array.isArray(b)?b:[]).filter(a=>a.valid&&!!a.name).map(a=>({name:`/${a.name}`,description:a.description||"",source:"skill",skillPath:a.path,argumentHint:a.argumentHint})))}else console.error("Failed to load skills:",a.cause)},[]),(0,e.useCallback)(async()=>{let a=await h.t4.runPromiseExit((0,g.jm)());"Success"===a._tag?q(a.value.flatMap(a=>a.valid?[{name:`@${a.name}`,description:a.description,source:"bot"}]:[])):console.error("Failed to load bots:",a.cause)},[]);let w=(0,e.useMemo)(()=>{let b=0===f?0:a.lastIndexOf("\n",f-1)+1,c=a.indexOf("\n",f),d=-1===c?a.length:c;return{text:a.slice(b,d),start:b,end:d}},[a,f]),x=(0,e.useMemo)(()=>{let a=w.text.match(/^\s*(\/@|\/|@)([a-zA-Z0-9-]*)$/);return a?{marker:a[1],verb:a[2].toLowerCase()}:null},[w.text]),y=(0,e.useMemo)(()=>{if(!x)return[];let{verb:a}=x,b=b=>b.name.slice(1).toLowerCase().startsWith(a);return"@"===x.marker?p.filter(b):[...(d??[]).filter(b),...l.filter(b),...n.filter(b)]},[x,d,l,n,p]),z=!t&&!!x&&y.length>0;(0,e.useRef)(a);let A=(0,e.useCallback)(a=>{k(a.selectionStart??0)},[]),B=(0,e.useCallback)(d=>{let e=x?.marker??"/",f=`${e}${d.name.slice(1)} `,g=a.slice(0,w.start),h=a.slice(w.end),i=g.length+f.length;b(g+f+h),k(i),requestAnimationFrame(()=>{let a=c.current;a&&(a.focus(),a.setSelectionRange(i,i))})},[a,w,x,b,c]),C=(0,e.useCallback)(a=>{if(a.nativeEvent.isComposing||!z||0===y.length)return!1;let b=()=>{a.preventDefault(),a.stopPropagation()};return"ArrowDown"===a.key?(b(),s(a=>(a+1)%y.length),!0):"ArrowUp"===a.key?(b(),s(a=>(a-1+y.length)%y.length),!0):"Enter"===a.key||"Tab"===a.key?(b(),B(y[r]),!0):"Escape"===a.key&&(b(),u(!0),!0)},[z,y,r,B]);return{isOpen:z,items:y,selectedIndex:r,marker:x?.marker??"/",listRef:v,selectCommand:B,handleKeyDown:C,trackCaret:A}}function k({ac:a,className:b=""}){let{t:c}=(0,f.Bd)(),{isOpen:e,items:g,selectedIndex:h,marker:i,listRef:j,selectCommand:l}=a;return e&&0!==g.length?(0,d.jsx)("div",{ref:j,className:`overflow-y-auto bg-card border border-border rounded-lg shadow-lv2 ${b}`,children:g.map((a,b)=>{let e=b>0?g[b-1]:null,f="skill"===a.source&&(!e||"skill"!==e.source),j="bot"===a.source&&(!e||"bot"!==e.source),k="builtin"===a.source&&0===b;return(0,d.jsxs)("div",{children:[k&&(0,d.jsx)("div",{className:"px-4 py-1 text-[10px] uppercase tracking-wider text-muted-foreground bg-muted/40",children:"Commands"}),f&&(0,d.jsx)("div",{className:"px-4 py-1 text-[10px] uppercase tracking-wider text-muted-foreground bg-muted/40",children:"Skills"}),j&&(0,d.jsx)("div",{className:"px-4 py-1 text-[10px] uppercase tracking-wider text-muted-foreground bg-muted/40",children:"Bots"}),(0,d.jsxs)("div",{onClick:()=>l(a),className:`px-4 py-2 cursor-pointer ${b===h?"bg-brand/10":"hover:bg-hover"}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"font-mono text-sm font-medium text-foreground",children:i+a.name.slice(1)}),(0,d.jsx)("span",{className:"flex-1 text-sm text-muted-foreground truncate",children:"builtin"===a.source?c(`commands.${a.name.slice(1)}`,{defaultValue:a.description}):a.description}),(0,d.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded ${(a=>{switch(a){case"builtin":return"bg-brand/15 text-brand dark:bg-brand/25 dark:text-teal-11";case"skill":return"bg-purple-9/15 text-purple-11 dark:bg-purple-9/25 dark:text-purple-11";case"bot":return"bg-teal-9/15 text-teal-11 dark:bg-teal-9/25 dark:text-teal-11"}})(a.source)}`,children:(a=>{switch(a){case"builtin":return c("common.builtin");case"skill":return"Skill";case"bot":return"Bot"}})(a.source)})]}),"skill"===a.source&&a.argumentHint&&(0,d.jsx)("div",{className:"font-mono text-xs text-muted-foreground mt-0.5 pl-0 truncate",children:a.argumentHint})]})]},a.name)})}):null}},72399:(a,b,c)=>{"use strict";c.d(b,{ProjectSidebar:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ProjectSidebar() from the server but ProjectSidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/ProjectSidebar.tsx","ProjectSidebar")},72529:(a,b,c)=>{"use strict";c.d(b,{m:()=>f});var d=c(48249),e=c(67484);function f({content:a,children:b,className:c}){if(c)return(0,d.jsx)("div",{"data-tooltip":a,className:c,children:b});let g=e.Children.toArray(b);if(1===g.length&&(0,e.isValidElement)(g[0])){let b=g[0];return(0,e.cloneElement)(b,{"data-tooltip":a})}return(0,d.jsx)("div",{"data-tooltip":a,style:{display:"contents"},children:b})}},72899:(a,b,c)=>{"use strict";c.d(b,{O:()=>ab});var d=c(48249),e=c(67484),f=c(44384),g=c(10316),h=c(46674),i=c(80600),j=c(69924);c(33281),c(85655),c(87808);var k=c(33982),l=c(34622),m=c(34948),n=c(26875),o=c(87148),p=c(82633);function q({kind:a,qname:b,className:c}){let e=`${(function(a,b){if("__file__"===b||"__preamble__"===b||b&&b.startsWith("__heading_"))return"text-muted-foreground/60";switch(a){case"function":case"method":return"text-violet-11";case"class":return"text-amber-11";case"interface":return"text-blue-11";default:return"text-muted-foreground/60"}})(a,b)} ${c??""}`.trim();if("__file__"===b)return(0,d.jsx)(i.A,{className:e});if("__preamble__"===b)return(0,d.jsx)(k.A,{className:e});if(b&&b.startsWith("__heading_"))return(0,d.jsx)(l.A,{className:e});switch(a){case"function":case"method":return(0,d.jsx)(m.A,{className:e});case"class":return(0,d.jsx)(n.A,{className:e});case"interface":return(0,d.jsx)(o.A,{className:e});default:return(0,d.jsx)(p.A,{className:e})}}var r=c(85984),s=c(29939);function t({cwd:a}){let{t:b}=(0,f.Bd)(),[c,g]=(0,e.useState)(null),h=(0,e.useCallback)(b=>{b?.type==="graphProgress"&&b.data&&b.data.cwd===a&&g(b.data)},[a]);(0,s.h)({url:`/ws/watch?cwd=${encodeURIComponent(a)}`,onMessage:h});let i=(0,e.useRef)("");if(c?.currentFile&&(i.current=c.currentFile),!c)return(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:b("blockViewer.fileMode.loading","Loading…")});let j=b(`blockViewer.buildProgress.${c.phase}`,u[c.phase]),k=Math.max(0,Math.min(100,Math.round(c.percent)));return(0,d.jsx)("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-8",children:(0,d.jsxs)("div",{className:"w-full max-w-md flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-baseline justify-between text-xs text-muted-foreground",children:[(0,d.jsx)("span",{children:j}),(0,d.jsx)("span",{className:"tabular-nums",children:"parsing"===c.phase&&c.filesTotal>0?`${c.filesDone} / ${c.filesTotal}`:`${k}%`})]}),(0,d.jsx)("div",{className:"h-1 w-full overflow-hidden rounded-full bg-muted",children:(0,d.jsx)("div",{className:"h-full rounded-full bg-primary transition-[width] duration-150 ease-linear",style:{width:`${k}%`}})}),(0,d.jsx)("div",{className:"h-4 truncate text-left font-mono text-[11px] leading-4 text-muted-foreground/70",dir:"rtl",title:"done"===c.phase?"":i.current,children:"done"===c.phase?"":i.current})]})})}let u={listing:"Listing files…",contexts:"Reading project config…",parsing:"Parsing files",resolving:"Resolving imports…",edges:"Building call graph…",done:"Finishing up…"};var v=c(7031),w=c(74754),x=c(91579),y=c(83768),z=c(36984),A=c(72529);function B({entries:a,onSelect:b,onClear:c}){let{t:e}=(0,f.Bd)();return(0,d.jsxs)("div",{className:"flex-1 min-h-0 bg-card flex flex-col","data-testid":"function-history-drawer",children:[(0,d.jsxs)("div",{className:"flex-shrink-0 px-2 py-1.5 border-b border-border flex items-center justify-between gap-1",children:[(0,d.jsx)("div",{className:"flex items-center text-xs text-muted-foreground font-mono min-w-0",children:(0,d.jsx)("span",{className:"truncate",children:0===a.length?e("blockViewer.history.title"):`${e("blockViewer.history.title")} \xb7 ${a.length}/15`})}),a.length>0&&(0,d.jsx)(A.m,{content:e("blockViewer.history.clear"),children:(0,d.jsx)("button",{onClick:c,className:"flex-shrink-0 text-muted-foreground hover:text-foreground p-0.5 rounded hover:bg-secondary",children:(0,d.jsx)(h.A,{className:"w-3 h-3"})})})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:0===a.length?(0,d.jsx)("div",{className:"px-3 py-4 text-[10px] text-muted-foreground/60 italic leading-relaxed",children:e("blockViewer.history.empty")}):a.map((a,c)=>{var e;let f;return(0,d.jsx)(A.m,{content:`${a.qname} \xb7 ${a.filePath}`,children:(0,d.jsxs)("button",{onClick:()=>b(a),className:"w-full text-left px-2 py-1.5 border-b border-border/50 hover:transition-colors group flex items-start gap-1.5",children:[(0,d.jsx)(q,{kind:a.kind??"unknown",qname:a.qname,className:"w-3 h-3 mt-0.5 flex-shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-xs font-mono font-medium truncate",children:a.name}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/70 truncate",children:[(f=(e=a.filePath).lastIndexOf("/"))>=0?e.slice(f+1):e,a.kind&&(0,d.jsxs)("span",{className:"ml-1 opacity-60",children:["\xb7 ",a.kind]})]})]})]})},`${a.filePath}::${a.qname}::${c}`)})})]})}function C(a,b){let c=a.filter(a=>a.filePath!==b.filePath||a.qname!==b.qname),d=[b,...c];return d.length>15?d.slice(0,15):d}var D=c(65543);function E({functions:a,counts:b,totalLines:c,currentQname:g,onSelect:h,notIndexed:i,onRebuild:j}){let{t:k}=(0,f.Bd)(),l=(0,e.useMemo)(()=>a.filter(D._),[a]);return(0,d.jsxs)("div",{className:"flex-1 min-h-0 bg-card flex flex-col","data-testid":"file-toc-section",children:[(0,d.jsxs)("div",{className:"flex-shrink-0 px-2 py-1.5 border-b border-border text-xs text-muted-foreground font-mono truncate",children:[k("blockViewer.toc.title"),l.length>0&&` \xb7 ${l.length}`,null!=c&&` \xb7 ${c} ${k("common.lines")}`]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto",children:0===l.length?i?(0,d.jsxs)("div",{className:"px-3 py-4 text-[10px] text-muted-foreground/80 leading-relaxed flex flex-col gap-2",children:[(0,d.jsx)("span",{className:"italic",children:k("blockViewer.toc.notIndexed")}),j&&(0,d.jsx)("button",{type:"button",onClick:j,className:"self-start px-2 py-1 rounded border border-border bg-secondary/60 hover:bg-secondary text-[10px] text-foreground transition-colors",children:k("blockViewer.refresh")})]}):(0,d.jsx)("div",{className:"px-3 py-4 text-[10px] text-muted-foreground/60 italic leading-relaxed",children:k("blockViewer.toc.empty")}):l.map(a=>{let c=g===a.qualifiedName,e=b?.get(a.qualifiedName),f=e?[e.in>0&&["in",e.in,"text-amber-11/80"],e.out>0&&["out",e.out,"text-green-11/80"],e.self>0&&["self",e.self,"text-muted-foreground/60"]].filter(Boolean):[];return(0,d.jsx)(A.m,{content:`${a.qualifiedName} \xb7 L${a.startLine}`,children:(0,d.jsxs)("button",{onClick:()=>h(a.qualifiedName,a.startLine),className:`w-full text-left px-2 py-1 transition-colors flex items-start gap-1.5 min-w-0 ${c?"bg-brand/15 hover:bg-brand/20":"hover:bg-secondary/60"}`,children:[(0,d.jsx)(q,{kind:a.kind,qname:a.qualifiedName,className:"w-3 h-3 flex-shrink-0 mt-0.5"}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1.5 min-w-0",children:[(0,d.jsx)("span",{className:`flex-1 min-w-0 text-xs font-mono truncate ${c?"font-semibold text-brand":""}`,children:a.name}),(0,d.jsx)("span",{className:"flex-shrink-0 text-[10px] text-muted-foreground/50 tabular-nums",children:a.endLine-a.startLine+1})]}),f.length>0&&(0,d.jsx)("span",{className:"block text-[10px] font-mono truncate",children:f.map(([a,b,c],e)=>(0,d.jsxs)("span",{className:c,children:[e>0&&(0,d.jsx)("span",{className:"text-muted-foreground/30",children:" \xb7 "}),a," ",b]},a))})]})]})},a.qualifiedName)})})]})}var F=c(37690),G=c(22341);function H({comments:a,startLine:b,endLine:c,lineHeight:e,bodyTopOffset:f,rowOf:g,onCommentClick:h}){let i=new Map;for(let d of a){if(d.endLine<b||d.endLine>c)continue;let a=i.get(d.endLine);a?a.push(d):i.set(d.endLine,[d])}return 0===i.size?null:(0,d.jsx)("div",{className:"absolute top-0 right-0 bottom-0 w-6 pointer-events-none",children:Array.from(i.entries()).map(([a,c])=>{let i=g?g(a):a-b,j=c[0],k=c.length-1;return(0,d.jsx)(A.m,{content:1===c.length?j.content:`${c.length} comments — click to view`,children:(0,d.jsxs)("button",{onClick:a=>h(j,a),className:"pointer-events-auto absolute right-1 w-4 h-4 rounded-full bg-amber-9/70 hover:bg-amber-11 text-white flex items-center justify-center shadow-lv1 transition-colors",style:{top:`${f+i*e+e/2-8}px`},children:[(0,d.jsx)(G.A,{className:"w-2.5 h-2.5"}),k>0&&(0,d.jsx)("span",{className:"absolute -top-1 -right-1 bg-amber-11 text-white rounded-full text-[8px] leading-none w-3 h-3 flex items-center justify-center",children:k+1})]})},a)})})}function I(a,b){for(let c=0;c<a.blocks.length;c++){let d=a.blocks[c];if(b>=d.startLine&&b<=d.endLine)return a.prefix[c]+(b-d.startLine)}return null}function J({addedLines:a,blockRanges:b,viewportRange:c,onJumpToLine:f}){let g,h=(0,e.useRef)(null),i=(0,e.useMemo)(()=>(function(a){let b=[...a].sort((a,b)=>a.startLine-b.startLine),c=[0];for(let a of b){let b=Math.max(0,a.endLine-a.startLine+1);c.push(c[c.length-1]+b)}return{blocks:b,prefix:c,total:c[c.length-1]}})(b),[b]),j=(0,e.useMemo)(()=>{if(i.total<=0||0===a.size)return[];let b=[];for(let c of a){let a=i.blocks.find(a=>c>=a.startLine&&c<=a.endLine);a&&b.push({line:c,qname:a.qname})}b.sort((a,b)=>a.line-b.line);let c=[],d=null;for(let a of b)d&&a.line===d.end+1&&a.qname===d.qname?d.end=a.line:(d&&c.push(d),d={start:a.line,end:a.line,qname:a.qname});return d&&c.push(d),c},[a,i]);if(i.total<=0)return null;let k=(a,b)=>{let c=I(i,a),d=I(i,b);return null===c||null===d?null:{top:c/i.total*100,heightPct:(d-c+1)/i.total*100}};return(0,d.jsxs)("div",{ref:h,onClick:a=>{let b=h.current;if(!b)return;let c=b.getBoundingClientRect();if(c.height<=0)return;let d=function(a,b){if(a.total<=0)return null;let c=Math.max(0,Math.min(a.total-1,b));for(let b=0;b<a.blocks.length;b++){let d=a.prefix[b],e=a.prefix[b+1];if(c>=d&&c<e){let e=a.blocks[b];return{qname:e.qname,line:e.startLine+Math.round(c-d)}}}return null}(i,(a.clientY-c.top)/c.height*i.total);if(!d)return;let e=d.line,g=j.find(a=>a.qname===d.qname&&e>=a.start&&e<=a.end);if(g)return void f(g.qname,e);if(j.length>0){let a=Math.max(2,Math.round(.05*i.total)),b=I(i,e);if(null!==b){let c=null,d=1/0;for(let a of j){let e=I(i,a.start),f=I(i,a.end);if(null===e||null===f)continue;let g=b<e?e-b:b>f?b-f:0;g<d&&(c=a,d=g)}if(c&&d<=a){let a=e<c.start?c.start:e>c.end?c.end:e;f(c.qname,a);return}}}let k=i.blocks.find(a=>a.qname===d.qname);k&&f(k.qname,k.startLine)},className:"w-4 flex-shrink-0 bg-secondary border-l border-border relative cursor-pointer",title:"Diff minimap — click to jump",children:[j.map(a=>{let b=k(a.start,a.end);return b?(0,d.jsx)("div",{className:"absolute left-0 right-0 bg-green-9 pointer-events-none",style:{top:`${b.top}%`,height:`${b.heightPct}%`,minHeight:"2px"}},`run:${a.qname}:${a.start}-${a.end}`):null}),c&&c.end>=c.start&&((g=k(c.start,c.end))?(0,d.jsx)("div",{className:"absolute left-0 right-0 bg-muted/60 border-y border-border pointer-events-none",style:{top:`${g.top}%`,height:`${Math.max(1.2,g.heightPct)}%`}}):null)]})}var K=c(73414),L=c(41051),M=c(42140),N=c(70596);function O(a){let b=a.lastIndexOf("/");return b>=0?a.slice(b+1):a}function P(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let Q="flex-shrink-0 h-4 leading-4 px-1.5 rounded text-[10px] text-brand hover:bg-brand/10 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent";function R({symbol:a,fileSource:b,hasChange:c,onHighlighted:g,comments:h,onCommentClick:i,addedLines:j,upstream:k,downstream:l,fold:m,onExpandGap:n}){let{resolvedTheme:o}=(0,y.DP)(),{t:p}=(0,f.Bd)(),r=(0,v.r)(),s=(k?.length??0)+(l?.length??0)>0;(0,e.useMemo)(()=>(0,z.sQ)(a.filePath),[a.filePath]);let[t,u]=(0,e.useState)(null),[w,x]=(0,e.useState)(null),A=(0,e.useMemo)(()=>{if(!t)return null;let b=b=>{let c=t[b-a.startLine]??"",d=j?.has(b)?" bg-green-9/15":"";return`<div class="flex${d}" style="min-width:max-content" data-line="${b}"><span class="select-none pr-3 text-muted-foreground/60 tabular-nums" style="min-width:3.2rem;text-align:right">${b}</span><span class="whitespace-pre">${c}</span></div>`};return m?m.segments.map(a=>{if("gap"===a.kind){var c;let b,d,e;return c=a.startLine,d=P(p("diffViewer.gap.hidden",{count:b=a.endLine-c+1})),e=P(p("diffViewer.gap.expandAll",{count:b})),`<div class="flex items-center cursor-pointer select-none hover:bg-hover" style="min-width:max-content;height:${U}px" data-fold-gap="${c}" title="${e}"><span class="select-none pr-3 text-muted-foreground/40" style="min-width:3.2rem;text-align:right">⋯</span><span class="text-[10px] text-muted-foreground/60 whitespace-pre">${d}</span></div>`}let d="";for(let c=a.startLine;c<=a.endLine;c++)d+=b(c);return d}).join(""):t.map((c,d)=>b(a.startLine+d)).join("")},[t,m,j,a.startLine,p]),B=(0,e.useCallback)(b=>{if(!n)return;let c=b.target,d=c?.closest?.("[data-fold-gap]");if(!d)return;let e=Number(d.getAttribute("data-fold-gap"));Number.isFinite(e)&&n(a.qualifiedName,e)},[n,a.qualifiedName]);return(0,d.jsxs)("div",{className:"flex-1 min-w-0 bg-card border border-border rounded overflow-hidden relative",children:[(0,d.jsxs)("div",{"data-block-header":!0,className:"flex items-center gap-1.5 px-2 py-1.5 border-b border-border text-xs",children:[(0,d.jsx)(q,{kind:a.kind,qname:a.qualifiedName,className:"w-3.5 h-3.5 flex-shrink-0"}),!a.qualifiedName.startsWith("__code_")&&(0,d.jsxs)("span",{className:"font-mono truncate min-w-0",children:[(0,d.jsx)("span",{className:"font-medium",children:a.name}),void 0!==a.params&&(0,d.jsxs)("span",{className:"text-muted-foreground/80",children:["(",a.params.join(", "),")"]})]}),(0,d.jsxs)("span",{className:"text-[10px] text-muted-foreground/70 flex-shrink-0",children:["unknown"!==a.kind&&`${a.kind} \xb7 `,a.endLine-a.startLine+1," ",p("common.lines")]}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>r.sendMessage(p("explain.symbolMessage",{name:a.name,path:a.filePath,lines:`${a.startLine}-${a.endLine}`})),disabled:r.isLoading,title:r.isLoading?p("comments.aiResponding"):void 0,className:Q,children:p("explain.action")}),s&&(0,d.jsx)("button",{onClick:()=>r.sendMessage(p("deps.symbolMessage",{name:a.name,path:a.filePath,lines:`${a.startLine}-${a.endLine}`,...function(a,b,c){let d=a=>{switch(a.kind){case"cross":case"self":return`${a.external.name} (${a.external.filePath})`;case"method":return`${a.receiverName}.${a.methodName}()`;case"ext":return null}},e=a=>{let b=a.map(d).filter(a=>null!==a);return b.length?b.join(", "):c},f=new Map;for(let a of b){if("ext"!==a.kind)continue;let b=f.get(a.packageSpec);b?b.push(a.name):f.set(a.packageSpec,[a.name])}let g=[...f].map(([a,b])=>`${a} (${b.join(", ")})`);return{callers:e(a),callees:e(b),externals:g.length?g.join("; "):c}}(k??[],l??[],p("deps.none"))})),disabled:r.isLoading,title:r.isLoading?p("comments.aiResponding"):void 0,className:Q,children:p("deps.action")})]}),(0,d.jsx)("span",{className:"flex-1"}),c&&(0,d.jsx)("span",{className:"flex-shrink-0 w-2 h-2 rounded-full bg-amber-11","data-tooltip":"File has uncommitted change"})]}),(0,d.jsxs)("div",{"data-block-body":!0,className:"text-[11px] font-mono px-2 py-2 overflow-auto",style:{lineHeight:`${U}px`},onClick:B,children:[!b&&(0,d.jsx)("span",{className:"text-muted-foreground",children:"Loading…"}),w&&(0,d.jsx)("span",{className:"text-red-11",children:w}),A&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:A}})]}),h&&h.length>0&&i&&(0,d.jsx)(H,{comments:h,startLine:a.startLine,endLine:a.endLine,lineHeight:U,bodyTopOffset:V+W,rowOf:m?.rowOf,onCommentClick:i})]})}function S({side:a,pin:b,accent:c,onClick:e}){let f,g,h,i,j,k,l,m=b.lines.length;"ext"===b.kind?(f="bg-secondary/30 border-border/50 hover:border-muted-foreground/60",g="ext",h="text-muted-foreground/60",i=b.name,j=b.packageSpec,k="external",l=b.packageSpec):"method"===b.kind?(f="bg-secondary/30 border-border/50 hover:border-muted-foreground/60",g="method",h="text-muted-foreground/60",i=`${b.receiverName}.${b.methodName}`,j=null,k="method (unresolved)",l=m>0?`at line${m>1?"s":""} ${b.lines.join(", ")}`:""):"self"===b.kind?(f="bg-secondary/40 border-border hover:border-muted-foreground",g="self",h="text-muted-foreground/70",i=b.external.name,j=null,k="same-file",l=m>0?`at line${m>1?"s":""} ${b.lines.join(", ")}`:""):(f="in"===a?"bg-amber-9/15 border-amber-9/40 hover:border-amber-11":"bg-green-9/15 border-green-9/40 hover:border-green-11",g=a,h="in"===a?"text-amber-11":"text-green-11",i=b.external.name,j=O(b.external.filePath),k="in"===a?"caller":"callee",l=b.external.filePath);let n=c&&"ext"!==b.kind&&"method"!==b.kind?" ring-1 ring-amber-9/70 ring-offset-0":"";return(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),e()},className:`${f}${n} w-full text-left border rounded px-1.5 py-0.5 text-[10px] font-mono cursor-pointer transition-colors block`,"data-tooltip":`${k} \xb7 ${i}${l?" \xb7 "+l:""}`,children:(0,d.jsxs)("span",{className:"block h-[26px] leading-[13px] overflow-hidden",children:[(0,d.jsx)("span",{className:`${h} float-left mr-1.5 text-[9px] uppercase tracking-wider font-semibold`,children:g}),(j||m>1)&&(0,d.jsxs)("span",{className:"float-right clear-both ml-1.5 max-w-[60%] truncate text-muted-foreground/70",children:[j,m>1&&(0,d.jsxs)("span",{className:"text-muted-foreground/60",children:[j?" ":"","\xb7",m,"\xd7"]})]}),(0,d.jsx)("span",{className:"font-medium break-all",children:i})]})})}let T="w-44 @min-[900px]:w-52 @min-[1100px]:w-60 @min-[1400px]:w-72 @min-[1800px]:w-80 @min-[2400px]:w-96",U=18,V=29,W=8;function X(a,b){switch(b.kind){case"cross":return`${a}:x:${b.external.filePath}::${b.external.qualifiedName}`;case"self":return`${a}:s:${b.external.filePath}::${b.external.qualifiedName}`;case"ext":return`${a}:e:${b.packageSpec}::${b.name}`;case"method":return`${a}:m:${b.receiverName}::${b.methodName}`}}function Y(a,b){return"ext"!==a.kind&&"method"!==a.kind&&(b?.has(a.external.qualifiedName)??!1)}function Z(a){return{filePath:a.filePath,qname:a.qualifiedName,name:a.name,kind:a.kind}}function $({symbol:a,fileSource:b,hasChange:c,upstream:e,downstream:f,onPinClick:g,onHighlighted:h,comments:i,onCommentClick:j,accentQnames:k,addedLines:l,fold:m,onExpandGap:n}){let o=function(a,b,c){if(0===a.length)return[];let d=a.map((a,c)=>{var d,e;return{i:c,line:(d=a.lines[0]??b.startLine,e=b.startLine,Math.max(e,Math.min(b.endLine,d)))}});d.sort((a,b)=>a.line-b.line||a.i-b.i);let e=Array(a.length).fill(0),f=-1/0;for(let{i:a,line:g}of d){let d=Math.max(V+W+(c?c.rowOf(g):g-b.startLine)*U,f);e[a]=d,f=d+34}return e}(f,a,m);return(0,d.jsxs)("div",{"data-block-qname":a.qualifiedName,"data-start-line":a.startLine,"data-end-line":a.endLine,className:"flex gap-2 items-stretch scroll-mt-2",children:[(0,d.jsx)("div",{className:`${T} flex-shrink-0 flex flex-col gap-1 pt-1`,children:0===e.length?(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/40 italic px-1.5",children:"no callers"}):e.map(b=>(0,d.jsx)(S,{side:"in",pin:b,accent:Y(b,k),onClick:()=>g(b,a)},X("in",b)))}),(0,d.jsx)(R,{symbol:a,fileSource:b,hasChange:c,onHighlighted:h,comments:i,onCommentClick:j,addedLines:l,upstream:e,downstream:f,fold:m,onExpandGap:n}),(0,d.jsx)("div",{className:`${T} flex-shrink-0 relative`,children:0===f.length?(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/40 italic px-1.5 pt-1",children:"no callees"}):f.map((b,c)=>(0,d.jsx)("div",{className:"absolute left-0 right-0",style:{top:`${o[c]}px`},children:(0,d.jsx)(S,{side:"out",pin:b,accent:Y(b,k),onClick:()=>g(b,a)})},X("out",b)))})]})}function _({cwd:a,onSelect:b,onClose:c}){let{t:i}=(0,f.Bd)(),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)({files:[],symbols:[]}),[n,o]=(0,e.useState)(0),[p,q]=(0,e.useState)(!1),r=(0,e.useMemo)(()=>[...l.files,...l.symbols],[l]),s=(0,e.useCallback)(a=>{if("Escape"===a.key)return void c();if(0!==r.length){if("ArrowDown"===a.key)a.preventDefault(),o(a=>Math.min(a+1,r.length-1));else if("ArrowUp"===a.key)a.preventDefault(),o(a=>Math.max(a-1,0));else if("Enter"===a.key){a.preventDefault();let c=r[n];c&&b(c)}}},[r,n,c,b]);return(0,d.jsx)("div",{className:"absolute inset-0 bg-background/40 z-20 flex items-start justify-center pt-24",onClick:c,children:(0,d.jsxs)("div",{className:"w-[480px] max-w-[80%] bg-card border border-border rounded shadow-lv3 overflow-hidden",onClick:a=>a.stopPropagation(),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border",children:[(0,d.jsx)(g.A,{className:"w-4 h-4 text-muted-foreground"}),(0,d.jsx)("input",{autoFocus:!0,value:j,onChange:a=>k(a.target.value),onKeyDown:s,placeholder:i("blockViewer.search.hint","Start typing to search"),className:"flex-1 bg-transparent border-0 outline-none text-sm"}),p&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"…"}),(0,d.jsx)("button",{onClick:c,className:"text-muted-foreground hover:text-foreground",children:(0,d.jsx)(h.A,{className:"w-3.5 h-3.5"})})]}),(0,d.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[0===r.length&&j&&!p&&(0,d.jsx)("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("blockViewer.search.noResults","No matches")}),(0,d.jsx)(aa,{label:i("blockViewer.search.files","Files"),hits:l.files,startIdx:0,activeIdx:n,onSelect:b,setActive:o}),(0,d.jsx)(aa,{label:i("blockViewer.search.symbols","Symbols"),hits:l.symbols,startIdx:l.files.length,activeIdx:n,onSelect:b,setActive:o})]})]})})}function aa({label:a,hits:b,startIdx:c,activeIdx:e,onSelect:f,setActive:g}){return 0===b.length?null:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-muted-foreground bg-secondary/40",children:a}),b.map((a,b)=>{let h=c+b,j=h===e;return(0,d.jsxs)("button",{onMouseEnter:()=>g(h),onClick:()=>f(a),className:`w-full text-left px-3 py-1.5 text-xs flex items-start gap-2 ${j?"bg-secondary":"hover:bg-secondary/60"}`,children:["file"===a.type?(0,d.jsx)(i.A,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0 text-muted-foreground"}):(0,d.jsx)(q,{kind:a.target.kind,qname:a.target.qualifiedName,className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"font-mono truncate",children:a.label}),a.hint&&(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground truncate",children:a.hint})]})]},`${a.type}:${a.label}:${b}`)})]})}function ab({cwd:a,highlightedFilePath:b,changedFiles:c,onSwitchToCode:g,enableComments:h=!1,onContentSearch:i,onFocalChange:j,qnameFilter:k,qnameFilterFile:l,accentQnames:m,accentFile:n,addedLines:o,addedLinesFile:p,compact:q=!1,headerExtraLeft:s,headerExtraRight:u}){let{t:y}=(0,f.Bd)(),[z,A]=(0,e.useState)("toc"),[D,G]=(0,e.useState)(null),H=D??b??null,{state:I,refresh:P}=(0,r.V)(a,H),[Q,R]=(0,e.useState)(null),S=(0,e.useMemo)(()=>Q?Q.content.split("\n").length:null,[Q]);(0,e.useRef)(null);let[U,V]=(0,e.useState)([]),[W,X]=(0,e.useState)(!1),[Y,aa]=(0,e.useState)(null),ae=(0,e.useRef)(0);(0,e.useRef)(0);let[af,ag]=(0,e.useState)(()=>new Set);"ready"===I.state&&I.data.filePath;let ah=(0,e.useCallback)(a=>{ag(b=>{if(b.has(a))return b;let c=new Set(b);return c.add(a),c})},[]),ai=(0,e.useCallback)((a,b)=>{if("ext"===a.kind||"method"===a.kind){let a=b.filePath;if(!a)return;ae.current+=1,aa({filePath:a,qname:"__imports__",nonce:ae.current});return}let c=Z(b),d=Z(a.external);V(a=>C(C(a,c),d)),G(d.filePath),ae.current+=1,aa({filePath:d.filePath,qname:d.qname,nonce:ae.current})},[]),aj=(0,e.useCallback)(a=>{G(a.filePath),ae.current+=1,aa({filePath:a.filePath,qname:a.qname,nonce:ae.current})},[]),ak=(0,e.useCallback)(a=>{X(!1),G(a.target.filePath),"symbol"===a.type&&(ae.current+=1,aa({filePath:a.target.filePath,qname:a.target.qualifiedName,line:a.target.startLine,nonce:ae.current}))},[]),al=(0,e.useCallback)((a,b)=>{H&&(ae.current+=1,aa({filePath:H,qname:a,line:b,nonce:ae.current}))},[H]),[am,an]=(0,e.useState)(()=>new Set),ao=(0,e.useCallback)((a,b)=>{an(c=>{let d=new Set(c);return d.add(`${H}#${a}#${b}`),d})},[H]),[ap,aq]=(0,e.useState)(null),[ar,as]=(0,e.useState)(null),at=(0,e.useMemo)(()=>{if("ready"!==I.state||!ar)return null;let a=I.data.functions;if(0===a.length)return null;let b=(ar.start+ar.end)/2;for(let c of a)if(c.startLine<=b&&b<=c.endLine)return c.qualifiedName;let c=null;for(let b of a)b.startLine<=ar.start&&(!c||b.startLine>c.startLine)&&(c=b);return c?.qualifiedName??null},[I,ar]),au=h&&!!a&&!!H,av=(0,v.r)(),{comments:aw,addComment:ax,updateComment:ay,deleteComment:az,refresh:aA}=(0,w._)({cwd:a,filePath:H??""}),[aB,aC]=(0,e.useState)(null),{toolbarRef:aD,bumpRef:aE,clearToolbar:aF}=(0,F.L)({enabled:au,container:aB,resolveLineRange:a=>{if(!document.contains(a))return null;let b=a.nodeType===Node.TEXT_NODE?a.parentElement:a,c=b?.closest("[data-line]");if(!c||!aB||!aB.contains(c))return null;let d=c.getAttribute("data-line");if(!d)return null;let e=parseInt(d,10);return Number.isFinite(e)?{start:e,end:e}:null},buildLineSnapshot:({start:a,end:b})=>{let c=Q?.content;return c?c.split("\n").slice(a-1,b).join("\n"):""}}),[aG,aH]=(0,e.useState)(null),[aI,aJ]=(0,e.useState)(null),[aK,aL]=(0,e.useState)(null),aM=(0,e.useCallback)(()=>{let a=aD.current;a&&(aH({x:a.x,y:a.y,range:a.range,selectedText:a.selectedText,lineSnapshot:a.lineSnapshot}),aF())},[aF,aD]),aN=(0,e.useCallback)(()=>{let a=aD.current;a&&(aJ({x:a.x,y:a.y,range:a.range,selectedText:a.selectedText,lineSnapshot:a.lineSnapshot}),aF())},[aF,aD]),aO=(0,e.useCallback)(()=>{let a=aD.current;a&&av&&H&&(aF(),(0,x.Ff)(av.sendMessage,{filePath:H,startLine:a.range.start,endLine:a.range.end,codeContent:a.lineSnapshot},y("explain.selectionMessage")))},[av,H,aF,aD,y]),aP=(0,e.useCallback)(()=>{let a=aD.current;if(!a||!i)return;let b=a.selectedText.trim();aF(),b&&i(b)},[i,aF,aD]),aQ=(0,e.useCallback)(async a=>{aG&&(await ax(aG.range.start,aG.range.end,a,aG.selectedText),aH(null))},[aG,ax]),aR=(0,e.useCallback)(async(b,c)=>{if(av&&a&&H)try{let d=(await (0,x.$3)(a)).map(a=>({filePath:a.filePath,startLine:a.startLine,endLine:a.endLine,codeContent:a.codeContent,note:a.content||void 0}));d.push({filePath:H,startLine:b.range.start,endLine:b.range.end,codeContent:b.lineSnapshot});let e=(0,x.Gw)(d,c);av.sendMessage(e),await (0,x.RP)(a),aA()}catch(a){console.error("[BlockViewer] send to AI failed:",a)}},[av,a,H,aA]),aS=(0,e.useCallback)(a=>{aI&&aR(aI,a)},[aI,aR]),aT=(0,e.useCallback)(a=>{aG&&aR(aG,a)},[aG,aR]),aU=(0,e.useCallback)((a,b)=>{b.stopPropagation(),aL({comment:a,x:b.clientX,y:b.clientY}),aF(),aH(null),aJ(null)},[aF]);if(!H)return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(ad,{focalFile:null,fileCount:null,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,refreshDisabled:!0,extraLeft:s,extraRight:u}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center text-sm text-muted-foreground gap-2 px-4 text-center",children:[(0,d.jsx)("span",{children:y("blockViewer.empty.body","Select a file in the left tree to see its function call graph.")}),(0,d.jsx)("span",{className:"text-xs",children:y("blockViewer.empty.hint","or press ⌘K to search.")})]}),W&&(0,d.jsx)(_,{cwd:a,onSelect:ak,onClose:()=>X(!1)})]});if("idle"===I.state||"loading"===I.state)return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(ad,{focalFile:H,fileCount:null,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,refreshDisabled:!0,extraLeft:s,extraRight:u}),(0,d.jsx)(t,{cwd:a})]});if("notFound"===I.state)return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(ad,{focalFile:H,fileCount:null,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,extraLeft:s,extraRight:u}),(0,d.jsx)("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground px-4 text-center",children:y("blockViewer.fileMode.notFound","This file is not indexed (unsupported language or beyond the file cap).")}),W&&(0,d.jsx)(_,{cwd:a,onSelect:ak,onClose:()=>X(!1)})]});if("error"===I.state)return(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(ad,{focalFile:H,fileCount:null,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,extraLeft:s,extraRight:u}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-sm",children:[(0,d.jsx)("span",{className:"text-red-11",children:I.message}),(0,d.jsx)("button",{onClick:P,className:"px-3 py-1 rounded bg-secondary hover:bg-secondary/80",children:y("blockViewer.retry","Retry")})]})]});let aV=I.data,aW=aV.functions;if(0===aW.length&&Q){let a=Math.max(1,S??1);aW=[{filePath:aV.filePath,qualifiedName:"__file__",name:O(aV.filePath),kind:"unknown",startLine:1,endLine:a}]}let aX=l&&l===aV.filePath,aY=n&&n===aV.filePath,aZ=p&&p===aV.filePath;aX&&k&&(aW=aW.filter(a=>k.has(a.qualifiedName)));let a$=aY?m:void 0,a_=aZ?o:void 0,a0=new Map;if(q&&a_)for(let a of aW)a0.set(a.qualifiedName,function(a,b,c,d,e=K.aj){if(b<a)return null;let f=[];for(let d of c)d>=a&&d<=b&&f.push(d);f.sort((a,b)=>a-b);let g=[];for(let c of f){let d=Math.max(a,c-e),f=Math.min(b,c+e),h=g[g.length-1];h&&d<=h.endLine+1?f>h.endLine&&(h.endLine=f):g.push({startLine:d,endLine:f})}let h=[],i=a;for(let a of g)a.startLine>i&&h.push({startLine:i,endLine:a.startLine-1}),i=a.endLine+1;i<=b&&h.push({startLine:i,endLine:b});let j=[],k=[];for(let a of h)a.endLine-a.startLine+1<2||d(a.startLine)?k.push(a):j.push(a);if(0===j.length)return null;g=function(a){let b=[...a].sort((a,b)=>a.startLine-b.startLine),c=[];for(let a of b){let b=c[c.length-1];b&&a.startLine<=b.endLine+1?a.endLine>b.endLine&&(b.endLine=a.endLine):c.push({...a})}return c}([...g,...k]);let l=[];for(let a of[...g.map(a=>({kind:"lines",...a})),...j.map(a=>({kind:"gap",...a}))].sort((a,b)=>a.startLine-b.startLine))l.push(a);let m=[],n=0;for(let a of l)m.push(n),n+="gap"===a.kind?1:a.endLine-a.startLine+1;let o=n;return{segments:l,visibleRuns:g,hiddenCount:j.reduce((a,b)=>a+(b.endLine-b.startLine+1),0),rowOf:b=>{for(let a=0;a<l.length;a++){let c=l[a];if(b<c.startLine)break;if(b<=c.endLine)return"gap"===c.kind?m[a]:m[a]+(b-c.startLine)}return b<a?0:Math.max(0,o-1)}}}(a.startLine,a.endLine,a_,b=>am.has(`${aV.filePath}#${a.qualifiedName}#${b}`)));let a1=ac(aV.upstreamCalls),a2=ac(aV.downstreamCalls),a3=new Map(aW.map(a=>[a.qualifiedName,a])),a4=new Map,a5=new Map;for(let a of aV.intraCalls){let b=a3.get(a.to),c=a3.get(a.from);if(b){let c=a4.get(a.from),d={kind:"self",external:b,lines:a.lines};c?c.push(d):a4.set(a.from,[d])}if(c){let b=a5.get(a.to),d={kind:"self",external:c,lines:a.lines};b?b.push(d):a5.set(a.to,[d])}}let a6=new Map;for(let a of aV.externalCalls??[]){let b=a6.get(a.focalQname),c={kind:"ext",name:a.external.name,packageSpec:a.external.packageSpec,lines:a.lines};b?b.push(c):a6.set(a.focalQname,[c])}let a7=new Map;for(let a of aV.methodCalls??[]){let b=a7.get(a.focalQname),c={kind:"method",receiverName:a.receiverName,methodName:a.methodName,lines:a.lines};b?b.push(c):a7.set(a.focalQname,[c])}let a8=new Map;for(let a of aW){let b=a.qualifiedName,c={in:a1.get(b)?.length??0,out:a2.get(b)?.length??0,self:(a5.get(b)?.length??0)+(a4.get(b)?.length??0)};(c.in||c.out||c.self)&&a8.set(b,c)}let a9=c.has(aV.filePath);return(0,d.jsxs)("div",{className:"h-full flex flex-col relative",children:[(0,d.jsx)(ad,{focalFile:H,fileCount:aV.fileCount,functionCount:aV.functions.length,upstreamCount:aV.upstreamCalls.length,downstreamCount:aV.downstreamCalls.length,onSwitchToCode:g,onSearch:()=>X(!0),onRefresh:P,extraLeft:s,extraRight:u}),(0,d.jsxs)("div",{ref:aC,className:"@container flex-1 relative min-h-0 flex",children:[(0,d.jsxs)("div",{className:`${T} flex-shrink-0 border-r border-border flex flex-col`,children:[(0,d.jsx)("div",{className:"flex-shrink-0 flex border-b border-border",children:[["toc",y("blockViewer.tabs.toc")],["history",y("blockViewer.tabs.history")]].map(([a,b])=>(0,d.jsx)("button",{onClick:()=>A(a),className:`flex-1 px-2 py-1.5 text-xs font-medium transition-colors ${z===a?"text-brand border-b-2 border-brand":"text-muted-foreground hover:text-foreground"}`,children:b},a))}),(0,d.jsx)("div",{className:"toc"===z?"flex-1 min-h-0 flex flex-col":"hidden",children:(0,d.jsx)(E,{functions:aW,counts:a8,totalLines:S,currentQname:at,onSelect:al,notIndexed:aV.notIndexed,onRebuild:P})}),(0,d.jsx)("div",{className:"history"===z?"flex-1 min-h-0 flex flex-col":"hidden",children:(0,d.jsx)(B,{entries:U,onSelect:aj,onClear:()=>V([])})})]}),(0,d.jsx)("div",{ref:aq,className:"@container flex-1 min-w-0 overflow-auto",children:(0,d.jsx)("div",{className:"flex flex-col gap-3 p-3",children:aW.map(a=>{let b,c,e,f,g,h;return(0,d.jsx)($,{symbol:a,fileSource:Q?.content??null,hasChange:a9,upstream:(b=a1.get(a.qualifiedName),c=a5.get(a.qualifiedName),[...(b??[]).map(a=>({kind:"cross",external:a.external,lines:a.lines})),...c??[]]),downstream:(e=a2.get(a.qualifiedName),f=a4.get(a.qualifiedName),g=a7.get(a.qualifiedName),h=a6.get(a.qualifiedName),[...(e??[]).map(a=>({kind:"cross",external:a.external,lines:a.lines})),...f??[],...g??[],...h??[]]),onPinClick:ai,onHighlighted:ah,comments:au?aw:void 0,onCommentClick:au?aU:void 0,accentQnames:a$,addedLines:a_,fold:a0.get(a.qualifiedName),onExpandGap:ao},`${a.qualifiedName}#${a.startLine}`)})})}),au&&aB&&(0,d.jsx)(L.fS,{floatingToolbarRef:aD,bumpRef:aE,container:aB,onAddComment:aM,onSendToAI:aN,onSearch:i?aP:void 0,onExplain:av&&H?aO:void 0,isChatLoading:av?.isLoading}),au&&aG&&(0,d.jsx)(M.t,{x:aG.x,y:aG.y,range:aG.range,filePath:H??void 0,lineSnapshot:aG.lineSnapshot,container:aB,onSubmit:aQ,onSendToAI:av&&H?aT:void 0,onClose:()=>aH(null),isChatLoading:av?.isLoading}),au&&aI&&H&&(0,d.jsx)(M.G,{x:aI.x,y:aI.y,range:aI.range,filePath:H,lineSnapshot:aI.lineSnapshot,container:aB,onSubmit:aS,onClose:()=>aJ(null),isChatLoading:av?.isLoading}),au&&aK&&(0,d.jsx)(N.t,{x:aK.x,y:aK.y,comment:aK.comment,container:aB,onClose:()=>aL(null),onUpdateComment:ay,onDeleteComment:az}),a_&&a_.size>0&&aW.length>0&&(0,d.jsx)(J,{addedLines:a_,blockRanges:aW.flatMap(a=>{let b=a0.get(a.qualifiedName);return b?b.visibleRuns.map(b=>({qname:a.qualifiedName,startLine:b.startLine,endLine:b.endLine})):[{qname:a.qualifiedName,startLine:a.startLine,endLine:a.endLine}]}),viewportRange:ar,onJumpToLine:al}),W&&(0,d.jsx)(_,{cwd:a,onSelect:ak,onClose:()=>X(!1)})]})]})}function ac(a){let b=new Map;for(let c of a){let a=b.get(c.focalQname);if(!a){b.set(c.focalQname,[c]);continue}a.some(a=>a.external.filePath===c.external.filePath&&a.external.qualifiedName===c.external.qualifiedName)||a.push(c)}return b}function ad({focalFile:a,fileCount:b,functionCount:c,upstreamCount:e,downstreamCount:h,onSwitchToCode:i,onSearch:k,onRefresh:l,refreshDisabled:m,extraLeft:n,extraRight:o}){let{t:p}=(0,f.Bd)(),q={focalFile:a,blockCount:c??0,upstreamCount:e??0,downstreamCount:h??0};return(0,d.jsxs)("div",{className:"flex-shrink-0 px-3 py-2 border-b border-border flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0 text-xs text-muted-foreground font-mono",children:[(0,d.jsx)("span",{className:"truncate min-w-0",children:a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"text-foreground",children:a}),"number"==typeof c&&(0,d.jsxs)("span",{className:"ml-2",children:["\xb7 ",c," blocks"]}),"number"==typeof e&&"number"==typeof h&&(0,d.jsxs)("span",{className:"ml-2",children:["\xb7 ",e," in \xb7 ",h," out"]})]}):(0,d.jsx)("span",{children:null!==b?`${b} files`:"…"})}),n&&(0,d.jsx)("span",{className:"flex items-center gap-1 flex-shrink-0",children:n(q)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[o&&(0,d.jsx)("span",{className:"flex items-center gap-1",children:o(q)}),(0,d.jsxs)("button",{onClick:k,className:"text-xs px-2 py-1 rounded hover:bg-secondary text-muted-foreground hover:text-foreground flex items-center gap-1","data-tooltip":p("blockViewer.search.tooltip","Search (⌘K)"),children:[(0,d.jsx)(g.A,{className:"w-3 h-3"})," ⌘K"]}),(0,d.jsx)("button",{onClick:l,disabled:m,className:"text-xs px-2 py-1 rounded hover:bg-secondary text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:hover:bg-transparent","data-tooltip":p("blockViewer.refresh","Rebuild project graph"),children:(0,d.jsx)(j.A,{className:"w-3 h-3"})}),i&&(0,d.jsx)("button",{onClick:i,className:"text-xs px-2 py-1 rounded hover:bg-secondary text-muted-foreground hover:text-foreground",children:p("common.code","Code")})]})]})}},73414:(a,b,c)=>{"use strict";c.d(b,{YO:()=>e,aj:()=>d,pU:()=>f});let d=3,e=20;function f(a,b,c,g=[]){let h=a.length,i=c=>"unchanged"!==a[c].type||"unchanged"!==b[c].type,j=new Set;for(let a=0;a<h;a++){if(!i(a))continue;let b=Math.max(0,a-d),c=Math.min(h-1,a+d);for(let a=b;a<=c;a++)j.add(a)}let k=[];for(let a=0;a<h;a++){if(j.has(a))continue;let b=a;for(;a<h&&!j.has(a);)a++;k.push({id:k.length,startIdx:b,endIdx:a-1}),a--}for(let a of k){let b=c.get(a.id)??{topRevealed:0,bottomRevealed:0},d=a.endIdx-a.startIdx+1,e=Math.max(0,Math.min(b.topRevealed,d)),f=Math.max(0,Math.min(b.bottomRevealed,d-e));for(let b=a.startIdx;b<a.startIdx+e;b++)j.add(b);for(let b=a.endIdx-f+1;b<=a.endIdx;b++)j.add(b)}let l=[];for(let a=0;a<h;a++){let c;if(j.has(a)){l.push({kind:"diff",idx:a});continue}let d=a;for(;a<h&&!j.has(a);)a++;let f=a-1;a--;let i=k.find(a=>a.startIdx<=d&&f<=a.endIdx);if(!i)continue;let m=f-d+1,n=Math.min(e,m);if(g.length>0&&f+1<h)for(let a=f+1;a<h;a++){let d=b[a].lineNum;if(!(d<=0)){c=function(a,b){let c=null;for(let d of a)d.startLine<=b&&b<=d.endLine&&(!c||d.endLine-d.startLine<c.endLine-c.startLine)&&(c=d);return c}(g,d)??void 0;break}}l.push({kind:"gap-expand",gapId:i.id,direction:"up",revealCount:n}),l.push({kind:"gap-label",gapId:i.id,hiddenCount:m,enclosingFn:c}),l.push({kind:"gap-expand",gapId:i.id,direction:"down",revealCount:n})}return{rows:l,gaps:k}}},73887:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{M:()=>B});var e=c(48249),f=c(67484),g=c(44384),h=c(64825),i=c(74429),j=c(7122),k=c(7833),l=c(41051),m=c(42140),n=c(70596),o=c(74754),p=c(7031),q=c(91579),r=c(208),s=c(5900),t=c(64676),u=c(84835);c(15466);var v=c(60591),w=c(59865),x=c(93321),y=c(24680),z=c(92608),A=c(37690);let a=[u.W];function B({content:b,filePath:c,cwd:d,onClose:u,sourceFile:C,embedded:D=!1,onLocalMdLink:E,scrollToAnchor:F}){let G=C||(d&&c.startsWith(d)?c.slice(d.endsWith("/")?d.length:d.length+1):c),{t:H}=(0,g.Bd)(),I=(0,j.iN)(),J=(0,p.r)(),K=(0,w.U)(),L=(0,x.Q)(),{comments:M,addComment:N,updateComment:O,deleteComment:P,refresh:Q}=(0,o._)({cwd:d,filePath:c}),[R,S]=(0,f.useState)(!1),[T,U]=(0,f.useState)(null),[V,W]=(0,f.useState)(null),[X,Y]=(0,f.useState)(null),Z=(0,f.useMemo)(()=>b.split("\n"),[b]),$=(0,f.useMemo)(()=>(0,t.J4)(c,d),[c,d]),[_,aa]=(0,f.useState)(null),ab=(0,f.useRef)(null),ac=(0,f.useRef)({onLocalMdLink:E,sourceFile:G});ac.current={onLocalMdLink:E,sourceFile:G};let ad=(0,f.useRef)(a=>{let{onLocalMdLink:b,sourceFile:c}=ac.current;if(!b||/^[a-z][a-z0-9+.-]*:/i.test(a))return!1;let d=a.indexOf("#"),e=d>=0?a.slice(0,d):a,f=d>=0?a.slice(d+1):null;if(!e)return!1;let g=e;try{g=decodeURIComponent(e)}catch{}return!!(0,v.e$)(g)&&(b((0,v.WU)(c,g),f),!0)}).current,{toolbarRef:ae,bumpRef:af,clearToolbar:ag}=(0,A.L)({enabled:!0,container:_,resolveLineRange:a=>{let b=function(a){let b=a.nodeType===Node.TEXT_NODE?a.parentElement:a;if(!b||!("closest"in b))return null;let c=b.closest("[data-source-start]");if(!c)return null;let d=c.getAttribute("data-source-start"),e=c.getAttribute("data-source-end");return d&&e?{start:parseInt(d,10),end:parseInt(e,10)}:null}(a);return b?{start:b.start,end:b.end}:null},buildLineSnapshot:({start:a,end:b})=>{let c=Math.max(0,a-1),d=Math.min(Z.length,b);return Z.slice(c,d).join("\n")}}),ah=(0,f.useCallback)(()=>{let a=ae.current;a&&(U({x:a.x,y:a.y,range:a.range,selectedText:a.selectedText,lineSnapshot:a.lineSnapshot}),ag())},[ag,ae]),ai=(0,f.useCallback)(()=>{let a=ae.current;a&&(W({x:a.x,y:a.y,range:a.range,selectedText:a.selectedText,lineSnapshot:a.lineSnapshot}),ag())},[ag,ae]),aj=(0,f.useCallback)(()=>{let a=ae.current;a&&J&&(ag(),(0,q.Ff)(J.sendMessage,{filePath:c,startLine:a.range.start,endLine:a.range.end,codeContent:a.lineSnapshot},r.A.t("explain.selectionMessage")))},[J,c,ag,ae]),ak=(0,f.useCallback)(async a=>{T&&(await N(T.range.start,T.range.end,a,T.selectedText),U(null))},[T,N]),al=(0,f.useCallback)(async(a,b)=>{if(J)try{let e=await (0,q.$3)(d),f=[];for(let a of e)f.push({filePath:a.filePath,startLine:a.startLine,endLine:a.endLine,codeContent:a.codeContent,note:a.content||void 0});f.push({filePath:c,startLine:a.range.start,endLine:a.range.end,codeContent:a.lineSnapshot});let g=(0,q.Gw)(f,b);J.sendMessage(g),await (0,q.RP)(d),Q()}catch(a){console.error("Failed to send to AI:",a)}},[J,c,d,Q]),am=(0,f.useCallback)(a=>{V&&al(V,a)},[V,al]),an=(0,f.useCallback)(a=>{T&&al(T,a)},[T,al]);(0,f.useMemo)(()=>{if(0===M.length)return[];let a=new Map;for(let b of M){let c=`${b.startLine}-${b.endLine}`;a.has(c)||a.set(c,[]),a.get(c).push(b)}return Array.from(a.entries()).map(([a,b])=>({key:a,startLine:b[0].startLine,endLine:b[0].endLine,comments:b}))},[M]);let[ao,ap]=(0,f.useState)([]);return(0,e.jsxs)(e.Fragment,{children:[!D&&(0,e.jsxs)("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between gap-3 flex-shrink-0",children:[(0,e.jsxs)("span",{className:"text-sm font-medium text-foreground truncate min-w-0 flex-1 cursor-pointer hover:text-brand transition-colors",style:{direction:"rtl",textAlign:"left"},"data-tooltip":c,onClick:()=>{navigator.clipboard.writeText(c),(0,k.oR)(H("common.copiedPath"))},children:["‎",c]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(z.ShareReviewToggle,{content:b,sourceFile:G}),((0,v.C_)(c)||(0,v.OG)(c))&&(0,e.jsx)("button",{onClick:()=>{let a=c.startsWith("/")||!d?c:`${d.replace(/\/$/,"")}/${c}`;(0,v.OG)(c)?L(a):K(a)},className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:H((0,v.OG)(c)?"bots.addTooltip":"skills.addTooltip"),children:(0,e.jsx)(h.A,{className:"w-4 h-4"})}),(0,e.jsx)("button",{onClick:u,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:H("common.close"),children:(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,e.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,e.jsx)(y.l,{content:b,containerRef:ab}),(0,e.jsxs)("div",{className:"flex-1 overflow-auto relative",ref:ab,children:[(0,e.jsx)("div",{className:"p-6",children:(0,e.jsx)(s.T,{content:b,basePath:$,rehypePlugins:a,onLinkClick:ad})}),ao.map(({key:a,top:b,comments:c})=>(0,e.jsx)("div",{className:"absolute right-3 cursor-pointer z-10",style:{top:b},onClick:a=>{a.stopPropagation(),Y({comment:c[0],x:a.clientX,y:a.clientY})},children:(0,e.jsx)("div",{className:"w-5 h-5 rounded-full bg-amber-500/80 text-white text-xs flex items-center justify-center shadow-lv1 hover:bg-amber-500 transition-colors",children:c.length})},a))]})]}),R&&I&&(0,i.createPortal)((0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.fS,{floatingToolbarRef:ae,bumpRef:af,container:I,onAddComment:ah,onSendToAI:ai,onExplain:J?aj:void 0,isChatLoading:J?.isLoading}),T&&(0,e.jsx)(m.t,{x:T.x,y:T.y,range:T.range,filePath:c,lineSnapshot:T.lineSnapshot,container:I,onSubmit:ak,onSendToAI:J?an:void 0,onClose:()=>U(null),isChatLoading:J?.isLoading}),V&&(0,e.jsx)(m.G,{x:V.x,y:V.y,range:V.range,filePath:c,lineSnapshot:V.lineSnapshot,container:I,onSubmit:am,onClose:()=>W(null),isChatLoading:J?.isLoading}),X&&(0,e.jsx)(n.t,{x:X.x,y:X.y,comment:X.comment,container:I,onClose:()=>Y(null),onUpdateComment:O,onDeleteComment:P})]}),I)]})}d()}catch(a){d(a)}})},74228:(a,b,c)=>{"use strict";c.d(b,{S:()=>g,l:()=>h});var d=c(48249),e=c(40311),f=c(41233);function g(a){return"loading"===a||"unread"===a?a:"normal"}function h({projectNumber:a,sessionNumber:b,coordinate:c,status:g="normal",statusLabel:i,bot:j,className:k=""}){if(c){let[d,e]=c.split(".");a??=d,b??=e}if(null==a&&null==b&&"normal"!==g&&(b="\xb7"),null==a&&null==b)return null;let l=[a,b].filter(a=>null!=a).join(".");return(0,d.jsxs)("span",{className:`inline-flex items-center gap-1 font-mono text-[9px] font-medium leading-none tabular-nums flex-shrink-0 ${k}`,"aria-label":i?`${l} \xb7 ${i}`:l,children:[null!=a&&(0,d.jsx)("span",{className:`flex h-4 w-4 items-center justify-center border rounded-[4px] ${(0,e.ci)("normal",!1)}`,children:a}),null!=b&&(0,d.jsx)(f.w,{wash:(0,e.JQ)(g,!1),ring:(0,e.QV)(g),bot:j,title:i,children:b})]})}},74542:(a,b,c)=>{"use strict";c.d(b,{b:()=>f});var d=c(48249),e=c(67484);function f({lines:a,containerRef:b}){let c=(0,e.useRef)(null),[g,h]=(0,e.useState)({top:0,height:0});if(0===a.length)return null;let i=100/a.length;return(0,d.jsxs)("div",{ref:c,className:"w-4 flex-shrink-0 bg-secondary border-l border-border relative cursor-pointer",onClick:a=>{let d=b.current,e=c.current;if(!d||!e)return;let f=e.getBoundingClientRect(),g=(a.clientY-f.top)/f.height*d.scrollHeight-d.clientHeight/2;d.scrollTo({top:Math.max(0,g),behavior:"smooth"})},children:[a.map((a,b)=>"unchanged"!==a.type&&(0,d.jsx)("div",{className:`absolute left-0 right-0 ${"removed"===a.type?"bg-red-9":"bg-green-9"}`,style:{top:`${b*i}%`,height:`${Math.max(i,.5)}%`,minHeight:"2px"}},b)),(0,d.jsx)("div",{className:"absolute left-0 right-0 bg-muted/60 border-y border-border",style:{top:`${g.top}px`,height:`${Math.max(g.height,10)}px`}})]})}},74691:(a,b,c)=>{"use strict";c.d(b,{y:()=>f});var d=c(48249),e=c(44384);function f({value:a,onChange:b,className:c}){let{t:g}=(0,e.Bd)();return(0,d.jsx)("div",{className:`flex items-center gap-0.5 rounded border border-border overflow-hidden ${c??""}`,children:["compact","full"].map(c=>(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),b(c)},className:`px-2 py-0.5 text-xs transition-colors ${a===c?"bg-brand text-white":"text-muted-foreground hover:bg-hover"}`,children:g("compact"===c?"diffViewer.compact":"diffViewer.full")},c))})}},74754:(a,b,c)=>{"use strict";c.d(b,{_:()=>h});var d=c(67484),e=c(91579),f=c(33281),g=c(89800);function h({cwd:a,filePath:b}){let[c,i]=(0,d.useState)([]),[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(null),n=(0,d.useCallback)(async()=>{if(!a||!b)return;k(!0),m(null);let c=await f.t4.runPromiseExit((0,g.lb)(a,b));if("Success"===c._tag)i(c.value.comments??[]);else{let a="Fail"===c.cause._tag?c.cause.error:null,b=a?.cause;m(b instanceof Error?b.message:"Failed to load comments")}k(!1)},[a,b]),o=(0,d.useCallback)(async(c,d,h,j)=>{let k=await f.t4.runPromiseExit((0,g.BC)({cwd:a,filePath:b,startLine:c,endLine:d,content:h,...j?{selectedText:j}:{}}));if("Success"===k._tag&&k.value.comment){let a=k.value.comment;return i(b=>[...b,a]),(0,e.Cm)(),a}return"Failure"===k._tag&&console.error("Failed to add comment:",k.cause),null},[a,b]),p=(0,d.useCallback)(async(b,c)=>{let d=await f.t4.runPromiseExit((0,g.vv)(a,b,c));if("Success"===d._tag&&d.value.comment){let a=d.value.comment;return i(c=>c.map(c=>c.id===b?a:c)),!0}return"Failure"===d._tag&&console.error("Failed to update comment:",d.cause),!1},[a]),q=(0,d.useCallback)(async b=>{let c=await f.t4.runPromiseExit((0,g.Tu)(a,b));return"Success"===c._tag?(i(a=>a.filter(a=>a.id!==b)),(0,e.Cm)(),!0):(console.error("Failed to delete comment:",c.cause),!1)},[a]),r=(0,d.useCallback)(a=>c.filter(b=>a>=b.startLine&&a<=b.endLine),[c]);return{comments:c,isLoading:j,error:l,addComment:o,updateComment:p,deleteComment:q,refresh:n,getCommentsForLine:r}}},74837:(a,b,c)=>{"use strict";c.d(b,{NoteToolbar:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call NoteToolbar() from the server but NoteToolbar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/cockpit/cockpit/packages/feature/workspace/src/client/NoteToolbar.tsx","NoteToolbar")},74991:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{I:()=>t});var e=c(48249),f=c(67484),g=c(44384),h=c(29588),i=c(7833),j=c(15819);c(33281);var k=c(13054),l=c(30458),m=c(36688),n=c(32753),o=c(74228),p=c(15790);c(41224);var q=a([p,m]);function r(a){return a.engine||"claude"}function s(a){return a.lastFiredAt??a.createdAt}[p,m]=q.then?(await q)():q;let u=[{key:"pendingReview",labelKey:"scheduledTasks.groupPendingReview"},{key:"upcoming",labelKey:"scheduledTasks.groupUpcoming"},{key:"paused",labelKey:"scheduledTasks.paused"}];function t({collapsed:a,tasks:b,unreadCount:c,sessionNumbers:d,onSwitchProject:q,onPause:v,onResume:w,onTrigger:x,onDelete:y,onMarkRead:z,onUpdateTask:A}){let{t:B}=(0,g.Bd)(),[C,D]=(0,f.useState)(!1),[E,F]=(0,f.useState)(null),G=(0,f.useRef)(null),H=(0,f.useRef)(null),[I,J]=(0,f.useState)(null),K=(0,f.useCallback)(()=>{F(null),G.current=null,J(null)},[]),[L,M]=(0,f.useState)(null),[N,O]=(0,f.useState)(null),[P,Q]=(0,f.useState)(null),[R,S]=(0,f.useState)(null),T=b.filter(a=>!a.completed),U=T.filter(a=>!a.paused).length,V=(0,f.useMemo)(()=>(function(a){let b=[],c=[],d=[];for(let e of a)e.unread||e.completed?b.push(e):e.paused?d.push(e):c.push(e);return b.sort((a,b)=>Number(!!b.unread)-Number(!!a.unread)||s(b)-s(a)),c.sort((a,b)=>(a.nextFireTime||Number.MAX_SAFE_INTEGER)-(b.nextFireTime||Number.MAX_SAFE_INTEGER)),d.sort((a,b)=>s(b)-s(a)),{pendingReview:b,upcoming:c,paused:d}})(b),[b]),W=P?b.find(a=>a.id===P)??null:null,[,X]=(0,f.useState)(0),Y=(0,f.useCallback)(()=>{M(null),O(null)},[]),Z=(0,f.useCallback)(async a=>{let b=!!a.taskFile;try{await navigator.clipboard.writeText(b?a.taskFile:a.message),(0,i.oR)(B(b?"common.copiedPath":"toast.copiedMessage"),"success")}catch{(0,i.oR)(B("common.copyFailed"),"error")}},[B]),$=(0,f.useCallback)(()=>{D(!1),Q(null)},[]),_=(0,f.useCallback)(a=>{q(a.cwd,a.sessionId),a.unread&&z(a.id),$()},[q,z,$]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{onClick:()=>D(!0),className:`relative flex items-center gap-2 px-2 py-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-hover transition-colors ${a?"w-full justify-center":"w-full"}`,title:a?B("scheduledTasks.title"):void 0,children:[(0,e.jsx)(h.A,{className:"w-5 h-5 flex-shrink-0"}),!a&&(0,e.jsx)("span",{className:"text-sm flex-1 text-left",children:B("scheduledTasks.title")}),c>0?(0,e.jsx)("span",{className:`min-w-[18px] h-[18px] px-1 bg-orange-11/15 text-orange-11 text-xs font-medium rounded-full flex items-center justify-center ${a?"absolute -top-1 -right-1":""}`,children:c}):a&&b.length>0?(0,e.jsx)("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 text-muted-foreground text-xs font-medium rounded-full flex items-center justify-center bg-popover border border-border",children:b.length}):null]}),C&&(0,e.jsxs)("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-scrim",onClick:$}),(0,e.jsxs)("div",{className:j.aO,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-foreground",children:B("scheduledTasks.title")}),T.length>0&&(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[B("scheduledTasks.activeCount",{running:U}),T.length-U>0?` \xb7 ${B("scheduledTasks.pausedCount",{paused:T.length-U})}`:""]})]}),(0,e.jsx)("button",{onClick:$,className:"p-1 text-foreground-subtle hover:text-foreground hover:bg-hover rounded transition-colors",children:(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("div",{className:"flex-1 flex min-h-0",children:0===b.length?(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:B("scheduledTasks.noScheduledTasks")})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"w-full md:w-[360px] min-h-0 flex-shrink-0 md:border-r border-border overflow-y-auto",children:(0,e.jsx)("div",{className:"p-3 space-y-4",children:u.map(({key:a,labelKey:b})=>{let c=V[a];return 0===c.length?null:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"sticky top-0 z-10 -mx-3 px-3 py-1 bg-card text-[11px] font-medium text-muted-foreground",children:[B(b)," (",c.length,")"]}),(0,e.jsx)("div",{className:"mt-1 space-y-2",children:c.map(a=>{let b,c;return b=a.id===P,(0,e.jsxs)("div",{onClick:()=>Q(a.id),onMouseLeave:()=>S(b=>b===a.id?null:b),className:`group p-3 rounded border cursor-pointer transition-all hover:border-brand hover:shadow-lv2 ${b?"border-brand bg-brand/5 shadow-lv2":a.unread?"border-brand/40 bg-brand/5":"border-border"} ${a.completed?"opacity-70":""}`,children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)(n.S,{engine:r(a),tooltip:(c=r(a),a.model?`${c} \xb7 ${a.model}`:c)}),(0,e.jsx)("h4",{className:"text-xs font-medium text-foreground truncate flex-1","data-tooltip":a.cwd,children:(0,k.P_)(a.cwd)}),(0,e.jsx)(o.l,{coordinate:d?.[`${a.cwd}
731
731
  ${a.sessionId}`]}),(0,e.jsx)("span",{className:"text-[10px] text-muted-foreground flex-shrink-0 group-hover:hidden",children:a.completed?B("scheduledTasks.completed"):a.paused?B("scheduledTasks.paused"):B("common.running")}),R===a.id?(0,e.jsxs)("div",{className:"flex-shrink-0 flex items-center gap-1",children:[(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),S(null),y(a.id)},className:"px-2 py-0.5 text-[10px] rounded bg-red-9 text-white hover:bg-red-10",children:B("common.confirm")}),(0,e.jsx)("button",{onClick:a=>{a.stopPropagation(),S(null)},className:"px-2 py-0.5 text-[10px] rounded border border-border text-muted-foreground hover:text-foreground",children:B("common.cancel")})]}):(0,e.jsxs)("div",{className:"flex-shrink-0 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[a.taskFile&&(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),M(a.taskFile)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground",title:B("common.preview"),children:(0,e.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),Z(a)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground",title:B(a.taskFile?"common.copyPath":"common.copy"),children:(0,e.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,e.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",strokeWidth:2}),(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),x(a.id)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-brand",title:B("scheduledTasks.runNow"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M8 5v14l11-7z"})})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),G.current=b.currentTarget,F(a)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground",title:B("common.edit"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),a.completed?null:a.paused?(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),w(a.id)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-green-11",title:B("scheduledTasks.resume"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"})})}):(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),v(a.id)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-amber-11",title:B("scheduledTasks.pause"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 9v6m4-6v6"})})}),(0,e.jsx)("button",{onClick:b=>{b.stopPropagation(),S(a.id)},className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-destructive",title:B("common.delete"),children:(0,e.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,e.jsx)("div",{className:"text-xs text-foreground line-clamp-3 mb-1 whitespace-pre-wrap break-words","data-tooltip":(0,k.Q_)(a),children:(0,k.Q_)(a)}),(0,e.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"truncate",children:function(a,b){if("once"===a.type)return b("scheduledTasks.onceType",{minutes:a.delayMinutes});if("interval"===a.type){let c=b("scheduledTasks.everyNMinutes",{minutes:a.intervalMinutes});return a.activeFrom&&a.activeTo?`${c} (${a.activeFrom}-${a.activeTo})`:c}return"cron"===a.type?a.cron||"cron":a.type}(a,B)}),(0,e.jsx)("span",{children:"\xb7"}),(0,e.jsx)("span",{className:"flex-shrink-0",children:a.completed?"success"===a.lastResult?B("scheduledTasks.success"):B("scheduledTasks.failure"):a.paused?B("scheduledTasks.paused"):function(a,b){if(!a)return"-";let c=a-Date.now();if(c<=0)return b("scheduledTasks.aboutToTrigger");if(c<6e4)return b("scheduledTasks.secondsLater",{count:Math.ceil(c/1e3)});if(c<36e5)return b("scheduledTasks.minutesLater",{count:Math.ceil(c/6e4)});if(c<864e5){let a=Math.floor(c/36e5),d=Math.ceil(c%36e5/6e4);return d>0?b("scheduledTasks.hoursMinutesLater",{h:a,m:d}):b("scheduledTasks.hoursLater",{h:a})}return new Date(a).toLocaleDateString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}(a.nextFireTime,B)}),!a.completed&&a.lastFiredAt&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{children:"\xb7"}),(0,e.jsxs)("span",{className:"flex-shrink-0",children:[B("scheduledTasks.lastResult"),": ","success"===a.lastResult?"✓":"✗"]})]})]})]},a.id)})})]},a)})})}),(0,e.jsx)("div",{className:"hidden md:flex flex-1 min-w-0",children:W?(0,e.jsx)(p.x,{task:W,onOpenSession:()=>_(W)},W.id):(0,e.jsx)("div",{className:"flex-1 flex items-center justify-center text-xs text-muted-foreground",children:B("scheduledTasks.selectTaskHint")})})]})})]})]}),L&&null!==N&&(0,e.jsx)(m.x,{filePath:L,content:N,cwd:L.slice(0,Math.max(0,L.lastIndexOf("/"))),onClose:Y,zClassName:"z-[80]"}),E&&(0,e.jsx)("div",{ref:H,className:"fixed z-[100]",style:{top:I?.top??0,left:I?.left??0,visibility:I?"visible":"hidden"},children:(0,e.jsx)(l.E,{onClose:K,onCreate:()=>{},editTask:{id:E.id,message:E.message,taskFile:E.taskFile,type:E.type,delayMinutes:E.delayMinutes,intervalMinutes:E.intervalMinutes,activeFrom:E.activeFrom,activeTo:E.activeTo,cron:E.cron},onUpdate:(a,b)=>{A(a,b),K()}})})]})}d()}catch(a){d(a)}})},75310:(a,b,c)=>{"use strict";function d(a,b){let c=`/project?cwd=${encodeURIComponent(a)}`;b?.sessionId?c+=`&sessionId=${encodeURIComponent(b.sessionId)}`:b?.blank&&(c+="&newChat=1"),b?.file?c+=`&file=${encodeURIComponent(b.file)}`:b?.bubble&&(c+=`&bubble=${encodeURIComponent(b.bubble)}`);let d=b?.file?"explorer":b?.bubble?"console":b?.sessionId&&b.switchToAgent?"agent":null;return d&&(c+=`&view=${d}`),c}c.d(b,{f:()=>d})},75389:(a,b,c)=>{"use strict";c.d(b,{T:()=>A});var d=c(48249),e=c(67484),f=c(36041),g=c(12625),h=c(44384),i=c(44256),j=c(63565),k=c(46674),l=c(57063);let m=/^#\s+(.*)$/;function n(a,b=[]){let c=new Map(b.map(a=>[a.name,a.id])),d=[];for(let[b,c]of a.split(/\r?\n/).entries()){let a=c.match(m);if(a){d.push({name:a[1].trim(),line:b+1,body:[]});continue}let e=d[d.length-1];if(!e){if(c.trim())return{ok:!1,line:b+1,reason:"content-before-heading"};continue}e.body.push(c)}let e=new Set,f=[];for(let a of d){let b=a.body.join("\n").trim();if(!a.name||!b)return{ok:!1,line:a.line,reason:"empty-style"};if(e.has(a.name))return{ok:!1,line:a.line,reason:"duplicate-name"};e.add(a.name),f.push({id:c.get(a.name)??"",name:a.name,content:b})}return{ok:!0,styles:f}}function o({styles:a,onSave:b,onClose:c}){let{t:f}=(0,h.Bd)(),[g,j]=(0,e.useState)(()=>a.map(a=>`# ${a.name}
732
732
  ${a.content}`).join("\n\n")),[m,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(!1),s=n(g,a);(0,l.E)(c);let t=(0,e.useCallback)(async()=>{let d=n(g,a);if(d.ok&&!m){if(p(!0),r(!1),await b(d.styles))return void c();p(!1),r(!0)}},[c,b,m,a,g]),u=f("chat.editOutputStyles");return(0,d.jsx)(i.ZL,{children:(0,d.jsx)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-scrim p-4",onMouseDown:a=>{a.target===a.currentTarget&&c()},children:(0,d.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":u,className:"w-full max-w-4xl max-h-[90vh] bg-card border border-border rounded-xl shadow-lv3 flex flex-col",children:[(0,d.jsxs)("header",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-foreground",children:u}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:f("chat.outputStylesMarkdownHint")})]}),(0,d.jsx)("button",{type:"button",onClick:c,className:"p-1 text-muted-foreground hover:text-foreground hover:bg-hover rounded","aria-label":f("common.cancel"),children:(0,d.jsx)(k.A,{className:"w-4 h-4"})})]}),(0,d.jsx)("div",{className:"min-h-0 flex-1 px-4 py-3",children:(0,d.jsx)("textarea",{autoFocus:!0,value:g,onChange:a=>j(a.target.value),placeholder:f("chat.outputStylesMarkdownPlaceholder"),rows:24,spellCheck:!1,"data-testid":"output-styles-editor",className:"w-full h-[60vh] min-h-80 max-h-[70vh] resize-y px-3 py-2 text-sm font-mono leading-6 bg-background border border-border rounded-lg text-foreground focus:outline-none focus:border-brand"})}),(0,d.jsxs)("footer",{className:"flex items-center justify-between gap-3 px-4 py-3 border-t border-border",children:[(0,d.jsx)("span",{className:"text-xs text-destructive",children:s.ok?q?f("chat.saveQuickInstructionsFailed"):"":f(`chat.outputStylesError.${s.reason}`,{line:s.line})}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:c,className:"px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground rounded hover:bg-hover",children:f("common.cancel")}),(0,d.jsx)("button",{type:"button",disabled:!s.ok||m,onClick:t,"data-testid":"output-styles-save",className:"px-3 py-1.5 text-xs rounded border border-brand text-brand hover:bg-brand/10 disabled:opacity-40",children:f(m?"chat.savingQuickInstructions":"common.save")})]})]})]})})})}var p=c(33281),q=c(41224);let r=[],s=r,t=!1,u=null,v=new Set,w=a=>{s=a,v.forEach(a=>a())};async function x(a){let b=await p.t4.runPromiseExit((0,q.DF)(a));return"Failure"===b._tag?(console.error("Failed to save output styles:",b.cause),!1):(t=!0,w(b.value.styles??r),!0)}let y=a=>(v.add(a),()=>{v.delete(a)}),z=()=>s;function A({value:a,onChange:b}){let{t:c}=(0,h.Bd)(),k=(0,e.useSyncExternalStore)(y,z,()=>r),l=(0,e.useRef)(null),m=(0,e.useRef)(null),[n,s]=(0,e.useState)(!1),[v,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)({top:0,left:0}),E=(0,i.F2)(),F=k.find(b=>b.id===a),G=c("chat.outputStyleNone"),H=F?.name??G,I=(0,e.useCallback)(()=>{let a=l.current?.getBoundingClientRect();if(!a)return;let b=E?.getBoundingClientRect();D({top:a.bottom+4-(b?.top??0),left:a.left-(b?.left??0)})},[E]),J=a=>{b(a),s(!1)},K=a=>`flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition-colors ${a?j.yI:"text-muted-foreground hover:bg-hover hover:text-foreground"}`;return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(j.XY,{buttonRef:l,label:H,labelMaxWidth:"max-w-[140px]",title:`${c("chat.outputStyle")}: ${H}`,onClick:()=>{n||(I(),function(a=!1){t&&!a?Promise.resolve():u||(u=(async()=>{let a=await p.t4.runPromiseExit((0,q.K4)());(u=null,"Failure"===a._tag)?console.error("Failed to load output styles:",a.cause):(t=!0,w(a.value.styles??r))})())}(!0)),s(a=>!a)},icon:(0,d.jsx)(f.A,{className:`h-3.5 w-3.5 flex-shrink-0 ${F?"text-brand":""}`}),testId:"output-style-picker"}),n&&(0,d.jsx)(i.ZL,{children:(0,d.jsxs)("div",{ref:m,className:`${j.ys} min-w-[200px] max-w-[320px]`,style:{top:C.top,left:C.left},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 pb-1",children:[(0,d.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:c("chat.outputStyle")}),(0,d.jsx)("button",{type:"button",onClick:()=>{s(!1),B(!0)},className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-hover",title:c("chat.editOutputStyles"),"data-testid":"output-style-edit",children:(0,d.jsx)(g.A,{className:"w-3 h-3"})})]}),(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>J(""),className:K(!F),children:[(0,d.jsx)("span",{className:"mt-0.5",children:(0,d.jsx)(j.hG,{selected:!F})}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:G})]}),k.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>J(a.id),className:K(F?.id===a.id),title:a.content,children:[(0,d.jsx)("span",{className:"mt-0.5",children:(0,d.jsx)(j.hG,{selected:F?.id===a.id})}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.name})]},a.id)),0===k.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-[11px] text-muted-foreground",children:c("chat.noOutputStyles")})]})]})}),v&&(0,d.jsx)(o,{styles:k,onSave:x,onClose:()=>B(!1)})]})}},75513:(a,b,c)=>{"use strict";c.d(b,{k_:()=>h,nH:()=>i});var d=c(48249),e=c(67484),f=c(7031);let g=(0,e.createContext)(null);function h({children:a}){let b=(0,e.useRef)(new Map),c=(0,e.useRef)(null),[i,j]=(0,e.useState)(()=>new Set),k=i.size>0,l=(0,e.useCallback)((a,b)=>{j(c=>{if(b===c.has(a))return c;let d=new Set(c);return b?d.add(a):d.delete(a),d})},[]),m=(0,e.useCallback)((a,c)=>{b.current.set(c,a)},[]),n=(0,e.useCallback)(a=>{b.current.delete(a),j(b=>{if(!b.has(a))return b;let c=new Set(b);return c.delete(a),c})},[]),o=(0,e.useCallback)(a=>{c.current=a},[]),p=(0,e.useCallback)(a=>{let d=c.current;if(!d)return void console.warn("No active tab to send message");let e=b.current.get(d);e?e(a):console.warn(`No chat sender registered for tab ${d}`)},[]),q=(0,e.useCallback)((a,c)=>{let d=b.current.get(a);return d?(d(c),!0):(console.warn(`No chat sender registered for tab ${a}`),!1)},[]),r=(0,e.useMemo)(()=>({sendMessage:p,sendToTab:q,isLoading:k,registerChat:m,unregisterChat:n,setActiveTab:o,setChatLoading:l}),[p,q,k,m,n,o,l]),s=(0,e.useMemo)(()=>({sendMessage:p,isLoading:k}),[p,k]);return(0,d.jsx)(g.Provider,{value:r,children:(0,d.jsx)(f.H,{value:s,children:a})})}function i(){return(0,e.useContext)(g)}},76306:(a,b,c)=>{"use strict";c.d(b,{V:()=>g});var d=c(57031),e=c(88214);let f={isFramed:()=>window.parent!==window,publishOpenProject:a=>(0,d.F)(e.n.OpenProject,a),navigate:a=>window.location.assign(a)};function g(a,b,c=f){c.isFramed()?c.publishOpenProject({cwd:a.cwd,sessionId:a.sessionId,switchToAgent:!0}):c.navigate(b)}},76537:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>q,metadata:()=>o,viewport:()=>p});var d=c(5735),e=c(30768),f=c.n(e),g=c(93868),h=c.n(g),i=c(83503),j=c.n(i),k=c(29021),l=c(33873);c(61135);var m=c(25702);let n="";try{n=(0,k.readFileSync)((0,l.join)(process.cwd(),"public","boot.js"),"utf8")}catch{}let o={title:"OpenCockpit",description:"OpenCockpit is a local-first AI development hub with chat agents, a file explorer, terminals, and browser bubbles in one swipeable workspace. One seat. One AI.",appleWebApp:{capable:!0,statusBarStyle:"default",title:"Cockpit"},icons:{icon:"/icons/icon-192x192.png",apple:"/icons/icon-192x192.png"}},p={themeColor:[{media:"(prefers-color-scheme: light)",color:"#f9f9fb"},{media:"(prefers-color-scheme: dark)",color:"#111113"}]};function q({children:a}){return(0,d.jsxs)("html",{lang:"en",suppressHydrationWarning:!0,className:"overflow-hidden",children:[(0,d.jsxs)("head",{children:[(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:n}}),(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:`window.__COCKPIT_BUILD_ID__=${JSON.stringify(process.env.COCKPIT_BUILD_ID??null)};window.__COCKPIT_FORCE_UPDATE__=${JSON.stringify("1"===process.env.COCKPIT_FORCE_UPDATE_BADGE)}`}})]}),(0,d.jsx)("body",{className:`${f().variable} ${h().variable} ${j().variable} antialiased overflow-hidden`,children:(0,d.jsx)(m.Providers,{children:a})})]})}},76603:(a,b,c)=>{"use strict";c.d(b,{BotsModal:()=>t});var d=c(48249),e=c(67484),f=c(76193),g=c(46674),h=c(65255),i=c(7309),j=c(59347),k=c(44384),l=c(33281),m=c(57031),n=c(88214),o=c(15332),p=c(27668),q=c(81608),r=c(7833),s=c(15819);function t({isOpen:a,onClose:b}){let{t:c}=(0,k.Bd)(),[h,i]=(0,e.useState)([]),[j,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),B=(0,e.useCallback)(async()=>{w(!0);let a=await l.t4.runPromiseExit((0,o.jm)());"Success"===a._tag?i(a.value):(0,r.oR)((0,p.oh)(a.cause,c("bots.loadFailed")),"error"),w(!1)},[c]),C=(0,e.useMemo)(()=>{let a=z.trim().toLowerCase();return a?h.filter(b=>{let c=b.valid?b.description:b.error;return`${b.name}
733
733
  ${c}