@readmagic/workmate 0.0.3 → 0.0.4

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 (322) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-mANiG0xj.js → AddWorkspaceDirectory-BTC7FPqM.js} +1 -1
  2. package/dist/chunks/{App-aUVaOLeo.js → App-DOm71vtY.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-36iUE5CW.js → ApproveApiKey-9YQzwrrC.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-LPrZMlgU.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-BLcvdkgb.js → AssistantSessionChooser-CnYfFWrx.js} +1 -1
  6. package/dist/chunks/{BackgroundTasksDialog-DyjVt81B.js → BackgroundTasksDialog-D_UHm7xo.js} +1 -1
  7. package/dist/chunks/{BypassPermissionsModeDialog-CTlpvTuz.js → BypassPermissionsModeDialog-DAq-qbqC.js} +1 -1
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog--w2zWWEn.js +1 -0
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-5pipE8m8.js → ClaudeMdExternalIncludesDialog-CyvidoR3.js} +1 -1
  10. package/dist/chunks/ConsoleOAuthFlow-BXdC6j3_.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-Blg1TVut.js → DesktopHandoff-gRvy-WlW.js} +1 -1
  12. package/dist/chunks/{DiffDialog-CUEpuocY.js → DiffDialog-CdfVTgOx.js} +1 -1
  13. package/dist/chunks/Doctor-BuiYwjAS.js +1 -0
  14. package/dist/chunks/{Doctor-DlE1Mbb9.js → Doctor-DKlHJBXq.js} +1 -1
  15. package/dist/chunks/{ExitFlow-DCIhnP5h.js → ExitFlow-rExuBL3w.js} +1 -1
  16. package/dist/chunks/{Feedback-CDTqPqsM.js → Feedback-gGpjUC_F.js} +1 -1
  17. package/dist/chunks/{Grove-D9lSG_Lh.js → Grove-CD769Wvw.js} +1 -1
  18. package/dist/chunks/Grove-ENfM8hC6.js +1 -0
  19. package/dist/chunks/{HybridTransport-8j0AviF6.js → HybridTransport-kN1jmg26.js} +1 -1
  20. package/dist/chunks/{InvalidConfigDialog-I3t-0nU3.js → InvalidConfigDialog-BpJub73a.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-BnthOxGT.js → InvalidSettingsDialog-DzOp3Ihx.js} +1 -1
  22. package/dist/chunks/{MCPConnectionManager-zdocEDgk.js → MCPConnectionManager-CaBvO7NB.js} +1 -1
  23. package/dist/chunks/{McpParsingWarnings-D0XvLirX.js → McpParsingWarnings-Cc6FWyU4.js} +1 -1
  24. package/dist/chunks/{MessageSelector-BBhCstBa.js → MessageSelector-DOB1S2-O.js} +1 -1
  25. package/dist/chunks/{Messages-Dv2VrytX.js → Messages-Clihwd2F.js} +2 -2
  26. package/dist/chunks/{Onboarding-B1WRpoBI.js → Onboarding-D00lTweB.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-BSmgq089.js → OverageCreditUpsell-B-Bf_-UX.js} +1 -1
  28. package/dist/chunks/{PluginSettings-DN9rpwc_.js → PluginSettings-DUxj_oAg.js} +1 -1
  29. package/dist/chunks/{PromptInputFooterSuggestions-3rjz6zhK.js → PromptInputFooterSuggestions-MwS_cExV.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-DgDJHZqC.js → PromptInputHelpMenu-V2dEpzhC.js} +1 -1
  31. package/dist/chunks/{QueryEngine-BnaHDZVZ.js → QueryEngine-BLcPQYq_.js} +1 -1
  32. package/dist/chunks/{REPL-CA8FEO7J.js → REPL-B_E07dnf.js} +6 -6
  33. package/dist/chunks/REPL-BhURgntS.js +1 -0
  34. package/dist/chunks/{RemoteCallout-BFzCx_Pn.js → RemoteCallout-ChCjmgw1.js} +1 -1
  35. package/dist/chunks/{RemoteSessionManager-BhUrtejX.js → RemoteSessionManager-B43isWQs.js} +1 -1
  36. package/dist/chunks/{ResumeConversation-BseKUFRI.js → ResumeConversation-DaQ9n8_C.js} +1 -1
  37. package/dist/chunks/{SSETransport-DGIytG74.js → SSETransport-h43pQVlJ.js} +1 -1
  38. package/dist/chunks/SearchExtraToolsTool-DSq7beKs.js +1 -0
  39. package/dist/chunks/{Settings-BvhG1XoW.js → Settings-CNsaWv8g.js} +2 -2
  40. package/dist/chunks/{TeleportProgress-Bens06DU.js → TeleportProgress-QtJrXSCX.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-BtLBCZUe.js → TeleportRepoMismatchDialog-D-HVj-A6.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-t50LfWyN.js → TeleportResumeWrapper-C6sbzJsJ.js} +1 -1
  43. package/dist/chunks/{ThemePicker-BTfuZZ7E.js → ThemePicker-CqPCp5Hs.js} +1 -1
  44. package/dist/chunks/{TrustDialog-CgE_pYUK.js → TrustDialog-CeVwxDlZ.js} +1 -1
  45. package/dist/chunks/{WelcomeV2-C93xQYAF.js → WelcomeV2-DNiXQ5ES.js} +1 -1
  46. package/dist/chunks/{add-dir-C3IhJYVH.js → add-dir-V3xjklnJ.js} +1 -1
  47. package/dist/chunks/{agentDisplay-Cju-aXCx.js → agentDisplay-BuiwcrQi.js} +1 -1
  48. package/dist/chunks/{agents-Bhg0CtXR.js → agents-D7um1IXM.js} +1 -1
  49. package/dist/chunks/{agents-Du3FQ82k.js → agents-ZY6IaVE7.js} +1 -1
  50. package/dist/chunks/{allErrors-DJYCAtab.js → allErrors-CHVdQ3fT.js} +1 -1
  51. package/dist/chunks/{ant-CVvy4SuO.js → ant-D66LZCap.js} +1 -1
  52. package/dist/chunks/{api-gJBnC8z3.js → api-C-rOQY-l.js} +1 -1
  53. package/dist/chunks/api-Dmn7DUgU.js +1 -0
  54. package/dist/chunks/{assistant-C_SkUDk_.js → assistant-CYF7ch7C.js} +1 -1
  55. package/dist/chunks/auth-C4Rvit2q.js +1 -0
  56. package/dist/chunks/auth-Cj7EX1eG.js +1 -0
  57. package/dist/chunks/{auth-CgEABs3i.js → auth-DAxGNCIR.js} +1 -1
  58. package/dist/chunks/{autoMode-CZyb-mMY.js → autoMode-TysBQkU_.js} +1 -1
  59. package/dist/chunks/{autonomy-DJZ25xZp.js → autonomy-CNEbT-t_.js} +1 -1
  60. package/dist/chunks/{autonomy-BpINX4jw.js → autonomy-k3QPea5z.js} +1 -1
  61. package/dist/chunks/{autonomyPanel-ssoiIOx5.js → autonomyPanel-DiztRblF.js} +1 -1
  62. package/dist/chunks/{backgroundHousekeeping-BHncba6e.js → backgroundHousekeeping-C9m4tiFi.js} +2 -2
  63. package/dist/chunks/backgroundHousekeeping-DQjzXBe0.js +1 -0
  64. package/dist/chunks/{branch-BXo5z2al.js → branch-_NBgDfrK.js} +1 -1
  65. package/dist/chunks/{bridge-CbKc1HeD.js → bridge-DpmFl8p8.js} +2 -2
  66. package/dist/chunks/{bridgeConfig-DbqUHe0H.js → bridgeConfig-DMBOO3gW.js} +1 -1
  67. package/dist/chunks/bridgeConfig-DsI5d0s7.js +1 -0
  68. package/dist/chunks/bridgeEnabled-DZzlF2d8.js +1 -0
  69. package/dist/chunks/{bridgeEnabled-CM3SaumJ.js → bridgeEnabled-FjPuA7zx.js} +1 -1
  70. package/dist/chunks/{bridgeMain-CzhBVCsN.js → bridgeMain-BppY0KW3.js} +6 -6
  71. package/dist/chunks/bridgeMain-BrY4tkF6.js +1 -0
  72. package/dist/chunks/{bridgeMessaging-lfa_v3oi.js → bridgeMessaging-N5zlzCCr.js} +1 -1
  73. package/dist/chunks/{btw-Cp0whJaJ.js → btw-BFRje_Zi.js} +1 -1
  74. package/dist/chunks/caches-BBLH8G1I.js +1 -0
  75. package/dist/chunks/{caches-CmW7idg5.js → caches-CcfPJ4_A.js} +2 -2
  76. package/dist/chunks/{ccrClient-BPXmxWHw.js → ccrClient-q2JCVCU2.js} +1 -1
  77. package/dist/chunks/{clear-DjGPxX7T.js → clear-CxY7W5Wt.js} +1 -1
  78. package/dist/chunks/client-CtVu3BLD.js +1 -0
  79. package/dist/chunks/{color-DYYBN52b.js → color-DOWhfjnA.js} +1 -1
  80. package/dist/chunks/commands-BWw1sQeH.js +1 -0
  81. package/dist/chunks/{commitAttribution-Bmzgtqc6.js → commitAttribution-CLbEIaRJ.js} +1 -1
  82. package/dist/chunks/commitAttribution-DIT_s0vY.js +1 -0
  83. package/dist/chunks/{compact-D6xqZN4Q.js → compact-CaOnQVkH.js} +1 -1
  84. package/dist/chunks/config-DmPGzNmi.js +1 -0
  85. package/dist/chunks/{config-huQaTcNb.js → config-HHTwEsWp.js} +1 -1
  86. package/dist/chunks/{context-Bh_iUj76.js → context-B2OvKo2t.js} +1 -1
  87. package/dist/chunks/context-noninteractive-BilCSCV1.js +1 -0
  88. package/dist/chunks/{context-noninteractive-Cb3EM2Oz.js → context-noninteractive-BuGxX3YL.js} +1 -1
  89. package/dist/chunks/conversation-BWXf3un9.js +1 -0
  90. package/dist/chunks/{conversation-CvCQta8e.js → conversation-awh8AwwL.js} +1 -1
  91. package/dist/chunks/{createSSHSession-B0s839mX.js → createSSHSession-C-c7I5iJ.js} +1 -1
  92. package/dist/chunks/{createSession-VMTMXOHu.js → createSession-D_fIDqgc.js} +1 -1
  93. package/dist/chunks/createSession-Hvpx3Le7.js +1 -0
  94. package/dist/chunks/{crossProjectResume-DGpgCUfk.js → crossProjectResume-_XjvSXA3.js} +1 -1
  95. package/dist/chunks/{datadog-D9rlcN12.js → datadog-Ed8emSFA.js} +1 -1
  96. package/dist/chunks/{desktop-DidI-4N5.js → desktop-D_ofPlyi.js} +1 -1
  97. package/dist/chunks/{diff-CZg5qL2n.js → diff-CUAgBDu1.js} +1 -1
  98. package/dist/chunks/doctor-CkdQ7Fv7.js +1 -0
  99. package/dist/chunks/{effort-BcvNemuq.js → effort-DCgooYMY.js} +1 -1
  100. package/dist/chunks/{entry-dA1UCfC0.js → entry-Bh0gPOAo.js} +1 -1
  101. package/dist/chunks/{envLessBridgeConfig-BFjJ8Kt4.js → envLessBridgeConfig-DJHZAlU-.js} +1 -1
  102. package/dist/chunks/envLessBridgeConfig-sxodu0xO.js +1 -0
  103. package/dist/chunks/{esm-DjGYYlQe.js → esm-B62dCLgf.js} +1 -1
  104. package/dist/chunks/{exit-COMnVxzw.js → exit-CFJR3NfE.js} +1 -1
  105. package/dist/chunks/{extra-usage-BTv_OwGN.js → extra-usage-CjaHpu8y.js} +1 -1
  106. package/dist/chunks/extra-usage-D1Y-3OWQ.js +1 -0
  107. package/dist/chunks/{extra-usage-core-RZMzaH0L.js → extra-usage-core-B6ga8Rni.js} +1 -1
  108. package/dist/chunks/{extra-usage-noninteractive-BB-BQ3kh.js → extra-usage-noninteractive-Dc9AndId.js} +1 -1
  109. package/dist/chunks/{extraUsage-CTn9FWSk.js → extraUsage-2DwLEr26.js} +1 -1
  110. package/dist/chunks/extractMemories-C3qrwpu2.js +1 -0
  111. package/dist/chunks/{fast-CNXgsvnE.js → fast-CW_NsL0x.js} +1 -1
  112. package/dist/chunks/fast-D3CPmUX4.js +1 -0
  113. package/dist/chunks/{feedback-DeJ2gvw2.js → feedback-BpRorTAC.js} +1 -1
  114. package/dist/chunks/{firstPartyEventLogger-CQdJn3LV.js → firstPartyEventLogger-CuUiNdj8.js} +2 -2
  115. package/dist/chunks/firstPartyEventLogger-DPUQnc6J.js +1 -0
  116. package/dist/chunks/{flushGate-CJ73xcaK.js → flushGate-BltVae97.js} +1 -1
  117. package/dist/chunks/{gemini-Cn9bMXwP.js → gemini-YyIxfveQ.js} +1 -1
  118. package/dist/chunks/{generateRecap-BO9kzRon.js → generateRecap-tx4wLIkI.js} +1 -1
  119. package/dist/chunks/{generateSessionName-CGpL6ATy.js → generateSessionName-BkDigIN8.js} +1 -1
  120. package/dist/chunks/{goal-C8Qzl7_i.js → goal-DZrD4puM.js} +1 -1
  121. package/dist/chunks/{grok-CDT9P_BL.js → grok-BZf7W_hL.js} +1 -1
  122. package/dist/chunks/{grove-BGXzEyH9.js → grove-CFBPplP6.js} +1 -1
  123. package/dist/chunks/{heapdump-CFHvdSZv.js → heapdump-DWc3Z2NO.js} +1 -1
  124. package/dist/chunks/{help-DUZ7Y7Em.js → help-pap9jNUJ.js} +1 -1
  125. package/dist/chunks/{hooks-RHwUCXcT.js → hooks-Bmat0L6A.js} +1 -1
  126. package/dist/chunks/hooks-cCAzfabs.js +1 -0
  127. package/dist/chunks/inboundAttachments-DZgSqDwY.js +1 -0
  128. package/dist/chunks/{inboundAttachments-Cfl4_n0S.js → inboundAttachments-DkfNHtF9.js} +1 -1
  129. package/dist/chunks/{initReplBridge-GH3-LHF4.js → initReplBridge-myzllvlk.js} +1 -1
  130. package/dist/chunks/{install-OkuNmjmB.js → install-D4jmHjmk.js} +1 -1
  131. package/dist/chunks/{instrumentation-hrXeo-G4.js → instrumentation-Nqgm1SMw.js} +3 -3
  132. package/dist/chunks/{job-DjmIpwJl.js → job-CT9bcgPb.js} +1 -1
  133. package/dist/chunks/{keybindings-B8U17bhs.js → keybindings-DETOn3qJ.js} +1 -1
  134. package/dist/chunks/{launchAgentsPlatform-DnxH2SAn.js → launchAgentsPlatform-CuRQgd2Q.js} +1 -1
  135. package/dist/chunks/{launchLocalMemory-CgXtGng1.js → launchLocalMemory-CRMqifzn.js} +1 -1
  136. package/dist/chunks/{launchLocalVault-Bs6Km3Ua.js → launchLocalVault-DlKX_oDE.js} +1 -1
  137. package/dist/chunks/{launchMemoryStores-DxVAIJuB.js → launchMemoryStores-CN0ecWpP.js} +1 -1
  138. package/dist/chunks/{launchOnboarding-Cn0t_o2k.js → launchOnboarding-DTdUA_wE.js} +1 -1
  139. package/dist/chunks/{launchSchedule-Chwr3Nzd.js → launchSchedule-psiSLmTA.js} +1 -1
  140. package/dist/chunks/{launchSkillStore-6zxJfWVU.js → launchSkillStore-CQQ00Ads.js} +1 -1
  141. package/dist/chunks/{launchTeleport-Ba_Hj13c.js → launchTeleport-CXFRPVMR.js} +1 -1
  142. package/dist/chunks/{launchVault-hGVrHy33.js → launchVault-Dn6jq0Rc.js} +1 -1
  143. package/dist/chunks/{loadAgentsDir-DrDu5yYy.js → loadAgentsDir-BURvZNN6.js} +38 -38
  144. package/dist/chunks/loadAgentsDir-Db9UTm45.js +1 -0
  145. package/dist/chunks/{loadPluginHooks-s7bvGtns.js → loadPluginHooks-C9A9oS-w.js} +1 -1
  146. package/dist/chunks/{localSearch-_bQhk9W6.js → localSearch-D2Rs8wQP.js} +1 -1
  147. package/dist/chunks/localSearch-hBh1ATr2.js +1 -0
  148. package/dist/chunks/{logoV2Utils-CoC4nheD.js → logoV2Utils-DN9nzdX-.js} +1 -1
  149. package/dist/chunks/{magicDocs-kMjYpjCA.js → magicDocs-DIeTcwAA.js} +1 -1
  150. package/dist/chunks/{main-C_rVSWfm.js → main-CI54PZrG.js} +14 -14
  151. package/dist/chunks/{mappers-D0CNXG32.js → mappers-Q_Z3Kjo-.js} +1 -1
  152. package/dist/chunks/{mcp-1ZuFesM9.js → mcp-CtbhGaLC.js} +1 -1
  153. package/dist/chunks/{mcp-CKvGBEjz.js → mcp-DMacvhqZ.js} +1 -1
  154. package/dist/chunks/{mcp-DtxIl6aN.js → mcp-RvwPC7FB.js} +2 -2
  155. package/dist/chunks/{memory-DE2jtkd_.js → memory-BPN8gW7n.js} +1 -1
  156. package/dist/chunks/{mode-B4WIxCMW.js → mode-Jl_Boaym.js} +1 -1
  157. package/dist/chunks/{model-fi472PRc.js → model-BIVmcl_N.js} +1 -1
  158. package/dist/chunks/{model-j9GNZDFr.js → model-CWBwPvTH.js} +1 -1
  159. package/dist/chunks/model-DlVpqR0P.js +1 -0
  160. package/dist/chunks/{nativeInstaller-DktvrWRd.js → nativeInstaller-8arnRiUO.js} +1 -1
  161. package/dist/chunks/{onChangeAppState-CGVeNkt7.js → onChangeAppState-DBantDJ6.js} +1 -1
  162. package/dist/chunks/{openai-BSVjSJiF.js → openai-yin1iDG8.js} +1 -1
  163. package/dist/chunks/{overageCreditGrant-BVxlYgeU.js → overageCreditGrant-CN_sVURL.js} +1 -1
  164. package/dist/chunks/{panelCall-Cp6fpQeL.js → panelCall-CPKC6VR5.js} +1 -1
  165. package/dist/chunks/{partition-RjCtgt9J.js → partition-CW0BJ881.js} +1 -1
  166. package/dist/chunks/{passes-ByTLy6pj.js → passes-DOm9ukdK.js} +1 -1
  167. package/dist/chunks/{permissions-B3df_htx.js → permissions-CxDJ__l6.js} +1 -1
  168. package/dist/chunks/{pidLock-CdNZ0Wfg.js → pidLock-C69HNTTb.js} +2 -2
  169. package/dist/chunks/{plan-BxTA-b4l.js → plan-B0rEs32a.js} +1 -1
  170. package/dist/chunks/{plugin-DOpl5e1t.js → plugin-BSEMgcGu.js} +1 -1
  171. package/dist/chunks/{pluginAutoupdate-L09CQ-ph.js → pluginAutoupdate-CTByPD8J.js} +1 -1
  172. package/dist/chunks/{pluginBlocklist-B32eWmzn.js → pluginBlocklist-mogKaK0p.js} +1 -1
  173. package/dist/chunks/{pluginCliCommands-CDMWnO3d.js → pluginCliCommands-DQQ7C7kk.js} +1 -1
  174. package/dist/chunks/{pluginFlagging-3FQGvIfq.js → pluginFlagging-mHNff1t9.js} +1 -1
  175. package/dist/chunks/{pluginOperations-ClzXYNQe.js → pluginOperations-JEedVzfS.js} +1 -1
  176. package/dist/chunks/pluginStartupCheck-D7ts2V3p.js +1 -0
  177. package/dist/chunks/{pluginStartupCheck-BNd2QNzZ.js → pluginStartupCheck-RscVZDi4.js} +1 -1
  178. package/dist/chunks/{plugins-CcDG95Bs.js → plugins-Cr03lISA.js} +1 -1
  179. package/dist/chunks/policyLimits-DWtLyJ4n.js +1 -0
  180. package/dist/chunks/{print-Cc_QOSPF.js → print-CZUmAzmt.js} +4 -4
  181. package/dist/chunks/{privacy-settings-ChNsgGUs.js → privacy-settings-CwJ1H8Ua.js} +1 -1
  182. package/dist/chunks/{processBashCommand-Bx6_oZoE.js → processBashCommand-aKNneP2u.js} +1 -1
  183. package/dist/chunks/{processSlashCommand-AltWgIFt.js → processSlashCommand-BcPnWNxZ.js} +1 -1
  184. package/dist/chunks/prompt-CIyhCdkE.js +1 -0
  185. package/dist/chunks/{prompt-C0nU0VK3.js → prompt-DNDgGM9q.js} +1 -1
  186. package/dist/chunks/prompt-DRhjinu2.js +1 -0
  187. package/dist/chunks/{promptEditor-Cumef6hJ.js → promptEditor-DMJyosKj.js} +1 -1
  188. package/dist/chunks/{rate-limit-options-VL7S3SCx.js → rate-limit-options--Y3oF1g0.js} +1 -1
  189. package/dist/chunks/{rcDebugLog-2-1XSyFV.js → rcDebugLog-DoL1FpGJ.js} +1 -1
  190. package/dist/chunks/{reconciler-DHRE_gV2.js → reconciler-CJcSh6xo.js} +1 -1
  191. package/dist/chunks/{referral-DrebVwqx.js → referral-UKJv23_5.js} +1 -1
  192. package/dist/chunks/{refresh-pFezssA8.js → refresh-ul_i5R1a.js} +1 -1
  193. package/dist/chunks/{release-notes-D7vrFNXp.js → release-notes-CGv_6MMt.js} +1 -1
  194. package/dist/chunks/{releaseNotes-CDx2P0fb.js → releaseNotes-BKZNuDLD.js} +1 -1
  195. package/dist/chunks/{reload-plugins-CltHfg-l.js → reload-plugins-2W11dpLQ.js} +1 -1
  196. package/dist/chunks/{remote-env-SvvSuP0J.js → remote-env-D9xsoBfx.js} +1 -1
  197. package/dist/chunks/{remoteBridgeCore-BOeljn2c.js → remoteBridgeCore-asY9JAXU.js} +1 -1
  198. package/dist/chunks/{remoteManagedSettings-CaY_ZH8r.js → remoteManagedSettings-Bxo3bv1U.js} +1 -1
  199. package/dist/chunks/{rename-CbqrCCBO.js → rename-CHsHMWpO.js} +1 -1
  200. package/dist/chunks/{resume-DockJaY9.js → resume-NduOaghx.js} +1 -1
  201. package/dist/chunks/{runtimeObserver-XufSllVw.js → runtimeObserver-BXbjibFk.js} +2 -2
  202. package/dist/chunks/{runtimeObserver-DSUuYKfs.js → runtimeObserver-Bo80nWQf.js} +1 -1
  203. package/dist/chunks/sandbox-adapter-DDfVl_2V.js +1 -0
  204. package/dist/chunks/{sandbox-toggle-CZI5fuK3.js → sandbox-toggle-C-WCDRN4.js} +1 -1
  205. package/dist/chunks/searchExtraTools-BHWzsbNO.js +1 -0
  206. package/dist/chunks/{session-B-Z3DU9o.js → session-pDd13-wE.js} +1 -1
  207. package/dist/chunks/{sessionDiscovery-C3pMZkBM.js → sessionDiscovery-CSUnpsCy.js} +1 -1
  208. package/dist/chunks/sessionFileAccessHooks-BZvxeufx.js +1 -0
  209. package/dist/chunks/{sessionMemory-CqRpgwtU.js → sessionMemory-CAmpw2yb.js} +1 -1
  210. package/dist/chunks/sessionMemory-DT0IkiA1.js +1 -0
  211. package/dist/chunks/sessionMemoryUtils-B4kGNH4j.js +1 -0
  212. package/dist/chunks/{sessionObserver-B_09FQKV.js → sessionObserver-Ur7PqKl_.js} +1 -1
  213. package/dist/chunks/sessionObserver-oIkwTidC.js +1 -0
  214. package/dist/chunks/sessionStorage-DqARUj0K.js +1 -0
  215. package/dist/chunks/{sessionTitle-CmLWNFuX.js → sessionTitle-pWMaI79N.js} +1 -1
  216. package/dist/chunks/{sessionTracing-lArOaj9u.js → sessionTracing-CCPRzOvy.js} +1 -1
  217. package/dist/chunks/{settingsSync-BlDk6rsM.js → settingsSync-D_4P3Esd.js} +1 -1
  218. package/dist/chunks/{setup-DdbmxSZh.js → setup-JHvhWKh9.js} +2 -2
  219. package/dist/chunks/{shadowedRuleDetection-E2wF1UjU.js → shadowedRuleDetection-Chi3afMR.js} +1 -1
  220. package/dist/chunks/{sideQuestion-BjHCLSR9.js → sideQuestion-D03MXdE2.js} +1 -1
  221. package/dist/chunks/{sinks-Cb--pqr-.js → sinks-B4_pw0Gb.js} +2 -2
  222. package/dist/chunks/sinks-Cro1Y8C2.js +1 -0
  223. package/dist/chunks/{skill-learning-B0dyBT1_.js → skill-learning-7ZQF5JvA.js} +1 -1
  224. package/dist/chunks/{skillChangeDetector-DQof8SUY.js → skillChangeDetector-uCaYrerZ.js} +1 -1
  225. package/dist/chunks/{skillGapStore-D2fqmnKx.js → skillGapStore-BND2Lq0Z.js} +1 -1
  226. package/dist/chunks/{skillGapStore-75ZYlfwi.js → skillGapStore-z3LP64O-.js} +2 -2
  227. package/dist/chunks/{skillGenerator-CwXUfM4Y.js → skillGenerator-DaNb-yKH.js} +2 -2
  228. package/dist/chunks/skillLearning-GZxYPlyl.js +1 -0
  229. package/dist/chunks/{skillLearning-CB-5fdMl.js → skillLearning-rMX1bSBa.js} +1 -1
  230. package/dist/chunks/{skillPanel-Bum7xpgo.js → skillPanel-q7GPSQ6_.js} +3 -3
  231. package/dist/chunks/{skillSearchPanel-LSPwZIOw.js → skillSearchPanel-oj8gy1ZL.js} +2 -2
  232. package/dist/chunks/{skills-G8WBeffd.js → skills-QqbeFP0s.js} +1 -1
  233. package/dist/chunks/{status-i5beKggW.js → status-BEIsLmfj.js} +1 -1
  234. package/dist/chunks/{status-ClSsvm1N.js → status-DW3Z_7xa.js} +1 -1
  235. package/dist/chunks/{statusNoticeHelpers-BK-54uGY.js → statusNoticeHelpers-CaHS8xig.js} +1 -1
  236. package/dist/chunks/{tag-DYYq4H_i.js → tag-CRg93Die.js} +1 -1
  237. package/dist/chunks/{tasks-BySzm_YJ.js → tasks-BEohK1ij.js} +1 -1
  238. package/dist/chunks/{teleport-dxtBcM01.js → teleport-4Srg5vcP.js} +1 -1
  239. package/dist/chunks/{templateJobs-CT5VxeRr.js → templateJobs-DYP1fjYU.js} +1 -1
  240. package/dist/chunks/{theme-CVTVsRwt.js → theme-kNL4kl_3.js} +1 -1
  241. package/dist/chunks/{thinkback-CXsRbDYN.js → thinkback-gV-sKkMM.js} +1 -1
  242. package/dist/chunks/thinkback-hc5eJ9ul.js +1 -0
  243. package/dist/chunks/{thinkback-play-BhfCaIye.js → thinkback-play-BpWMqbgJ.js} +1 -1
  244. package/dist/chunks/{toolEventObserver-DdhPsAs1.js → toolEventObserver-C98uraqD.js} +1 -1
  245. package/dist/chunks/{toolEventObserver--4fqXxQZ.js → toolEventObserver-ar5NDa0M.js} +1 -1
  246. package/dist/chunks/{toolPool-DvHECcbN.js → toolPool-CNYKDRq5.js} +1 -1
  247. package/dist/chunks/trustedDevice-0dehm9qz.js +1 -0
  248. package/dist/chunks/{trustedDevice-DvpN4J1F.js → trustedDevice-BBKUhCCL.js} +1 -1
  249. package/dist/chunks/{ultrareviewCommand-i3PfFKly.js → ultrareviewCommand-yXlFsMnv.js} +1 -1
  250. package/dist/chunks/{undercover-Q24TWRw0.js → undercover-BTIRVF1t.js} +1 -1
  251. package/dist/chunks/undercover-CG_269xD.js +1 -0
  252. package/dist/chunks/{updateCCB-CEXA6dax.js → updateCCB-B2xAJ4Nr.js} +1 -1
  253. package/dist/chunks/upgrade-J7lKLkD2.js +1 -0
  254. package/dist/chunks/{upgrade-7OrBbrzS.js → upgrade-yNl7EO4e.js} +1 -1
  255. package/dist/chunks/{upload-B-lNHpWe.js → upload-BWVIHmMB.js} +1 -1
  256. package/dist/chunks/{usage-CZdPfUqP.js → usage-B2PbCUMi.js} +1 -1
  257. package/dist/chunks/usage-Ck8Cu45g.js +1 -0
  258. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CzFtdlnD.js → useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js} +1 -1
  259. package/dist/chunks/useMainLoopModel-CO4yBjRM.js +1 -0
  260. package/dist/chunks/{useManagePlugins-BkK1zydO.js → useManagePlugins-BzFKIDrD.js} +1 -1
  261. package/dist/chunks/{useMergedTools-DMGRA1ga.js → useMergedTools-CRLWSGDl.js} +1 -1
  262. package/dist/chunks/{useSearchInput-D5VU9IDU.js → useSearchInput-BzGq4t7t.js} +1 -1
  263. package/dist/chunks/{useSettingsErrors-B5PSF1va.js → useSettingsErrors-CSemUjj1.js} +1 -1
  264. package/dist/chunks/{util-CNa1ib_4.js → util-BnReK81E.js} +1 -1
  265. package/dist/chunks/{validatePlugin-Dw-RGCrm.js → validatePlugin-D6sPqea1.js} +1 -1
  266. package/dist/chunks/{workerRegistry-B2QD2sKq.js → workerRegistry-CUXbNyL9.js} +1 -1
  267. package/dist/chunks/worktree-89ttIVxH.js +1 -0
  268. package/dist/cli.js +1 -1
  269. package/package.json +2 -6
  270. package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +0 -1
  271. package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +0 -1
  272. package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +0 -1
  273. package/dist/chunks/Doctor-B540I-gq.js +0 -1
  274. package/dist/chunks/Grove-DLYXL8hv.js +0 -1
  275. package/dist/chunks/REPL-B3RbzeV7.js +0 -1
  276. package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +0 -1
  277. package/dist/chunks/api-CI8HXREw.js +0 -1
  278. package/dist/chunks/auth-B9V3i5oZ.js +0 -1
  279. package/dist/chunks/auth-fSFfSKy_.js +0 -1
  280. package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +0 -1
  281. package/dist/chunks/bridgeConfig-CLHy-BiF.js +0 -1
  282. package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +0 -1
  283. package/dist/chunks/bridgeMain-BESKzpm0.js +0 -1
  284. package/dist/chunks/caches-CpqTC0Lb.js +0 -1
  285. package/dist/chunks/client-DPUvQ6Rf.js +0 -1
  286. package/dist/chunks/commands-D7l3P1k9.js +0 -1
  287. package/dist/chunks/commitAttribution-B7NUPJ8E.js +0 -1
  288. package/dist/chunks/config-qLaiAn7z.js +0 -1
  289. package/dist/chunks/context-noninteractive-CNot6jbs.js +0 -1
  290. package/dist/chunks/conversation-CSpwF3Ha.js +0 -1
  291. package/dist/chunks/createSession-GNSNbUbN.js +0 -1
  292. package/dist/chunks/doctor-CKUXGCri.js +0 -1
  293. package/dist/chunks/envLessBridgeConfig-bei51W3H.js +0 -1
  294. package/dist/chunks/extra-usage-By33zGLT.js +0 -1
  295. package/dist/chunks/extractMemories-CXGZGe0h.js +0 -1
  296. package/dist/chunks/fast-BXzdzzXU.js +0 -1
  297. package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +0 -1
  298. package/dist/chunks/hooks-fZ1r0jUF.js +0 -1
  299. package/dist/chunks/inboundAttachments-YMxf4fmR.js +0 -1
  300. package/dist/chunks/loadAgentsDir-BHOyHxwz.js +0 -1
  301. package/dist/chunks/localSearch-CebU5BA9.js +0 -1
  302. package/dist/chunks/model-C4RHNhDQ.js +0 -1
  303. package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +0 -1
  304. package/dist/chunks/policyLimits-Bwi9VqDF.js +0 -1
  305. package/dist/chunks/prompt-CYx145pp.js +0 -1
  306. package/dist/chunks/prompt-DH3lKFag.js +0 -1
  307. package/dist/chunks/sandbox-adapter-CEZnHq0U.js +0 -1
  308. package/dist/chunks/searchExtraTools-iQfI39wB.js +0 -1
  309. package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +0 -1
  310. package/dist/chunks/sessionMemory-D_HQmhj7.js +0 -1
  311. package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +0 -1
  312. package/dist/chunks/sessionObserver-B400YG3s.js +0 -1
  313. package/dist/chunks/sessionStorage-DRnvtrpU.js +0 -1
  314. package/dist/chunks/sinks-DbwDBd-E.js +0 -1
  315. package/dist/chunks/skillLearning-CSY5R5Jn.js +0 -1
  316. package/dist/chunks/thinkback-B-GpXG9U.js +0 -1
  317. package/dist/chunks/trustedDevice-e6iF1X7C.js +0 -1
  318. package/dist/chunks/undercover-CPvoDtJ1.js +0 -1
  319. package/dist/chunks/upgrade-uR7SIVtx.js +0 -1
  320. package/dist/chunks/usage-7jOeIVv9.js +0 -1
  321. package/dist/chunks/useMainLoopModel-DegH12LZ.js +0 -1
  322. package/dist/chunks/worktree-D38cJ23W.js +0 -1
