/**
 * i18n Constants — en
 * English translations for the Web UI.
 * Must have identical keys to zh-CN.ts (enforced by type).
 */
import type { I18nKey } from './zh-CN'

const en: Record<I18nKey, string> = {
  // ─── App ───
  appName: 'xbot',
  appSubtitle: 'AI Chat Assistant',
  loading: 'Loading...',
  logoutBtn: 'Logout',
  skipToContent: 'Skip to content',

  // ─── Auth ───
  login: 'Login',
  register: 'Register',
  logout: 'Logout',
  username: 'Username',
  password: 'Password',
  loginFailed: 'Login failed',
  registerFailed: 'Registration succeeded but auto-login failed. Please login manually.',
  networkError: 'Network error',
  operationFailed: 'Operation failed',
  enterUsername: 'Enter username',
  enterPassword: 'Enter password',
  noAccount: "Don't have an account? Register",
  hasAccount: 'Already have an account? Login',
  createAccount: 'Create Account',
  feishuLogin: 'Feishu Login',
  feishuAccountLogin: 'Feishu Account Login',
  feishuLoginFailed: 'Feishu login failed',
  feishuUserId: 'Feishu User ID',
  feishuPassword: 'Linked Web account password',
  feishuPasswordLabel: 'Web Password',
  feishuBindHint: 'You need to bind a Web account in Feishu first, then use the password set during binding.',
  feishuPlaceholder: 'ou_xxx or open_id',
  backToPasswordLogin: '← Back to password login',
  loginViaFeishu: 'Login via Feishu User ID →',

  // ─── Chat ───
  startConversation: 'Start a conversation',
  sendFirstMessage: 'Send a message to start chatting with the AI assistant',
  searchHistory: 'Search history',
  viewCommands: 'View commands',
  inputPlaceholder: 'Type a message... (Shift+Enter for new line)',
  connecting: 'Connecting...',
  send: 'Send',
  sendMessage: 'Send message',
  stopGeneration: 'Stop generation',
  scrollToBottom: 'Scroll to bottom',
  newMessages: 'New messages',
  conversationCleared: 'Conversation cleared',
  newConversation: 'New conversation',
  copyContent: 'Copy content',
  copied: '✓ Copied',
  copyCode: 'Copy code',
  searchKbHint: 'Search history',
  commandHint: 'View commands',
  switchedToModel: 'Switched to {model}',
  openSettings: 'Open settings',
  messagesAriaLabel: 'Messages',
  imagePreview: 'Image preview',
  closePreview: 'Close preview',
  imagePreviewAlt: 'Preview',
  cancelGeneration: 'Cancel generation',
  helpTitle: 'Available commands',

  // ─── Status ───
  connected: '● Connected',
  connectingStatus: '◐ Connecting...',
  disconnected: '○ Disconnected',
  serverDisconnected: '⛔ Server disconnected. Please refresh the page to reconnect.',
  reconnecting: '⚠️ Connection lost, reconnecting...',
  contextUsage: 'Context usage',
  contextUsageTitle: 'Context usage: {prompt} / {max} tokens',

  // ─── Settings ───
  settings: '⚙️ Settings',
  closeSettings: 'Close settings',
  saving: 'Saving...',
  appearance: 'Appearance',
  sessions: 'Sessions',
  presets: 'Presets',
  llm: 'LLM',
  runner: 'Runner',
  market: 'Market',
  theme: 'Theme',
  dark: 'Dark',
  light: 'Light',
  fontSize: 'Font size',
  nickname: 'Nickname',
  switchModel: 'Switch model',
  modelSelect: 'Model selection',
  settingsSaved: 'Settings saved',
  saveFailed: 'Save failed. Please try again.',

  // ─── Search ───
  searchMessages: 'Search message history...',
  searching: 'Searching...',
  noResults: 'No results found',

  // ─── File upload ───
  uploadFile: 'Upload file',
  uploadFailed: 'Upload failed',
  fileTooLarge: 'File exceeds 10MB limit',
  uploadResponseError: 'Upload response error',
  dragToUpload: 'Drag files here to upload',
  dragSupportedTypes: 'Supports images, documents, code and other files',
  remove: 'Remove',

  // ─── Commands ───
  cmdClear: 'Clear conversation',
  cmdNew: 'New conversation',
  cmdCompact: 'Compress context',
  cmdHelp: 'Show help',
  cmdCancel: 'Cancel generation',

  // ─── AskUser ───
  agentNeedsInput: 'Agent needs your input',
  inputAnswer: 'Type your answer...',
  submit: 'Submit',
  previousQuestion: '← Previous',
  cancel: 'Cancel',

  // ─── Progress ───
  thinking: 'Thinking...',
  rendering: 'Rendering chart...',
  executingTool: 'Executing tool...',
  processing: 'Processing...',
  preparing: 'Preparing...',

  // ─── Mermaid ───
  mermaidRenderFailed: 'Mermaid render failed',

  // ─── Image / File ───
  image: 'Image',
  file: 'File',

  // ─── Confirm dialog ───
  confirm: 'Confirm',

  // ─── Sidebar ───
  searchPlaceholder: 'Search sessions...',
  expandSidebar: 'Expand session list',
  chatSessions: '💬 Sessions',
  newSession: 'New session',
  collapseSidebar: 'Collapse',
  unnamedSession: 'Unnamed',
  currentSession: 'Current',
  refreshSessions: '🔄 Refresh',
  noSessions: 'No sessions',
  deleteSession: 'Delete session',
  renameSession: 'Rename',
  confirmDeleteSession: 'Are you sure you want to delete this session? This action cannot be undone.',
  sidebarLoading: 'Loading...',

  // ─── Errors ───
  switchFailed: 'Switch failed',

  // ─── Runner ───
  local: 'Local',
  workspaceEnv: '🖥️ Workspace',
  manageRunners: 'Manage remote Runners. Click a card to switch the active environment.',
  noRunners: 'No workspaces added',
  addRunnerHint: 'Add a Runner to execute commands remotely',
  activeBadge: 'Active',
  dockerSandbox: '🐳 Docker Sandbox (Built-in)',
  builtinEnv: 'Built-in environment',
  copyConnectCommand: 'Copy connect command',
  copiedCommand: 'Copied!',
  deleteRunner: 'Delete',
  confirmDeleteRunner: 'Confirm delete',
  confirmDeleteRunnerText: 'Are you sure you want to delete {name}?',
  runnerOnlineWarning: '⚠️ This Runner is currently online. Deleting will disconnect it.',
  runnerName: 'Name',
  runnerNamePlaceholder: 'e.g. MacBook Pro',
  runMode: 'Run mode',
  nativeMode: '🖥️ Native',
  dockerMode: '🐳 Docker',
  dockerImage: 'Docker Image',
  workspace: 'Workspace',
  workspacePlaceholder: 'e.g. /home/user/project (leave empty for auto-detect)',
  workspaceHint: 'Runner will use this directory as workspace after connecting',
  creating: '⏳ Creating...',
  create: '✨ Create',
  addWorkspace: '➕ Add workspace',

  // ─── Offline ───
  offlineMessage: '📶 Network disconnected. Some features are unavailable.',
  backOnline: '📶 Network restored',

  // ─── Error boundary ───
  errorBoundaryTitle: 'Something went wrong',
  errorBoundaryMessage: 'An unexpected error occurred. Please try refreshing the page.',
  errorBoundaryRetry: 'Retry',
  refreshPage: 'Refresh page',
  errorDetails: 'Error details',

  // ─── Tokens ───
  tokens: 'tokens',

  // ─── Appearance Tab ───
  appearanceTitle: '🎨 Appearance',
  themeLabel: 'Theme',
  fontSizeLabel: 'Font Size',
  nicknameLabel: 'Nickname',
  languageLabel: 'Language',
  smallSize: 'Small',
  mediumSize: 'Medium',
  largeSize: 'Large',
  enterNickname: 'Enter nickname...',

  // ─── Sessions Tab ───
  chatRooms: '💬 ChatRooms',
  chatRoomDesc: 'All conversations are ChatRooms — Person↔Agent, Agent↔Agent unified management.',
  backToList: '← Back to list',
  mainSession: '👤 Main',
  agentSession: '🤖 Agent',
  running: 'Running',
  completed: 'Completed',
  noMessages: 'No messages',
  noChatRooms: 'No ChatRooms',
  loadingDots: 'Loading...',
  refresh: '🔄 Refresh',

  // ─── LLM Tab ───
  llmTitle: '🧠 Personal LLM Config',
  fetchConfigFailed: 'Failed to load config',
  providerLabel: 'Provider',
  currentModelLabel: 'Current model',
  usingPersonalModel: 'Using personal model. You can switch models or delete the config to restore system default.',
  addLLMConfig: 'Add personal LLM config',
  baseURLRequired: 'Base URL and API Key are required',
  configSaved: 'Config saved',
  modelSwitched: 'Model switched',
  switchModelFailed: 'Failed to switch model',
  configDeleted: 'Config deleted',
  deleteFailed: 'Delete failed',
  deleteLLMConfig: 'Delete personal LLM config? This will restore the system default model.',
  deleteConfig: 'Delete config',
  addConfig: 'Add config',
  saveConfig: 'Save config',
  save: 'Save',
  defaultModel: 'Default',
  apiKeyMasked: '••••••••',
  maxContextLabel: 'Max Context Tokens',
  maxOutputLabel: 'Max Output Tokens',
  thinkingModeLabel: 'Thinking Mode',
  thinkingAuto: 'Auto',
  thinkingOn: 'On',
  thinkingOff: 'Off',
  baseURLLabel: 'Base URL',
  apiKeyLabel: 'API Key',
  modelLabel: 'Model',
  enterModelName: 'Enter model name...',

  // ─── Presets Tab ───
  presetsTitle: '⚡ Presets',
  presetsDesc: 'Configure quick commands for fast access in the chat input. Max 20 entries.',
  presetIcon: 'Icon',
  presetLabel: 'Label',
  presetContent: 'Content',
  presetContentPlaceholder: 'Content to send on click...',
  fillMode: 'Fill mode (fill into editor instead of direct send)',
  savePreset: '💾 Save',
  confirmDeletePreset: 'Delete this preset?',
  noPresets: 'No presets',
  moveUp: 'Move up',
  moveDown: 'Move down',
  editPreset: 'Edit',
  deletePreset: 'Delete',

  // ─── Market Tab ───
  marketTitle: '🏪 Market',
  publishSuccess: 'Published',
  unpublishSuccess: 'Unpublished',
  installSuccess: 'Installed',
  uninstallSuccess: 'Uninstalled',
  installFailed: 'Install failed',
  uninstallFailed: 'Uninstall failed',

  // ─── AssistantTurn ───
  thinkingProcess: 'Thinking process',
  iterationProcess: 'Iteration process',
  expandAll: 'Expand all',
  collapse: 'Collapse',

  // ─── Tab labels ───
  tabAppearance: 'Appearance',
  tabSessions: 'Sessions',
  tabPresets: 'Presets',
  tabLLM: 'LLM',
  tabRunner: 'Runner',
  tabMarket: 'Market',

  // ─── Message Actions ───
  deleteMessage: 'Delete Message',
  regenerate: 'Regenerate',
  messageDeleted: 'Message Deleted',
  regenerateFailed: 'Regeneration Failed',

  // ─── Search ───
  searchResults: '{count} results',

  // ─── Misc ───
  refreshPageHint: 'Please refresh the page to reconnect',
  delete: 'Delete',
  exportMarkdown: 'Export Markdown',
  exportJSON: 'Export JSON',
  exportChat: 'Export Chat',
  edit: 'Edit',
  preview: 'Preview',
  returnToLogin: 'Return to login',
  // ─── Reply ───
  replyMessage: 'Reply',
  replyingTo: 'Replying to',
  cancelReply: 'Cancel reply',

  // ─── Tab Bar ───
  closeTab: 'Close tab',
  newTab: 'New session',
  noOpenTabs: 'No open sessions',

  // ─── Notification ───
  enableNotification: 'Enable desktop notifications',
  newMessageNotification: 'New message from xbot',
  notificationClickToView: 'Click to view',
  notificationEnabled: 'Notifications enabled',
  notificationDenied: 'Notification permission denied',
  expandCodeBlock: 'Expand ({lines} lines)',
  collapseCodeBlock: 'Collapse',

  // ─── WebSocket Status ───
  wsConnected: '● Connected',
  wsConnecting: '◐ Connecting...',
  wsDisconnected: '○ Disconnected',
  wsReconnecting: '⚠️ Reconnecting',
  reconnectAttemptN: 'Attempt {n}',
  nextRetryIn: '{n}s',
  reconnectSyncHint: 'Messages will sync automatically after reconnection',

  // ─── Settings Advanced ───
  searchSettings: 'Search settings...',
  noMatchingSettings: 'No matching settings',
  exportSettings: 'Export Settings',
  importSettings: 'Import Settings',
  importSuccess: 'Settings imported',
  importFailed: 'Import failed: invalid format',
  resetToDefaults: 'Reset to Defaults',
  confirmResetSettings: 'Reset all appearance settings to defaults?',
  settingsReset: 'Settings reset',

  // ─── Message Status ───
  sending: 'Sending...',
  sendFailed: 'Send failed',
  retry: 'Retry',
  edited: '(edited)',
  charCount: '{count} chars',
  justNow: 'just now',
  minutesAgo: '{n}m ago',
  hoursAgo: '{n}h ago',
  daysAgo: '{n}d ago',

  // ─── Image Brightness ───
  imageBrightnessLabel: 'Image Brightness',
  imageBrightnessHint: 'Adjust image brightness in dark mode',

  // ─── Upload Queue (Batch 2) ───
  uploadQueue: 'Upload Queue',
  uploadProgress: '{percent}%',
  uploadComplete: 'Upload complete',
  uploadCancelled: 'Upload cancelled',
  uploadRetrying: 'Retrying...',
  cancelUpload: 'Cancel upload',
  retryUpload: 'Retry upload',
  queueEmpty: 'No uploads in queue',
  uploading: 'Uploading...',
  uploadError: 'Upload error',
  filesSelected: '{count} files selected',
  uploadAll: 'Upload All',
  clearCompleted: 'Clear completed',
  uploadSpeed: '{speed}/s',
  uploadRemaining: '{time} remaining',
  parallelUploads: 'Parallel uploads',
  uploadPaused: 'Paused',
  pauseUpload: 'Pause',
  resumeUpload: 'Resume',

  // ─── Swipe & Context Menu (Batch 3) ───
  swipeToReply: '← Swipe to reply',
  doubleClickToReply: 'Double-click to reply',
  copyMessageLink: 'Copy message link',
  quoteMessage: 'Quote',
  forwardMessage: 'Forward',
  messageActions: 'Message actions',
  pinMessage: 'Pin',
  unpinMessage: 'Unpin',

  // ─── Command Palette (Batch 4) ───
  commandPalette: 'Command Palette',
  commandPaletteHint: 'Type a command or search...',
  commandPaletteTabCommands: 'Commands',
  commandPaletteTabSearch: 'Search',
  noMatchingCommands: 'No matching commands',
  quickActions: 'Quick Actions',
  openCommandPalette: 'Ctrl+K Command Palette',
  runCommand: 'Run',

  // ─── Onboarding (Batch 4) ───
  onboardingTip: '💡 Press Ctrl+K to open the command palette for quick search and actions',
  onboardingDismiss: 'Got it',
  onboardingPrev: 'Previous',
  onboardingNext: 'Next',
  onboardingDone: 'Get started',
  onboardingStep1Title: 'Input Box',
  onboardingStep1Desc: 'Type messages to chat with AI',
  onboardingStep2Title: 'File Upload',
  onboardingStep2Desc: 'Drag & drop or paste to upload files',
  onboardingStep3Title: 'Command Palette',
  onboardingStep3Desc: 'Press Ctrl+K for quick search and actions',

  // ─── Media Player (Batch 5) ───
  audioPlayer: 'Audio Player',
  videoPlayer: 'Video Player',
  play: 'Play',
  pause: 'Pause',
  volume: 'Volume',
  mute: 'Mute',
  unmute: 'Unmute',
  fullscreen: 'Fullscreen',
  exitFullscreen: 'Exit Fullscreen',
  mediaNotSupported: 'Browser does not support this media format',
  playbackSpeed: 'Playback Speed',
  normalSpeed: 'Normal',
  pip: 'Picture-in-Picture',
  exitPip: 'Exit Picture-in-Picture',

  // ─── Media Player Enhancements (Batch 6) ───
  playbackRate: 'Playback Speed',
  rate0_5: '0.5x',
  rate0_75: '0.75x',
  rate1: '1x',
  rate1_25: '1.25x',
  rate1_5: '1.5x',
  rate2: '2x',

  // ─── Keyboard Navigation ───
  keyboardHelp: 'Keyboard Shortcuts',
  vimNavigation: 'Vim Navigation',
  navigation: 'Navigation',
  actions: 'Actions',
  mediaControl: 'Media Control',
  scrollDown: 'Scroll Down',
  scrollUp: 'Scroll Up',
  goToTop: 'Go to Top',
  goToBottom: 'Go to Bottom',
  halfPageUp: 'Half Page Up',
  halfPageDown: 'Half Page Down',
  toggleKeyboardHelp: 'Keyboard Help',
  playPause: 'Play/Pause',
  seekBackForward: 'Seek Back/Forward',
  volumeUpDown: 'Volume Up/Down',

  // ─── Bookmarks & Theme ───
  bookmarkMessage: 'Bookmark Message',
  bookmarks: 'Bookmarks',
  themeEditor: 'Theme Editor',
  customTheme: 'Custom Theme',
  importTheme: 'Import Theme',
  exportTheme: 'Export Theme',
  previewTheme: 'Preview Theme',
  resetTheme: 'Reset Theme',
  safeArea: 'Safe Area',
  foldScreen: 'Fold Screen',
  landscapeMode: 'Landscape Mode',
  noBookmarks: 'No Bookmarks',
  jumpToBookmark: 'Jump',
  removeBookmark: 'Remove Bookmark',

  // ─── Reactions (Round 14) ───
  reactions: 'Reactions',
  addReaction: 'Add reaction',
  reactionLike: '👍 Like',
  reactionLove: '❤️ Love',
  reactionLaugh: '😂 Laugh',
  reactionWow: '😮 Wow',
  reactionSad: '😢 Sad',
  reactionAngry: '😠 Angry',
  reactionCount: '{count}',
  reactionTooltip: '{emoji} {count} people',

  // ─── Threads (Round 14) ───
  thread: 'Thread',
  threads: 'Threads',
  newThread: 'New thread',
  replyInThread: 'Reply in thread',
  threadReplies: '{count} replies',
  threadParticipants: '{count} participants',
  closeThread: 'Close thread',
  threadEmpty: 'No replies in this thread',
  threadLastReply: 'Last reply',
  threadCreated: 'Thread created',
  deleteThread: 'Delete thread',

  // ─── Notifications (Round 14) ───
  notificationCenter: 'Notification Center',
  notificationSettings: 'Notification Settings',
  markAllRead: 'Mark all read',
  noNotifications: 'No notifications',
  notificationSound: 'Notification Sound',
  notificationSoundOn: 'Sound on',
  notificationSoundOff: 'Sound off',
  notificationType: 'Notification Type',
  notifyOnMention: 'On mention',
  notifyOnReply: 'On reply',
  notifyOnNewMessage: 'On new message',
  notifyOnWsChange: 'Connection change',
  notificationPreview: 'Notification Preview',
  notificationPermissionRequired: 'Notification permission required',
  clearNotifications: 'Clear notifications',
  unreadCount: '{count} unread',

  // ─── Snapshot (Round 14) ───
  snapshot: 'Snapshot',
  takeSnapshot: 'Screenshot',
  snapshotCopied: 'Snapshot copied to clipboard',
  snapshotFailed: 'Screenshot failed',
  snapshotTitle: 'Message Snapshot',
  snapshotTimestamp: 'Snapshot time',

  // ─── Search Enhancements (Round 14) ───
  searchFilter: 'Filter',
  searchFilterAll: 'All',
  searchFilterUser: 'User messages',
  searchFilterAssistant: 'Assistant messages',
  searchFilterDate: 'Date range',
  searchFilterToday: 'Today',
  searchFilterWeek: 'This week',
  searchFilterMonth: 'This month',
  searchFilterCustom: 'Custom',
  searchHistoryR14: 'Search History',
  clearSearchHistory: 'Clear search history',
  searchContext: 'Context',
  showContext: 'Show context',
  hideContext: 'Hide context',
  contextLines: '{count} lines context',

  // ─── Sound Feedback (Round 14) ───
  soundFeedback: 'Sound Feedback',
  soundOn: '🔊 Sound on',
  soundOff: '🔇 Sound off',
  soundVolume: 'Volume',
  soundType: 'Sound Type',
  soundSent: 'Sent sound',
  soundReceive: 'Receive sound',
  soundNotify: 'Notify sound',
  soundBeep: 'Beep',
  soundChime: 'Chime',
  soundPop: 'Pop',

}

export default en
