commandmate 0.45.0 → 0.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +265 -264
  3. package/.next/app-path-routes-manifest.json +18 -18
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +9 -9
  6. package/.next/react-loadable-manifest.json +4 -4
  7. package/.next/required-server-files.json +1 -1
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/capabilities/route.js +1 -1
  18. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  62. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/route.js +1 -1
  148. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  150. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  152. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  153. package/.next/server/app/page_client-reference-manifest.js +1 -1
  154. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  155. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  156. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  157. package/.next/server/app/sessions/page.js +1 -1
  158. package/.next/server/app/sessions/page.js.nft.json +1 -1
  159. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  160. package/.next/server/app/skills/[skillId]/page.js +2 -2
  161. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  162. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  163. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  164. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  165. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  166. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  167. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  168. package/.next/server/app/worktrees/[id]/page.js +4 -4
  169. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  170. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  171. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  172. package/.next/server/app-paths-manifest.json +18 -18
  173. package/.next/server/chunks/2119.js +1 -1
  174. package/.next/server/chunks/2335.js +1 -0
  175. package/.next/server/chunks/2404.js +1 -1
  176. package/.next/server/chunks/2445.js +1 -1
  177. package/.next/server/chunks/2460.js +1 -1
  178. package/.next/server/chunks/{4802.js → 4243.js} +1 -1
  179. package/.next/server/chunks/4837.js +3 -3
  180. package/.next/server/chunks/5209.js +1 -1
  181. package/.next/server/chunks/5625.js +2 -2
  182. package/.next/server/chunks/6130.js +1 -1
  183. package/.next/server/chunks/6401.js +1 -1
  184. package/.next/server/chunks/6927.js +1 -1
  185. package/.next/server/chunks/8728.js +1 -1
  186. package/.next/server/chunks/9355.js +1 -0
  187. package/.next/server/chunks/9862.js +1 -0
  188. package/.next/server/middleware-build-manifest.js +1 -1
  189. package/.next/server/middleware-manifest.json +5 -5
  190. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  191. package/.next/server/pages/500.html +1 -1
  192. package/.next/server/server-reference-manifest.json +1 -1
  193. package/.next/static/chunks/{7485.8a2a9d7c5396aa26.js → 1111.5ab4f0ffb0d944e5.js} +2 -2
  194. package/.next/static/chunks/{1642-767aed8e7c61ef7f.js → 1642-0f1bf8fb8161e10a.js} +1 -1
  195. package/.next/static/chunks/{2407-dd4a0f04f1349221.js → 2407-86890b00eeecf391.js} +1 -1
  196. package/.next/static/chunks/3662-5a27ee39a3ecba49.js +1 -0
  197. package/.next/static/chunks/3922.0bc2e4e168d2b522.js +1 -0
  198. package/.next/static/chunks/4541-b0ce0bf829ae79b7.js +1 -0
  199. package/.next/static/chunks/4727-4c69d1aa4118cc09.js +1 -0
  200. package/.next/static/chunks/5371-af1c2b68e983da61.js +1 -0
  201. package/.next/static/chunks/6288-09feba367cc2c65e.js +1 -0
  202. package/.next/static/chunks/953.31c52a251deda22d.js +1 -0
  203. package/.next/static/chunks/app/{layout-07d040cb3d3ea657.js → layout-eaa6365f8f942e88.js} +1 -1
  204. package/.next/static/chunks/app/sessions/{page-2af68c63211c751f.js → page-ebfed2c80e916fb8.js} +1 -1
  205. package/.next/static/chunks/app/skills/[skillId]/page-e4b14031f946c007.js +1 -0
  206. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-9cf1ecc59e36a004.js +1 -0
  207. package/.next/static/chunks/app/worktrees/[id]/page-3372b78fde232b1f.js +1 -0
  208. package/.next/static/chunks/{webpack-165d8df9acd1c5d4.js → webpack-ee3ccbe378c4aa06.js} +1 -1
  209. package/.next/static/css/{057f64a65726c439.css → 6faeb04a0b6819d4.css} +1 -1
  210. package/.next/trace +13 -13
  211. package/dist/server/locales/en/worktree.json +2 -1
  212. package/dist/server/locales/ja/worktree.json +2 -1
  213. package/dist/server/src/lib/auto-yes-poller.js +16 -163
  214. package/dist/server/src/lib/polling/auto-yes-enter-fallback-state.js +1 -1
  215. package/dist/server/src/lib/polling/auto-yes-poller-state.js +52 -0
  216. package/dist/server/src/lib/polling/auto-yes-prompt-suppression.js +125 -0
  217. package/dist/server/src/lib/polling/prompt-dedup.js +93 -2
  218. package/dist/server/src/lib/polling/response-checker.js +40 -2
  219. package/dist/server/src/lib/polling/response-dedup.js +62 -1
  220. package/package.json +1 -1
  221. package/release-notes/0.45.1.json +38 -0
  222. package/.next/server/chunks/364.js +0 -1
  223. package/.next/server/chunks/488.js +0 -1
  224. package/.next/server/chunks/5326.js +0 -1
  225. package/.next/static/chunks/2053-390e77fce43b555c.js +0 -1
  226. package/.next/static/chunks/3922.f45dcfc1e7da552a.js +0 -1
  227. package/.next/static/chunks/4727-5d695d71e3fdf97b.js +0 -1
  228. package/.next/static/chunks/8283-26ad31a4670ea52d.js +0 -1
  229. package/.next/static/chunks/8566-aeda747542072ace.js +0 -1
  230. package/.next/static/chunks/8811-29eaa24237f48558.js +0 -1
  231. package/.next/static/chunks/953.19e4c8178c9eac4c.js +0 -1
  232. package/.next/static/chunks/app/skills/[skillId]/page-9ee7a381636e60cb.js +0 -1
  233. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-5445205c8dd80109.js +0 -1
  234. package/.next/static/chunks/app/worktrees/[id]/page-35f0e31a725d1c89.js +0 -1
  235. /package/.next/static/{TPWbZB3zBp3Zv_eFEOlmt → vYIpFRCU_Mt0wtG8F_3-6}/_buildManifest.js +0 -0
  236. /package/.next/static/{TPWbZB3zBp3Zv_eFEOlmt → vYIpFRCU_Mt0wtG8F_3-6}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8898],{9219:(e,t,s)=>{"use strict";s.d(t,{k:()=>l});var n=s(95155),a=s(12115),i=s(48407),r=s(87531);function l(e){let{onRefresh:t,enabled:s=!0,className:l,children:o}=e,{containerRef:c,pullDistance:d,isRefreshing:u,isPulling:m}=function(e){let{onRefresh:t,enabled:s=!0,threshold:n=64,maxPull:i=96,resistance:r=.5}=e,l=(0,a.useRef)(null),[o,c]=(0,a.useState)(0),[d,u]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),x=(0,a.useRef)(null),f=(0,a.useRef)(0),g=(0,a.useRef)(!1);g.current=d;let p=(0,a.useCallback)(()=>{x.current=null,f.current=0,c(0),h(!1)},[]),b=(0,a.useCallback)(e=>{if(!s||g.current)return;let t=l.current;t&&!(t.scrollTop>0)&&(x.current=e.touches[0].clientY,f.current=0)},[s]),v=(0,a.useCallback)(e=>{if(null===x.current)return;let t=l.current;if(!t)return;if(t.scrollTop>0)return void p();let s=e.touches[0].clientY-x.current;if(s<=0){0!==f.current&&(f.current=0,c(0),h(!1));return}e.cancelable&&e.preventDefault();let n=Math.min(s*r,i);f.current=n,c(n),h(!0)},[r,i,p]),y=(0,a.useCallback)(async()=>{u(!0),h(!1),c(n);try{await Promise.resolve(t())}finally{u(!1),c(0)}},[t,n]),w=(0,a.useCallback)(()=>{if(null===x.current)return;let e=f.current>=n&&!g.current;x.current=null,f.current=0,e?y():(c(0),h(!1))},[n,y]);return(0,a.useEffect)(()=>{let e=l.current;if(e)return e.addEventListener("touchstart",b,{passive:!0}),e.addEventListener("touchmove",v,{passive:!1}),e.addEventListener("touchend",w,{passive:!0}),e.addEventListener("touchcancel",w,{passive:!0}),()=>{e.removeEventListener("touchstart",b),e.removeEventListener("touchmove",v),e.removeEventListener("touchend",w),e.removeEventListener("touchcancel",w)}},[b,v,w]),{containerRef:l,pullDistance:o,isRefreshing:d,isPulling:m}}({onRefresh:t,enabled:s,threshold:64}),h=u||d>0,x=u?1:Math.min(d/64,1);return(0,n.jsxs)("div",{ref:c,className:(0,r.cn)("relative overflow-auto",l),style:{overscrollBehaviorY:"contain"},"data-testid":"pull-to-refresh",children:[(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center",style:{transform:"translateY(".concat(h?Math.max(d-24,8):-32,"px)"),opacity:x,transition:m?"none":"transform 0.2s ease-out, opacity 0.2s ease-out"},"data-testid":"pull-to-refresh-indicator",role:"status","aria-hidden":!u,children:(0,n.jsx)(i.y$,{size:"sm",variant:"accent"})}),(0,n.jsx)("div",{style:{transform:h?"translateY(".concat(d,"px)"):void 0,transition:m?"none":"transform 0.2s ease-out"},children:o})]})}},75676:(e,t,s)=>{"use strict";s.d(t,{jg:()=>i,kQ:()=>r,mR:()=>c,mS:()=>o,wf:()=>n});let n="terminal",a=new Set(["terminal","chat"]);function i(e){return"string"==typeof e&&a.has(e)}let r={data:null,messageId:null,visible:!1,answering:!1},l={mode:"split",mobileActivePane:"terminal",leftPaneTab:"history",splitRatio:.5,leftPaneCollapsed:!1,activityBar:{active:"files"},historyPane:{visible:!0,width:25,collapsed:!1}},o={type:null,message:null,retryable:!1,retryCount:0};function c(){return{phase:"idle",prompt:{...r},layout:{...l},error:{...o},messages:[],wsConnected:!1}}},80003:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])},87047:(e,t,s)=>{Promise.resolve().then(s.bind(s,89569))},89569:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>em});var n=s(95155),a=s(12115),i=s(52619),r=s.n(i),l=s(18955),o=s(20562),c=s(8803),d=s(9219),u=s(37586),m=s(22479),h=s(54485),x=s(58597),f=s(83051),g=s(14006),p=s(88155),b=s(92509),v=s(73333),y=s(2954),w=s(48407),j=s(32771),k=s(89599),N=s(308),A=s(80635),S=s(52407);function C(){let{signals:e}=(0,S.Fx)();return(0,a.useMemo)(()=>({offline:(0,S.sV)(e),reachable:(0,S._X)(e)}),[e])}var M=s(66966);let I=Object.freeze({enabled:!1,expiresAt:null});var L=s(81507),P=s(2317),T=s(75676),E=s(63881),R=s(8355),_=s(80344),D=s(38606),z=s(76471),F=s(54014),K=s(55449),U=s(67149),B=s(68394);let O=[{mode:"chat",labelKey:"surfaceMode.showChat",icon:u.A},{mode:"terminal",labelKey:"surfaceMode.showTerminal",icon:m.A}];function H(e){return"flex h-7 w-7 shrink-0 items-center justify-center rounded transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(e?"bg-accent-500/15 text-accent-600 dark:text-accent-400":"text-muted-foreground hover:bg-muted hover:text-foreground")}let V=()=>{},Y=(0,a.memo)(function(e){return e.connectivity?(0,n.jsx)(W,{...e,connectivity:e.connectivity}):(0,n.jsx)(q,{...e})});function q(e){let t=C();return(0,n.jsx)(W,{...e,connectivity:t})}function W(e){var t,s,i,o,c,d,u;let{worktree:m,enabled:S,connectivity:C,className:Y=""}=e,q=(0,l.c)("common"),W=(0,l.c)("worktree"),J=(0,a.useMemo)(()=>{var e;return m.agentInstances&&m.agentInstances.length>0?m.agentInstances:(0,F.lu)(null!=(e=m.selectedAgents)?e:(0,K.sA)())},[m]),[Q,G]=(0,a.useState)(null),X=null!=(s=J.find(e=>e.id===Q))?s:J[0],Z=null==X?void 0:X.id,$=null!=(i=null==X?void 0:X.cliTool)?i:"claude",ee=null!=Z?Z:$,{surfaceMode:et,setSurfaceMode:es}=function(e){let{value:t,setValue:s}=(0,P.V)({key:"".concat("commandmate.sessions.tileSurfaceMode-").concat(e),defaultValue:"chat",validate:T.jg,serialize:e=>e,deserialize:e=>e});return{surfaceMode:t,setSurfaceMode:(0,a.useCallback)(e=>s(e),[s])}}(m.id),{visible:en,toggle:ea}=(0,L.TG)(L.jt),ei="terminal"===et,er=ei&&en,[el,eo]=(0,a.useState)(null),[ec,ed]=(0,a.useState)(null),{terminal:eu,prompt:em,refresh:eh,setAutoScroll:ex}=(0,j.NK)({worktreeId:m.id,cliToolId:$,instanceId:Z,enabled:S,cadence:U.sD}),{messages:ef,isLoading:eg,refresh:ep}=(0,N.Md)({worktreeId:m.id,cliToolId:$,instanceId:Z,enabled:S&&(!ei||en),cadence:U.WT}),eb=(0,a.useCallback)((e,t)=>_.y.sendMessage(m.id,e,t),[m.id]),{messages:ev,sendOptimistic:ey,retry:ew,discard:ej}=(0,A.v4)({worktreeId:m.id,serverMessages:ef,sendFn:eb,onSent:ep,connectivity:C}),ek=(0,a.useMemo)(()=>(function(e,t){let s=e=>{var s;return void 0!==e.optimisticState&&(null!=(s=e.instanceId)?s:e.cliToolId)!==t};return e.some(s)?e.filter(e=>!s(e)):e})(ev,ee),[ev,ee]),[eN,eA]=(0,a.useState)(null),eS=(0,a.useCallback)(()=>eA(null),[]),eC=(0,a.useCallback)(e=>{let t=ej(e);t&&eA(t)},[ej]),eM=(0,a.useCallback)(()=>{eh()},[eh]),eI=function(e){var t;let{worktree:s,cliToolId:n,instanceId:i}=e,r=null==(t=(0,M.rC)())?void 0:t.refresh,l=s.id,o=(0,a.useMemo)(()=>(function(e,t){var s;let n=null==(s=e.autoYesByInstance)?void 0:s[t];return n&&!0===n.enabled?{enabled:!0,expiresAt:"number"==typeof n.expiresAt?n.expiresAt:null}:I})(s,i),[s,i]),[c,d]=(0,a.useState)(null),u=(0,a.useRef)(s);u.current=s;let m=null===c||c.instanceId!==i||function(e,t,s){let n=t.enabled===e.value.enabled&&(!t.enabled||t.expiresAt===e.value.expiresAt),a=null!==e.settledRow&&s!==e.settledRow;return n||a}(c,o,s)?null:c;(0,a.useEffect)(()=>{null!==c&&null===m&&d(null)},[c,m]);let h=(0,a.useCallback)(async e=>{let t;try{let s=await fetch("/api/worktrees/".concat(encodeURIComponent(l),"/auto-yes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e.enabled,cliToolId:n,instanceId:i,duration:e.duration,stopPattern:e.stopPattern})});if(!s.ok)return;let a=await s.json(),r=!0===a.enabled;t={enabled:r,expiresAt:r&&"number"==typeof a.expiresAt?a.expiresAt:null}}catch(e){return}let s={instanceId:i,value:t,settledRow:null};d(s);try{await (null==r?void 0:r())}catch(e){}d(e=>e===s?{...s,settledRow:u.current}:e)},[l,n,i,r]),x=m?m.value:o;return{enabled:x.enabled,expiresAt:x.expiresAt,toggle:h}}({worktree:m,cliToolId:$,instanceId:ee}),eL=(0,a.useMemo)(()=>({isRunning:eu.isRunning,attaching:eu.attaching,sessionStatus:eu.sessionStatus,isThinking:eu.isThinking,isPromptWaiting:em.visible,promptData:em.data,isSelectionListActive:eu.isSelectionListActive,isPagerActive:eu.isPagerActive,isDismissablePanelActive:eu.isDismissablePanelActive,isUnclassifiedActive:eu.isUnclassifiedActive,startingSince:eu.startingSince}),[eu.isRunning,eu.attaching,eu.sessionStatus,eu.isThinking,eu.isSelectionListActive,eu.isPagerActive,eu.isDismissablePanelActive,eu.isUnclassifiedActive,eu.startingSince,em.visible,em.data]),eP=(0,k.Bj)((0,k.qi)(m.id,ee),eu.startingSince),eT=S&&ei&&eu.isSelectionListActive&&!eP.starting,eE=eT?{className:"min-h-[18rem]",px:288}:{className:"min-h-[15rem]",px:240},eR=(0,E.b4)(el,ec,eE.px),e_=(0,a.useCallback)(e=>es(e),[es]),eD=(0,a.useMemo)(()=>({isLoading:eg,onRetryPending:ew,onDiscardPending:eC,onInsertToMessage:eA}),[eg,ew,eC]),{compactTuiLayoutPadding:ez,preservePaintedPanelRows:eF}=(0,a.useMemo)(()=>(0,B.EK)($),[$]),eK="opencode"===$||"copilot"===$,eU=(u=m.id,"session-tile-history-".concat(u)),eB=(0,a.useCallback)(e=>{G(e.target.value)},[]),eO=null!=(o=m.branch)?o:m.name,eH=null!=(c=m.repositoryDisplayName)?c:m.repositoryName,eV=Z?null==(t=m.sessionStatusByInstance)?void 0:t[Z]:void 0,eY=(0,D.kA)(eV),eq=(0,z.Mq)(eY,(0,D.px)(eV));return(0,n.jsxs)("section",{className:"flex h-full min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-sm ".concat(Y),"data-testid":"session-tile-".concat(m.id),"data-enabled":S?"true":"false","aria-label":q("sessions.tileAriaLabel",{branch:eO}),children:[(0,n.jsxs)("header",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[(0,n.jsx)(w.md,{status:eY,size:"sm",label:q(eq?z.rH:"status.".concat(eY)),className:eq?z.Jd:void 0,"data-unclassified":eq?"true":void 0}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:eH}),(0,n.jsx)(r(),{href:"/worktrees/".concat(m.id),className:"block truncate text-sm font-medium text-foreground underline-offset-2 hover:text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:hover:text-accent-400","data-testid":"session-tile-branch-".concat(m.id),title:eO,children:eO})]}),J.length>1&&(0,n.jsx)("select",{value:null!=(d=null==X?void 0:X.id)?d:"",onChange:eB,className:"max-w-[9rem] shrink-0 rounded-md border border-border bg-surface px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"session-tile-instance-".concat(m.id),"aria-label":q("sessions.tileInstanceAriaLabel"),children:J.map(e=>(0,n.jsx)("option",{value:e.id,children:(0,F.sw)(e)},e.id))}),ei&&(0,n.jsx)("button",{type:"button",onClick:ea,"aria-pressed":en,"aria-expanded":en,"aria-controls":eU,"aria-label":en?W("terminal.hideHistory"):W("terminal.showHistory"),title:en?W("terminal.hideHistory"):W("terminal.showHistory"),className:H(en),"data-testid":"session-tile-history-toggle-".concat(m.id),children:(0,n.jsx)(h.A,{size:14,"aria-hidden":"true"})}),(0,n.jsx)("div",{role:"group","aria-label":W("surfaceMode.groupLabelMobile"),className:"flex shrink-0 items-center gap-0.5 rounded-md border border-border p-0.5","data-testid":"session-tile-surface-mode-".concat(m.id),children:O.map(e=>{let{mode:t,labelKey:s,icon:a}=e,i=et===t,r=W(s);return(0,n.jsx)("button",{type:"button",onClick:()=>es(t),"aria-pressed":i,"aria-label":r,title:r,className:H(i),"data-testid":"session-tile-surface-".concat(t,"-").concat(m.id),children:(0,n.jsx)(a,{size:14,"aria-hidden":"true"})},t)})})]}),(0,n.jsx)("div",{ref:eo,className:"min-w-0 flex-1 overflow-hidden ".concat(eE.className),"data-testid":"session-tile-body-".concat(m.id),children:S&&ei?(0,n.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col","data-testid":"session-tile-terminal-stack-".concat(m.id),children:[(0,n.jsx)("div",{className:"relative min-w-0 overflow-hidden ".concat(er?"flex-[3_3_0%] min-h-[8.5rem]":"min-h-0 flex-1"),"data-testid":"session-tile-terminal-".concat(m.id),children:eP.noticeVisible&&null!==eP.startingSince?(0,n.jsx)(p.TE,{cliToolId:$,startingSince:eP.startingSince,onShowTerminal:eP.revealTerminal}):(0,n.jsx)(g.D,{output:eu.output,isActive:eu.isRunning,attaching:eu.attaching,isThinking:eu.isThinking,autoScroll:eu.autoScroll,onScrollChange:ex,disableAutoFollow:eK,compactTuiLayoutPadding:ez,preservePaintedPanelRows:eF,wrapMode:B.Wq.wrapMode,density:B.Wq.density})}),eT?(0,n.jsx)("div",{className:"min-w-0 shrink overflow-y-auto border-t border-border p-2 ".concat("min-h-[3rem] max-h-[8rem]"),"data-testid":"session-tile-selection-keys-".concat(m.id),children:(0,n.jsx)(b.Z,{worktreeId:m.id,cliToolId:$,instanceId:ee,onKeysSent:eh,frame:eu.output,surface:"terminal",showPagerKeys:eu.isPagerActive})}):null,er&&(0,n.jsx)("div",{id:eU,className:"min-w-0 overflow-hidden border-t border-border ".concat("flex-[2_2_0%] min-h-[6.5rem]"),"data-testid":"session-tile-history-".concat(m.id),children:(0,n.jsx)(f.bl,{messages:ek,worktreeId:m.id,worktreePath:m.path,cliToolId:$,isLoading:eg,onFilePathClick:V,onInsertToMessage:eA,onRetryPending:ew,onDiscardPending:eC,className:"h-full"})})]}):S?(0,n.jsx)(x.wY,{messages:ek,worktreeId:m.id,worktreePath:m.path,cliToolId:$,instanceId:Z,live:eL,frame:eu.output,onKeysSent:eh,onSurfaceModeChange:e_,compact:!0,history:eD}):(0,n.jsx)("div",{className:"h-full","data-testid":"session-tile-placeholder-".concat(m.id),"aria-hidden":"true"})}),S&&(0,n.jsx)("div",{ref:ed,className:"shrink-0 border-t border-border p-2","data-testid":"session-tile-composer-".concat(m.id),children:(0,n.jsx)(v.E,{worktreeId:m.id,cliToolId:$,instanceId:ee,isSessionRunning:eu.isRunning,isSessionStarting:eP.starting,onOptimisticSend:ey,onMessageSent:eM,pendingInsertText:eN,onInsertConsumed:eS,heightScope:R.CM,maxHeight:eR,autoYesSlot:(0,n.jsx)(y.T,{enabled:eI.enabled,expiresAt:eI.expiresAt,onToggle:eI.toggle,lastAutoResponse:null,cliToolName:$,inline:!0})})})]})}let J=(0,a.memo)(function(e){let{worktree:t,connectivity:s}=e,{ref:i,inViewport:r}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{rootMargin:t,threshold:s}=e,[n,i]=(0,a.useState)(!1),[r,l]=(0,a.useState)(null),o=(0,a.useCallback)(e=>{l(e)},[]);return(0,a.useEffect)(()=>{if("undefined"==typeof IntersectionObserver)return void i(!0);if(!r)return;let e=new IntersectionObserver(e=>{let t=e[e.length-1];t&&i(t.isIntersecting)},{rootMargin:t,threshold:s});return e.observe(r),()=>e.disconnect()},[r,t,s]),{ref:o,inViewport:n}}({rootMargin:"560px"});return(0,n.jsx)("div",{ref:i,className:"min-w-0 ".concat("h-[35rem]"),children:(0,n.jsx)(Y,{worktree:t,enabled:r,connectivity:s})})}),Q=(0,a.memo)(function(e){let{worktrees:t}=e,s=C();return(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2","data-testid":"sessions-tile-grid",children:t.map(e=>(0,n.jsx)(J,{worktree:e,connectivity:s},e.id))})});var G=s(80003);let X=(0,s(71847).A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),Z=["list","tile"];function $(e){return"string"==typeof e&&Z.includes(e)}let ee=[{mode:"list",labelKey:"sessions.viewMode.list",icon:G.A},{mode:"tile",labelKey:"sessions.viewMode.tile",icon:X}],et=(0,a.memo)(function(e){let{value:t,onChange:s}=e,a=(0,l.c)("common");return(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-1 rounded-md border border-input bg-surface p-0.5",role:"group","aria-label":a("sessions.viewMode.groupAriaLabel"),"data-testid":"sessions-view-mode",children:ee.map(e=>{let{mode:i,labelKey:r,icon:l}=e,o=t===i;return(0,n.jsx)("button",{type:"button",onClick:()=>s(i),"aria-pressed":o,"aria-label":a(r),title:a(r),"data-testid":"sessions-view-mode-".concat(i),className:"rounded p-1.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(o?"bg-accent-100 text-accent-700 dark:bg-accent-900/30 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(l,{size:16,"aria-hidden":"true"})},i)})})});var es=s(38218),en=s(50857),ea=s(7636),ei=s(83012);let er=[{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"status",labelKey:"sort.status"},{key:"lastSent",labelKey:"sort.lastSent"}],el={lastSent:"desc",updatedAt:"desc"},eo={ready:0,in_progress:1,in_review:2,done:3};function ec(e){let{status:t,label:s,unclassified:a}=e,i=(0,l.c)("common"),r=(0,z.Mq)(t,a),o="".concat(s,": ").concat(i(r?z.rH:"status.".concat(t)));return(0,n.jsx)(w.md,{status:t,size:"md",label:o,className:r?z.Jd:void 0,"data-unclassified":r?"true":void 0})}let ed={ready:"worktreeStatus.ready",in_progress:"worktreeStatus.inProgress",in_review:"worktreeStatus.inReview",done:"worktreeStatus.done"},eu={done:"bg-success-subtle text-success-foreground",in_review:"bg-info-subtle text-info-foreground",in_progress:"bg-accent-100 dark:bg-accent-900/30 text-accent-700 dark:text-accent-400"};function em(){let e=(0,l.c)("common"),t=(0,l.c)("worktree"),s=(0,es.a)(),{worktrees:i,isLoading:u,error:m,refresh:h}=(0,M.Fn)(),x=i.length>0,[f,g]=(0,a.useState)(""),[p,b]=(0,a.useState)("lastSent"),[v,y]=(0,a.useState)("desc"),{viewMode:j,setViewMode:k}=function(){let{value:e,setValue:t}=(0,P.V)({key:"mcbd-sessions-view-mode",defaultValue:"list",validate:$,serialize:e=>e,deserialize:e=>e});return{viewMode:e,setViewMode:(0,a.useCallback)(e=>t(e),[t])}}(),N="tile"===j;(0,a.useEffect)(()=>{(0,K.qD)()},[]);let A=(0,a.useMemo)(()=>{let e=i;if(f){let t=f.toLowerCase();e=e.filter(e=>{var s,n;return e.name.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t)||null!=(n=null==(s=e.repositoryDisplayName)?void 0:s.toLowerCase().includes(t))&&n})}let t=[...e];return t.sort((e,t)=>{var s,n,a,i,r,l,o,c;let d=0;switch(p){case"lastSent":{let s=(0,ea.nO)(e.lastUserMessageAt,t.lastUserMessageAt);if(!e.lastUserMessageAt&&!t.lastUserMessageAt)return 0;if(!e.lastUserMessageAt)return 1;if(!t.lastUserMessageAt)return -1;d=s;break}case"repositoryName":{let a=(null!=(s=e.repositoryDisplayName)?s:e.repositoryName).toLowerCase(),i=(null!=(n=t.repositoryDisplayName)?n:t.repositoryName).toLowerCase();0===(d=a.localeCompare(i))&&(d=e.name.toLowerCase().localeCompare(t.name.toLowerCase()));break}case"status":if(0==(d=(null!=(i=eo[null!=(a=e.status)?a:""])?i:4)-(null!=(l=eo[null!=(r=t.status)?r:""])?l:4))){let s=(null!=(o=e.repositoryDisplayName)?o:e.repositoryName).toLowerCase(),n=(null!=(c=t.repositoryDisplayName)?c:t.repositoryName).toLowerCase();d=s.localeCompare(n)}break;default:d=0}return("lastSent"===p?"desc"===v:"asc"===v)?d:-d}),t},[i,f,p,v]),S=(0,a.useCallback)(e=>{g(e.target.value)},[]),C=(0,a.useCallback)(e=>{var t;b(e),y(null!=(t=el[e])?t:"asc")},[]),I=(0,a.useCallback)(()=>{y(e=>"asc"===e?"desc":"asc")},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(d.k,{onRefresh:h,enabled:s,className:"".concat(N?"w-full px-4 sm:px-6 lg:px-8":"container-custom"," py-8 h-full"),children:[(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e("sessions.title")}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("sessions.description")})]}),(0,n.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,n.jsx)(w.pd,{type:"text",placeholder:e("sessions.filterPlaceholder"),value:f,onChange:S,className:"max-w-md flex-1","data-testid":"sessions-filter","aria-label":e("sessions.filterAriaLabel"),inputMode:"search",enterKeyHint:"search"}),(0,n.jsxs)(w.l6,{value:p,onValueChange:C,children:[(0,n.jsx)(w.bq,{className:"w-40","data-testid":"sessions-sort-select","aria-label":e("sessions.sortByAriaLabel"),children:(0,n.jsx)(w.yv,{})}),(0,n.jsx)(w.gC,{children:er.map(t=>(0,n.jsx)(w.eb,{value:t.key,children:e(t.labelKey)},t.key))})]}),(0,n.jsx)("button",{type:"button",onClick:I,"data-testid":"sessions-sort-direction","aria-label":"asc"===v?e("sessions.sortAscending"):e("sessions.sortDescending"),className:"rounded-md border border-input bg-surface p-2 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"asc"===v?(0,n.jsx)(o.A,{size:16,"aria-hidden":"true"}):(0,n.jsx)(c.A,{size:16,"aria-hidden":"true"})}),(0,n.jsx)(et,{value:j,onChange:k})]}),x?(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)("div",{className:"mb-4 rounded-md border border-danger-border bg-danger-subtle px-3 py-2 text-sm text-danger-foreground",role:"status","data-testid":"sessions-error-banner",children:e("sessions.refreshError",{message:m.message})}),N?0===A.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):(0,n.jsx)(Q,{worktrees:A}):(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-list",children:0===A.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):A.map((s,a)=>{var i,l,o,c;let d=null!=(i=s.selectedAgents)?i:(0,K.sA)(),u=s.lastUserMessage?s.lastUserMessage.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/g,"").replace(/[\u200B-\u200F\u2028-\u202F\uFEFF\u061C]/g,"").replace(/[\r\n\t]/g," ").replace(/\s+/g," ").trim():null,m=s.lastUserMessageAt?(0,ei.Fx)(String(s.lastUserMessageAt)):null,h=d.map(e=>{var t;let n=null==(t=s.sessionStatusByCli)?void 0:t[e];return{agent:e,status:(0,D.kA)(n),unclassified:(0,D.px)(n)}}),x=h.filter(e=>(0,en.Qo)(e.status)||e.unclassified),f=h.length-x.length,g=d.some(e=>{var t;let n=(0,D.kA)(null==(t=s.sessionStatusByCli)?void 0:t[e]);return"running"===n||"generating"===n});return(0,n.jsxs)(r(),{href:"/worktrees/".concat(s.id),style:{animationDelay:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(Number.isFinite(e)&&!(e<=0)&&!(e>=s))return"".concat(e*t,"ms")}(a)},className:"block bg-surface rounded-lg p-4 border transition-colors ".concat(g?"border-accent-500/40 shadow-[0_0_16px_-4px_rgb(var(--accent-500)/0.45)] hover:border-accent-400":"border-border shadow-sm hover:border-accent-300 dark:hover:border-accent-700"," ").concat("animate-in fade-in-0 slide-in-from-bottom-2 fill-mode-backwards duration-300"),"data-testid":"session-item-".concat(s.id),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:null!=(l=s.repositoryDisplayName)?l:s.repositoryName}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:s.name})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 ml-4 flex-shrink-0","data-testid":"session-agents-".concat(s.id),children:[x.map(e=>{let{agent:t,status:s,unclassified:a}=e;return(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-agent-".concat(t),children:[(0,n.jsx)(ec,{status:s,label:(0,F.oo)(t),unclassified:a}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,F.oo)(t)})]},t)}),f>0&&(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-idle-cluster-".concat(s.id),"aria-label":e("sessions.idleAgents",{count:f}),children:[(0,n.jsx)(w.md,{status:"idle",size:"sm","aria-hidden":!0,title:void 0}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums",children:["+",f]})]})]})]}),s.description&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 whitespace-pre-wrap",children:s.description})}),s.status&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded ".concat(null!=(c=eu[null!=(o=s.status)?o:""])?c:"bg-muted text-muted-foreground"),children:function(e,t){if(!e)return"";let s=ed[e];return s?t(s):e}(s.status,t)})}),u&&(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-2","data-testid":"session-message-".concat(s.id),children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate min-w-0 flex-1","data-testid":"session-message-text-".concat(s.id),title:u,children:u}),m&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0 whitespace-nowrap tabular-nums","data-testid":"session-time-".concat(s.id),children:m})]})]},s.id)})})]}):(0,n.jsxs)(n.Fragment,{children:[u&&(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-loading",role:"status","aria-label":e("sessions.loadingAriaLabel"),children:[0,1,2].map(e=>(0,n.jsxs)("div",{className:"block bg-surface rounded-lg p-4 border border-border shadow-sm",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,n.jsx)(w.EA,{className:"h-4 w-40 max-w-full"}),(0,n.jsx)(w.EA,{className:"h-3 w-56 max-w-full"})]}),(0,n.jsx)(w.EA,{className:"ml-4 h-3 w-16 flex-shrink-0"})]}),(0,n.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,n.jsx)(w.EA,{className:"h-3 min-w-0 flex-1"}),(0,n.jsx)(w.EA,{className:"h-3 w-10 flex-shrink-0"})]})]},e))}),!u&&m&&(0,n.jsx)("div",{className:"text-danger-foreground","data-testid":"sessions-error",children:e("sessions.loadError",{message:m.message})}),!u&&!m&&(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:f?e("sessions.noMatching"):e("sessions.empty")})]})]})})}}},e=>{e.O(0,[6809,4909,2770,2619,8566,6322,5521,8407,2407,344,6654,8606,4768,8811,4727,8441,1255,7358],()=>e(e.s=87047)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8898],{9219:(e,t,s)=>{"use strict";s.d(t,{k:()=>l});var n=s(95155),a=s(12115),i=s(48407),r=s(87531);function l(e){let{onRefresh:t,enabled:s=!0,className:l,children:o}=e,{containerRef:c,pullDistance:d,isRefreshing:u,isPulling:m}=function(e){let{onRefresh:t,enabled:s=!0,threshold:n=64,maxPull:i=96,resistance:r=.5}=e,l=(0,a.useRef)(null),[o,c]=(0,a.useState)(0),[d,u]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),x=(0,a.useRef)(null),f=(0,a.useRef)(0),g=(0,a.useRef)(!1);g.current=d;let p=(0,a.useCallback)(()=>{x.current=null,f.current=0,c(0),h(!1)},[]),b=(0,a.useCallback)(e=>{if(!s||g.current)return;let t=l.current;t&&!(t.scrollTop>0)&&(x.current=e.touches[0].clientY,f.current=0)},[s]),v=(0,a.useCallback)(e=>{if(null===x.current)return;let t=l.current;if(!t)return;if(t.scrollTop>0)return void p();let s=e.touches[0].clientY-x.current;if(s<=0){0!==f.current&&(f.current=0,c(0),h(!1));return}e.cancelable&&e.preventDefault();let n=Math.min(s*r,i);f.current=n,c(n),h(!0)},[r,i,p]),y=(0,a.useCallback)(async()=>{u(!0),h(!1),c(n);try{await Promise.resolve(t())}finally{u(!1),c(0)}},[t,n]),w=(0,a.useCallback)(()=>{if(null===x.current)return;let e=f.current>=n&&!g.current;x.current=null,f.current=0,e?y():(c(0),h(!1))},[n,y]);return(0,a.useEffect)(()=>{let e=l.current;if(e)return e.addEventListener("touchstart",b,{passive:!0}),e.addEventListener("touchmove",v,{passive:!1}),e.addEventListener("touchend",w,{passive:!0}),e.addEventListener("touchcancel",w,{passive:!0}),()=>{e.removeEventListener("touchstart",b),e.removeEventListener("touchmove",v),e.removeEventListener("touchend",w),e.removeEventListener("touchcancel",w)}},[b,v,w]),{containerRef:l,pullDistance:o,isRefreshing:d,isPulling:m}}({onRefresh:t,enabled:s,threshold:64}),h=u||d>0,x=u?1:Math.min(d/64,1);return(0,n.jsxs)("div",{ref:c,className:(0,r.cn)("relative overflow-auto",l),style:{overscrollBehaviorY:"contain"},"data-testid":"pull-to-refresh",children:[(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center",style:{transform:"translateY(".concat(h?Math.max(d-24,8):-32,"px)"),opacity:x,transition:m?"none":"transform 0.2s ease-out, opacity 0.2s ease-out"},"data-testid":"pull-to-refresh-indicator",role:"status","aria-hidden":!u,children:(0,n.jsx)(i.y$,{size:"sm",variant:"accent"})}),(0,n.jsx)("div",{style:{transform:h?"translateY(".concat(d,"px)"):void 0,transition:m?"none":"transform 0.2s ease-out"},children:o})]})}},75676:(e,t,s)=>{"use strict";s.d(t,{jg:()=>i,kQ:()=>r,mR:()=>c,mS:()=>o,wf:()=>n});let n="terminal",a=new Set(["terminal","chat"]);function i(e){return"string"==typeof e&&a.has(e)}let r={data:null,messageId:null,visible:!1,answering:!1},l={mode:"split",mobileActivePane:"terminal",leftPaneTab:"history",splitRatio:.5,leftPaneCollapsed:!1,activityBar:{active:"files"},historyPane:{visible:!0,width:25,collapsed:!1}},o={type:null,message:null,retryable:!1,retryCount:0};function c(){return{phase:"idle",prompt:{...r},layout:{...l},error:{...o},messages:[],wsConnected:!1}}},80003:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])},87047:(e,t,s)=>{Promise.resolve().then(s.bind(s,89569))},89569:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>em});var n=s(95155),a=s(12115),i=s(52619),r=s.n(i),l=s(18955),o=s(20562),c=s(8803),d=s(9219),u=s(37586),m=s(22479),h=s(54485),x=s(58597),f=s(83051),g=s(14006),p=s(88155),b=s(92509),v=s(73333),y=s(2954),w=s(48407),j=s(32771),k=s(89599),N=s(308),A=s(80635),S=s(52407);function C(){let{signals:e}=(0,S.Fx)();return(0,a.useMemo)(()=>({offline:(0,S.sV)(e),reachable:(0,S._X)(e)}),[e])}var M=s(66966);let I=Object.freeze({enabled:!1,expiresAt:null});var L=s(81507),P=s(2317),T=s(75676),E=s(63881),R=s(8355),_=s(80344),D=s(38606),z=s(76471),F=s(54014),K=s(55449),U=s(67149),B=s(68394);let O=[{mode:"chat",labelKey:"surfaceMode.showChat",icon:u.A},{mode:"terminal",labelKey:"surfaceMode.showTerminal",icon:m.A}];function H(e){return"flex h-7 w-7 shrink-0 items-center justify-center rounded transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(e?"bg-accent-500/15 text-accent-600 dark:text-accent-400":"text-muted-foreground hover:bg-muted hover:text-foreground")}let V=()=>{},Y=(0,a.memo)(function(e){return e.connectivity?(0,n.jsx)(W,{...e,connectivity:e.connectivity}):(0,n.jsx)(q,{...e})});function q(e){let t=C();return(0,n.jsx)(W,{...e,connectivity:t})}function W(e){var t,s,i,o,c,d,u;let{worktree:m,enabled:S,connectivity:C,className:Y=""}=e,q=(0,l.c)("common"),W=(0,l.c)("worktree"),J=(0,a.useMemo)(()=>{var e;return m.agentInstances&&m.agentInstances.length>0?m.agentInstances:(0,F.lu)(null!=(e=m.selectedAgents)?e:(0,K.sA)())},[m]),[Q,G]=(0,a.useState)(null),X=null!=(s=J.find(e=>e.id===Q))?s:J[0],Z=null==X?void 0:X.id,$=null!=(i=null==X?void 0:X.cliTool)?i:"claude",ee=null!=Z?Z:$,{surfaceMode:et,setSurfaceMode:es}=function(e){let{value:t,setValue:s}=(0,P.V)({key:"".concat("commandmate.sessions.tileSurfaceMode-").concat(e),defaultValue:"chat",validate:T.jg,serialize:e=>e,deserialize:e=>e});return{surfaceMode:t,setSurfaceMode:(0,a.useCallback)(e=>s(e),[s])}}(m.id),{visible:en,toggle:ea}=(0,L.TG)(L.jt),ei="terminal"===et,er=ei&&en,[el,eo]=(0,a.useState)(null),[ec,ed]=(0,a.useState)(null),{terminal:eu,prompt:em,refresh:eh,setAutoScroll:ex}=(0,j.NK)({worktreeId:m.id,cliToolId:$,instanceId:Z,enabled:S,cadence:U.sD}),{messages:ef,isLoading:eg,refresh:ep}=(0,N.Md)({worktreeId:m.id,cliToolId:$,instanceId:Z,enabled:S&&(!ei||en),cadence:U.WT}),eb=(0,a.useCallback)((e,t)=>_.y.sendMessage(m.id,e,t),[m.id]),{messages:ev,sendOptimistic:ey,retry:ew,discard:ej}=(0,A.v4)({worktreeId:m.id,serverMessages:ef,sendFn:eb,onSent:ep,connectivity:C}),ek=(0,a.useMemo)(()=>(function(e,t){let s=e=>{var s;return void 0!==e.optimisticState&&(null!=(s=e.instanceId)?s:e.cliToolId)!==t};return e.some(s)?e.filter(e=>!s(e)):e})(ev,ee),[ev,ee]),[eN,eA]=(0,a.useState)(null),eS=(0,a.useCallback)(()=>eA(null),[]),eC=(0,a.useCallback)(e=>{let t=ej(e);t&&eA(t)},[ej]),eM=(0,a.useCallback)(()=>{eh()},[eh]),eI=function(e){var t;let{worktree:s,cliToolId:n,instanceId:i}=e,r=null==(t=(0,M.rC)())?void 0:t.refresh,l=s.id,o=(0,a.useMemo)(()=>(function(e,t){var s;let n=null==(s=e.autoYesByInstance)?void 0:s[t];return n&&!0===n.enabled?{enabled:!0,expiresAt:"number"==typeof n.expiresAt?n.expiresAt:null}:I})(s,i),[s,i]),[c,d]=(0,a.useState)(null),u=(0,a.useRef)(s);u.current=s;let m=null===c||c.instanceId!==i||function(e,t,s){let n=t.enabled===e.value.enabled&&(!t.enabled||t.expiresAt===e.value.expiresAt),a=null!==e.settledRow&&s!==e.settledRow;return n||a}(c,o,s)?null:c;(0,a.useEffect)(()=>{null!==c&&null===m&&d(null)},[c,m]);let h=(0,a.useCallback)(async e=>{let t;try{let s=await fetch("/api/worktrees/".concat(encodeURIComponent(l),"/auto-yes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e.enabled,cliToolId:n,instanceId:i,duration:e.duration,stopPattern:e.stopPattern})});if(!s.ok)return;let a=await s.json(),r=!0===a.enabled;t={enabled:r,expiresAt:r&&"number"==typeof a.expiresAt?a.expiresAt:null}}catch(e){return}let s={instanceId:i,value:t,settledRow:null};d(s);try{await (null==r?void 0:r())}catch(e){}d(e=>e===s?{...s,settledRow:u.current}:e)},[l,n,i,r]),x=m?m.value:o;return{enabled:x.enabled,expiresAt:x.expiresAt,toggle:h}}({worktree:m,cliToolId:$,instanceId:ee}),eL=(0,a.useMemo)(()=>({isRunning:eu.isRunning,attaching:eu.attaching,sessionStatus:eu.sessionStatus,isThinking:eu.isThinking,isPromptWaiting:em.visible,promptData:em.data,isSelectionListActive:eu.isSelectionListActive,isPagerActive:eu.isPagerActive,isDismissablePanelActive:eu.isDismissablePanelActive,isUnclassifiedActive:eu.isUnclassifiedActive,startingSince:eu.startingSince}),[eu.isRunning,eu.attaching,eu.sessionStatus,eu.isThinking,eu.isSelectionListActive,eu.isPagerActive,eu.isDismissablePanelActive,eu.isUnclassifiedActive,eu.startingSince,em.visible,em.data]),eP=(0,k.Bj)((0,k.qi)(m.id,ee),eu.startingSince),eT=S&&ei&&eu.isSelectionListActive&&!eP.starting,eE=eT?{className:"min-h-[18rem]",px:288}:{className:"min-h-[15rem]",px:240},eR=(0,E.b4)(el,ec,eE.px),e_=(0,a.useCallback)(e=>es(e),[es]),eD=(0,a.useMemo)(()=>({isLoading:eg,onRetryPending:ew,onDiscardPending:eC,onInsertToMessage:eA}),[eg,ew,eC]),{compactTuiLayoutPadding:ez,preservePaintedPanelRows:eF}=(0,a.useMemo)(()=>(0,B.EK)($),[$]),eK="opencode"===$||"copilot"===$,eU=(u=m.id,"session-tile-history-".concat(u)),eB=(0,a.useCallback)(e=>{G(e.target.value)},[]),eO=null!=(o=m.branch)?o:m.name,eH=null!=(c=m.repositoryDisplayName)?c:m.repositoryName,eV=Z?null==(t=m.sessionStatusByInstance)?void 0:t[Z]:void 0,eY=(0,D.kA)(eV),eq=(0,z.Mq)(eY,(0,D.px)(eV));return(0,n.jsxs)("section",{className:"flex h-full min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-sm ".concat(Y),"data-testid":"session-tile-".concat(m.id),"data-enabled":S?"true":"false","aria-label":q("sessions.tileAriaLabel",{branch:eO}),children:[(0,n.jsxs)("header",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[(0,n.jsx)(w.md,{status:eY,size:"sm",label:q(eq?z.rH:"status.".concat(eY)),className:eq?z.Jd:void 0,"data-unclassified":eq?"true":void 0}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:eH}),(0,n.jsx)(r(),{href:"/worktrees/".concat(m.id),className:"block truncate text-sm font-medium text-foreground underline-offset-2 hover:text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:hover:text-accent-400","data-testid":"session-tile-branch-".concat(m.id),title:eO,children:eO})]}),J.length>1&&(0,n.jsx)("select",{value:null!=(d=null==X?void 0:X.id)?d:"",onChange:eB,className:"max-w-[9rem] shrink-0 rounded-md border border-border bg-surface px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"session-tile-instance-".concat(m.id),"aria-label":q("sessions.tileInstanceAriaLabel"),children:J.map(e=>(0,n.jsx)("option",{value:e.id,children:(0,F.sw)(e)},e.id))}),ei&&(0,n.jsx)("button",{type:"button",onClick:ea,"aria-pressed":en,"aria-expanded":en,"aria-controls":eU,"aria-label":en?W("terminal.hideHistory"):W("terminal.showHistory"),title:en?W("terminal.hideHistory"):W("terminal.showHistory"),className:H(en),"data-testid":"session-tile-history-toggle-".concat(m.id),children:(0,n.jsx)(h.A,{size:14,"aria-hidden":"true"})}),(0,n.jsx)("div",{role:"group","aria-label":W("surfaceMode.groupLabelMobile"),className:"flex shrink-0 items-center gap-0.5 rounded-md border border-border p-0.5","data-testid":"session-tile-surface-mode-".concat(m.id),children:O.map(e=>{let{mode:t,labelKey:s,icon:a}=e,i=et===t,r=W(s);return(0,n.jsx)("button",{type:"button",onClick:()=>es(t),"aria-pressed":i,"aria-label":r,title:r,className:H(i),"data-testid":"session-tile-surface-".concat(t,"-").concat(m.id),children:(0,n.jsx)(a,{size:14,"aria-hidden":"true"})},t)})})]}),(0,n.jsx)("div",{ref:eo,className:"min-w-0 flex-1 overflow-hidden ".concat(eE.className),"data-testid":"session-tile-body-".concat(m.id),children:S&&ei?(0,n.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col","data-testid":"session-tile-terminal-stack-".concat(m.id),children:[(0,n.jsx)("div",{className:"relative min-w-0 overflow-hidden ".concat(er?"flex-[3_3_0%] min-h-[8.5rem]":"min-h-0 flex-1"),"data-testid":"session-tile-terminal-".concat(m.id),children:eP.noticeVisible&&null!==eP.startingSince?(0,n.jsx)(p.TE,{cliToolId:$,startingSince:eP.startingSince,onShowTerminal:eP.revealTerminal}):(0,n.jsx)(g.D,{output:eu.output,isActive:eu.isRunning,attaching:eu.attaching,isThinking:eu.isThinking,autoScroll:eu.autoScroll,onScrollChange:ex,disableAutoFollow:eK,compactTuiLayoutPadding:ez,preservePaintedPanelRows:eF,wrapMode:B.Wq.wrapMode,density:B.Wq.density})}),eT?(0,n.jsx)("div",{className:"min-w-0 shrink overflow-y-auto border-t border-border p-2 ".concat("min-h-[3rem] max-h-[8rem]"),"data-testid":"session-tile-selection-keys-".concat(m.id),children:(0,n.jsx)(b.Z,{worktreeId:m.id,cliToolId:$,instanceId:ee,onKeysSent:eh,frame:eu.output,surface:"terminal",showPagerKeys:eu.isPagerActive})}):null,er&&(0,n.jsx)("div",{id:eU,className:"min-w-0 overflow-hidden border-t border-border ".concat("flex-[2_2_0%] min-h-[6.5rem]"),"data-testid":"session-tile-history-".concat(m.id),children:(0,n.jsx)(f.bl,{messages:ek,worktreeId:m.id,worktreePath:m.path,cliToolId:$,isLoading:eg,onFilePathClick:V,onInsertToMessage:eA,onRetryPending:ew,onDiscardPending:eC,className:"h-full"})})]}):S?(0,n.jsx)(x.wY,{messages:ek,worktreeId:m.id,worktreePath:m.path,cliToolId:$,instanceId:Z,live:eL,frame:eu.output,onKeysSent:eh,onSurfaceModeChange:e_,compact:!0,history:eD}):(0,n.jsx)("div",{className:"h-full","data-testid":"session-tile-placeholder-".concat(m.id),"aria-hidden":"true"})}),S&&(0,n.jsx)("div",{ref:ed,className:"shrink-0 border-t border-border p-2","data-testid":"session-tile-composer-".concat(m.id),children:(0,n.jsx)(v.E,{worktreeId:m.id,cliToolId:$,instanceId:ee,isSessionRunning:eu.isRunning,isSessionStarting:eP.starting,onOptimisticSend:ey,onMessageSent:eM,pendingInsertText:eN,onInsertConsumed:eS,heightScope:R.CM,maxHeight:eR,autoYesSlot:(0,n.jsx)(y.T,{enabled:eI.enabled,expiresAt:eI.expiresAt,onToggle:eI.toggle,lastAutoResponse:null,cliToolName:$,inline:!0})})})]})}let J=(0,a.memo)(function(e){let{worktree:t,connectivity:s}=e,{ref:i,inViewport:r}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{rootMargin:t,threshold:s}=e,[n,i]=(0,a.useState)(!1),[r,l]=(0,a.useState)(null),o=(0,a.useCallback)(e=>{l(e)},[]);return(0,a.useEffect)(()=>{if("undefined"==typeof IntersectionObserver)return void i(!0);if(!r)return;let e=new IntersectionObserver(e=>{let t=e[e.length-1];t&&i(t.isIntersecting)},{rootMargin:t,threshold:s});return e.observe(r),()=>e.disconnect()},[r,t,s]),{ref:o,inViewport:n}}({rootMargin:"560px"});return(0,n.jsx)("div",{ref:i,className:"min-w-0 ".concat("h-[35rem]"),children:(0,n.jsx)(Y,{worktree:t,enabled:r,connectivity:s})})}),Q=(0,a.memo)(function(e){let{worktrees:t}=e,s=C();return(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2","data-testid":"sessions-tile-grid",children:t.map(e=>(0,n.jsx)(J,{worktree:e,connectivity:s},e.id))})});var G=s(80003);let X=(0,s(71847).A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),Z=["list","tile"];function $(e){return"string"==typeof e&&Z.includes(e)}let ee=[{mode:"list",labelKey:"sessions.viewMode.list",icon:G.A},{mode:"tile",labelKey:"sessions.viewMode.tile",icon:X}],et=(0,a.memo)(function(e){let{value:t,onChange:s}=e,a=(0,l.c)("common");return(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-1 rounded-md border border-input bg-surface p-0.5",role:"group","aria-label":a("sessions.viewMode.groupAriaLabel"),"data-testid":"sessions-view-mode",children:ee.map(e=>{let{mode:i,labelKey:r,icon:l}=e,o=t===i;return(0,n.jsx)("button",{type:"button",onClick:()=>s(i),"aria-pressed":o,"aria-label":a(r),title:a(r),"data-testid":"sessions-view-mode-".concat(i),className:"rounded p-1.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(o?"bg-accent-100 text-accent-700 dark:bg-accent-900/30 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(l,{size:16,"aria-hidden":"true"})},i)})})});var es=s(38218),en=s(50857),ea=s(7636),ei=s(83012);let er=[{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"status",labelKey:"sort.status"},{key:"lastSent",labelKey:"sort.lastSent"}],el={lastSent:"desc",updatedAt:"desc"},eo={ready:0,in_progress:1,in_review:2,done:3};function ec(e){let{status:t,label:s,unclassified:a}=e,i=(0,l.c)("common"),r=(0,z.Mq)(t,a),o="".concat(s,": ").concat(i(r?z.rH:"status.".concat(t)));return(0,n.jsx)(w.md,{status:t,size:"md",label:o,className:r?z.Jd:void 0,"data-unclassified":r?"true":void 0})}let ed={ready:"worktreeStatus.ready",in_progress:"worktreeStatus.inProgress",in_review:"worktreeStatus.inReview",done:"worktreeStatus.done"},eu={done:"bg-success-subtle text-success-foreground",in_review:"bg-info-subtle text-info-foreground",in_progress:"bg-accent-100 dark:bg-accent-900/30 text-accent-700 dark:text-accent-400"};function em(){let e=(0,l.c)("common"),t=(0,l.c)("worktree"),s=(0,es.a)(),{worktrees:i,isLoading:u,error:m,refresh:h}=(0,M.Fn)(),x=i.length>0,[f,g]=(0,a.useState)(""),[p,b]=(0,a.useState)("lastSent"),[v,y]=(0,a.useState)("desc"),{viewMode:j,setViewMode:k}=function(){let{value:e,setValue:t}=(0,P.V)({key:"mcbd-sessions-view-mode",defaultValue:"list",validate:$,serialize:e=>e,deserialize:e=>e});return{viewMode:e,setViewMode:(0,a.useCallback)(e=>t(e),[t])}}(),N="tile"===j;(0,a.useEffect)(()=>{(0,K.qD)()},[]);let A=(0,a.useMemo)(()=>{let e=i;if(f){let t=f.toLowerCase();e=e.filter(e=>{var s,n;return e.name.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t)||null!=(n=null==(s=e.repositoryDisplayName)?void 0:s.toLowerCase().includes(t))&&n})}let t=[...e];return t.sort((e,t)=>{var s,n,a,i,r,l,o,c;let d=0;switch(p){case"lastSent":{let s=(0,ea.nO)(e.lastUserMessageAt,t.lastUserMessageAt);if(!e.lastUserMessageAt&&!t.lastUserMessageAt)return 0;if(!e.lastUserMessageAt)return 1;if(!t.lastUserMessageAt)return -1;d=s;break}case"repositoryName":{let a=(null!=(s=e.repositoryDisplayName)?s:e.repositoryName).toLowerCase(),i=(null!=(n=t.repositoryDisplayName)?n:t.repositoryName).toLowerCase();0===(d=a.localeCompare(i))&&(d=e.name.toLowerCase().localeCompare(t.name.toLowerCase()));break}case"status":if(0==(d=(null!=(i=eo[null!=(a=e.status)?a:""])?i:4)-(null!=(l=eo[null!=(r=t.status)?r:""])?l:4))){let s=(null!=(o=e.repositoryDisplayName)?o:e.repositoryName).toLowerCase(),n=(null!=(c=t.repositoryDisplayName)?c:t.repositoryName).toLowerCase();d=s.localeCompare(n)}break;default:d=0}return("lastSent"===p?"desc"===v:"asc"===v)?d:-d}),t},[i,f,p,v]),S=(0,a.useCallback)(e=>{g(e.target.value)},[]),C=(0,a.useCallback)(e=>{var t;b(e),y(null!=(t=el[e])?t:"asc")},[]),I=(0,a.useCallback)(()=>{y(e=>"asc"===e?"desc":"asc")},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(d.k,{onRefresh:h,enabled:s,className:"".concat(N?"w-full px-4 sm:px-6 lg:px-8":"container-custom"," py-8 h-full"),children:[(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e("sessions.title")}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("sessions.description")})]}),(0,n.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,n.jsx)(w.pd,{type:"text",placeholder:e("sessions.filterPlaceholder"),value:f,onChange:S,className:"max-w-md flex-1","data-testid":"sessions-filter","aria-label":e("sessions.filterAriaLabel"),inputMode:"search",enterKeyHint:"search"}),(0,n.jsxs)(w.l6,{value:p,onValueChange:C,children:[(0,n.jsx)(w.bq,{className:"w-40","data-testid":"sessions-sort-select","aria-label":e("sessions.sortByAriaLabel"),children:(0,n.jsx)(w.yv,{})}),(0,n.jsx)(w.gC,{children:er.map(t=>(0,n.jsx)(w.eb,{value:t.key,children:e(t.labelKey)},t.key))})]}),(0,n.jsx)("button",{type:"button",onClick:I,"data-testid":"sessions-sort-direction","aria-label":"asc"===v?e("sessions.sortAscending"):e("sessions.sortDescending"),className:"rounded-md border border-input bg-surface p-2 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"asc"===v?(0,n.jsx)(o.A,{size:16,"aria-hidden":"true"}):(0,n.jsx)(c.A,{size:16,"aria-hidden":"true"})}),(0,n.jsx)(et,{value:j,onChange:k})]}),x?(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)("div",{className:"mb-4 rounded-md border border-danger-border bg-danger-subtle px-3 py-2 text-sm text-danger-foreground",role:"status","data-testid":"sessions-error-banner",children:e("sessions.refreshError",{message:m.message})}),N?0===A.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):(0,n.jsx)(Q,{worktrees:A}):(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-list",children:0===A.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):A.map((s,a)=>{var i,l,o,c;let d=null!=(i=s.selectedAgents)?i:(0,K.sA)(),u=s.lastUserMessage?s.lastUserMessage.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/g,"").replace(/[\u200B-\u200F\u2028-\u202F\uFEFF\u061C]/g,"").replace(/[\r\n\t]/g," ").replace(/\s+/g," ").trim():null,m=s.lastUserMessageAt?(0,ei.Fx)(String(s.lastUserMessageAt)):null,h=d.map(e=>{var t;let n=null==(t=s.sessionStatusByCli)?void 0:t[e];return{agent:e,status:(0,D.kA)(n),unclassified:(0,D.px)(n)}}),x=h.filter(e=>(0,en.Qo)(e.status)||e.unclassified),f=h.length-x.length,g=d.some(e=>{var t;let n=(0,D.kA)(null==(t=s.sessionStatusByCli)?void 0:t[e]);return"running"===n||"generating"===n});return(0,n.jsxs)(r(),{href:"/worktrees/".concat(s.id),style:{animationDelay:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(Number.isFinite(e)&&!(e<=0)&&!(e>=s))return"".concat(e*t,"ms")}(a)},className:"block bg-surface rounded-lg p-4 border transition-colors ".concat(g?"border-accent-500/40 shadow-[0_0_16px_-4px_rgb(var(--accent-500)/0.45)] hover:border-accent-400":"border-border shadow-sm hover:border-accent-300 dark:hover:border-accent-700"," ").concat("animate-in fade-in-0 slide-in-from-bottom-2 fill-mode-backwards duration-300"),"data-testid":"session-item-".concat(s.id),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:null!=(l=s.repositoryDisplayName)?l:s.repositoryName}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:s.name})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 ml-4 flex-shrink-0","data-testid":"session-agents-".concat(s.id),children:[x.map(e=>{let{agent:t,status:s,unclassified:a}=e;return(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-agent-".concat(t),children:[(0,n.jsx)(ec,{status:s,label:(0,F.oo)(t),unclassified:a}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,F.oo)(t)})]},t)}),f>0&&(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-idle-cluster-".concat(s.id),"aria-label":e("sessions.idleAgents",{count:f}),children:[(0,n.jsx)(w.md,{status:"idle",size:"sm","aria-hidden":!0,title:void 0}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums",children:["+",f]})]})]})]}),s.description&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 whitespace-pre-wrap",children:s.description})}),s.status&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded ".concat(null!=(c=eu[null!=(o=s.status)?o:""])?c:"bg-muted text-muted-foreground"),children:function(e,t){if(!e)return"";let s=ed[e];return s?t(s):e}(s.status,t)})}),u&&(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-2","data-testid":"session-message-".concat(s.id),children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate min-w-0 flex-1","data-testid":"session-message-text-".concat(s.id),title:u,children:u}),m&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0 whitespace-nowrap tabular-nums","data-testid":"session-time-".concat(s.id),children:m})]})]},s.id)})})]}):(0,n.jsxs)(n.Fragment,{children:[u&&(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-loading",role:"status","aria-label":e("sessions.loadingAriaLabel"),children:[0,1,2].map(e=>(0,n.jsxs)("div",{className:"block bg-surface rounded-lg p-4 border border-border shadow-sm",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,n.jsx)(w.EA,{className:"h-4 w-40 max-w-full"}),(0,n.jsx)(w.EA,{className:"h-3 w-56 max-w-full"})]}),(0,n.jsx)(w.EA,{className:"ml-4 h-3 w-16 flex-shrink-0"})]}),(0,n.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,n.jsx)(w.EA,{className:"h-3 min-w-0 flex-1"}),(0,n.jsx)(w.EA,{className:"h-3 w-10 flex-shrink-0"})]})]},e))}),!u&&m&&(0,n.jsx)("div",{className:"text-danger-foreground","data-testid":"sessions-error",children:e("sessions.loadError",{message:m.message})}),!u&&!m&&(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:f?e("sessions.noMatching"):e("sessions.empty")})]})]})})}}},e=>{e.O(0,[6809,4909,2770,2619,3662,6322,5521,8407,2407,344,6654,8606,5371,4768,4727,8441,1255,7358],()=>e(e.s=87047)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9404],{38021:(e,t,s)=>{"use strict";s.d(t,{n:()=>n});var l=s(95155),i=s(12115),a=s(18955);function n(e){let{apiUrl:t,alt:s,width:n,height:r,lazy:d=!1,loadingFallback:o,errorFallback:c,className:u,style:m,wrap:x}=e,h=(0,a.c)("worktree"),[g,p]=(0,i.useState)(null),[f,j]=(0,i.useState)("idle"),[b,k]=(0,i.useState)(!d),v=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(b)return;let e=v.current;if(!e||"undefined"==typeof IntersectionObserver)return void k(!0);let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(k(!0),t.disconnect())});return t.observe(e),()=>t.disconnect()},[b]),(0,i.useEffect)(()=>{if(!b)return;let e=!1;return p(null),j("idle"),fetch(t).then(e=>e.ok?e.json():null).then(t=>{e||("string"==typeof(null==t?void 0:t.content)&&t.content?(p(t.content),j("loaded")):j("error"))}).catch(()=>{e||j("error")}),()=>{e=!0}},[t,b]);let N=null!=o?o:(0,l.jsx)("span",{style:{color:"#999"},children:h("markdownPreview.loadingImage")});if("error"===f)return(0,l.jsx)(l.Fragment,{children:null!=c?c:N});if(!g)return d?(0,l.jsx)("span",{ref:v,children:N}):N;let y=(0,l.jsx)("img",{src:g,alt:s,width:n,height:r,className:u,style:null!=m?m:{maxWidth:n||"100%"},onError:void 0!==c?()=>j("error"):void 0});return x?(0,l.jsx)(l.Fragment,{children:x(y)}):y}},54014:(e,t,s)=>{"use strict";s.d(t,{Ab:()=>i,NL:()=>p,O6:()=>x,XH:()=>l,f_:()=>u,hR:()=>o,lu:()=>h,n6:()=>r,oo:()=>c,pQ:()=>a,sw:()=>m,vz:()=>g});let l=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity","command-code","opencode-v2"],i=10,a=50,n=/^[a-zA-Z0-9_-]+$/;function r(e){return"string"==typeof e&&e.length>0&&e.length<=64&&n.test(e)}let d={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity","command-code":"Command Code","opencode-v2":"OpenCode V2"};function o(e){return l.includes(e)}function c(e){var t;return null!=(t=d[e])?t:e}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Assistant";return e&&o(e)?c(e):t}function m(e){let t=e.alias;return"string"==typeof t&&t.trim().length>0?t:c(e.cliTool)}function x(e,t,s){let l=e.find(e=>e.id===t);return l?m(l):c(s)}function h(e){return e.map((e,t)=>({id:e,cliTool:e,alias:c(e),order:t}))}let g=128,p=2097152},68331:(e,t,s)=>{"use strict";s.d(t,{y:()=>r});var l=s(95155);s(12115);var i=s(18955),a=s(37381),n=s(95584);function r(e){let{catalog:t}=e,s=(0,i.c)("skills");return t.stale||t.offline?(0,l.jsx)(a.u,{tone:"warning","data-testid":"skill-catalog-stale",className:"flex-col sm:flex-row",children:(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("p",{className:"font-medium",children:s("catalog.staleHeading")}),(0,l.jsx)("p",{children:s("catalog.staleNotice")}),t.offline&&(0,l.jsx)("p",{children:s("catalog.offlineNotice")}),(0,l.jsx)("p",{children:s((0,n.pk)(t.staleReason))}),(0,l.jsxs)("p",{className:"break-words",children:[s("catalog.fetchedAt",{timestamp:t.fetchedAt})," \xb7"," ",s("catalog.revalidatedAt",{timestamp:t.revalidatedAt})]}),(0,l.jsx)("p",{className:"break-words",children:s("catalog.sourceLabel",{repository:t.source.repository,ref:t.source.ref})})]})}):(0,l.jsxs)("p",{"data-testid":"skill-catalog-fresh",className:"text-xs text-muted-foreground break-words",children:[s("catalog.freshLabel")," \xb7"," ",s("catalog.revalidatedAt",{timestamp:t.revalidatedAt})," \xb7"," ",s("catalog.sourceLabel",{repository:t.source.repository,ref:t.source.ref})]})}},69352:(e,t,s)=>{"use strict";s.d(t,{WU:()=>o,d3:()=>c,dj:()=>d,uO:()=>u});var l,i,a,n,r=s(9567);function d(e){return e.startsWith("#")?"anchor":e.startsWith("http://")||e.startsWith("https://")||e.startsWith("mailto:")||e.startsWith("tel:")?"external":"relative"}function o(e,t){if(!t)return null;let s=e.substring(0,e.lastIndexOf("/")+1);try{let e=new URL(s,"file:///"),l=new URL(t,e),i=decodeURIComponent(l.pathname);if(i.startsWith("/")){let e=i.substring(1);if(e.length>0)return e}}catch(e){}return null}function c(e){return!e||0===e.length||e.length>2048||/[\x00-\x1f\x7f]/.test(e)?null:e}let u={...r.j,attributes:{...r.j.attributes,a:[...(null!=(a=null==(l=r.j.attributes)?void 0:l.a)?a:[]).filter(e=>"href"!==e),["href",/^(?:#|mailto:|tel:|https?:\/\/|(?![a-zA-Z][a-zA-Z0-9+.-]*:))/]],img:[...(null!=(n=null==(i=r.j.attributes)?void 0:i.img)?n:[]).filter(e=>"src"!==e),["src",/^(?:https?:\/\/|(?![a-zA-Z][a-zA-Z0-9+.-]*:))/],"alt","width","height"]}}},74385:(e,t,s)=>{"use strict";s.d(t,{I:()=>l,k:()=>i});let l="skill:installed";function i(e){window.dispatchEvent(new CustomEvent(l,{detail:{worktreeId:e}}))}},76246:(e,t,s)=>{"use strict";function l(e){return e?e.split("/").map(encodeURIComponent).join("/"):""}s.d(t,{o:()=>l})},89675:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>R});var l=s(95155),i=s(20063),a=s(12115),n=s(52619),r=s.n(n),d=s(18955),o=s(35626),c=s(48407),u=s(99648),m=s(75333),x=s(68331),h=s(50825),g=s(5118),p=s(95584);function f(e){let{changelog:t}=e,s=(0,d.c)("skills"),i=(0,p.RG)(t).trim();return 0===i.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"skill-changelog-empty",children:s("detail.changelogEmpty")}):(0,l.jsxs)("div",{"data-testid":"skill-changelog",children:[(0,l.jsx)("div",{className:"prose prose-sm max-w-none dark:prose-invert break-words",children:(0,l.jsx)(g.G8,{content:i})}),(0,l.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:s("detail.mediaStripped")})]})}var j=s(34380),b=s(37381),k=s(80130);let v={status:"loading",catalog:null,skill:null,failure:null};function N(e){let{label:t,children:s,mono:i=!1}=e;return(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,l.jsx)("dd",{className:"mt-0.5 text-sm text-foreground ".concat(i?"break-all font-mono text-xs":"break-words"),children:s})]})}function y(e){let{title:t,children:s,testId:i}=e;return(0,l.jsxs)(c.Zp,{"data-testid":i,className:"space-y-3",children:[(0,l.jsx)("h2",{className:"text-base font-semibold text-foreground",children:t}),s]})}function w(e){var t;let{compatibility:s}=e,i=(0,d.c)("skills");return(0,l.jsx)("p",{className:"text-sm text-foreground","data-testid":"skill-compatibility-reason",children:i((0,p.e5)(s.messageKey),{range:s.requiredRange,currentVersion:null!=(t=s.currentVersion)?t:""})})}function I(e){let{version:t}=e,s=(0,d.c)("skills");return(0,l.jsxs)(c.Zp,{"data-testid":"skill-version-".concat(t.version),className:"space-y-3",padding:"sm",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"font-mono text-sm font-semibold text-foreground",children:t.version}),t.prerelease&&(0,l.jsx)(c.Ex,{variant:"warning",children:s("detail.prerelease")}),(0,l.jsx)(m.Xz,{status:t.compatibility.commandmate.status}),(0,l.jsx)(m.qW,{risk:t.declaredRisk})]}),(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,l.jsx)(N,{label:s("detail.publishedAt"),children:t.publishedAt}),(0,l.jsx)(N,{label:s("detail.requiredRangeLabel"),children:t.compatibility.commandmate.requiredRange}),(0,l.jsx)(N,{label:s("detail.sourceRepository"),children:t.source.repository}),(0,l.jsx)(N,{label:s("detail.sourceRef"),children:t.source.ref}),(0,l.jsx)(N,{label:s("detail.sourceCommit"),mono:!0,children:t.source.commit}),(0,l.jsx)(N,{label:s("detail.packageAsset"),mono:!0,children:t.artifact.assetName}),(0,l.jsx)(N,{label:s("detail.packageDigest"),mono:!0,children:t.artifact.sha256}),(0,l.jsx)(N,{label:s("detail.packageSize"),children:s("detail.packageBytes",{bytes:t.artifact.size})})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.compatibility.agents.length>0?t.compatibility.agents.map(e=>(0,l.jsx)(m.uE,{agent:e},e.agent)):(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:s("compatibility.agentsUnknown")})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:s("detail.changelogHeading")}),(0,l.jsx)("div",{className:"mt-1",children:(0,l.jsx)(f,{changelog:t.changelog})})]})]})}function A(e){var t,s,i,n,g,f,A,R,C;let{skillId:V}=e,E=(0,d.c)("skills"),[z,q]=(0,a.useState)(v),[W,U]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=new AbortController;return q(v),(0,k.Db)(V,e.signal).then(t=>{e.signal.aborted||q(t.ok?{status:"loaded",catalog:t.data.catalog,skill:t.data.skill,failure:null}:{status:"error",catalog:null,skill:null,failure:t.failure})}).catch(()=>{}),()=>e.abort()},[V,W]);let _=(0,a.useCallback)(()=>U(e=>e+1),[]),H=(0,l.jsxs)(r(),{href:"/skills",className:"inline-flex items-center gap-1 text-sm text-accent-600 hover:underline dark:text-accent-400","data-testid":"skill-detail-back",children:[(0,l.jsx)(o.A,{size:14,"aria-hidden":"true"}),E("page.backToCatalog")]});if("loading"===z.status)return(0,l.jsxs)("div",{className:"space-y-4","data-testid":"skill-detail-loading",children:[H,(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:E("state.loading")}),(0,l.jsx)(c.EA,{className:"h-40 w-full rounded-lg"})]});if("error"===z.status||!z.skill){let e=(null==(s=z.failure)?void 0:s.status)===404;return(0,l.jsxs)("div",{className:"space-y-4",children:[H,(0,l.jsxs)(c.Zp,{"data-testid":e?"skill-detail-not-found":"skill-detail-error",className:"space-y-3",children:[(0,l.jsx)("h2",{className:"text-base font-semibold text-foreground",children:E(e?"state.notFoundHeading":"state.errorHeading")}),(0,l.jsxs)(b.u,{tone:"danger",children:[(0,l.jsx)("p",{children:E(e?"state.notFoundNotice":"state.errorNotice")}),(0,l.jsx)("p",{className:"mt-1 break-words",children:E("state.errorCode",{code:null!=(n=null==(i=z.failure)?void 0:i.code)?n:""})})]}),!e&&(0,l.jsx)(c.$n,{variant:"secondary",size:"sm",onClick:_,"data-testid":"skill-detail-retry",children:E("state.retry")})]})]})}let O=z.skill,Z=O.compatibility,L=null!=(g=O.versions.find(e=>e.version===O.recommendedVersion))?g:null,S=null!=(f=null==(t=null!=L?L:O.versions[0])?void 0:t.declaredRisk)?f:null,F=O.recommendedVersion?Z&&"compatible"!==Z.status?E("detail.install.blockedIncompatible",{reason:E((0,p.e5)(Z.messageKey),{range:Z.requiredRange,currentVersion:null!=(A=Z.currentVersion)?A:""})}):null:E("detail.install.blockedNoVersion");return(0,l.jsxs)("div",{className:"space-y-4",children:[H,z.catalog&&(0,l.jsx)(x.y,{catalog:z.catalog}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-foreground break-words",children:O.name}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground break-words",children:O.summary}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[Z&&(0,l.jsx)(m.Xz,{status:Z.status}),S&&(0,l.jsx)(m.qW,{risk:S})]})]}),(0,l.jsx)(y,{title:E("detail.install.action"),testId:"skill-install-section",children:(0,l.jsx)(j.B,{skillId:O.id,version:O.recommendedVersion,blockedReason:F,agents:null!=(R=null==L?void 0:L.compatibility.agents)?R:[]})}),(0,l.jsxs)(y,{title:E("capabilities.heading"),testId:"skill-capabilities-section",children:[(0,l.jsx)("p",{className:"text-sm text-foreground break-words",children:O.summary}),(0,l.jsx)(b.u,{tone:"neutral",children:E("capabilities.unavailable")})]}),(0,l.jsxs)(y,{title:E("detail.overview"),testId:"skill-overview-section",children:[(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,l.jsx)(N,{label:E("detail.skillId"),mono:!0,children:O.id}),(0,l.jsx)(N,{label:E("detail.provider"),children:O.provider.url?(0,l.jsx)("a",{href:O.provider.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent-600 hover:underline dark:text-accent-400",children:O.provider.name}):O.provider.name}),O.provider.contact&&(0,l.jsx)(N,{label:E("detail.providerContact"),children:O.provider.contact}),(0,l.jsx)(N,{label:E("detail.license"),children:O.license}),O.homepage&&(0,l.jsx)(N,{label:E("detail.homepage"),children:(0,l.jsx)("a",{href:O.homepage,target:"_blank",rel:"noopener noreferrer",className:"break-all text-accent-600 hover:underline dark:text-accent-400",children:O.homepage})}),(0,l.jsx)(N,{label:E("detail.latestVersion"),mono:!0,children:O.latest}),(0,l.jsx)(N,{label:E("detail.recommendedVersion"),mono:!0,children:null!=(C=O.recommendedVersion)?C:E("detail.recommendedVersionNone")})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-recommendation-reason",children:E(p.TE[O.recommendedReason])}),O.keywords.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:E("detail.keywords")}),(0,l.jsx)("div",{className:"mt-1 flex flex-wrap gap-1.5",children:O.keywords.map(e=>(0,l.jsx)(c.Ex,{variant:"gray",children:e},e))})]})]}),(0,l.jsxs)(y,{title:E("compatibility.label"),testId:"skill-compatibility-section",children:[Z?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(m.Xz,{status:Z.status}),(0,l.jsx)("span",{className:"text-sm text-muted-foreground",children:E("compatibility.requiredRange",{range:Z.requiredRange})})]}),(0,l.jsx)(w,{compatibility:Z}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:Z.currentVersion?E("compatibility.currentVersion",{version:Z.currentVersion}):E("compatibility.currentVersionUnknown")}),"unknown"===Z.status&&(0,l.jsx)(b.u,{tone:"warning","data-testid":"skill-compatibility-unknown-notice",children:E("compatibility.unverifiedNotice")})]}):(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:E("compatibility.currentVersionUnknown")}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-foreground",children:E("compatibility.agentsHeading")}),L&&L.compatibility.agents.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:L.compatibility.agents.map(e=>(0,l.jsx)(m.uE,{agent:e},e.agent))}),(0,l.jsx)("div",{className:"space-y-3",children:L.compatibility.agents.map(e=>(0,l.jsx)(h.m,{agent:e},e.agent))})]}):(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:E("compatibility.agentsUnknown")}),(0,l.jsx)(b.u,{tone:"neutral",children:E("compatibility.agentsNotice")})]})]}),(0,l.jsxs)(y,{title:E("risk.declaredHeading"),testId:"skill-risk-section",children:[S?(0,l.jsx)(m.qW,{risk:S}):null,(0,l.jsx)(b.u,{tone:"neutral",children:E("risk.declaredNotice")}),"high"===S&&(0,l.jsx)(b.u,{tone:"danger","data-testid":"skill-high-risk-warning",children:E("risk.highWarning")}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-foreground",children:E("risk.computedHeading")}),(0,l.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":"skill-computed-risk-unavailable",children:E("risk.computedUnavailable")})]})]}),(0,l.jsxs)(y,{title:E("permissions.heading"),testId:"skill-permissions-section",children:[(0,l.jsx)(b.u,{tone:"warning","data-testid":"skill-permission-declaration-notice",children:E((0,p.e5)(u.Ms))}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:E("permissions.unavailable")})]}),(0,l.jsx)(y,{title:E("requirements.heading"),testId:"skill-requirements-section",children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:E("requirements.unavailable")})}),(0,l.jsx)(y,{title:E("contents.heading"),testId:"skill-contents-section",children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:E("contents.unavailable")})}),(0,l.jsxs)("section",{className:"space-y-3","data-testid":"skill-versions-section",children:[(0,l.jsx)("h2",{className:"text-base font-semibold text-foreground",children:E("detail.versionsHeading")}),0===O.versions.length?(0,l.jsx)(c.Zp,{children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:E("detail.versionsEmpty")})}):O.versions.map(e=>(0,l.jsx)(I,{version:e},e.version))]})]})}function R(){let e=(0,i.useParams)(),t="string"==typeof e.skillId?e.skillId:"";return(0,l.jsx)("div",{className:"container-custom py-8 overflow-auto h-full",children:(0,l.jsx)(A,{skillId:t})})}},99027:(e,t,s)=>{Promise.resolve().then(s.bind(s,89675))}},e=>{e.O(0,[6481,6809,4909,2770,2619,3662,6322,4541,8407,5371,2751,6288,8441,1255,7358],()=>e(e.s=99027)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1385],{17846:(u,D,e)=>{"use strict";e.d(D,{a:()=>s});var F=e(95155),t=e(12115),r=e(18955);function s(u){let{src:D,alt:e,onError:s}=u,n=(0,r.c)("worktree"),[a,o]=(0,t.useState)(!1);return a?(0,F.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,F.jsx)("svg",{className:"w-16 h-16 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,F.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,F.jsx)("p",{className:"text-sm",children:n("imageViewer.loadError")}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e})]}):(0,F.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,F.jsx)("img",{src:D,alt:e,onError:()=>{o(!0),null==s||s()},style:{maxWidth:"100%",maxHeight:"500px",objectFit:"contain"},className:"rounded-lg shadow-sm"})})}},20063:(u,D,e)=>{"use strict";var F=e(47260);e.o(F,"useParams")&&e.d(D,{useParams:function(){return F.useParams}}),e.o(F,"usePathname")&&e.d(D,{usePathname:function(){return F.usePathname}}),e.o(F,"useRouter")&&e.d(D,{useRouter:function(){return F.useRouter}}),e.o(F,"useSearchParams")&&e.d(D,{useSearchParams:function(){return F.useSearchParams}})},21286:(u,D,e)=>{"use strict";e.d(D,{A:()=>r});let F=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,t=Object.hasOwnProperty;class r{constructor(){this.occurrences,this.reset()}slug(u,D){var e,r;let s=(e=u,r=!0===D,"string"!=typeof e?"":(r||(e=e.toLowerCase()),e.replace(F,"").replace(/ /g,"-"))),n=s;for(;t.call(this.occurrences,s);)this.occurrences[n]++,s=n+"-"+this.occurrences[n];return this.occurrences[s]=0,s}reset(){this.occurrences=Object.create(null)}}},32366:(u,D,e)=>{Promise.resolve().then(e.bind(e,82743))},50666:(u,D,e)=>{"use strict";e.d(D,{Ck:()=>s});var F=e(95155),t=e(12115),r=e(53482);function s(u){let{children:D,as:e="div",className:s=""}=u,n=function u(D){return null==D||"boolean"==typeof D?"":"string"==typeof D?D:"number"==typeof D?String(D):Array.isArray(D)?D.map(u).join(""):t.isValidElement(D)?u(D.props.children):""}(D);if(!n||0===n.trim().length)return(0,F.jsx)(e,{className:s||void 0,children:D});let a="relative group ".concat("span"===e?"block ":"").concat(s).trim();return(0,F.jsxs)(e,{className:a,"data-testid":"code-block-with-copy",children:[D,(0,F.jsx)(r.i,{text:n,className:"absolute right-2 top-2 z-10 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 focus:opacity-100"})]})}},53482:(u,D,e)=>{"use strict";e.d(D,{i:()=>o});var F=e(95155),t=e(12115),r=e(60322),s=e(9900);function n(){return(0,F.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,F.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function a(){return(0,F.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,F.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function o(u){let{text:D,className:e="",label:o="Copy"}=u,[l,c]=(0,t.useState)(!1),i=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[]);let C=(0,t.useCallback)(async()=>{try{await (0,r.l)(D),c(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>c(!1),s.s7)}catch(u){}},[D]);return(0,F.jsxs)("button",{type:"button",onClick:C,className:"inline-flex items-center gap-1 rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-foreground transition-colors hover:bg-muted ".concat(e),"aria-label":l?"Copied":o,title:l?"Copied!":o,children:[l?(0,F.jsx)(a,{}):(0,F.jsx)(n,{}),(0,F.jsx)("span",{children:l?"Copied":o})]})}},55924:(u,D,e)=>{"use strict";e.d(D,{K:()=>r});var F=e(95155),t=e(12115);function r(u){let{entries:D,title:e,headerOffset:r=64,root:s=null,className:n=""}=u,[a,o]=(0,t.useState)(null);return((0,t.useRef)(null).current=a,(0,t.useEffect)(()=>{if("undefined"==typeof IntersectionObserver||0===D.length)return;let u=new IntersectionObserver(u=>{let D=function(u){let D=u.filter(u=>u.isIntersecting).sort((u,D)=>u.boundingClientRect.top-D.boundingClientRect.top);return D.length>0?D[0].target.id:null}(u);D&&o(D)},{root:s,rootMargin:"-".concat(r,"px 0px -70% 0px"),threshold:0}),e=[];for(let F of D){let D=document.getElementById(F.id);D&&(u.observe(D),e.push(D))}return()=>{u.disconnect(),e.length=0}},[D,r,s]),0===D.length)?null:(0,F.jsxs)("nav",{"aria-label":e,className:n,children:[(0,F.jsx)("p",{className:"px-3 pb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:e}),(0,F.jsx)("ul",{className:"space-y-0.5 text-sm",children:D.map((u,D)=>{let e=u.id===a;return(0,F.jsx)("li",{children:(0,F.jsx)("a",{href:"#".concat(u.id),onClick:D=>((u,D)=>{u.preventDefault();let e="undefined"!=typeof document?document.getElementById(D):null;e&&e.scrollIntoView({behavior:"smooth",block:"start"}),o(D)})(D,u.id),"aria-current":e?"location":void 0,"data-depth":u.depth,style:{paddingLeft:"".concat((u.depth-1)*12+12,"px")},className:["block truncate rounded py-1 pr-2 transition-colors",e?"bg-accent-50 font-medium text-accent-700":"text-muted-foreground hover:bg-muted hover:text-foreground"].join(" "),title:u.text,children:u.text})},"".concat(u.id,"-").concat(D))})})]})}},69264:(u,D,e)=>{"use strict";e.d(D,{u:()=>n});var F=e(95155),t=e(12115),r=e(18955),s=e(3005);function n(u){let{src:D,onError:e}=u,n=(0,r.c)("worktree"),[a,o]=(0,t.useState)(!0),[l,c]=(0,t.useState)(!1);return l?(0,F.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,F.jsx)("svg",{className:"w-16 h-16 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,F.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})}),(0,F.jsx)("p",{className:"text-sm",children:n("videoViewer.loadError")})]}):(0,F.jsxs)("div",{className:"flex flex-col items-center justify-center p-4",children:[a&&(0,F.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,F.jsx)(s.y,{size:"xl",variant:"accent"}),(0,F.jsx)("p",{className:"ml-3 text-muted-foreground",children:n("videoViewer.loading")})]}),(0,F.jsx)("video",{controls:!0,src:D,onLoadedData:()=>{o(!1)},onError:()=>{o(!1),c(!0),null==e||e()},style:{maxWidth:"100%",maxHeight:"500px",display:a?"none":"block"},className:"rounded-lg shadow-sm",children:n("videoViewer.unsupported")})]})}},79962:(u,D,e)=>{"use strict";e.d(D,{K:()=>n,Y:()=>t});var F=e(21286);let t="commandmate:md-toc-visible",r=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/,s=/^( {0,3})(`{3,}|~{3,})(.*)$/;function n(u){if(!u)return[];let D=new F.A,e=[],t=null,n=0;for(let F of u.split("\n")){var a;let u=s.exec(F);if(t){if(u){let D=u[2];D[0]===t&&D.length>=n&&""===u[3].trim()&&(t=null,n=0)}continue}if(u){let D=u[2],e=D[0];if("`"===e&&u[3].includes("`"));else{t=e,n=D.length;continue}}let o=r.exec(F);if(!o)continue;let l=o[1].length,c=function(u){let D=u;return(D=(D=(D=(D=(D=(D=(D=(D=(D=(D=D.replace(/!\[[^\]]*\]\([^)]*\)/g,"")).replace(/!\[[^\]]*\]\[[^\]]*\]/g,"")).replace(/\[([^\]]*)\]\([^)]*\)/g,"$1")).replace(/\[([^\]]*)\]\[[^\]]*\]/g,"$1")).replace(/\[([^\]]*)\]/g,"$1")).replace(/(`+)([\s\S]*?)\1/g,"$2")).replace(/(\*\*|__)(.*?)\1/g,"$2")).replace(/(\*|_)(.*?)\1/g,"$2")).replace(/~~(.*?)~~/g,"$1")).replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")).trim()}((null!=(a=o[2])?a:"").replace(/([ \t]|^)#+[ \t]*$/,"")),i=D.slug(c);e.push({depth:l,text:c,id:i})}return e}},80003:(u,D,e)=>{"use strict";e.d(D,{A:()=>F});let F=(0,e(71847).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])},82743:(u,D,e)=>{"use strict";e.r(D),e.d(D,{default:()=>m});var F=e(95155),t=e(12115),r=e(20063),s=e(18955),n=e(80003);let a=(0,e(71847).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);var o=e(48407),l=e(36578),c=e(22133),i=e(5225),C=e(92254),E=e(17846),d=e(69264),A=e(55924),B=e(32388),h=e(11620),x=e(50666),p=e(79962);function m(){let u=(0,r.useRouter)(),D=(0,r.useParams)(),e=(0,s.c)("common"),m=(0,s.c)("worktree"),g=D.id,f=D.path.join("/"),[j,y]=(0,t.useState)(null),[b,v]=(0,t.useState)(!0),[k,N]=(0,t.useState)(null),[w,L]=(0,t.useState)(!0),[M,S]=(0,t.useState)(!1),P=(null==j?void 0:j.extension)==="md"||(null==j?void 0:j.extension)==="markdown",z=(0,t.useMemo)(()=>P&&j?(0,p.K)(j.content):[],[P,j]),$=z.length>=2,V=P&&$&&w;return(0,t.useEffect)(()=>{let u=localStorage.getItem(p.Y);"true"===u?L(!0):"false"===u&&L(!1),S(!0)},[]),(0,t.useEffect)(()=>{M&&localStorage.setItem(p.Y,String(w))},[w,M]),(0,t.useEffect)(()=>{(async()=>{v(!0),N(null);try{let u=await fetch("/api/worktrees/".concat(g,"/files/").concat(f));if(!u.ok){let D=await u.json();throw Error(D.error||"Failed to load file")}let D=await u.json();y(D)}catch(u){N(u instanceof Error?u.message:"Failed to load file")}finally{v(!1)}})()},[g,f]),(0,F.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,F.jsx)("div",{className:"sticky top-0 z-10 bg-white border-b border-gray-200 shadow-sm",children:(0,F.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center gap-3",children:[(0,F.jsxs)("button",{onClick:()=>u.back(),className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 transition-colors","aria-label":e("back"),children:[(0,F.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,F.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),(0,F.jsx)("span",{className:"hidden sm:inline",children:e("back")})]}),(0,F.jsx)("div",{className:"flex-1 min-w-0",children:(0,F.jsx)("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:f})}),P&&$&&(0,F.jsxs)("button",{onClick:()=>L(u=>!u),"aria-pressed":w,"aria-label":m(w?"toc.hide":"toc.show"),title:m(w?"toc.hide":"toc.show"),className:"hidden lg:flex items-center gap-1.5 flex-shrink-0 rounded-md border border-gray-200 px-2.5 py-1.5 text-sm text-gray-600 hover:bg-gray-50 hover:text-gray-900 transition-colors",children:[w?(0,F.jsx)(n.A,{className:"w-4 h-4"}):(0,F.jsx)(a,{className:"w-4 h-4"}),(0,F.jsx)("span",{className:"hidden xl:inline",children:m("toc.title")})]})]})}),(0,F.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-6",children:[b&&(0,F.jsx)(o.Zp,{padding:"lg",children:(0,F.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,F.jsx)(o.y$,{size:"xl",variant:"accent"}),(0,F.jsx)("p",{className:"ml-3 text-gray-600",children:"Loading file..."})]})}),k&&(0,F.jsx)(o.Zp,{padding:"lg",children:(0,F.jsx)("div",{className:"bg-danger-subtle border border-danger-border rounded-lg p-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("svg",{className:"w-5 h-5 text-danger-foreground flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,F.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,F.jsx)("p",{className:"text-sm text-danger-foreground",children:k})]})})}),j&&!b&&!k&&(0,F.jsxs)(o.Zp,{padding:"none",children:[(0,F.jsx)("div",{className:"bg-gray-100 px-4 py-3 border-b border-gray-200",children:(0,F.jsxs)("p",{className:"text-xs text-gray-600 font-mono break-all",children:[j.worktreePath,"/",j.path]})}),(0,F.jsx)("div",{className:"p-6 sm:p-8 bg-white",children:j.isVideo?(0,F.jsx)(d.u,{src:j.content,mimeType:j.mimeType}):j.isImage?(0,F.jsx)(E.a,{src:j.content,alt:j.path,mimeType:j.mimeType}):P?(0,F.jsxs)("div",{className:"lg:flex lg:gap-6 lg:items-start",children:[(0,F.jsx)("div",{className:"min-w-0 lg:flex-1 prose prose-slate max-w-none prose-headings:font-semibold prose-headings:scroll-mt-[57px] prose-h1:text-3xl prose-h1:border-b prose-h1:pb-2 prose-h2:text-2xl prose-h2:border-b prose-h2:pb-2 prose-h3:text-xl prose-a:text-accent-600 prose-a:no-underline hover:prose-a:underline prose-code:text-sm prose-code:bg-gray-100 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none prose-img:rounded-lg prose-img:shadow-md",children:(0,F.jsx)(l.oz,{remarkPlugins:[c.A],rehypePlugins:[C.A,i.A],components:{code:u=>{let{className:D,children:e,...t}=u;return(0,h.c)(D)?(0,F.jsx)(B.AY,{className:D,children:e}):D&&D.includes("language-")?(0,F.jsx)("code",{className:D,...t,children:e}):(0,F.jsx)("code",{className:"bg-gray-100 text-gray-800 px-1.5 py-0.5 rounded text-sm font-mono",...t,children:e})},pre:u=>{let{children:D}=u;return(0,h.D)(D)?(0,F.jsx)(F.Fragment,{children:D}):(0,F.jsx)(x.Ck,{children:(0,F.jsx)("pre",{className:"overflow-x-auto",children:D})})},table:u=>{let{children:D}=u;return(0,F.jsx)("div",{className:"overflow-x-auto",children:(0,F.jsx)("table",{className:"border-collapse border border-gray-300",children:D})})},th:u=>{let{children:D}=u;return(0,F.jsx)("th",{className:"border border-gray-300 bg-gray-100 px-4 py-2 text-left font-semibold",children:D})},td:u=>{let{children:D}=u;return(0,F.jsx)("td",{className:"border border-gray-300 px-4 py-2",children:D})},blockquote:u=>{let{children:D}=u;return(0,F.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 italic text-gray-700",children:D})}},children:j.content})}),V&&(0,F.jsx)("aside",{className:"hidden lg:block lg:w-64 lg:flex-shrink-0",children:(0,F.jsx)("div",{className:"lg:sticky",style:{top:"".concat(65,"px")},children:(0,F.jsx)(A.K,{entries:z,title:m("toc.title"),headerOffset:57})})})]}):(0,F.jsx)("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 overflow-x-auto text-sm",children:(0,F.jsx)("code",{className:"language-".concat(j.extension),children:j.content})})})]})]})]})}},92254:(u,D,e)=>{"use strict";e.d(D,{A:()=>n});var F=e(21286),t=e(95139);let r={},s=new F.A;function n(u){let D=(u||r).prefix||"";return function(u){s.reset(),(0,t.YR)(u,"element",function(u){(function(u){let D="element"===u.type?u.tagName.toLowerCase():"",e=2===D.length&&104===D.charCodeAt(0)?D.charCodeAt(1):0;return e>48&&e<55?e-48:void 0})(u)&&!u.properties.id&&(u.properties.id=D+s.slug("children"in u?function u(D){let e=-1,F=[];for(;++e<D.children.length;){var t;F[e]="text"===(t=D.children[e]).type?t.value:"children"in t?u(t):""}return F.join("")}(u):"value"in u?u.value:""))})}}}},u=>{u.O(0,[6809,4909,2770,3662,8407,5371,8441,1255,7358],()=>u(u.s=32366)),_N_E=u.O()}]);