@@ -1,3 +1,3 @@
1
- import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./figures-5ThXQEtq.js";import{C as a,Gt as o,I as s,P as c,Wt as l,fi as u,ot as d,t as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{en as m,ht as h,nr as g,pt as _}from"./state-ix0xIunV.js";import{$T as v,Cb as y,Dc as b,Ec as x,Fx as S,Gi as C,Go as w,JS as T,Lb as E,Nx as D,Oo as O,QT as k,Qi as A,Rc as j,Sb as ee,So as M,Ui as te,Uo as N,Vo as ne,XT as P,_x as re,aw as ie,ca as ae,hn as oe,ho as se,kb as ce,kc as le,lC as ue,lu as F,on as I,os as de,ow as fe,qS as pe,su as me,vx as he,wb as ge,wo as L,yn as R,yo as _e,zb as z,zc as ve,zo as B}from"./loadAgentsDir-DrDu5yYy.js";import{n as ye,t as be}from"./cwd-CYmmnQVS.js";import{$ as xe,_n as Se,f as Ce,g as we,gn as Te,nt as Ee}from"./settings-DfWP5y6X.js";import{Y as De,h as Oe,m as ke,o as Ae,s as V,w as je}from"./log-BMCygSzM.js";import{n as H,r as U}from"./analytics-BotDBGh0.js";import{S as Me,b as Ne,h as Pe}from"./startupProfiler-xa3NmN7Z.js";import{Ct as Fe,Vt as Ie,X as Le,tt as Re}from"./model-fi472PRc.js";import{E as ze,T as Be,c as Ve,d as He,w as Ue}from"./sessionTracing-lArOaj9u.js";import{u as We}from"./referral-DrebVwqx.js";import{n as Ge,t as Ke}from"./slashCommandParsing-RQb_7Xzt.js";import{n as qe,t as Je}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";import*as W from"path";import{randomUUID as G}from"crypto";u();var K=p();r(),f(),m(),ye(),De(),ke(),Ae(),Se(),H(),Ne(),Ee(),we(),Ie(),k(),Ue(),ie(),D(),Ve(),me(),j(),le(),de(),B(),A(),R(),Ke();var Ye={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Xe(e,t){if(!new RegExp(t,`i`).test(e)||e.startsWith(`/`))return[];let n=[],r=null,i=0,a=e=>!!e&&/[\p{L}\p{N}_]/u.test(e);for(let t=0;t<e.length;t++){let o=e[t];if(r){if(r===`[`&&o===`[`){i=t;continue}if(o!==Ye[r]||r===`'`&&a(e[t+1]))continue;n.push({start:i,end:t+1}),r=null}else(o===`<`&&t+1<e.length&&/[a-zA-Z/]/.test(e[t+1])||o===`'`&&!a(e[t-1])||o!==`<`&&o!==`'`&&o in Ye)&&(r=o,i=t)}let o=[],s=RegExp(`\\b${t}\\b`,`gi`),c=e.matchAll(s);for(let t of c){if(t.index===void 0)continue;let r=t.index,i=r+t[0].length;if(n.some(e=>r>=e.start&&r<e.end))continue;let s=e[r-1],c=e[i];s===`/`||s===`\\`||s===`-`||c===`/`||c===`\\`||c===`-`||c===`?`||c===`.`&&a(e[i+1])||o.push({word:t[0],start:r,end:i})}return o}function q(e){return Xe(e,`ultraplan`)}function Ze(e){return Xe(e,`ultrareview`)}function Qe(e){return q(e).length>0}function $e(e){let[t]=q(e);if(!t)return e;let n=e.slice(0,t.start),r=e.slice(t.end);return(n+r).trim()?n+t.word.slice(5)+r:``}function et(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function tt(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function nt(e,t,n,r,i,a,o){let s=G();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;He(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Be(`user_prompt`,{prompt_length:String(l.length),prompt:ze(l),"prompt.id":s}),U(`tengu_input_prompt`,{is_negative:et(c),is_keep_going:tt(c)}),t.length>0?{messages:[M({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[M({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}H(),B();async function rt({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null,y=v?.startsWith(`/`)&&!p;n===`prompt`&&v!==null&&!h&&!y&&c?.(v),F(`query_process_user_input_base_start`);let b=i.getAppState(),S=await at(e,n,r,i,a,o,s,l,u,d,f,b.toolPermissionContext.mode,p,m,h,g,t,_);if(F(`query_process_user_input_base_end`),!S.shouldQuery)return S;F(`query_hooks_start`);let C=O(e)||``;for await(let t of I(C,b.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[_e(`${oe(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:S.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return S.messages.push(M({content:e})),S.shouldQuery=!1,S}if(t.additionalContexts&&t.additionalContexts.length>0&&S.messages.push(x({type:`hook_additional_context`,content:t.additionalContexts.map(it),hookName:`UserPromptSubmit`,toolUseID:`hook-${G()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;S.messages.push({...t.message,attachment:{...t.message.attachment,content:it(t.message.attachment.content)}});break;default:S.messages.push(t.message);break}}return F(`query_hooks_end`),S}var J=1e4;function it(e){return e.length>J?`${e.substring(0,J)}… [output truncated - exceeded ${J} characters]`:e}async function at(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let y=null,x=[],w=[],T=e;if(typeof e==`string`)y=e;else if(e.length>0){F(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await v(n);if(e.dimensions){let t=P(e.dimensions);t&&w.push(t)}t.push(e.block)}else t.push(n);T=t,F(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(y=n.text,x=t.slice(0,-1)):x=t}if(y===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let E=i?Object.values(i).filter(ve):[],D=E.map(e=>e.id),O=i?await S(i):new Map;F(`query_pasted_image_processing_start`);let k=await Promise.all(E.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return U(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await v(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??O.get(e.id)}})),A=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of k){if(e.dimensions){let t=P(e.dimensions,n);t&&w.push(t)}else if(t){let e=P(t,n);e&&w.push(e)}else n&&w.push(`[Image source: ${n}]`);A.push(e.block)}F(`query_pasted_image_processing_end`);let j=f;if(p&&y!==null&&y.startsWith(`/`)){let e=Ge(y),t=e?te(e.commandName,r.options.commands):void 0;if(t){let n=C(t,e?.args??``);if(n.ok)j=!1;else{let e=n.reason??`/${ae(t)} isn't available over Remote Control.`;return{messages:[M({content:y,uuid:s}),se(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&y!==null&&!j&&!y.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&Qe(g??y)){U(`tengu_ultraplan_keyword`,{});let e=$e(y).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-AltWgIFt.js`);return Y(await t(`/ultraplan ${e}`,x,A,[],r,n,s,c,u,_),w)}let ee=!h&&y!==null&&(t!==`prompt`||j||!y.startsWith(`/`));F(`query_attachment_loading_start`);let N=ee?await fe(b(y,r,a??null,[],o,l)):[];if(F(`query_attachment_loading_end`),y!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-Bx6_oZoE.js`);return Y(await e(y,x,N,r,n),w)}if(y!==null&&!j&&y.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-AltWgIFt.js`);return Y(await e(y,x,A,N,r,n,s,c,u,_),w)}if(y!==null&&t===`prompt`){let e=y.trim(),t=N.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;U(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return Y(nt(T,A,D,N,s,d,m),w)}function Y(e,t){return t.length>0&&e.messages.push(M({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}m(),Re();function ot(e){return e===`Agent`?xe:e}function st(e){let t=Ce()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:be(),session_id:h(),tools:e.tools.map(e=>ot(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:Fe().source,betas:_(),claude_code_version:`0.0.3`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:G()};return n.fast_mode_state=Le(e.model,e.fastMode),n}var ct=n({MessageSelector:()=>ut,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function lt(e){return e.type===`text`}function X(e){return e===`summarize`||e===`summarize_up_to`}function ut({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:u,onClose:d,preselectedMessage:f}){let p=T(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=y(),_=(0,Q.useMemo)(G,[]),v=(0,Q.useMemo)(()=>[...e.filter(Z),{...M({content:``}),uuid:_}],[e,_]),[b,x]=(0,Q.useState)(v.length-1),S=Math.max(0,Math.min(b-Math.floor($/2),v.length-$)),C=v.length>1,[w,D]=(0,Q.useState)(f),[O,k]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!f||!g)return;let e=!1;return ge(p,f.uuid).then(t=>{e||k(t)}),()=>{e=!0}},[f,g,p]);let[A,j]=(0,Q.useState)(!1),[te,N]=(0,Q.useState)(null),[ne,P]=(0,Q.useState)(`both`),[ie,ae]=(0,Q.useState)(``),[oe,se]=(0,Q.useState)(``);function ce(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:ae}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:se}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{U(`tengu_message_selector_opened`,{})},[]);async function le(e){t(),j(!0);try{await n(e),j(!1),d()}catch(e){V(e),j(!1),h(`Failed to restore the conversation:\n${e}`)}}async function ue(t){let n=e.indexOf(t);if(U(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){d();return}if(!g){await le(t);return}let r=await ge(p,t.uuid);D(t),k(r)}async function F(e){if(U(`tengu_message_selector_restore_option_selected`,{option:e}),!w){h(`Message not found.`);return}if(e===`nevermind`){f?d():D(void 0);return}if(X(e)){t(),j(!0),N(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`,n=(t===`up_to`?oe:ie).trim()||void 0;await u(w,n,t),j(!1),N(null),D(void 0),d()}catch(e){V(e),j(!1),N(null),D(void 0),h(`Failed to summarize:\n${e}`)}return}t(),j(!0),h(void 0);let i=null,a=null;if(e===`code`||e===`both`)try{await r(w)}catch(e){i=e,V(i)}if(e===`conversation`||e===`both`)try{await n(w)}catch(e){a=e,V(a)}j(!1),D(void 0),a&&i?h(`Failed to restore the conversation and code:\n${a}\n${i}`):a?h(`Failed to restore the conversation:\n${a}`):i?h(`Failed to restore the code:\n${i}`):d()}let I=qe(),de=(0,Q.useCallback)(()=>{if(w&&!f){D(void 0);return}U(`tengu_message_selector_cancelled`,{}),d()},[d,w,f]),fe=(0,Q.useCallback)(()=>x(e=>Math.max(0,e-1)),[]),pe=(0,Q.useCallback)(()=>x(e=>Math.min(v.length-1,e+1)),[v.length]),me=(0,Q.useCallback)(()=>x(0),[]),he=(0,Q.useCallback)(()=>x(v.length-1),[v.length]),L=(0,Q.useCallback)(()=>{let e=v[b];e&&ue(e)},[v,b,ue]);l(`confirm:no`,de,{context:`Confirmation`,isActive:!w}),o({"messageSelector:up":fe,"messageSelector:down":pe,"messageSelector:top":me,"messageSelector:bottom":he,"messageSelector:select":L},{context:`MessageSelector`,isActive:!A&&!m&&!w&&C});let[R,_e]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=ee(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;_e(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let z=g&&O?.filesChanged&&O.filesChanged.length>0,ve=!m&&!w&&!f&&C;return(0,K.jsxs)(s,{flexDirection:`column`,width:`100%`,children:[(0,K.jsx)(a,{color:`suggestion`}),(0,K.jsxs)(s,{flexDirection:`column`,marginX:1,gap:1,children:[(0,K.jsx)(c,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{color:`error`,children:[`Error: `,m]})}),!C&&(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{children:`Nothing to rewind to yet.`})}),!m&&w&&C&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{children:[`Confirm you want to restore `,!O&&`the conversation `,`to the point before you sent this message:`]}),(0,K.jsxs)(s,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,K.jsx)(ht,{userMessage:w,color:`text`,isCurrent:!1}),(0,K.jsxs)(c,{dimColor:!0,children:[`(`,Pe(new Date(w.timestamp)),`)`]})]}),(0,K.jsx)(ft,{selectedRestoreOption:ne,canRestoreCode:!!z,diffStatsForRestore:O}),A&&X(te)?(0,K.jsxs)(s,{flexDirection:`row`,gap:1,children:[(0,K.jsx)(E,{}),(0,K.jsx)(c,{children:`Summarizing…`})]}):(0,K.jsx)(re,{isDisabled:A,options:ce(!!z),defaultFocusValue:z?`both`:`conversation`,onFocus:e=>P(e),onChange:e=>F(e),onCancel:()=>f?d():D(void 0)}),z&&(0,K.jsx)(s,{marginBottom:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),ve&&(0,K.jsxs)(K.Fragment,{children:[g?(0,K.jsx)(c,{children:`Restore the code and/or conversation to the point before…`}):(0,K.jsx)(c,{children:`Restore and fork the conversation to the point before…`}),(0,K.jsx)(s,{width:`100%`,flexDirection:`column`,children:v.slice(S,S+$).map((e,t)=>{let n=S+t,r=n===b,a=e.uuid===_,o=n in R,l=R[n],u=l?.filesChanged&&l.filesChanged.length;return(0,K.jsxs)(s,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,K.jsx)(s,{width:2,minWidth:2,children:r?(0,K.jsxs)(c,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,K.jsx)(c,{children:` `})}),(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(s,{flexShrink:1,height:1,overflow:`hidden`,children:(0,K.jsx)(ht,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,K.jsx)(s,{height:1,flexDirection:`row`,children:l?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{dimColor:!r,color:`inactive`,children:u?(0,K.jsxs)(K.Fragment,{children:[u===1&&l.filesChanged[0]?`${W.basename(l.filesChanged[0])} `:`${u} files changed `,(0,K.jsx)(mt,{diffStats:l})]}):(0,K.jsx)(K.Fragment,{children:`No code changes`})})}):(0,K.jsxs)(c,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!w&&(0,K.jsx)(c,{dimColor:!0,italic:!0,children:I.pending?(0,K.jsxs)(K.Fragment,{children:[`Press `,I.keyName,` again to exit`]}):(0,K.jsxs)(K.Fragment,{children:[!m&&C&&`Enter to continue · `,`Esc to exit`]})})]})]})}function dt(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function ft({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(c,{dimColor:!0,children:dt(e)}),!X(e)&&(r?(0,K.jsx)(pt,{diffStatsForRestore:n}):(0,K.jsx)(c,{dimColor:!0,children:`The code will be unchanged.`}))]})}function pt({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,K.jsx)(c,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?W.basename(e.filesChanged[0]||``):t===2?`${W.basename(e.filesChanged[0]||``)} and ${W.basename(e.filesChanged[1]||``)}`:`${W.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{dimColor:!0,children:[`The code will be restored `,(0,K.jsx)(mt,{diffStats:e}),` in `,n,`.`]})})}function mt({diffStats:e}){if(!(!e||!e.filesChanged))return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,K.jsxs)(c,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=d();if(r)return(0,K.jsx)(s,{width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,l=typeof o==`string`?null:o[o.length-1],u=Oe(typeof o==`string`?o.trim():l&&lt(l)?l.text.trim():`(no prompt)`);if(ne(u))return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=L(u,`bash-input`);if(e)return(0,K.jsxs)(s,{flexDirection:`row`,width:`100%`,children:[(0,K.jsx)(c,{color:`bashBorder`,children:`!`}),(0,K.jsxs)(c,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=L(u,je),r=L(u,`command-args`),i=L(u,`skill-format`)===`true`;if(e)return i?(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{color:t,dimColor:n,children:i?Me(u,a-i,!0):u.slice(0,500).split(`
1
+ import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./figures-5ThXQEtq.js";import{C as a,Gt as o,I as s,P as c,Wt as l,fi as u,ot as d,t as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{en as m,ht as h,nr as g,pt as _}from"./state-ix0xIunV.js";import{$T as v,Cb as y,Dc as b,Ec as x,Fx as S,Gi as C,Go as w,JS as T,Lb as E,Nx as D,Oo as O,QT as k,Qi as A,Rc as j,Sb as ee,So as M,Ui as te,Uo as N,Vo as ne,XT as P,_x as re,aw as ie,ca as ae,hn as oe,ho as se,kb as ce,kc as le,lC as ue,lu as F,on as I,os as de,ow as fe,qS as pe,su as me,vx as he,wb as ge,wo as L,yn as R,yo as _e,zb as z,zc as ve,zo as B}from"./loadAgentsDir-BURvZNN6.js";import{n as ye,t as be}from"./cwd-CYmmnQVS.js";import{$ as xe,_n as Se,f as Ce,g as we,gn as Te,nt as Ee}from"./settings-DfWP5y6X.js";import{Y as De,h as Oe,m as ke,o as Ae,s as V,w as je}from"./log-BMCygSzM.js";import{n as H,r as U}from"./analytics-BotDBGh0.js";import{S as Me,b as Ne,h as Pe}from"./startupProfiler-xa3NmN7Z.js";import{Ct as Fe,Vt as Ie,X as Le,tt as Re}from"./model-BIVmcl_N.js";import{E as ze,T as Be,c as Ve,d as He,w as Ue}from"./sessionTracing-CCPRzOvy.js";import{u as We}from"./referral-UKJv23_5.js";import{n as Ge,t as Ke}from"./slashCommandParsing-RQb_7Xzt.js";import{n as qe,t as Je}from"./useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js";import*as W from"path";import{randomUUID as G}from"crypto";u();var K=p();r(),f(),m(),ye(),De(),ke(),Ae(),Se(),H(),Ne(),Ee(),we(),Ie(),k(),Ue(),ie(),D(),Ve(),me(),j(),le(),de(),B(),A(),R(),Ke();var Ye={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Xe(e,t){if(!new RegExp(t,`i`).test(e)||e.startsWith(`/`))return[];let n=[],r=null,i=0,a=e=>!!e&&/[\p{L}\p{N}_]/u.test(e);for(let t=0;t<e.length;t++){let o=e[t];if(r){if(r===`[`&&o===`[`){i=t;continue}if(o!==Ye[r]||r===`'`&&a(e[t+1]))continue;n.push({start:i,end:t+1}),r=null}else(o===`<`&&t+1<e.length&&/[a-zA-Z/]/.test(e[t+1])||o===`'`&&!a(e[t-1])||o!==`<`&&o!==`'`&&o in Ye)&&(r=o,i=t)}let o=[],s=RegExp(`\\b${t}\\b`,`gi`),c=e.matchAll(s);for(let t of c){if(t.index===void 0)continue;let r=t.index,i=r+t[0].length;if(n.some(e=>r>=e.start&&r<e.end))continue;let s=e[r-1],c=e[i];s===`/`||s===`\\`||s===`-`||c===`/`||c===`\\`||c===`-`||c===`?`||c===`.`&&a(e[i+1])||o.push({word:t[0],start:r,end:i})}return o}function q(e){return Xe(e,`ultraplan`)}function Ze(e){return Xe(e,`ultrareview`)}function Qe(e){return q(e).length>0}function $e(e){let[t]=q(e);if(!t)return e;let n=e.slice(0,t.start),r=e.slice(t.end);return(n+r).trim()?n+t.word.slice(5)+r:``}function et(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function tt(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function nt(e,t,n,r,i,a,o){let s=G();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;He(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Be(`user_prompt`,{prompt_length:String(l.length),prompt:ze(l),"prompt.id":s}),U(`tengu_input_prompt`,{is_negative:et(c),is_keep_going:tt(c)}),t.length>0?{messages:[M({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[M({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}H(),B();async function rt({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null,y=v?.startsWith(`/`)&&!p;n===`prompt`&&v!==null&&!h&&!y&&c?.(v),F(`query_process_user_input_base_start`);let b=i.getAppState(),S=await at(e,n,r,i,a,o,s,l,u,d,f,b.toolPermissionContext.mode,p,m,h,g,t,_);if(F(`query_process_user_input_base_end`),!S.shouldQuery)return S;F(`query_hooks_start`);let C=O(e)||``;for await(let t of I(C,b.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[_e(`${oe(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:S.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return S.messages.push(M({content:e})),S.shouldQuery=!1,S}if(t.additionalContexts&&t.additionalContexts.length>0&&S.messages.push(x({type:`hook_additional_context`,content:t.additionalContexts.map(it),hookName:`UserPromptSubmit`,toolUseID:`hook-${G()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;S.messages.push({...t.message,attachment:{...t.message.attachment,content:it(t.message.attachment.content)}});break;default:S.messages.push(t.message);break}}return F(`query_hooks_end`),S}var J=1e4;function it(e){return e.length>J?`${e.substring(0,J)}… [output truncated - exceeded ${J} characters]`:e}async function at(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let y=null,x=[],w=[],T=e;if(typeof e==`string`)y=e;else if(e.length>0){F(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await v(n);if(e.dimensions){let t=P(e.dimensions);t&&w.push(t)}t.push(e.block)}else t.push(n);T=t,F(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(y=n.text,x=t.slice(0,-1)):x=t}if(y===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let E=i?Object.values(i).filter(ve):[],D=E.map(e=>e.id),O=i?await S(i):new Map;F(`query_pasted_image_processing_start`);let k=await Promise.all(E.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return U(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await v(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??O.get(e.id)}})),A=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of k){if(e.dimensions){let t=P(e.dimensions,n);t&&w.push(t)}else if(t){let e=P(t,n);e&&w.push(e)}else n&&w.push(`[Image source: ${n}]`);A.push(e.block)}F(`query_pasted_image_processing_end`);let j=f;if(p&&y!==null&&y.startsWith(`/`)){let e=Ge(y),t=e?te(e.commandName,r.options.commands):void 0;if(t){let n=C(t,e?.args??``);if(n.ok)j=!1;else{let e=n.reason??`/${ae(t)} isn't available over Remote Control.`;return{messages:[M({content:y,uuid:s}),se(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&y!==null&&!j&&!y.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&Qe(g??y)){U(`tengu_ultraplan_keyword`,{});let e=$e(y).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-BcPnWNxZ.js`);return Y(await t(`/ultraplan ${e}`,x,A,[],r,n,s,c,u,_),w)}let ee=!h&&y!==null&&(t!==`prompt`||j||!y.startsWith(`/`));F(`query_attachment_loading_start`);let N=ee?await fe(b(y,r,a??null,[],o,l)):[];if(F(`query_attachment_loading_end`),y!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-aKNneP2u.js`);return Y(await e(y,x,N,r,n),w)}if(y!==null&&!j&&y.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-BcPnWNxZ.js`);return Y(await e(y,x,A,N,r,n,s,c,u,_),w)}if(y!==null&&t===`prompt`){let e=y.trim(),t=N.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;U(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return Y(nt(T,A,D,N,s,d,m),w)}function Y(e,t){return t.length>0&&e.messages.push(M({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}m(),Re();function ot(e){return e===`Agent`?xe:e}function st(e){let t=Ce()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:be(),session_id:h(),tools:e.tools.map(e=>ot(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:Fe().source,betas:_(),claude_code_version:`0.0.4`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:G()};return n.fast_mode_state=Le(e.model,e.fastMode),n}var ct=n({MessageSelector:()=>ut,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function lt(e){return e.type===`text`}function X(e){return e===`summarize`||e===`summarize_up_to`}function ut({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:u,onClose:d,preselectedMessage:f}){let p=T(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=y(),_=(0,Q.useMemo)(G,[]),v=(0,Q.useMemo)(()=>[...e.filter(Z),{...M({content:``}),uuid:_}],[e,_]),[b,x]=(0,Q.useState)(v.length-1),S=Math.max(0,Math.min(b-Math.floor($/2),v.length-$)),C=v.length>1,[w,D]=(0,Q.useState)(f),[O,k]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!f||!g)return;let e=!1;return ge(p,f.uuid).then(t=>{e||k(t)}),()=>{e=!0}},[f,g,p]);let[A,j]=(0,Q.useState)(!1),[te,N]=(0,Q.useState)(null),[ne,P]=(0,Q.useState)(`both`),[ie,ae]=(0,Q.useState)(``),[oe,se]=(0,Q.useState)(``);function ce(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:ae}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:se}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{U(`tengu_message_selector_opened`,{})},[]);async function le(e){t(),j(!0);try{await n(e),j(!1),d()}catch(e){V(e),j(!1),h(`Failed to restore the conversation:\n${e}`)}}async function ue(t){let n=e.indexOf(t);if(U(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){d();return}if(!g){await le(t);return}let r=await ge(p,t.uuid);D(t),k(r)}async function F(e){if(U(`tengu_message_selector_restore_option_selected`,{option:e}),!w){h(`Message not found.`);return}if(e===`nevermind`){f?d():D(void 0);return}if(X(e)){t(),j(!0),N(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`,n=(t===`up_to`?oe:ie).trim()||void 0;await u(w,n,t),j(!1),N(null),D(void 0),d()}catch(e){V(e),j(!1),N(null),D(void 0),h(`Failed to summarize:\n${e}`)}return}t(),j(!0),h(void 0);let i=null,a=null;if(e===`code`||e===`both`)try{await r(w)}catch(e){i=e,V(i)}if(e===`conversation`||e===`both`)try{await n(w)}catch(e){a=e,V(a)}j(!1),D(void 0),a&&i?h(`Failed to restore the conversation and code:\n${a}\n${i}`):a?h(`Failed to restore the conversation:\n${a}`):i?h(`Failed to restore the code:\n${i}`):d()}let I=qe(),de=(0,Q.useCallback)(()=>{if(w&&!f){D(void 0);return}U(`tengu_message_selector_cancelled`,{}),d()},[d,w,f]),fe=(0,Q.useCallback)(()=>x(e=>Math.max(0,e-1)),[]),pe=(0,Q.useCallback)(()=>x(e=>Math.min(v.length-1,e+1)),[v.length]),me=(0,Q.useCallback)(()=>x(0),[]),he=(0,Q.useCallback)(()=>x(v.length-1),[v.length]),L=(0,Q.useCallback)(()=>{let e=v[b];e&&ue(e)},[v,b,ue]);l(`confirm:no`,de,{context:`Confirmation`,isActive:!w}),o({"messageSelector:up":fe,"messageSelector:down":pe,"messageSelector:top":me,"messageSelector:bottom":he,"messageSelector:select":L},{context:`MessageSelector`,isActive:!A&&!m&&!w&&C});let[R,_e]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=ee(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;_e(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let z=g&&O?.filesChanged&&O.filesChanged.length>0,ve=!m&&!w&&!f&&C;return(0,K.jsxs)(s,{flexDirection:`column`,width:`100%`,children:[(0,K.jsx)(a,{color:`suggestion`}),(0,K.jsxs)(s,{flexDirection:`column`,marginX:1,gap:1,children:[(0,K.jsx)(c,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{color:`error`,children:[`Error: `,m]})}),!C&&(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{children:`Nothing to rewind to yet.`})}),!m&&w&&C&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{children:[`Confirm you want to restore `,!O&&`the conversation `,`to the point before you sent this message:`]}),(0,K.jsxs)(s,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,K.jsx)(ht,{userMessage:w,color:`text`,isCurrent:!1}),(0,K.jsxs)(c,{dimColor:!0,children:[`(`,Pe(new Date(w.timestamp)),`)`]})]}),(0,K.jsx)(ft,{selectedRestoreOption:ne,canRestoreCode:!!z,diffStatsForRestore:O}),A&&X(te)?(0,K.jsxs)(s,{flexDirection:`row`,gap:1,children:[(0,K.jsx)(E,{}),(0,K.jsx)(c,{children:`Summarizing…`})]}):(0,K.jsx)(re,{isDisabled:A,options:ce(!!z),defaultFocusValue:z?`both`:`conversation`,onFocus:e=>P(e),onChange:e=>F(e),onCancel:()=>f?d():D(void 0)}),z&&(0,K.jsx)(s,{marginBottom:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),ve&&(0,K.jsxs)(K.Fragment,{children:[g?(0,K.jsx)(c,{children:`Restore the code and/or conversation to the point before…`}):(0,K.jsx)(c,{children:`Restore and fork the conversation to the point before…`}),(0,K.jsx)(s,{width:`100%`,flexDirection:`column`,children:v.slice(S,S+$).map((e,t)=>{let n=S+t,r=n===b,a=e.uuid===_,o=n in R,l=R[n],u=l?.filesChanged&&l.filesChanged.length;return(0,K.jsxs)(s,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,K.jsx)(s,{width:2,minWidth:2,children:r?(0,K.jsxs)(c,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,K.jsx)(c,{children:` `})}),(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(s,{flexShrink:1,height:1,overflow:`hidden`,children:(0,K.jsx)(ht,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,K.jsx)(s,{height:1,flexDirection:`row`,children:l?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{dimColor:!r,color:`inactive`,children:u?(0,K.jsxs)(K.Fragment,{children:[u===1&&l.filesChanged[0]?`${W.basename(l.filesChanged[0])} `:`${u} files changed `,(0,K.jsx)(mt,{diffStats:l})]}):(0,K.jsx)(K.Fragment,{children:`No code changes`})})}):(0,K.jsxs)(c,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!w&&(0,K.jsx)(c,{dimColor:!0,italic:!0,children:I.pending?(0,K.jsxs)(K.Fragment,{children:[`Press `,I.keyName,` again to exit`]}):(0,K.jsxs)(K.Fragment,{children:[!m&&C&&`Enter to continue · `,`Esc to exit`]})})]})]})}function dt(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function ft({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(c,{dimColor:!0,children:dt(e)}),!X(e)&&(r?(0,K.jsx)(pt,{diffStatsForRestore:n}):(0,K.jsx)(c,{dimColor:!0,children:`The code will be unchanged.`}))]})}function pt({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,K.jsx)(c,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?W.basename(e.filesChanged[0]||``):t===2?`${W.basename(e.filesChanged[0]||``)} and ${W.basename(e.filesChanged[1]||``)}`:`${W.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{dimColor:!0,children:[`The code will be restored `,(0,K.jsx)(mt,{diffStats:e}),` in `,n,`.`]})})}function mt({diffStats:e}){if(!(!e||!e.filesChanged))return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,K.jsxs)(c,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=d();if(r)return(0,K.jsx)(s,{width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,l=typeof o==`string`?null:o[o.length-1],u=Oe(typeof o==`string`?o.trim():l&&lt(l)?l.text.trim():`(no prompt)`);if(ne(u))return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=L(u,`bash-input`);if(e)return(0,K.jsxs)(s,{flexDirection:`row`,width:`100%`,children:[(0,K.jsx)(c,{color:`bashBorder`,children:`!`}),(0,K.jsxs)(c,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=L(u,je),r=L(u,`command-args`),i=L(u,`skill-format`)===`true`;if(e)return i?(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{color:t,dimColor:n,children:i?Me(u,a-i,!0):u.slice(0,500).split(`
2
2
  `).slice(0,4).join(`
3
3
  `)})})}function gt(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!w(n))continue;let r=n.toolUseResult;if(!(!r||!r.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=Te(e.lines,e=>e.startsWith(`+`)),n=Te(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function Z(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||N(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&lt(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1)}function _t(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!N(t)&&!w(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var Q,$,vt=e((()=>{Q=t(u(),1),H(),pe(),ce(),Je(),We(),B(),he(),z(),ue(),$=7}));export{Z as a,rt as c,_t as i,q as l,ct as n,st as o,vt as r,ot as s,ut as t,Ze as u};
@@ -1,4 +1,4 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{l as r,o as i}from"./envUtils-DSxRz_kt.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{C as s,Gr as c,I as l,N as u,P as d,Pn as f,Rn as p,di as m,fi as h,j as g,mt as _,ot as v,t as y,ui as b,xt as x}from"./src-CDCSSo0U2.js";import{t as S}from"./jsx-runtime-Bb4Xn-E0.js";import{B as C,en as w}from"./state-ix0xIunV.js";import{$a as T,$o as E,Am as D,Ao as O,Bu as k,Co as ee,Cv as A,Dx as j,Eg as te,Eu as ne,Fu as M,Gw as N,Hg as re,Ho as P,IE as ie,Iu as ae,JS as F,Jb as oe,Jy as se,Kb as I,Kw as ce,Kx as le,LE as L,Lg as ue,Lm as de,Lu as fe,MO as pe,Mg as me,Mm as he,Mo as ge,NE as _e,Nm as ve,No as ye,OO as be,Og as R,Ox as xe,Po as Se,Ro as Ce,Ru as we,Sv as Te,Ug as Ee,Xo as De,Yy as Oe,Zo as ke,_D as Ae,bD as je,bh as Me,bv as Ne,ch as Pe,co as Fe,eo as Ie,jm as Le,jo as Re,km as ze,lC as Be,lh as Ve,nh as He,po as Ue,qS as We,qb as Ge,qo as Ke,qx as qe,so as Je,th as Ye,to as Xe,vv as Ze,wo as Qe,wv as $e,xv as et,yh as tt,zE as nt,zo as rt,zu as it}from"./loadAgentsDir-DrDu5yYy.js";import{n as at,t as ot}from"./cwd-CYmmnQVS.js";import{a as st,l as ct,o as lt,r as ut,s as dt}from"./debug-BrXObCdR.js";import{G as ft,K as pt,Kt as mt,Ut as ht,g as gt,n as _t}from"./settings-DfWP5y6X.js";import{b as vt,c as z,g as yt}from"./config-DiT2Z8dY.js";import{B as bt,L as xt,R as St,Y as Ct}from"./log-BMCygSzM.js";import{f as wt,l as Tt}from"./file-DcZWPH2V.js";import{n as Et,r as Dt}from"./analytics-BotDBGh0.js";import{S as Ot,b as kt,h as At,n as jt,p as Mt,r as Nt,t as Pt}from"./startupProfiler-xa3NmN7Z.js";import{l as Ft,o as It}from"./stringUtils-DGLPkqJ4.js";import{Ct as Lt,E as Rt,Et as zt,Kt as Bt,Ot as Vt,Vt as Ht,_ as Ut,b as Wt,vn as Gt,yn as Kt}from"./model-fi472PRc.js";import{Cn as qt,Tn as Jt}from"./prompt-C0nU0VK3.js";import{C as Yt,y as Xt}from"./rcDebugLog-2-1XSyFV.js";import{a as Zt,o as Qt,r as $t,s as en,t as tn}from"./referral-DrebVwqx.js";import{d as nn,f as rn,h as an,p as on}from"./terminalSetup-BNs9nLbT.js";import{n as sn,r as cn,t as ln}from"./browser-BmZuQom6.js";import{c as un,r as dn}from"./releaseNotes-CDx2P0fb.js";import{a as fn,c as pn,d as mn,i as hn,l as gn,n as _n,o as vn,r as yn,t as bn,u as xn}from"./logoV2Utils-CoC4nheD.js";import{n as Sn,t as Cn}from"./systemTheme-Ceakddth.js";import{n as wn,r as Tn}from"./PromptInputFooterSuggestions-3rjz6zhK.js";import{n as En,t as Dn}from"./useMainLoopModel-DegH12LZ.js";import{n as On,t as kn}from"./modalContext-DFjKLCB6.js";import{i as An,n as jn,r as Mn,s as Nn,t as Pn}from"./OverageCreditUpsell-BSmgq089.js";import{n as Fn,r as In,t as Ln}from"./statusNoticeHelpers-BK-54uGY.js";import{homedir as Rn}from"os";import{relative as zn}from"path";import{fileURLToPath as Bn}from"url";function Vn(e){return Array.isArray?Array.isArray(e):Yn(e)===`[object Array]`}function Hn(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Un(e){return e==null?``:Hn(e)}function B(e){return typeof e==`string`}function Wn(e){return typeof e==`number`}function Gn(e){return e===!0||e===!1||qn(e)&&Yn(e)==`[object Boolean]`}function Kn(e){return typeof e==`object`}function qn(e){return Kn(e)&&e!==null}function V(e){return e!=null}function Jn(e){return!e.trim().length}function Yn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}function Xn(e){let t=null,n=null,r=null,i=1,a=null;if(B(e)||Vn(e))r=e,t=Zn(e),n=Qn(e);else{if(!Pr.call(e,`name`))throw Error(jr(`name`));let o=e.name;if(r=o,Pr.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(Mr(Qn(o)));t=Zn(o),n=Qn(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function Zn(e){return Vn(e)?e:e.split(`.`)}function Qn(e){return Vn(e)?e.join(`.`):e}function $n(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(V(e))if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!V(s))return;if(a===t.length-1&&(B(s)||Wn(s)||Gn(s)||typeof s==`bigint`))n.push(o===void 0?Un(s):{v:Un(s),i:o});else if(Vn(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}};return i(e,B(t)?t.split(`.`):t,0),r?n:n[0]}function er(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=1,a=!1;for(let e=0;e<t.length;e++)t.charCodeAt(e)===32?a||(i++,a=!0):a=!1;if(n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}function tr(e,t,{getFn:n=H.getFn,fieldNormWeight:r=H.fieldNormWeight}={}){let i=new Br({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(Xn)),i.setSources(t),i.create(),i}function nr(e,{getFn:t=H.getFn,fieldNormWeight:n=H.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new Br({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function rr(e=[],t=H.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function ir(e,t,n,{location:r=H.location,distance:i=H.distance,threshold:a=H.threshold,findAllMatches:o=H.findAllMatches,minMatchCharLength:s=H.minMatchCharLength,includeMatches:c=H.includeMatches,ignoreLocation:l=H.ignoreLocation}={}){if(t.length>32)throw Error(Ar(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,x=0,S=u+d,C=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=S;for(;r<i;)h(t,f+i)<=p?r=i:S=i,i=Math.floor((S-r)/2+r);S=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&C&&(b=h(t,i),b<=p)){if(p=b,m=i,x=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+x);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=rr(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function ar(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function or(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}function sr(e){return e.startsWith(`inverse`)}function cr(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function lr(e,t){let n=e.match(t);return n?n[1]:null}function ur(e,t={}){return e.replace(/\\\|/g,Jr).split(Yr).map(e=>{let n=cr(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<qr;){let e=Kr[o],n=lr(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<qr;){let e=Kr[o],n=lr(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}function dr(...e){Zr.push(...e)}function fr(e,t){for(let n=0,r=Zr.length;n<r;n+=1){let r=Zr[n];if(r.condition(e,t))return new r(e,t)}return new Wr(e,t)}function pr(e,t,{auto:n=!0}={}){let r=e=>{if(B(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=fr(e,t)),r}let i=Object.keys(e),a=ti(e);if(!a&&i.length>1&&!ei(e))return r(ri(e));if(ni(e)){let r=a?e[$r.PATH]:i[0],o=a?e[$r.PATTERN]:e[r];if(!B(o))throw Error(kr(r));let s={keyId:Qn(r),pattern:o};return n&&(s.searcher=fr(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];Vn(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return ei(e)||(e=ri(e)),r(e)}function mr(e,{ignoreFieldNorm:t=H.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function hr(e,{ignoreFieldNorm:t=H.ignoreFieldNorm}){e.forEach(e=>{e.score=mr(e.matches,{ignoreFieldNorm:t})})}function gr(e){let t=[];return e.matches.forEach(e=>{if(!V(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function _r(e,t,{includeMatches:n=H.includeMatches,includeScore:r=H.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=gr(e)),r&&(a.score=e.score),a})}function vr(e){oi.has(e)||(oi.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function yr(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||vr(e),t=>t.match(e)||[]):e=>e.match(ai)||[]}function br({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=yr(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=Ur(n)),r(n)}}}function xr(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function Sr(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){xr(e,a,i,r);return}if(o)for(let t=0;t<n;t++){let n=o[t];if(n)if(Array.isArray(n))for(let t of n)xr(e,t.v,i,r);else xr(e,n.v,i,r)}}function Cr(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)Sr(r,i,t,n);return r}function wr(e,t,n,r){Sr(e,t,n,r)}function Tr(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function Er(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)Tr(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,H,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui=t((()=>{Dr=`Incorrect 'index' type`,Or=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,kr=e=>`Invalid value for key ${e}`,Ar=e=>`Pattern length exceeds max of ${e}.`,jr=e=>`Missing ${e} property in key`,Mr=e=>`Property 'weight' in key '${e}' must be a positive integer`,Nr=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,Pr=Object.prototype.hasOwnProperty,Fr=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=Xn(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}},Ir={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Lr={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Rr={location:0,threshold:.6,distance:100},zr={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:$n,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},H=Object.freeze({...Lr,...Ir,...Rr,...zr}),Br=class{constructor({getFn:e=H.getFn,fieldNormWeight:t=H.fieldNormWeight}={}){this.norm=er(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(B(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(Or);if(B(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(Or);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!V(e)||Jn(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(V(i)){if(Vn(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(V(n)){if(B(n)){if(!Jn(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(V(n.v)){let t=B(n.v)?n.v:Un(n.v);if(!Jn(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(B(i)&&!Jn(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}},Vr={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},Hr=RegExp(`[`+Object.keys(Vr).join(``)+`]`,`g`),Ur=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``).replace(Hr,e=>Vr[e]):e=>e,Wr=class{constructor(e,{location:t=H.location,threshold:n=H.threshold,distance:r=H.distance,includeMatches:i=H.includeMatches,findAllMatches:a=H.findAllMatches,minMatchCharLength:o=H.minMatchCharLength,isCaseSensitive:s=H.isCaseSensitive,ignoreDiacritics:c=H.ignoreDiacritics,ignoreLocation:l=H.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?Ur(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:ar(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?Ur(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=ir(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=or(u)),p}},Gr=new Set([`fuzzy`,`include`]),Kr=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new Wr(e,{location:t.location??H.location,threshold:t.threshold??H.threshold,distance:t.distance??H.distance,includeMatches:t.includeMatches??H.includeMatches,findAllMatches:t.findAllMatches??H.findAllMatches,minMatchCharLength:t.minMatchCharLength??H.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??H.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??H.ignoreDiacritics,ignoreLocation:t.ignoreLocation??H.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],qr=Kr.length,Jr=`\0`,Yr=`|`,Xr=class{constructor(e,{isCaseSensitive:t=H.isCaseSensitive,ignoreDiacritics:n=H.ignoreDiacritics,includeMatches:r=H.includeMatches,minMatchCharLength:i=H.minMatchCharLength,ignoreLocation:a=H.ignoreLocation,findAllMatches:o=H.findAllMatches,location:s=H.location,threshold:c=H.threshold,distance:l=H.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?Ur(e):e,this.pattern=e,this.query=ur(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?Ur(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,sr(r.type)&&(c=!0),n&&(Gr.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=or(o)),e}}return{isMatch:!1,score:1}}},Zr=[],Qr={AND:`$and`,OR:`$or`},$r={PATH:`$path`,PATTERN:`$val`},ei=e=>!!(e[Qr.AND]||e[Qr.OR]),ti=e=>!!e[$r.PATH],ni=e=>!Vn(e)&&Kn(e)&&!ei(e),ri=e=>({[Qr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))}),ii=class{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(t[e].score<=t[n].score)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&t[i].score>t[r].score&&(r=i),a<n&&t[a].score>t[r].score&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}},ai=/[\p{L}\p{M}\p{N}_]+/gu,oi=new WeakSet,si=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=br({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new Wr(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=or(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}},ci=class{constructor(e,t,n){this.options={...H,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Fr(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=fr(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Br))throw Error(Dr);if(this._myIndex=t||tr(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=br({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Cr(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!V(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=br({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});wr(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Er(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(Or);this._invertedIndex&&Er(this._invertedIndex,[e]);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(B(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return Wn(n)&&n>-1&&(e=e.slice(0,n)),e}let c=Wn(n)&&n>0&&B(e),l;if(c){let t=new ii(n);B(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),l=t.extractSorted(o)}else l=B(e)?B(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),hr(l,{ignoreFieldNorm:s}),a&&l.sort(o),Wn(n)&&n>-1&&(l=l.slice(0,n));return _r(l,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!V(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=mr(r.matches,{ignoreFieldNorm:n}),t.shouldInsert(r.score)&&t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=pr(e,this.options),n=(e,t,r)=>{if(!(`children`in e)){let{keyId:n,searcher:i}=e,a;return n===null?(a=[],this._myIndex.keys.forEach((e,n)=>{a.push(...this._findMatches({key:e,value:t[n],searcher:i}))})):a=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i}),a&&a.length?[{idx:r,item:t,matches:a}]:[]}let{children:i,operator:a}=e,o=[];for(let e=0,s=i.length;e<s;e+=1){let s=i[e],c=n(s,t,r);if(c.length)o.push(...c);else if(a===Qr.AND)return[]}return o},r=this._myIndex.records,i=new Map,a=[];return r.forEach(({$:e,i:r})=>{if(V(e)){let o=n(t,e,r);o.length&&(i.has(r)||(i.set(r,{idx:r,item:e,matches:[]}),a.push(i.get(r))),o.forEach(({matches:e})=>{i.get(r).matches.push(...e)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{keys:a,records:o}=this._myIndex,s=t?null:[];return o.forEach(({$:e,i:o})=>{if(!V(e))return;let c=[],l=!1,u=!1;if(a.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:o,item:e,matches:c};t?(r.score=mr(r.matches,{ignoreFieldNorm:n}),t.shouldInsert(r.score)&&t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!V(t))return[];let r=[];if(Vn(t))t.forEach(({v:t,i,n:a})=>{if(!V(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}},ci.version=`7.4.2`,ci.createIndex=tr,ci.parseIndex=nr,ci.config=H,ci.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(Nr);return fr(e,{...H,...n}).searchIn(t)},ci.parseQuery=pr,dr(Xr),dr(si),ci.use=function(...e){e.forEach(e=>dr(e))},li=ci}));function di(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var fi=t((()=>{}));function pi(e){if(e.type!==`user`)return!1;let t=Array.isArray(e.message.content)?e.message.content[0]:void 0;return!t||typeof t==`string`||t?.type!==`text`||!t.text.includes(`<task-notification`)||Qe(t.text,`status`)!==`completed`?!1:Qe(t.text,`summary`)?.startsWith(`Background command `)??!1}function mi(e,t){if(!qe()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(pi(t)){let i=0;for(;r<e.length&&pi(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${bt}><${xt}>completed</${xt}><${St}>${i} background commands completed</${St}></${bt}>`}]}})}else n.push(t),r++}return n}var hi=t((()=>{Ct(),ne(),le(),rt()}));function gi(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function _i(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(gi(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!gi(t)||t.hookLabel!==i)break;a.push(t),n++}a.length===1?t.push(r):t.push({...r,hookCount:a.reduce((e,t)=>e+t.hookCount,0),hookInfos:a.flatMap(e=>e.hookInfos),hookErrors:a.flatMap(e=>e.hookErrors),preventedContinuation:a.some(e=>e.preventedContinuation),hasOutput:a.some(e=>e.hasOutput),totalDurationMs:Math.max(...a.map(e=>e.totalDurationMs??0))})}else t.push(r),n++}return t}var vi=t((()=>{}));function yi(e){let t=Si.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),Si.set(e,t)),t}function bi(e){if(e.type===`assistant`&&e.message?.content&&Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_use`){let t=e.message.content[0];return{messageId:e.message.id,toolUseId:t.id,toolName:t.name}}return null}function xi(e,t,n=!1){if(n)return{messages:e};let r=yi(t),i=new Map;for(let t of e){let e=bi(t);if(e&&r.has(e.toolName)){let n=`${e.messageId}:${e.toolName}`,r=i.get(n)??[];r.push(t),i.set(n,r)}}let a=new Map,o=new Set;for(let[e,t]of i)if(t.length>=2){a.set(e,t);for(let e of t){let t=bi(e);t&&o.add(t.toolUseId)}}let s=new Map;for(let t of e)if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content))for(let e of t.message.content)e.type===`tool_result`&&o.has(e.tool_use_id)&&s.set(e.tool_use_id,t);let c=[],l=new Set;for(let t of e){let e=bi(t);if(e){let t=`${e.messageId}:${e.toolName}`,n=a.get(t);if(n){if(!l.has(t)){l.add(t);let r=n[0],i=[];for(let e of n){let t=e.message.content[0].id,n=s.get(t);n&&i.push(n)}let a={type:`grouped_tool_use`,toolName:e.toolName,messages:n,results:i,displayMessage:r,uuid:`grouped-${r.uuid}`,timestamp:r.timestamp,messageId:e.messageId};c.push(a)}continue}}if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content)){let e=t.message.content.filter(e=>e.type===`tool_result`);if(e.length>0&&e.every(e=>o.has(e.tool_use_id)))continue}c.push(t)}return{messages:c}}var Si,Ci=t((()=>{Si=new WeakMap}));function wi(e){let t=Ai.get(e);if(t!==void 0)return t;let n=Ti(e).toLowerCase();return Ai.set(e,n),n}function Ti(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=ki.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?ki.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(Di(e.toolUseResult));t=r.join(`
1
+ import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{l as r,o as i}from"./envUtils-DSxRz_kt.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{C as s,Gr as c,I as l,N as u,P as d,Pn as f,Rn as p,di as m,fi as h,j as g,mt as _,ot as v,t as y,ui as b,xt as x}from"./src-CDCSSo0U2.js";import{t as S}from"./jsx-runtime-Bb4Xn-E0.js";import{B as C,en as w}from"./state-ix0xIunV.js";import{$a as T,$o as E,Am as D,Ao as O,Bu as k,Co as ee,Cv as A,Dx as j,Eg as te,Eu as ne,Fu as M,Gw as N,Hg as re,Ho as P,IE as ie,Iu as ae,JS as F,Jb as oe,Jy as se,Kb as I,Kw as ce,Kx as le,LE as L,Lg as ue,Lm as de,Lu as fe,MO as pe,Mg as me,Mm as he,Mo as ge,NE as _e,Nm as ve,No as ye,OO as be,Og as R,Ox as xe,Po as Se,Ro as Ce,Ru as we,Sv as Te,Ug as Ee,Xo as De,Yy as Oe,Zo as ke,_D as Ae,bD as je,bh as Me,bv as Ne,ch as Pe,co as Fe,eo as Ie,jm as Le,jo as Re,km as ze,lC as Be,lh as Ve,nh as He,po as Ue,qS as We,qb as Ge,qo as Ke,qx as qe,so as Je,th as Ye,to as Xe,vv as Ze,wo as Qe,wv as $e,xv as et,yh as tt,zE as nt,zo as rt,zu as it}from"./loadAgentsDir-BURvZNN6.js";import{n as at,t as ot}from"./cwd-CYmmnQVS.js";import{a as st,l as ct,o as lt,r as ut,s as dt}from"./debug-BrXObCdR.js";import{G as ft,K as pt,Kt as mt,Ut as ht,g as gt,n as _t}from"./settings-DfWP5y6X.js";import{b as vt,c as z,g as yt}from"./config-DiT2Z8dY.js";import{B as bt,L as xt,R as St,Y as Ct}from"./log-BMCygSzM.js";import{f as wt,l as Tt}from"./file-DcZWPH2V.js";import{n as Et,r as Dt}from"./analytics-BotDBGh0.js";import{S as Ot,b as kt,h as At,n as jt,p as Mt,r as Nt,t as Pt}from"./startupProfiler-xa3NmN7Z.js";import{l as Ft,o as It}from"./stringUtils-DGLPkqJ4.js";import{Ct as Lt,E as Rt,Et as zt,Kt as Bt,Ot as Vt,Vt as Ht,_ as Ut,b as Wt,vn as Gt,yn as Kt}from"./model-BIVmcl_N.js";import{Cn as qt,Tn as Jt}from"./prompt-DNDgGM9q.js";import{C as Yt,y as Xt}from"./rcDebugLog-DoL1FpGJ.js";import{a as Zt,o as Qt,r as $t,s as en,t as tn}from"./referral-UKJv23_5.js";import{d as nn,f as rn,h as an,p as on}from"./terminalSetup-BNs9nLbT.js";import{n as sn,r as cn,t as ln}from"./browser-BmZuQom6.js";import{c as un,r as dn}from"./releaseNotes-BKZNuDLD.js";import{a as fn,c as pn,d as mn,i as hn,l as gn,n as _n,o as vn,r as yn,t as bn,u as xn}from"./logoV2Utils-DN9nzdX-.js";import{n as Sn,t as Cn}from"./systemTheme-Ceakddth.js";import{n as wn,r as Tn}from"./PromptInputFooterSuggestions-MwS_cExV.js";import{n as En,t as Dn}from"./useMainLoopModel-CO4yBjRM.js";import{n as On,t as kn}from"./modalContext-DFjKLCB6.js";import{i as An,n as jn,r as Mn,s as Nn,t as Pn}from"./OverageCreditUpsell-B-Bf_-UX.js";import{n as Fn,r as In,t as Ln}from"./statusNoticeHelpers-CaHS8xig.js";import{homedir as Rn}from"os";import{relative as zn}from"path";import{fileURLToPath as Bn}from"url";function Vn(e){return Array.isArray?Array.isArray(e):Yn(e)===`[object Array]`}function Hn(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Un(e){return e==null?``:Hn(e)}function B(e){return typeof e==`string`}function Wn(e){return typeof e==`number`}function Gn(e){return e===!0||e===!1||qn(e)&&Yn(e)==`[object Boolean]`}function Kn(e){return typeof e==`object`}function qn(e){return Kn(e)&&e!==null}function V(e){return e!=null}function Jn(e){return!e.trim().length}function Yn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}function Xn(e){let t=null,n=null,r=null,i=1,a=null;if(B(e)||Vn(e))r=e,t=Zn(e),n=Qn(e);else{if(!Pr.call(e,`name`))throw Error(jr(`name`));let o=e.name;if(r=o,Pr.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(Mr(Qn(o)));t=Zn(o),n=Qn(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function Zn(e){return Vn(e)?e:e.split(`.`)}function Qn(e){return Vn(e)?e.join(`.`):e}function $n(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(V(e))if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!V(s))return;if(a===t.length-1&&(B(s)||Wn(s)||Gn(s)||typeof s==`bigint`))n.push(o===void 0?Un(s):{v:Un(s),i:o});else if(Vn(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}};return i(e,B(t)?t.split(`.`):t,0),r?n:n[0]}function er(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=1,a=!1;for(let e=0;e<t.length;e++)t.charCodeAt(e)===32?a||(i++,a=!0):a=!1;if(n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}function tr(e,t,{getFn:n=H.getFn,fieldNormWeight:r=H.fieldNormWeight}={}){let i=new Br({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(Xn)),i.setSources(t),i.create(),i}function nr(e,{getFn:t=H.getFn,fieldNormWeight:n=H.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new Br({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function rr(e=[],t=H.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function ir(e,t,n,{location:r=H.location,distance:i=H.distance,threshold:a=H.threshold,findAllMatches:o=H.findAllMatches,minMatchCharLength:s=H.minMatchCharLength,includeMatches:c=H.includeMatches,ignoreLocation:l=H.ignoreLocation}={}){if(t.length>32)throw Error(Ar(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,x=0,S=u+d,C=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=S;for(;r<i;)h(t,f+i)<=p?r=i:S=i,i=Math.floor((S-r)/2+r);S=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&C&&(b=h(t,i),b<=p)){if(p=b,m=i,x=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+x);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=rr(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function ar(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function or(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}function sr(e){return e.startsWith(`inverse`)}function cr(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function lr(e,t){let n=e.match(t);return n?n[1]:null}function ur(e,t={}){return e.replace(/\\\|/g,Jr).split(Yr).map(e=>{let n=cr(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<qr;){let e=Kr[o],n=lr(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<qr;){let e=Kr[o],n=lr(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}function dr(...e){Zr.push(...e)}function fr(e,t){for(let n=0,r=Zr.length;n<r;n+=1){let r=Zr[n];if(r.condition(e,t))return new r(e,t)}return new Wr(e,t)}function pr(e,t,{auto:n=!0}={}){let r=e=>{if(B(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=fr(e,t)),r}let i=Object.keys(e),a=ti(e);if(!a&&i.length>1&&!ei(e))return r(ri(e));if(ni(e)){let r=a?e[$r.PATH]:i[0],o=a?e[$r.PATTERN]:e[r];if(!B(o))throw Error(kr(r));let s={keyId:Qn(r),pattern:o};return n&&(s.searcher=fr(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];Vn(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return ei(e)||(e=ri(e)),r(e)}function mr(e,{ignoreFieldNorm:t=H.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function hr(e,{ignoreFieldNorm:t=H.ignoreFieldNorm}){e.forEach(e=>{e.score=mr(e.matches,{ignoreFieldNorm:t})})}function gr(e){let t=[];return e.matches.forEach(e=>{if(!V(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function _r(e,t,{includeMatches:n=H.includeMatches,includeScore:r=H.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=gr(e)),r&&(a.score=e.score),a})}function vr(e){oi.has(e)||(oi.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function yr(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||vr(e),t=>t.match(e)||[]):e=>e.match(ai)||[]}function br({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=yr(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=Ur(n)),r(n)}}}function xr(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function Sr(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){xr(e,a,i,r);return}if(o)for(let t=0;t<n;t++){let n=o[t];if(n)if(Array.isArray(n))for(let t of n)xr(e,t.v,i,r);else xr(e,n.v,i,r)}}function Cr(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)Sr(r,i,t,n);return r}function wr(e,t,n,r){Sr(e,t,n,r)}function Tr(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function Er(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)Tr(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,H,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui=t((()=>{Dr=`Incorrect 'index' type`,Or=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,kr=e=>`Invalid value for key ${e}`,Ar=e=>`Pattern length exceeds max of ${e}.`,jr=e=>`Missing ${e} property in key`,Mr=e=>`Property 'weight' in key '${e}' must be a positive integer`,Nr=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,Pr=Object.prototype.hasOwnProperty,Fr=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=Xn(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}},Ir={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Lr={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Rr={location:0,threshold:.6,distance:100},zr={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:$n,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},H=Object.freeze({...Lr,...Ir,...Rr,...zr}),Br=class{constructor({getFn:e=H.getFn,fieldNormWeight:t=H.fieldNormWeight}={}){this.norm=er(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(B(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(Or);if(B(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(Or);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!V(e)||Jn(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(V(i)){if(Vn(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(V(n)){if(B(n)){if(!Jn(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(V(n.v)){let t=B(n.v)?n.v:Un(n.v);if(!Jn(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(B(i)&&!Jn(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}},Vr={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},Hr=RegExp(`[`+Object.keys(Vr).join(``)+`]`,`g`),Ur=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``).replace(Hr,e=>Vr[e]):e=>e,Wr=class{constructor(e,{location:t=H.location,threshold:n=H.threshold,distance:r=H.distance,includeMatches:i=H.includeMatches,findAllMatches:a=H.findAllMatches,minMatchCharLength:o=H.minMatchCharLength,isCaseSensitive:s=H.isCaseSensitive,ignoreDiacritics:c=H.ignoreDiacritics,ignoreLocation:l=H.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?Ur(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:ar(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?Ur(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=ir(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=or(u)),p}},Gr=new Set([`fuzzy`,`include`]),Kr=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new Wr(e,{location:t.location??H.location,threshold:t.threshold??H.threshold,distance:t.distance??H.distance,includeMatches:t.includeMatches??H.includeMatches,findAllMatches:t.findAllMatches??H.findAllMatches,minMatchCharLength:t.minMatchCharLength??H.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??H.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??H.ignoreDiacritics,ignoreLocation:t.ignoreLocation??H.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],qr=Kr.length,Jr=`\0`,Yr=`|`,Xr=class{constructor(e,{isCaseSensitive:t=H.isCaseSensitive,ignoreDiacritics:n=H.ignoreDiacritics,includeMatches:r=H.includeMatches,minMatchCharLength:i=H.minMatchCharLength,ignoreLocation:a=H.ignoreLocation,findAllMatches:o=H.findAllMatches,location:s=H.location,threshold:c=H.threshold,distance:l=H.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?Ur(e):e,this.pattern=e,this.query=ur(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?Ur(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,sr(r.type)&&(c=!0),n&&(Gr.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=or(o)),e}}return{isMatch:!1,score:1}}},Zr=[],Qr={AND:`$and`,OR:`$or`},$r={PATH:`$path`,PATTERN:`$val`},ei=e=>!!(e[Qr.AND]||e[Qr.OR]),ti=e=>!!e[$r.PATH],ni=e=>!Vn(e)&&Kn(e)&&!ei(e),ri=e=>({[Qr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))}),ii=class{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(t[e].score<=t[n].score)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&t[i].score>t[r].score&&(r=i),a<n&&t[a].score>t[r].score&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}},ai=/[\p{L}\p{M}\p{N}_]+/gu,oi=new WeakSet,si=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=br({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new Wr(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=or(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}},ci=class{constructor(e,t,n){this.options={...H,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Fr(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=fr(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Br))throw Error(Dr);if(this._myIndex=t||tr(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=br({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Cr(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!V(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=br({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});wr(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Er(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(Or);this._invertedIndex&&Er(this._invertedIndex,[e]);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(B(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return Wn(n)&&n>-1&&(e=e.slice(0,n)),e}let c=Wn(n)&&n>0&&B(e),l;if(c){let t=new ii(n);B(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),l=t.extractSorted(o)}else l=B(e)?B(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),hr(l,{ignoreFieldNorm:s}),a&&l.sort(o),Wn(n)&&n>-1&&(l=l.slice(0,n));return _r(l,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!V(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=mr(r.matches,{ignoreFieldNorm:n}),t.shouldInsert(r.score)&&t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=pr(e,this.options),n=(e,t,r)=>{if(!(`children`in e)){let{keyId:n,searcher:i}=e,a;return n===null?(a=[],this._myIndex.keys.forEach((e,n)=>{a.push(...this._findMatches({key:e,value:t[n],searcher:i}))})):a=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i}),a&&a.length?[{idx:r,item:t,matches:a}]:[]}let{children:i,operator:a}=e,o=[];for(let e=0,s=i.length;e<s;e+=1){let s=i[e],c=n(s,t,r);if(c.length)o.push(...c);else if(a===Qr.AND)return[]}return o},r=this._myIndex.records,i=new Map,a=[];return r.forEach(({$:e,i:r})=>{if(V(e)){let o=n(t,e,r);o.length&&(i.has(r)||(i.set(r,{idx:r,item:e,matches:[]}),a.push(i.get(r))),o.forEach(({matches:e})=>{i.get(r).matches.push(...e)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{keys:a,records:o}=this._myIndex,s=t?null:[];return o.forEach(({$:e,i:o})=>{if(!V(e))return;let c=[],l=!1,u=!1;if(a.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:o,item:e,matches:c};t?(r.score=mr(r.matches,{ignoreFieldNorm:n}),t.shouldInsert(r.score)&&t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!V(t))return[];let r=[];if(Vn(t))t.forEach(({v:t,i,n:a})=>{if(!V(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}},ci.version=`7.4.2`,ci.createIndex=tr,ci.parseIndex=nr,ci.config=H,ci.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(Nr);return fr(e,{...H,...n}).searchIn(t)},ci.parseQuery=pr,dr(Xr),dr(si),ci.use=function(...e){e.forEach(e=>dr(e))},li=ci}));function di(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var fi=t((()=>{}));function pi(e){if(e.type!==`user`)return!1;let t=Array.isArray(e.message.content)?e.message.content[0]:void 0;return!t||typeof t==`string`||t?.type!==`text`||!t.text.includes(`<task-notification`)||Qe(t.text,`status`)!==`completed`?!1:Qe(t.text,`summary`)?.startsWith(`Background command `)??!1}function mi(e,t){if(!qe()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(pi(t)){let i=0;for(;r<e.length&&pi(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${bt}><${xt}>completed</${xt}><${St}>${i} background commands completed</${St}></${bt}>`}]}})}else n.push(t),r++}return n}var hi=t((()=>{Ct(),ne(),le(),rt()}));function gi(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function _i(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(gi(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!gi(t)||t.hookLabel!==i)break;a.push(t),n++}a.length===1?t.push(r):t.push({...r,hookCount:a.reduce((e,t)=>e+t.hookCount,0),hookInfos:a.flatMap(e=>e.hookInfos),hookErrors:a.flatMap(e=>e.hookErrors),preventedContinuation:a.some(e=>e.preventedContinuation),hasOutput:a.some(e=>e.hasOutput),totalDurationMs:Math.max(...a.map(e=>e.totalDurationMs??0))})}else t.push(r),n++}return t}var vi=t((()=>{}));function yi(e){let t=Si.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),Si.set(e,t)),t}function bi(e){if(e.type===`assistant`&&e.message?.content&&Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_use`){let t=e.message.content[0];return{messageId:e.message.id,toolUseId:t.id,toolName:t.name}}return null}function xi(e,t,n=!1){if(n)return{messages:e};let r=yi(t),i=new Map;for(let t of e){let e=bi(t);if(e&&r.has(e.toolName)){let n=`${e.messageId}:${e.toolName}`,r=i.get(n)??[];r.push(t),i.set(n,r)}}let a=new Map,o=new Set;for(let[e,t]of i)if(t.length>=2){a.set(e,t);for(let e of t){let t=bi(e);t&&o.add(t.toolUseId)}}let s=new Map;for(let t of e)if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content))for(let e of t.message.content)e.type===`tool_result`&&o.has(e.tool_use_id)&&s.set(e.tool_use_id,t);let c=[],l=new Set;for(let t of e){let e=bi(t);if(e){let t=`${e.messageId}:${e.toolName}`,n=a.get(t);if(n){if(!l.has(t)){l.add(t);let r=n[0],i=[];for(let e of n){let t=e.message.content[0].id,n=s.get(t);n&&i.push(n)}let a={type:`grouped_tool_use`,toolName:e.toolName,messages:n,results:i,displayMessage:r,uuid:`grouped-${r.uuid}`,timestamp:r.timestamp,messageId:e.messageId};c.push(a)}continue}}if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content)){let e=t.message.content.filter(e=>e.type===`tool_result`);if(e.length>0&&e.every(e=>o.has(e.tool_use_id)))continue}c.push(t)}return{messages:c}}var Si,Ci=t((()=>{Si=new WeakMap}));function wi(e){let t=Ai.get(e);if(t!==void 0)return t;let n=Ti(e).toLowerCase();return Ai.set(e,n),n}function Ti(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=ki.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?ki.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(Di(e.toolUseResult));t=r.join(`
2
2
  `)}break}case`assistant`:{let n=e.message.content;Array.isArray(n)&&(t=n.flatMap(e=>e.type===`text`?[e.text]:e.type===`tool_use`?[Ei(e.input)]:[]).join(`
3
3
  `));break}case`attachment`:if(e.attachment.type===`relevant_memories`)t=(e.attachment.memories??[]).map(e=>e.content).join(`
4
4
  `);else if(e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
@@ -7,5 +7,5 @@ import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{l as r,o
7
7
  `)}function Di(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;if(typeof t.stdout==`string`){let e=typeof t.stderr==`string`?t.stderr:``;return t.stdout+(e?`
8
8
  `+e:``)}if(t.file&&typeof t.file==`object`&&typeof t.file.content==`string`)return t.file.content;let n=[];for(let e of[`content`,`output`,`result`,`text`,`message`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`filenames`,`lines`,`results`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(`
9
9
  `))}return n.join(`
10
- `)}var Oi,ki,Ai,ji=t((()=>{rt(),Oi=`</system-reminder>`,ki=new Set([Ie,Xe]),Ai=new WeakMap}));function Mi({pose:e=`default`}={}){return(0,Ni.jsxs)(l,{flexDirection:`column`,alignItems:`center`,children:[(0,Ni.jsx)(d,{color:`clawd_body`,children:` █████ `}),(0,Ni.jsx)(d,{color:`clawd_body`,children:`██ ● ● ██`}),(0,Ni.jsx)(d,{color:`clawd_body`,children:`██ ▄▄▄ ██`}),(0,Ni.jsx)(d,{color:`clawd_body`,children:` █ █ █ █ `})]})}var Ni,Pi=t((()=>{h(),y(),Ni=S()}));function Fi(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=c(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,c(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?c(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=c(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,c(r))),o}function Ii({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?c(e.timestamp):0));return(0,U.jsxs)(l,{flexDirection:`column`,width:t,children:[(0,U.jsx)(d,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(d,{dimColor:!0,italic:!0,children:Ot(i,t)})]}):r.length===0&&a?(0,U.jsx)(d,{dimColor:!0,children:Ot(a,t)}):(0,U.jsxs)(U.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,U.jsxs)(d,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(d,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(d,{children:Ot(e.text,r)})]},n)}),i&&(0,U.jsx)(d,{dimColor:!0,italic:!0,children:Ot(i,t)})]})]})}var U,Li=t((()=>{h(),y(),kt(),U=S()}));function Ri({feeds:e,maxWidth:t}){let n=e.map(e=>Fi(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Bi.jsx)(l,{flexDirection:`column`,children:e.map((t,n)=>(0,Bi.jsxs)(zi.Fragment,{children:[(0,Bi.jsx)(Ii,{config:t,actualWidth:i}),n<e.length-1&&(0,Bi.jsx)(s,{color:`claude`,width:i})]},n))})}var zi,Bi,Vi=t((()=>{zi=n(h(),1),y(),Li(),Bi=S()}));function Hi(e){let t=e.map(e=>{let t=At(e.modified);return{text:(e.summary&&e.summary!==`No prompt`?e.summary:e.firstPrompt)||``,timestamp:t}});return{title:`Recent activity`,lines:t,footer:t.length>0?`/resume for more`:void 0,emptyMessage:`No recent activity`}}function Ui(e){let t=e.map(e=>{if(process.env.USER_TYPE===`ant`){let t=e.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);if(t)return{timestamp:t[1],text:t[2]||``}}return{text:e}}),n=process.env.USER_TYPE===`ant`?`Unable to fetch latest claude-cli-internal commits`:`Check the Claude Code changelog for updates`;return{title:process.env.USER_TYPE===`ant`?`What's new [ANT-ONLY: Latest CC commits]`:`What's new`,lines:t,footer:t.length>0?`/release-notes for more`:void 0,emptyMessage:n}}function Wi(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${o.tick} `:``}${e}`})),n=ot()===Rn()?`Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.`:void 0;return n&&t.push({text:n}),{title:`Tips for getting started`,lines:t}}function Gi(){let e=Zt(),t=e?`Share Claude Code and earn ${$t(e)} of extra usage`:`Share Claude Code with friends`;return{title:`3 guest passes`,lines:[],customContent:{content:(0,Ki.jsxs)(Ki.Fragment,{children:[(0,Ki.jsx)(l,{marginY:1,children:(0,Ki.jsx)(d,{color:`claude`,children:`[✻] [✻] [✻]`})}),(0,Ki.jsx)(d,{dimColor:!0,children:t})]}),width:48},footer:`/passes`}}var Ki,qi=t((()=>{a(),y(),en(),at(),kt(),Ki=S()}));function Ji(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Yi(){let{pose:e,bounceOffset:t,onClick:n}=Xi();return(0,Qi.jsx)(l,{height:ia,flexDirection:`column`,onClick:n,children:(0,Qi.jsx)(l,{marginTop:t,flexShrink:0,children:(0,Qi.jsx)(Mi,{pose:e})})})}function Xi(){let[e]=(0,Zi.useState)(()=>_t().prefersReducedMotion??!1),[t,n]=(0,Zi.useState)(-1),r=(0,Zi.useRef)($i),i=()=>{e||t!==-1||(r.current=ea[Math.floor(Math.random()*ea.length)],n(0))};(0,Zi.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,na,ra);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:ta;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Zi,Qi,$i,ea,ta,na,ra,ia,aa=t((()=>{h(),Zi=n(h(),1),y(),gt(),Pi(),Qi=S(),$i=[...Ji(`default`,1,2),...Ji(`arms-up`,0,3),...Ji(`default`,0,1),...Ji(`default`,1,2),...Ji(`arms-up`,0,3),...Ji(`default`,0,1)],ea=[$i,[...Ji(`look-right`,0,5),...Ji(`look-left`,0,5),...Ji(`default`,0,1)]],ta={pose:`default`,offset:0},na=60,ra=e=>e+1,ia=3}));function oa(){let e=Qt();e==null||e<=0||e>(z().passesLastSeenRemaining??0)&&vt(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function sa(){let{eligible:e,hasCache:t}=tn();if(!e||!t)return!1;oa();let n=z();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function ca(){let[e]=(0,da.useState)(()=>sa());return e}function la(){let e=0;vt(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),Dt(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function ua(){let e=Zt();return(0,fa.jsxs)(d,{dimColor:!0,children:[(0,fa.jsx)(d,{color:`claude`,children:`[✻]`}),` `,(0,fa.jsx)(d,{color:`claude`,children:`[✻]`}),` `,(0,fa.jsx)(d,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${$t(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var da,fa,pa=t((()=>{h(),da=n(h(),1),y(),Et(),en(),yt(),fa=S()}));function ma(){let{columns:e}=v(),t=F(e=>e.agent),n=F(e=>e.effortValue),r=En(),i=Rt(r),{version:a,cwd:o,billingType:s,agentName:u}=vn(),f=t??u,p=ca(),m=Nn();(0,ha.useEffect)(()=>{p&&la()},[p]),(0,ha.useEffect)(()=>{m&&!p&&Mn()},[m,p]);let h=Math.max(e-15,20),g=Ot(a,Math.max(h-11,6)),{shouldSplit:_,truncatedModel:y,truncatedBilling:b}=yn(i+be(r,n),s,h),x=f?h-1-c(f)-3:h,S=mn(o,Math.max(x,10));return(0,W.jsx)(he,{children:(0,W.jsxs)(l,{flexDirection:`row`,gap:2,alignItems:`center`,children:[qe()?(0,W.jsx)(Yi,{}):(0,W.jsx)(Mi,{}),(0,W.jsxs)(l,{flexDirection:`column`,children:[(0,W.jsxs)(d,{children:[(0,W.jsx)(d,{bold:!0,children:`Work Mate`}),` `,(0,W.jsxs)(d,{dimColor:!0,children:[`v`,g]})]}),_?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(d,{dimColor:!0,children:y}),(0,W.jsx)(d,{dimColor:!0,children:b})]}):(0,W.jsxs)(d,{dimColor:!0,children:[y,` · `,b]}),(0,W.jsx)(d,{dimColor:!0,children:f?`@${f} · ${S}`:S}),p&&(0,W.jsx)(ua,{}),!p&&m&&(0,W.jsx)(Pn,{maxWidth:h,twoLine:!0})]})]})})}var ha,W,ga=t((()=>{ha=n(h(),1),Dn(),Be(),y(),We(),pe(),kt(),le(),xn(),Ut(),ve(),aa(),Pi(),pa(),An(),W=S()}));function _a(){let e=(0,ya.useMemo)(va,[]),t=(0,ya.useMemo)(()=>z().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,ya.useEffect)(()=>{n&&vt(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,ba.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,ba.jsx)(d,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function va(){return xa}var ya,ba,xa,Sa=t((()=>{h(),ya=n(h(),1),y(),yt(),ba=S(),xa={tip:``,color:`dim`}}));function Ca({char:e=`✻`}){let[t]=(0,wa.useState)(()=>_t().prefersReducedMotion??!1),[n,r]=(0,wa.useState)(t),i=(0,wa.useRef)(null),[a,o]=_(n?null:50);return(0,wa.useEffect)(()=>{if(n)return;let e=setTimeout(r,Da,!0);return()=>clearTimeout(e)},[n]),n?(0,Ta.jsx)(l,{ref:a,children:(0,Ta.jsx)(d,{color:Oa,children:e})}):(i.current===null&&(i.current=o),(0,Ta.jsx)(l,{ref:a,children:(0,Ta.jsx)(d,{color:oe(I((o-i.current)/Ea*360%360)),children:e})}))}var wa,Ta,Ea,Da,Oa,ka=t((()=>{h(),wa=n(h(),1),mt(),y(),gt(),Ge(),Ta=S(),Ea=1500,Da=Ea*2,Oa=oe({r:153,g:153,b:153})}));function Aa(){return Wt()&&(z().opus1mMergeNoticeSeenCount??0)<Pa}function ja(){let[e]=(0,Ma.useState)(Aa);return(0,Ma.useEffect)(()=>{if(!e)return;let t=(z().opus1mMergeNoticeSeenCount??0)+1;vt(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,Na.jsxs)(l,{paddingLeft:2,children:[(0,Na.jsx)(Ca,{char:`↑`}),(0,Na.jsx)(d,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var Ma,Na,Pa,Fa=t((()=>{h(),Ma=n(h(),1),mt(),y(),yt(),Ut(),ka(),Na=S(),Pa=6}));function Ia(){return null}var La=t((()=>{}));function Ra(){return null}var za=t((()=>{}));function Ba(){let e=pn(),t=z().oauthAccount?.displayName??``,{columns:n}=v(),i=an(),a=Ae.isSandboxingEnabled(),o=ca(),s=Nn(),u=F(e=>e.agent),f=F(e=>e.effortValue),p=z(),m;try{m=gn(3)}catch{m=[]}let[h]=(0,Va.useState)(()=>{let e=_t().companyAnnouncements;if(!(!e||e.length===0))return p.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:_}=dn(p.lastReleaseNotesSeen);(0,Va.useEffect)(()=>{z().lastReleaseNotesSeen!==`0.0.3`&&(vt(e=>e.lastReleaseNotesSeen===`0.0.3`?e:{...e,lastReleaseNotesSeen:`0.0.3`}),i&&rn())},[p,i]);let y=!_&&!i&&!r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Va.useEffect)(()=>{o&&!i&&!y&&la()},[o,i,y]),(0,Va.useEffect)(()=>{s&&!i&&!o&&!y&&Mn()},[s,i,o,y]);let b=En(),x=Rt(b),{version:S,cwd:C,billingType:w,agentName:T}=vn(),E=u??T,D=Ot(x+be(b,f),Ha-20);if(!_&&!i&&!r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ma,{}),(0,G.jsx)(ja,{}),lt()&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(d,{dimColor:!0,children:[`Logging to: `,dt()?`stderr`:ut()]})]}),(0,G.jsx)(_a,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(d,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(d,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),h&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&p.oauthAccount?.organizationName&&(0,G.jsxs)(d,{dimColor:!0,children:[`Message from `,p.oauthAccount.organizationName,`:`]}),(0,G.jsx)(d,{children:h})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(d,{dimColor:!0,children:[`API calls: `,Tt(N())]}),(0,G.jsxs)(d,{dimColor:!0,children:[`Debug logs: `,Tt(ut())]}),Nt()&&(0,G.jsxs)(d,{dimColor:!0,children:[`Startup Perf: `,Tt(Pt())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ia,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ra,{})]});let O=fn(n),k=Sn(z().theme),ee=` ${g(`claude`,k)(`Work Mate`)} ${g(`inactive`,k)(`v${S}`)} `,A=g(`claude`,k)(` Work Mate `);if(O===`compact`){let e=hn(t);c(e)>n-4&&(e=hn(null));let r=E?n-4-1-c(E)-3:n-4,i=mn(C,Math.max(r,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(he,{children:(0,G.jsxs)(l,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:A,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,G.jsx)(d,{bold:!0,children:e}),(0,G.jsx)(l,{marginY:1,children:(0,G.jsx)(Mi,{})}),(0,G.jsx)(d,{dimColor:!0,children:D}),(0,G.jsx)(d,{dimColor:!0,children:w}),(0,G.jsx)(d,{dimColor:!0,children:E?`@${E} · ${i}`:i})]})}),(0,G.jsx)(ja,{}),a&&(0,G.jsx)(l,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(d,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ia,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ra,{})]})}let j=hn(t),te=!process.env.IS_DEMO&&p.oauthAccount?.organizationName?`${D} · ${w} · ${p.oauthAccount.organizationName}`:`${D} · ${w}`,ne=E?Ha-1-c(E)-3:Ha,M=mn(C,Math.max(ne,10)),re=E?`@${E} · ${M}`:M,{leftWidth:P,rightWidth:ie}=bn(n,O,_n(j,re,te));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(he,{children:(0,G.jsx)(l,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:ee,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(l,{flexDirection:O===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(l,{flexDirection:`column`,width:P,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(l,{marginTop:1,children:(0,G.jsx)(d,{bold:!0,children:j})}),(0,G.jsx)(Mi,{}),(0,G.jsxs)(l,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(d,{dimColor:!0,children:te}),(0,G.jsx)(d,{dimColor:!0,children:re})]})]}),O===`horizontal`&&(0,G.jsx)(l,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),O===`horizontal`&&(0,G.jsx)(Ri,{feeds:i?[Wi(nn()),Hi(e)]:o?[Hi(e),Gi()]:s?[Hi(e),jn()]:[Hi(e),Ui(m)],maxWidth:ie})]})})}),(0,G.jsx)(ja,{}),lt()&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(d,{dimColor:!0,children:[`Logging to: `,dt()?`stderr`:ut()]})]}),(0,G.jsx)(_a,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(d,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(d,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),h&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&p.oauthAccount?.organizationName&&(0,G.jsxs)(d,{dimColor:!0,children:[`Message from `,p.oauthAccount.organizationName,`:`]}),(0,G.jsx)(d,{children:h})]}),a&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(d,{dimColor:!0,children:[`API calls: `,Tt(N())]}),(0,G.jsxs)(d,{dimColor:!0,children:[`Debug logs: `,Tt(ut())]}),Nt()&&(0,G.jsxs)(d,{dimColor:!0,children:[`Startup Perf: `,Tt(Pt())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ia,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ra,{})]})}var Va,G,Ha,Ua=t((()=>{h(),y(),Be(),xn(),kt(),wt(),Pi(),Vi(),qi(),yt(),Cn(),gt(),st(),Va=n(h(),1),on(),ga(),ve(),un(),ce(),i(),jt(),Sa(),Fa(),La(),za(),je(),pa(),An(),We(),pe(),Dn(),Ut(),G=S(),Ha=50}));function Wa({message:e,isTranscriptMode:t}){let n=e.message?.content,r=Array.isArray(n)?n:[];if(!(t&&e.type===`assistant`&&e.message?.model&&r.some(e=>e?.type===`text`)))return null;let i=e.message.model;return(0,Ga.jsx)(l,{minWidth:c(i)+8,children:(0,Ga.jsx)(d,{dimColor:!0,children:i})})}var Ga,Ka=t((()=>{h(),y(),Ga=S()}));function qa({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type===`assistant`&&Array.isArray(e.message.content)&&e.message.content.some(e=>e.type===`text`)))return null;let n=new Date(e.timestamp).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0});return(0,Ja.jsx)(l,{minWidth:c(n),children:(0,Ja.jsx)(d,{dimColor:!0,children:n})})}var Ja,Ya=t((()=>{h(),y(),Ja=S()}));function Xa(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=ro(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(fe(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&ro(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=ro(t.messages[0]?.message.content)?.input;if(fe(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function Za({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:u,onOpenRateLimitOptions:d,lastThinkingBlockId:f,latestBashOutputUUID:p,columns:m,isLoading:h,lookups:g,shouldCollapseDiffs:_}){let v=c===`transcript`,y=e.type===`grouped_tool_use`,b=e.type===`collapsed_read_search`,x=b&&(it(e,o)||h&&!n),S=y?e.displayMessage:b?ae(e):e,C=y||b?[]:Re(e,g),w=xs(e,s,o,y||b?T:ge(e,g),c,g),E=!1;if(u)if(y)E=e.messages.some(e=>{let t=ro(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(b)E=it(e,o);else{let t=ye(e);E=!t||o.has(t)}let D=v&&S.type===`assistant`&&Array.isArray(S.message.content)&&S.message.content.some(e=>e.type===`text`)&&(S.timestamp||S.message.model),O=(0,no.jsx)(ze,{message:e,lookups:g,addMargin:!D,containerWidth:D?void 0:m,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:C,shouldAnimate:E,shouldShowDot:!0,isTranscriptMode:v,isStatic:w,onOpenRateLimitOptions:d,isActiveCollapsedGroup:x,isUserContinuation:t,lastThinkingBlockId:f,latestBashOutputUUID:p,shouldCollapseDiffs:_});return D?(0,no.jsx)(he,{children:(0,no.jsxs)(l,{width:m,flexDirection:`column`,children:[(0,no.jsxs)(l,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,no.jsx)(qa,{message:S,isTranscriptMode:v}),(0,no.jsx)(Wa,{message:S,isTranscriptMode:v})]}),O]})}):(0,no.jsx)(he,{children:O})}function Qa(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=ro(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return we(e).some(e=>t.has(e));let n=ye(e);return!!n&&t.has(n)}function $a(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=ro(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return we(e).every(e=>t.has(e));if(e.type===`assistant`){let n=ro(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=ye(e);return!n||t.has(n)}function eo(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&D(t.message))return!1;let n=Qa(e.message,e.streamingToolUseIDs),r=$a(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var to,no,ro,io,ao=t((()=>{to=n(h(),1),y(),k(),rt(),Le(),no=S(),Ka(),Ms(),Ya(),ve(),ro=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},io=to.memo(Za,eo)}));function oo(e){return e.type===`attachment`&&so.has(e.attachment.type)}var so,co=t((()=>{so=new Set(`hook_success.hook_additional_context.hook_cancelled.command_permissions.agent_mention.budget_usd.critical_system_reminder.edited_image_file.edited_text_file.opened_file_in_ide.output_style.plan_mode.plan_mode_exit.plan_mode_reentry.structured_output.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.token_usage.ultrathink_effort.max_turns_reached.task_reminder.auto_mode.auto_mode_exit.output_token_usage.verify_plan_reminder.current_session_memory.compaction_reminder.date_change`.split(`.`))}));function lo(e){return _o.filter(t=>t.isActive(e))}var K,uo,fo,po,mo,ho,go,_o,vo=t((()=>{y(),h(),nt(),a(),at(),kt(),Ht(),In(),R(),re(),K=S(),uo={id:`large-memory-files`,type:`warning`,isActive:e=>ie(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:ie(e.memoryFiles).map(e=>{let t=e.path.startsWith(ot())?zn(ot(),e.path):e.path;return(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Large `,(0,K.jsx)(d,{bold:!0,children:t}),` will impact performance (`,Mt(e.content.length),` chars > `,Mt(_e),`)`,(0,K.jsx)(d,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},fo={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=Vt();return Bt()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=Vt();return(0,K.jsxs)(l,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},po={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=Lt({skipRetrievingKeyFromApiKeyHelper:!0});return!!zt()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=Lt({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(l,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},mo={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=Lt({skipRetrievingKeyFromApiKeyHelper:!0}),t=Vt();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=Lt({skipRetrievingKeyFromApiKeyHelper:!0}),t=Vt();return(0,K.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(l,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(d,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,K.jsxs)(d,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},ho={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Fn(e.agentDefinitions)>Ln,render:e=>{let t=Fn(e.agentDefinitions);return(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,Mt(t),` tokens > `,Mt(Ln),`)`,(0,K.jsx)(d,{dimColor:!0,children:` · /agents to manage`})]})]})}},go={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!me()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=te();return t!==null&&!Ee(t)},render:()=>{let e=ue(te());return(0,K.jsxs)(l,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,K.jsx)(d,{color:`ide`,children:o.arrowUp}),(0,K.jsxs)(d,{children:[`Install the `,(0,K.jsx)(d,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,K.jsx)(d,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},_o=[uo,ho,fo,po,mo,go]}));function yo({agentDefinitions:e}={}){let t={config:z(),agentDefinitions:e,memoryFiles:(0,xo.use)(L())},n=lo(t);return n.length===0?null:(0,So.jsx)(l,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,So.jsx)(bo.Fragment,{children:e.render(t)},e.id))})}var bo,xo,So,Co=t((()=>{bo=n(h(),1),xo=n(h(),1),y(),nt(),yt(),vo(),So=S()}));function wo(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??Mo,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/Oo);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,q.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??To);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-Do),w=b;else{if(y){let e=v+Eo;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-Eo;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*Eo,y=Math.min(b,C+Ao),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+Eo);)S+=r.current.get(t[w])??ko,w++}let e=v+2*Eo,n=Math.max(0,w-Ao),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??ko;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??ko;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-jo&&(C=e-jo),w>t+jo&&(w=t+jo),C>w&&(w=Math.min(C+jo,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let T=(0,q.useDeferredValue)(C),E=(0,q.useDeferredValue)(w),D=C<T?T:C,O=w>E?E:w;if((D>O||y)&&(D=C,O=w),_>0&&(O=w),O-D>Ao){let e=(x[D]+x[O])/2;g-m.current<e?O=D+Ao:D=O-Ao}let k=m.current,ee=x[D],A=D===0?0:ee+k,j=O===b?1/0:Math.max(ee,x[O]-v)+k;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(A,j)}),(0,q.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let te=(0,q.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),ne=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),M=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),N=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),re=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),P=S-x[O];return{range:[D,O],topSpacer:ee,bottomSpacer:P,measureRef:te,spacerRef:h,offsets:x,getItemTop:ne,getItemElement:M,getItemHeight:N,scrollToIndex:re}}var q,To,Eo,Do,Oo,ko,Ao,jo,Mo,No=t((()=>{q=n(h(),1),To=3,Eo=40,Do=30,Oo=20,ko=1,Ao=200,jo=25,Mo=()=>{}}));function Po({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,zo.jsx)(Vo.Provider,{value:n,children:(0,zo.jsx)(Uo.Provider,{value:i,children:(0,zo.jsx)(Bo.Provider,{value:t,children:(0,zo.jsx)(Ho.Provider,{value:r,children:e})})})})}function Fo(){return(0,J.useContext)(Bo)}function Io(){return(0,J.useContext)(Ho)}function Lo(e){let t=(0,J.useContext)(Vo);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Ro(e){let t=(0,J.useContext)(Uo);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,zo,Bo,Vo,Ho,Uo,Wo=t((()=>{J=n(h(),1),zo=S(),Bo=(0,J.createContext)(null),Vo=(0,J.createContext)(null),Ho=(0,J.createContext)(null),Uo=(0,J.createContext)(null)}));function Go(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function Ko(e,t){let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t.type===`progress`||t.type===`assistant`&&!qo(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function qo(e){if(e.type!==`assistant`||!Array.isArray(e.message.content))return!1;for(let t of e.message.content)if(typeof t!=`string`&&t.type===`text`&&t.text.trim()!==``)return!0;return!1}function Jo(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||oo(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=Ko(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function Yo({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:u=!1,newMessageCount:f=0,onPillClick:m}){let{rows:h,columns:g}=v(),[_,y]=(0,Y.useState)(null),b=(0,Y.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!qe())return;let e=p.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{cn(Bn(e))}catch{}else sn(e)},()=>{e.onHyperlinkClick=void 0}},[]),qe()){let s=u?null:_,p=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,X.jsxs)(Po,{children:[(0,X.jsx)(l,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(l,{flexDirection:`column`,flexGrow:1,width:g,overflow:`hidden`,children:[(0,X.jsxs)(l,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[p&&(0,X.jsx)(Zo,{text:p.text,onClick:p.scrollTo}),(0,X.jsxs)(x,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,X.jsx)(ts,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,X.jsx)(Xo,{count:f,onClick:m}),r!=null&&(0,X.jsx)(l,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(l,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(Qo,{}),(0,X.jsx)($o,{}),(0,X.jsx)(l,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(kn,{value:{rows:h-es-1,columns:g-4,scrollRef:a??null},children:(0,X.jsxs)(l,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:h-es,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(l,{flexShrink:0,children:(0,X.jsx)(d,{color:`permission`,children:`▔`.repeat(g)})}),(0,X.jsx)(l,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function Xo({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(l,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(l,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(d,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${Ft(e,`message`)}`:`Jump to bottom`,` `,o.arrowDown,` `]})})})}function Zo({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(l,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(d,{color:`subtle`,wrap:`truncate-end`,children:[o.pointer,` `,e]})})}function Qo(){let e=Fo();return!e||e.suggestions.length===0?null:(0,X.jsx)(l,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(wn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function $o(){let e=Io();return e?(0,X.jsx)(l,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,es,ts,ns=t((()=>{a(),Y=n(h(),1),On(),Wo(),Be(),y(),ln(),le(),It(),co(),Tn(),X=S(),es=2,ts=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function rs(e){let t=ds.get(e);if(t!==void 0)return t;let n=wi(e);return ds.set(e,n),n}function is(e){let t=ps.get(e);if(t!==void 0)return t;let n=as(e);return ps.set(e,n),n}function as(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
10
+ `)}var Oi,ki,Ai,ji=t((()=>{rt(),Oi=`</system-reminder>`,ki=new Set([Ie,Xe]),Ai=new WeakMap}));function Mi({pose:e=`default`}={}){return(0,Ni.jsxs)(l,{flexDirection:`column`,alignItems:`center`,children:[(0,Ni.jsx)(d,{color:`clawd_body`,children:` █████ `}),(0,Ni.jsx)(d,{color:`clawd_body`,children:`██ ● ● ██`}),(0,Ni.jsx)(d,{color:`clawd_body`,children:`██ ▄▄▄ ██`}),(0,Ni.jsx)(d,{color:`clawd_body`,children:` █ █ █ █ `})]})}var Ni,Pi=t((()=>{h(),y(),Ni=S()}));function Fi(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=c(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,c(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?c(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=c(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,c(r))),o}function Ii({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?c(e.timestamp):0));return(0,U.jsxs)(l,{flexDirection:`column`,width:t,children:[(0,U.jsx)(d,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(d,{dimColor:!0,italic:!0,children:Ot(i,t)})]}):r.length===0&&a?(0,U.jsx)(d,{dimColor:!0,children:Ot(a,t)}):(0,U.jsxs)(U.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,U.jsxs)(d,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(d,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(d,{children:Ot(e.text,r)})]},n)}),i&&(0,U.jsx)(d,{dimColor:!0,italic:!0,children:Ot(i,t)})]})]})}var U,Li=t((()=>{h(),y(),kt(),U=S()}));function Ri({feeds:e,maxWidth:t}){let n=e.map(e=>Fi(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Bi.jsx)(l,{flexDirection:`column`,children:e.map((t,n)=>(0,Bi.jsxs)(zi.Fragment,{children:[(0,Bi.jsx)(Ii,{config:t,actualWidth:i}),n<e.length-1&&(0,Bi.jsx)(s,{color:`claude`,width:i})]},n))})}var zi,Bi,Vi=t((()=>{zi=n(h(),1),y(),Li(),Bi=S()}));function Hi(e){let t=e.map(e=>{let t=At(e.modified);return{text:(e.summary&&e.summary!==`No prompt`?e.summary:e.firstPrompt)||``,timestamp:t}});return{title:`Recent activity`,lines:t,footer:t.length>0?`/resume for more`:void 0,emptyMessage:`No recent activity`}}function Ui(e){let t=e.map(e=>{if(process.env.USER_TYPE===`ant`){let t=e.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);if(t)return{timestamp:t[1],text:t[2]||``}}return{text:e}}),n=process.env.USER_TYPE===`ant`?`Unable to fetch latest claude-cli-internal commits`:`Check the Claude Code changelog for updates`;return{title:process.env.USER_TYPE===`ant`?`What's new [ANT-ONLY: Latest CC commits]`:`What's new`,lines:t,footer:t.length>0?`/release-notes for more`:void 0,emptyMessage:n}}function Wi(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${o.tick} `:``}${e}`})),n=ot()===Rn()?`Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.`:void 0;return n&&t.push({text:n}),{title:`Tips for getting started`,lines:t}}function Gi(){let e=Zt(),t=e?`Share Claude Code and earn ${$t(e)} of extra usage`:`Share Claude Code with friends`;return{title:`3 guest passes`,lines:[],customContent:{content:(0,Ki.jsxs)(Ki.Fragment,{children:[(0,Ki.jsx)(l,{marginY:1,children:(0,Ki.jsx)(d,{color:`claude`,children:`[✻] [✻] [✻]`})}),(0,Ki.jsx)(d,{dimColor:!0,children:t})]}),width:48},footer:`/passes`}}var Ki,qi=t((()=>{a(),y(),en(),at(),kt(),Ki=S()}));function Ji(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Yi(){let{pose:e,bounceOffset:t,onClick:n}=Xi();return(0,Qi.jsx)(l,{height:ia,flexDirection:`column`,onClick:n,children:(0,Qi.jsx)(l,{marginTop:t,flexShrink:0,children:(0,Qi.jsx)(Mi,{pose:e})})})}function Xi(){let[e]=(0,Zi.useState)(()=>_t().prefersReducedMotion??!1),[t,n]=(0,Zi.useState)(-1),r=(0,Zi.useRef)($i),i=()=>{e||t!==-1||(r.current=ea[Math.floor(Math.random()*ea.length)],n(0))};(0,Zi.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,na,ra);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:ta;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Zi,Qi,$i,ea,ta,na,ra,ia,aa=t((()=>{h(),Zi=n(h(),1),y(),gt(),Pi(),Qi=S(),$i=[...Ji(`default`,1,2),...Ji(`arms-up`,0,3),...Ji(`default`,0,1),...Ji(`default`,1,2),...Ji(`arms-up`,0,3),...Ji(`default`,0,1)],ea=[$i,[...Ji(`look-right`,0,5),...Ji(`look-left`,0,5),...Ji(`default`,0,1)]],ta={pose:`default`,offset:0},na=60,ra=e=>e+1,ia=3}));function oa(){let e=Qt();e==null||e<=0||e>(z().passesLastSeenRemaining??0)&&vt(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function sa(){let{eligible:e,hasCache:t}=tn();if(!e||!t)return!1;oa();let n=z();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function ca(){let[e]=(0,da.useState)(()=>sa());return e}function la(){let e=0;vt(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),Dt(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function ua(){let e=Zt();return(0,fa.jsxs)(d,{dimColor:!0,children:[(0,fa.jsx)(d,{color:`claude`,children:`[✻]`}),` `,(0,fa.jsx)(d,{color:`claude`,children:`[✻]`}),` `,(0,fa.jsx)(d,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${$t(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var da,fa,pa=t((()=>{h(),da=n(h(),1),y(),Et(),en(),yt(),fa=S()}));function ma(){let{columns:e}=v(),t=F(e=>e.agent),n=F(e=>e.effortValue),r=En(),i=Rt(r),{version:a,cwd:o,billingType:s,agentName:u}=vn(),f=t??u,p=ca(),m=Nn();(0,ha.useEffect)(()=>{p&&la()},[p]),(0,ha.useEffect)(()=>{m&&!p&&Mn()},[m,p]);let h=Math.max(e-15,20),g=Ot(a,Math.max(h-11,6)),{shouldSplit:_,truncatedModel:y,truncatedBilling:b}=yn(i+be(r,n),s,h),x=f?h-1-c(f)-3:h,S=mn(o,Math.max(x,10));return(0,W.jsx)(he,{children:(0,W.jsxs)(l,{flexDirection:`row`,gap:2,alignItems:`center`,children:[qe()?(0,W.jsx)(Yi,{}):(0,W.jsx)(Mi,{}),(0,W.jsxs)(l,{flexDirection:`column`,children:[(0,W.jsxs)(d,{children:[(0,W.jsx)(d,{bold:!0,children:`Work Mate`}),` `,(0,W.jsxs)(d,{dimColor:!0,children:[`v`,g]})]}),_?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(d,{dimColor:!0,children:y}),(0,W.jsx)(d,{dimColor:!0,children:b})]}):(0,W.jsxs)(d,{dimColor:!0,children:[y,` · `,b]}),(0,W.jsx)(d,{dimColor:!0,children:f?`@${f} · ${S}`:S}),p&&(0,W.jsx)(ua,{}),!p&&m&&(0,W.jsx)(Pn,{maxWidth:h,twoLine:!0})]})]})})}var ha,W,ga=t((()=>{ha=n(h(),1),Dn(),Be(),y(),We(),pe(),kt(),le(),xn(),Ut(),ve(),aa(),Pi(),pa(),An(),W=S()}));function _a(){let e=(0,ya.useMemo)(va,[]),t=(0,ya.useMemo)(()=>z().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,ya.useEffect)(()=>{n&&vt(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,ba.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,ba.jsx)(d,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function va(){return xa}var ya,ba,xa,Sa=t((()=>{h(),ya=n(h(),1),y(),yt(),ba=S(),xa={tip:``,color:`dim`}}));function Ca({char:e=`✻`}){let[t]=(0,wa.useState)(()=>_t().prefersReducedMotion??!1),[n,r]=(0,wa.useState)(t),i=(0,wa.useRef)(null),[a,o]=_(n?null:50);return(0,wa.useEffect)(()=>{if(n)return;let e=setTimeout(r,Da,!0);return()=>clearTimeout(e)},[n]),n?(0,Ta.jsx)(l,{ref:a,children:(0,Ta.jsx)(d,{color:Oa,children:e})}):(i.current===null&&(i.current=o),(0,Ta.jsx)(l,{ref:a,children:(0,Ta.jsx)(d,{color:oe(I((o-i.current)/Ea*360%360)),children:e})}))}var wa,Ta,Ea,Da,Oa,ka=t((()=>{h(),wa=n(h(),1),mt(),y(),gt(),Ge(),Ta=S(),Ea=1500,Da=Ea*2,Oa=oe({r:153,g:153,b:153})}));function Aa(){return Wt()&&(z().opus1mMergeNoticeSeenCount??0)<Pa}function ja(){let[e]=(0,Ma.useState)(Aa);return(0,Ma.useEffect)(()=>{if(!e)return;let t=(z().opus1mMergeNoticeSeenCount??0)+1;vt(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,Na.jsxs)(l,{paddingLeft:2,children:[(0,Na.jsx)(Ca,{char:`↑`}),(0,Na.jsx)(d,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var Ma,Na,Pa,Fa=t((()=>{h(),Ma=n(h(),1),mt(),y(),yt(),Ut(),ka(),Na=S(),Pa=6}));function Ia(){return null}var La=t((()=>{}));function Ra(){return null}var za=t((()=>{}));function Ba(){let e=pn(),t=z().oauthAccount?.displayName??``,{columns:n}=v(),i=an(),a=Ae.isSandboxingEnabled(),o=ca(),s=Nn(),u=F(e=>e.agent),f=F(e=>e.effortValue),p=z(),m;try{m=gn(3)}catch{m=[]}let[h]=(0,Va.useState)(()=>{let e=_t().companyAnnouncements;if(!(!e||e.length===0))return p.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:_}=dn(p.lastReleaseNotesSeen);(0,Va.useEffect)(()=>{z().lastReleaseNotesSeen!==`0.0.4`&&(vt(e=>e.lastReleaseNotesSeen===`0.0.4`?e:{...e,lastReleaseNotesSeen:`0.0.4`}),i&&rn())},[p,i]);let y=!_&&!i&&!r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Va.useEffect)(()=>{o&&!i&&!y&&la()},[o,i,y]),(0,Va.useEffect)(()=>{s&&!i&&!o&&!y&&Mn()},[s,i,o,y]);let b=En(),x=Rt(b),{version:S,cwd:C,billingType:w,agentName:T}=vn(),E=u??T,D=Ot(x+be(b,f),Ha-20);if(!_&&!i&&!r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ma,{}),(0,G.jsx)(ja,{}),lt()&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(d,{dimColor:!0,children:[`Logging to: `,dt()?`stderr`:ut()]})]}),(0,G.jsx)(_a,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(d,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(d,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),h&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&p.oauthAccount?.organizationName&&(0,G.jsxs)(d,{dimColor:!0,children:[`Message from `,p.oauthAccount.organizationName,`:`]}),(0,G.jsx)(d,{children:h})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(d,{dimColor:!0,children:[`API calls: `,Tt(N())]}),(0,G.jsxs)(d,{dimColor:!0,children:[`Debug logs: `,Tt(ut())]}),Nt()&&(0,G.jsxs)(d,{dimColor:!0,children:[`Startup Perf: `,Tt(Pt())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ia,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ra,{})]});let O=fn(n),k=Sn(z().theme),ee=` ${g(`claude`,k)(`Work Mate`)} ${g(`inactive`,k)(`v${S}`)} `,A=g(`claude`,k)(` Work Mate `);if(O===`compact`){let e=hn(t);c(e)>n-4&&(e=hn(null));let r=E?n-4-1-c(E)-3:n-4,i=mn(C,Math.max(r,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(he,{children:(0,G.jsxs)(l,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:A,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,G.jsx)(d,{bold:!0,children:e}),(0,G.jsx)(l,{marginY:1,children:(0,G.jsx)(Mi,{})}),(0,G.jsx)(d,{dimColor:!0,children:D}),(0,G.jsx)(d,{dimColor:!0,children:w}),(0,G.jsx)(d,{dimColor:!0,children:E?`@${E} · ${i}`:i})]})}),(0,G.jsx)(ja,{}),a&&(0,G.jsx)(l,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(d,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ia,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ra,{})]})}let j=hn(t),te=!process.env.IS_DEMO&&p.oauthAccount?.organizationName?`${D} · ${w} · ${p.oauthAccount.organizationName}`:`${D} · ${w}`,ne=E?Ha-1-c(E)-3:Ha,M=mn(C,Math.max(ne,10)),re=E?`@${E} · ${M}`:M,{leftWidth:P,rightWidth:ie}=bn(n,O,_n(j,re,te));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(he,{children:(0,G.jsx)(l,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:ee,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(l,{flexDirection:O===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(l,{flexDirection:`column`,width:P,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(l,{marginTop:1,children:(0,G.jsx)(d,{bold:!0,children:j})}),(0,G.jsx)(Mi,{}),(0,G.jsxs)(l,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(d,{dimColor:!0,children:te}),(0,G.jsx)(d,{dimColor:!0,children:re})]})]}),O===`horizontal`&&(0,G.jsx)(l,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),O===`horizontal`&&(0,G.jsx)(Ri,{feeds:i?[Wi(nn()),Hi(e)]:o?[Hi(e),Gi()]:s?[Hi(e),jn()]:[Hi(e),Ui(m)],maxWidth:ie})]})})}),(0,G.jsx)(ja,{}),lt()&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(d,{dimColor:!0,children:[`Logging to: `,dt()?`stderr`:ut()]})]}),(0,G.jsx)(_a,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(d,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(d,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),h&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&p.oauthAccount?.organizationName&&(0,G.jsxs)(d,{dimColor:!0,children:[`Message from `,p.oauthAccount.organizationName,`:`]}),(0,G.jsx)(d,{children:h})]}),a&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(d,{dimColor:!0,children:[`API calls: `,Tt(N())]}),(0,G.jsxs)(d,{dimColor:!0,children:[`Debug logs: `,Tt(ut())]}),Nt()&&(0,G.jsxs)(d,{dimColor:!0,children:[`Startup Perf: `,Tt(Pt())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ia,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ra,{})]})}var Va,G,Ha,Ua=t((()=>{h(),y(),Be(),xn(),kt(),wt(),Pi(),Vi(),qi(),yt(),Cn(),gt(),st(),Va=n(h(),1),on(),ga(),ve(),un(),ce(),i(),jt(),Sa(),Fa(),La(),za(),je(),pa(),An(),We(),pe(),Dn(),Ut(),G=S(),Ha=50}));function Wa({message:e,isTranscriptMode:t}){let n=e.message?.content,r=Array.isArray(n)?n:[];if(!(t&&e.type===`assistant`&&e.message?.model&&r.some(e=>e?.type===`text`)))return null;let i=e.message.model;return(0,Ga.jsx)(l,{minWidth:c(i)+8,children:(0,Ga.jsx)(d,{dimColor:!0,children:i})})}var Ga,Ka=t((()=>{h(),y(),Ga=S()}));function qa({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type===`assistant`&&Array.isArray(e.message.content)&&e.message.content.some(e=>e.type===`text`)))return null;let n=new Date(e.timestamp).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0});return(0,Ja.jsx)(l,{minWidth:c(n),children:(0,Ja.jsx)(d,{dimColor:!0,children:n})})}var Ja,Ya=t((()=>{h(),y(),Ja=S()}));function Xa(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=ro(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(fe(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&ro(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=ro(t.messages[0]?.message.content)?.input;if(fe(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function Za({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:u,onOpenRateLimitOptions:d,lastThinkingBlockId:f,latestBashOutputUUID:p,columns:m,isLoading:h,lookups:g,shouldCollapseDiffs:_}){let v=c===`transcript`,y=e.type===`grouped_tool_use`,b=e.type===`collapsed_read_search`,x=b&&(it(e,o)||h&&!n),S=y?e.displayMessage:b?ae(e):e,C=y||b?[]:Re(e,g),w=xs(e,s,o,y||b?T:ge(e,g),c,g),E=!1;if(u)if(y)E=e.messages.some(e=>{let t=ro(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(b)E=it(e,o);else{let t=ye(e);E=!t||o.has(t)}let D=v&&S.type===`assistant`&&Array.isArray(S.message.content)&&S.message.content.some(e=>e.type===`text`)&&(S.timestamp||S.message.model),O=(0,no.jsx)(ze,{message:e,lookups:g,addMargin:!D,containerWidth:D?void 0:m,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:C,shouldAnimate:E,shouldShowDot:!0,isTranscriptMode:v,isStatic:w,onOpenRateLimitOptions:d,isActiveCollapsedGroup:x,isUserContinuation:t,lastThinkingBlockId:f,latestBashOutputUUID:p,shouldCollapseDiffs:_});return D?(0,no.jsx)(he,{children:(0,no.jsxs)(l,{width:m,flexDirection:`column`,children:[(0,no.jsxs)(l,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,no.jsx)(qa,{message:S,isTranscriptMode:v}),(0,no.jsx)(Wa,{message:S,isTranscriptMode:v})]}),O]})}):(0,no.jsx)(he,{children:O})}function Qa(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=ro(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return we(e).some(e=>t.has(e));let n=ye(e);return!!n&&t.has(n)}function $a(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=ro(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return we(e).every(e=>t.has(e));if(e.type===`assistant`){let n=ro(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=ye(e);return!n||t.has(n)}function eo(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&D(t.message))return!1;let n=Qa(e.message,e.streamingToolUseIDs),r=$a(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var to,no,ro,io,ao=t((()=>{to=n(h(),1),y(),k(),rt(),Le(),no=S(),Ka(),Ms(),Ya(),ve(),ro=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},io=to.memo(Za,eo)}));function oo(e){return e.type===`attachment`&&so.has(e.attachment.type)}var so,co=t((()=>{so=new Set(`hook_success.hook_additional_context.hook_cancelled.command_permissions.agent_mention.budget_usd.critical_system_reminder.edited_image_file.edited_text_file.opened_file_in_ide.output_style.plan_mode.plan_mode_exit.plan_mode_reentry.structured_output.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.token_usage.ultrathink_effort.max_turns_reached.task_reminder.auto_mode.auto_mode_exit.output_token_usage.verify_plan_reminder.current_session_memory.compaction_reminder.date_change`.split(`.`))}));function lo(e){return _o.filter(t=>t.isActive(e))}var K,uo,fo,po,mo,ho,go,_o,vo=t((()=>{y(),h(),nt(),a(),at(),kt(),Ht(),In(),R(),re(),K=S(),uo={id:`large-memory-files`,type:`warning`,isActive:e=>ie(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:ie(e.memoryFiles).map(e=>{let t=e.path.startsWith(ot())?zn(ot(),e.path):e.path;return(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Large `,(0,K.jsx)(d,{bold:!0,children:t}),` will impact performance (`,Mt(e.content.length),` chars > `,Mt(_e),`)`,(0,K.jsx)(d,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},fo={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=Vt();return Bt()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=Vt();return(0,K.jsxs)(l,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},po={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=Lt({skipRetrievingKeyFromApiKeyHelper:!0});return!!zt()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=Lt({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(l,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},mo={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=Lt({skipRetrievingKeyFromApiKeyHelper:!0}),t=Vt();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=Lt({skipRetrievingKeyFromApiKeyHelper:!0}),t=Vt();return(0,K.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(l,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(d,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,K.jsxs)(d,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},ho={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Fn(e.agentDefinitions)>Ln,render:e=>{let t=Fn(e.agentDefinitions);return(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,Mt(t),` tokens > `,Mt(Ln),`)`,(0,K.jsx)(d,{dimColor:!0,children:` · /agents to manage`})]})]})}},go={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!me()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=te();return t!==null&&!Ee(t)},render:()=>{let e=ue(te());return(0,K.jsxs)(l,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,K.jsx)(d,{color:`ide`,children:o.arrowUp}),(0,K.jsxs)(d,{children:[`Install the `,(0,K.jsx)(d,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,K.jsx)(d,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},_o=[uo,ho,fo,po,mo,go]}));function yo({agentDefinitions:e}={}){let t={config:z(),agentDefinitions:e,memoryFiles:(0,xo.use)(L())},n=lo(t);return n.length===0?null:(0,So.jsx)(l,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,So.jsx)(bo.Fragment,{children:e.render(t)},e.id))})}var bo,xo,So,Co=t((()=>{bo=n(h(),1),xo=n(h(),1),y(),nt(),yt(),vo(),So=S()}));function wo(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??Mo,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/Oo);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,q.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??To);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-Do),w=b;else{if(y){let e=v+Eo;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-Eo;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*Eo,y=Math.min(b,C+Ao),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+Eo);)S+=r.current.get(t[w])??ko,w++}let e=v+2*Eo,n=Math.max(0,w-Ao),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??ko;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??ko;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-jo&&(C=e-jo),w>t+jo&&(w=t+jo),C>w&&(w=Math.min(C+jo,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let T=(0,q.useDeferredValue)(C),E=(0,q.useDeferredValue)(w),D=C<T?T:C,O=w>E?E:w;if((D>O||y)&&(D=C,O=w),_>0&&(O=w),O-D>Ao){let e=(x[D]+x[O])/2;g-m.current<e?O=D+Ao:D=O-Ao}let k=m.current,ee=x[D],A=D===0?0:ee+k,j=O===b?1/0:Math.max(ee,x[O]-v)+k;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(A,j)}),(0,q.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let te=(0,q.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),ne=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),M=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),N=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),re=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),P=S-x[O];return{range:[D,O],topSpacer:ee,bottomSpacer:P,measureRef:te,spacerRef:h,offsets:x,getItemTop:ne,getItemElement:M,getItemHeight:N,scrollToIndex:re}}var q,To,Eo,Do,Oo,ko,Ao,jo,Mo,No=t((()=>{q=n(h(),1),To=3,Eo=40,Do=30,Oo=20,ko=1,Ao=200,jo=25,Mo=()=>{}}));function Po({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,zo.jsx)(Vo.Provider,{value:n,children:(0,zo.jsx)(Uo.Provider,{value:i,children:(0,zo.jsx)(Bo.Provider,{value:t,children:(0,zo.jsx)(Ho.Provider,{value:r,children:e})})})})}function Fo(){return(0,J.useContext)(Bo)}function Io(){return(0,J.useContext)(Ho)}function Lo(e){let t=(0,J.useContext)(Vo);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Ro(e){let t=(0,J.useContext)(Uo);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,zo,Bo,Vo,Ho,Uo,Wo=t((()=>{J=n(h(),1),zo=S(),Bo=(0,J.createContext)(null),Vo=(0,J.createContext)(null),Ho=(0,J.createContext)(null),Uo=(0,J.createContext)(null)}));function Go(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function Ko(e,t){let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t.type===`progress`||t.type===`assistant`&&!qo(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function qo(e){if(e.type!==`assistant`||!Array.isArray(e.message.content))return!1;for(let t of e.message.content)if(typeof t!=`string`&&t.type===`text`&&t.text.trim()!==``)return!0;return!1}function Jo(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||oo(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=Ko(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function Yo({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:u=!1,newMessageCount:f=0,onPillClick:m}){let{rows:h,columns:g}=v(),[_,y]=(0,Y.useState)(null),b=(0,Y.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!qe())return;let e=p.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{cn(Bn(e))}catch{}else sn(e)},()=>{e.onHyperlinkClick=void 0}},[]),qe()){let s=u?null:_,p=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,X.jsxs)(Po,{children:[(0,X.jsx)(l,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(l,{flexDirection:`column`,flexGrow:1,width:g,overflow:`hidden`,children:[(0,X.jsxs)(l,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[p&&(0,X.jsx)(Zo,{text:p.text,onClick:p.scrollTo}),(0,X.jsxs)(x,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,X.jsx)(ts,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,X.jsx)(Xo,{count:f,onClick:m}),r!=null&&(0,X.jsx)(l,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(l,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(Qo,{}),(0,X.jsx)($o,{}),(0,X.jsx)(l,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(kn,{value:{rows:h-es-1,columns:g-4,scrollRef:a??null},children:(0,X.jsxs)(l,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:h-es,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(l,{flexShrink:0,children:(0,X.jsx)(d,{color:`permission`,children:`▔`.repeat(g)})}),(0,X.jsx)(l,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function Xo({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(l,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(l,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(d,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${Ft(e,`message`)}`:`Jump to bottom`,` `,o.arrowDown,` `]})})})}function Zo({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(l,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(d,{color:`subtle`,wrap:`truncate-end`,children:[o.pointer,` `,e]})})}function Qo(){let e=Fo();return!e||e.suggestions.length===0?null:(0,X.jsx)(l,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(wn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function $o(){let e=Io();return e?(0,X.jsx)(l,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,es,ts,ns=t((()=>{a(),Y=n(h(),1),On(),Wo(),Be(),y(),ln(),le(),It(),co(),Tn(),X=S(),es=2,ts=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function rs(e){let t=ds.get(e);if(t!==void 0)return t;let n=wi(e);return ds.set(e,n),n}function is(e){let t=ps.get(e);if(t!==void 0)return t;let n=as(e);return ps.set(e,n),n}function as(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
11
11
  `)}if(t===null)return null;let n=A(t);return n.startsWith(`<`)||n===``?null:n}function os({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:d,renderItem:f}){return(0,ls.jsx)(l,{ref:r(e),flexDirection:`column`,backgroundColor:i?`userMessageBackgroundHover`:void 0,paddingBottom:i?1:void 0,onClick:o?e=>s(t,e.cellIsBlank):void 0,onMouseEnter:o?()=>c(e):void 0,onMouseLeave:o?()=>d(e):void 0,children:(0,ls.jsx)(u.Provider,{value:a&&!i?`text`:void 0,children:f(t,n)})})}function ss({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=rs,trackStickyPrompt:u,selectedIndex:d,cursorNavRef:f,setCursor:p,jumpRef:m,onSearchMatchesChange:h,scanElement:g,setPositions:_}){let v=(0,Z.useRef)([]),y=(0,Z.useRef)(e),b=(0,Z.useRef)(r);if(b.current!==r||e.length<v.current.length||e[0]!==y.current[0])v.current=e.map(e=>r(e));else for(let t=v.current.length;t<e.length;t++)v.current.push(r(e[t]));y.current=e,b.current=r;let x=v.current,{range:S,topSpacer:C,bottomSpacer:w,measureRef:T,spacerRef:E,offsets:D,getItemTop:O,getItemElement:k,getItemHeight:ee,scrollToIndex:A}=wo(t,x,n),[j,te]=S,ne=(0,Z.useCallback)(t=>ee(t)!==0&&Te(e[t]),[ee,e]);(0,Z.useImperativeHandle)(f,()=>{let n=e=>p?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:$e(e)?.name}),r=d??-1,i=(t,r,i=ne)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>ne(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),p?.(null))},navigatePrevUser:()=>i(r-1,-1,a),navigateNextUser:()=>i(r+1,1,a),navigateTop:()=>i(0,1),navigateBottom:()=>i(e.length-1,-1),getSelected:()=>r>=0?e[r]??null:null}},[e,d,p,ne]);let M=(0,Z.useRef)({offsets:D,start:j,getItemElement:k,getItemTop:O,messages:e,scrollToIndex:A});M.current={offsets:D,start:j,getItemElement:k,getItemTop:O,messages:e,scrollToIndex:A},(0,Z.useEffect)(()=>{if(d===void 0)return;let e=M.current,n=e.getItemElement(d);n?t.current?.scrollToElement(n,1):e.scrollToIndex(d)},[d,t]);let N=(0,Z.useRef)(null),re=(0,Z.useRef)({msgIdx:-1,positions:[]}),P=(0,Z.useRef)(-1),ie=(0,Z.useRef)(0),ae=(0,Z.useRef)(0),F=(0,Z.useRef)(()=>{}),oe=(0,Z.useRef)(()=>{}),se=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),I=(0,Z.useRef)(-1),ce=(0,Z.useRef)(!1);function le(e){let t=M.current.getItemTop(e);return Math.max(0,t-us)}function L(e){let n=t.current,{msgIdx:r,positions:i}=re.current;if(!n||i.length===0||r<0){_?.(null);return}let a=Math.max(0,Math.min(e,i.length-1)),o=i[a],s=M.current.getItemTop(r),c=n.getViewportTop(),l=s-n.getScrollTop(),u=n.getViewportHeight(),d=c+l+o.row;(d<c||d>=c+u)&&(n.scrollTo(Math.max(0,s+o.row-us)),l=s-n.getScrollTop(),d=c+l+o.row),_?.({positions:i,rowOffset:c+l,currentIdx:a});let f=se.current,p=f.prefixSum.at(-1)??0,m=(f.prefixSum[f.ptr]??0)+a+1;h?.(p,m),ct(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${m}/${p}`)}oe.current=L;let[ue,de]=(0,Z.useState)(0),fe=(0,Z.useCallback)(()=>de(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=N.current;if(!e)return;let{idx:n,wantLast:r,tries:i}=e,a=t.current;if(!a)return;let{getItemElement:o,getItemTop:s,scrollToIndex:c}=M.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){N.current=null,ct(`seek(i=${n}): no mount after scrollToIndex, skip`),F.current(r?-1:1);return}N.current={idx:n,wantLast:r,tries:i+1},c(n),fe();return}N.current=null,a.scrollTo(Math.max(0,s(n)-us));let d=g?.(l)??[];if(re.current={msgIdx:n,positions:d},ct(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++ie.current>20){ie.current=0;return}F.current(r?-1:1);return}ie.current=0;let f=r?d.length-1:0;se.current.screenOrd=f,P.current=-1,oe.current(f);let p=ae.current;p&&(ae.current=0,F.current(p))},[ue]);function pe(e,n){let r=t.current;if(!r)return;let i=M.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;_?.(null),re.current={msgIdx:-1,positions:[]},N.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(le(e)):o(e),fe()}function me(e){let t=se.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(N.current){ae.current=e;return}P.current<0&&(P.current=t.ptr);let{positions:a}=re.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,L(o),P.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===P.current){_?.(null),P.current=-1,ct(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,pe(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;h?.(i,c)}F.current=me,(0,Z.useImperativeHandle)(m,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(le(e))},setSearchQuery:e=>{N.current=null,re.current={msgIdx:-1,positions:[]},P.current=-1,_?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=M.current.messages;for(let t=0;t<e.length;t++){let a=c(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:l,start:u,getItemTop:d}=M.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=I.current>=0?I.current:s.getScrollTop(),n=1/0;for(let e=0;e<r.length;e++){let i=Math.abs(p+l[r[e]]-t);i<=n&&(n=i,o=e)}ct(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}se.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?pe(r[o],!0):I.current>=0&&s&&s.scrollTo(I.current),h?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>me(1),prevMatch:()=>me(-1),setAnchor:()=>{let e=t.current;e&&(I.current=e.getScrollTop())},disarmSearch:()=>{_?.(null),N.current=null,re.current={msgIdx:-1,positions:[]},P.current=-1},warmSearchIndex:async()=>{if(ce.current)return 0;let e=M.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await Kt(0);let r=performance.now(),i=Math.min(n+500,e.length);for(let t=n;t<i;t++)c(e[t]);t+=performance.now()-r}let r=Math.round(performance.now()-n);return ct(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),ce.current=!0,Math.round(t)}}),[t]);let[he,ge]=(0,Z.useState)(null),_e=(0,Z.useRef)({onItemClick:a,setHoveredKey:ge});_e.current={onItemClick:a,setHoveredKey:ge};let ve=(0,Z.useCallback)((e,t)=>{let n=_e.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),ye=(0,Z.useCallback)(e=>{_e.current.setHoveredKey(e)},[]),be=(0,Z.useCallback)(e=>{_e.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,ls.jsxs)(ls.Fragment,{children:[(0,ls.jsx)(l,{ref:E,height:C,flexShrink:0}),e.slice(j,te).map((e,t)=>{let n=j+t,r=x[n],c=!!a&&(o?.(e)??!0),l=c&&he===r,u=s?.(e);return(0,ls.jsx)(os,{itemKey:r,msg:e,idx:n,measureRef:T,expanded:u,hovered:l,clickable:c,onClickK:ve,onEnterK:ye,onLeaveK:be,renderItem:i},r)}),w>0&&(0,ls.jsx)(l,{height:w,flexShrink:0}),u&&(0,ls.jsx)(cs,{messages:e,start:j,end:te,offsets:D,getItemTop:O,getItemElement:k,scrollRef:t})]})}function cs({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(ts);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??ms,[o]),()=>{let e=o.current;if(!e)return NaN;let t=e.getScrollTop()+e.getPendingDelta();return e.isSticky()?-1-t:t});let c=o.current?.isSticky()??!0,l=Math.max(0,(o.current?.getScrollTop()??0)+(o.current?.getPendingDelta()??0)),u=t,d=-1;for(let e=n-1;e>=t;e--){let t=i(e);if(t>=0){if(t<l)break;d=t}u=e}let f=-1,p=null;if(u>0&&!c)for(let t=u-1;t>=0;t--){let n=is(e[t]);if(n===null)continue;let r=i(t);if(!(r>=0&&r+1>=l)){f=t,p=n;break}}let m=d>=0?d-r[u]:0,h=f>=0?Math.max(0,m+r[f]):-1,g=(0,Z.useRef)({idx:-1,tries:0}),_=(0,Z.useRef)(`none`),v=(0,Z.useRef)(-1);return(0,Z.useEffect)(()=>{if(g.current.idx>=0)return;if(_.current===`armed`){_.current=`force`;return}let e=_.current===`force`;if(_.current=`none`,!e&&v.current===f)return;if(v.current=f,p===null){s(null);return}let t=p.trimStart(),n=t.search(/\n\s*\n/),r=(n>=0?t.slice(0,n):t).slice(0,fs).replace(/\s+/g,` `).trim();if(r===``){s(null);return}let i=f,c=h;s({text:r,scrollTo:()=>{s(`clicked`),_.current=`armed`;let e=a(i);e?o.current?.scrollToElement(e,1):(o.current?.scrollTo(c),g.current={idx:i,tries:0})}})}),(0,Z.useEffect)(()=>{if(g.current.idx<0)return;let e=a(g.current.idx);e?(o.current?.scrollToElement(e,1),g.current={idx:-1,tries:0}):++g.current.tries>5&&(g.current={idx:-1,tries:0})}),null}var Z,ls,us,ds,fs,ps,ms,hs=t((()=>{h(),Z=n(h(),1),No(),y(),de(),ns(),ls=S(),st(),Gt(),ji(),et(),us=3,ds=new WeakMap,fs=500,ps=new WeakMap,ms=()=>{}}));function gs(e,t){let n=new Set(t),r=new Set;return e.filter(e=>{if(e.type===`system`)return e.subtype!==`api_metrics`;let t=e.message?.content[0];if(e.type===`assistant`)return e.isApiErrorMessage?!0:t?.type===`tool_use`&&t.name&&n.has(t.name)?(`id`in t&&r.add(t.id),!0):!1;if(e.type===`user`)return t?.type===`tool_result`?t.tool_use_id!==void 0&&r.has(t.tool_use_id):!e.isMeta;if(e.type===`attachment`){let t=e.attachment;return t?.type===`queued_command`&&t.commandMode===`prompt`&&!t.isMeta&&t.origin===void 0}return!1})}function _s(e,t){let n=new Set(t),r=new Set,i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t],s=o.message?.content[0];if(o.type===`user`&&s?.type!==`tool_result`&&!o.isMeta){a++;continue}o.type===`assistant`&&(s?.type===`text`?i[t]=a:s?.type===`tool_use`&&s.name&&n.has(s.name)&&r.add(a))}return r.size===0?e:e.filter((e,t)=>{let n=i[t];return n===void 0||!r.has(n)})}function vs(e,t,n=Os,r=ks){let i=t.current,a=i?e.findIndex(e=>e.uuid===i.uuid):-1,o=a>=0?a:i?Math.min(i.idx,Math.max(0,e.length-n)):0;e.length-o>n+r&&(o=e.length-n);let s=e[o];return s&&(i?.uuid!==s.uuid||i.idx!==o)?t.current={uuid:s.uuid,idx:o}:!s&&i&&(t.current=null),o}function ys(e){return(e.type===`assistant`||e.type===`user`?ye(e):null)??e.uuid}function bs(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function xs(e,t,n,r,i,a){if(i===`transcript`)return!0;switch(e.type){case`attachment`:case`user`:case`assistant`:{if(e.type===`assistant`){let t=e.message.content[0];if(t?.type===`server_tool_use`)return a.resolvedToolUseIDs.has(t.id)}let i=ye(e);return i?t.has(i)||n.has(i)||Ce(i,`PostToolUse`,a)?!1:di(r,a.resolvedToolUseIDs):!0}case`system`:return e.subtype!==`api_error`;case`grouped_tool_use`:return e.messages.every(e=>{let t=e.message.content[0];return t?.type===`tool_use`&&a.resolvedToolUseIDs.has(t.id)});case`collapsed_read_search`:return!1;default:return!0}}var Ss,Q,$,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms=t((()=>{m(),Ss=n(h(),1),Q=n(h(),1),fi(),w(),mt(),Be(),y(),j(),Jt(),tt(),hi(),vi(),k(),yt(),i(),le(),Ci(),rt(),It(),ji(),Ua(),Ve(),ao(),et(),He(),co(),ve(),Co(),$=S(),hs(),Cs=Ss.memo(function({agentDefinitions:e}){return(0,$.jsx)(he,{children:(0,$.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(Ba,{}),(0,$.jsx)(Ss.Suspense,{fallback:null,children:(0,$.jsx)(yo,{agentDefinitions:e})})]})})}),ws=(Xt(),e(Yt)),Ts=(ft(),e(pt)).BRIEF_TOOL_NAME,Es=(se(),e(Oe)).SEND_USER_FILE_TOOL_NAME,Ds=30,Os=200,ks=50,As=({messages:e,tools:t,commands:n,verbose:i,toolJSX:a,toolUseConfirmQueue:o,inProgressToolUseIDs:c,isMessageSelectorVisible:u,conversationId:p,screen:m,streamingToolUses:h,showAllInTranscript:g=!1,agentDefinitions:_,onOpenRateLimitOptions:y,hideLogo:x=!1,isLoading:S,hidePastThinking:w=!1,streamingThinking:T,streamingText:D,isBriefOnly:k=!1,unseenDivider:A,scrollRef:j,trackStickyPrompt:te,jumpRef:ne,onSearchMatchesChange:N,scanElement:re,setPositions:ie,disableRenderCap:ae=!1,cursor:F=null,setCursor:oe,cursorNavRef:se,renderRange:I})=>{let{columns:ce}=v(),le=xe(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),L=(0,Q.useMemo)(()=>Ke(e).filter(P),[e]),ue=(0,Q.useMemo)(()=>T?T.isStreaming?!0:T.streamingEndedAt?Date.now()-T.streamingEndedAt<3e4:!1:!1,[T]),{lastThinkingBlockId:de,latestBashOutputUUID:fe}=(0,Q.useMemo)(()=>{let e=null,t=null,n=w&&!ue;w&&ue&&(e=`streaming`);for(let r=L.length-1;r>=0;r--){let i=L[r];if(i?.type===`user`){let r=i.message.content;if(!t){for(let e of r)if(e.type===`text`){let n=e.text??``;if(n.startsWith(`<bash-stdout`)||n.startsWith(`<bash-stderr`)){t=i.uuid;break}}}n&&!e&&(r.some(e=>e.type===`tool_result`)||(e=`no-thinking`))}else if(i?.type===`assistant`&&n&&!e){let t=i.message.content;for(let n=t.length-1;n>=0;n--)if(t[n]?.type===`thinking`){e=`${i.uuid}:${n}`;break}}if(e!==null&&t)break}return w||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[L,w,ue]),pe=(0,Q.useMemo)(()=>Se(L),[L]),me=(0,Q.useMemo)(()=>h.filter(e=>!c.has(e.contentBlock.id)&&!pe.has(e.contentBlock.id)),[h,c,pe]),he=(0,Q.useMemo)(()=>me.flatMap(e=>{let t=Ue({content:[e.contentBlock]});return t.uuid=ee(e.contentBlock.id,0),Ke([t])}),[me]),ge=m===`transcript`,_e=(0,Q.useMemo)(()=>r(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),ve=j!=null&&!_e,ye=ge&&!g&&!ve,be=(0,Q.useRef)(null),R=(0,Q.useRef)(null),{collapsed:Ce,lookups:we,hasTruncatedMessages:Te,hiddenMessageCount:Ee}=(0,Q.useMemo)(()=>{let e=De((i||qe()?L:O(L,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!oo(e)&&ke(e,ge)),he),n=[Ts,Es].filter(e=>e!==null),r=[Ts].filter(e=>e!==null),a=n.length>0&&!ge?k?gs(e,n):r.length>0?_s(e,r):e:e,o=ye?a.slice(-30):a,s=ye&&a.length>Ds,{messages:c}=xi(o,t,i),l=mi(_i(M(c,t)),i),u=Fe(L,o),d=(()=>{let e=o.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),f;if(R.current&&R.current.key===u)f=R.current.lookups;else if(R.current&&L.length>=R.current.normalizedCount&&o.length>=R.current.messageCount&&R.current.lastAssistantMsgId===d){let e=E(R.current.lookups,R.current.normalizedCount,R.current.messageCount,L,o);e?(f=e,R.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d}):(f=Je(L,o),R.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d})}else f=Je(L,o),R.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d};let p=e.length-Ds;return{collapsed:l,lookups:f,hasTruncatedMessages:s,hiddenMessageCount:p}},[i,L,ge,he,ye,t,k]),Oe=(0,Q.useMemo)(()=>{let e=!ve&&!ae?vs(Ce,be):0;return I?Ce.slice(I[0],I[1]):e>0?Ce.slice(e):Ce},[Ce,I,ve,ae]),Ae=(0,Q.useMemo)(()=>new Set(h.map(e=>e.contentBlock.id)),[h]),{dividerBeforeIndex:je,selectedIdx:Ie}=(0,Q.useMemo)(()=>{if(!A&&!F)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=A?.firstUnseenUuid.slice(0,24);for(let r=0;r<Oe.length;r++){let i=Oe[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&F&&i.uuid===F.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[A,F,Oe]),[Le,Re]=(0,Q.useState)(()=>new Set),ze=(0,Q.useCallback)(e=>{let t=ys(e);Re(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),Be=(0,Q.useCallback)(e=>Le.size>0&&Le.has(ys(e)),[Le]),Ve=(0,Q.useRef)(we);Ve.current=we;let He=(0,Q.useCallback)(e=>{if(e.type===`collapsed_read_search`)return!0;if(e.type===`assistant`){let t=e.message.content,n=Array.isArray(t)?t[0]:void 0;return n!=null&&Me(n)&&n.type===`advisor_tool_result`&&n.content.type===`advisor_result`}if(e.type!==`user`)return!1;let n=e.message.content[0];if(n?.type!==`tool_result`||n.is_error||!e.toolUseResult)return!1;let r=Ve.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?qt(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),We=(!a||!!a.shouldContinueAnimation)&&!o.length&&!u,Ge=c.size>0,{progress:Xe}=f(),Qe=(0,Q.useRef)(null),$e=z().terminalProgressBarEnabled&&!C()&&!(ws?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=$e?Ge?`indeterminate`:`completed`:null;Qe.current!==e&&(Qe.current=e,Xe(e))},[Xe,$e,Ge]),(0,Q.useEffect)(()=>()=>Xe(null),[Xe]);let et=(0,Q.useCallback)(e=>`${e.uuid}-${p}`,[p]),tt=(e,r)=>{let a=r>0?Oe[r-1]?.type:void 0,o=e.type===`user`&&a===`user`,u=e.type===`collapsed_read_search`&&(!!D||Xa(Oe,r,t,Ae)),d=Oe.length-1-r>0,f=et(e),p=(0,$.jsx)(io,{message:e,isUserContinuation:o,hasContentAfter:u,tools:t,commands:n,verbose:i||Be(e)||F?.expanded===!0&&r===Ie,inProgressToolUseIDs:c,streamingToolUseIDs:Ae,screen:m,canAnimate:We,onOpenRateLimitOptions:y,lastThinkingBlockId:de,latestBashOutputUUID:fe,columns:ce,isLoading:S,lookups:we,shouldCollapseDiffs:d},f),h=(0,$.jsx)(Ne.Provider,{value:r===Ie,children:p},f);return A&&r===je?[(0,$.jsx)(l,{marginTop:1,children:(0,$.jsx)(s,{title:`${A.count} new ${Ft(A.count,`message`)}`,width:ce,color:`inactive`})},`unseen-divider`),h]:h},nt=(0,Q.useRef)(new WeakMap),rt=(0,Q.useCallback)(e=>{let n=nt.current.get(e);if(n!==void 0)return n;let r=wi(e);if(e.type===`user`&&e.toolUseResult&&Array.isArray(e.message.content)){let n=e.message.content.find(e=>e.type===`tool_result`);if(n&&`tool_use_id`in n){let i=we.toolUseByToolUseID.get(n.tool_use_id),a=(i&&qt(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return nt.current.set(e,i),i},[t,we]);return(0,$.jsxs)($.Fragment,{children:[!x&&!(I&&I[0]>0)&&(0,$.jsx)(Cs,{agentDefinitions:_}),Te&&(0,$.jsx)(s,{title:`${le} to show ${b.bold(Ee)} previous messages`,width:ce}),ge&&g&&Ee>0&&!ae&&(0,$.jsx)(s,{title:`${le} to hide ${b.bold(Ee)} previous messages`,width:ce}),ve?(0,$.jsx)(Ze.Provider,{value:!0,children:(0,$.jsx)(ss,{messages:Oe,scrollRef:j,columns:ce,itemKey:et,renderItem:tt,onItemClick:ze,isItemClickable:He,isItemExpanded:Be,trackStickyPrompt:te,selectedIndex:Ie>=0?Ie:void 0,cursorNavRef:se,setCursor:oe,jumpRef:ne,onSearchMatchesChange:N,scanElement:re,setPositions:ie,extractSearchText:rt})}):Oe.flatMap(tt),D&&!k&&(0,$.jsx)(l,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(l,{flexDirection:`row`,children:[(0,$.jsx)(l,{minWidth:2,children:(0,$.jsx)(d,{color:`text`,children:ht})}),(0,$.jsx)(l,{flexDirection:`column`,children:(0,$.jsx)(Pe,{children:D})})]})}),ue&&T&&!k&&(0,$.jsx)(l,{marginTop:1,children:(0,$.jsx)(Ye,{param:{type:`thinking`,thinking:T.thinking},addMargin:!1,isTranscriptMode:!0,verbose:i,hideInTranscript:!1})})]})},js=Ss.memo(As,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(r===`onOpenRateLimitOptions`||r===`scrollRef`||r===`trackStickyPrompt`||r===`setCursor`||r===`cursorNavRef`||r===`jumpRef`||r===`onSearchMatchesChange`||r===`scanElement`||r===`setPositions`)&&e[r]!==t[r]){if(r===`streamingToolUses`){let n=e.streamingToolUses,r=t.streamingToolUses;if(n.length===r.length&&n.every((e,t)=>e.contentBlock===r[t]?.contentBlock))continue}if(r===`inProgressToolUseIDs`&&bs(e.inProgressToolUseIDs,t.inProgressToolUseIDs))continue;if(r===`unseenDivider`){let n=e.unseenDivider,r=t.unseenDivider;if(n?.firstUnseenUuid===r?.firstUnseenUuid&&n?.count===r?.count)continue}if(r===`tools`){let n=e.tools,r=t.tools;if(n.length===r.length&&n.every((e,t)=>e.name===r[t]?.name))continue}return!1}return!0})}));export{ns as a,Lo as c,ui as d,Jo as i,Ro as l,Ms as n,Go as o,Yo as r,Wo as s,js as t,li as u};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,o as n}from"./envUtils-DSxRz_kt.js";import{Gt as r,H as i,I as a,Lt as o,P as s,fi as c,kt as l,t as u}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{Ix as f,Lx as p,_x as m,vx as h,zb as g}from"./loadAgentsDir-DrDu5yYy.js";import{Jt as _,Zt as v}from"./settings-DfWP5y6X.js";import{g as y,s as b}from"./config-DiT2Z8dY.js";import{n as x,r as S}from"./analytics-BotDBGh0.js";import{Ar as C,Ut as w,Vt as T,kr as E}from"./model-fi472PRc.js";import{u as D}from"./referral-DrebVwqx.js";import{c as O,i as k,s as A}from"./terminalSetup-BNs9nLbT.js";import{t as j}from"./WelcomeV2-C93xQYAF.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";import{n as P,t as F}from"./ThemePicker-BTfuZZ7E.js";import{n as I,t as L}from"./PressEnterToContinue-Dl9Hg9Mf.js";import{t as R}from"./ApproveApiKey-36iUE5CW.js";n();var z=e(c(),1),B=d();x(),v(),y(),E(),T(),D(),k(),N(),u(),u(),g(),p(),h(),P(),I(),u();var V=(0,z.createContext)({marker:``});function H({children:e}){let{marker:t}=(0,z.useContext)(V);return(0,B.jsxs)(a,{gap:1,children:[(0,B.jsx)(s,{dimColor:!0,children:t}),(0,B.jsx)(a,{flexDirection:`column`,children:e})]})}u();var U=(0,z.createContext)({marker:``});function W({children:e}){let{marker:t}=(0,z.useContext)(U),n=0;for(let t of z.Children.toArray(e))!(0,z.isValidElement)(t)||t.type!==H||n++;let r=String(n).length;return(0,B.jsx)(a,{flexDirection:`column`,children:z.Children.map(e,(e,n)=>{if(!(0,z.isValidElement)(e)||e.type!==H)return e;let i=`${String(n+1).padStart(r)}.`,a=`${t}${i}`;return(0,B.jsx)(U.Provider,{value:{marker:a},children:(0,B.jsx)(V.Provider,{value:{marker:a},children:e})})})})}W.Item=H;var G=W;u();function K({onDone:e}){let[n,c]=(0,z.useState)(0),[u,d]=(0,z.useState)(!1),[p]=(0,z.useState)(()=>w()),[h,g]=i();(0,z.useEffect)(()=>{S(`tengu_began_setup`,{oauthEnabled:p})},[p]);function v(){if(n<N.length-1){let e=n+1;c(e),S(`tengu_onboarding_step`,{oauthEnabled:p,stepId:N[e]?.id})}else e()}function y(e){g(e),v()}let x=M(),T=(0,B.jsx)(a,{marginX:1,children:(0,B.jsx)(F,{onThemeSelect:y,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),E=(0,B.jsxs)(a,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Before you start, keep in mind:`}),(0,B.jsx)(a,{flexDirection:`column`,width:70,children:(0,B.jsxs)(G,{children:[(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Always review changes before accepting`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,B.jsx)(l,{}),`or editing files. You stay in control of every action.`,(0,B.jsx)(l,{})]})]}),(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Only use Claude Code on projects you trust`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,B.jsx)(l,{}),(0,B.jsx)(o,{url:`https://code.claude.com/docs/en/security`})]})]})]})}),(0,B.jsx)(L,{})]}),D=(0,z.useMemo)(()=>{if(!process.env.ANTHROPIC_API_KEY||t())return``;let e=C(process.env.ANTHROPIC_API_KEY);if(b(e)===`new`)return e},[]);function k(e){e&&d(!0),v()}let N=[];N.push({id:`theme`,component:T}),D&&N.push({id:`api-key`,component:(0,B.jsx)(R,{customApiKeyTruncated:D,onDone:k})}),p&&N.push({id:`oauth`,component:(0,B.jsx)(q,{skip:u,onSkip:v,children:(0,B.jsx)(f,{onDone:v})})}),N.push({id:`security`,component:E}),O()&&N.push({id:`terminal-setup`,component:(0,B.jsxs)(a,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,B.jsxs)(a,{flexDirection:`column`,width:70,gap:1,children:[(0,B.jsxs)(s,{children:[`For the optimal coding experience, enable the recommended settings`,(0,B.jsx)(l,{}),`for your terminal:`,` `,_.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,B.jsx)(m,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?A(h).catch(()=>{}).finally(v):v()},onCancel:()=>v()}),(0,B.jsx)(s,{dimColor:!0,children:x.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,x.keyName,` again to exit`]}):(0,B.jsx)(B.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let P=N[n],I=(0,z.useCallback)(()=>{n===N.length-1?e():v()},[n,N.length,p,e]),V=(0,z.useCallback)(()=>{v()},[n,N.length,p,e]);return r({"confirm:yes":I},{context:`Confirmation`,isActive:P?.id===`security`}),r({"confirm:no":V},{context:`Confirmation`,isActive:P?.id===`terminal-setup`}),(0,B.jsxs)(a,{flexDirection:`column`,children:[(0,B.jsx)(j,{}),(0,B.jsxs)(a,{flexDirection:`column`,marginTop:1,children:[P?.component,x.pending&&(0,B.jsx)(a,{padding:1,children:(0,B.jsxs)(s,{dimColor:!0,children:[`Press `,x.keyName,` again to exit`]})})]})]})}function q({skip:e,onSkip:t,children:n}){return(0,z.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{K as Onboarding};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,o as n}from"./envUtils-DSxRz_kt.js";import{Gt as r,H as i,I as a,Lt as o,P as s,fi as c,kt as l,t as u}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{Ix as f,Lx as p,_x as m,vx as h,zb as g}from"./loadAgentsDir-BURvZNN6.js";import{Jt as _,Zt as v}from"./settings-DfWP5y6X.js";import{g as y,s as b}from"./config-DiT2Z8dY.js";import{n as x,r as S}from"./analytics-BotDBGh0.js";import{Ar as C,Ut as w,Vt as T,kr as E}from"./model-BIVmcl_N.js";import{u as D}from"./referral-UKJv23_5.js";import{c as O,i as k,s as A}from"./terminalSetup-BNs9nLbT.js";import{t as j}from"./WelcomeV2-DNiXQ5ES.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js";import{n as P,t as F}from"./ThemePicker-CqPCp5Hs.js";import{n as I,t as L}from"./PressEnterToContinue-Dl9Hg9Mf.js";import{t as R}from"./ApproveApiKey-9YQzwrrC.js";n();var z=e(c(),1),B=d();x(),v(),y(),E(),T(),D(),k(),N(),u(),u(),g(),p(),h(),P(),I(),u();var V=(0,z.createContext)({marker:``});function H({children:e}){let{marker:t}=(0,z.useContext)(V);return(0,B.jsxs)(a,{gap:1,children:[(0,B.jsx)(s,{dimColor:!0,children:t}),(0,B.jsx)(a,{flexDirection:`column`,children:e})]})}u();var U=(0,z.createContext)({marker:``});function W({children:e}){let{marker:t}=(0,z.useContext)(U),n=0;for(let t of z.Children.toArray(e))!(0,z.isValidElement)(t)||t.type!==H||n++;let r=String(n).length;return(0,B.jsx)(a,{flexDirection:`column`,children:z.Children.map(e,(e,n)=>{if(!(0,z.isValidElement)(e)||e.type!==H)return e;let i=`${String(n+1).padStart(r)}.`,a=`${t}${i}`;return(0,B.jsx)(U.Provider,{value:{marker:a},children:(0,B.jsx)(V.Provider,{value:{marker:a},children:e})})})})}W.Item=H;var G=W;u();function K({onDone:e}){let[n,c]=(0,z.useState)(0),[u,d]=(0,z.useState)(!1),[p]=(0,z.useState)(()=>w()),[h,g]=i();(0,z.useEffect)(()=>{S(`tengu_began_setup`,{oauthEnabled:p})},[p]);function v(){if(n<N.length-1){let e=n+1;c(e),S(`tengu_onboarding_step`,{oauthEnabled:p,stepId:N[e]?.id})}else e()}function y(e){g(e),v()}let x=M(),T=(0,B.jsx)(a,{marginX:1,children:(0,B.jsx)(F,{onThemeSelect:y,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),E=(0,B.jsxs)(a,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Before you start, keep in mind:`}),(0,B.jsx)(a,{flexDirection:`column`,width:70,children:(0,B.jsxs)(G,{children:[(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Always review changes before accepting`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,B.jsx)(l,{}),`or editing files. You stay in control of every action.`,(0,B.jsx)(l,{})]})]}),(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Only use Claude Code on projects you trust`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,B.jsx)(l,{}),(0,B.jsx)(o,{url:`https://code.claude.com/docs/en/security`})]})]})]})}),(0,B.jsx)(L,{})]}),D=(0,z.useMemo)(()=>{if(!process.env.ANTHROPIC_API_KEY||t())return``;let e=C(process.env.ANTHROPIC_API_KEY);if(b(e)===`new`)return e},[]);function k(e){e&&d(!0),v()}let N=[];N.push({id:`theme`,component:T}),D&&N.push({id:`api-key`,component:(0,B.jsx)(R,{customApiKeyTruncated:D,onDone:k})}),p&&N.push({id:`oauth`,component:(0,B.jsx)(q,{skip:u,onSkip:v,children:(0,B.jsx)(f,{onDone:v})})}),N.push({id:`security`,component:E}),O()&&N.push({id:`terminal-setup`,component:(0,B.jsxs)(a,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,B.jsxs)(a,{flexDirection:`column`,width:70,gap:1,children:[(0,B.jsxs)(s,{children:[`For the optimal coding experience, enable the recommended settings`,(0,B.jsx)(l,{}),`for your terminal:`,` `,_.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,B.jsx)(m,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?A(h).catch(()=>{}).finally(v):v()},onCancel:()=>v()}),(0,B.jsx)(s,{dimColor:!0,children:x.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,x.keyName,` again to exit`]}):(0,B.jsx)(B.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let P=N[n],I=(0,z.useCallback)(()=>{n===N.length-1?e():v()},[n,N.length,p,e]),V=(0,z.useCallback)(()=>{v()},[n,N.length,p,e]);return r({"confirm:yes":I},{context:`Confirmation`,isActive:P?.id===`security`}),r({"confirm:no":V},{context:`Confirmation`,isActive:P?.id===`terminal-setup`}),(0,B.jsxs)(a,{flexDirection:`column`,children:[(0,B.jsx)(j,{}),(0,B.jsxs)(a,{flexDirection:`column`,marginTop:1,children:[P?.component,x.pending&&(0,B.jsx)(a,{padding:1,children:(0,B.jsxs)(s,{dimColor:!0,children:[`Press `,x.keyName,` again to exit`]})})]})]})}function q({skip:e,onSkip:t,children:n}){return(0,z.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{K as Onboarding};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{b as o,c as s,g as c}from"./config-DiT2Z8dY.js";import{n as l,r as u}from"./analytics-BotDBGh0.js";import{S as d,b as f}from"./startupProfiler-xa3NmN7Z.js";import{a as p,n as m,r as h,t as g}from"./overageCreditGrant-BVxlYgeU.js";function _(){let e=m();return!e||!e.available||e.granted?!1:g(e)!==null}function v(){if(!_())return!1;let e=s();return!(e.hasVisitedExtraUsage||(e.overageCreditUpsellSeenCount??0)>=O)}function y(){m()===null&&p()}function b(){let[e]=(0,E.useState)(()=>(y(),v()));return e}function x(){let e=0;o(t=>(e=(t.overageCreditUpsellSeenCount??0)+1,{...t,overageCreditUpsellSeenCount:e})),u(`tengu_overage_credit_upsell_shown`,{seen_count:e})}function S(e){return`${e} in extra usage for third-party apps · /extra-usage`}function C(e){return`${e} in extra usage`}function w({maxWidth:e,twoLine:t}){let r=m();if(!r)return null;let i=g(r);if(!i)return null;if(t){let t=C(i);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(n,{color:`claude`,children:e?d(t,e):t}),(0,D.jsx)(n,{dimColor:!0,children:e?d(k,e):k})]})}let a=S(i),o=e?d(a,e):a,s=Math.min(C(i).length,o.length);return(0,D.jsxs)(n,{dimColor:!0,children:[(0,D.jsx)(n,{color:`claude`,children:o.slice(0,s)}),o.slice(s)]})}function T(){let e=m(),t=e?g(e):null,r=t?C(t):`extra usage credit`;return{title:r,lines:[],customContent:{content:(0,D.jsx)(n,{dimColor:!0,children:k}),width:Math.max(r.length,47)}}}var E,D,O,k,A=e((()=>{r(),E=t(r(),1),i(),l(),h(),c(),f(),D=a(),O=3,k=`On us. Works on third-party apps · /extra-usage`}));export{_ as a,A as i,T as n,v as o,x as r,b as s,w as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{b as o,c as s,g as c}from"./config-DiT2Z8dY.js";import{n as l,r as u}from"./analytics-BotDBGh0.js";import{S as d,b as f}from"./startupProfiler-xa3NmN7Z.js";import{a as p,n as m,r as h,t as g}from"./overageCreditGrant-CN_sVURL.js";function _(){let e=m();return!e||!e.available||e.granted?!1:g(e)!==null}function v(){if(!_())return!1;let e=s();return!(e.hasVisitedExtraUsage||(e.overageCreditUpsellSeenCount??0)>=O)}function y(){m()===null&&p()}function b(){let[e]=(0,E.useState)(()=>(y(),v()));return e}function x(){let e=0;o(t=>(e=(t.overageCreditUpsellSeenCount??0)+1,{...t,overageCreditUpsellSeenCount:e})),u(`tengu_overage_credit_upsell_shown`,{seen_count:e})}function S(e){return`${e} in extra usage for third-party apps · /extra-usage`}function C(e){return`${e} in extra usage`}function w({maxWidth:e,twoLine:t}){let r=m();if(!r)return null;let i=g(r);if(!i)return null;if(t){let t=C(i);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(n,{color:`claude`,children:e?d(t,e):t}),(0,D.jsx)(n,{dimColor:!0,children:e?d(k,e):k})]})}let a=S(i),o=e?d(a,e):a,s=Math.min(C(i).length,o.length);return(0,D.jsxs)(n,{dimColor:!0,children:[(0,D.jsx)(n,{color:`claude`,children:o.slice(0,s)}),o.slice(s)]})}function T(){let e=m(),t=e?g(e):null,r=t?C(t):`extra usage credit`;return{title:r,lines:[],customContent:{content:(0,D.jsx)(n,{dimColor:!0,children:k}),width:Math.max(r.length,47)}}}var E,D,O,k,A=e((()=>{r(),E=t(r(),1),i(),l(),h(),c(),f(),D=a(),O=3,k=`On us. Works on third-party apps · /extra-usage`}));export{_ as a,A as i,T as n,v as o,x as r,b as s,w as t};