commandmate 0.48.0 → 0.49.0

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 (269) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +164 -164
  3. package/.next/app-path-routes-manifest.json +30 -30
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
  9. package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/capabilities/route.js +1 -1
  17. package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/push/escalation/route.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.js +1 -1
  34. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  63. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  70. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  89. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  92. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  95. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  98. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
  101. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  104. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  107. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  109. package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
  110. package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  113. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/prompt-response/strict/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  137. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
  149. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
  151. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  152. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  153. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  154. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  155. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  156. package/.next/server/app/page_client-reference-manifest.js +1 -1
  157. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  158. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  159. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  160. package/.next/server/app/sessions/page.js +1 -1
  161. package/.next/server/app/sessions/page.js.nft.json +1 -1
  162. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  163. package/.next/server/app/skills/[skillId]/page.js +1 -1
  164. package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
  165. package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
  166. package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
  167. package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  168. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +2 -2
  169. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  170. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  171. package/.next/server/app/worktrees/[id]/page.js +3 -3
  172. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  173. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  174. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  175. package/.next/server/app-paths-manifest.json +30 -30
  176. package/.next/server/chunks/1601.js +2 -2
  177. package/.next/server/chunks/1656.js +2 -2
  178. package/.next/server/chunks/1945.js +3 -3
  179. package/.next/server/chunks/2069.js +1 -0
  180. package/.next/server/chunks/2422.js +1 -1
  181. package/.next/server/chunks/2534.js +1 -1
  182. package/.next/server/chunks/3241.js +1 -1
  183. package/.next/server/chunks/4243.js +1 -1
  184. package/.next/server/chunks/4248.js +1 -1
  185. package/.next/server/chunks/4280.js +1 -1
  186. package/.next/server/chunks/6119.js +1 -1
  187. package/.next/server/chunks/6130.js +1 -1
  188. package/.next/server/chunks/6401.js +1 -1
  189. package/.next/server/chunks/6486.js +1 -1
  190. package/.next/server/chunks/720.js +2 -2
  191. package/.next/server/chunks/7604.js +2 -2
  192. package/.next/server/chunks/7905.js +1 -1
  193. package/.next/server/chunks/8581.js +3 -3
  194. package/.next/server/chunks/8728.js +3 -3
  195. package/.next/server/chunks/8791.js +1 -1
  196. package/.next/server/chunks/9390.js +1 -1
  197. package/.next/server/chunks/9627.js +3 -3
  198. package/.next/server/middleware-manifest.json +5 -5
  199. package/.next/server/pages/500.html +1 -1
  200. package/.next/server/server-reference-manifest.json +1 -1
  201. package/.next/static/chunks/1128-914c559913546bbc.js +1 -0
  202. package/.next/static/chunks/{2407-26139a8a2f1adbe8.js → 2407-ab92ae9837c39dce.js} +1 -1
  203. package/.next/static/chunks/{2619-a305ad4810f1393a.js → 2619-04bc32f026a0d946.js} +1 -1
  204. package/.next/static/chunks/{2863-f0121af1cbbedb3b.js → 2863-7173dc305dffc4f6.js} +1 -1
  205. package/.next/static/chunks/6288-6fadbba6e84393b2.js +1 -0
  206. package/.next/static/chunks/7665-e9ef6e0a85b9fa49.js +1 -0
  207. package/.next/static/chunks/{8165-c68b3dc844210e6a.js → 8165-263172c17ae8e8c3.js} +1 -1
  208. package/.next/static/chunks/9079-987939d231704218.js +1 -0
  209. package/.next/static/chunks/app/{layout-46b4cbf07520d9b6.js → layout-aa8e66164a4367af.js} +1 -1
  210. package/.next/static/chunks/app/sessions/{page-fb241bed579c67aa.js → page-cfd645305e25fd33.js} +1 -1
  211. package/.next/static/chunks/app/skills/[skillId]/{page-52ba58712faf3378.js → page-cb6e74fd9a6a571d.js} +1 -1
  212. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-704086656fb45699.js +1 -0
  213. package/.next/static/chunks/app/worktrees/[id]/{page-cbc7749a33450cc5.js → page-a8d7886703ffc7b4.js} +1 -1
  214. package/.next/static/chunks/app/worktrees/[id]/terminal/{page-c601f3b3ece6557e.js → page-373ea37b16d930c7.js} +1 -1
  215. package/.next/static/css/{743f79ff19ab91e9.css → db8959555c3d9c96.css} +1 -1
  216. package/.next/trace +13 -13
  217. package/dist/cli/commands/auto-yes.d.ts.map +1 -1
  218. package/dist/cli/commands/auto-yes.js +3 -5
  219. package/dist/cli/commands/capture.d.ts.map +1 -1
  220. package/dist/cli/commands/capture.js +5 -0
  221. package/dist/cli/commands/send.d.ts.map +1 -1
  222. package/dist/cli/commands/send.js +4 -6
  223. package/dist/cli/commands/verify.d.ts.map +1 -1
  224. package/dist/cli/commands/verify.js +8 -1
  225. package/dist/cli/config/duration-constants.d.ts +16 -13
  226. package/dist/cli/config/duration-constants.d.ts.map +1 -1
  227. package/dist/cli/config/duration-constants.js +21 -21
  228. package/dist/cli/docs/agent-operations.d.ts +1 -1
  229. package/dist/cli/docs/agent-operations.d.ts.map +1 -1
  230. package/dist/cli/docs/agent-operations.js +2 -1
  231. package/dist/cli/types/api-responses.d.ts +29 -1
  232. package/dist/cli/types/api-responses.d.ts.map +1 -1
  233. package/dist/cli/utils/verify-runner.d.ts +24 -1
  234. package/dist/cli/utils/verify-runner.d.ts.map +1 -1
  235. package/dist/cli/utils/verify-runner.js +54 -1
  236. package/dist/config/auto-yes-duration.d.ts +56 -0
  237. package/dist/config/auto-yes-duration.d.ts.map +1 -0
  238. package/dist/config/auto-yes-duration.js +76 -0
  239. package/dist/server/src/config/auto-yes-config.js +14 -19
  240. package/dist/server/src/config/auto-yes-duration.js +76 -0
  241. package/dist/server/src/lib/auto-yes-state.js +9 -2
  242. package/dist/server/src/lib/cli-tools/submit-verified-sender.js +137 -14
  243. package/dist/server/src/lib/detection/composer-text.js +215 -11
  244. package/dist/server/src/lib/detection/prompt-detect-multiple-choice-chrome.js +193 -0
  245. package/dist/server/src/lib/detection/prompt-detect-multiple-choice.js +8 -191
  246. package/dist/server/src/lib/detection/upstream-faults.js +19 -2
  247. package/dist/server/src/lib/hooks/structured-decision-response.js +1 -1
  248. package/dist/server/src/lib/polling/auto-yes-manual-answer.js +4 -2
  249. package/dist/server/src/lib/polling/response-checker.js +12 -15
  250. package/dist/server/src/lib/session/composer-clear.js +56 -4
  251. package/dist/server/src/lib/session/current-output-builder.js +2 -1
  252. package/dist/server/src/lib/session/send-attempt-state.js +2 -1
  253. package/dist/server/src/lib/session/waiting-episode-state-ops.js +152 -0
  254. package/dist/server/src/lib/session/waiting-episode-state-store.js +202 -0
  255. package/dist/server/src/lib/session/waiting-episode-state-types.js +6 -0
  256. package/dist/server/src/lib/session/waiting-episode-state.js +26 -339
  257. package/dist/server/src/lib/tmux/tmux.js +25 -0
  258. package/dist/server/src/lib/verification/gate-runner.js +11 -4
  259. package/docs/en/user-guide/webapp-guide.md +15 -10
  260. package/package.json +1 -1
  261. package/release-notes/0.49.0.json +45 -0
  262. package/.next/server/chunks/6722.js +0 -1
  263. package/.next/static/chunks/2099-c3e0ab70a1b95dd3.js +0 -1
  264. package/.next/static/chunks/5371-a549a0d2c2044d41.js +0 -1
  265. package/.next/static/chunks/6288-09feba367cc2c65e.js +0 -1
  266. package/.next/static/chunks/9079-406b84d3cc891a87.js +0 -1
  267. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-9cf1ecc59e36a004.js +0 -1
  268. /package/.next/static/{PTlAswXLq8PAe2vUJ8dVP → 3_JtAZaKMJEDFIIfkHv4n}/_buildManifest.js +0 -0
  269. /package/.next/static/{PTlAswXLq8PAe2vUJ8dVP → 3_JtAZaKMJEDFIIfkHv4n}/_ssgManifest.js +0 -0
@@ -16,12 +16,12 @@ document.addEventListener('click', function(e) {
16
16
  });
17
17
  </script>`;function bD({worktreeId:a,htmlContent:b,filePath:c}){let[f,g]=(0,e.useState)("preview"),[i,j]=(0,e.useState)("safe"),k=(0,e.useRef)(new Set),l=(0,h.c)("worktree"),m=(0,a4.SC)(),n=(0,e.useCallback)(async a=>{if("interactive"===a&&!k.current.has(c)){if(!await m({description:l("htmlPreview.interactiveModeConfirm")}))return;k.current.add(c)}j(a)},[c,m,l]),o=function(a,b,c){let[d,f]=(0,e.useState)(null);return((0,e.useMemo)(()=>(function(a,b){let c=new DOMParser().parseFromString(a,"text/html"),d=new Set,e=[];for(let a of Array.from(c.querySelectorAll("img[src]"))){let c=a.getAttribute("src")??"";if(d.has(c)||!function(a){if(!a)return!1;let b=a.toLowerCase();return!br.some(a=>b.startsWith(a))}(c))continue;let f=(0,bq.WU)(b,c);null!==f&&(d.add(c),e.push({src:c,resolvedPath:f}))}return e})(c,b).slice(0,50),[c,b]),d&&d.worktreeId===a&&d.filePath===b&&d.htmlContent===c)?d.html:c}(a,c,b),p=(0,e.useMemo)(()=>"interactive"!==i?o:o.includes("</body>")?o.replace("</body>",`${bC}</body>`):o+bC,[o,i]),q=(0,e.useMemo)(()=>{try{return bv.highlight(b,{language:"html",ignoreIllegals:!0}).value}catch{return bv.highlightAuto(b).value}},[b]),r=(0,e.useMemo)(()=>Array.from({length:b.split("\n").length},(a,b)=>b+1),[b]),s=(0,e.useMemo)(()=>q.split("\n"),[q]);return(0,d.jsxs)("div",{className:"flex flex-col h-full","data-testid":"html-preview-mobile",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-1 border-b border-border bg-muted",children:[(0,d.jsx)("div",{className:"flex gap-1",children:["source","preview"].map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>g(a),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${f===a?"bg-accent-100 dark:bg-accent-900/50 text-accent-700 dark:text-accent-300":"text-muted-foreground hover:bg-muted"}`,children:"source"===a?l("fileViewer.tabSource"):l("fileViewer.tabPreview")},a))}),(0,d.jsx)("div",{className:"flex gap-1",children:["safe","interactive"].map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>n(a),className:`px-2 py-1 text-xs font-medium rounded-md transition-colors ${i===a?"safe"===a?"bg-success-subtle text-success-foreground":"bg-warning-subtle text-warning-foreground":"text-muted-foreground hover:bg-muted"}`,children:"safe"===a?l("fileViewer.sandboxSafe"):l("fileViewer.sandboxInteractive")},a))})]}),(0,d.jsx)("div",{className:"flex-1 overflow-auto min-h-0",children:"source"===f?(0,d.jsx)("table",{className:"text-sm w-full border-collapse",children:(0,d.jsx)("tbody",{children:r.map(a=>{let b=a-1;return(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{className:"pl-3 pr-2 text-right select-none font-mono border-r border-border bg-muted dark:bg-muted/50 sticky left-0 align-top whitespace-nowrap text-muted-foreground",children:a}),(0,d.jsx)("td",{className:"px-4 text-foreground align-top",children:(0,d.jsx)("pre",{className:"m-0 whitespace-pre-wrap break-words font-mono",children:(0,d.jsx)("code",{className:"hljs",dangerouslySetInnerHTML:{__html:s[b]??""}})})})]},a)})})}):(0,d.jsx)("iframe",{srcDoc:p,sandbox:bf[i],title:l("htmlPreview.title",{path:c}),className:"w-full h-full border-0 bg-white"},`${c}-${i}`)})]})}function bE({reason:a}){return(0,d.jsxs)("div",{"data-testid":"file-read-only-notice","data-reason-code":a.code,role:"status",className:"flex items-center gap-2 px-3 py-2 bg-warning-subtle border-b border-warning-border text-xs text-warning-foreground",children:[(0,d.jsx)(bl,{className:"w-3.5 h-3.5 shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{children:a.message})]})}let bF=(0,e.memo)(function({isOpen:a,onClose:b,worktreeId:c,filePath:f,onFileSaved:g,onOpenFile:j}){let[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(null),{copied:r,markCopied:s,reset:t}=(0,bu.q)(),{copied:u,markCopied:v}=(0,bu.q)(),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(0),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)("viewer"),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(null),[I,J]=(0,e.useState)(!1),K=(0,e.useRef)(null),L=(0,h.c)("worktree"),M=(0,a4.SC)(),N=l?G??l.content:void 0,{searchOpen:O,searchQuery:P,searchMatches:Q,searchCurrentIdx:R,searchInputRef:S,openSearch:T,closeSearch:U,nextMatch:V,prevMatch:W,setSearchQuery:X}=bt(N),Y=(0,e.useMemo)(()=>!!(l?.content&&!l.isImage&&!l.isVideo&&!l.isPdf),[l]),Z=l?.extension.toLowerCase()??"",$="md"===Z,_=!!(l&&!l.readOnly&&!l.isHtml&&bj(`.${Z}`)),aa=$?C:O?"viewer":"editor",ab=(0,e.useCallback)(async()=>{if(Y&&N)try{await (0,bk.l)(N),s()}catch{}},[Y,N,s]),ac=(0,e.useCallback)(async()=>{try{await (0,bk.l)(f),v()}catch{}},[f,v]),ad=(0,e.useCallback)(()=>{B(a=>!a)},[]);(0,e.useEffect)(()=>{if(0===Q.length||!K.current)return;let a=Q[R],b=K.current.querySelector(`[data-line="${a}"]`);b&&"function"==typeof b.scrollIntoView&&b.scrollIntoView({block:"center",behavior:"smooth"})},[R,Q]),(0,e.useEffect)(()=>{if(!A||_)return;let a=a=>{(0,bw.cE)(a)&&B(!1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[A,_]),(0,e.useEffect)(()=>{if(!a||!f){m(null),q(null),t(),D("viewer"),F(!1),H(null),J(!1),U();return}D("viewer"),F(!1),H(null),J(!1),(async()=>{o(!0),q(null);try{let a=await fetch(`/api/worktrees/${c}/files/${(0,bp.o)(f)}`);if(!a.ok){let b=await a.json(),c="string"==typeof b.error?b.error:b.error?.message||L("fileViewer.loadError");throw Error(c)}let b=await a.json();m(b)}catch(a){q(a instanceof Error?a.message:L("fileViewer.loadError"))}finally{o(!1)}})()},[a,c,f]),(0,e.useEffect)(()=>{x(null),z(0),l&&"md"===l.extension&&bA.test(l.content)&&!(l.content.length>1e6)&&(async()=>{try{let a=await fetch(`/api/worktrees/${c}/marp-render`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({markdownContent:l.content})});if(a.ok){let b=await a.json();x(b.slides)}}catch{}})()},[l,c]);let ae=!!(w&&w.length>0),ag=(0,e.useCallback)(a=>{H(a)},[]),ah=(0,e.useCallback)((a,b)=>{m(a=>a?{...a,content:b}:a),H(b),g?.(a)},[g]),ai=(0,e.useCallback)(async()=>{(!I||await M({description:L("editor.unsavedCloseConfirm"),variant:"danger"}))&&b()},[I,M,L,b]);(0,e.useEffect)(()=>{if(!_||E)return;let a=a=>{(0,bw.cE)(a)&&(O?U():A?B(!1):ai())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[_,E,O,A,ai]);let[aj,ak]=(0,e.useState)("");(0,e.useEffect)(()=>{$&&"viewer"===aa&&void 0!==N&&ak(N)},[$,aa,N]),(0,e.useEffect)(()=>{if(!_||!a)return;let b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=b}},[_,a]);let al=(0,e.useMemo)(()=>{if(!l||void 0===N||l.isImage||l.isVideo||l.isHtml||l.isPdf)return null;let a=Array.from({length:N.split("\n").length},(a,b)=>b+1);try{return{lineNumbers:a,highlightedHtml:bv.highlight(N,{language:l.extension,ignoreIllegals:!0}).value}}catch{return{lineNumbers:a,highlightedHtml:bv.highlightAuto(N).value}}},[l,N]),am=()=>l?l.isImage?(0,d.jsx)(a5.a,{src:l.content,alt:l.path,mimeType:l.mimeType}):l.isVideo?(0,d.jsx)(a6.u,{src:l.content,mimeType:l.mimeType}):l.isPdf?(0,d.jsx)("div",{className:"h-full min-h-[40vh]",children:(0,d.jsx)(a7.n,{dataUri:l.content,filePath:f,variant:"download"})}):l.isHtml?(0,d.jsx)(bD,{worktreeId:c,htmlContent:l.content,filePath:f}):an():null,an=()=>{if(!al)return null;let a=new Set(Q),b=Q.length>0?Q[R]:-1,c=al.highlightedHtml.split("\n");return(0,d.jsx)("div",{ref:K,children:(0,d.jsx)("table",{className:"text-sm w-full border-collapse",children:(0,d.jsx)("tbody",{children:al.lineNumbers.map(e=>{let f=e-1,g=e===b,h=a.has(e);return(0,d.jsxs)("tr",{"data-line":e,className:g?"bg-warning/30":h?"bg-warning/15":"",children:[(0,d.jsx)("td",{className:`pl-3 pr-2 text-right select-none font-mono border-r border-border bg-muted dark:bg-muted/50 sticky left-0 align-top whitespace-nowrap ${g||h?"text-warning-foreground":"text-muted-foreground"}`,children:e}),(0,d.jsx)("td",{className:"px-4 text-foreground align-top",children:(0,d.jsx)("pre",{className:"m-0 whitespace-pre-wrap break-words font-mono",children:(0,d.jsx)("code",{className:"hljs",dangerouslySetInnerHTML:{__html:c[f]??""}})})})]},e)})})})})},ao=`/api/worktrees/${c}/files/${(0,bp.o)(f)}?download=1`,ap=f?f.split("/").pop()||f:"",aq=(a,b=!1)=>(0,d.jsxs)("a",{"data-testid":"download-file-button",href:ao,download:ap,className:a,"aria-label":L("actions.downloadFile"),title:L("actions.download"),children:[(0,d.jsx)(bc,{className:"w-3.5 h-3.5"}),b&&(0,d.jsx)("span",{children:L("actions.download")})]}),ar=()=>(0,d.jsxs)("div",{className:"bg-muted px-3 py-1.5 border-b border-border flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1 min-w-0",children:[(0,d.jsx)("button",{onClick:ac,className:"flex-shrink-0 p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":L("actions.copyFilePath"),title:L("actions.copyPath"),children:u?(0,d.jsx)(a9.A,{className:"w-3.5 h-3.5 text-success"}):(0,d.jsx)(bb,{className:"w-3.5 h-3.5"})}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground font-mono truncate",children:f})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[Y&&(0,d.jsx)("button",{onClick:T,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":L("actions.searchInFile"),title:L("actions.search"),children:(0,d.jsx)(af.A,{className:"w-3.5 h-3.5"})}),Y&&(0,d.jsx)("button",{"data-testid":"copy-content-button",onClick:ab,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":L("actions.copyFileContent"),title:L("actions.copyContent"),children:r?(0,d.jsx)(a9.A,{className:"w-3.5 h-3.5 text-success"}):(0,d.jsx)(ba.A,{className:"w-3.5 h-3.5"})}),aq("p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground"),(0,d.jsx)("button",{onClick:ad,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":A?L("actions.exitFullscreen"):L("actions.fullscreen"),title:A?L("actions.exitFullscreen"):L("actions.fullscreen"),children:A?(0,d.jsx)(at,{className:"w-3.5 h-3.5"}):(0,d.jsx)(au,{className:"w-3.5 h-3.5"})})]})]}),as=()=>l?.readOnly&&l.readOnlyReason?(0,d.jsx)(bE,{reason:l.readOnlyReason}):null,aw=()=>(0,d.jsx)(bB,{searchInputRef:S,searchQuery:P,searchMatches:Q,searchCurrentIdx:R,onQueryChange:X,onPrev:W,onNext:V,onClose:U});if(_&&l&&!n&&!p){let a=a=>`flex min-h-[44px] items-center justify-center gap-1 rounded-md px-2 text-xs font-medium touch-manipulation transition-colors ${a?"bg-surface shadow-sm text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"}`;return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{"data-testid":"markdown-file-screen",[bw.en]:"",role:"dialog","aria-modal":"true","aria-label":f,className:"fixed inset-0 flex h-[100dvh] flex-col bg-surface",style:{zIndex:bo.M.MAXIMIZED_EDITOR},children:[A?(0,d.jsxs)("div",{"data-testid":"markdown-file-immersive-controls",className:"absolute right-2 top-2 z-10 flex items-center gap-1 rounded-lg border border-border bg-surface/90 shadow-sm",children:[(0,d.jsx)("button",{type:"button","data-testid":"markdown-file-maximize",onClick:ad,"aria-pressed":!0,"aria-label":L("actions.exitFullscreen"),className:bz,children:(0,d.jsx)(at,{className:"h-5 w-5"})}),(0,d.jsx)("button",{type:"button","data-testid":"markdown-file-close",onClick:()=>void ai(),"aria-label":L("actions.close"),className:bz,children:(0,d.jsx)(av.A,{className:"h-5 w-5"})})]}):(0,d.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1 border-b border-border bg-muted px-2",children:[(0,d.jsx)("p",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f}),$&&(0,d.jsxs)("div",{"data-testid":"markdown-file-mode-switch",role:"group","aria-label":L("fileViewer.modeSwitch"),className:"flex flex-shrink-0 items-center gap-0.5 rounded-lg bg-muted p-0.5",children:[(0,d.jsxs)("button",{type:"button","data-testid":"markdown-file-mode-viewer","aria-pressed":"viewer"===C,onClick:()=>D("viewer"),className:a("viewer"===C),children:[(0,d.jsx)(bm,{className:"h-4 w-4"}),L("fileViewer.modeViewer")]}),(0,d.jsxs)("button",{type:"button","data-testid":"markdown-file-mode-editor","aria-pressed":"editor"===C,onClick:()=>D("editor"),className:a("editor"===C),children:[(0,d.jsx)(bn.A,{className:"h-4 w-4"}),L("fileViewer.modeEditor")]})]}),(0,d.jsx)("button",{type:"button","data-testid":"markdown-file-actions-trigger",onClick:()=>F(!0),"aria-label":L("fileViewer.moreActions"),className:bz,children:(0,d.jsx)(i.A,{className:"h-5 w-5"})}),(0,d.jsx)("button",{type:"button","data-testid":"markdown-file-maximize",onClick:ad,"aria-pressed":!1,"aria-label":L("actions.fullscreen"),className:bz,children:(0,d.jsx)(au,{className:"h-5 w-5"})}),(0,d.jsx)("button",{type:"button","data-testid":"markdown-file-close",onClick:()=>void ai(),"aria-label":L("actions.close"),className:bz,children:(0,d.jsx)(av.A,{className:"h-5 w-5"})})]}),O&&(0,d.jsx)("div",{className:"flex-shrink-0",children:aw()}),(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,d.jsx)("div",{className:"viewer"===aa?"flex min-h-0 flex-1 flex-col":"hidden",children:O?(0,d.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:an()}):ae?w?(0,d.jsxs)("div",{className:"flex h-full flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between p-2 bg-muted border-b border-border",children:[(0,d.jsx)("button",{type:"button",onClick:()=>z(a=>Math.max(0,a-1)),disabled:0===y,className:"min-h-[44px] px-3 text-sm rounded-md bg-muted disabled:opacity-50 hover:bg-muted/80 transition-colors touch-manipulation",children:L("actions.prev")}),(0,d.jsxs)("span",{className:"text-sm text-muted-foreground",children:[y+1," / ",w.length]}),(0,d.jsx)("button",{type:"button",onClick:()=>z(a=>Math.min(w.length-1,a+1)),disabled:y===w.length-1,className:"min-h-[44px] px-3 text-sm rounded-md bg-muted disabled:opacity-50 hover:bg-muted/80 transition-colors touch-manipulation",children:L("actions.next")})]}),(0,d.jsx)("iframe",{srcDoc:w[y],sandbox:"",title:L("fileViewer.slideTitle",{name:f,number:y+1}),className:"w-full flex-1 border-0"})]}):null:$?(0,d.jsx)("div",{"data-testid":"markdown-file-preview",className:"prose prose-sm dark:prose-invert min-h-0 max-w-none flex-1 overflow-y-auto p-4",children:(0,d.jsx)(a8.G8,{content:aj,currentFilePath:f,worktreeId:c,onOpenFile:j})}):null}),(0,d.jsx)("div",{"data-testid":"markdown-file-editor",className:"editor"===aa?"flex min-h-0 flex-1 flex-col":"hidden",children:(0,d.jsx)(by,{worktreeId:c,filePath:f,initialContent:l.content,embedded:!0,onSave:ah,onDirtyChange:J,onContentChange:ag,onOpenFile:j},f)})]}),(0,d.jsx)(be,{open:E,onClose:()=>F(!1),onSearch:()=>{D("viewer"),T()},onCopyContent:ab,onCopyPath:ac,downloadUrl:ao,downloadName:ap,contentCopied:r,pathCopied:u})]})})}return A&&l&&!n&&!p?(0,d.jsxs)("div",{"data-testid":"file-viewer-fullscreen",[bw.en]:"",className:"fixed inset-0 bg-surface flex flex-col",style:{zIndex:bo.M.MAXIMIZED_EDITOR},children:[ar(),as(),O&&aw(),(0,d.jsx)("div",{className:"flex-1 overflow-auto",children:am()})]}):(0,d.jsx)(k.Jh,{isOpen:a,onClose:b,title:f,size:"xl",children:(0,d.jsxs)("div",{className:"max-h-[60vh] sm:max-h-[70vh] flex flex-col",children:[n&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,d.jsx)(k.y$,{size:"xl",variant:"accent"}),(0,d.jsx)("p",{className:"ml-3 text-muted-foreground",children:L("fileViewer.loading")})]}),p&&(0,d.jsxs)("div",{className:"bg-danger-subtle border border-danger-border rounded-lg p-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("svg",{className:"w-5 h-5 text-danger-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsx)("p",{className:"text-sm text-danger-foreground",children:p})]}),(0,d.jsx)("div",{className:"mt-3",children:aq("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium bg-surface border border-border text-foreground hover:bg-muted transition-colors",!0)})]}),l&&!n&&!p&&(0,d.jsxs)("div",{className:"bg-muted rounded-lg overflow-hidden flex flex-col min-h-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex-shrink-0",children:[ar(),as(),O&&aw()]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:am()})]})]})})});var bG=c(55992),bH=c(52120),bI=c(59581),bJ=c(8849);let bK="w-44",bL="w-[7.5rem]",bM=bo.M.POPOVER+1;function bN({current:a,others:b,onSelect:c,onDragStart:f,onDragEnd:g,draggingInstanceId:i,onAddSession:j,canAddSession:k=!0}){let m=(0,h.c)("worktree"),n=(0,e.useId)(),o=(0,e.useId)(),p=(0,e.useRef)(null),q=(0,e.useRef)(null),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(!1),D=(0,e.useRef)(null),E=(0,e.useRef)(!1),F=z??b,G=(0,bI.dW)(F),H=F.find(a=>"running"===a.status||"generating"===a.status)?.status??F.find(a=>"waiting"===a.status)?.status??null,I=(0,e.useCallback)(a=>{s(!1),u(null),a&&p.current?.focus()},[]),J=(0,e.useCallback)(a=>{s(!0),u(a)},[]),K=(0,e.useCallback)(a=>{if(E.current)return;let b=a.relatedTarget;b&&(q.current?.contains(b)||p.current?.contains(b)||I(!1))},[I]),L=(0,e.useCallback)(a=>{let b=Array.from(q.current?.querySelectorAll("[data-switcher-item]:not([disabled])")??[]),c=b.indexOf(document.activeElement),d=a=>{var c;(c=b[(a+b.length)%b.length])&&(c.focus(),c.scrollIntoView?.({block:"nearest"}))};switch(a.key){case"ArrowDown":a.preventDefault(),d(c+1);break;case"ArrowUp":a.preventDefault(),d(c<0?b.length-1:c-1);break;case"Home":a.preventDefault(),d(0);break;case"End":a.preventDefault(),d(b.length-1);break;case"Escape":a.preventDefault(),a.stopPropagation(),I(!0);break;case"Tab":I(!1)}},[I]),M=(0,e.useCallback)(a=>{"ArrowDown"===a.key||"ArrowUp"===a.key?(a.preventDefault(),J("ArrowDown"===a.key?"first":"last")):"Escape"===a.key&&r&&(a.preventDefault(),I(!0))},[r,J,I]),N=(0,e.useCallback)((a,c)=>{E.current=!0,A(b),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{D.current=null,E.current&&C(!0)},0),f(a,c)},[b,f]),O=(0,e.useCallback)(()=>{E.current=!1,D.current&&(clearTimeout(D.current),D.current=null),C(!1),A(null),g(),I(!0)},[g,I]),P=(0,e.useCallback)(a=>{I(!0),c?.(a)},[I,c]),Q=(0,e.useCallback)(()=>{I(!0),j?.()},[I,j]),R=G>0?m("agentStatus.otherSessionsWaitingLabel",{count:F.length,waiting:G}):m("agentStatus.otherSessionsLabel",{count:F.length}),S=(0,d.jsxs)("div",{ref:q,id:n,role:"group","aria-label":m("agentStatus.otherSessionsList"),"data-testid":"desktop-session-others-list","data-dragging":B?"true":void 0,hidden:!r,onKeyDown:L,onBlur:K,style:{zIndex:bo.M.POPOVER,top:v?.top??0,right:v?.right??0,...v?{maxHeight:`${v.maxHeight}px`}:{}},className:`fixed flex w-72 overflow-y-auto overscroll-contain max-w-[calc(100vw-8px)] flex-col gap-0.5 rounded-md border border-border bg-surface p-1 text-surface-foreground shadow-lg transition-opacity${B?" pointer-events-none opacity-40":""}`,children:[F.map(a=>(0,d.jsx)(aw.m_,{content:a.tooltip,placement:"right",fallbackPlacement:"left",zIndex:bM,children:(0,d.jsxs)("button",{type:"button","data-switcher-item":"","data-testid":`desktop-agent-status-${a.id}`,onClick:()=>P(a.id),draggable:!0,onDragStart:b=>N(b,a.id),onDragEnd:O,"aria-label":a.tooltip,"aria-pressed":a.isActive,className:`flex w-full min-w-0 items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm text-foreground outline-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring${i===a.id?" opacity-50 cursor-grabbing":""}`,children:[(0,d.jsx)(l.m,{status:a.status,size:"sm","aria-hidden":!0,title:void 0,className:a.dotClass}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.name}),(0,d.jsx)("span",{className:"flex-shrink-0 text-xs text-muted-foreground",children:a.statusWord}),null!==a.splitIndex&&(0,d.jsx)("span",{className:"flex-shrink-0 rounded bg-muted px-1.5 text-[10px] font-medium leading-4 text-muted-foreground","data-testid":`desktop-session-split-${a.id}`,children:m("agentStatus.inSplit",{index:a.splitIndex+1})})]})},a.id)),j&&(0,d.jsxs)(d.Fragment,{children:[F.length>0&&(0,d.jsx)("div",{role:"separator",className:"my-0.5 h-px bg-border"}),(0,d.jsxs)("button",{type:"button","data-switcher-item":"","data-testid":"desktop-session-add",onClick:Q,disabled:!k,"aria-describedby":k?void 0:o,className:"flex w-full flex-shrink-0 items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm text-foreground outline-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",children:[(0,d.jsx)(bJ.A,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),m("agentStatus.addSession")]}),!k&&(0,d.jsx)("p",{id:o,"data-testid":"desktop-session-add-limit",className:"flex-shrink-0 px-2 pb-1 text-xs text-muted-foreground",children:m("agentAdd.maxReached",{max:al.Ab})})]})]});return(0,d.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1","data-testid":"desktop-session-switcher",children:[a?(0,d.jsxs)("button",{type:"button","data-testid":`desktop-agent-status-${a.id}`,"data-session-current":"",onClick:()=>c?.(a.id),draggable:!0,onDragStart:b=>f(b,a.id),onDragEnd:g,"aria-label":a.tooltip,title:a.tooltip,"aria-pressed":a.isActive,className:`flex ${bK} flex-shrink-0 items-center gap-1.5 overflow-hidden px-2 py-1 rounded text-xs transition-colors ${a.isActive?"bg-accent-100 dark:bg-accent-900/30 text-accent-900 dark:text-accent-100":"hover:bg-muted text-foreground"}${i===a.id?" opacity-50 cursor-grabbing":""}`,children:[(0,d.jsx)(l.m,{status:a.status,size:"sm","aria-hidden":!0,title:void 0,className:a.dotClass}),(0,d.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap",children:a.fullLabel})]}):(0,d.jsx)("span",{"aria-hidden":"true",className:`${bK} flex-shrink-0`}),F.length>0||null!==z?(0,d.jsxs)("button",{ref:p,type:"button","data-testid":"desktop-agent-status-overflow","aria-label":R,"aria-expanded":r,"aria-controls":n,onClick:()=>r?I(!1):J("first"),onKeyDown:M,className:`flex ${bL} flex-shrink-0 items-center gap-1.5 overflow-hidden rounded px-2 py-1 text-xs tabular-nums text-muted-foreground transition-colors hover:bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-ring${r?" bg-muted text-foreground":""}`,children:[H?(0,d.jsx)(l.m,{status:H,size:"sm","aria-hidden":!0,title:void 0}):(0,d.jsx)("span",{"aria-hidden":"true",className:"h-2 w-2 flex-shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",children:m("agentStatus.otherSessions",{count:F.length})}),(0,d.jsxs)("span",{className:"flex flex-shrink-0 items-center gap-0.5",children:[(0,d.jsx)("span",{"data-testid":"desktop-session-others-waiting","aria-hidden":"true",className:`min-w-[1.25rem] rounded-full px-1 text-center text-[10px] font-semibold leading-4 ${G>0?"bg-warning text-warning-foreground":"invisible"}`,children:G>0?G:""}),(0,d.jsx)(aj.A,{className:"h-3 w-3","aria-hidden":"true"})]})]}):(0,d.jsx)("span",{"aria-hidden":"true","data-testid":"desktop-session-others-placeholder",className:`${bL} flex-shrink-0`}),x&&(0,ak.createPortal)(S,x)]})}var bO=c(63474),bP=c(78352);function bQ({worktreeId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(null),[i,j]=(0,e.useState)(null),[l,m]=(0,e.useState)(!0),[n,p]=(0,e.useState)(null),[q,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(0),[v,w]=(0,e.useState)("all"),[x,y]=(0,e.useState)(!1),{showToast:z}=(0,bO.dj)(),A=(0,h.c)("worktree"),B=(0,e.useMemo)(()=>"all"===v?b:b.filter(a=>a.toLowerCase().includes(v)),[b,v]),C=async b=>{try{m(!0),p(null);let c=await bP.y.getLogFile(a,b);j(c.content),g(b),s(""),u(0)}catch(a){p((0,bP.hS)(a))}finally{m(!1)}},D=(0,e.useCallback)(async()=>{if(f)try{y(!0);let b=await bP.y.getLogFile(a,f,{sanitize:!0});await (0,bk.l)(b.content),z(A("logViewer.copied"),"success")}catch(a){z(A("logViewer.exportError",{error:(0,bP.hS)(a)}),"error")}finally{y(!1)}},[a,f,z,A]),E=(0,e.useMemo)(()=>{let a;if(!q||!i)return[];let b=RegExp(o(q),"gi"),c=[];for(;null!==(a=b.exec(i));)c.push({index:a.index,length:a[0].length});return c},[q,i]),F=()=>{E.length>0&&u(a=>(a+1)%E.length)},G=()=>{E.length>0&&u(a=>(a-1+E.length)%E.length)},H=(0,e.useMemo)(()=>{if(!i||!q||0===E.length)return i;let a="",b=0;return E.forEach((c,d)=>{a+=r(i.substring(b,c.index));let e=i.substring(c.index,c.index+c.length),f=d===t;a+=`<mark class="${f?"bg-warning text-black":"bg-warning-border text-black"}" data-match-index="${d}">${r(e)}</mark>`,b=c.index+c.length}),a+=r(i.substring(b))},[i,q,E,t]);return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)(k.Zp,{padding:"md",children:[(0,d.jsx)(k.aR,{children:(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)(k.ZB,{children:A("logViewer.title")}),(0,d.jsx)(k.Ex,{variant:"gray",children:B.length})]}),(0,d.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,d.jsx)(k.$n,{variant:"all"===v?"primary":"ghost",size:"sm",onClick:()=>w("all"),children:A("logViewer.all",{count:b.length})}),(0,d.jsx)(k.$n,{variant:"claude"===v?"primary":"ghost",size:"sm",onClick:()=>w("claude"),children:A("logViewer.toolCount",{tool:"Claude",count:b.filter(a=>a.toLowerCase().includes("claude")).length})}),(0,d.jsx)(k.$n,{variant:"codex"===v?"primary":"ghost",size:"sm",onClick:()=>w("codex"),children:A("logViewer.toolCount",{tool:"Codex",count:b.filter(a=>a.toLowerCase().includes("codex")).length})}),(0,d.jsx)(k.$n,{variant:"gemini"===v?"primary":"ghost",size:"sm",onClick:()=>w("gemini"),children:A("logViewer.toolCount",{tool:"Gemini",count:b.filter(a=>a.toLowerCase().includes("gemini")).length})}),(0,d.jsx)(k.$n,{variant:"antigravity"===v?"primary":"ghost",size:"sm",onClick:()=>w("antigravity"),children:A("logViewer.toolCount",{tool:"Antigravity",count:b.filter(a=>a.toLowerCase().includes("antigravity")).length})})]})]})}),(0,d.jsxs)(k.Wu,{children:[l&&0===b.length&&(0,d.jsx)("div",{className:"text-center py-4",children:(0,d.jsx)(k.y$,{size:"lg",variant:"accent",className:"inline-block"})}),n&&(0,d.jsx)("div",{className:"p-3 bg-danger-subtle border border-danger-border rounded text-sm text-danger-foreground",children:n}),!l&&0===B.length&&!n&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground text-center py-4",children:"all"===v?A("logViewer.empty"):A("logViewer.emptyFiltered",{tool:v})}),B.length>0&&(0,d.jsx)("div",{className:"space-y-2",children:B.map(a=>(0,d.jsx)("button",{onClick:()=>C(a),className:`w-full text-left px-3 py-2 rounded text-sm font-mono transition-colors ${f===a?"bg-accent-50 text-accent-700 border border-accent-200":"hover:bg-muted border border-transparent"}`,children:a},a))})]})]}),f&&(0,d.jsxs)(k.Zp,{padding:"md",children:[(0,d.jsx)(k.aR,{children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)(k.ZB,{className:"font-mono text-base",children:f}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:D,disabled:!f||x,title:A("logViewer.copyTitle"),children:x?A("logViewer.exporting"):A("logViewer.export")}),(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:()=>{g(null),j(null),s(""),u(0)},children:A("actions.close")})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)(k.pd,{type:"text",value:q,onChange:a=>s(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.nativeEvent.isComposing||(a.preventDefault(),a.shiftKey?G():F())},placeholder:A("logViewer.searchPlaceholder"),className:"w-full pr-20"}),E.length>0&&(0,d.jsxs)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground",children:[t+1," / ",E.length]})]}),E.length>0&&(0,d.jsxs)("div",{className:"flex gap-1",children:[(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:G,disabled:0===E.length,title:A("logViewer.prevMatch"),children:"↑"}),(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:F,disabled:0===E.length,title:A("logViewer.nextMatch"),children:"↓"})]})]})]})}),(0,d.jsxs)(k.Wu,{children:[l&&(0,d.jsx)("div",{className:"text-center py-8",children:(0,d.jsx)(k.y$,{size:"xl",variant:"accent",className:"inline-block"})}),!l&&i&&(0,d.jsx)("div",{className:"bg-[#111827] text-[#f3f4f6] rounded p-4 overflow-x-auto max-h-[500px] scrollbar-thin",children:q&&E.length>0?(0,d.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:H||""}}):(0,d.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap",children:i})}),!l&&q&&0===E.length&&i&&(0,d.jsx)("div",{className:"text-center py-4 text-sm text-muted-foreground",children:A("logViewer.noMatches",{query:q})})]})]})]})}var bR=c(23910),bS=c(56379);function bT({version:a,className:b}){let c=(0,h.c)("worktree"),{checking:e}=(0,bR.Y)();return(0,d.jsxs)("div",{className:b,"data-testid":"version-section",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:c("update.version")}),(0,d.jsx)("p",{className:"text-sm text-foreground",children:a}),e&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1","data-testid":"version-loading",children:"..."}),(0,d.jsx)(bS.V,{})]})}let bU="https://github.com/Kewton/CommandMate",bV=`${bU}/issues`,bW=`${bU}/issues/new`,bX=`${bW}?template=bug_report.md`,bY=`${bW}?template=feature_request.md`,bZ=`${bW}?template=question.md`;function b$({className:a}){let b=(0,h.c)("worktree"),c=[{href:bX,label:b("feedback.bugReport")},{href:bY,label:b("feedback.featureRequest")},{href:bZ,label:b("feedback.question")},{href:bV,label:b("feedback.viewIssues")}];return(0,d.jsxs)("div",{className:a,"data-testid":"feedback-section",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-2",children:b("feedback.title")}),(0,d.jsx)("div",{className:"flex flex-col gap-1",children:c.map(({href:a,label:b})=>(0,d.jsxs)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-sm text-accent-600 hover:text-accent-800 underline",children:[b,(0,d.jsx)("span",{className:"ml-1","aria-hidden":"true",children:"→"})]},a))})]})}var b_=c(98033),b0=c(89877),b1=c(3991),b2=c.n(b1),b3=c(81092),b4=c(5772),b5=c(47684),b6=c(72280),b7=c(32482);let b8=(0,e.memo)(function({repositoryName:a}){let b=(0,h.c)("worktree");return(0,d.jsxs)(b2(),{href:"/repositories","data-testid":"desktop-repository-name",className:"flex min-w-0 max-w-[200px] items-center gap-1 rounded text-xs text-muted-foreground hover:text-foreground hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:b("detail.openRepositories",{repository:a}),children:[(0,d.jsx)(b6.n,{className:"h-3 w-3 flex-shrink-0",color:(0,b7.LV)(a)}),(0,d.jsx)("span",{className:"truncate",children:a})]})});function b9(a,b){let c=b?.trim()?b:void 0;return c?a?`${a}
18
18
 
19
- ${c}`:c:a}function ca({worktreeName:a,description:b}){let c=b9(void 0,b);return c?(0,d.jsx)("span",{title:c,"data-testid":"worktree-breadcrumb-name",children:a}):(0,d.jsx)(d.Fragment,{children:a})}let cb=(0,e.memo)(function({worktreeId:a,worktreeName:b,repositoryName:c,description:e}){let f=(0,ao.rC)();return f&&a?(0,d.jsx)(cc,{worktreeId:a,worktreeName:b,repositoryName:c,description:e,worktrees:f.worktrees,repositories:f.repositories}):(0,d.jsx)(ca,{worktreeName:b,description:e})});function cc({worktrees:a,repositories:b,...c}){let{sortKey:e,sortDirection:f,repositoryOrder:g}=(0,b3.VF)();return e&&f&&g?(0,d.jsx)(cd,{...c,worktrees:a,repositories:b,sortKey:e,sortDirection:f,repositoryOrder:g}):(0,d.jsx)(ca,{worktreeName:c.worktreeName,description:c.description})}function cd({worktreeId:a,worktreeName:b,repositoryName:c,description:f,worktrees:g,repositories:i,sortKey:j,sortDirection:k,repositoryOrder:l}){let m=(0,h.c)("common"),n=(0,b5.zX)(),{factor:o}=(0,b4.Ps)(),p=(0,b5.Iz)({worktrees:g,repositories:i,sortKey:j,sortDirection:k,repositoryOrder:l}).find(b=>b.branches.some(b=>b.id===a))??null,[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useCallback)(()=>r(null),[]),u=(0,e.useCallback)(()=>{let a=s.current?.getBoundingClientRect();a&&r({left:a.left,right:a.right,bottom:a.bottom})},[]);(0,b5.W2)(null!==q,t);let v=(0,e.useCallback)(a=>{t(),n(a)},[t,n]);return p?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:s,type:"button","data-testid":"worktree-breadcrumb-branch","aria-haspopup":"menu","aria-expanded":null!==q,title:b9(m("repoTabBar.switchBranch",{repository:c}),f),onClick:()=>q?t():u(),onKeyDown:a=>{"ArrowDown"===a.key&&(a.preventDefault(),q||u())},className:"inline-flex max-w-full items-center gap-1 rounded-md align-bottom hover:bg-surface-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)("span",{className:"min-w-0 truncate",children:b}),(0,d.jsx)(aj.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"flex-shrink-0 text-muted-foreground"})]}),q&&(0,d.jsx)(b5.oW,{group:p,anchor:q,factor:o,activeWorktreeId:a,onBranchClick:v})]}):(0,d.jsx)(ca,{worktreeName:b,description:f})}var ce=c(60957),cf=c(57898);let cg=(0,x.A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);var ch=c(55056);let ci=(0,x.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),cj=(0,x.A)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var ck=c(75234),cl=c(54937);let cm=(0,x.A)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),cn=[{id:"files",labelKey:"activityBar.files",icon:z},{id:"git",labelKey:"activityBar.git",icon:cf.A},{id:"notes",labelKey:"activityBar.notes",icon:ag},{id:"schedules",labelKey:"activityBar.schedules",icon:cg},{id:"agent",labelKey:"activityBar.agent",icon:ch.A},{id:"timer",labelKey:"activityBar.timer",icon:ci},{id:"todo",labelKey:"activityBar.todo",icon:cj},{id:"skills",labelKey:"activityBar.skills",icon:ck.A},{id:"verification",labelKey:"activityBar.verification",icon:cl.A},{id:"env",labelKey:"activityBar.env",icon:cm}],co="verification",cp=cn.filter(a=>a.id!==co);cn.map(a=>a.id);let cq="worktree-activity-pane",cr="worktree-header-tools-more";function cs(a){return`flex items-center justify-center h-7 w-7 rounded-md transition-colors ${a?"bg-accent-500/10 text-accent-600 dark:text-accent-400":"text-muted-foreground group-hover:text-surface-foreground group-hover:bg-muted-foreground/10"}`}let ct="group flex flex-shrink-0 items-center justify-center h-8 w-8 rounded-md transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",cu=(0,e.memo)(function({active:a,onToggle:b,foldedCount:c=0}){let f=(0,h.c)("worktree"),g=Math.max(0,Math.min(c,cp.length)),j=cp.slice(0,cp.length-g),k=cp.slice(cp.length-g),l=k.some(b=>b.id===a),m=k.find(b=>b.id===a),n=(0,e.useRef)([]),o=(0,e.useRef)(null),p=(0,e.useRef)(null),q=(0,e.useRef)(null),[r,s]=(0,e.useState)(!1),t=j.length+ +(g>0),u=(0,e.useCallback)(a=>{let b=a<j.length?n.current[a]:o.current;b?.focus()},[j.length]),v=j.findIndex(b=>b.id===a),w=-1!==v?v:l?j.length:0,x=(0,e.useCallback)((a,b)=>{if(0!==t){if("ArrowRight"===a.key){a.preventDefault(),u((b+1)%t);return}if("ArrowLeft"===a.key){a.preventDefault(),u((b-1+t)%t);return}if("Home"===a.key){a.preventDefault(),u(0);return}"End"===a.key&&(a.preventDefault(),u(t-1))}},[t,u]),y=(0,e.useCallback)((a,c,d)=>{if("Enter"===a.key||" "===a.key){a.preventDefault(),b(d);return}x(a,c)},[b,x]),z=(0,e.useCallback)(a=>{s(!1),a&&o.current?.focus()},[]),A=(0,e.useCallback)(a=>{if("Enter"===a.key||" "===a.key||"ArrowDown"===a.key){a.preventDefault();let b="ArrowDown"===a.key;s(a=>b||!a);return}if("Escape"===a.key&&r){a.preventDefault(),z(!0);return}x(a,j.length)},[r,z,x,j.length]);(0,e.useEffect)(()=>{0===g&&s(!1)},[g]),(0,e.useEffect)(()=>{if(!r)return;let a=p.current;if(!a)return;let b=a.querySelector('[role="tab"][aria-selected="true"]');(b??a.querySelector('[role="tab"]'))?.focus()},[r]),(0,e.useEffect)(()=>{if(!r)return;let a=a=>{let b=a.target;b instanceof Node&&q.current?.contains(b)||s(!1)};return document.addEventListener("pointerdown",a),()=>document.removeEventListener("pointerdown",a)},[r]);let B=(0,e.useCallback)(a=>{let b=a.relatedTarget;b instanceof Node&&q.current?.contains(b)||null!==b&&s(!1)},[]),C=(0,e.useCallback)(a=>{b(a),z(!0)},[b,z]),D=(0,e.useCallback)((a,b,c)=>{let d=p.current?Array.from(p.current.querySelectorAll('[role="tab"]')):[];if("Enter"===a.key||" "===a.key){a.preventDefault(),C(c);return}if("Escape"===a.key){a.preventDefault(),z(!0);return}0!==d.length&&("ArrowDown"===a.key?(a.preventDefault(),d[(b+1)%d.length]?.focus()):"ArrowUp"===a.key?(a.preventDefault(),d[(b-1+d.length)%d.length]?.focus()):"Home"===a.key?(a.preventDefault(),d[0]?.focus()):"End"===a.key&&(a.preventDefault(),d[d.length-1]?.focus()))},[C,z]),E=m?f("headerTools.moreActive",{label:f(m.labelKey)}):f("headerTools.more");return(0,d.jsxs)("div",{ref:q,"data-testid":"header-tool-bar",className:"relative flex flex-shrink-0 items-center",onBlur:B,children:[(0,d.jsx)("div",{id:"worktree-header-tools",role:"tablist","aria-orientation":"horizontal","aria-label":f("headerTools.label"),className:"flex items-center",children:j.map((c,e)=>{let g=c.icon,h=a===c.id,i=f(c.labelKey);return(0,d.jsx)(aw.m_,{content:i,placement:"bottom",children:(0,d.jsx)("button",{ref:a=>{n.current[e]=a},type:"button",role:"tab","aria-selected":h,"aria-label":i,"aria-controls":cq,tabIndex:e===w?0:-1,onClick:()=>b(c.id),onKeyDown:a=>y(a,e,c.id),"data-testid":`header-tool-${c.id}`,"data-activity-entry":c.id,className:ct,children:(0,d.jsx)("span",{"aria-hidden":"true",className:cs(h),children:(0,d.jsx)(g,{size:18,"aria-hidden":"true"})})})},c.id)})}),g>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(aw.m_,{content:E,placement:"bottom",children:(0,d.jsx)("button",{ref:o,type:"button","aria-label":E,"aria-haspopup":"true","aria-expanded":r,"aria-controls":r?cr:void 0,tabIndex:w===j.length?0:-1,onClick:()=>s(a=>!a),onKeyDown:A,"data-testid":"header-tool-more","data-active":l?"true":"false",className:ct,children:(0,d.jsxs)("span",{"aria-hidden":"true",className:`relative ${cs(l)}`,children:[(0,d.jsx)(i.A,{size:18,"aria-hidden":"true"}),l&&(0,d.jsx)("span",{"data-testid":"header-tool-more-active-mark",className:"absolute right-0.5 top-0.5 h-1.5 w-1.5 rounded-full bg-accent-500"})]})})}),r&&(0,d.jsx)("div",{ref:p,id:cr,role:"tablist","aria-orientation":"vertical","aria-label":f("headerTools.more"),"data-testid":"header-tool-more-list","data-floating-layer":"open",className:"absolute right-0 top-full z-40 mt-1 flex min-w-[12rem] flex-col rounded-lg border border-border bg-surface p-1 shadow-lg",children:k.map((b,c)=>{let e=b.icon,g=a===b.id,h=f(b.labelKey);return(0,d.jsxs)("button",{type:"button",role:"tab","aria-selected":g,"aria-controls":cq,onClick:()=>C(b.id),onKeyDown:a=>D(a,c,b.id),"data-testid":`header-tool-more-item-${b.id}`,className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ${g?"bg-accent-500/10 text-accent-600 dark:text-accent-400":"text-foreground hover:bg-muted"}`,children:[(0,d.jsx)(e,{size:16,"aria-hidden":"true"}),(0,d.jsx)("span",{children:h})]},b.id)})})]})]})});var cv=c(20316);function cw(a,b,c){return(0,m.Mq)(a,(0,b0.px)(c?b?.[c]:void 0))}function cx(a,b,c){if(!a)return null;let d=b?`${a} \xb7 ${b}`:a;return c?`${c} \xb7 ${d}`:d}function cy(a,b){if(!a||!a.liveness&&!a.degradedReason)return null;let c=b("sse"===a.kind?"agentSource.kindSse":"scraper"===a.kind?"agentSource.kindScraper":"agentSource.kindHooks"),d=void 0===a.degradedReason?null:"port_identity_changed"===a.degradedReason?b("agentSource.reasonPortIdentityChanged"):"heartbeat_stale"===a.degradedReason?b("agentSource.reasonHeartbeatStale"):"not_subscribed"===a.degradedReason?b("agentSource.reasonNotSubscribed"):b("agentSource.reasonOther",{reason:a.degradedReason}),e=["stale"===a.liveness?b("agentSource.livenessStale"):"live"===a.liveness?b("agentSource.livenessLive"):null,d].filter(a=>null!==a).join(" \xb7 ");return e?b("agentSource.line",{kind:c,state:e}):b("agentSource.lineBare",{kind:c})}function cz(a,b,c=2){return"number"==typeof a&&Number.isFinite(a)?new Intl.NumberFormat(b,{style:"currency",currency:"USD",minimumFractionDigits:c,maximumFractionDigits:c}).format(a):null}function cA(a,b,c,d){var e;let f=cz(a?.cost,d),g=(e=b?.tokens,"number"==typeof e&&Number.isFinite(e)?new Intl.NumberFormat(d,{notation:"compact",maximumFractionDigits:1}).format(e):null),h=[];return f&&h.push(f),g&&h.push("number"==typeof b?.percent?c("agentSession.context",{tokens:g,percent:b.percent}):g),h.length>0?h.join(" \xb7 "):null}function cB(a){if(!a)return{};let b={};for(let[c,d]of Object.entries(a)){let a=cx(d?.model,d?.reasoningEffort);a&&(b[c]=a)}return b}function cC(a,b,c,d){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(!1),l=(0,e.useCallback)(async()=>{if(a){k(!0);try{let c=await bP.y.updateDescription(a.id,h);b(c),g(!1)}catch(a){console.error("Failed to save description:",a)}finally{k(!1)}}},[a,h,b]),m=(0,e.useCallback)(()=>{i(a?.description||""),g(!1)},[a]);return{isEditing:f,text:h,setText:i,isSaving:j,handleSave:l,handleCancel:m,startEditing:(0,e.useCallback)(()=>{g(!0)},[])}}let cD=(0,e.memo)(function({worktreeId:a,worktree:b,cardClassName:c,descriptionEditor:f,showLogs:g,onToggleLogs:i,onWorktreeUpdate:j}){let{isEditing:l,text:m,setText:n,isSaving:o,handleSave:p,handleCancel:q,startEditing:r}=f,s=(0,h.c)("worktree"),t=(0,h.c)("common"),{showToast:u}=(0,bO.dj)(),{copied:v,markCopied:w}=(0,bu.q)(),{copied:x,markCopied:y}=(0,bu.q)(),z=(0,e.useCallback)(async()=>{try{await (0,bk.l)(b.path),w()}catch{}},[b.path,w]),A=(0,e.useCallback)(async()=>{try{await (0,bk.l)(b.repositoryPath),y()}catch{}},[b.repositoryPath,y]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:c,children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.worktree")}),(0,d.jsx)("p",{className:"text-lg font-semibold text-foreground",children:b.name})]}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.repository")}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:A,className:"flex-shrink-0 p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":s("detail.copyRepositoryPath"),title:x?s("detail.copied"):s("detail.copyRepositoryPath"),children:x?(0,d.jsx)(a9.A,{className:"w-3.5 h-3.5 text-success"}):(0,d.jsx)(bb,{className:"w-3.5 h-3.5"})})]}),(0,d.jsx)("p",{className:"text-base text-foreground",children:b.repositoryDisplayName??b.repositoryName}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:b.repositoryPath})]}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.path")}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:z,className:"flex-shrink-0 p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":s("detail.copyWorktreePath"),title:v?s("detail.copied"):s("detail.copyPath"),children:v?(0,d.jsx)(a9.A,{className:"w-3.5 h-3.5 text-success"}):(0,d.jsx)(bb,{className:"w-3.5 h-3.5"})})]}),(0,d.jsx)("p",{className:"text-sm text-foreground break-all font-mono",children:b.path})]}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.status")}),(0,d.jsx)("select",{value:b.status??"",onChange:async a=>{let c=a.target,d=b.status??"",e=c.value;try{let a=await (0,cv.V9)(b.id,""===e?null:e);j?.(a)}catch{c.value=d,u(t("branchItem.statusChangeFailed"),"error")}},className:"text-sm px-3 py-1.5 rounded-lg border border-input bg-surface text-foreground focus:ring-2 focus:ring-ring focus:border-transparent w-full","data-testid":"mobile-status-dropdown","aria-label":s("detail.worktreeStatusLabel"),children:cv.m9.map(a=>(0,d.jsx)("option",{value:a.value??"",children:s(a.labelKey)},a.labelKey))})]}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.description")}),!l&&(0,d.jsx)("button",{type:"button",onClick:r,className:"text-sm text-accent-600 hover:text-accent-800 dark:text-accent-400 dark:hover:text-accent-300",children:s("actions.edit")})]}),l?(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("textarea",{value:m,onChange:a=>n(a.target.value),placeholder:s("detail.addNotesPlaceholder"),className:"w-full min-h-[150px] p-3 border border-input dark:bg-surface dark:text-foreground rounded-lg resize-y focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",autoFocus:!0}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:p,disabled:o,className:"px-4 py-2 bg-accent-600 text-white rounded-lg hover:bg-accent-700 disabled:opacity-50 text-sm font-medium",children:o?s("actions.saving"):s("actions.save")}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:q,disabled:o,className:"px-4 py-2 bg-muted text-foreground rounded-lg hover:bg-border disabled:opacity-50 text-sm font-medium",children:t("cancel")})]})]}):(0,d.jsx)("div",{className:"min-h-[50px]",children:b.description?(0,d.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:b.description}):(0,d.jsx)("p",{className:"text-sm text-muted-foreground italic",children:s("detail.noDescription")})})]}),b.link&&(0,d.jsxs)("div",{className:c,children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.link")}),(0,d.jsx)("a",{href:b.link,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-600 hover:underline break-all",children:b.link})]}),b.updatedAt&&(0,d.jsxs)("div",{className:c,children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.lastUpdated")}),(0,d.jsx)("p",{className:"text-sm text-foreground",children:new Date(b.updatedAt).toLocaleString()})]}),(0,d.jsx)(bT,{version:"v0.48.0",className:c}),(0,d.jsx)(b$,{className:c}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.logs")}),(0,d.jsx)("button",{type:"button",onClick:i,className:"text-sm text-accent-600 hover:text-accent-800",children:g?s("detail.hide"):s("detail.show")})]}),g&&(0,d.jsx)(bQ,{worktreeId:a})]})]})}),cE=(0,e.memo)(function({worktreeId:a,worktreeName:b,repositoryName:c,description:f,status:g,gitStatus:i,onInfoClick:j,hasUpdate:n,sessionStatusByCli:o,sessionStatusByInstance:p,instances:r,activeInstanceId:s,onActiveInstanceChange:t,onAgentDragStart:u,onAgentDragEnd:v,onKillSession:w,agentSessionByInstance:x,agentAddControl:y,splitInstanceIds:z,activeActivity:A=null,onActivityToggle:B}){let D=(0,h.c)("worktree"),E=(0,bG.Ym)(),F=(0,h.c)("common"),G=bH.sb[g],H=G?D(G):void 0,[I,J]=(0,e.useState)(null),K=r?.find(a=>a.id===s),L=!!s&&(p?.[s]?.isRunning??(K?o?.[K.cliTool]?.isRunning:void 0)??!1),M=cw(g,o,K?.cliTool),N=(0,e.useCallback)((a,b)=>{a.dataTransfer.setData(aB,b),a.dataTransfer.effectAllowed="move",J(b),u?.(b)},[u]),O=(0,e.useCallback)(()=>{J(null),v?.()},[v]),P=i&&"(unknown)"!==i.currentBranch?i:null,Q=null!==P&&P.currentBranch!==b,R=(r??[]).map(a=>({item:a,status:(0,b0.kA)(p?.[a.id]??o?.[a.cliTool]),isActive:a.id===s})),S=new Set((r??[]).filter(a=>(0,b0.px)(p?.[a.id]??o?.[a.cliTool])).map(a=>a.id)),T=(r??[]).some(a=>(p?.[a.id]??o?.[a.cliTool])?.awaitingInstruction===!0),U=!!w&&L,V=(0,bR.Y)(),W=`${V.updateInfo?.latestVersion??""}:${V.hasUpdate}:${V.state}`,X=[E,b,c,Q?P?.currentBranch??"":"",P?.isDirty?"dirty":"",P?.statusUnknown?"status-unknown":"",U?"end":"",T?"awaiting":"",W,R.length>0?"sessions":""].join("\n"),Y=(0,e.useRef)(null),Z=(0,e.useRef)(null),$=function(a,b,c,d=0){let e=Math.max(0,d),f=as(a,b,`${c}
19
+ ${c}`:c:a}function ca({worktreeName:a,description:b}){let c=b9(void 0,b);return c?(0,d.jsx)("span",{title:c,"data-testid":"worktree-breadcrumb-name",children:a}):(0,d.jsx)(d.Fragment,{children:a})}let cb=(0,e.memo)(function({worktreeId:a,worktreeName:b,repositoryName:c,description:e}){let f=(0,ao.rC)();return f&&a?(0,d.jsx)(cc,{worktreeId:a,worktreeName:b,repositoryName:c,description:e,worktrees:f.worktrees,repositories:f.repositories}):(0,d.jsx)(ca,{worktreeName:b,description:e})});function cc({worktrees:a,repositories:b,...c}){let{sortKey:e,sortDirection:f,repositoryOrder:g}=(0,b3.VF)();return e&&f&&g?(0,d.jsx)(cd,{...c,worktrees:a,repositories:b,sortKey:e,sortDirection:f,repositoryOrder:g}):(0,d.jsx)(ca,{worktreeName:c.worktreeName,description:c.description})}function cd({worktreeId:a,worktreeName:b,repositoryName:c,description:f,worktrees:g,repositories:i,sortKey:j,sortDirection:k,repositoryOrder:l}){let m=(0,h.c)("common"),n=(0,b5.zX)(),{factor:o}=(0,b4.Ps)(),p=(0,b5.Iz)({worktrees:g,repositories:i,sortKey:j,sortDirection:k,repositoryOrder:l}).find(b=>b.branches.some(b=>b.id===a))??null,[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useCallback)(()=>r(null),[]),u=(0,e.useCallback)(()=>{let a=s.current?.getBoundingClientRect();a&&r({left:a.left,right:a.right,bottom:a.bottom})},[]);(0,b5.W2)(null!==q,t);let v=(0,e.useCallback)(a=>{t(),n(a)},[t,n]);return p?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:s,type:"button","data-testid":"worktree-breadcrumb-branch","aria-haspopup":"menu","aria-expanded":null!==q,title:b9(m("repoTabBar.switchBranch",{repository:c}),f),onClick:()=>q?t():u(),onKeyDown:a=>{"ArrowDown"===a.key&&(a.preventDefault(),q||u())},className:"inline-flex max-w-full items-center gap-1 rounded-md align-bottom hover:bg-surface-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)("span",{className:"min-w-0 truncate",children:b}),(0,d.jsx)(aj.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"flex-shrink-0 text-muted-foreground"})]}),q&&(0,d.jsx)(b5.oW,{group:p,anchor:q,factor:o,activeWorktreeId:a,onBranchClick:v})]}):(0,d.jsx)(ca,{worktreeName:b,description:f})}var ce=c(60957),cf=c(57898);let cg=(0,x.A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);var ch=c(55056);let ci=(0,x.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),cj=(0,x.A)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var ck=c(75234),cl=c(54937);let cm=(0,x.A)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),cn=[{id:"files",labelKey:"activityBar.files",icon:z},{id:"git",labelKey:"activityBar.git",icon:cf.A},{id:"notes",labelKey:"activityBar.notes",icon:ag},{id:"schedules",labelKey:"activityBar.schedules",icon:cg},{id:"agent",labelKey:"activityBar.agent",icon:ch.A},{id:"timer",labelKey:"activityBar.timer",icon:ci},{id:"todo",labelKey:"activityBar.todo",icon:cj},{id:"skills",labelKey:"activityBar.skills",icon:ck.A},{id:"verification",labelKey:"activityBar.verification",icon:cl.A},{id:"env",labelKey:"activityBar.env",icon:cm}],co="verification",cp=cn.filter(a=>a.id!==co);cn.map(a=>a.id);let cq="worktree-activity-pane",cr="worktree-header-tools-more";function cs(a){return`flex items-center justify-center h-7 w-7 rounded-md transition-colors ${a?"bg-accent-500/10 text-accent-600 dark:text-accent-400":"text-muted-foreground group-hover:text-surface-foreground group-hover:bg-muted-foreground/10"}`}let ct="group flex flex-shrink-0 items-center justify-center h-8 w-8 rounded-md transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",cu=(0,e.memo)(function({active:a,onToggle:b,foldedCount:c=0}){let f=(0,h.c)("worktree"),g=Math.max(0,Math.min(c,cp.length)),j=cp.slice(0,cp.length-g),k=cp.slice(cp.length-g),l=k.some(b=>b.id===a),m=k.find(b=>b.id===a),n=(0,e.useRef)([]),o=(0,e.useRef)(null),p=(0,e.useRef)(null),q=(0,e.useRef)(null),[r,s]=(0,e.useState)(!1),t=j.length+ +(g>0),u=(0,e.useCallback)(a=>{let b=a<j.length?n.current[a]:o.current;b?.focus()},[j.length]),v=j.findIndex(b=>b.id===a),w=-1!==v?v:l?j.length:0,x=(0,e.useCallback)((a,b)=>{if(0!==t){if("ArrowRight"===a.key){a.preventDefault(),u((b+1)%t);return}if("ArrowLeft"===a.key){a.preventDefault(),u((b-1+t)%t);return}if("Home"===a.key){a.preventDefault(),u(0);return}"End"===a.key&&(a.preventDefault(),u(t-1))}},[t,u]),y=(0,e.useCallback)((a,c,d)=>{if("Enter"===a.key||" "===a.key){a.preventDefault(),b(d);return}x(a,c)},[b,x]),z=(0,e.useCallback)(a=>{s(!1),a&&o.current?.focus()},[]),A=(0,e.useCallback)(a=>{if("Enter"===a.key||" "===a.key||"ArrowDown"===a.key){a.preventDefault();let b="ArrowDown"===a.key;s(a=>b||!a);return}if("Escape"===a.key&&r){a.preventDefault(),z(!0);return}x(a,j.length)},[r,z,x,j.length]);(0,e.useEffect)(()=>{0===g&&s(!1)},[g]),(0,e.useEffect)(()=>{if(!r)return;let a=p.current;if(!a)return;let b=a.querySelector('[role="tab"][aria-selected="true"]');(b??a.querySelector('[role="tab"]'))?.focus()},[r]),(0,e.useEffect)(()=>{if(!r)return;let a=a=>{let b=a.target;b instanceof Node&&q.current?.contains(b)||s(!1)};return document.addEventListener("pointerdown",a),()=>document.removeEventListener("pointerdown",a)},[r]);let B=(0,e.useCallback)(a=>{let b=a.relatedTarget;b instanceof Node&&q.current?.contains(b)||null!==b&&s(!1)},[]),C=(0,e.useCallback)(a=>{b(a),z(!0)},[b,z]),D=(0,e.useCallback)((a,b,c)=>{let d=p.current?Array.from(p.current.querySelectorAll('[role="tab"]')):[];if("Enter"===a.key||" "===a.key){a.preventDefault(),C(c);return}if("Escape"===a.key){a.preventDefault(),z(!0);return}0!==d.length&&("ArrowDown"===a.key?(a.preventDefault(),d[(b+1)%d.length]?.focus()):"ArrowUp"===a.key?(a.preventDefault(),d[(b-1+d.length)%d.length]?.focus()):"Home"===a.key?(a.preventDefault(),d[0]?.focus()):"End"===a.key&&(a.preventDefault(),d[d.length-1]?.focus()))},[C,z]),E=m?f("headerTools.moreActive",{label:f(m.labelKey)}):f("headerTools.more");return(0,d.jsxs)("div",{ref:q,"data-testid":"header-tool-bar",className:"relative flex flex-shrink-0 items-center",onBlur:B,children:[(0,d.jsx)("div",{id:"worktree-header-tools",role:"tablist","aria-orientation":"horizontal","aria-label":f("headerTools.label"),className:"flex items-center",children:j.map((c,e)=>{let g=c.icon,h=a===c.id,i=f(c.labelKey);return(0,d.jsx)(aw.m_,{content:i,placement:"bottom",children:(0,d.jsx)("button",{ref:a=>{n.current[e]=a},type:"button",role:"tab","aria-selected":h,"aria-label":i,"aria-controls":cq,tabIndex:e===w?0:-1,onClick:()=>b(c.id),onKeyDown:a=>y(a,e,c.id),"data-testid":`header-tool-${c.id}`,"data-activity-entry":c.id,className:ct,children:(0,d.jsx)("span",{"aria-hidden":"true",className:cs(h),children:(0,d.jsx)(g,{size:18,"aria-hidden":"true"})})})},c.id)})}),g>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(aw.m_,{content:E,placement:"bottom",children:(0,d.jsx)("button",{ref:o,type:"button","aria-label":E,"aria-haspopup":"true","aria-expanded":r,"aria-controls":r?cr:void 0,tabIndex:w===j.length?0:-1,onClick:()=>s(a=>!a),onKeyDown:A,"data-testid":"header-tool-more","data-active":l?"true":"false",className:ct,children:(0,d.jsxs)("span",{"aria-hidden":"true",className:`relative ${cs(l)}`,children:[(0,d.jsx)(i.A,{size:18,"aria-hidden":"true"}),l&&(0,d.jsx)("span",{"data-testid":"header-tool-more-active-mark",className:"absolute right-0.5 top-0.5 h-1.5 w-1.5 rounded-full bg-accent-500"})]})})}),r&&(0,d.jsx)("div",{ref:p,id:cr,role:"tablist","aria-orientation":"vertical","aria-label":f("headerTools.more"),"data-testid":"header-tool-more-list","data-floating-layer":"open",className:"absolute right-0 top-full z-40 mt-1 flex min-w-[12rem] flex-col rounded-lg border border-border bg-surface p-1 shadow-lg",children:k.map((b,c)=>{let e=b.icon,g=a===b.id,h=f(b.labelKey);return(0,d.jsxs)("button",{type:"button",role:"tab","aria-selected":g,"aria-controls":cq,onClick:()=>C(b.id),onKeyDown:a=>D(a,c,b.id),"data-testid":`header-tool-more-item-${b.id}`,className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ${g?"bg-accent-500/10 text-accent-600 dark:text-accent-400":"text-foreground hover:bg-muted"}`,children:[(0,d.jsx)(e,{size:16,"aria-hidden":"true"}),(0,d.jsx)("span",{children:h})]},b.id)})})]})]})});var cv=c(20316);function cw(a,b,c){return(0,m.Mq)(a,(0,b0.px)(c?b?.[c]:void 0))}function cx(a,b,c){if(!a)return null;let d=b?`${a} \xb7 ${b}`:a;return c?`${c} \xb7 ${d}`:d}function cy(a,b){if(!a||!a.liveness&&!a.degradedReason)return null;let c=b("sse"===a.kind?"agentSource.kindSse":"scraper"===a.kind?"agentSource.kindScraper":"agentSource.kindHooks"),d=void 0===a.degradedReason?null:"port_identity_changed"===a.degradedReason?b("agentSource.reasonPortIdentityChanged"):"heartbeat_stale"===a.degradedReason?b("agentSource.reasonHeartbeatStale"):"not_subscribed"===a.degradedReason?b("agentSource.reasonNotSubscribed"):b("agentSource.reasonOther",{reason:a.degradedReason}),e=["stale"===a.liveness?b("agentSource.livenessStale"):"live"===a.liveness?b("agentSource.livenessLive"):null,d].filter(a=>null!==a).join(" \xb7 ");return e?b("agentSource.line",{kind:c,state:e}):b("agentSource.lineBare",{kind:c})}function cz(a,b,c=2){return"number"==typeof a&&Number.isFinite(a)?new Intl.NumberFormat(b,{style:"currency",currency:"USD",minimumFractionDigits:c,maximumFractionDigits:c}).format(a):null}function cA(a,b,c,d){var e;let f=cz(a?.cost,d),g=(e=b?.tokens,"number"==typeof e&&Number.isFinite(e)?new Intl.NumberFormat(d,{notation:"compact",maximumFractionDigits:1}).format(e):null),h=[];return f&&h.push(f),g&&h.push("number"==typeof b?.percent?c("agentSession.context",{tokens:g,percent:b.percent}):g),h.length>0?h.join(" \xb7 "):null}function cB(a){if(!a)return{};let b={};for(let[c,d]of Object.entries(a)){let a=cx(d?.model,d?.reasoningEffort);a&&(b[c]=a)}return b}function cC(a,b,c,d){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(!1),l=(0,e.useCallback)(async()=>{if(a){k(!0);try{let c=await bP.y.updateDescription(a.id,h);b(c),g(!1)}catch(a){console.error("Failed to save description:",a)}finally{k(!1)}}},[a,h,b]),m=(0,e.useCallback)(()=>{i(a?.description||""),g(!1)},[a]);return{isEditing:f,text:h,setText:i,isSaving:j,handleSave:l,handleCancel:m,startEditing:(0,e.useCallback)(()=>{g(!0)},[])}}let cD=(0,e.memo)(function({worktreeId:a,worktree:b,cardClassName:c,descriptionEditor:f,showLogs:g,onToggleLogs:i,onWorktreeUpdate:j}){let{isEditing:l,text:m,setText:n,isSaving:o,handleSave:p,handleCancel:q,startEditing:r}=f,s=(0,h.c)("worktree"),t=(0,h.c)("common"),{showToast:u}=(0,bO.dj)(),{copied:v,markCopied:w}=(0,bu.q)(),{copied:x,markCopied:y}=(0,bu.q)(),z=(0,e.useCallback)(async()=>{try{await (0,bk.l)(b.path),w()}catch{}},[b.path,w]),A=(0,e.useCallback)(async()=>{try{await (0,bk.l)(b.repositoryPath),y()}catch{}},[b.repositoryPath,y]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:c,children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.worktree")}),(0,d.jsx)("p",{className:"text-lg font-semibold text-foreground",children:b.name})]}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.repository")}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:A,className:"flex-shrink-0 p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":s("detail.copyRepositoryPath"),title:x?s("detail.copied"):s("detail.copyRepositoryPath"),children:x?(0,d.jsx)(a9.A,{className:"w-3.5 h-3.5 text-success"}):(0,d.jsx)(bb,{className:"w-3.5 h-3.5"})})]}),(0,d.jsx)("p",{className:"text-base text-foreground",children:b.repositoryDisplayName??b.repositoryName}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:b.repositoryPath})]}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.path")}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:z,className:"flex-shrink-0 p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":s("detail.copyWorktreePath"),title:v?s("detail.copied"):s("detail.copyPath"),children:v?(0,d.jsx)(a9.A,{className:"w-3.5 h-3.5 text-success"}):(0,d.jsx)(bb,{className:"w-3.5 h-3.5"})})]}),(0,d.jsx)("p",{className:"text-sm text-foreground break-all font-mono",children:b.path})]}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.status")}),(0,d.jsx)("select",{value:b.status??"",onChange:async a=>{let c=a.target,d=b.status??"",e=c.value;try{let a=await (0,cv.V9)(b.id,""===e?null:e);j?.(a)}catch{c.value=d,u(t("branchItem.statusChangeFailed"),"error")}},className:"text-sm px-3 py-1.5 rounded-lg border border-input bg-surface text-foreground focus:ring-2 focus:ring-ring focus:border-transparent w-full","data-testid":"mobile-status-dropdown","aria-label":s("detail.worktreeStatusLabel"),children:cv.m9.map(a=>(0,d.jsx)("option",{value:a.value??"",children:s(a.labelKey)},a.labelKey))})]}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.description")}),!l&&(0,d.jsx)("button",{type:"button",onClick:r,className:"text-sm text-accent-600 hover:text-accent-800 dark:text-accent-400 dark:hover:text-accent-300",children:s("actions.edit")})]}),l?(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)("textarea",{value:m,onChange:a=>n(a.target.value),placeholder:s("detail.addNotesPlaceholder"),className:"w-full min-h-[150px] p-3 border border-input dark:bg-surface dark:text-foreground rounded-lg resize-y focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",autoFocus:!0}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:p,disabled:o,className:"px-4 py-2 bg-accent-600 text-white rounded-lg hover:bg-accent-700 disabled:opacity-50 text-sm font-medium",children:o?s("actions.saving"):s("actions.save")}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:q,disabled:o,className:"px-4 py-2 bg-muted text-foreground rounded-lg hover:bg-border disabled:opacity-50 text-sm font-medium",children:t("cancel")})]})]}):(0,d.jsx)("div",{className:"min-h-[50px]",children:b.description?(0,d.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:b.description}):(0,d.jsx)("p",{className:"text-sm text-muted-foreground italic",children:s("detail.noDescription")})})]}),b.link&&(0,d.jsxs)("div",{className:c,children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.link")}),(0,d.jsx)("a",{href:b.link,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-600 hover:underline break-all",children:b.link})]}),b.updatedAt&&(0,d.jsxs)("div",{className:c,children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.lastUpdated")}),(0,d.jsx)("p",{className:"text-sm text-foreground",children:new Date(b.updatedAt).toLocaleString()})]}),(0,d.jsx)(bT,{version:"v0.49.0",className:c}),(0,d.jsx)(b$,{className:c}),(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.logs")}),(0,d.jsx)("button",{type:"button",onClick:i,className:"text-sm text-accent-600 hover:text-accent-800",children:g?s("detail.hide"):s("detail.show")})]}),g&&(0,d.jsx)(bQ,{worktreeId:a})]})]})}),cE=(0,e.memo)(function({worktreeId:a,worktreeName:b,repositoryName:c,description:f,status:g,gitStatus:i,onInfoClick:j,hasUpdate:n,sessionStatusByCli:o,sessionStatusByInstance:p,instances:r,activeInstanceId:s,onActiveInstanceChange:t,onAgentDragStart:u,onAgentDragEnd:v,onKillSession:w,agentSessionByInstance:x,agentAddControl:y,splitInstanceIds:z,activeActivity:A=null,onActivityToggle:B}){let D=(0,h.c)("worktree"),E=(0,bG.Ym)(),F=(0,h.c)("common"),G=bH.sb[g],H=G?D(G):void 0,[I,J]=(0,e.useState)(null),K=r?.find(a=>a.id===s),L=!!s&&(p?.[s]?.isRunning??(K?o?.[K.cliTool]?.isRunning:void 0)??!1),M=cw(g,o,K?.cliTool),N=(0,e.useCallback)((a,b)=>{a.dataTransfer.setData(aB,b),a.dataTransfer.effectAllowed="move",J(b),u?.(b)},[u]),O=(0,e.useCallback)(()=>{J(null),v?.()},[v]),P=i&&"(unknown)"!==i.currentBranch?i:null,Q=null!==P&&P.currentBranch!==b,R=(r??[]).map(a=>({item:a,status:(0,b0.kA)(p?.[a.id]??o?.[a.cliTool]),isActive:a.id===s})),S=new Set((r??[]).filter(a=>(0,b0.px)(p?.[a.id]??o?.[a.cliTool])).map(a=>a.id)),T=(r??[]).some(a=>(p?.[a.id]??o?.[a.cliTool])?.awaitingInstruction===!0),U=!!w&&L,V=(0,bR.Y)(),W=`${V.updateInfo?.latestVersion??""}:${V.hasUpdate}:${V.state}`,X=[E,b,c,Q?P?.currentBranch??"":"",P?.isDirty?"dirty":"",P?.statusUnknown?"status-unknown":"",U?"end":"",T?"awaiting":"",W,R.length>0?"sessions":""].join("\n"),Y=(0,e.useRef)(null),Z=(0,e.useRef)(null),$=function(a,b,c,d=0){let e=Math.max(0,d),f=as(a,b,`${c}
20
20
  tools:${e}`,e+1,null);return{foldedTools:Math.min(f,e),squeezed:f>=e+1}}(Y,Z,X,B?cp.length:0),_=a=>{let b,c,d,e,f=a.item,g=(b=f.id,c=a.status,(0,m.Mq)(c,S.has(b))?F(m.rH):F(`status.${c}`)),h=D("detail.statusPill",{label:(0,al.sw)(f),status:g}),i=z?z.indexOf(f.id):-1;return{id:f.id,status:a.status,fullLabel:h,name:(0,al.sw)(f),statusWord:g,tooltip:((a,b,c)=>{let d=(0,al.sw)(a),e=p?.[a.id],f=x?.[a.id],g=cx(e?.model,e?.reasoningEffort,f?.session?.agent),h=g?D("detail.statusPillWithModel",{label:d,status:c,model:g}):b,i=cA(f?.session,f?.context,D,E),j=i?D("detail.statusPillWithUsage",{base:h,usage:i}):h,k=cy(e?.eventSource,D);return k?D("detail.statusPillWithSource",{base:j,source:k}):j})(f,h,g),dotClass:(d=f.id,e=a.status,(0,m.Mq)(e,S.has(d))?m.Jd:void 0),splitIndex:-1===i?null:i,isActive:a.isActive}},aa=(0,bI.sI)(r??[],s),ab=R.find(a=>a.item.id===aa),ac=ab?_(ab):null,ad=(0,bI.XV)(R,a=>a.id===aa).map(_),ae=(0,e.useRef)(null);return(0,d.jsxs)("div",{ref:Y,"data-testid":"desktop-header",className:"flex h-11 flex-shrink-0 items-center justify-between gap-3 px-4 bg-surface border-b border-border",children:[(0,d.jsxs)("div",{ref:Z,"data-testid":"desktop-header-identity",className:`flex items-center gap-2 min-w-0${$.squeezed?" overflow-x-clip":""}`,children:[(0,d.jsx)(l.m,{"data-testid":"desktop-status-indicator",status:g,size:"lg",label:M?F(m.rH):H,className:M?m.Jd:void 0,"data-unclassified":M?"true":void 0}),(0,d.jsx)("h1",{"data-testid":"desktop-worktree-name",className:"min-w-[6rem] max-w-[240px] shrink-4 truncate text-lg font-semibold leading-tight text-foreground",children:(0,d.jsx)(cb,{worktreeId:a,worktreeName:b,repositoryName:c,description:f})}),P?.isDirty&&(0,d.jsx)("span",{className:"flex-shrink-0 text-warning",title:D("git.uncommittedChanges"),"data-testid":"desktop-git-dirty",children:"*"}),P?.statusUnknown&&(0,d.jsx)("span",{className:"flex-shrink-0 text-muted-foreground",title:D("git.statusUnknown"),"data-testid":"desktop-git-status-unknown",children:"?"}),(0,d.jsx)(b8,{repositoryName:c}),Q&&P&&(0,d.jsx)("span",{className:"min-w-0 truncate max-w-[150px] font-mono text-xs text-muted-foreground",title:P.currentBranch,"data-testid":"desktop-branch-name",children:q(P.currentBranch,30)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 max-w-full","data-testid":"desktop-header-controls",children:[r&&r.length>0&&(0,d.jsxs)("div",{ref:ae,className:`flex items-center gap-2 min-w-0${$.squeezed?" overflow-x-clip":""}`,"data-testid":"desktop-agent-status-row",children:[T&&(0,d.jsx)("span",{"data-testid":"desktop-awaiting-instruction-badge",className:"flex-shrink-0 rounded-full bg-success-subtle px-1.5 py-0.5 text-[10px] font-medium leading-4 text-success-foreground",title:D("awaitingInstruction.label"),children:D("awaitingInstruction.badge")}),(0,d.jsx)(bN,{current:ac,others:ad,onSelect:t,onDragStart:N,onDragEnd:O,draggingInstanceId:I,onAddSession:y?()=>{(()=>{let a=ae.current?.lastElementChild??null;return a?a instanceof HTMLButtonElement?a:a.querySelector("button"):null})()?.click()}:void 0,canAddSession:(r?.length??0)<al.Ab}),y]}),U&&(0,d.jsxs)(k.$n,{variant:"ghost",type:"button",onClick:w,className:"flex items-center gap-1 px-2 py-1.5 text-xs font-medium rounded-lg text-danger-foreground hover:bg-danger-subtle transition-colors flex-shrink-0","aria-label":D("terminal.endSession"),"data-testid":"desktop-kill-session",children:[(0,d.jsx)("span",{"aria-hidden":"true",children:"✕"}),F("end")]}),(0,d.jsx)(ce.H,{}),(0,d.jsxs)(k.$n,{variant:"ghost",type:"button",onClick:j,className:"relative flex flex-shrink-0 items-center gap-1.5 px-3 py-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded-lg transition-colors","aria-label":D("detail.viewInfo"),"data-testid":"desktop-info-button",children:[(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,d.jsx)("span",{className:"text-sm font-medium",children:D("detail.info")}),n&&(0,d.jsx)(C,{"data-testid":"info-update-indicator",className:"absolute top-0 right-0","aria-label":D("tabs.updateAvailable")})]}),B&&(0,d.jsx)(cu,{active:A,onToggle:B,foldedCount:$.foldedTools})]})]})}),cF=(0,e.memo)(function({worktreeId:a,worktree:b,isOpen:c,onClose:f,onWorktreeUpdate:g}){let[i,j]=(0,e.useState)(!1),k=(0,h.c)("worktree"),l=(0,e.useRef)(c),m=cC(b,g,c,()=>{let a=c&&!l.current;return l.current=c,a});return b?(0,d.jsx)(b_.a,{isOpen:c,onClose:f,title:k("detail.infoModalTitle"),size:"md",children:(0,d.jsx)("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto","data-testid":"worktree-info-modal",children:(0,d.jsx)(cD,{worktreeId:a,worktree:b,cardClassName:"bg-muted rounded-lg p-4",descriptionEditor:m,showLogs:i,onToggleLogs:()=>j(!i),onWorktreeUpdate:g})})}):null}),cG=(0,e.memo)(function(){let a=(0,h.c)("worktree");return(0,d.jsx)("div",{className:"flex items-center justify-center h-full min-h-[200px]",role:"status","aria-live":"polite",children:(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,d.jsx)(k.y$,{size:"xl",variant:"accent"}),(0,d.jsx)("p",{className:"text-muted-foreground",children:a("detail.loading")})]})})}),cH=(0,e.memo)(function({message:a,onRetry:b}){let c=(0,h.c)("worktree"),e=(0,h.c)("common");return(0,d.jsx)("div",{className:"flex items-center justify-center h-full min-h-[200px]",role:"alert","aria-live":"assertive",children:(0,d.jsxs)("div",{className:"text-center p-6 bg-danger-subtle rounded-lg border border-danger-border max-w-md",children:[(0,d.jsx)("svg",{className:"mx-auto h-12 w-12 text-danger-foreground/70 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.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,d.jsx)("p",{className:"text-danger-foreground font-medium",children:c("detail.errorLoading")}),(0,d.jsx)("p",{className:"text-danger-foreground/80 text-sm mt-2",children:a}),b&&(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:b,className:"mt-4 px-4 py-2 bg-danger-foreground text-danger-subtle rounded-lg hover:opacity-90 transition-opacity focus:outline-none focus:ring-2 focus:ring-danger focus:ring-offset-2 ring-offset-background",children:e("retry")})]})})}),cI=(0,x.A)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var cJ=c(3171),cK=c(12178),cL=c(44047),cM=c(98639),cN=c(50391);function cO(a){return""!==(a??"").trim()}function cP({worktreeId:a,cliToolId:b,instanceId:c,composerText:f,onActionSent:g}){let i=(0,h.c)("worktree"),[j,k]=(0,e.useState)(!1),l=(0,cN.B)(a,b,c,g),m=(0,e.useCallback)(()=>{l(["Enter"])},[l]),n=(0,e.useCallback)(()=>{k(!0);let d=c&&c!==b?{cliToolId:b,instanceId:c}:{cliToolId:b};fetch(`/api/worktrees/${encodeURIComponent(a)}/clear-composer`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}).then(()=>{g&&setTimeout(g,aH.LK)}).catch(a=>{console.error("Failed to clear composer:",a)}).finally(()=>{k(!1)})},[a,b,c,g]);if(!cO(f))return null;let o=f.length>300?`${f.slice(0,300)}…`:f;return(0,d.jsxs)("div",{"data-testid":"unsent-composer-bar",role:"region","aria-label":i("unsentComposer.regionLabel"),className:"flex flex-wrap items-center gap-2 px-2 py-1.5 bg-info-subtle border border-info-border rounded-lg",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-info-foreground shrink-0",children:i("unsentComposer.label")}),(0,d.jsx)("code",{"data-testid":"unsent-composer-text",className:"flex-1 min-w-0 font-mono text-xs text-foreground break-all line-clamp-3 whitespace-pre-wrap",children:o}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:m,"aria-label":i("unsentComposer.run"),className:"min-h-[32px] px-3 rounded-md text-xs font-medium bg-info-foreground text-info-subtle hover:opacity-90 transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background",children:i("unsentComposer.run")}),(0,d.jsx)("button",{type:"button",onClick:n,disabled:j,"aria-label":i("unsentComposer.clear"),className:"min-h-[32px] px-3 rounded-md text-xs font-medium bg-surface border border-info-border text-info-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background",children:i("unsentComposer.clear")})]})]})}var cQ=c(7879),cR=c(20203),cS=c(98354);let cT=/^([^\S\n]*)╹(▀{4,})/,cU=/^([^\S\n]*)[│┃]/;function cV(a,b){return"opencode"===a&&null!==function(a){let b=(0,cQ.aJ)(a).split("\n"),c=-1,d=-1,e=-1;for(let a=0;a<b.length;a++){let f=cT.exec(b[a]);f&&(c=a,e=(d=f[1].length)+1+f[2].length)}if(-1===c)return null;let f=0,g="";for(let a=0;a<b.length;a++){let h=b[a];if(a!==c){let a=cU.exec(h);if(!a||a[1].length!==d)continue}let i=h.slice((0,cS.sh)(h,e)).trim();""!==i&&(f+=1,""===g&&(g=(0,cR.D)(i,200,"…[truncated]")))}return f<2?null:{id:"opencode_sidebar",matchedText:g,boxRight:e,rows:f}}(b??"")}function cW({cliToolId:a,frame:b}){let c=(0,h.c)("worktree");return(0,e.useMemo)(()=>cV(a,b),[a,b])?(0,d.jsxs)("div",{"data-testid":"opencode-sidebar-notice",role:"status","aria-label":c("opencodeSidebar.regionLabel"),className:"flex flex-wrap items-center gap-2 px-2 py-1.5 bg-warning-subtle border border-warning-border rounded-lg",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-warning-foreground shrink-0",children:c("opencodeSidebar.label")}),(0,d.jsx)("span",{className:"flex-1 min-w-0 text-xs text-foreground",children:c("opencodeSidebar.body")}),(0,d.jsx)("code",{"data-testid":"opencode-sidebar-notice-chord",className:"shrink-0 font-mono text-xs px-1.5 py-0.5 rounded bg-surface border border-warning-border text-warning-foreground",children:"ctrl+x b"})]}):null}var cX=c(49343),cY=c(87692);function cZ(a,b){return(0,e.useMemo)(()=>({isRunning:a.isRunning,attaching:a.attaching,sessionStatus:a.sessionStatus,isThinking:a.isThinking,isPromptWaiting:b.visible,promptData:b.data,isSelectionListActive:a.isSelectionListActive,isPagerActive:a.isPagerActive,isDismissablePanelActive:a.isDismissablePanelActive,isUnclassifiedActive:a.isUnclassifiedActive,startingSince:a.startingSince}),[a.isRunning,a.attaching,a.sessionStatus,a.isThinking,a.isSelectionListActive,a.isPagerActive,a.isDismissablePanelActive,a.isUnclassifiedActive,a.startingSince,b.visible,b.data])}var c$=c(2249),c_=c(56308),c0=c(67471),c1=c(38557);function c2({worktreeId:a,serverMessages:b,onSent:c}){let d=(0,e.useCallback)((b,c)=>bP.y.sendMessage(a,b,c),[a]),f=(0,c1.Fx)(),g=(0,e.useMemo)(()=>({offline:(0,c1.sV)(f.signals),reachable:(0,c1._X)(f.signals)}),[f.signals]);return(0,c0.v4)({worktreeId:a,serverMessages:b,sendFn:d,onSent:c,connectivity:g})}function c3(a,b){return(0,e.useCallback)(c=>{let d=a(c);d&&b?.(d)},[a,b])}let c4=(0,e.createContext)({register:()=>{},insertToComposer:()=>{}}),c5=(0,e.createContext)(null);function c6(a){return a.instanceId??a.cliToolId}function c7({onInsertToComposer:a,children:b}){let[c,f]=(0,e.useState)(null),g=(0,e.useRef)(a);g.current=a;let h=(0,e.useCallback)(a=>{g.current?.(a)},[]),i=(0,e.useMemo)(()=>({register:f,insertToComposer:h}),[h]);return(0,d.jsx)(c4.Provider,{value:i,children:(0,d.jsx)(c5.Provider,{value:c,children:b})})}function c8(a){let b=(0,e.useContext)(c5);if(null!==b&&b.target.cliToolId===a.cliToolId&&c6(b.target)===c6(a))return b.send}var c9=c(13074),da=c(25178),db=c(74930),dc=c(12055);function dd({showSessionRow:a,sessionNote:b,onCommit:c,onCancel:e}){let f=(0,h.c)("worktree");return(0,d.jsxs)("div",{"data-testid":"mobile-session-note-editor",className:`absolute inset-x-2 z-40 rounded-md border border-border bg-surface p-2 shadow-lg ${a?"top-9":"top-2"}`,children:[(0,d.jsx)(aD,{initialText:b?.text??"",onCommit:c,onCancel:e,ariaLabel:f("sessionNote.menuItem"),placeholder:f("sessionNote.placeholder"),testId:"mobile-session-note-input"}),(0,d.jsx)("p",{className:"mt-1 text-[10px] leading-tight text-muted-foreground",children:f("sessionNote.hint")})]})}let de=[{mode:"terminal",labelKey:"surfaceMode.terminal",icon:w.A},{mode:"chat",labelKey:"surfaceMode.chat",icon:ay.A}];function df({surfaceMode:a,showSessionRow:b,directInputOpen:c,onSurfaceToggle:e,showToolActivity:f,onToggleToolActivity:g}){let i=(0,h.c)("worktree");return(0,d.jsxs)("div",{role:"group","aria-label":i("surfaceMode.groupLabelMobile"),"data-testid":"mobile-surface-mode-toggle",className:`pointer-events-none absolute right-2 z-30 flex items-center gap-0.5 rounded-full border border-border bg-surface-2/95 p-0.5 shadow-lg backdrop-blur ${b?"top-9":"top-2"}`,children:[de.map(({mode:b,labelKey:f,icon:g})=>{let h=a===b,j=i(f);return(0,d.jsx)("button",{type:"button",onClick:()=>e(b),"aria-pressed":h,"aria-label":j,"aria-disabled":!!c||void 0,title:j,"data-testid":`mobile-surface-mode-${b}`,className:`pointer-events-auto flex min-h-[44px] min-w-[44px] items-center justify-center rounded-full transition-colors touch-manipulation ${h?"bg-accent-500/20 text-accent-600 dark:text-accent-400":"text-muted-foreground"} ${c?"opacity-40":""}`,children:(0,d.jsx)(g,{size:18,"aria-hidden":"true"})},b)}),"chat"===a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"mx-0.5 h-6 w-px bg-border"}),(0,d.jsx)("button",{type:"button",onClick:g,"aria-pressed":f,"aria-label":f?i("chatTranscript.toolActivity.hide"):i("chatTranscript.toolActivity.show"),title:f?i("chatTranscript.toolActivity.hide"):i("chatTranscript.toolActivity.show"),"data-testid":"mobile-chat-tool-activity-toggle",className:`pointer-events-auto flex min-h-[44px] min-w-[44px] items-center justify-center rounded-full transition-colors touch-manipulation ${f?"bg-accent-500/15 text-accent-700 dark:text-accent-400":"text-muted-foreground"}`,children:(0,d.jsx)(A.A,{size:18,"aria-hidden":"true"})})]}):null]})}var dg=c(11131),dh=c(84666),di=c(70911);function dj(a){let[b,c]=(0,e.useState)(am.wf);return{surfaceMode:b,handleSurfaceModeChange:(0,e.useCallback)(b=>{c(b),(0,di.If)(a,b)},[a])}}function dk(a,b,c,d){return{model:cx(a,null,b.session?.agent),usage:cA(b.session,b.context,c,d),usageDetail:function(a,b,c,d){let e=[];a?.title&&e.push(c("agentSession.titleLabel",{title:a.title})),a?.agent&&e.push(c("agentSession.agentLabel",{agent:a.agent}));let f=cz(a?.cost,d,4);f&&e.push(c("agentSession.costLabel",{cost:f}));let g=function(a){if(!a)return null;if(null!==a.total)return a.total;let b=[a.input,a.output,a.reasoning,a.cacheRead,a.cacheWrite].filter(a=>"number"==typeof a&&Number.isFinite(a));return 0===b.length?null:b.reduce((a,b)=>a+b,0)}(a?.tokens);if(null!==g&&e.push(c("agentSession.spentLabel",{tokens:new Intl.NumberFormat(d).format(g)})),"number"==typeof b?.tokens){let a=new Intl.NumberFormat(d).format(b.tokens);e.push("number"==typeof b.limit&&"number"==typeof b.percent?c("agentSession.contextLabel",{tokens:a,limit:new Intl.NumberFormat(d).format(b.limit),percent:b.percent}):c("agentSession.contextUnknownLabel",{tokens:a}))}return e.length>0?e.join("\n"):null}(b.session,b.context,c,d)}}let dl="top-16",dm=[dg.Mx,"m"],dn="/model",dp=(0,e.memo)(function({modelLabel:a,usage:b,usageDetail:c,recentChange:e,note:f,onEditNote:g,onOpenPicker:i,onDismissChange:j}){let k=(0,h.c)("worktree"),l=null!==e,m=k("agentModel.sessionRow",{model:a??""}),n=f?(0,ap.Uq)(new Date(f.updatedAt)):"",o=f?k("sessionNote.label",{note:f.text,time:n}):k("sessionNote.menuItem");return(0,d.jsxs)("div",{"data-testid":"mobile-session-row","data-model-changed":l?"true":"false",className:`relative z-20 flex h-7 shrink-0 items-center gap-2 border-b px-3 text-[11px] leading-none ${l?"border-warning-border bg-warning-subtle text-warning-foreground":"border-border bg-surface-2 text-muted-foreground"}`,children:[a?(0,d.jsxs)("button",{type:"button",onClick:i,"aria-label":m,title:m,"data-testid":"mobile-session-model",className:`relative flex min-w-0 basis-0 grow items-center gap-1.5 truncate text-left touch-manipulation before:absolute before:inset-x-0 before:-inset-y-2 before:content-[''] ${f?"shrink-[4]":"shrink"}`,children:[(0,d.jsx)(cI,{size:12,"aria-hidden":"true",className:"shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:a})]}):null,f?(0,d.jsxs)("button",{type:"button",onClick:g,"aria-label":o,title:o,"data-testid":"mobile-session-note",className:"relative flex min-w-0 shrink basis-0 grow items-center gap-1 text-left touch-manipulation before:absolute before:inset-x-0 before:-inset-y-2 before:content-['']",children:[(0,d.jsx)(ag,{size:12,"aria-hidden":"true",className:"shrink-0 opacity-70"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:f.text}),(0,d.jsx)("span",{"data-testid":"mobile-session-note-time",className:"shrink-0 tabular-nums opacity-70",children:n})]}):null,b?(0,d.jsx)("span",{"data-testid":"mobile-session-usage",title:c??k("agentSession.chipLabel",{usage:b}),className:"min-w-0 max-w-[10rem] shrink-0 truncate tabular-nums",children:b}):null,e?(0,d.jsx)("button",{type:"button",onClick:j,"aria-label":k("agentModel.changedRecentlyDetail",{from:e.from,to:e.to}),title:k("agentModel.changedRecentlyDetail",{from:e.from,to:e.to}),"data-testid":"mobile-session-model-changed",className:"relative shrink-0 rounded-full border border-warning-border bg-warning/20 px-1.5 py-0.5 font-medium touch-manipulation before:absolute before:inset-x-0 before:-inset-y-2 before:content-['']",children:k("agentModel.changedRecently")}):null]})}),dq=(0,e.memo)(function({worktreeId:a,cliToolId:b,instanceId:c,live:f,frame:g,onKeysSent:h,onSurfaceModeChange:i}){let{messages:j,isLoading:k,refresh:l}=(0,c_.Md)({worktreeId:a,cliToolId:b,instanceId:c}),{messages:m,sendOptimistic:n,retry:o,discard:p}=c2({worktreeId:a,serverMessages:j,onSent:l});!function({cliToolId:a,instanceId:b,send:c}){let{register:d}=(0,e.useContext)(c4)}({cliToolId:b,instanceId:c,send:n});let{worktreePath:q,openFile:r}=(0,c9.O)(),s=(0,e.useContext)(c4).insertToComposer,t=c3(p,s);return(0,d.jsx)(cY.wY,{messages:m,worktreeId:a,worktreePath:q,cliToolId:b,instanceId:c,live:f,onSurfaceModeChange:i,frame:g,onKeysSent:h,compact:!0,history:{onFilePathClick:r,isLoading:k,onRetryPending:o,onDiscardPending:t,onInsertToMessage:s,hideCornerControls:!0,openSearchOnWindowEvent:!0,searchBarTopClassName:dl}})}),dr=(0,e.memo)(function({worktreeId:a,cliToolId:b,instanceId:c,disableAutoFollow:f,onSurfaceModeChange:g,directInputOpen:i=!1,branchName:j,instances:k}){let{terminal:l,prompt:m,agentSession:n,setAutoScroll:o,refresh:p}=(0,c$.NK)({worktreeId:a,cliToolId:b,instanceId:c}),{compactTuiLayoutPadding:q,preservePaintedPanelRows:r,mobileWrapMode:s}=(0,dh.EK)(b),t=(0,h.c)("worktree"),u=(0,bG.Ym)(),v=c??b,{model:w,usage:x,usageDetail:y}=dk(function(a,b){let c=(0,ao.rC)(),d=c?.worktrees;return(0,e.useMemo)(()=>{let c=d?.find(b=>b.id===a);return cB(c?.sessionStatusByInstance)[b]??null},[d,a,b])}(a,v),n,t,u),z=function(a,b,c,d){let f=(0,h.c)("worktree");return(0,e.useMemo)(()=>{let e=c?.find(a=>a.id===b),g=(0,al.sw)(e??{cliTool:a}),h=d?.trim()?d.trim():null;return h?{text:f("terminal.composerTarget",{agent:g,branch:h}),label:f("terminal.composerTargetLabel",{agent:g,branch:h})}:{text:f("terminal.composerTargetNoBranch",{agent:g}),label:f("terminal.composerTargetLabelNoBranch",{agent:g})}},[c,b,a,d,f])}(b,v,k,j),{sessionNote:A,noteEditing:B,openNoteEditor:C,closeNoteEditor:D,commitNote:E}=function(a,b){let{note:c,save:d}=aC(a,b),[f,g]=(0,e.useState)(!1),h=(0,e.useCallback)(()=>g(!0),[]);return{sessionNote:c,noteEditing:f,openNoteEditor:h,closeNoteEditor:(0,e.useCallback)(()=>g(!1),[]),commitNote:(0,e.useCallback)(a=>{d(a),g(!1)},[d])}}(a,v),F=null!==w||null!==A,{recentModelChange:G,dismissModelChange:H}=function(a,b){let c=(0,ao.rC)(),[d,f]=(0,e.useState)(null);return(0,db.T3)(d=>{d.type===dc.T4&&d.worktreeId===a&&d.instance===b&&(f({from:d.from,to:d.to,at:d.at}),c?.refresh())}),{recentModelChange:d,dismissModelChange:(0,e.useCallback)(()=>f(null),[])}}(a,v),I=(0,cN.B)(a,b,c,p),J=c8({cliToolId:b,instanceId:c}),K=(0,e.useRef)(null);(0,e.useEffect)(()=>()=>{null!==K.current&&clearTimeout(K.current)},[]);let L=(0,e.useCallback)(()=>{if("opencode"===b)return void I([...dm]);let d={cliToolId:b,instanceId:c};J?J(dn,d):bP.y.sendMessage(a,dn,d).catch(()=>{}),null!==K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{K.current=null,p()},aH.LK)},[b,c,J,p,I,a]),{surfaceMode:M,handleSurfaceModeChange:N}=dj((0,di.NP)(a)),O=(0,e.useCallback)(a=>{i||N(a)},[i,N]),[P,Q]=(0,da.Af)(),R=(0,e.useRef)(null),S=(0,e.useRef)(l.autoScroll);S.current=l.autoScroll,(0,e.useEffect)(()=>{let a=R.current;if(!i||f||null===a)return;let b=()=>{if(!S.current)return;let b=a.querySelector('[role="log"]');b&&(b.scrollTop=b.scrollHeight)};if(b(),"undefined"==typeof ResizeObserver)return;let c=new ResizeObserver(b);return c.observe(a),()=>c.disconnect()},[i,f]),(0,e.useEffect)(()=>{g?.(M)},[g,M]);let T=(0,cM.Bj)((0,cM.qi)(a,v),l.startingSince),U=l.isUnclassifiedActive&&!m.visible&&"chat"!==M&&!T.starting,V=cO(l.composerText),W=cV(b,l.realtimeSnippet||l.output),X=cZ(l,m),Y="chat"===M&&(0,cY.BM)(X,l.output,b);return(0,d.jsxs)("div",{className:"relative flex flex-col h-full min-h-0",children:[(0,d.jsx)(df,{surfaceMode:M,showSessionRow:F,directInputOpen:i,onSurfaceToggle:O,showToolActivity:P,onToggleToolActivity:Q}),F?(0,d.jsx)(dp,{modelLabel:w,usage:x,usageDetail:y,recentChange:G,note:A,onEditNote:C,onOpenPicker:L,onDismissChange:H}):null,B?(0,d.jsx)(dd,{showSessionRow:F,sessionNote:A,onCommit:E,onCancel:D}):null,(0,d.jsxs)("div",{ref:R,className:"relative flex-1 min-h-0 overflow-hidden","data-testid":"mobile-terminal-region",children:["chat"===M?(0,d.jsx)("div",{className:"h-full min-h-0","data-testid":"mobile-chat-surface",children:(0,d.jsx)(dq,{worktreeId:a,cliToolId:b,instanceId:c,live:X,frame:l.output,onKeysSent:p,onSurfaceModeChange:N})}):T.noticeVisible&&null!==T.startingSince?(0,d.jsx)(cL.TE,{cliToolId:b,startingSince:T.startingSince,onShowTerminal:T.revealTerminal}):(0,d.jsx)(cJ.D,{output:l.output,isActive:l.isRunning,isThinking:l.isThinking,autoScroll:l.autoScroll,onScrollChange:o,disableAutoFollow:f,compactTuiLayoutPadding:q,preservePaintedPanelRows:r,wrapMode:s,searchBarTopClassName:dl}),i?null:(0,d.jsx)("div",{"data-testid":"mobile-composer-target","aria-label":z.label,title:z.label,className:"pointer-events-none absolute bottom-1 left-2 z-10 max-w-[70%] truncate rounded bg-surface-2/90 px-1.5 text-[11px] leading-4 text-muted-foreground",children:z.text})]}),V&&!i?(0,d.jsx)("div",{className:"shrink-0 px-2 pt-1",children:(0,d.jsx)(cP,{worktreeId:a,cliToolId:b,instanceId:c,composerText:l.composerText,onActionSent:p})}):null,W?(0,d.jsx)("div",{className:"shrink-0 px-2 pt-1",children:(0,d.jsx)(cW,{cliToolId:b,frame:l.realtimeSnippet||l.output})}):null,!l.isRunning||i||Y?null:(0,d.jsx)("div",{className:"shrink-0 px-2 pt-1","data-testid":"mobile-quick-keys-slot",children:(0,d.jsx)(cX.XU,{worktreeId:a,cliToolId:b,instanceId:c,hasAgentSession:null!==n.session,onKeysSent:p,compact:!0,collapsible:!0,layout:"mobile"})}),U&&!i?(0,d.jsx)("div",{className:"shrink-0 px-2 pt-1 pb-2",children:(0,d.jsx)(cK.U,{worktreeId:a,cliToolId:b,instanceId:c,onKeysSent:p})}):null]})});var ds=c(38463);let dt={isOpen:!1,position:{x:0,y:0},targetPath:null,targetType:null};function du(){let[a,b]=(0,e.useState)(dt),c=(0,e.useCallback)((a,c,d)=>{b({isOpen:!0,position:a,targetPath:c,targetType:d})},[]),d=(0,e.useCallback)((a,b,d)=>{let e,f;if(a.preventDefault(),"touches"in a&&a.touches.length>0)e=a.touches[0].clientX,f=a.touches[0].clientY;else{if(!("clientX"in a))return;e=a.clientX,f=a.clientY}c({x:e,y:f},b,d)},[c]);return{menuState:a,openMenu:d,openMenuAt:c,closeMenu:(0,e.useCallback)(()=>{b(a=>({...a,isOpen:!1}))},[]),resetMenu:(0,e.useCallback)(()=>{b(dt)},[])}}let dv=(0,x.A)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]),dw=(0,x.A)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),dx=(0,x.A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),dy=(0,x.A)("folder-input",[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]]),dz=(0,x.A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);var dA=c(6074);function dB(a,b,c){let d=c-b-8;return d<8?8:Math.min(Math.max(a,8),d)}let dC=(0,e.memo)(function({isOpen:a,position:b,targetPath:c,targetType:g,onClose:i,onNewFile:j,onNewDirectory:k,onRename:l,onDelete:m,onUpload:n,onMove:o,items:p,ariaLabel:q}){let r=(0,h.c)("worktree"),s=(0,e.useRef)(null),{shouldRender:t,isExiting:u}=(0,dA.O)(a,aH.$B),v=p?p.map(a=>a.id).join(","):"builtin",w=`${b.x}:${b.y}:${g}:${v}`,[x,y]=(0,e.useState)(null),z=x?.key===w?x:null;(0,e.useLayoutEffect)(()=>{if(!a)return;let c=s.current;if(!c)return;let d=c.getBoundingClientRect();y({key:w,left:dB(b.x,d.width,window.innerWidth),top:dB(b.y,d.height,window.innerHeight)})},[a,w,b.x,b.y]);let A=(0,e.useCallback)(a=>{a&&c&&a(c),i()},[c,i]),B=[{id:"new-file",label:r("fileTree.newFile"),icon:(0,d.jsx)(dv,{className:"w-4 h-4","aria-hidden":"true",role:"img"}),onClick:()=>A(j),showFor:["directory"]},{id:"new-directory",label:r("fileTree.newDirectory"),icon:(0,d.jsx)(dw,{className:"w-4 h-4","aria-hidden":"true",role:"img"}),onClick:()=>A(k),showFor:["directory"]},{id:"upload",label:r("contextMenu.uploadFile"),icon:(0,d.jsx)(dx,{className:"w-4 h-4","aria-hidden":"true",role:"img"}),onClick:()=>A(n),showFor:["directory"],showDividerAfter:!0},{id:"rename",label:r("contextMenu.rename"),icon:(0,d.jsx)(bn.A,{className:"w-4 h-4","aria-hidden":"true",role:"img"}),onClick:()=>A(l)},{id:"move",label:r("contextMenu.move"),icon:(0,d.jsx)(dy,{className:"w-4 h-4","aria-hidden":"true",role:"img"}),onClick:()=>{o&&c&&g&&o(c,g),i()},showDividerAfter:!0},{id:"delete",label:r("contextMenu.delete"),icon:(0,d.jsx)(dz,{className:"w-4 h-4","aria-hidden":"true",role:"img"}),onClick:()=>A(m),variant:"danger"}],C=p?p.map(a=>({id:a.id,label:a.label,icon:a.icon??null,onClick:()=>{a.onSelect(),i()},variant:a.variant,showDividerAfter:a.showDividerAfter,disabled:a.disabled??!1})):B.filter(a=>!a.showFor||g&&a.showFor.includes(g));if((0,e.useEffect)(()=>{if(!a)return;let b=a=>{if((0,bw.V$)(a))return void i();if("ArrowDown"===a.key||"ArrowUp"===a.key){let b;a.preventDefault();let c=s.current?.querySelectorAll('[role="menuitem"]');if(!c?.length)return;let d=Array.from(c).findIndex(a=>a===document.activeElement);b="ArrowDown"===a.key?d<c.length-1?d+1:0:d>0?d-1:c.length-1,c[b].focus()}};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[a,i]),(0,e.useEffect)(()=>{if(a&&s.current){let a=s.current.querySelector('[role="menuitem"]');a&&a.focus()}},[a]),!t)return null;let D=(0,d.jsx)("div",{ref:s,"data-testid":"context-menu",role:"menu","data-floating-layer":u?void 0:"open","aria-label":q??r("contextMenu.label"),className:`fixed min-w-[160px] py-1 bg-surface rounded-lg shadow-lg border border-border ${u?"animate-out fade-out-0 zoom-out-95 duration-100 fill-mode-forwards pointer-events-none":"animate-in fade-in-0 zoom-in-95 duration-100"}`,style:{zIndex:bo.M.CONTEXT_MENU,left:`${z?z.left:0}px`,top:`${z?z.top:0}px`},children:C.map((a,b)=>{let e=a.disabled??!c;return(0,d.jsxs)(f().Fragment,{children:[(0,d.jsxs)("button",{role:"menuitem","data-testid":`context-menu-${a.id}`,onClick:a.onClick,disabled:e,className:`w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors focus:outline-none focus:bg-muted ${"danger"===a.variant?"text-danger hover:bg-danger-subtle focus:bg-danger-subtle":"text-foreground hover:bg-muted"} ${e?"opacity-50 cursor-not-allowed":""}`,children:[a.icon,(0,d.jsx)("span",{children:a.label})]}),a.showDividerAfter&&b<C.length-1&&(0,d.jsx)("div",{"data-testid":"context-menu-divider",className:"my-1 border-t border-border"})]},a.id)})});return"undefined"==typeof document?D:(0,ak.createPortal)(D,document.body)});var dD=c(79695),dE=c(81497);let dF={showSize:!0,showCreated:!1,showModified:!1};function dG(a){return void 0===a?"":a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}let dH=(0,e.memo)(function({expanded:a}){return(0,d.jsx)("svg",{"data-testid":"chevron-icon",className:`w-4 h-4 text-muted-foreground transition-transform ${a?"rotate-90":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),dI=(0,e.memo)(function({open:a}){return(0,d.jsx)("svg",{"data-testid":"folder-icon",className:"w-5 h-5 flex-shrink-0 text-warning",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:a?(0,d.jsx)("path",{d:"M19 20H5c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h6l2 2h6c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2zM5 6v12h14V8h-7l-2-2H5z"}):(0,d.jsx)("path",{d:"M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"})})}),dJ=(0,e.memo)(function({text:a,query:b}){if(!b||!b.trim())return(0,d.jsx)(d.Fragment,{children:a});let c=o(b),e=a.split(RegExp(`(${c})`,"gi"));return(0,d.jsx)(d.Fragment,{children:e.map((a,c)=>a.toLowerCase()===b.toLowerCase()?(0,d.jsx)("mark",{className:"bg-warning-border text-foreground px-0.5 rounded",children:a},c):(0,d.jsx)("span",{children:a},c))})}),dK=(0,e.memo)(function({extension:a}){let b=(0,e.useMemo)(()=>a&&({ts:"text-info",tsx:"text-info",js:"text-warning",jsx:"text-warning",json:"text-warning",md:"text-muted-foreground",css:"text-accent-500",scss:"text-accent-500",html:"text-warning",py:"text-success"})[a]||"text-muted-foreground",[a]);return(0,d.jsx)("svg",{"data-testid":"file-icon",className:`w-5 h-5 flex-shrink-0 ${b}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),dL=(0,e.memo)(function a({item:b,path:c,depth:f,worktreeId:g,expanded:i,cache:k,onToggle:l,onFileSelect:m,onLoadChildren:n,onContextMenu:o,searchQuery:p,searchMode:q,matchedPaths:r,dateFnsLocaleStr:s,metadataDisplay:t=dF}){let u=(0,h.c)("worktree"),[v,w]=(0,e.useState)(!1),x=c?`${c}/${b.name}`:b.name,y=i.has(x),z="directory"===b.type,A=k.get(x),B=(0,e.useMemo)(()=>s?(0,dD.M)(s):void 0,[s]),C=(0,e.useMemo)(()=>{if(z)return;let a=[];if(void 0!==b.size&&a.push(`${u("fileTree.metadata.size")}: ${dG(b.size)}`),b.birthtime){let c=(0,ap.bg)(new Date(b.birthtime),B);c&&a.push(`${u("fileTree.metadata.created")}: ${c}`)}if(b.mtime){let c=(0,ap.bg)(new Date(b.mtime),B);c&&a.push(`${u("fileTree.metadata.modified")}: ${c}`)}return a.length>0?a.join("\n"):void 0},[z,b.size,b.birthtime,b.mtime,B,u]),D=(0,e.useCallback)(async()=>{z?(y||A||(w(!0),await n(x),w(!1)),l(x)):m?.(x)},[z,y,A,x,n,l,m]),E=(0,e.useCallback)(a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),D())},[D]),F=(0,e.useCallback)(a=>{a.preventDefault(),o?.(a,x,z?"directory":"file")},[x,z,o]),G=function({delay:a=500,moveThreshold:b=10,onLongPress:c}){let d=(0,e.useRef)(null),f=(0,e.useRef)(null),g=(0,e.useRef)(null),h=(0,e.useCallback)(()=>{d.current&&(clearTimeout(d.current),d.current=null),f.current=null,g.current=null},[]),i=(0,e.useCallback)(b=>{if(1!==b.touches.length)return;let e=b.touches[0];f.current={x:e.clientX,y:e.clientY},g.current=b,d.current=setTimeout(()=>{g.current&&c(g.current),h()},a)},[a,c,h]),j=(0,e.useCallback)(a=>{if(!f.current||1!==a.touches.length)return;let c=a.touches[0],d=c.clientX-f.current.x,e=c.clientY-f.current.y;Math.sqrt(d*d+e*e)>b&&h()},[b,h]);return{onTouchStart:i,onTouchMove:j,onTouchEnd:(0,e.useCallback)(()=>{h()},[h]),onTouchCancel:(0,e.useCallback)(()=>{h()},[h])}}({onLongPress:(0,e.useCallback)(a=>{o?.(a,x,z?"directory":"file")},[x,z,o])}),H={...function(a){let b=Math.min(a,20);return{"--tree-indent":`${.5+ +b}rem`}}(f),touchAction:"manipulation",WebkitTouchCallout:"none"};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{"data-testid":`tree-item-${b.name}`,role:"treeitem","aria-selected":!1,"aria-expanded":z?y:void 0,tabIndex:0,className:"@container flex items-center gap-2 py-1.5 pr-2 cursor-pointer hover:bg-muted rounded transition-colors pl-[min(var(--tree-indent),max(0.5rem,calc(100%_-_7rem)))]",style:H,onClick:D,onKeyDown:E,onContextMenu:F,onTouchStart:G.onTouchStart,onTouchMove:G.onTouchMove,onTouchEnd:G.onTouchEnd,onTouchCancel:G.onTouchCancel,children:[z?(0,d.jsx)("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:v?(0,d.jsx)(j.y,{size:"xs",variant:"accent"}):(0,d.jsx)(dH,{expanded:y})}):(0,d.jsx)("span",{className:"w-4 h-4 flex-shrink-0"}),z?(0,d.jsx)(dI,{open:y}):(0,d.jsx)(dK,{extension:b.extension}),(0,d.jsx)(dE.nR,{content:b.name,metadata:C,className:"flex-1 truncate text-sm text-foreground @min-[176px]:min-w-16",children:"name"===q&&p?(0,d.jsx)(dJ,{text:b.name,query:p}):b.name}),t.showSize&&(0,d.jsx)("span",{"data-testid":"tree-item-size",className:"hidden @min-[176px]:block truncate text-xs text-muted-foreground",children:z?void 0!==b.itemCount&&u("fileTree.itemCount",{count:b.itemCount}):dG(b.size)}),!z&&t.showCreated&&b.birthtime&&(0,d.jsx)("span",{"data-testid":"tree-item-created",className:"hidden @min-[296px]:block truncate text-xs text-muted-foreground",children:(0,ap.fw)(b.birthtime,B)}),!z&&t.showModified&&b.mtime&&(0,d.jsx)("span",{"data-testid":"tree-item-modified",className:`hidden ${t.showCreated?"@min-[416px]:block":"@min-[296px]:block"} truncate text-xs text-muted-foreground`,children:(0,ap.fw)(b.mtime,B)})]}),z&&y&&A&&(0,d.jsx)("div",{role:"group",children:A.filter(a=>{let b=x?`${x}/${a.name}`:a.name;if(!p?.trim())return!0;if("name"===q){let b=p.toLowerCase();return!!a.name.toLowerCase().includes(b)||"directory"===a.type}if("content"===q&&r&&r.size>0){if(r.has(b))return!0;if("directory"===a.type){for(let a of r)if(a.startsWith(b+"/"))return!0}return!1}return!0}).map(b=>(0,d.jsx)(a,{item:b,path:x,depth:f+1,worktreeId:g,expanded:i,cache:k,onToggle:l,onFileSelect:m,onLoadChildren:n,onContextMenu:o,searchQuery:p,searchMode:q,matchedPaths:r,dateFnsLocaleStr:s,metadataDisplay:t},b.name))})]})}),dM=(0,x.A)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),dN=[{key:"showSize",labelKey:"fileTree.metadata.showSize"},{key:"showCreated",labelKey:"fileTree.metadata.showCreated"},{key:"showModified",labelKey:"fileTree.metadata.showModified"}];function dO(a,b,c){if(b<=0||c<=0)return 0;let d=a+b+8-c;return d>0?-Math.min(d,Math.max(0,a-8)):a<8?8-a:0}let dP=(0,e.memo)(function({settings:a,onToggle:b}){let c=(0,h.c)("worktree"),[f,g]=(0,e.useState)(!1),i=(0,e.useRef)(null),j=(0,e.useRef)(null),l=(0,e.useRef)(null),m=(0,e.useRef)({x:0,y:0}),[n,o]=(0,e.useState)({x:0,y:0});(0,e.useEffect)(()=>{if(!f)return;let a=i.current;a&&!a.contains(document.activeElement)&&l.current?.focus();let b=a=>{a.target instanceof Node&&i.current&&!i.current.contains(a.target)&&g(!1)},c=a=>{i.current&&!i.current.contains(a.target)&&g(!1)},d=a=>{var b,c;(0,bw.V$)(a)&&(b=a.target,c=i.current,("undefined"!=typeof document&&(b===document||b===document.body||b===document.documentElement)||b instanceof Node&&null!==c&&c.contains(b))&&(a.preventDefault(),l.current?.focus(),g(!1)))};return document.addEventListener("mousedown",c),document.addEventListener("focusin",b),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("focusin",b),document.removeEventListener("keydown",d)}},[f]),(0,e.useLayoutEffect)(()=>{let a=a=>{m.current=a,o(b=>b.x===a.x&&b.y===a.y?b:a)};if(!f)return void a({x:0,y:0});let b=j.current;if(!b)return;let c=b.getBoundingClientRect();a({x:dO(c.left-m.current.x,c.width,window.innerWidth),y:dO(c.top-m.current.y,c.height,window.innerHeight)})},[f]);let p=(0,e.useCallback)(a=>{b(a)},[b]);return(0,d.jsxs)("div",{className:"relative",ref:i,"data-testid":"file-metadata-toggle",children:[(0,d.jsx)("button",{ref:l,type:"button","data-testid":"file-metadata-toggle-button",onClick:()=>g(a=>!a),"aria-haspopup":"menu","aria-expanded":f,"aria-label":c("fileTree.metadata.settingsLabel"),title:c("fileTree.metadata.settingsLabel"),className:"flex items-center gap-1 px-2 py-1 text-xs text-muted-foreground hover:bg-muted rounded transition-colors",children:(0,d.jsx)(dM,{className:"w-4 h-4","aria-hidden":"true"})}),f&&(0,d.jsxs)("div",{ref:j,role:"menu","data-testid":"file-metadata-toggle-menu","data-floating-layer":"open",className:"absolute right-0 top-full z-20 mt-1 min-w-[12rem] rounded border border-border bg-surface shadow-lg p-1",style:0!==n.x||0!==n.y?{transform:`translate(${n.x}px, ${n.y}px)`}:void 0,children:[(0,d.jsx)("div",{className:"px-2 py-1 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:c("fileTree.metadata.settingsTitle")}),dN.map(b=>(0,d.jsxs)("label",{className:"flex items-center gap-2 px-2 py-1.5 text-xs text-foreground hover:bg-muted rounded cursor-pointer",children:[(0,d.jsx)(k.Sc,{"data-testid":`file-metadata-toggle-${b.key}`,checked:a[b.key],onCheckedChange:()=>p(b.key),className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{children:c(b.labelKey)})]},b.key))]})]})});function dQ({intervalMs:a,enabled:b,onPoll:c}){(0,e.useRef)(c).current=c,(0,e.useRef)(b).current=b,(0,e.useRef)(null)}var dR=c(25345),dS=c(9212),dT=c(18310);let dU=(0,e.memo)(function({worktreeId:a,onFileSelect:b,onNewFile:c,onNewDirectory:f,onRename:g,onDelete:i,onUpload:j,onMove:l,className:m="",refreshTrigger:n=0,pollingEnabled:o=!1,searchQuery:q,searchMode:r,searchResults:s,onSearchResultSelect:t,onResetView:u}){let v=(0,bG.Ym)(),w=(0,h.c)("worktree"),{settings:x,toggle:y}=function(){let[a,b]=(0,e.useState)(dF),c=(0,e.useRef)(a);c.current=a;let d=(0,e.useCallback)(a=>{c.current=a,b(a)},[]);return{settings:a,toggle:(0,e.useCallback)(a=>{d({...c.current,[a]:!c.current[a]})},[d]),setSettings:d}}(),[z,A]=(0,e.useState)(!0),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)([]),{expanded:F,setExpanded:G,resetExpanded:H}=function(a){let[b,c]=(0,e.useState)(()=>new Set);(0,e.useRef)(a);let d=(0,e.useCallback)(()=>{c(new Set)},[]);return{expanded:b,setExpanded:c,resetExpanded:d}}(a),[I,J]=(0,e.useState)(()=>new Map),K=(0,e.useRef)(null),L=(0,e.useRef)(F);L.current=F;let M=(0,e.useRef)(w);M.current=w;let N=(0,e.useRef)(new Set),{menuState:O,openMenu:P,closeMenu:Q}=du(),R=(0,e.useCallback)(async(b="")=>{try{let c=b?`/api/worktrees/${a}/tree/${b}`:`/api/worktrees/${a}/tree`,d=await fetch(c);if(!d.ok)throw Error(M.current("fileTree.loadDirectoryError",{status:d.status}));return await d.json()}catch(a){throw console.error("[FileTreeView] Error fetching directory:",a),a}},[a]),S=(0,e.useRef)(!0);(0,e.useEffect)(()=>(S.current=!0,()=>{S.current=!1}),[]);let T=(0,e.useCallback)(async()=>{if(S.current){A(!0),C(null);try{let a=await R();if(!S.current||!a)return;let b=Array.from(L.current),c=new Map,d=[];for(let a=0;a<b.length;a+=5){if(!S.current)return;let e=b.slice(a,a+5);for(let[a,b]of(await Promise.allSettled(e.map(async a=>{let b=await R(a);return{dirPath:a,data:b}}))).entries())"fulfilled"===b.status&&b.value.data?c.set(b.value.dirPath,b.value.data.items):d.push(e[a])}if(!S.current)return;E(a.items),J(c),d.length>0&&G(a=>{let b=new Set(a);for(let a of d)a&&b.delete(a);return b})}catch(a){S.current&&C(a instanceof Error?a.message:M.current("fileTree.loadError"))}finally{S.current&&A(!1)}}},[R,G]);(0,e.useEffect)(()=>{T()},[T,n]);let U=(0,e.useRef)(null),V=(0,e.useRef)(!1);(0,e.useEffect)(()=>{U.current=null},[a]),dQ({intervalMs:5e3,enabled:o,onPoll:(0,e.useCallback)(async()=>{if(S.current&&!V.current){V.current=!0;try{let a=["",...Array.from(L.current)],b=new Map;for(let c=0;c<a.length;c+=5){if(!S.current)return;let d=a.slice(c,c+5);for(let{dirPath:a,hash:c}of(await Promise.all(d.map(async a=>{try{let b=await R(a);return{dirPath:a,hash:JSON.stringify(b?.items??null)}}catch{return{dirPath:a,hash:"unavailable"}}}))))b.set(a,c)}if(!S.current)return;let c=U.current;if(U.current=b,null===c)return;let d=!1;for(let[a,e]of b){let b=c.get(a);if(void 0!==b&&b!==e){d=!0;break}}d&&T()}finally{V.current=!1}}},[R,T])});let W=(0,e.useCallback)(async a=>{if(!(I.has(a)||N.current.has(a))){N.current.add(a);try{let b=await R(a);b&&J(c=>{let d=new Map(c);return d.set(a,b.items),d})}catch(a){console.error("[FileTreeView] Error loading children:",a)}finally{N.current.delete(a)}}},[I,R]),X=(0,e.useCallback)(a=>{G(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[G]),Y=(0,e.useCallback)(()=>{H(),J(new Map),K.current?.scrollTo({top:0}),u?.()},[H,u]),Z=(0,e.useMemo)(()=>"content"===r&&s&&0!==s.length?p(s.map(a=>a.filePath)):new Set,[r,s]);(0,e.useEffect)(()=>{Z.size>0&&G(a=>{let b=new Set(a);for(let a of Z)(I.has(a)||s?.some(b=>b.filePath.startsWith(a+"/")))&&b.add(a);return b})},[Z,I,s,G]);let $=(0,e.useMemo)(()=>{if(!q?.trim())return D;if("name"===r){let a=q.toLowerCase(),b=(c,d)=>c.filter(c=>{let e=d?`${d}/${c.name}`:c.name,f=c.name.toLowerCase().includes(a);if("directory"===c.type){let a=I.get(e);if(a&&b(a,e).length>0)return!0}return f});return b(D,"")}return"content"===r&&Z.size>0?D.filter(a=>{if(Z.has(a.name))return!0;if("directory"===a.type){for(let b of Z)if(b.startsWith(a.name+"/")||b===a.name)return!0}return!1}):D},[D,q,r,Z,I]);if(z&&0===D.length)return(0,d.jsx)("div",{"data-testid":"file-tree-loading",className:`p-2 ${m}`,role:"status","aria-label":w("fileTree.loading"),children:[0,8,16,8,0,8].map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-2 py-1.5 pr-2",style:{paddingLeft:`${8+a}px`},children:[(0,d.jsx)(k.EA,{className:"h-4 w-4 shrink-0 rounded"}),(0,d.jsx)(k.EA,{className:`h-4 ${b%3==0?"w-32":b%3==1?"w-24":"w-40"} max-w-full`})]},b))});if(B&&0===D.length)return(0,d.jsx)("div",{"data-testid":"file-tree-error",className:`p-4 bg-danger-subtle border border-danger-border rounded-lg ${m}`,children:(0,d.jsx)("p",{className:"text-sm text-danger",children:B})});let _=z&&D.length>0,aa=!!B&&D.length>0;return 0===D.length?(0,d.jsxs)("div",{"data-testid":"file-tree-empty",className:`p-4 text-center text-muted-foreground ${m}`,children:[(0,d.jsx)("p",{className:"text-sm",children:w("fileTree.empty")}),(c||f)&&(0,d.jsxs)("div",{className:"flex flex-col gap-2 mt-4",children:[c&&(0,d.jsxs)(k.$n,{variant:"ghost","data-testid":"empty-new-file-button",onClick:()=>c(""),className:"flex items-center justify-center gap-2 px-3 py-2 text-sm text-foreground bg-surface border border-input rounded-md hover:bg-muted transition-colors",children:[(0,d.jsx)(dv,{className:"w-4 h-4","aria-hidden":"true"}),(0,d.jsx)("span",{children:w("fileTree.newFile")})]}),f&&(0,d.jsxs)(k.$n,{variant:"ghost","data-testid":"empty-new-directory-button",onClick:()=>f(""),className:"flex items-center justify-center gap-2 px-3 py-2 text-sm text-foreground bg-surface border border-input rounded-md hover:bg-muted transition-colors",children:[(0,d.jsx)(dw,{className:"w-4 h-4","aria-hidden":"true"}),(0,d.jsx)("span",{children:w("fileTree.newDirectory")})]})]})]}):q?.trim()&&0===$.length?(0,d.jsx)("div",{"data-testid":"file-tree-no-results",className:`p-4 text-center text-muted-foreground ${m}`,children:(0,d.jsx)("p",{className:"text-sm",children:w("content"===r?"fileTree.noResultsContaining":"fileTree.noResultsMatching",{query:q})})}):(0,d.jsxs)("div",{ref:K,"data-testid":"file-tree-view",role:"tree","aria-label":w("fileTree.label"),className:`@container overflow-auto bg-surface ${m}`,children:[(0,d.jsxs)("div",{"data-testid":"file-tree-toolbar",className:"flex flex-wrap items-center gap-1 p-1 border-b border-border",children:[c&&(0,d.jsx)(aw.m_,{content:w("fileTree.newFile"),placement:"bottom",className:"flex-shrink-0",children:(0,d.jsxs)("button",{"data-testid":"toolbar-new-file-button",onClick:()=>c(""),"aria-label":w("fileTree.newFile"),className:"flex flex-shrink-0 items-center gap-1 whitespace-nowrap px-2 py-1 text-xs text-muted-foreground hover:bg-muted rounded transition-colors",children:[(0,d.jsx)(dv,{className:"w-4 h-4 flex-shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{className:"hidden @min-[360px]:inline",children:w("fileTree.newFile")})]})}),f&&(0,d.jsx)(aw.m_,{content:w("fileTree.newDirectory"),placement:"bottom",className:"flex-shrink-0",children:(0,d.jsxs)("button",{"data-testid":"toolbar-new-directory-button",onClick:()=>f(""),"aria-label":w("fileTree.newDirectory"),className:"flex flex-shrink-0 items-center gap-1 whitespace-nowrap px-2 py-1 text-xs text-muted-foreground hover:bg-muted rounded transition-colors",children:[(0,d.jsx)(dw,{className:"w-4 h-4 flex-shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{className:"hidden @min-[360px]:inline",children:w("fileTree.newDirectory")})]})}),(0,d.jsxs)("div",{className:"ml-auto flex flex-wrap items-center justify-end gap-1",children:[(0,d.jsx)(dP,{settings:x,onToggle:y}),_&&(0,d.jsxs)("div",{"data-testid":"file-tree-refetch-indicator",role:"status","aria-live":"polite",className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"w-3 h-3 border-2 border-input border-t-accent-500 rounded-full animate-spin"}),(0,d.jsx)("span",{className:"sr-only",children:w("fileTree.refreshing")})]}),(0,d.jsx)("button",{"data-testid":"file-tree-refresh-button",type:"button",onClick:()=>{T()},disabled:_,"aria-label":w("fileTree.refreshLabel"),title:w("actions.refresh"),className:"flex items-center gap-1 px-2 py-1 text-xs text-muted-foreground hover:bg-muted rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:(0,d.jsx)(dR.A,{className:`w-4 h-4 ${_?"animate-spin":""}`,"aria-hidden":"true"})}),(0,d.jsx)("button",{"data-testid":"file-tree-reset-button",type:"button",onClick:Y,"aria-label":w("fileTree.resetViewLabel"),title:w("actions.resetView"),className:"flex items-center gap-1 px-2 py-1 text-xs text-muted-foreground hover:bg-muted rounded transition-colors",children:(0,d.jsx)(dS.A,{className:"w-4 h-4","aria-hidden":"true"})})]})]}),aa&&(0,d.jsxs)("div",{"data-testid":"file-tree-refetch-error",role:"alert",className:"flex items-center gap-2 px-2 py-1 text-xs bg-danger-subtle border-b border-danger-border text-danger-foreground",children:[(0,d.jsx)(dT.A,{className:"w-4 h-4 flex-shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{className:"flex-1 truncate",children:B}),(0,d.jsx)(k.$n,{variant:"ghost","data-testid":"file-tree-refetch-retry-button",onClick:()=>{T()},className:"px-2 py-0.5 text-xs rounded border border-danger-border hover:bg-danger-subtle transition-colors",children:w("actions.retry")})]}),$.map(c=>(0,d.jsx)(dL,{item:c,path:"",depth:0,worktreeId:a,expanded:F,cache:I,onToggle:X,onFileSelect:t||b,onLoadChildren:W,onContextMenu:P,searchQuery:q,searchMode:r,matchedPaths:Z,dateFnsLocaleStr:v,metadataDisplay:x},c.name)),(0,d.jsx)(dC,{isOpen:O.isOpen,position:O.position,targetPath:O.targetPath,targetType:O.targetType,onClose:Q,onNewFile:c,onNewDirectory:f,onRename:g,onDelete:i,onUpload:j,onMove:l})]})});var dV=c(90076);let dW=(0,e.memo)(function(){return(0,d.jsx)("svg",{className:"w-4 h-4 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),dX=(0,e.memo)(function(){return(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),dY=(0,e.memo)(function(){let a=(0,h.c)("worktree");return(0,d.jsx)(j.y,{size:"sm",variant:"accent","data-testid":"search-loading",role:"status","aria-hidden":!1,"aria-label":a("search.searching")})}),dZ=(0,e.memo)(function({query:a,mode:b,isSearching:c,error:f,onQueryChange:g,onModeChange:i,onClear:j,placeholder:k,className:l=""}){let m=(0,e.useRef)(null),n=(0,h.c)("worktree"),o=(0,e.useCallback)(a=>{g(a.target.value)},[g]),p=(0,e.useCallback)(()=>{j(),m.current?.focus()},[j]),q=(0,e.useCallback)(b=>{"Escape"===b.key&&(b.preventDefault(),a?p():m.current?.blur())},[a,p]);return(0,e.useEffect)(()=>{if(!(window.innerWidth<dV.D)){let a=setTimeout(()=>{m.current?.focus()},100);return()=>clearTimeout(a)}},[]),(0,d.jsxs)("div",{"data-testid":"search-bar",className:`flex flex-col gap-2 p-2 bg-surface dark:bg-surface-2 border-b border-border ${l}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"flex-shrink-0",children:(0,d.jsx)(dW,{})}),(0,d.jsx)("input",{ref:m,type:"text","data-testid":"search-input",value:a,onChange:o,onKeyDown:q,placeholder:k??n("search.placeholder"),className:"flex-1 min-w-0 px-2 py-1 text-sm bg-muted text-foreground border border-input rounded focus:outline-none focus:ring-1 focus:ring-ring focus:border-accent-500","aria-label":n("search.label"),"aria-busy":c}),(c||!!a)&&(0,d.jsx)("div",{className:"flex-shrink-0 w-6 h-6 flex items-center justify-center",children:c?(0,d.jsx)(dY,{}):a?(0,d.jsx)("button",{type:"button","data-testid":"search-clear",onClick:p,className:"p-1 text-muted-foreground hover:text-foreground rounded transition-colors","aria-label":n("search.clear"),children:(0,d.jsx)(dX,{})}):null})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground mr-1 whitespace-nowrap",children:n("search.mode")}),(0,d.jsx)("button",{type:"button","data-testid":"mode-name",onClick:()=>i("name"),className:`px-2 py-0.5 text-xs rounded transition-colors whitespace-nowrap flex-shrink-0 ${"name"===b?"bg-accent-100 dark:bg-accent-900 text-accent-700 dark:text-accent-300 font-medium":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-pressed":"name"===b,children:n("search.modeName")}),(0,d.jsx)("button",{type:"button","data-testid":"mode-content",onClick:()=>i("content"),className:`px-2 py-0.5 text-xs rounded transition-colors whitespace-nowrap flex-shrink-0 ${"content"===b?"bg-accent-100 dark:bg-accent-900 text-accent-700 dark:text-accent-300 font-medium":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-pressed":"content"===b,children:n("search.modeContent")})]}),f&&(0,d.jsx)("div",{"data-testid":"search-error",className:"text-xs text-danger bg-danger-subtle px-2 py-1 rounded",role:"alert",children:f})]})});var d$=c(82042),d_=c(25770);function d0({value:a,saveFn:b,debounceMs:c=300,disabled:d=!1,maxRetries:f=3,onSaveComplete:g}){let[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(null),l=(0,e.useRef)(a),m=(0,e.useRef)(b),n=(0,e.useRef)(g),o=(0,e.useRef)(null),p=(0,e.useRef)(!0);(0,e.useRef)(a);let q=(0,e.useCallback)(async a=>{if(!p.current)return;i(!0),k(null);let b=null,c=0;for(;c<=f;)try{await m.current(a),p.current&&(i(!1),k(null),n.current?.());return}catch(a){if(b=a instanceof Error?a:Error(String(a)),++c<=f){let a=1e3*Math.pow(2,c-1);await new Promise(b=>setTimeout(b,a))}}p.current&&(i(!1),k(b))},[f]),r=(0,e.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]);return{isSaving:h,error:j,saveNow:(0,e.useCallback)(async()=>{d||(r(),await q(l.current))},[d,r,q])}}let d1=(0,e.memo)(function({memo:a,onUpdate:b,onDelete:c,isSaving:f,error:g,className:i="",onInsertToMessage:j,onMoveUp:k,onMoveDown:l,canMoveUp:m=!0,canMoveDown:n=!0}){let o=(0,h.c)("schedule"),p=(0,h.c)("worktree"),q=!!(k||l),[r,s]=(0,e.useState)(a.title),[t,u]=(0,e.useState)(a.content),[v,w]=(0,e.useState)(!1),x=(0,e.useRef)(void 0);(0,e.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let{isSaving:y,error:z,saveNow:A}=d0({value:r,saveFn:async c=>{await b(a.id,{title:c})}}),{isSaving:B,error:C,saveNow:D}=d0({value:t,saveFn:async c=>{await b(a.id,{content:c})}}),E=g??z?.message??C?.message??null,F=(0,e.useCallback)(a=>{s(a.target.value)},[]),G=(0,e.useCallback)(a=>{u(a.target.value)},[]),H=(0,e.useCallback)(()=>{A()},[A]),I=(0,e.useCallback)(()=>{D()},[D]),J=(0,e.useCallback)(()=>{c(a.id)},[a.id,c]),K=(0,e.useCallback)(()=>{t.trim()&&j?.(t)},[t,j]),L=(0,e.useCallback)(async()=>{if(t.trim())try{await (0,bk.l)(t),w(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>w(!1),2e3)}catch{}},[t]);return(0,d.jsxs)("div",{"data-testid":"memo-card","data-memo-id":a.id,tabIndex:-1,className:`bg-surface dark:bg-surface-2 border border-border rounded-lg p-4 space-y-3 focus:outline-none ${i}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:r,onChange:F,onBlur:H,placeholder:o("memoTitlePlaceholder"),className:"flex-1 min-w-0 text-sm font-medium text-foreground bg-transparent border-none focus:outline-none focus:ring-0 p-0"}),(f??(y||B))&&(0,d.jsx)("span",{"data-testid":"saving-indicator",className:"text-xs text-muted-foreground",children:p("actions.saving")}),q&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{type:"button","data-testid":`memo-move-up-${a.id}`,onClick:k,disabled:!m,"aria-label":o("memoMoveUp"),title:o("memoMoveUp"),className:"flex-shrink-0 p-1 text-muted-foreground hover:text-foreground transition-colors rounded disabled:opacity-30 disabled:cursor-not-allowed",children:(0,d.jsx)(d$.A,{className:"w-4 h-4","aria-hidden":"true"})}),(0,d.jsx)("button",{type:"button","data-testid":`memo-move-down-${a.id}`,onClick:l,disabled:!n,"aria-label":o("memoMoveDown"),title:o("memoMoveDown"),className:"flex-shrink-0 p-1 text-muted-foreground hover:text-foreground transition-colors rounded disabled:opacity-30 disabled:cursor-not-allowed",children:(0,d.jsx)(aj.A,{className:"w-4 h-4","aria-hidden":"true"})})]}),j&&(0,d.jsx)("button",{type:"button","data-testid":"insert-memo-content",onClick:K,"aria-label":o("memoInsertToMessage"),className:"flex-shrink-0 p-1 text-muted-foreground hover:text-accent-600 dark:hover:text-accent-400 transition-colors rounded",title:o("memoInsertToMessage"),children:(0,d.jsx)(d_.A,{className:"w-4 h-4","aria-hidden":"true"})}),(0,d.jsx)("button",{type:"button",onClick:L,"aria-label":o("memoCopyContent"),className:"flex-shrink-0 p-1 text-muted-foreground hover:text-foreground transition-colors rounded",children:v?(0,d.jsx)(a9.A,{className:"w-4 h-4 text-success"}):(0,d.jsx)(ba.A,{className:"w-4 h-4"})}),(0,d.jsx)("button",{type:"button",onClick:J,"aria-label":o("memoDelete"),className:"flex-shrink-0 p-1 text-muted-foreground hover:text-danger transition-colors rounded",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),(0,d.jsx)("textarea",{value:t,onChange:G,onBlur:I,placeholder:o("memoContentPlaceholder"),rows:4,className:"w-full text-sm text-foreground bg-muted border border-border rounded-md p-2 resize-y focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),E&&(0,d.jsx)("div",{className:"text-xs text-danger",children:E})]})}),d2=(0,e.memo)(function({currentCount:a,maxCount:b,onAdd:c,isLoading:e=!1,className:f=""}){let g=(0,h.c)("schedule"),i=Math.max(0,b-a),k=a>=b||e;return(0,d.jsxs)("div",{"data-testid":"memo-add-button",className:`flex flex-col items-center gap-2 ${f}`,children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{k||c()},disabled:k,"aria-label":g("memoAdd"),"aria-disabled":k,className:`
21
21
  flex items-center gap-2 px-4 py-2 rounded-lg border-2 border-dashed
22
22
  transition-colors focus:outline-none focus:ring-2 focus:ring-ring
23
23
  ${k?"border-border text-muted-foreground cursor-not-allowed opacity-50":"border-border text-muted-foreground hover:border-accent-400 dark:hover:border-accent-500 hover:text-accent-600 dark:hover:text-accent-400 hover:bg-accent-50 dark:hover:bg-accent-900/30"}
24
- `,children:[e?(0,d.jsx)(j.y,{"data-testid":"loading-indicator",size:"md",variant:"accent"}):(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),(0,d.jsx)("span",{className:"text-sm font-medium",children:g("memoAdd")})]}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:g("memoRemaining",{count:i})})]})});function d3({query:a,onQueryChange:b,matchCount:c,currentIndex:f,onNext:g,onPrev:i,onClose:j,onCompositionStart:l,onCompositionEnd:m}){let n=(0,h.c)("schedule"),o=(0,e.useRef)(null),p=(0,e.useCallback)(a=>{if("Escape"===a.key){a.preventDefault(),j();return}"Enter"!==a.key||a.nativeEvent.isComposing||(a.preventDefault(),g())},[j,g]),q=(0,e.useCallback)(a=>{b(a.target.value)},[b]),r=0===c?"0/0":`${f+1}/${c}`;return(0,d.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted border border-input rounded",role:"search","aria-label":n("memoSearchLabel"),children:[(0,d.jsx)("input",{ref:o,type:"text",value:a,onChange:q,onKeyDown:p,onCompositionStart:l,onCompositionEnd:m,placeholder:n("memoSearchPlaceholder"),className:"flex-1 min-w-0 bg-transparent text-foreground text-sm outline-none placeholder-muted-foreground","aria-label":n("memoSearchInputLabel"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}),(0,d.jsx)("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"text-muted-foreground text-xs min-w-[3rem] text-right",children:r}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:i,disabled:0===c,"aria-label":n("memoSearchPrev"),className:"text-muted-foreground hover:text-foreground dark:hover:text-white disabled:text-muted-foreground/50 min-w-[36px] min-h-[36px] flex items-center justify-center text-base",children:"▲"}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:g,disabled:0===c,"aria-label":n("memoSearchNext"),className:"text-muted-foreground hover:text-foreground dark:hover:text-white disabled:text-muted-foreground/50 min-w-[36px] min-h-[36px] flex items-center justify-center text-base",children:"▼"}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:j,"aria-label":n("memoSearchClose"),className:"text-muted-foreground hover:text-foreground dark:hover:text-white min-w-[36px] min-h-[36px] flex items-center justify-center text-base ml-1",children:"✕"})]})}let d4=(0,e.memo)(function({worktreeId:a,className:b="",onInsertToMessage:c}){let f=(0,h.c)("schedule"),g=(0,h.c)("common"),i=(0,a4.SC)(),[k,l]=(0,e.useState)([]),[m,n]=(0,e.useState)(!0),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),w=(0,e.useRef)(null),{query:x,matches:y,currentMatch:z,totalCount:A,setQuery:B,reset:C,navigateNext:D,navigatePrev:E,onCompositionStart:F,onCompositionEnd:G}=function({memos:a}){let[b,c]=(0,e.useState)(""),[d,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(-1),i=(0,e.useRef)(null),j=(0,e.useRef)(""),k=(0,e.useRef)(!1);(0,e.useRef)(0===a.length?"0":a.map(a=>`${a.id}:${a.title.length}:${a.content.length}`).join("|"));let l=(0,e.useRef)(a);l.current=a;let m=d.length,n=(0,e.useCallback)(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]),o=(0,e.useCallback)(a=>{let b=function(a,b){if(b.length<bs.E2||0===a.length)return[];let c=b.toLowerCase();return a.filter(a=>-1!==a.title.toLowerCase().indexOf(c)||-1!==a.content.toLowerCase().indexOf(c))}(l.current,a);f(b),h(b.length>0?0:-1)},[]),p=(0,e.useCallback)(a=>{n(),j.current=a,k.current||(i.current=setTimeout(()=>{o(a)},bs.e1))},[n,o]),q=(0,e.useCallback)(a=>{c(a),p(a)},[p]),r=(0,e.useCallback)(()=>{c(""),j.current="",f([]),h(-1),n()},[n]),s=(0,e.useCallback)(()=>{h(a=>0===m?-1:(a+1)%m)},[m]),t=(0,e.useCallback)(()=>{h(a=>0===m?-1:(a-1+m)%m)},[m]);return{query:b,matches:d,currentMatch:g,totalCount:m,setQuery:q,reset:r,navigateNext:s,navigatePrev:t,onCompositionStart:(0,e.useCallback)(()=>{k.current=!0,n()},[n]),onCompositionEnd:(0,e.useCallback)(()=>{k.current=!1;let a=j.current;a.length>=bs.E2&&(n(),i.current=setTimeout(()=>{o(a)},bs.e1))},[n,o])}}({memos:k}),H=u&&x.length>0,I=H?y:k,J=(0,e.useCallback)(async()=>{n(!0),r(null);try{let b=await bP.$T.getAll(a);l(b.sort((a,b)=>a.position-b.position))}catch(a){r((0,bP.hS)(a))}finally{n(!1)}},[a]);(0,e.useEffect)(()=>{J()},[J]);let K=(0,e.useCallback)(async()=>{p(!0),t(null);try{let b=await bP.$T.create(a,{title:f("memoDefaultTitle"),content:""});l(a=>[...a,b])}catch(a){t((0,bP.hS)(a))}finally{p(!1)}},[a,f]),L=(0,e.useCallback)(async(b,c)=>{await bP.$T.update(a,b,c),l(a=>a.map(a=>a.id===b?{...a,...c}:a))},[a]),M=(0,e.useCallback)(async b=>{let c=k.find(a=>a.id===b);if(await i({description:g("confirmDelete",{name:c?.title??""}),variant:"danger"}))try{await bP.$T.delete(a,b),l(a=>a.filter(a=>a.id!==b))}catch(a){console.error("Failed to delete memo:",a)}},[a,k,i,g]),N=(0,e.useCallback)(async(b,c)=>{let d=b+c;if(d<0||d>=k.length)return;let e=[...k];[e[b],e[d]]=[e[d],e[b]],l(e);try{await bP.$T.reorder(a,e.map(a=>a.id))}catch(a){r((0,bP.hS)(a)),await J()}},[k,a,J]),O=(0,e.useCallback)(()=>{J()},[J]),P=(0,e.useCallback)(()=>{v(a=>(a&&C(),!a))},[C]),Q=(0,e.useCallback)(()=>{v(!1),C()},[C]);return((0,e.useEffect)(()=>{if(!H||z<0)return;let a=y[z];if(!a)return;let b=w.current?.querySelector(`[data-memo-id="${a.id}"]`);b&&(b.scrollIntoView({block:"nearest"}),b.focus({preventScroll:!0}))},[H,z,y]),m)?(0,d.jsx)("div",{"data-testid":"memo-pane",className:`flex flex-col items-center justify-center h-full p-4 ${b}`,children:(0,d.jsxs)("div",{"data-testid":"memo-loading",className:"flex flex-col items-center gap-3",children:[(0,d.jsx)(j.y,{size:"xl",variant:"accent"}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:f("memoLoading")})]})}):q?(0,d.jsx)("div",{"data-testid":"memo-pane",className:`flex flex-col items-center justify-center h-full p-4 ${b}`,children:(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,d.jsx)("svg",{className:"w-12 h-12 text-danger",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsx)("span",{className:"text-sm text-danger-foreground",children:q}),(0,d.jsx)("button",{type:"button",onClick:O,"aria-label":g("retry"),className:"px-4 py-2 text-sm font-medium text-white bg-accent-500 rounded-lg hover:bg-accent-600 transition-colors",children:g("retry")})]})}):(0,d.jsxs)("div",{ref:w,"data-testid":"memo-pane",className:`flex flex-col gap-4 p-4 overflow-y-auto ${b}`,children:[(0,d.jsx)("div",{"data-testid":"memo-pane-header",className:"flex items-center gap-2",children:u?(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsx)(d3,{query:x,onQueryChange:B,matchCount:A,currentIndex:z,onNext:D,onPrev:E,onClose:Q,onCompositionStart:F,onCompositionEnd:G})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("button",{type:"button","data-testid":"memo-search-toggle",onClick:P,"aria-label":f("memoSearchToggle"),className:"p-1.5 text-muted-foreground hover:text-foreground transition-colors rounded",children:(0,d.jsx)(af.A,{className:"w-4 h-4","aria-hidden":"true"})})]})}),0===k.length&&!H&&!s&&(0,d.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,d.jsx)("p",{children:f("memoEmpty")}),(0,d.jsx)("p",{className:"text-sm",children:f("memoEmptyHint")})]}),H&&0===I.length&&(0,d.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:(0,d.jsx)("p",{children:f("memoNoMatch")})}),I.map((a,b)=>(0,d.jsx)(d1,{memo:a,onUpdate:L,onDelete:M,onInsertToMessage:c,onMoveUp:H?void 0:()=>N(b,-1),onMoveDown:H?void 0:()=>N(b,1),canMoveUp:!H&&b>0,canMoveDown:!H&&b<k.length-1},a.id)),s&&(0,d.jsx)("div",{className:"text-center py-2 text-sm text-danger",children:s}),!H&&(0,d.jsx)(d2,{currentCount:k.length,maxCount:20,onAdd:K,isLoading:o,className:"mt-2"})]})});async function d5(a,b){throw Error((await a.json().catch(()=>({}))).error||`${b} (${a.status})`)}let d6=["todo","doing","done"],d7={async list(a){let b=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos`);return b.ok?(await b.json()).todos??[]:d5(b,"Failed to load todos")},async create(a,b,c){let d=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(void 0!==c?{content:b,detail:c}:{content:b})});return d.ok?(await d.json()).todo:d5(d,"Failed to create todo")},async update(a,b,c){let d=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos/${encodeURIComponent(b)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});return d.ok?(await d.json()).todo:d5(d,"Failed to update todo")},async remove(a,b){let c=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos/${encodeURIComponent(b)}`,{method:"DELETE"});c.ok||await d5(c,"Failed to delete todo")},async reorder(a,b){let c=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({todoIds:b})});c.ok||await d5(c,"Failed to reorder todos")}};var d8=c(62484);let d9={todo:"border-input text-muted-foreground",doing:"border-warning-border bg-warning-subtle text-warning-foreground",done:"border-success-border bg-success-subtle text-success-foreground"},ea=f().memo(function({worktreeId:a,className:b=""}){let c=(0,h.c)("worktree"),f=(0,h.c)("common"),g=(0,a4.SC)(),[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(!0),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(!1),A=(0,e.useCallback)(a=>{switch(a){case"doing":return c("todo.statusDoing");case"done":return c("todo.statusDone");default:return c("todo.statusTodo")}},[c]),B=(0,e.useCallback)(async()=>{n(!0),r(null);try{let b=await d7.list(a);j(b)}catch(a){r(a instanceof Error?a.message:c("todo.loadError")),j([])}finally{n(!1)}},[a,c]);(0,e.useEffect)(()=>{B()},[a]);let C=(0,e.useCallback)(async()=>{let b=k.trim();if(b&&!o){p(!0),r(null);try{let c=await d7.create(a,b);j(a=>[...a,c]),l("")}catch(a){r(a instanceof Error?a.message:c("todo.addError"))}finally{p(!1)}}},[k,o,a,c]),D=(0,e.useCallback)(async b=>{let d=function(a){let b=d6.indexOf(a);return d6[(b+1)%d6.length]}(b.status);j(a=>a.map(a=>a.id===b.id?{...a,status:d,done:"done"===d}:a)),r(null);try{await d7.update(a,b.id,{status:d})}catch(a){r(a instanceof Error?a.message:c("todo.updateError")),B()}},[a,B,c]),E=(0,e.useCallback)(async b=>{if(await g({description:f("confirmDelete",{name:b.content}),variant:"danger"})){r(null);try{await d7.remove(a,b.id),j(a=>a.filter(a=>a.id!==b.id))}catch(a){r(a instanceof Error?a.message:c("todo.deleteError"))}}},[a,c,g,f]),F=(0,e.useCallback)(a=>{t(a),v(a.content),x(a.detail),r(null)},[]),G=(0,e.useCallback)(()=>{t(null),z(!1)},[]),H=(0,e.useCallback)(async()=>{if(!s)return;let b=u.trim();if(b&&!y){z(!0),r(null);try{let c=await d7.update(a,s.id,{content:b,detail:w});j(a=>a.map(a=>a.id===s.id?c:a)),G()}catch(a){r(a instanceof Error?a.message:c("todo.updateError")),z(!1)}}},[s,u,w,y,a,G,c]),I=(0,e.useCallback)(async(b,d)=>{let e=b+d;if(e<0||e>=i.length)return;let f=[...i];[f[b],f[e]]=[f[e],f[b]],j(f),r(null);try{await d7.reorder(a,f.map(a=>a.id))}catch(a){r(a instanceof Error?a.message:c("todo.reorderError")),B()}},[i,a,B,c]),J=(0,e.useCallback)(a=>{"Enter"!==a.key||a.nativeEvent.isComposing||(a.preventDefault(),C())},[C]),K=(0,e.useMemo)(()=>({todo:i.filter(a=>"todo"===a.status).length,doing:i.filter(a=>"doing"===a.status).length,done:i.filter(a=>"done"===a.status).length}),[i]);return(0,d.jsxs)("div",{"data-testid":"todo-pane",className:`flex flex-col h-full overflow-y-auto p-4 ${b}`.trim(),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("input",{type:"text",value:k,onChange:a=>l(a.target.value),onKeyDown:J,maxLength:2e3,placeholder:c("todo.addPlaceholder"),"data-testid":"todo-input",className:"flex-1 min-w-0 rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-1.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),(0,d.jsx)("button",{type:"button",onClick:C,disabled:o||0===k.trim().length,"data-testid":"todo-add-button",className:"shrink-0 rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-accent-700 disabled:opacity-50",children:c("todo.add")})]}),(0,d.jsxs)("div",{className:"mb-2 flex justify-end gap-2 text-xs text-muted-foreground",children:[(0,d.jsxs)("span",{"data-testid":"todo-count-todo",children:[A("todo")," ",K.todo]}),(0,d.jsxs)("span",{"data-testid":"todo-count-doing",children:[A("doing")," ",K.doing]}),(0,d.jsxs)("span",{"data-testid":"todo-count-done",children:[A("done")," ",K.done]})]}),q&&(0,d.jsx)("p",{className:"mb-2 text-xs text-danger-foreground","data-testid":"todo-error",children:q}),m?(0,d.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"todo-loading",children:c("todo.loading")}):0===i.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"todo-empty",children:c("todo.empty")}):(0,d.jsx)("ul",{className:"space-y-1","data-testid":"todo-list",children:i.map((a,b)=>(0,d.jsxs)("li",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-muted group","data-testid":"todo-item",children:[(0,d.jsx)("button",{type:"button",onClick:()=>D(a),"data-testid":"todo-status","data-status":a.status,"aria-label":c("todo.cycleStatus",{status:A(a.status)}),title:c("todo.cycleStatus",{status:A(a.status)}),className:`shrink-0 inline-flex min-h-[44px] items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium sm:min-h-0 ${d9[a.status]}`,children:A(a.status)}),(0,d.jsxs)("button",{type:"button",onClick:()=>F(a),"data-testid":"todo-content","aria-label":c("todo.edit"),title:c("todo.edit"),className:"group/content flex min-h-[44px] min-w-0 flex-1 items-center gap-1.5 text-left sm:min-h-0",children:[(0,d.jsx)("span",{className:`min-w-0 break-words text-sm ${"done"===a.status?"line-through text-muted-foreground":"text-foreground group-hover/content:text-accent-700 dark:group-hover/content:text-accent-300"}`,children:a.content}),""!==a.detail.trim()&&(0,d.jsxs)("svg",{"data-testid":"todo-detail-indicator","aria-label":c("todo.hasDetail"),className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,d.jsx)("title",{children:c("todo.hasDetail")}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h10"})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>I(b,-1),disabled:0===b,"aria-label":c("todo.moveUp"),"data-testid":"todo-move-up",className:"p-1 text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})})}),(0,d.jsx)("button",{type:"button",onClick:()=>I(b,1),disabled:b===i.length-1,"aria-label":c("todo.moveDown"),"data-testid":"todo-move-down",className:"p-1 text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})}),(0,d.jsx)("button",{type:"button",onClick:()=>E(a),"aria-label":c("todo.delete"),"data-testid":"todo-delete",className:"inline-flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center text-muted-foreground opacity-100 transition-opacity hover:text-danger-foreground sm:min-h-0 sm:min-w-0 sm:opacity-0 sm:group-hover:opacity-100",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},a.id))}),(0,d.jsx)(b_.a,{isOpen:null!==s,onClose:G,title:c("todo.editTitle"),size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:c("todo.contentLabel")}),(0,d.jsx)("input",{type:"text",value:u,onChange:a=>v(a.target.value),maxLength:2e3,placeholder:c("todo.contentPlaceholder"),"data-testid":"todo-edit-content",className:"w-full rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),(0,d.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:c("todo.detailLabel")}),""!==w.trim()&&(0,d.jsx)(d8.i,{text:w,label:c("todo.copyDetail"),className:"!border-input !bg-surface dark:!bg-surface-2 !text-muted-foreground hover:!bg-muted"})]}),(0,d.jsx)("textarea",{value:w,onChange:a=>x(a.target.value),maxLength:4e3,rows:6,placeholder:c("todo.detailPlaceholder"),"data-testid":"todo-edit-detail",className:"w-full resize-y rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:G,"data-testid":"todo-edit-cancel",className:"rounded-md border border-input px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted",children:c("todo.cancel")}),(0,d.jsx)("button",{type:"button",onClick:H,disabled:y||0===u.trim().length,"data-testid":"todo-edit-save",className:"rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-accent-700 disabled:opacity-50",children:c("todo.save")})]})]})})]})}),eb=(0,x.A)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);function ec({isOpen:a,onClose:b,title:c,children:f,footer:g,showCloseButton:i=!0}){let j=(0,h.c)("common"),[k,l]=(0,e.useState)(null);return a?(0,ak.createPortal)((0,d.jsxs)("div",{"data-testid":"full-screen-modal",role:"dialog","aria-modal":"true",className:"fixed inset-0 flex flex-col bg-surface animate-slide-up",style:{zIndex:bo.M.MODAL,height:k?`${k}px`:"100dvh"},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[(0,d.jsx)("h3",{className:"text-base font-semibold text-foreground truncate pr-2",children:c}),i&&(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":j("close"),"data-testid":"full-screen-modal-close",className:"flex-shrink-0 -mr-1 p-1 text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(av.A,{className:"w-6 h-6"})})]}),(0,d.jsx)("div",{"data-testid":"full-screen-modal-body",className:"flex-1 min-h-0 overflow-y-auto overscroll-contain px-4 py-4",onFocusCapture:a=>{let b=a.target;b&&"function"==typeof b.scrollIntoView&&window.requestAnimationFrame(()=>{b.scrollIntoView({block:"center",behavior:"smooth"})})},children:f}),g&&(0,d.jsx)("div",{"data-testid":"full-screen-modal-footer",className:"flex-shrink-0 border-t border-border bg-surface px-4 py-3",style:{paddingBottom:"max(0.75rem, env(safe-area-inset-bottom))"},children:g})]}),document.body):null}let ed=["default","acceptEdits","plan","dontAsk","bypassPermissions"],ee=["read-only","workspace-write","danger-full-access"],ef=["allow-all-tools","yolo"],eg=["--dangerously-skip-permissions"],eh=["default","standard","plan","auto-accept","dont-ask"],ei="yolo",ej=[ei,...eh],ek=[],el=[],em=[],en="default",eo=[en,"auto"],ep=[],eq={claude:"acceptEdits",codex:"workspace-write",gemini:"","vibe-local":"",opencode:"",copilot:"allow-all-tools",antigravity:"--dangerously-skip-permissions","command-code":ei,"opencode-v2":en},er=[];function es(a){return!er.includes(a)}function et(a){switch(a){case"claude":return ed;case"codex":return ee;case"copilot":return ef;case"antigravity":return eg;case"command-code":return ej;case"gemini":return ek;case"vibe-local":return el;case"opencode":return em;case"opencode-v2":return eo;default:return ep}}let eu=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F\x80-\x9F\u200B-\u200F\u2028-\u202F\uFEFF]/;function ev(a){return a.replace(RegExp(eu.source,"g"),"")}let ew=/^[\w\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\uF900-\uFAFF\s-]{1,100}$/;function ex(a){if(a.length>100)return!1;let b=a.trim().split(/\s+/);return b.length>=5&&b.length<=6}var ey=c(90277);let ez=["edit_file","write_file","shell_command","monitor_command","kill_shell"];function eA(a){let b=new Map,c=a.split("\n"),d=null,e=!1,f=!1;for(let a of c){let c=a.trim(),g=c.match(/^##\s+(.+)$/);if(g){d=g[1].trim(),e=!1,f=!1,b.has(d)||b.set(d,[]);continue}if(!c||!c.startsWith("|")||!d)continue;if(!e){e=!0;continue}if(!f){if(c.match(/^\|[\s-:|]+\|$/)){f=!0;continue}f=!0}let h=c.split("|").slice(1,-1).map(a=>a.trim());h.length>0&&b.get(d).push(h)}return b}function eB(a,b){return"command-code"===a&&eh.includes(b.trim())}var eC=c(68232);let eD={en:{bannerTitle:"CMATE.md has schedules to check",body:"With a --permission-mode value as Permission (default / standard / plan / auto-accept / dont-ask), command-code print mode (`commandcode -p`) rejects the write tools the agent calls directly (edit_file / write_file / shell_command / monitor_command / kill_shell). This is a warning and does not stop the schedule from being saved or run. Set Permission to `yolo` if the task needs to write."},ja:{bannerTitle:"CMATE.md に確認が必要なスケジュールがあります",body:"Permission が --permission-mode の値(default / standard / plan / auto-accept / dont-ask)のとき、command-code の print モード(`commandcode -p`)は、エージェントが直接呼ぶ書き込み系ツール(edit_file / write_file / shell_command / monitor_command / kill_shell)を拒否します。これは警告で、スケジュールの登録も実行も止めません。書き込みが必要な作業なら Permission を `yolo` にしてください。"}};function eE(a){return eD[(0,eC.d9)(a)?a:eC.Xn]}let eF=[{value:"0 */1 * * *",labelKey:"cronPresetHourly"},{value:"0 9 * * *",labelKey:"cronPresetDaily9"},{value:"0 9 * * 1",labelKey:"cronPresetWeeklyMon9"}],eG={name:"",cronExpression:"0 9 * * *",message:"",cliToolId:"claude",enabled:!0,permission:eq.claude??"",model:"",agent:"",variant:"",continueSession:!1,title:""},eH="w-full px-3 py-2 text-sm border border-input rounded-md bg-surface dark:bg-surface-2 text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",eI="block text-xs font-semibold text-foreground mb-1",eJ="mt-1 text-xs text-danger-foreground";function eK({onClick:a,label:b,title:c,testId:e}){return(0,d.jsxs)("button",{type:"button","data-testid":e,onClick:a,title:c,className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded border border-info-border text-info-foreground hover:bg-info-subtle transition-colors",children:[(0,d.jsx)(ck.A,{size:14,"aria-hidden":"true"}),b]})}function eL({id:a,title:b,summary:c,icon:e,isOpen:f,onToggle:g,children:h}){let i=`schedule-section-${a}-content`;return(0,d.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,d.jsxs)("button",{type:"button","data-testid":`schedule-section-${a}`,"aria-expanded":f,"aria-controls":i,onClick:()=>g(a),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left bg-surface-2 hover:bg-muted transition-colors",children:[(0,d.jsx)("span",{className:"flex-shrink-0 text-accent-600 dark:text-accent-400",children:e}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"block text-sm font-semibold text-foreground",children:b}),c&&(0,d.jsx)("span",{"data-testid":`schedule-section-${a}-summary`,className:"block truncate text-xs text-muted-foreground",children:c})]}),(0,d.jsx)(aj.A,{className:`flex-shrink-0 w-4 h-4 text-muted-foreground transition-transform ${f?"rotate-180":""}`})]}),f&&(0,d.jsx)("div",{id:i,className:"px-3 py-3 flex flex-col gap-4",children:h})]})}function eM({isOpen:a,worktreeId:b,initialValues:c,originalName:f,onInsertToMessage:g,instances:i,onClose:j,onSaved:l}){let m=(0,h.c)("schedule"),n=(0,bG.Ym)(),o=(0,dV.a)(),p=(0,e.useMemo)(()=>(i&&i.length>0?i:(0,al.lu)([...al.XH])).filter(a=>es(a.cliTool)),[i]),[q,r]=(0,e.useState)(eG),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(()=>new Set(["basic","advanced","message"])),A=(0,e.useCallback)(a=>{z(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),C=et(q.cliToolId),D=C.length>0,E=eB(q.cliToolId,q.permission),F=ey.Vt.has(q.cliToolId),G=ey.aN.has(q.cliToolId),H=!!f,I=(0,e.useMemo)(()=>{let a=q.name.trim();return a?a.length>100?m("edit.errorNameTooLong",{max:100}):ew.test(a)?null:m("edit.errorNameInvalid"):m("edit.errorNameRequired")},[q.name,m]),J=(0,e.useMemo)(()=>ex(q.cronExpression.trim())?null:m("edit.errorCronInvalid"),[q.cronExpression,m]),K=(0,e.useMemo)(()=>q.message.trim()?q.message.length>1e4?m("edit.errorMessageTooLong",{max:1e4}):null:m("edit.errorMessageRequired"),[q.message,m]),L=(0,e.useMemo)(()=>F&&q.model.trim()?(0,ey.JY)(q.model.trim()).valid?null:m("edit.errorModelInvalid"):null,[F,q.model,m]),M=(0,e.useMemo)(()=>G&&q.agent.trim()?(0,ey.sd)(q.agent.trim(),"agent").valid?null:m("edit.errorAgentInvalid"):null,[G,q.agent,m]),N=(0,e.useMemo)(()=>G&&q.variant.trim()?(0,ey.sd)(q.variant.trim(),"variant").valid?(0,ey.z7)(q.cliToolId,q.model,q.variant)?m("edit.errorVariantNeedsModel"):null:m("edit.errorVariantInvalid"):null,[G,q.cliToolId,q.model,q.variant,m]),O=(0,e.useMemo)(()=>G&&q.title.trim()?(0,ey.kj)(q.title.trim()).valid?null:m("edit.errorTitleInvalid"):null,[G,q.title,m]),P=!I&&!J&&!K&&!L&&!M&&!N&&!O,Q=(0,e.useCallback)(a=>{r(b=>({...b,cliToolId:a,permission:function(a){let b=eq[a];if(void 0!==b)return b;let c=et(a);return c.length>0?c[0]:""}(a),model:ey.Vt.has(a)?b.model:"",agent:ey.aN.has(a)?b.agent:"",variant:ey.aN.has(a)?b.variant:"",continueSession:!!ey.aN.has(a)&&b.continueSession,title:ey.aN.has(a)?b.title:""}))},[]),R=(0,e.useCallback)(a=>{let b=p.find(b=>b.id===a);b&&(t(a),Q(b.cliTool))},[p,Q]),S=eF.some(a=>a.value===q.cronExpression)?q.cronExpression:"custom",T=(0,e.useCallback)(a=>{"custom"!==a&&r(b=>({...b,cronExpression:a}))},[]),U=(0,e.useCallback)(a=>{g?.(a),j()},[g,j]),V=(0,e.useCallback)(async()=>{if(P&&!u){v(!0),x(null);try{let a=await fetch(`/api/worktrees/${b}/cmate/schedules`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:q.name.trim(),cronExpression:q.cronExpression.trim(),message:q.message.trim(),cliToolId:q.cliToolId,enabled:q.enabled,permission:D?q.permission:"",model:F&&q.model.trim()?q.model.trim():void 0,agent:G&&q.agent.trim()?q.agent.trim():void 0,variant:G&&q.variant.trim()?q.variant.trim():void 0,continueSession:!!G&&!!q.continueSession||void 0,title:G&&q.title.trim()?q.title.trim():void 0,originalName:f??void 0})});if(!a.ok){let b=await a.json().catch(()=>({}));x(b.error||m("edit.saveError"));return}l(),j()}catch{x(m("edit.saveError"))}finally{v(!1)}}},[P,u,b,q,D,F,G,f,l,j,m]),W=p.find(a=>a.id===s)?.alias??(0,al.f_)(q.cliToolId),X=q.name.trim()?`${q.name.trim()} \xb7 ${q.cronExpression}`:q.cronExpression,Y=[W,D?q.permission:null,F&&q.model.trim()?q.model.trim():null,G&&q.agent.trim()?`--agent ${q.agent.trim()}`:null,G&&q.variant.trim()?`--variant ${q.variant.trim()}`:null,G&&q.continueSession?"--continue":null].filter(Boolean).join(" \xb7 "),Z=q.message.trim(),$=Z.length>32?`${Z.slice(0,32)}…`:Z,_=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-name-input",children:m("edit.name")}),(0,d.jsx)("input",{id:"schedule-name-input","data-testid":"schedule-name-input",type:"text",value:q.name,maxLength:100,placeholder:m("edit.namePlaceholder"),onChange:a=>r(b=>({...b,name:a.target.value})),className:eH}),I&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-name-error",children:I})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground",htmlFor:"schedule-cron-input",children:m("edit.cron")}),g&&(0,d.jsx)(eK,{testId:"schedule-cron-ask-ai",label:m("edit.askAiCron"),title:m("edit.askAiHint"),onClick:()=>U(function(a,b){let c=b.trim();return 0===c.length?a("edit.aiPrompts.cron"):a("edit.aiPrompts.cronRefine",{current:"`"+c+"`"})}(m,q.cronExpression))})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,d.jsx)("input",{id:"schedule-cron-input","data-testid":"schedule-cron-input",type:"text",value:q.cronExpression,placeholder:m("edit.cronPlaceholder"),onChange:a=>r(b=>({...b,cronExpression:a.target.value})),className:`${eH} font-mono sm:flex-1`}),(0,d.jsxs)("select",{"data-testid":"schedule-cron-preset","aria-label":m("edit.cronPreset"),value:S,onChange:a=>T(a.target.value),className:`${eH} sm:w-48`,children:[eF.map(a=>(0,d.jsx)("option",{value:a.value,children:m(`edit.${a.labelKey}`)},a.value)),(0,d.jsx)("option",{value:"custom",children:m("edit.cronPresetCustom")})]})]}),J&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-cron-error",children:J})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)(k.Sc,{"data-testid":"schedule-enabled-toggle",checked:q.enabled,onCheckedChange:a=>r(b=>({...b,enabled:!0===a}))}),(0,d.jsx)("span",{className:"text-sm text-foreground",children:m("edit.enabledLabel")})]})]}),aa=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-cli-tool-select",children:m("edit.cliTool")}),(0,d.jsx)("select",{id:"schedule-cli-tool-select","data-testid":"schedule-cli-tool-select",value:s,onChange:a=>R(a.target.value),className:eH,children:p.map(a=>(0,d.jsx)("option",{value:a.id,children:a.alias},a.id))})]}),F&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-model-input",children:m("edit.model")}),(0,d.jsx)("input",{id:"schedule-model-input","data-testid":"schedule-model-input",type:"text",value:q.model,placeholder:m("edit.modelPlaceholder"),onChange:a=>r(b=>({...b,model:a.target.value})),className:eH}),L&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-model-error",children:L})]}),G&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-agent-input",children:m("edit.opencodeAgent")}),(0,d.jsx)("input",{id:"schedule-agent-input","data-testid":"schedule-agent-input",type:"text",value:q.agent,placeholder:m("edit.opencodeAgentPlaceholder"),onChange:a=>r(b=>({...b,agent:a.target.value})),className:eH}),M&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-agent-error",children:M})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-variant-input",children:m("edit.opencodeVariant")}),(0,d.jsx)("input",{id:"schedule-variant-input","data-testid":"schedule-variant-input",type:"text",value:q.variant,placeholder:m("edit.opencodeVariantPlaceholder"),onChange:a=>r(b=>({...b,variant:a.target.value})),className:eH}),N&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-variant-error",children:N})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-title-input",children:m("edit.opencodeTitle")}),(0,d.jsx)("input",{id:"schedule-title-input","data-testid":"schedule-title-input",type:"text",value:q.title,placeholder:m("edit.opencodeTitlePlaceholder"),onChange:a=>r(b=>({...b,title:a.target.value})),className:eH}),O&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-title-error",children:O})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)(k.Sc,{"data-testid":"schedule-continue-toggle",checked:q.continueSession,onCheckedChange:a=>r(b=>({...b,continueSession:!0===a}))}),(0,d.jsx)("span",{className:"text-sm text-foreground",children:m("edit.opencodeContinue")})]})]}),D&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-permission-select",children:m("edit.permission")}),(0,d.jsx)("select",{id:"schedule-permission-select","data-testid":"schedule-permission-select",value:q.permission,onChange:a=>r(b=>({...b,permission:a.target.value})),className:eH,children:C.map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),E&&(0,d.jsx)("p",{className:"mt-1 text-xs text-warning-foreground","data-testid":"schedule-permission-write-tools-denied-note",children:eE(n).body})]})]}),ab=(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground",htmlFor:"schedule-message-input",children:m("edit.message")}),g&&(0,d.jsx)(eK,{testId:"schedule-message-ask-ai",label:m("edit.askAiMessage"),title:m("edit.askAiHint"),onClick:()=>U(function(a,b){let c=b.trim();return 0===c.length?a("edit.aiPrompts.messageDraft"):a("edit.aiPrompts.messageDraftNamed",{name:"`"+c+"`"})}(m,q.name))})]}),(0,d.jsx)("textarea",{id:"schedule-message-input","data-testid":"schedule-message-input",value:q.message,rows:4,maxLength:1e4,placeholder:m("edit.messagePlaceholder"),onChange:a=>r(b=>({...b,message:a.target.value})),className:`${eH} resize-none`}),(0,d.jsxs)("div",{className:"mt-1 flex items-center justify-between",children:[K?(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-message-error",children:K}):(0,d.jsx)("span",{}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"schedule-message-count",children:m("edit.charCount",{count:q.message.length,max:1e4})})]})]}),ac=(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(eL,{id:"basic",title:m("edit.sectionBasic"),summary:X,icon:(0,d.jsx)(B.A,{className:"w-4 h-4"}),isOpen:y.has("basic"),onToggle:A,children:_}),(0,d.jsx)(eL,{id:"advanced",title:m("edit.sectionAdvanced"),summary:Y,icon:(0,d.jsx)(eb,{className:"w-4 h-4"}),isOpen:y.has("advanced"),onToggle:A,children:aa}),(0,d.jsx)(eL,{id:"message",title:m("edit.sectionMessage"),summary:$,icon:(0,d.jsx)(ay.A,{className:"w-4 h-4"}),isOpen:y.has("message"),onToggle:A,children:ab}),w&&(0,d.jsx)("div",{className:"text-xs p-2 rounded bg-danger-subtle text-danger-foreground","data-testid":"schedule-submit-error",children:w})]}),ad=(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:j,className:"px-4 py-2 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",children:m("edit.cancel")}),(0,d.jsx)("button",{type:"button","data-testid":"schedule-save-button",onClick:()=>void V(),disabled:!P||u,className:"px-4 py-2 text-sm font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-md transition-colors",children:m("edit.save")})]}),ae=H?m("edit.titleEdit"):m("edit.titleCreate");return o?(0,d.jsx)(ec,{isOpen:a,onClose:j,title:ae,footer:ad,children:ac}):(0,d.jsx)(b_.a,{isOpen:a,onClose:j,title:ae,size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[ac,(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:ad})]})})}function eN(a){return new Date(a).toLocaleString()}function eO(a,b){if(null===b)return null;let c=b-a;if(c<0)return null;let d=Math.floor(c/1e3),e=Math.floor(d/60),f=d%60;return e>0?`${e}m ${f}s`:`${f}s`}let eP=(0,e.memo)(function({worktreeId:a}){let b=(0,bG.Ym)(),[c,f]=(0,e.useState)([]);if((0,e.useEffect)(()=>{let b=!1,c=a=>{b||f(b=>0===b.length&&0===a.length?b:a)};return(async()=>{try{let b=await fetch(`/api/worktrees/${a}/files/CMATE.md`),d=b.ok?await b.json():null,e="string"==typeof d?.content?d.content:"";c(function(a){let b=[],c=0;for(let e=0;e<a.length;e++){var d;let f=a[e],g=function(a){let b=[];for(let c=0;c<a.length;c++){let d=a[c];if(d.length<3){b.push({row:c,message:`Row ${c+1}: insufficient columns (need at least 3, got ${d.length})`,field:"columns"});continue}let[e,f,g]=d,h=ev(e);ew.test(h)||b.push({row:c,message:`Row ${c+1}: invalid name "${h}"`,field:"name"}),ex(f)||b.push({row:c,message:`Row ${c+1}: invalid cron "${f}"`,field:"cron"}),ev(g).trim()||b.push({row:c,message:`Row ${c+1}: empty message`,field:"message"});let{result:i,errors:j}=(0,ey.zK)(d[3]||"");for(let a of j)b.push({row:c,message:`Row ${c+1}: ${a}`,field:a.includes("Model")?"model":"cliTool"});i&&!(0,al.hR)(i.cliToolId)&&b.push({row:c,message:`Row ${c+1}: unknown CLI Tool "${i.cliToolId}"`,field:"cliTool"}),i&&(0,al.hR)(i.cliToolId)&&!es(i.cliToolId)&&b.push({row:c,message:`Row ${c+1}: CLI Tool "${i.cliToolId}" is not supported in schedules yet`,field:"cliTool"});let k=d[5];if(void 0!==k&&""!==k.trim()){let a=k.trim(),d=i.cliToolId;("claude"===d?ed:"codex"===d?ee:"copilot"===d?ef:"antigravity"===d?eg:"command-code"===d?ej:"opencode-v2"===d?eo:[]).includes(a)||b.push({row:c,message:`Row ${c+1}: invalid permission "${a}" for ${d}`,field:"permission"})}}return b}([f]);if(g.some(a=>"permission"!==a.field))continue;if(c>=100)break;if(c++,g.length>0)continue;let[h,,,i,j,k]=f;if(d=j,void 0!==d&&""!==d&&"true"!==d.toLowerCase())continue;let{result:l}=(0,ey.zK)(i||""),m=(k??"").trim();if(!eB(l.cliToolId,m))continue;let n=ev(h);b.push({row:e,name:n,field:"permission",code:"command-code-direct-write-tools-denied",cliToolId:l.cliToolId,permission:m,message:`Row ${e+1}: schedule "${n}" runs command-code with the --permission-mode value "${m}", so commandcode -p rejects the write tools the agent calls directly (${ez.join(", ")}). This is a warning, not an error: the schedule still runs. Use "yolo" if it needs to write.`})}return b}(eA(e).get("Schedules")??[]))}catch{c([])}})(),()=>{b=!0}},[a]),0===c.length)return null;let g=eE(b);return(0,d.jsxs)("div",{role:"status","data-testid":"schedule-config-warnings",className:"rounded border border-warning-border bg-warning-subtle p-3 text-warning-foreground",children:[(0,d.jsx)("p",{className:"text-sm font-semibold",children:g.bannerTitle}),(0,d.jsx)("ul",{className:"mt-1 space-y-1",children:c.map(a=>(0,d.jsxs)("li",{"data-testid":`schedule-config-warning-${a.name}`,"data-warning-code":a.code,className:"text-xs",children:[(0,d.jsx)("span",{className:"font-medium",children:a.name}),(0,d.jsxs)("span",{className:"ml-2 font-mono",children:[a.cliToolId," / ",a.permission]})]},`${a.row}-${a.name}`))}),(0,d.jsx)("p",{className:"mt-2 text-xs",children:g.body})]})}),eQ=(0,e.memo)(function({worktreeId:a,logs:b}){let c=(0,h.c)("schedule"),[f,g]=(0,e.useState)(null),[i,j]=(0,e.useState)(null),k=(0,e.useCallback)(async b=>{if(f===b){g(null),j(null);return}try{let c=await fetch(`/api/worktrees/${a}/execution-logs/${b}`);if(c.ok){let a=await c.json();j(a.log),g(b)}}catch(a){console.error("Failed to fetch log detail:",a)}},[a,f]),l=(0,d.jsx)(eP,{worktreeId:a});return 0===b.length?(0,d.jsxs)("div",{className:"space-y-2",children:[l,(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:c("noLogs")})]}):(0,d.jsxs)("div",{className:"space-y-2","data-testid":"execution-logs-view",children:[l,b.map(a=>(0,d.jsxs)("div",{className:"border border-border rounded bg-surface","data-testid":"execution-log-row","data-warning":a.warning?"true":void 0,children:[(0,d.jsxs)("button",{type:"button",onClick:()=>void k(a.id),className:"w-full text-left p-3 hover:bg-muted transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm truncate max-w-[60%]",children:a.schedule_name||c("unknownSchedule")}),(0,d.jsxs)("span",{className:`text-xs px-2 py-0.5 rounded ${function(a,b){if(b&&"completed"===a)return"text-warning-foreground bg-warning-subtle";switch(a){case"completed":return"text-success-foreground bg-success-subtle";case"failed":return"text-danger-foreground bg-danger-subtle";case"timeout":return"text-warning-foreground bg-warning-subtle";case"running":return"text-accent-600 dark:text-accent-400 bg-accent-50 dark:bg-accent-900/30";case"cancelled":return"text-muted-foreground bg-muted"}}(a.status,!!a.warning)}`,"data-testid":"execution-log-status",children:[a.warning&&(0,d.jsx)("span",{"aria-hidden":"true",children:"⚠ "}),c(`status.${a.status}`)]})]}),(0,d.jsxs)("div",{className:"text-xs text-muted-foreground mt-1",children:[eN(a.started_at),eO(a.started_at,a.completed_at)&&(0,d.jsxs)("span",{className:"ml-2",children:["(",eO(a.started_at,a.completed_at),")"]}),null!==a.exit_code&&(0,d.jsxs)("span",{className:"ml-2",children:[c("exitCode"),": ",a.exit_code]})]}),a.warning&&(0,d.jsxs)("div",{className:"text-xs text-warning-foreground mt-1 break-words","data-testid":"execution-log-warning",children:[(0,d.jsx)("span",{"aria-hidden":"true",children:"⚠ "}),a.warning]})]}),f===a.id&&i&&(0,d.jsxs)("div",{className:"border-t border-border p-3 bg-muted space-y-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:c("message")}),(0,d.jsx)("pre",{className:"text-xs whitespace-pre-wrap font-mono text-foreground",children:i.message})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:c("response")}),(0,d.jsx)("pre",{className:"text-xs whitespace-pre-wrap font-mono text-foreground max-h-60 overflow-y-auto",children:i.result||c("noOutput")})]})]})]},a.id))]})});function eR(){return(0,d.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4",children:(0,d.jsx)("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-8.5 8.5a1 1 0 01-.43.26l-3 .857a.5.5 0 01-.617-.618l.857-3a1 1 0 01.26-.43l8.5-8.5z"})})}function eS(){return(0,d.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4",children:(0,d.jsx)("path",{fillRule:"evenodd",d:"M8 2a1 1 0 00-.894.553L6.382 4H3a1 1 0 000 2h.293l.668 9.357A2 2 0 005.956 17h8.088a2 2 0 001.995-1.643L16.707 6H17a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0012 2H8zm1 5a1 1 0 012 0v6a1 1 0 11-2 0V7zm-3 0a1 1 0 011 1v5a1 1 0 11-2 0V8a1 1 0 011-1z",clipRule:"evenodd"})})}let eT=(0,e.memo)(function({worktreeId:a,className:b="",onInsertToMessage:c,instances:f}){let g=(0,h.c)("schedule"),i=(0,a4.SC)(),[j,l]=(0,e.useState)([]),[m,n]=(0,e.useState)([]),[o,p]=(0,e.useState)([]),[q,r]=(0,e.useState)(!0),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)("schedules"),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(void 0),[C,D]=(0,e.useState)(void 0),E=(0,e.useCallback)(async()=>{r(!0),t(null);try{let[b,c,d]=await Promise.all([fetch(`/api/worktrees/${a}/execution-logs`),fetch(`/api/worktrees/${a}/schedules`),fetch(`/api/worktrees/${a}/schedules/active`)]);if(b.ok){let a=await b.json();l(a.logs||[])}if(c.ok){let a=await c.json();n(a.schedules||[])}if(d.ok){let a=await d.json();p(a.schedules||[])}else p([])}catch(a){t(a instanceof Error?a.message:"Failed to fetch data")}finally{r(!1)}},[a]);(0,e.useEffect)(()=>{E()},[E]);let F=(0,e.useCallback)(async b=>{try{let c=await fetch(`/api/worktrees/${a}/files/CMATE.md`);if(!c.ok)return null;let d=await c.json(),e="string"==typeof d.content?d.content:"",f=(eA(e).get("Schedules")??[]).find(a=>(a[0]??"").trim()===b);if(!f)return null;let g=(0,ey.I_)(f[3]??"claude"),h=(f[4]??"true").trim().toLowerCase();return{name:b,cronExpression:(f[1]??"").trim(),message:(f[2]??"").trim(),cliToolId:g.cliToolId||"claude",enabled:""===h||"true"===h,permission:(f[5]??"").trim(),model:g.model??""}}catch{return null}},[a]),G=(0,e.useCallback)(()=>{D(void 0),B(void 0),z(!0)},[]),H=(0,e.useCallback)(async a=>{let b=await F(a.name);D(a.name),B(b??{name:a.name,cronExpression:a.cron_expression,message:a.message,cliToolId:a.cli_tool_id,enabled:1===a.enabled,permission:"",model:""}),z(!0)},[F]),I=(0,e.useCallback)(async b=>{if(await i({description:g("edit.confirmDelete",{name:b}),variant:"danger"}))try{(await fetch(`/api/worktrees/${a}/cmate/schedules`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})})).ok&&await E()}catch(a){console.error("Failed to delete schedule:",a)}},[a,g,E,i]),J=(0,e.useCallback)(async b=>{try{(await fetch(`/api/worktrees/${a}/cmate/schedules`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b.name,enabled:1!==b.enabled})})).ok&&await E()}catch(a){console.error("Failed to toggle schedule:",a)}},[a,E]);return q?(0,d.jsx)("div",{className:`flex items-center justify-center h-full p-4 ${b}`,children:(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,d.jsx)(k.y$,{size:"xl",variant:"accent"}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:g("loading")})]})}):s?(0,d.jsx)("div",{className:`flex items-center justify-center h-full p-4 ${b}`,children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("span",{className:"text-sm text-danger-foreground",children:s}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:()=>void E(),className:"ml-2 px-3 py-1 text-sm text-white bg-accent-500 rounded hover:bg-accent-600",children:g("retry")})]})}):(0,d.jsxs)("div",{className:`flex flex-col h-full ${b}`,children:[(0,d.jsxs)("div",{className:"flex shrink-0 border-b border-border px-4 pt-3",children:[(0,d.jsxs)("button",{type:"button","data-testid":"schedule-tab-schedules",role:"tab","aria-selected":"schedules"===u,onClick:()=>v("schedules"),className:`-mb-px px-3 py-2 text-sm font-medium border-b-2 transition-colors ${"schedules"===u?"border-accent-500 text-accent-700 dark:text-accent-300":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[g("tabs.schedules")," (",m.length,")"]}),(0,d.jsxs)("button",{type:"button","data-testid":"schedule-tab-logs",role:"tab","aria-selected":"logs"===u,onClick:()=>v("logs"),className:`-mb-px px-3 py-2 text-sm font-medium border-b-2 transition-colors ${"logs"===u?"border-accent-500 text-accent-700 dark:text-accent-300":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[g("tabs.logs")," (",j.length,")"]})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:"schedules"===u?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"rounded border border-accent-100 bg-accent-50/60 p-3 dark:border-accent-900/40 dark:bg-accent-950/20",children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-sm font-semibold text-accent-900 dark:text-accent-200",children:[g("activeSchedulesTitle")," (",o.length,")"]}),(0,d.jsx)("span",{className:"text-xs text-accent-700 dark:text-accent-300",children:g("activeSchedulesDescription")})]}),0===o.length?(0,d.jsx)("p",{className:"text-xs text-accent-800 dark:text-accent-300",children:g("noActiveSchedules")}):(0,d.jsx)("div",{className:"space-y-2",children:o.map(a=>(0,d.jsxs)("div",{className:"rounded border border-accent-200/80 bg-white/80 p-3 dark:border-accent-900/40 dark:bg-surface/60",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"font-medium text-sm text-foreground",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${a.isCronActive?"bg-success-subtle text-success-foreground":"bg-danger-subtle text-danger-foreground"}`,children:a.isCronActive?g("activeState.active"):g("activeState.inactive")}),a.isExecuting&&(0,d.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-accent-100 text-accent-700 dark:bg-accent-900/30 dark:text-accent-300",children:g("activeState.executing")})]})]}),(0,d.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(0,d.jsxs)("span",{children:[g("cron"),": ",a.cronExpression||"N/A"]}),(0,d.jsxs)("span",{className:"ml-3",children:[g("agentLabel"),": ",a.cliToolId]}),a.model&&(0,d.jsxs)("span",{className:"ml-3",children:["model: ",a.model]}),a.nextRunAt&&(0,d.jsxs)("span",{className:"ml-3",children:[g("nextRun"),": ",eN(a.nextRunAt)]})]})]},a.scheduleId))})]}),0===m.length?(0,d.jsxs)("div",{className:"flex flex-col items-center text-center py-8 px-4",children:[(0,d.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-accent-50 text-accent-600 dark:bg-accent-900/30 dark:text-accent-300",children:(0,d.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",className:"w-7 h-7",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7.5V12l3 2"})]})}),(0,d.jsx)("p",{className:"font-semibold text-foreground mb-1",children:g("emptyState.title")}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-5 max-w-xs",children:g("emptyState.description")}),(0,d.jsxs)(k.$n,{variant:"ghost",type:"button","data-testid":"schedule-empty-cta",onClick:G,className:"inline-flex items-center gap-1.5 px-5 py-2.5 text-sm font-semibold text-white bg-accent-600 hover:bg-accent-700 rounded-lg shadow-sm transition-colors",children:[(0,d.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4",children:(0,d.jsx)("path",{d:"M10 4a1 1 0 011 1v4h4a1 1 0 110 2h-4v4a1 1 0 11-2 0v-4H5a1 1 0 110-2h4V5a1 1 0 011-1z"})}),g("emptyState.createButton")]}),(0,d.jsx)("button",{type:"button","data-testid":"schedule-manual-toggle","aria-expanded":w,onClick:()=>x(a=>!a),className:"mt-5 text-xs text-accent-700 dark:text-accent-300 hover:underline",children:g("emptyState.manualToggle")}),w&&(0,d.jsxs)("ol",{"data-testid":"schedule-manual-steps",className:"mt-3 text-xs text-left inline-block space-y-1.5 list-decimal list-inside text-muted-foreground",children:[(0,d.jsx)("li",{children:g("noSchedulesStep1")}),(0,d.jsx)("li",{children:g("noSchedulesStep2")}),(0,d.jsx)("li",{children:g("noSchedulesStep3")}),(0,d.jsx)("li",{children:g("noSchedulesStep4")})]})]}):(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"mb-2 flex items-center justify-end",children:(0,d.jsxs)(k.$n,{variant:"ghost",type:"button","data-testid":"schedule-new-button",onClick:G,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-white bg-accent-600 hover:bg-accent-700 rounded transition-colors whitespace-nowrap",children:[(0,d.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",fill:"currentColor",className:"w-3.5 h-3.5",children:(0,d.jsx)("path",{d:"M10 4a1 1 0 011 1v4h4a1 1 0 110 2h-4v4a1 1 0 11-2 0v-4H5a1 1 0 110-2h4V5a1 1 0 011-1z"})}),g("edit.newSchedule")]})}),(0,d.jsx)("div",{className:"space-y-2",children:m.map(a=>{let b=1===a.enabled;return(0,d.jsxs)("div",{className:"border border-border rounded p-3 bg-white dark:bg-surface",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"font-medium text-sm truncate",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":b,"aria-label":b?g("edit.disable"):g("edit.enable"),title:b?g("edit.disable"):g("edit.enable"),"data-testid":`schedule-toggle-${a.name}`,onClick:()=>void J(a),className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors ${b?"bg-success":"bg-input"}`,children:(0,d.jsx)("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ${b?"translate-x-4":"translate-x-0.5"}`})}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button","data-testid":`schedule-edit-${a.name}`,"aria-label":g("edit.edit"),title:g("edit.edit"),onClick:()=>void H(a),className:"p-1.5 text-muted-foreground hover:text-accent-600 dark:hover:text-accent-400 hover:bg-accent-50 dark:hover:bg-accent-900/20 rounded transition-colors",children:(0,d.jsx)(eR,{})}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button","data-testid":`schedule-delete-${a.name}`,"aria-label":g("edit.delete"),title:g("edit.delete"),onClick:()=>void I(a.name),className:"p-1.5 text-muted-foreground hover:text-danger-foreground hover:bg-danger-subtle rounded transition-colors",children:(0,d.jsx)(eS,{})})]})]}),(0,d.jsxs)("div",{className:"text-xs text-muted-foreground mt-1",children:[(0,d.jsxs)("span",{children:[g("cron"),": ",a.cron_expression||"N/A"]}),a.last_executed_at&&(0,d.jsxs)("span",{className:"ml-3",children:[g("lastRun"),": ",eN(a.last_executed_at)]})]})]},a.id)})})]})]}):(0,d.jsx)(eQ,{worktreeId:a,logs:j})}),(0,d.jsx)(eM,{isOpen:y,worktreeId:a,initialValues:A,originalName:C,onInsertToMessage:c,instances:f,onClose:()=>z(!1),onSaved:()=>{E()}})]})}),eU=(0,e.memo)(function({worktreeId:a,vibeLocalModel:b,onVibeLocalModelChange:c,vibeLocalContextWindow:f,onVibeLocalContextWindowChange:g}){let i=(0,h.c)("schedule"),[k,l]=(0,e.useState)([]),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null!=f?String(f):""),[u,v]=(0,e.useState)(!1);(0,e.useEffect)(()=>{t(null!=f?String(f):"")},[f]),(0,e.useEffect)(()=>{let a=!1;return p(!0),fetch("/api/ollama/models").then(a=>a.json()).then(b=>{a||(l(b.models),n(0===b.models.length&&b.error?b.error:null))}).catch(()=>{a||(l([]),n("Failed to fetch models"))}).finally(()=>{a||p(!1)}),()=>{a=!0}},[]);let w=(0,e.useCallback)(async b=>{let d=b.target.value,e=""===d?null:d;r(!0);try{(await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({vibeLocalModel:e})})).ok&&c(e)}catch{}finally{r(!1)}},[a,c]),x=(0,e.useCallback)(a=>{t(a.target.value)},[]),y=(0,e.useCallback)(async()=>{let b=s.trim(),c=parseInt(b,10),d=""===b||Number.isNaN(c)?null:c,e=f??null;if(d!==e){v(!0);try{(await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({vibeLocalContextWindow:d})})).ok?g?.(d):t(null!=e?String(e):"")}catch{t(null!=e?String(e):"")}finally{v(!1)}}},[s,f,a,g]);return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border",children:[(0,d.jsx)("h4",{className:"text-sm font-semibold text-foreground mb-2",children:i("vibeLocalModel")}),o?(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(j.y,{size:"xs",variant:"muted"}),i("loading")]}):m&&0===k.length?(0,d.jsx)("p",{className:"text-xs text-warning-foreground",children:i("ollamaNotAvailable")}):(0,d.jsxs)("select",{"data-testid":"vibe-local-model-select",value:b??"",onChange:w,disabled:q,className:"w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:[(0,d.jsx)("option",{value:"",children:i("vibeLocalModelDefault")}),k.map(a=>(0,d.jsxs)("option",{value:a.name,children:[a.name,a.parameterSize?` (${a.parameterSize})`:""]},a.name))]}),(0,d.jsxs)("div",{className:"mt-3",children:[(0,d.jsx)("h4",{className:"text-sm font-semibold text-foreground mb-2",children:i("vibeLocalContextWindow")}),(0,d.jsx)("input",{type:"number","data-testid":"vibe-local-context-window-input",step:"1",min:al.vz,max:al.NL,value:s,onChange:x,onBlur:y,placeholder:i("vibeLocalContextWindowDefault"),disabled:u,className:"w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"})]})]})}),eV=Object.freeze({agent:null,providerId:null,modelId:null,variant:null}),eW=[{id:"opencode",label:(0,al.oo)("opencode")}];function eX(a){let b=a.indexOf("/");return b<=0||b===a.length-1?null:{providerId:a.slice(0,b),modelId:a.slice(b+1)}}let eY=(0,e.memo)(function({worktreeId:a,instances:b}){let c=(0,h.c)("schedule"),[f,g]=(0,e.useState)({}),[i,j]=(0,e.useState)({connected:!1,providers:[],agents:[]}),[l,m]=(0,e.useState)(!0),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(null);(0,e.useEffect)(()=>{let b=!1;return m(!0),fetch(`/api/worktrees/${a}/instances/opencode`).then(a=>a.ok?a.json():Promise.reject(Error(String(a.status)))).then(a=>{b||(g(a.settings??{}),j(a.catalog??{connected:!1,providers:[],agents:[]}),q(null))}).catch(()=>{b||q(c("opencodeSettingsLoadError"))}).finally(()=>{b||m(!1)}),()=>{b=!0}},[a,c]);let r=(0,e.useCallback)(async(b,d)=>{g(a=>({...a,[b]:d})),o(!0),q(null);try{let e=await fetch(`/api/worktrees/${a}/instances/opencode`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({instanceId:b,...d})});if(!e.ok)return void q(c("opencodeSettingsSaveError"));let f=await e.json();f.settings&&g(a=>({...a,[b]:f.settings}))}catch{q(c("opencodeSettingsSaveError"))}finally{o(!1)}},[a,c]);return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border","data-testid":"opencode-instance-settings",children:[(0,d.jsx)("h4",{className:"text-sm font-semibold text-foreground mb-1",children:c("opencodeSettings")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:c("opencodeSettingsDescription")}),l?(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(k.y$,{size:"xs",variant:"muted"}),c("loading")]}):(0,d.jsxs)("div",{className:"space-y-4",children:[!i.connected&&(0,d.jsx)("p",{"data-testid":"opencode-settings-offline",className:"text-xs text-muted-foreground",children:c("opencodeSettingsOffline")}),b.map(a=>{let e=f[a.id]??{...eV},g=e.providerId&&e.modelId?`${e.providerId}/${e.modelId}`:"",h=function(a,b){if(!b.providerId||!b.modelId)return null;let c=a.providers.find(a=>a.id===b.providerId);return c?.models.find(a=>a.id===b.modelId)??null}(i,e),j=h?.variants??[],k=i.agents.filter(a=>"primary"===a.mode);return(0,d.jsxs)("div",{className:"space-y-2",children:[b.length>1&&(0,d.jsx)("p",{className:"text-xs font-medium text-foreground",children:a.label}),(0,d.jsxs)("label",{className:"block text-xs text-muted-foreground",children:[c("opencodeAgent"),k.length>0?(0,d.jsxs)("select",{"data-testid":`opencode-agent-select-${a.id}`,value:e.agent??"",disabled:n,onChange:b=>void r(a.id,{...e,agent:""===b.target.value?null:b.target.value}),className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:[(0,d.jsx)("option",{value:"",children:c("opencodeDefault")}),k.map(a=>(0,d.jsx)("option",{value:a.name,children:a.name},a.name))]}):(0,d.jsx)("input",{type:"text","data-testid":`opencode-agent-input-${a.id}`,defaultValue:e.agent??"",disabled:n,placeholder:c("opencodeAgentPlaceholder"),onBlur:b=>void r(a.id,{...e,agent:""===b.target.value.trim()?null:b.target.value.trim()}),className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"})]}),(0,d.jsxs)("label",{className:"block text-xs text-muted-foreground",children:[c("opencodeModel"),i.providers.length>0?(0,d.jsxs)("select",{"data-testid":`opencode-model-select-${a.id}`,value:g,disabled:n,onChange:b=>{let c=eX(b.target.value);r(a.id,{...e,providerId:c?.providerId??null,modelId:c?.modelId??null,variant:null})},className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:[(0,d.jsx)("option",{value:"",children:c("opencodeDefault")}),i.providers.map(a=>(0,d.jsx)("optgroup",{label:a.name,children:a.models.map(b=>(0,d.jsx)("option",{value:`${a.id}/${b.id}`,children:b.name},b.id))},a.id))]}):(0,d.jsx)("input",{type:"text","data-testid":`opencode-model-input-${a.id}`,defaultValue:g,disabled:n,placeholder:c("opencodeModelPlaceholder"),onBlur:b=>{let c=eX(b.target.value.trim());r(a.id,{...e,providerId:c?.providerId??null,modelId:c?.modelId??null})},className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"})]}),(0,d.jsxs)("label",{className:"block text-xs text-muted-foreground",children:[c("opencodeVariant"),j.length>0?(0,d.jsxs)("select",{"data-testid":`opencode-variant-select-${a.id}`,value:e.variant??"",disabled:n,onChange:b=>void r(a.id,{...e,variant:""===b.target.value?null:b.target.value}),className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:[(0,d.jsx)("option",{value:"",children:c("opencodeDefault")}),j.map(a=>(0,d.jsx)("option",{value:a,children:a},a))]}):(0,d.jsx)("input",{type:"text","data-testid":`opencode-variant-input-${a.id}`,defaultValue:e.variant??"",disabled:n,placeholder:c("opencodeVariantPlaceholder"),onBlur:b=>void r(a.id,{...e,variant:""===b.target.value.trim()?null:b.target.value.trim()}),className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"})]}),h&&0===j.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("opencodeNoVariants")})]},a.id)}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("opencodeVariantLaunchNote")}),n&&(0,d.jsxs)("div",{"data-testid":"opencode-settings-loading",className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(k.y$,{size:"xs",variant:"muted"}),c("loading")]}),p&&(0,d.jsx)("p",{"data-testid":"opencode-settings-error",className:"text-xs text-danger-foreground",children:p})]})]})}),eZ=(0,e.memo)(function({worktreeId:a,selectedAgents:b,onSelectedAgentsChange:c,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:j,maxAgents:l=2,availableAgents:m=al.XH,persistToServer:n=!0}){let o=(0,h.c)("schedule"),p=b.length>l?b.slice(0,l):b,[q,r]=(0,e.useState)(()=>new Set(p)),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),w=(0,e.useRef)(q);w.current=q,(0,e.useEffect)(()=>{u||r(new Set(p))},[b,u,l]);let x=q.has("vibe-local"),y=q.has("opencode"),z=(0,e.useCallback)(async(b,d)=>{let e=new Set(w.current);if(d?e.add(b):(e.delete(b),v(!0)),r(e),e.size>=2){let b=Array.from(e);if(!n){r(new Set(b)),c(b),v(!1);return}t(!0);try{(await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedAgents:b})})).ok?(r(new Set(b)),c(b)):r(new Set(p))}catch{r(new Set(p))}finally{t(!1),v(!1)}}},[a,p,c,n]),A=q.size>=l;return(0,d.jsxs)("div",{className:"p-4",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-1",children:o("agentSettings")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:o("selectAgents")}),(0,d.jsx)("div",{className:"space-y-3",children:m.map(a=>{let b=q.has(a),c=!b&&A;return(0,d.jsxs)("label",{className:`flex items-center gap-3 p-2 rounded-lg border transition-colors ${b?"border-accent-200 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30":c?"border-border bg-muted opacity-50":"border-border hover:border-input hover:bg-muted"}`,children:[(0,d.jsx)(k.Sc,{"data-testid":`agent-checkbox-${a}`,"aria-label":(0,al.oo)(a),checked:b,disabled:c||s,onCheckedChange:b=>z(a,!0===b)}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:(0,al.oo)(a)})]},a)})}),s&&(0,d.jsxs)("div",{"data-testid":"agent-settings-loading",className:"mt-3 flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(k.y$,{size:"xs",variant:"muted"}),o("loading")]}),y&&(0,d.jsx)(eY,{worktreeId:a,instances:eW}),x&&(0,d.jsx)(eU,{worktreeId:a,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:j})]})});function e$(a,b){if(0===b.length)return[];if(null!==a){let c=new Set(a),d=b.filter(a=>c.has(a.id));if(d.length>0)return d}return[...b]}let e_=(0,x.A)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var e0=c(16945);let e1=(0,x.A)("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);var e2=c(82788),e3=c(77917);let e4=(0,x.A)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);var e5=c(71563),e6=c(59405),e7=c(722),e8=c(31666),e9=c(4267),fa=c(89907);let fb="/api/worktrees/apply-default-agents";var fc=c(85678);let fd=["noteInstanceFlag","noteWaitOnPrompt","noteRespondNumber"];function fe({worktreeId:a,instance:b,isOpen:c,onClose:f}){let g=(0,h.c)("worktree"),[i,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(0),x=n&&p?(0,fc.kj)({binary:n.binary,worktreeId:n.worktreeId,instanceId:p.instanceId,portPrefix:n.portPrefix,messagePlaceholder:g("cliCommands.messagePlaceholder")}):null,y=(0,e.useCallback)(async(a,b)=>{try{await navigator.clipboard.writeText(b),s(a),u(!1)}catch(a){console.error("[InstanceCliCommandsModal] clipboard write failed:",a),s(null),u(!0)}},[]);return(0,d.jsx)(b_.a,{isOpen:c,onClose:f,size:"md",title:g("cliCommands.title",{alias:b.alias}),children:(0,d.jsxs)("div",{className:"space-y-4","data-testid":`cli-commands-panel-${b.id}`,children:[i&&(0,d.jsxs)("div",{"data-testid":"cli-commands-loading",className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(j.y,{size:"xs",variant:"muted"}),g("cliCommands.loading")]}),l&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("p",{"data-testid":"cli-commands-error",className:"text-xs text-danger-foreground",children:g("cliCommands.loadError")}),(0,d.jsx)("button",{type:"button","data-testid":"cli-commands-retry",onClick:()=>w(a=>a+1),className:"text-xs font-medium px-2 py-1 rounded-md border border-input text-foreground hover:bg-muted",children:g("cliCommands.retry")})]}),x&&p&&n&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{"data-testid":"cli-commands-target",className:"text-xs text-muted-foreground break-words",children:g("cliCommands.target",{instance:p.instanceId,tool:(0,al.oo)(p.cliToolId),stage:g(`cliCommands.resolvedBy.${p.resolvedBy}`)})}),p.conflict&&(0,d.jsxs)("p",{"data-testid":"cli-commands-conflict",className:"flex items-start gap-1 text-xs text-warning",children:[(0,d.jsx)(e0.A,{className:"w-3 h-3 mt-0.5 shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{children:g("cliCommands.conflict",{instance:p.conflict.instanceId,roster:(0,al.oo)(p.conflict.rosterCliTool),requested:(0,al.oo)(p.conflict.requestedCliTool)})})]}),(0,d.jsx)("ul",{className:"space-y-3",children:fc.wx.map(a=>(0,d.jsxs)("li",{className:"space-y-1",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground",children:g(`cliCommands.commandLabel.${a}`)}),(0,d.jsxs)("button",{type:"button","data-testid":`cli-commands-copy-${a}`,"aria-label":g("cliCommands.copy"),title:g("cliCommands.copy"),onClick:()=>void y(a,x[a]),className:"flex items-center gap-1 shrink-0 text-xs px-2 py-1 rounded-md border border-input text-muted-foreground hover:text-foreground hover:bg-muted",children:[r===a?(0,d.jsx)(a9.A,{className:"w-3 h-3","aria-hidden":"true"}):(0,d.jsx)(ba.A,{className:"w-3 h-3","aria-hidden":"true"}),r===a?g("cliCommands.copied"):g("cliCommands.copy")]})]}),(0,d.jsx)("code",{"data-testid":`cli-commands-command-${a}`,className:"block whitespace-pre-wrap break-all rounded-md bg-terminal-surface px-2 py-1.5 font-mono text-xs text-terminal-foreground",children:x[a]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:g(`cliCommands.commandDescription.${a}`)})]},a))}),t&&(0,d.jsx)("p",{"data-testid":"cli-commands-copy-error",className:"text-xs text-danger-foreground",children:g("cliCommands.copyFailed")}),null!==n.portPrefix&&(0,d.jsx)("p",{"data-testid":"cli-commands-port-hint",className:"text-xs text-muted-foreground",children:g("cliCommands.portHint",{port:n.portPrefix})}),(0,d.jsxs)("div",{className:"rounded-md border border-border bg-surface-2 p-3",children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-foreground",children:g("cliCommands.notesTitle")}),(0,d.jsx)("ul",{className:"mt-1 space-y-1",children:fd.map(a=>(0,d.jsx)("li",{"data-testid":`cli-commands-${a}`,className:"text-xs text-muted-foreground",children:g(`cliCommands.${a}`)},a))})]})]})]})})}var ff=c(73060),fg=c(76047);let fh=[.5,.5],fi={splits:[{cliToolId:"claude",instanceId:"claude"}],widths:[1]};al.XH;function fj(a){return"number"==typeof a&&Number.isFinite(a)&&a>0}function fk(a){return void 0===a||!!Array.isArray(a)&&2===a.length&&a.every(fj)}function fl(a,b){let c=a+b;if(!Number.isFinite(c)||c<=0)return[1,1];let d=Math.min(a,b);return!Number.isFinite(d)||d<=0?[1,1]:[a/d,b/d]}let fm=Array.from({length:4},(a,b)=>1+b),fn=["new-split","replace","roster-only"];function fo(a,b){return"new-split"!==a||b<4}function fp(a){return fo("new-split",a)?"new-split":"replace"}let fq=new Map;function fr(a,b,c){let d=(0,e.useRef)(b);d.current=b;let f=(0,e.useRef)(c);return f.current=c,(0,e.useCallback)(b=>(function(a,b,c,d){let e,f=((e=fq.get(a))||(e={tail:Promise.resolve(),pending:0,latest:null},fq.set(a,e)),e);f.pending+=1;let g=async()=>{try{let e=f.latest??b(),g=c(e);if(!g)return{status:"skipped"};let h=g.map((a,b)=>({...a,order:b}));try{if(!(await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentInstances:h})})).ok)return{status:"failed"}}catch{return{status:"failed"}}return f.latest=h,d(h),{status:"saved",roster:h}}finally{f.pending-=1,0===f.pending&&fq.delete(a)}},h=f.tail.then(g,g);return f.tail=h,h})(a,()=>d.current,b,a=>f.current(a)),[a])}function fs(a,b){let c=new Set(b.map(a=>a.id));if(!c.has(a))return a;let d=2;for(;c.has(`${a}-${d}`);)d++;return`${a}-${d}`}function ft(a,b){let c=(0,al.oo)(a);if(b===a)return c;let d=b.slice(a.length+1);return d?`${c} ${d}`:c}async function fu(){try{let a=await fetch(`${fa.zk}?include=installed`);if(!a.ok)return null;let b=await a.json();if(!b||"object"!=typeof b)return null;let c=b.installed;if(!Array.isArray(c))return null;let d=new Set(al.XH),e=c.filter(a=>"string"==typeof a&&d.has(a));return e.length>0?e:null}catch{return null}}let fv={"new-split":"placementNewSplit",replace:"placementReplace","roster-only":"placementRosterOnly"},fw=(0,e.memo)(function({worktreeId:a,instances:b,splitCount:c,onInstancesChange:f,onAdded:g}){let i=(0,h.c)("worktree"),j=(0,e.useId)(),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(void 0),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(()=>fp(c)),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),y=b.length>=al.Ab,z=fr(a,b,f),A=(0,e.useCallback)(a=>null==m||m.includes(a),[m]),B=(0,e.useMemo)(()=>al.XH.find(a=>A(a))??"",[A]);(0,e.useEffect)(()=>{if(!k)return;let a=!1;return n(void 0),fu().then(b=>{a||n(b)}),()=>{a=!0}},[k]);let C=o&&A(o)?o:B;(0,e.useEffect)(()=>{t(a=>fo(a,c)?a:fp(c))},[c]);let D=(0,e.useCallback)(()=>{r(""),x(null),t(fp(c)),l(!0)},[c]),E=(0,e.useCallback)(()=>{u||l(!1)},[u]),F=(0,e.useCallback)(async a=>{if(a.preventDefault(),!C||!A(C)||y||u||!fo(s,c))return;let b=q.trim(),d=null;v(!0),x(null);try{let a=await z(a=>{if(a.length>=al.Ab)return null;let c=fs(C,a);return d={id:c,cliTool:C,alias:b||ft(C,c),order:a.length},[...a,d]});if("saved"!==a.status||null===d)return void x(i("agentAdd.saveError"));let c=a.roster.find(a=>a.id===d.id);g?.(c??d,s),l(!1)}finally{v(!1)}},[C,A,y,u,s,c,q,z,i,g]),G=y?i("agentAdd.maxReached",{max:al.Ab}):i("agentAdd.button"),H=!u&&!y&&void 0!==m&&""!==C&&A(C);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(aw.m_,{content:G,placement:"bottom",children:(0,d.jsx)("button",{type:"button",onClick:D,disabled:y,"aria-disabled":y,"aria-label":G,"aria-haspopup":"dialog","data-testid":"agent-add-button",className:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors",children:(0,d.jsx)(bJ.A,{className:"w-4 h-4","aria-hidden":"true"})})}),(0,d.jsx)(b_.a,{isOpen:k,onClose:E,title:i("agentAdd.title"),size:"sm",children:(0,d.jsxs)("form",{id:j,onSubmit:F,"data-testid":"agent-add-form",className:"space-y-4 text-sm",children:[(0,d.jsxs)("label",{className:"block space-y-1",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("agentAdd.tool")}),(0,d.jsx)("select",{"data-testid":"agent-add-tool",value:C,disabled:u||void 0===m,onChange:a=>p(a.target.value),className:"w-full text-sm border border-input rounded-md px-2 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",children:al.XH.map(a=>{let b=A(a),c=(0,al.oo)(a);return(0,d.jsx)("option",{value:a,disabled:!b,children:b?c:i("agentAdd.notInstalled",{name:c})},a)})})]}),null===m&&(0,d.jsx)("p",{"data-testid":"agent-add-installed-unknown",className:"text-xs text-muted-foreground",children:i("agentAdd.installedUnknown")}),(0,d.jsxs)("label",{className:"block space-y-1",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("agentAdd.name")}),(0,d.jsx)("input",{type:"text","data-testid":"agent-add-name",value:q,maxLength:al.pQ,placeholder:i("agentAdd.namePlaceholder"),disabled:u,onChange:a=>r(a.target.value),className:"w-full text-sm border border-input rounded-md px-2 py-2 bg-surface text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),(0,d.jsxs)("fieldset",{className:"space-y-1",children:[(0,d.jsx)("legend",{className:"text-xs font-medium text-muted-foreground",children:i("agentAdd.placement")}),fn.map(a=>{let b=fo(a,c);return(0,d.jsxs)("label",{className:`flex items-center gap-2 py-0.5 ${b?"":"opacity-50 cursor-not-allowed"}`,children:[(0,d.jsx)("input",{type:"radio",name:`${j}-placement`,value:a,"data-testid":`agent-add-placement-${a}`,checked:s===a,disabled:!b||u,onChange:()=>t(a)}),(0,d.jsx)("span",{children:i(`agentAdd.${fv[a]}`)}),!b&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:i("agentAdd.placementNewSplitFull",{max:4})})]},a)})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:i("agentAdd.startHint")}),w&&(0,d.jsx)("p",{role:"alert","data-testid":"agent-add-error",className:"text-xs text-danger",children:w}),(0,d.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,d.jsx)("button",{type:"button",onClick:E,disabled:u,className:"px-3 py-1.5 text-sm rounded-md bg-muted hover:bg-muted/80 text-foreground disabled:opacity-50",children:i("agentAdd.cancel")}),(0,d.jsx)("button",{type:"submit","data-testid":"agent-add-submit",disabled:!H,className:"px-3 py-1.5 text-sm font-medium rounded-md border border-accent-200 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300 hover:bg-accent-100 dark:hover:bg-accent-900/50 disabled:opacity-40 disabled:cursor-not-allowed",children:i("agentAdd.submit")})]})]})})]})});function fx(a){return"prompt"===a.tone?"text-warning":"text-muted-foreground"}let fy=(0,e.memo)(function({worktreeId:a,instances:b,onInstancesChange:c,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:k,modelByInstance:l,sourceByInstance:m,composerTargetInstanceId:n,className:o=""}){let p=(0,h.c)("schedule"),q=(0,bG.Ym)(),{showToast:r}=(0,bO.dj)(),s=(0,h.c)("common"),t=(0,h.c)("worktree"),u=(0,a4.SC)(),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)({}),[B,C]=(0,e.useState)(al.XH[0]),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(null),L=(0,e.useCallback)(async b=>{let c=fg.yW["ja"===q?"ja":"en"];if((n??(0,fg.xk)())===b.id)return void r(c.self,"info");let d=await (0,fg.P0)(a,b,q);if(null===d)return void r(c.failed,"error");let e=(0,fg.oQ)(d);r(e?c.inserted:c.noComposer,e?"success":"error")},[n,q,r,a]),M=function(a,b,c){let[d,f]=(0,e.useState)({});return b.some(a=>"opencode"===a.cliTool),c??d}(0,b,m),N=(0,e7.UI)(a),O=(0,e.useCallback)(c=>c.worktreeId!==a?`${c.instanceId} @ ${c.worktreeId}`:b.find(a=>a.id===c.instanceId)?.alias??c.instanceId,[b,a]),P=b.length>=al.Ab,Q=b.length<=1,R=b.some(a=>"vibe-local"===a.cliTool),S=(0,e.useMemo)(()=>{let a=new Set,c=[];for(let d of b)a.has(d.cliTool)||(a.add(d.cliTool),c.push(d.cliTool));return c},[b]),T=function(a,b){let[c,d]=(0,e.useState)(null),[f,g]=(0,e.useState)(null),[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),r=(0,e.useCallback)(a=>{g("string"==typeof a?.repositoryName?a.repositoryName:null),i(a?.repoDeclaresAgents===!0)},[]),s=(0,e.useCallback)(async()=>{k(!0);try{let b=await fetch(`${fb}?worktreeId=${encodeURIComponent(a)}`);if(!b.ok)throw Error(String(b.status));let c=await b.json(),e=c?.eligible;if("number"!=typeof e||!Number.isFinite(e))throw Error("unexpected body");return d(e),r(c),q(null),e}catch{return d(null),q("count"),null}finally{k(!1)}},[a,r]);return{eligible:c,repositoryName:f,repoDeclaresAgents:h,busy:j,savedDefault:l,appliedCount:n,error:p,refreshEligible:s,saveAsDefault:(0,e.useCallback)(async()=>{k(!0),q(null),m(!1),o(null);try{let a=await fetch(fa.zk,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:b})}),c=await a.json().catch(()=>null),d=c?.defaultSelectedAgents;if(!a.ok||!Array.isArray(d))return q("save"),!1;return(0,fa.IK)(d),m(!0),!0}catch{return q("save"),!1}finally{k(!1)}},[b]),applyToUnchanged:(0,e.useCallback)(async()=>{k(!0),q(null),m(!1);try{let c=await fetch(fb,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({worktreeId:a,agents:b})}),e=await c.json().catch(()=>null),f=e?.updated;if(!c.ok||"number"!=typeof f||!Number.isFinite(f))return q("apply"),null;o(f),r(e);let g=e.eligible;return"number"==typeof g&&Number.isFinite(g)&&d(g),f}catch{return q("apply"),null}finally{k(!1)}},[a,b,r])}}(a,S),U=S.length>=e9.eu&&S.length<=e9.Wj,V=v||T.busy,W=U&&!T.repoDeclaresAgents&&null!==T.eligible&&T.eligible>0,X="count"===T.error?p("agentDefaultsCountError"):"save"===T.error?p("agentDefaultsSaveError"):"apply"===T.error?p("agentDefaultsApplyError"):null,Y=(0,e.useCallback)(()=>{let a=!H;I(a),a&&T.refreshEligible()},[H,T]),Z=(0,e.useCallback)(async()=>{if(!W)return;let a=await T.refreshEligible();null!==a&&0!==a&&await u({description:p("agentDefaultsApplyConfirm",{count:a,agents:S.map(a=>(0,al.oo)(a)).join(", ")})})&&await T.applyToUnchanged()},[W,T,u,p,S]),$=fr(a,b,c),_=(0,e.useCallback)(async a=>{w(!0),y(null);try{let b=await $(a);"failed"===b.status&&y(p("agentInstanceSaveError"))}finally{w(!1)}},[$,p]),aa=(0,e.useCallback)(()=>{b.length>=al.Ab||_(a=>{if(a.length>=al.Ab)return null;let b=fs(B,a);return[...a,{id:b,cliTool:B,alias:ft(B,b),order:a.length}]})},[B,b,_]),ab=(0,e.useCallback)(async a=>{if(b.length<=1)return;let c=b.find(b=>b.id===a);await u({description:s("confirmDelete",{name:c?.alias??""}),variant:"danger"})&&_(b=>b.length<=1||!b.some(b=>b.id===a)?null:b.filter(b=>b.id!==a))},[b,_,u,s]),ac=(0,e.useCallback)((a,c)=>{if(a===c||a<0||c<0||a>=b.length||c>=b.length)return;let d=b[a].id,e=b[c].id;_(a=>{let b=a.findIndex(a=>a.id===d),c=a.findIndex(a=>a.id===e);if(-1===b||-1===c||b===c)return null;let f=[...a],[g]=f.splice(b,1);return f.splice(c,0,g),f})},[b,_]),ad=(0,e.useCallback)((a,b)=>{ac(a,a+b)},[ac]),ae=(0,e.useCallback)((a,c)=>{A(b=>{if(!(a in b))return b;let c={...b};return delete c[a],c});let d=b.find(b=>b.id===a);d&&c!==d.alias&&_(b=>b.some(b=>b.id===a)?b.map(b=>b.id===a?{...b,alias:c}:b):null)},[b,_]),af=["flex flex-col p-4",o?"overflow-y-auto":"",o].filter(Boolean).join(" ");return(0,d.jsxs)("div",{className:af,"data-testid":"agent-instances-pane",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-1",children:p("agentInstances")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:p("agentInstancesDescription")}),(0,d.jsx)("div",{className:"space-y-2",children:b.map((c,e)=>{let f=c.id in z?z[c.id]:c.alias,g=D===e,h=l?.[c.id]??null,i=M?.[c.id],j=cy(i,t),k=!!i&&("sse"!==i.kind||"live"!==i.liveness),m=(0,e8.g)({owed:N.owedBy(c.id),awaiting:N.awaitedBy(c.id),aliasOf:O}),o=n===c.id;return(0,d.jsxs)("div",{"data-testid":`agent-instance-row-${c.id}`,draggable:!0,onDragStart:()=>E(e),onDragOver:a=>a.preventDefault(),onDrop:()=>{null!==D&&ac(D,e),E(null)},onDragEnd:()=>E(null),className:`flex items-center gap-2 p-2 rounded-lg border border-border bg-surface transition-colors hover:border-accent-300 dark:hover:border-accent-700 focus-within:border-accent-500 ${g?"opacity-50":""}`,children:[(0,d.jsx)("span",{className:"cursor-grab text-muted-foreground shrink-0","aria-hidden":"true",children:(0,d.jsx)(e_,{className:"w-4 h-4"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("input",{type:"text","data-testid":`agent-instance-alias-${c.id}`,"aria-label":p("agentInstanceAliasLabel"),value:f,maxLength:al.pQ,disabled:v,placeholder:p("agentInstanceAliasPlaceholder"),onChange:a=>A(b=>({...b,[c.id]:a.target.value})),onBlur:a=>ae(c.id,a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.nativeEvent.isComposing||a.currentTarget.blur()},className:"w-full text-sm font-medium border border-input rounded-md px-2 py-1 bg-surface dark:bg-surface-2 text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"}),(0,d.jsx)(dE.nR,{content:(0,al.oo)(c.cliTool),className:"mt-0.5 block truncate text-xs text-muted-foreground"}),h&&(0,d.jsx)("span",{"data-testid":`agent-instance-model-${c.id}`,title:t("agentModel.modelLabel",{model:h}),className:"mt-0.5 block truncate text-xs text-muted-foreground",children:h}),j&&(0,d.jsxs)("span",{"data-testid":`agent-instance-source-${c.id}`,title:t(k?"agentSource.degradedTitle":"agentSource.healthyTitle"),className:`mt-0.5 flex items-center gap-1 truncate text-xs ${k?"text-warning":"text-muted-foreground"}`,children:[k?(0,d.jsx)(e0.A,{className:"w-3 h-3 shrink-0","aria-hidden":"true"}):(0,d.jsx)(e1,{className:"w-3 h-3 shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:j})]}),m.map(a=>(0,d.jsxs)("span",{"data-testid":`agent-instance-relay-${a.tone}-${c.id}`,title:t(`relay.${a.titleKey}`),className:`mt-0.5 flex items-center gap-1 truncate text-xs ${fx(a)}`,children:[(0,d.jsx)(e2.A,{className:"w-3 h-3 shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:t(`relay.${a.key}`,a.params)})]},a.key))]}),(0,d.jsx)("button",{type:"button","data-testid":`agent-instance-cli-${c.id}`,"aria-label":t("cliCommands.open"),title:t("cliCommands.open"),onClick:()=>K(c.id),className:"shrink-0 p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted",children:(0,d.jsx)(e3.A,{className:"w-4 h-4"})}),J===c.id&&(0,d.jsx)(fe,{worktreeId:a,instance:c,isOpen:!0,onClose:()=>K(null)}),(0,d.jsxs)(an.rI,{children:[(0,d.jsx)(an.ty,{asChild:!0,children:(0,d.jsx)("button",{type:"button","data-testid":`agent-instance-menu-${c.id}`,"aria-label":p("agentInstanceActions"),title:p("agentInstanceActions"),disabled:v,className:"shrink-0 p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-30 disabled:cursor-not-allowed",children:(0,d.jsx)(e4,{className:"w-4 h-4"})})}),(0,d.jsxs)(an.SQ,{align:"end",children:[!o&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(an._2,{"data-testid":`agent-instance-delegate-${c.id}`,onSelect:()=>{L(c)},children:[(0,d.jsx)(e5.A,{className:"w-4 h-4"}),fg.yW["ja"===q?"ja":"en"].menuItem]}),(0,d.jsx)(an.mB,{})]}),(0,d.jsxs)(an._2,{"data-testid":`agent-instance-move-up-${c.id}`,disabled:0===e,onSelect:()=>ad(e,-1),children:[(0,d.jsx)(d$.A,{className:"w-4 h-4"}),p("agentInstanceMoveUp")]}),(0,d.jsxs)(an._2,{"data-testid":`agent-instance-move-down-${c.id}`,disabled:e===b.length-1,onSelect:()=>ad(e,1),children:[(0,d.jsx)(aj.A,{className:"w-4 h-4"}),p("agentInstanceMoveDown")]}),(0,d.jsx)(an.mB,{}),(0,d.jsxs)(an._2,{"data-testid":`agent-instance-delete-${c.id}`,disabled:Q,onSelect:()=>{ab(c.id)},className:"text-danger-foreground focus:text-danger-foreground",children:[(0,d.jsx)(dz,{className:"w-4 h-4"}),p("agentInstanceDelete")]})]})]})]},c.id)})}),(0,d.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,d.jsx)("select",{"data-testid":"agent-instance-add-tool","aria-label":p("agentInstanceBaseTool"),value:B,disabled:v||P,onChange:a=>C(a.target.value),className:"flex-1 min-w-0 text-sm border border-input rounded-md px-2 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:al.XH.map(a=>(0,d.jsx)("option",{value:a,children:(0,al.oo)(a)},a))}),(0,d.jsxs)("button",{type:"button","data-testid":"agent-instance-add",disabled:v||P,onClick:aa,className:"flex items-center gap-1 text-sm font-medium px-3 py-2 rounded-md border border-accent-200 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300 hover:bg-accent-100 dark:hover:bg-accent-900/50 disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:[(0,d.jsx)(bJ.A,{className:"w-4 h-4"}),p("agentInstanceAdd")]})]}),P&&(0,d.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:p("agentInstanceMax",{max:al.Ab})}),Q&&(0,d.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:p("agentInstanceMin",{min:1})}),v&&(0,d.jsxs)("div",{"data-testid":"agent-instances-loading",className:"mt-3 flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(j.y,{size:"xs",variant:"muted"}),p("loading")]}),x&&(0,d.jsx)("p",{"data-testid":"agent-instances-error",className:"mt-3 text-xs text-danger-foreground",children:x}),R&&(0,d.jsx)(eU,{worktreeId:a,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:k}),(0,d.jsxs)("div",{className:"mt-6 border-t border-border pt-4",children:[(0,d.jsxs)("button",{type:"button","data-testid":"agent-defaults-toggle","aria-expanded":H,onClick:Y,className:"flex w-full items-center gap-1 text-left text-sm font-semibold text-foreground hover:text-accent-600 dark:hover:text-accent-400",children:[H?(0,d.jsx)(aj.A,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}):(0,d.jsx)(e6.A,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),p("agentDefaults")]}),H&&(0,d.jsxs)("div",{className:"mt-2 space-y-3","data-testid":"agent-defaults-section",children:[(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:p("agentDefaultsDescription")}),(0,d.jsx)("p",{"data-testid":"agent-defaults-roster",className:"text-xs font-medium text-foreground break-words",children:S.map(a=>(0,al.oo)(a)).join(" → ")}),!U&&(0,d.jsx)("p",{"data-testid":"agent-defaults-invalid",className:"text-xs text-warning-foreground",children:p("agentDefaultsInvalidRoster",{min:e9.eu,max:e9.Wj})}),(0,d.jsx)("button",{type:"button","data-testid":"agent-defaults-set-default",disabled:V||!U,onClick:()=>{T.saveAsDefault()},className:"w-full text-sm font-medium px-3 py-2 rounded-md border border-accent-200 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300 hover:bg-accent-100 dark:hover:bg-accent-900/50 disabled:opacity-40 disabled:cursor-not-allowed",children:p("agentDefaultsSetDefault")}),(0,d.jsxs)("div",{className:"space-y-1",children:[T.repositoryName&&(0,d.jsx)("p",{"data-testid":"agent-defaults-repository","data-repository":T.repositoryName,className:"text-xs text-muted-foreground",children:p("agentDefaultsRepositoryLabel",{repository:T.repositoryName})}),T.repoDeclaresAgents&&(0,d.jsx)("p",{"data-testid":"agent-defaults-repo-declared",className:"text-xs text-warning-foreground",children:p("agentDefaultsRepoDeclared")}),!T.repoDeclaresAgents&&(0,d.jsx)("span",{"data-testid":"agent-defaults-eligible","data-count":T.eligible??void 0,className:"block text-xs text-muted-foreground",children:null===T.eligible?p("agentDefaultsEligibleUnknown"):p("agentDefaultsEligible",{count:T.eligible})}),(0,d.jsx)("button",{type:"button","data-testid":"agent-defaults-apply",disabled:V||!W,onClick:()=>{Z()},className:"w-full text-sm font-medium px-3 py-2 rounded-md border border-border bg-surface text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed",children:p("agentDefaultsApply")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:p("agentDefaultsApplyScope")})]}),T.savedDefault&&(0,d.jsxs)("p",{"data-testid":"agent-defaults-saved",className:"flex items-center gap-1 text-xs text-success-foreground",children:[(0,d.jsx)(a9.A,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),p("agentDefaultsSaved")]}),null!==T.appliedCount&&(0,d.jsxs)("p",{"data-testid":"agent-defaults-applied","data-count":T.appliedCount,className:"flex items-center gap-1 text-xs text-success-foreground",children:[(0,d.jsx)(a9.A,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),p("agentDefaultsApplied",{count:T.appliedCount})]}),X&&(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("p",{"data-testid":"agent-defaults-error",className:"text-xs text-danger-foreground",children:X}),"count"===T.error&&(0,d.jsx)("button",{type:"button","data-testid":"agent-defaults-retry",disabled:V,onClick:()=>{T.refreshEligible()},className:"text-xs font-medium underline text-accent-700 dark:text-accent-300 disabled:opacity-40 disabled:cursor-not-allowed",children:p("agentDefaultsRetry")})]})]})]}),(0,d.jsxs)("div",{className:"mt-6 border-t border-border pt-4",children:[(0,d.jsxs)("button",{type:"button","data-testid":"agent-updates-toggle","aria-expanded":F,onClick:()=>G(a=>!a),className:"flex w-full items-center gap-1 text-left text-sm font-semibold text-foreground hover:text-accent-600 dark:hover:text-accent-400",children:[F?(0,d.jsx)(aj.A,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}):(0,d.jsx)(e6.A,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),s("agentUpdates.title")]}),F&&(0,d.jsx)("div",{className:"mt-2",children:(0,d.jsx)(ff.uN,{worktreeId:a,instances:b.map(a=>({id:a.id,cliTool:a.cliTool,alias:a.alias})),variant:"plain"})})]})]})}),fz=(0,e.memo)(function({worktreeId:a,instances:b,onInstancesChange:c,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:j,visibleInstanceIds:l,onToggleInstanceVisible:m,modelByInstance:n,sourceByInstance:o,composerTargetInstanceId:p}){let q=(0,h.c)("schedule"),r=(0,h.c)("worktree"),s=new Set(l),t=l.length<=1,u=(0,e7.UI)(a),v=(0,e.useCallback)(c=>c.worktreeId!==a?`${c.instanceId} @ ${c.worktreeId}`:b.find(a=>a.id===c.instanceId)?.alias??c.instanceId,[b,a]);return(0,d.jsxs)("div",{"data-testid":"mobile-agent-instances-pane",children:[(0,d.jsx)(fy,{worktreeId:a,instances:b,onInstancesChange:c,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:j,modelByInstance:n,sourceByInstance:o,composerTargetInstanceId:p}),(0,d.jsxs)("div",{"data-testid":"mobile-visible-instances",className:"px-4 pb-4 border-t border-border mt-2 pt-4",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-1",children:q("mobileVisibleInstances")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:q("mobileVisibleInstancesDescription")}),(0,d.jsx)("div",{className:"space-y-1",children:b.map(a=>{let b=s.has(a.id),c=b&&t,e=n?.[a.id]??null,f=(0,e8.g)({owed:u.owedBy(a.id),awaiting:u.awaitedBy(a.id),aliasOf:v});return(0,d.jsxs)("label",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer ${c?"opacity-60 cursor-not-allowed":"hover:bg-muted"}`,children:[(0,d.jsx)(k.Sc,{"data-testid":`mobile-visible-instance-toggle-${a.id}`,checked:b,disabled:c,onCheckedChange:()=>m(a.id)}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"block text-sm font-medium text-foreground truncate",children:(0,al.sw)(a)}),(0,d.jsx)("span",{className:"block text-xs text-muted-foreground truncate",children:(0,al.oo)(a.cliTool)}),e&&(0,d.jsx)("span",{"data-testid":`mobile-visible-instance-model-${a.id}`,title:r("agentModel.modelLabel",{model:e}),className:"block text-xs text-muted-foreground truncate",children:e}),f.map(b=>(0,d.jsx)("span",{"data-testid":`mobile-visible-instance-relay-${b.tone}-${a.id}`,title:r(`relay.${b.titleKey}`),className:`block text-xs truncate ${fx(b)}`,children:r(`relay.${b.key}`,b.params)},b.key))]})]},a.id)})}),t&&(0,d.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:q("mobileVisibleInstanceMin")})]})]})}),fA=Array.from({length:Math.floor(104)+1},(a,b)=>3e5+3e5*b);var fB=c(10063);function fC(a){let b=Math.floor(a/6e4),c=Math.floor(b/60),d=b%60;return c>0&&d>0?`${c}h ${d}m`:c>0?`${c}h`:`${d}m`}let fD="w-full px-3 py-2 text-sm border border-input rounded-md bg-surface dark:bg-surface-2 text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring";function fE({isOpen:a,worktreeId:b,instances:c,onClose:f,onSaved:g}){let i=(0,h.c)("schedule"),j=(0,dV.a)(),k=(0,e.useMemo)(()=>c&&c.length>0?c:(0,al.lu)([...al.XH]),[c]),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(()=>k[0]?.id??al.XH[0]),[p,q]=(0,e.useState)(fA[0]),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(null),v=l.trim().length>0&&!r,w=(0,e.useCallback)(async()=>{if(!l.trim()||r)return;let a=k.find(a=>a.id===n);if(a){u(null),s(!0);try{let c=await fetch(`/api/worktrees/${b}/timers`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:a.cliTool,instanceId:a.id,message:l.trim(),delayMs:p})});if(c.ok){let a=await c.json();g(),"session_not_running"===a.warning?(u("session_not_running"),m("")):f()}}catch{}finally{s(!1)}}},[b,k,n,l,p,r,g,f]),x=(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1",htmlFor:"timer-instance-select",children:i("timer.agent")}),(0,d.jsx)("select",{id:"timer-instance-select","data-testid":"timer-instance-select",value:n,onChange:a=>o(a.target.value),className:fD,children:k.map(a=>(0,d.jsx)("option",{value:a.id,children:a.alias},a.id))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1",htmlFor:"timer-message-input",children:i("timer.message")}),(0,d.jsx)("textarea",{id:"timer-message-input","data-testid":"timer-message-input",value:l,onChange:a=>m(a.target.value),placeholder:i("timer.message"),maxLength:1e4,rows:3,className:`${fD} resize-none`})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1",htmlFor:"timer-delay-select",children:i("timer.delay")}),(0,d.jsx)("select",{id:"timer-delay-select","data-testid":"timer-delay-select",value:p,onChange:a=>q(Number(a.target.value)),className:fD,children:fA.map(a=>(0,d.jsx)("option",{value:a,children:fC(a)},a))})]}),"session_not_running"===t&&(0,d.jsx)("div",{"data-testid":"timer-session-warning",className:"text-xs p-2 rounded bg-warning-subtle text-warning-foreground",children:i("timer.sessionWarning")})]}),y=(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:f,className:"px-4 py-2 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",children:i("timer.close")}),(0,d.jsx)("button",{type:"button","data-testid":"timer-register-button",onClick:()=>void w(),disabled:!v,className:"px-4 py-2 text-sm font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-md transition-colors",children:i("timer.register")})]}),z=i("timer.titleCreate");return j?(0,d.jsx)(ec,{isOpen:a,onClose:f,title:z,footer:y,children:x}):(0,d.jsx)(b_.a,{isOpen:a,onClose:f,title:z,size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[x,(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:y})]})})}function fF(a){return new Date(a).toLocaleString()}function fG({timer:a,instances:b,onClose:c}){let e=(0,h.c)("schedule"),f=(0,dV.a)();if(!a)return null;let g=b.find(b=>b.id===a.instanceId)?.alias??a.cliToolId,i=({label:a,children:b})=>(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-muted-foreground mb-0.5",children:a}),(0,d.jsx)("div",{className:"text-sm text-foreground break-words",children:b})]}),j=(0,d.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"timer-detail-body",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:e("timer.message")}),(0,d.jsx)("pre",{"data-testid":"timer-detail-message",className:"text-sm whitespace-pre-wrap break-words font-mono text-foreground bg-muted rounded p-2 max-h-60 overflow-y-auto",children:a.message})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsx)(i,{label:e("timer.agent"),children:(0,d.jsx)("span",{className:"text-accent-600 dark:text-accent-400 font-medium",children:g})}),(0,d.jsx)(i,{label:e("timer.statusLabel"),children:(0,d.jsx)("span",{className:function(a){switch(a){case"pending":return"text-info";case"sending":case"no_session":return"text-warning-foreground";case"sent":return"text-success-foreground";case"failed":return"text-danger-foreground";default:return"text-muted-foreground"}}(a.status),children:e(`timer.status.${a.status}`)})}),(0,d.jsx)(i,{label:e("timer.delay"),children:fC(a.delayMs)}),(0,d.jsx)(i,{label:e("timer.scheduledTime"),children:fF(a.scheduledSendTime)}),(0,d.jsx)(i,{label:e("timer.createdTime"),children:fF(a.createdAt)}),null!==a.sentAt&&(0,d.jsx)(i,{label:e("timer.sentTime"),children:fF(a.sentAt)})]}),"failed"===a.status&&a.error&&(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-danger-foreground mb-1",children:e("timer.failureReason")}),(0,d.jsx)("pre",{"data-testid":"timer-detail-error",className:"text-xs whitespace-pre-wrap break-words font-mono text-danger-foreground bg-danger-subtle rounded p-2 max-h-40 overflow-y-auto",children:a.error})]})]}),k=(0,d.jsx)("div",{className:"flex items-center justify-end",children:(0,d.jsx)("button",{type:"button","data-testid":"timer-detail-close",onClick:c,className:"px-4 py-2 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",children:e("timer.close")})}),l=e("timer.detailTitle");return f?(0,d.jsx)(ec,{isOpen:!0,title:l,onClose:c,footer:k,children:j}):(0,d.jsx)(b_.a,{isOpen:!0,title:l,onClose:c,size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[j,(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:k})]})})}let fH=(0,e.memo)(function({worktreeId:a,instances:b}){let c=(0,h.c)("schedule"),f=(0,a4.SC)(),g=(0,e.useMemo)(()=>b&&b.length>0?b:(0,al.lu)([...al.XH]),[b]),[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(null),[,q]=(0,e.useState)(0),r=(0,e.useRef)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useCallback)(async()=>{try{let b=await fetch(`/api/worktrees/${a}/timers`);if(b.ok){let a=await b.json();j(a.timers),l(a.hasMore??!1),a.timers.length>0?t.current=a.timers[a.timers.length-1].createdAt:t.current=null}}catch{}},[a]),v=(0,e.useCallback)(async()=>{if(null!=t.current)try{let b=new URLSearchParams;b.set("before",String(t.current)),b.set("limit",String(50));let c=await fetch(`/api/worktrees/${a}/timers?${b}`);if(c.ok){let a=await c.json();j(b=>[...b,...a.timers]),l(a.hasMore??!1),a.timers.length>0&&(t.current=a.timers[a.timers.length-1].createdAt)}}catch{}},[a]);(0,e.useEffect)(()=>{function a(){return u(),r.current=setInterval(()=>{u()},1e4),s.current=setInterval(()=>{q(a=>a+1)},1e3),b}function b(){r.current&&clearInterval(r.current),s.current&&clearInterval(s.current),r.current=null,s.current=null}a();let c=()=>{"hidden"===document.visibilityState?b():a()};return document.addEventListener("visibilitychange",c),()=>{b(),document.removeEventListener("visibilitychange",c)}},[u]);let w=(0,e.useCallback)(async b=>{try{(await fetch(`/api/worktrees/${a}/timers?timerId=${b}`,{method:"DELETE"})).ok&&u()}catch{}},[a,u]),x=(0,e.useCallback)(async()=>{if(await f({description:c("timer.clearConfirm"),variant:"danger"}))try{(await fetch(`/api/worktrees/${a}/timers/history`,{method:"DELETE"})).ok&&u()}catch{}},[a,u,c,f]),z=i.filter(a=>"pending"===a.status).length>=5;return(0,d.jsxs)("div",{className:"flex flex-col h-full p-3 gap-3 overflow-auto",children:[0===i.length?(0,d.jsxs)("div",{className:"flex flex-col items-center text-center py-8 px-4",children:[(0,d.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-accent-50 text-accent-600 dark:bg-accent-900/30 dark:text-accent-300",children:(0,d.jsx)(y,{className:"w-7 h-7"})}),(0,d.jsx)("p",{className:"font-semibold text-foreground mb-1",children:c("timer.title")}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-5 max-w-xs",children:c("timer.noTimers")}),(0,d.jsxs)("button",{type:"button","data-testid":"timer-empty-cta",onClick:()=>n(!0),className:"inline-flex items-center gap-1.5 px-5 py-2.5 text-sm font-semibold text-white bg-accent-600 hover:bg-accent-700 rounded-lg shadow-sm transition-colors",children:[(0,d.jsx)(bJ.A,{className:"w-4 h-4"}),c("timer.createButton")]})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[z&&(0,d.jsx)("span",{className:"text-xs text-warning-foreground",children:c("timer.maxReached",{max:5})}),(0,d.jsxs)("button",{type:"button","data-testid":"timer-new-button",onClick:()=>n(!0),disabled:z,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded transition-colors whitespace-nowrap",children:[(0,d.jsx)(bJ.A,{className:"w-3.5 h-3.5"}),c("timer.newTimer")]})]}),i.map(a=>(0,d.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"timer-row",onClick:()=>p(a),onKeyDown:b=>{("Enter"===b.key||" "===b.key)&&(b.preventDefault(),p(a))},className:"flex items-center gap-2 p-2 rounded-lg border border-border bg-surface text-left cursor-pointer hover:bg-muted transition-colors",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-sm text-foreground truncate",children:a.message.length>60?a.message.slice(0,60)+"...":a.message}),(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,d.jsx)("span",{className:"text-accent-600 dark:text-accent-400 font-medium",children:g.find(b=>b.id===a.instanceId)?.alias??a.cliToolId}),(0,d.jsx)("span",{className:function(a){switch(a){case"pending":return"text-info";case"sending":case"no_session":return"text-warning-foreground";case"sent":return"text-success-foreground";case"failed":return"text-danger-foreground";default:return"text-muted-foreground"}}(a.status),children:c(`timer.status.${a.status}`)}),"pending"===a.status&&(0,d.jsx)("span",{className:"text-muted-foreground",children:(0,fB.$B)(a.scheduledSendTime)}),(0,d.jsx)("span",{className:"text-muted-foreground",children:fC(a.delayMs)})]})]}),"pending"===a.status&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),w(a.id)},className:"px-2 py-1 text-xs text-danger-foreground hover:bg-danger-subtle rounded transition-colors",children:c("timer.cancel")})]},a.id)),k&&(0,d.jsx)("button",{type:"button",onClick:v,className:"px-3 py-2 text-sm text-accent-600 dark:text-accent-400 hover:bg-accent-50 dark:hover:bg-accent-900/20 rounded-md transition-colors text-center",children:c("timer.loadMore")}),i.some(a=>"pending"!==a.status)&&(0,d.jsx)("button",{type:"button",onClick:x,className:"px-3 py-2 text-sm text-muted-foreground hover:bg-muted rounded-md transition-colors text-center",children:c("timer.clearHistory")})]}),(0,d.jsx)(fE,{isOpen:m,worktreeId:a,instances:b,onClose:()=>n(!1),onSaved:()=>{u()}}),(0,d.jsx)(fG,{timer:o,instances:g,onClose:()=>p(null)})]})});var fI=c(79944),fJ=c(81136);let fK={verified:"skills.compatibility.axisOutcome.verified",unsupported:"skills.compatibility.axisOutcome.unsupported",unknown:"skills.compatibility.axisOutcome.unknown"},fL={mechanical:"skills.compatibility.evidenceKind.mechanical",self_report:"skills.compatibility.evidenceKind.selfReport",not_measured:"skills.compatibility.evidenceKind.notMeasured"},fM={outcome:"unknown",evidenceKind:"not_measured",labelKey:fK.unknown,evidenceKindKey:fL.not_measured,limitationKey:null},fN={SESSION_RESTART:"skills.compatibility.reload.sessionRestart",SESSION_RESTART_NO_SLASH:"skills.compatibility.reload.sessionRestartNoSlash",PICKED_UP_LIVE:"skills.compatibility.reload.pickedUpLive",UNKNOWN:"skills.compatibility.reload.unknown"},fO={NO_SLASH_COMMAND:"skills.compatibility.limitation.noSlashCommand"};function fP(a){return{agent:a,discoveryRoots:[],discovery:fM,invocation:fM,testedVersion:null,testedDate:null,evidenceSource:null,reloadKey:fN.UNKNOWN,skipReasonKey:"skills.compatibility.skipReason.notMeasured"}}fJ.td,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fN.SESSION_RESTART,fJ.Co,fK.verified,fL.self_report,fK.unsupported,fL.mechanical,fO.NO_SLASH_COMMAND,fN.SESSION_RESTART_NO_SLASH,fP("gemini"),fP("vibe-local"),fJ.Co,fJ.td,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fO.NO_SLASH_COMMAND,fN.SESSION_RESTART,fJ.Co,fJ.td,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fN.UNKNOWN,fP("antigravity"),fJ.Co,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fN.SESSION_RESTART,fJ.Co,fJ.td,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fO.NO_SLASH_COMMAND,fN.PICKED_UP_LIVE;let fQ={SATISFIED:"SKILL_COMPAT_SATISFIED",HOST_VERSION_OUT_OF_RANGE:"SKILL_COMPAT_HOST_VERSION_OUT_OF_RANGE",HOST_VERSION_UNKNOWN:"SKILL_COMPAT_HOST_VERSION_UNKNOWN",RANGE_UNSUPPORTED:"SKILL_COMPAT_RANGE_UNSUPPORTED"};fQ.SATISFIED,fQ.HOST_VERSION_OUT_OF_RANGE,fQ.HOST_VERSION_UNKNOWN,fQ.RANGE_UNSUPPORTED;let fR={CONFIRMED:"SKILL_AGENT_EVIDENCE_CONFIRMED",RESTRICTED:"SKILL_AGENT_EVIDENCE_RESTRICTED",STALE_DECLARATION:"SKILL_AGENT_EVIDENCE_STALE_DECLARATION",UNVERIFIED:"SKILL_AGENT_EVIDENCE_UNVERIFIED"};fR.CONFIRMED,fR.RESTRICTED,fR.STALE_DECLARATION,fR.UNVERIFIED;let fS=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function fT(a){if("string"!=typeof a||a.length>64)return null;let b=fS.exec(a);return b?{major:Number(b[1]),minor:Number(b[2]),patch:Number(b[3]),prerelease:b[4]?b[4].split("."):[],build:b[5]?b[5].split("."):[]}:null}let fU={UP_TO_DATE:"SKILL_UPDATE_UP_TO_DATE",HIGHEST_COMPATIBLE:"SKILL_UPDATE_RECOMMEND_HIGHEST_COMPATIBLE",LATEST_UNVERIFIED:"SKILL_UPDATE_RECOMMEND_LATEST_UNVERIFIED",NONE_COMPATIBLE:"SKILL_UPDATE_RECOMMEND_NONE_COMPATIBLE",INSTALLED_VERSION_INVALID:"SKILL_UPDATE_INSTALLED_VERSION_INVALID",RANGE_UNSUPPORTED:"SKILL_UPDATE_RANGE_UNSUPPORTED"};function fV(a,b){let c=function(a,b){let c=fT(a),d=fT(b);return c&&d?c.major!==d.major?c.major<d.major?-1:1:c.minor!==d.minor?c.minor<d.minor?-1:1:c.patch!==d.patch?c.patch<d.patch?-1:1:function(a,b){if(0===a.length&&0===b.length)return 0;if(0===a.length)return 1;if(0===b.length)return -1;let c=Math.min(a.length,b.length);for(let d=0;d<c;d++){let c=a[d],e=b[d];if(c===e)continue;let f=/^\d+$/.test(c),g=/^\d+$/.test(e);if(f&&g)return Number(c)<Number(e)?-1:1;if(f)return -1;if(g)return 1;return c<e?-1:1}return a.length===b.length?0:a.length<b.length?-1:1}(c.prerelease,d.prerelease):null}(a,b);return null!==c&&c>0}fU.UP_TO_DATE,fU.HIGHEST_COMPATIBLE,fU.LATEST_UNVERIFIED,fU.NONE_COMPATIBLE,fU.INSTALLED_VERSION_INVALID,fU.RANGE_UNSUPPORTED;var fW=c(28593),fX=c(9815),fY=c(3805),fZ=c(27884),f$=c(30156);let f_={open:!1,selectedVersion:null,busy:!1,plan:null,failure:null,riskAcknowledged:!1,riskIncreaseAcknowledged:!1,applying:!1,applyResult:null,applyFailure:null};function f0({heading:a,paths:b,testid:c}){return 0===b.length?null:(0,d.jsxs)("div",{"data-testid":c,children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a}),(0,d.jsx)("ul",{className:"mt-1 space-y-0.5",children:b.map(a=>(0,d.jsx)("li",{className:"break-all font-mono text-xs text-foreground",children:a},a))})]})}function f1({skillId:a,skillName:b,worktreeId:c,installedVersion:f,versions:g}){let i=(0,h.c)("skills"),j=(0,e.useMemo)(()=>g.filter(a=>fV(a.version,f)),[g,f]),l=(0,e.useMemo)(()=>(j.find(a=>"compatible"===a.compatibility.commandmate.status)??j[0])?.version??null,[j]),[m,n]=(0,e.useState)(f_),o=(0,e.useCallback)(()=>{n({...f_,open:!0,selectedVersion:l})},[l]),p=(0,e.useCallback)(()=>{n(f_)},[]),q=(0,e.useCallback)(async()=>{let b=m.selectedVersion;if(!b)return;n(a=>({...a,busy:!0,plan:null,failure:null,riskAcknowledged:!1,riskIncreaseAcknowledged:!1,applyResult:null,applyFailure:null}));let d=await (0,f$.Sw)(c,a,{version:b});n(a=>({...a,busy:!1,plan:d.ok?d.data.plan:null,failure:d.ok?null:d.failure}))},[a,m.selectedVersion,c]),r=(0,e.useCallback)(async()=>{var b;let d=m.plan;if(!d||!d.updatable)return;n(a=>({...a,applying:!0,applyFailure:null}));let e=await (0,f$.h2)(c,a,{planToken:d.token,version:d.update.toVersion,acknowledgeRisk:m.riskAcknowledged,acknowledgeRiskIncrease:m.riskIncreaseAcknowledged,idempotencyKey:(b=d.token,`skill-update-${b}`)});n(a=>({...a,applying:!1,applyResult:e.ok?e.data:null,applyFailure:e.ok?null:e.failure}))},[a,m.plan,m.riskAcknowledged,m.riskIncreaseAcknowledged,c]);if(0===j.length)return(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-update-uptodate",children:i("update.upToDate",{version:f})});let s=m.plan,t=m.applyResult;return(0,d.jsxs)("div",{"data-testid":"skill-update-dialog-host",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(k.Ex,{variant:"info","data-testid":"skill-update-badge",children:i("update.badge")}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:i("update.fromTo",{from:f,to:j[0].version})}),(0,d.jsx)(k.$n,{variant:"secondary",size:"sm",onClick:o,"data-testid":"skill-update-trigger",children:i("update.open")})]}),(0,d.jsx)(k.Jh,{isOpen:m.open,onClose:p,title:i("update.heading"),size:"lg",children:(0,d.jsxs)("div",{className:"space-y-3 p-4","data-testid":"skill-update-dialog",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:i("update.intro",{skill:b,version:f})}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:i("update.ready")}),(0,d.jsxs)("label",{className:"block text-xs font-medium text-muted-foreground",children:[i("update.versionPicker"),(0,d.jsx)("select",{className:"w-full rounded-md border border-input bg-surface px-3 py-2 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring mt-1",value:m.selectedVersion??"",onChange:a=>n(b=>({...b,selectedVersion:a.target.value,plan:null,failure:null})),disabled:m.busy,"data-testid":"skill-update-version-select",children:j.map(a=>(0,d.jsxs)("option",{value:a.version,children:[a.version,a.prerelease?` (${i("detail.prerelease")})`:"","compatible"!==a.compatibility.commandmate.status?` — ${i(fZ.OV[a.compatibility.commandmate.status])}`:""]},a.version))})]}),(0,d.jsx)(k.$n,{variant:"primary",disabled:m.busy||!m.selectedVersion,onClick:q,"data-testid":"skill-update-build",children:m.busy?i("update.building"):i("update.build")}),m.failure&&(0,d.jsxs)(fY.u,{tone:"danger","data-testid":"skill-update-error",children:[(0,d.jsx)("p",{children:i((0,fZ.FW)(m.failure.code))}),(0,d.jsx)("p",{className:"mt-1 break-words",children:i("state.errorCode",{code:m.failure.code})})]}),s&&(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-update-plan",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-semibold text-foreground",children:i("update.fromTo",{from:s.update.fromVersion,to:s.update.toVersion})}),null!==s.update.latestVersion&&s.update.latestVersion!==s.update.toVersion&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:i("update.latestAvailable",{version:s.update.latestVersion})})]}),(0,d.jsx)(fY.u,{tone:s.updatable?"info":"warning","data-testid":"skill-update-next-action",children:i((0,fZ.e5)(s.nextActionKey))}),s.blockers.length>0&&(0,d.jsx)("ul",{className:"space-y-1","data-testid":"skill-update-blockers",children:s.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),i((0,fZ.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))}),(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-update-risk",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("plan.riskHeading")}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-foreground",children:[(0,d.jsx)(fW.qW,{risk:s.securityDiff.risk.from.effective}),(0,d.jsx)("span",{"aria-hidden":"true",children:"→"}),(0,d.jsx)(fW.qW,{risk:s.securityDiff.risk.to.effective})]}),s.riskIncreased&&s.riskIncreaseMessageKey&&(0,d.jsx)(fY.u,{tone:"danger","data-testid":"skill-update-risk-increase",children:i((0,fZ.e5)(s.riskIncreaseMessageKey))}),s.requiresRiskAcknowledgement&&s.riskAcknowledgementMessageKey&&(0,d.jsx)(fY.u,{tone:"warning","data-testid":"skill-update-high-risk",children:i((0,fZ.e5)(s.riskAcknowledgementMessageKey))}),s.updatable&&!m.applyResult&&s.requiresRiskAcknowledgement&&(0,d.jsxs)("label",{className:"flex items-start gap-2 text-xs text-foreground",children:[(0,d.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:m.riskAcknowledged,onChange:a=>n(b=>({...b,riskAcknowledged:a.target.checked})),"data-testid":"skill-update-ack-risk"}),i("update.ackRisk")]}),s.updatable&&!m.applyResult&&s.riskIncreased&&(0,d.jsxs)("label",{className:"flex items-start gap-2 text-xs text-foreground",children:[(0,d.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:m.riskIncreaseAcknowledged,onChange:a=>n(b=>({...b,riskIncreaseAcknowledged:a.target.checked})),"data-testid":"skill-update-ack-risk-increase"}),i("update.ackRiskIncrease")]})]}),(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-update-security-diff",children:[s.securityDiff.permissions.added.length>0&&(0,d.jsxs)("div",{"data-testid":"skill-update-permissions-added",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("update.permissionsAdded")}),(0,d.jsx)("ul",{className:"mt-1 space-y-0.5",children:s.securityDiff.permissions.added.map(a=>(0,d.jsx)("li",{className:"text-xs text-foreground",children:i(fZ.z2[a]??"plan.permissionsNone")},a))})]}),s.securityDiff.permissions.removed.length>0&&(0,d.jsxs)("div",{"data-testid":"skill-update-permissions-removed",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("update.permissionsRemoved")}),(0,d.jsx)("ul",{className:"mt-1 space-y-0.5",children:s.securityDiff.permissions.removed.map(a=>(0,d.jsx)("li",{className:"text-xs text-foreground",children:i(fZ.z2[a]??"plan.permissionsNone")},a))})]}),(0,d.jsx)(f0,{heading:i("update.scriptsAdded"),paths:s.securityDiff.scripts.added,testid:"skill-update-scripts-added"}),(0,d.jsx)(f0,{heading:i("update.scriptsRemoved"),paths:s.securityDiff.scripts.removed,testid:"skill-update-scripts-removed"}),(0,d.jsx)(f0,{heading:i("update.executablesAdded"),paths:s.securityDiff.executables.added,testid:"skill-update-executables-added"}),(0,d.jsx)(f0,{heading:i("update.executablesRemoved"),paths:s.securityDiff.executables.removed,testid:"skill-update-executables-removed"})]}),s.securityDiff.changelogs.length>0&&(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-update-changelogs",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("detail.changelogHeading")}),s.securityDiff.changelogs.map(a=>(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-foreground",children:a.version}),(0,d.jsx)("p",{className:"whitespace-pre-wrap text-xs text-muted-foreground",children:a.changelog})]},a.version))]}),(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-update-files",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("update.filesHeading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-update-stats",children:i("update.stats",{added:s.stats.added,updated:s.stats.updated,removed:s.stats.removed,unchanged:s.stats.unchanged})}),(0,d.jsx)("ul",{className:"space-y-1",children:s.files.filter(a=>"unchanged"!==a.change).map(a=>(0,d.jsxs)("li",{"data-testid":"skill-update-file",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(k.Ex,{variant:fZ.JD[a.change]??"gray",children:i(fZ.KS[a.change]??"update.change.update")}),(0,d.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:a.path})]}),a.diff&&(0,d.jsxs)("details",{className:"mt-1",children:[(0,d.jsx)("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:i("update.showDiff")}),(0,d.jsx)("pre",{className:"mt-1 overflow-x-auto rounded-md bg-muted p-2 text-xs text-foreground",children:a.diff})]})]},a.path))})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-update-expiry",children:i("plan.expiresAt",{timestamp:s.expiresAt})}),s.updatable&&!m.applyResult&&(0,d.jsx)(k.$n,{variant:"primary",disabled:m.applying||s.requiresRiskAcknowledgement&&!m.riskAcknowledged||s.riskIncreased&&!m.riskIncreaseAcknowledged,onClick:r,"data-testid":"skill-update-apply",children:m.applying?i("update.applying"):i("update.apply")}),m.applyFailure&&(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-update-apply-error",children:[(0,d.jsxs)(fY.u,{tone:"danger",children:[(0,d.jsx)("p",{children:i((0,fZ.FW)(m.applyFailure.code))}),(0,d.jsx)("p",{className:"mt-1 break-words",children:i("state.errorCode",{code:m.applyFailure.code})})]}),m.applyFailure.nextActionKey&&(0,d.jsx)(fY.u,{tone:"warning",children:i((0,fZ.e5)(m.applyFailure.nextActionKey))}),m.applyFailure.blockers&&m.applyFailure.blockers.length>0&&(0,d.jsx)("ul",{className:"space-y-1","data-testid":"skill-update-apply-error-blockers",children:m.applyFailure.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),i((0,fZ.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))})]})]}),t&&(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-update-result",children:[(0,d.jsx)(fY.u,{tone:"succeeded"===t.operation.result?"info":"warning","data-testid":"skill-update-result-next-action",children:i((0,fZ.e5)(t.operation.nextActionKey))}),"reload"in t&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-foreground",children:i("update.fromTo",{from:t.update.fromVersion,to:t.update.toVersion})}),(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-update-result-reload",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("operation.reloadHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:t.reload.agents.map(a=>(0,d.jsx)("li",{className:"text-xs text-muted-foreground",children:i((0,fZ.e5)(a.messageKey),{agent:(0,al.f_)(a.agent),skillId:t.reload.skillId,version:t.reload.version})},a.agent))})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-update-result-rollback",children:i((0,fZ.e5)(t.rollback.messageKey),{version:t.rollback.backup.fromVersion})})]})]})]})})]})}let f2={status:"loading",skills:[],failure:null},f3={status:"loading",skills:[],failure:null};function f4({worktreeId:a,className:b=""}){let c=(0,h.c)("skills"),[f,g]=(0,e.useState)(f2),[i,j]=(0,e.useState)(f3),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(0),[p,q]=(0,e.useState)(0),r=(0,e.useMemo)(()=>new Map(i.skills.map(a=>[a.skillId,a.version])),[i.skills]),s=(0,e.useMemo)(()=>new Map(f.skills.map(a=>[a.id,{name:a.name,summary:a.summary,latest:a.latest}])),[f.skills]),t=(0,e.useMemo)(()=>{let a=new Map;for(let[c,d]of r){var b;a.set(c,(b=s.get(c)?.latest??null,null!==d&&null!==b&&fV(b,d)))}return a},[r,s]),u=(0,e.useMemo)(()=>f.skills.find(a=>a.id===l)??null,[f.skills,l]),v=(0,e.useMemo)(()=>i.skills.find(a=>a.skillId===l)??null,[i.skills,l]);if(l){let e=u?.compatibility??null,f=u?u.recommendedVersion:v?.version??null,g=u?u.recommendedVersion?e&&"compatible"!==e.status?c("detail.install.blockedIncompatible",{reason:c((0,fZ.e5)(e.messageKey),{range:e.requiredRange,currentVersion:e.currentVersion??""})}):null:c("detail.install.blockedNoVersion"):null;return(0,d.jsxs)("div",{className:`flex flex-col min-h-0 ${b}`.trim(),"data-testid":"worktree-skills-pane",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b border-border p-3",children:[(0,d.jsxs)(k.$n,{variant:"ghost",size:"sm",onClick:()=>{m(null),q(a=>a+1)},"data-testid":"worktree-skills-back",children:[(0,d.jsx)(fI.A,{size:14,"aria-hidden":"true",className:"mr-1"}),c("worktreePane.back")]}),(0,d.jsx)("h2",{className:"min-w-0 truncate text-sm font-semibold text-foreground",children:u?.name??l})]}),(0,d.jsxs)("div",{className:"min-h-0 flex-1 space-y-3 overflow-auto p-3",children:[v&&u&&(0,d.jsx)(f1,{skillId:l,skillName:u.name,worktreeId:a,installedVersion:v.version,versions:u.versions}),(0,d.jsx)(fX.B,{skillId:l,version:f,blockedReason:g,worktreeId:a})]})]})}return(0,d.jsx)("div",{className:`flex flex-col min-h-0 ${b}`.trim(),"data-testid":"worktree-skills-pane",children:(0,d.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-auto p-3",children:[(0,d.jsxs)("section",{className:"space-y-2","data-testid":"worktree-skills-installed",children:[(0,d.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:c("worktreePane.installedHeading")}),"loading"===i.status?(0,d.jsx)(k.EA,{className:"h-16 w-full rounded-lg","data-testid":"worktree-skills-installed-loading"}):"error"===i.status?(0,d.jsxs)(k.Zp,{className:"space-y-2","data-testid":"worktree-skills-installed-error",children:[(0,d.jsxs)(fY.u,{tone:"danger",children:[(0,d.jsx)("p",{children:c("worktreePane.installedError")}),(0,d.jsx)("p",{className:"mt-1 break-words",children:c("state.errorCode",{code:i.failure?.code??""})})]}),(0,d.jsx)(k.$n,{variant:"secondary",size:"sm",onClick:()=>q(a=>a+1),"data-testid":"worktree-skills-installed-retry",children:c("state.retry")})]}):0===i.skills.length?(0,d.jsx)(k.Zp,{"data-testid":"worktree-skills-installed-empty",children:(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:c("worktreePane.installedEmpty")})}):(0,d.jsx)("ul",{className:"space-y-2",children:i.skills.map(a=>{let b=s.get(a.skillId);return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>m(a.skillId),"data-testid":`worktree-skills-installed-${a.skillId}`,className:"w-full rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"break-all text-sm font-semibold text-foreground",children:b?.name??a.skillId}),(0,d.jsx)(fW.qW,{risk:a.effectiveRisk}),t.get(a.skillId)&&(0,d.jsx)(k.Ex,{variant:"info","data-testid":`worktree-skills-update-badge-${a.skillId}`,children:c("worktreePane.updateBadge")})]}),b?.summary&&(0,d.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-2","data-testid":`worktree-skills-installed-summary-${a.skillId}`,children:b.summary}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:c("worktreePane.version",{version:a.version})})]})},a.skillId)})})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"worktree-skills-catalog",children:[(0,d.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:c("worktreePane.catalogHeading")}),"loading"===f.status?(0,d.jsx)(k.EA,{className:"h-24 w-full rounded-lg","data-testid":"worktree-skills-catalog-loading"}):"error"===f.status?(0,d.jsxs)(k.Zp,{className:"space-y-2","data-testid":"worktree-skills-catalog-error",children:[(0,d.jsxs)(fY.u,{tone:"danger",children:[(0,d.jsx)("p",{children:c("state.errorNotice")}),(0,d.jsx)("p",{className:"mt-1 break-words",children:c("state.errorCode",{code:f.failure?.code??""})})]}),(0,d.jsx)(k.$n,{variant:"secondary",size:"sm",onClick:()=>o(a=>a+1),"data-testid":"worktree-skills-catalog-retry",children:c("state.retry")})]}):0===f.skills.length?(0,d.jsx)(k.Zp,{"data-testid":"worktree-skills-catalog-empty",children:(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:c("state.empty")})}):(0,d.jsx)("ul",{className:"space-y-2",children:f.skills.map(a=>{let b=(0,fZ.gh)(a),e=r.has(a.id),f=!0===t.get(a.id);return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>m(a.id),"data-testid":`worktree-skills-catalog-${a.id}`,className:"w-full rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"min-w-0 break-all text-sm font-semibold text-foreground",children:a.name}),e&&(f?(0,d.jsx)(k.Ex,{variant:"info","data-testid":`worktree-skills-catalog-update-badge-${a.id}`,children:c("worktreePane.updateBadge")}):(0,d.jsx)(k.Ex,{variant:"info","data-testid":`worktree-skills-installed-badge-${a.id}`,children:c("worktreePane.installedBadge")}))]}),(0,d.jsx)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:c("card.provider",{provider:a.provider.name})}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground","data-testid":`worktree-skills-catalog-version-${a.id}`,children:c("worktreePane.version",{version:a.latest})}),a.summary&&(0,d.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2","data-testid":`worktree-skills-catalog-summary-${a.id}`,children:a.summary}),(0,d.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[a.compatibility&&(0,d.jsx)(fW.Xz,{status:a.compatibility.status}),b&&(0,d.jsx)(fW.qW,{risk:b})]})]})},a.id)})})]})]})})}let f5=(0,x.A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var f6=c(80755),f7=c(95779);let f8={pending:"gray",running:"info",waiting_input:"warning",verifying:"info",succeeded:"success",failed:"error",not_started:"warning",cancelled:"gray"},f9={running:"info",passed:"success",failed:"error",not_started:"warning",error:"error",cancelled:"gray"},ga={running:"info",passed:"success",failed:"error",timeout:"error",skipped:"gray",error:"error"},gb=["failed","timeout","error"],gc=`${bU}/blob/main/docs/design/verification-config.md`,gd=".commandmate/verify.yaml";class ge extends Error{constructor(a,b,c=null){super(a),this.name="VerificationApiError",this.status=b,this.runningRunId=c}}async function gf(a,b){let c=await a.json().catch(()=>({})),d="string"==typeof c.error?c.error:`${b} (${a.status})`,e="number"==typeof c.runningRunId?c.runningRunId:null;throw new ge(d,a.status,e)}function gg(a){return`/api/worktrees/${encodeURIComponent(a)}`}async function gh(a,b={}){let c=await fetch(`${gg(a)}/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok)return gf(c,"Failed to start verification");let d=await c.json();if("number"!=typeof d.runId)throw new ge("Verification response carried no run id",c.status);return d.runId}async function gi(a){let b=await fetch(`${gg(a)}/verify/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!b.ok)return gf(b,"Failed to draft the verification config");let c=await b.json();return{created:!0===c.created,path:"string"==typeof c.path?c.path:gd,gates:c.gates??[],excluded:c.excluded??[],scanned:c.scanned??[]}}async function gj(a,b){let c=await fetch(`${gg(a)}/verify/runs/${b}/cancel`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!c.ok)return gf(c,"Failed to cancel the verification run");let d=await c.json();return{runId:"number"==typeof d.runId?d.runId:b,status:d.status??"cancelled"}}let gk={running:null,passed:0,failed:20,not_started:21,error:99,cancelled:99},gl=["passed","failed","not_started","error","cancelled"],gm={"work-evidence":"workEvidence",scope:"scope","env-clean":"envClean",config:"config"},gn={mutex:"reason=mutex-wait",detachedContract:"was NOT judged",noContract:"no contract is attached to this run",notRequired:"success.requireScopeClean: false"};var go=c(93467);function gp(a){if(!a)return"—";let b=new Date(a);return Number.isNaN(b.getTime())?a:b.toLocaleString()}function gq({heading:a,action:b,children:c,testId:e}){return(0,d.jsxs)("section",{className:"border-b border-border px-3 py-3 last:border-b-0","data-testid":e,children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,d.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a}),b]}),c]})}function gr({label:a,children:b}){return(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:a}),(0,d.jsx)("span",{className:"min-w-0 break-words text-xs text-foreground",children:b})]})}function gs({task:a}){let b=(0,h.c)("worktree"),c=a.contract,e=c.goal??"",f=e.length>240?`${e.slice(0,240)}…`:e;return(0,d.jsxs)("div",{className:"space-y-2","data-testid":"verification-contract",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"min-w-0 break-words text-sm font-medium text-foreground",children:c.title||a.title}),(0,d.jsx)(f6.E,{variant:f8[a.status],"data-testid":"verification-task-status",children:b(`task.status.${a.status}`)})]}),(0,d.jsx)("p",{className:"whitespace-pre-wrap break-words text-xs text-muted-foreground",children:f}),(0,d.jsxs)("div",{className:"space-y-1 pt-1",children:[(0,d.jsx)(gr,{label:b("verification.contract.scopeAllow"),children:(0,d.jsx)("span",{className:"font-mono",children:c.scope.allow.join(", ")||"—"})}),c.scope.deny.length>0&&(0,d.jsx)(gr,{label:b("verification.contract.scopeDeny"),children:(0,d.jsx)("span",{className:"font-mono",children:c.scope.deny.join(", ")})}),(0,d.jsx)(gr,{label:b("verification.contract.gates"),children:(0,d.jsx)("span",{className:"font-mono",children:null===c.verify.gates?b("verification.contract.gatesAll"):c.verify.gates.join(", ")||b("verification.contract.gatesAll")})}),(0,d.jsx)(gr,{label:b("verification.contract.autoYes"),children:(0,d.jsx)("span",{className:"font-mono",children:c.autoYes.mode??b("verification.contract.autoYesUnset")})}),a.contractPath&&(0,d.jsx)(gr,{label:b("verification.contract.file"),children:(0,d.jsx)("span",{className:"font-mono",children:a.contractPath})}),(0,d.jsx)(gr,{label:b("verification.contract.updated"),children:gp(a.updatedAt)})]})]})}function gt({gate:a}){return(0,d.jsxs)("li",{className:"flex flex-col gap-0.5 rounded-md border border-border bg-surface px-2 py-1.5","data-testid":`verification-declared-gate-${a.id}`,children:[(0,d.jsx)("span",{className:"break-all font-mono text-xs font-medium text-foreground",children:a.id}),(0,d.jsx)("span",{className:"break-all font-mono text-[11px] text-muted-foreground",children:a.command})]})}function gu({children:a,testId:b,tone:c="muted"}){return(0,d.jsx)("p",{className:`whitespace-pre-line break-words ${"warning"===c?"rounded border border-warning-border bg-warning-subtle px-2 py-1 text-xs text-warning-foreground":"text-xs text-muted-foreground"}`,"data-testid":b,role:"warning"===c?"alert":void 0,children:a})}function gv({state:a}){let b=(0,h.c)("worktree"),{config:c,configError:f,phase:g,runs:i,selectedRun:j,latestRun:k}=a,l=c?.path??gd,m=(0,e.useCallback)(()=>{a.draftConfig()},[a]),n=(0,e.useCallback)(()=>{a.rerun()},[a]),o=(0,e.useCallback)(()=>{k&&a.selectRun(k.id)},[k,a]),p=(0,e.useCallback)(()=>{a.cancelRun()},[a]),q=i.find(a=>"running"===a.status)??null,r=j&&q&&j.id===q.id?j.gates:[],s=r.filter(a=>"running"!==a.status).length,t=Math.max(c?.plannedGateIds.length??0,r.length),u=q?Date.now()-new Date(q.startedAt).getTime():0;return(0,d.jsxs)("section",{className:"space-y-2 border-b border-border px-3 py-3","data-testid":"verification-onboarding","data-phase":g,children:[(0,d.jsx)(gu,{testId:"verification-onboarding-what",children:b("verification.onboarding.what",{path:l})}),(0,d.jsx)(gu,{testId:"verification-onboarding-how",children:b("verification.onboarding.how")}),null!==f&&(0,d.jsx)(gu,{tone:"warning",testId:"verification-config-error",children:b("verification.onboarding.configError",{message:f})}),c?.error!=null&&(0,d.jsx)(gu,{tone:"warning",testId:"verification-config-invalid",children:b("verification.onboarding.invalid",{path:l,message:c.error})}),"unknown"===g&&(0,d.jsx)(gu,{testId:"verification-onboarding-unknown",children:b("verification.onboarding.loading")}),"no-config"===g&&(0,d.jsxs)("div",{className:"space-y-2","data-testid":"verification-onboarding-no-config",children:[(0,d.jsx)(gu,{children:b("verification.onboarding.noConfig.body",{path:l})}),(0,d.jsx)(gu,{children:b("verification.onboarding.noConfig.hint")}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"primary",onClick:m,disabled:a.draftPending,"data-testid":"verification-draft-button",children:b(a.draftPending?"verification.onboarding.noConfig.pending":"verification.onboarding.noConfig.action")}),(0,d.jsxs)("a",{href:gc,target:"_blank",rel:"noreferrer noopener","data-testid":"verification-docs-link",className:"inline-flex items-center gap-1 rounded text-xs font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:[b("verification.onboarding.noConfig.docs"),(0,d.jsx)(f5,{size:12,"aria-hidden":"true"})]})]}),a.draftFailure&&(0,d.jsx)(gu,{tone:"warning",testId:"verification-draft-failure",children:"conflict"===a.draftFailure.kind?b("verification.onboarding.noConfig.conflict",{path:l}):"empty"===a.draftFailure.kind?b("verification.onboarding.noConfig.empty",{path:l}):b("verification.onboarding.noConfig.error",{message:a.draftFailure.message})})]}),"configured"===g&&(0,d.jsxs)("div",{className:"space-y-2","data-testid":"verification-onboarding-configured",children:[(0,d.jsx)(gu,{children:b("verification.onboarding.configured.body",{path:l,count:c?.gates.length??0})}),a.draftResult?.created&&(0,d.jsx)(gu,{testId:"verification-draft-created",children:b("verification.onboarding.noConfig.created",{path:a.draftResult.path,count:a.draftResult.gates.length})}),(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("verification.onboarding.configured.gatesHeading")}),(0,d.jsx)("ul",{className:"space-y-1","data-testid":"verification-declared-gates",children:(c?.gates??[]).map(a=>(0,d.jsx)(gt,{gate:a},a.id))}),(0,d.jsx)(gu,{testId:"verification-builtin-gates",children:b("verification.onboarding.configured.builtin",{gates:(function(a){if(null===a)return[];let b=new Set(a.gates.map(a=>a.id));return a.plannedGateIds.filter(a=>!b.has(a))})(c).join(", ")})}),(0,d.jsx)(gu,{testId:"verification-builtin-gates-hint",children:b("verification.onboarding.configured.builtinHint")}),(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"primary",onClick:n,disabled:a.rerunPending,"data-testid":"verification-run-button",children:b(a.rerunPending?"verification.runs.rerunPending":"verification.onboarding.configured.action")})]}),"running"===g&&null!==q&&(0,d.jsxs)("div",{className:"space-y-1","data-testid":"verification-onboarding-running",children:[(0,d.jsx)(gu,{testId:"verification-running-progress",children:b("verification.onboarding.running.progress",{done:s,total:t})}),(0,d.jsx)(gu,{testId:"verification-running-elapsed",children:b("verification.onboarding.running.elapsed",{elapsed:(0,go.C)(u)})}),(0,d.jsx)(gu,{children:b("verification.onboarding.running.hint")}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:a.refresh,"data-testid":"verification-running-refresh-button",children:b("verification.onboarding.running.action")}),(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"danger",onClick:p,disabled:a.cancelPending,"data-testid":"verification-cancel-button",children:b(a.cancelPending?"verification.runs.cancelPending":"verification.runs.cancel")})]}),(0,d.jsx)(gu,{testId:"verification-cancel-hint",children:b("verification.runs.cancelHint")}),a.cancelSettling&&(0,d.jsx)(gu,{testId:"verification-cancel-settling",children:b("verification.runs.cancelSettling")}),a.cancelFailure&&(0,d.jsx)(gu,{tone:"warning",testId:"verification-cancel-failure",children:"gone"===a.cancelFailure.kind?b("verification.runs.cancelGone"):b("verification.runs.cancelError",{message:a.cancelFailure.message})})]}),"result"===g&&null!==k&&(0,d.jsxs)("div",{className:"space-y-2","data-testid":"verification-onboarding-result",children:[(0,d.jsx)(gu,{testId:"verification-result-body",children:b("verification.onboarding.result.body",{runId:k.id,verdict:b(`verification.runStatus.${k.status}`)})}),(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:o,"data-testid":"verification-show-latest-button",children:b("verification.onboarding.result.action")})]})]})}function gw({state:a}){let b=(0,h.c)("worktree"),[c,f]=(0,e.useState)(!1),{availableGateIds:g,selectedGateIds:i,failedGateIds:j,rerunPending:k}=a,l=(0,e.useCallback)(()=>f(a=>!a),[]),m=(0,e.useCallback)(()=>a.setGateSelection(null),[a]),n=(0,e.useCallback)(()=>{a.selectFailedGates(),f(!0)},[a]),o=(0,e.useCallback)(()=>{a.rerun()},[a]);if(0===g.length)return null;let p=i??g,q=null===i,r=g.filter(a=>j.includes(a));return(0,d.jsxs)("div",{className:"mb-2 rounded-md border border-border bg-surface-2 px-2 py-2","data-testid":"verification-gate-selector","data-selection":q?"all":p.join(","),children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground",children:b("verification.selection.heading")}),(0,d.jsx)("button",{type:"button",onClick:l,"aria-expanded":c,"data-testid":"verification-gate-selector-toggle",className:"rounded text-[11px] font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:c?b("verification.selection.close"):b("verification.selection.open")})]}),(0,d.jsx)("p",{className:"mt-0.5 break-words text-[11px] text-muted-foreground","data-testid":"verification-gate-selector-summary",children:q?b("verification.selection.all",{count:g.length}):b("verification.selection.partial",{selected:p.length,total:g.length,gates:p.join(", ")})}),c&&(0,d.jsxs)("div",{className:"mt-2 space-y-2","data-testid":"verification-gate-selector-body",children:[(0,d.jsx)("ul",{className:"space-y-1","data-testid":"verification-gate-checkboxes",children:g.map(c=>{let e=`verification-gate-select-${c}`,f=j.includes(c);return(0,d.jsxs)("li",{className:"flex items-center gap-2",children:[(0,d.jsx)(f7.S,{id:e,checked:p.includes(c),onCheckedChange:()=>a.toggleGate(c),"data-testid":e,"aria-label":b("verification.selection.gateLabel",{gateId:c})}),(0,d.jsx)("label",{htmlFor:e,className:"min-w-0 flex-1 cursor-pointer break-all font-mono text-[11px] text-foreground touch-manipulation",children:c}),f&&(0,d.jsx)(f6.E,{variant:"error",className:"flex-shrink-0",children:b("verification.gateStatus.failed")})]},c)})}),(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"primary",onClick:o,disabled:k,"data-testid":"verification-run-selected-button",children:k?b("verification.runs.rerunPending"):q?b("verification.selection.runAll"):b("verification.selection.runSelected",{count:p.length})}),(0,d.jsx)("p",{className:"break-words text-[11px] text-muted-foreground",children:b("verification.selection.hint")})]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:n,disabled:0===r.length,"data-testid":"verification-failed-only-button",children:b("verification.selection.failedOnly",{count:r.length})}),!q&&(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"ghost",onClick:m,"data-testid":"verification-select-all-button",children:b("verification.selection.selectAll")})]}),0===r.length&&(0,d.jsx)("p",{className:"mt-1 break-words text-[11px] text-muted-foreground","data-testid":"verification-failed-only-empty",children:b("verification.selection.failedOnlyEmpty")})]})}function gx({state:a}){let b=(0,h.c)("worktree"),{repositoryHistoryOpen:c,repositoryHistory:f,repositoryHistoryLoading:g,repositoryHistoryError:i}=a,j=(0,e.useCallback)(()=>{a.toggleRepositoryHistory()},[a]);return(0,d.jsxs)("div",{className:"mt-2","data-testid":"verification-repository-history",children:[(0,d.jsx)("button",{type:"button",onClick:j,"aria-expanded":c,"data-testid":"verification-repository-history-toggle",className:"rounded text-[11px] font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:b(c?"verification.runs.history.close":"verification.runs.history.open")}),c&&(0,d.jsxs)("div",{className:"mt-1 space-y-1","data-testid":"verification-repository-history-body",children:[(0,d.jsx)("p",{className:"break-words text-[11px] text-muted-foreground",children:b("verification.runs.history.hint")}),null!==i?(0,d.jsx)("p",{className:"rounded border border-warning-border bg-warning-subtle px-2 py-1 text-[11px] text-warning-foreground","data-testid":"verification-repository-history-error",role:"alert",children:b("verification.runs.history.error",{message:i})}):g&&0===f.length?(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground",children:b("verification.runs.history.loading")}):0===f.length?(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"verification-repository-history-empty",children:b("verification.runs.history.empty")}):(0,d.jsx)("ul",{className:"space-y-1","data-testid":"verification-repository-history-runs",children:f.map(a=>(0,d.jsx)(gy,{run:a},a.id))})]})]})}function gy({run:a}){let b=(0,h.c)("worktree"),c=a.status,e=a.gates.filter(a=>gb.includes(a.status)).map(a=>a.gateId);return(0,d.jsxs)("li",{className:"flex flex-col gap-0.5 rounded-md border border-border bg-surface px-2 py-1.5","data-testid":`verification-history-run-${a.id}`,children:[(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)(f6.E,{variant:f9[c],className:"flex-shrink-0",children:b(`verification.runStatus.${c}`)}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:a.worktreeId})]}),(0,d.jsxs)("span",{className:"flex flex-wrap gap-x-2 font-mono text-[11px] text-muted-foreground",children:[(0,d.jsx)("span",{children:b("verification.runs.runLabel",{runId:a.id})}),(0,d.jsx)("span",{children:gp(a.startedAt)})]}),e.length>0&&(0,d.jsx)("span",{className:"break-words text-[11px] text-muted-foreground",children:b("verification.runs.history.failingGates",{gates:e.join(", ")})})]})}function gz({gate:a,log:b,onClose:c}){let f=(0,h.c)("worktree"),[g,i]=(0,e.useState)("idle"),j=(0,e.useRef)(null),k=""===b?0:b.replace(/\n+$/,"").split("\n").length,l=""!==b.trim(),m=(0,e.useCallback)(()=>{(async()=>{try{await (0,bk.l)(b),i("done")}catch{i("failed")}null!==j.current&&clearTimeout(j.current),j.current=setTimeout(()=>i("idle"),2e3)})()},[b]);return(0,d.jsx)(b_.a,{isOpen:!0,onClose:c,size:"xl",title:f("verification.gates.fullLogTitle",{gateId:a.gateId,runId:a.runId}),children:(0,d.jsxs)("div",{className:"space-y-2","data-testid":`verification-gate-full-log-${a.gateId}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsxs)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:m,disabled:!l,"data-testid":"verification-gate-log-copy-button",children:[(0,d.jsx)(ba.A,{size:12,"aria-hidden":"true",className:"mr-1"}),f("done"===g?"verification.gates.copied":"failed"===g?"verification.gates.copyFailed":"verification.gates.copyLog")]}),(0,d.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground","data-testid":"verification-gate-log-size",children:f("verification.gates.fullLogSize",{lines:k})})]}),(0,d.jsx)("p",{className:"break-words text-[11px] text-muted-foreground",children:f("verification.gates.fullLogStored")}),""===b?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("verification.gates.noLog")}):(0,d.jsx)("pre",{className:"max-h-[60vh] overflow-auto rounded bg-terminal-surface p-2 font-mono text-[11px] leading-relaxed text-terminal-foreground",children:b})]})})}function gA({run:a,selected:b,onSelect:c}){let e=(0,h.c)("worktree"),f=e(`verification.runStatus.${a.status}`),g=e(`verification.runStatusGloss.${a.status}`),i=gk[a.status];return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>c(a.id),"aria-current":b?"true":void 0,"aria-label":e("verification.runs.select",{runId:a.id,verdict:f,gloss:g}),title:g,"data-testid":`verification-run-${a.id}`,className:`flex w-full flex-col gap-0.5 rounded-md border px-2 py-2 text-left text-xs transition-colors touch-manipulation focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${b?"border-accent-500 bg-accent-50 dark:bg-accent-900/30":"border-border bg-surface hover:bg-muted"}`,children:[(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)(f6.E,{variant:f9[a.status],className:"flex-shrink-0",children:f}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:gp(a.startedAt)})]}),(0,d.jsxs)("span",{className:"flex flex-wrap gap-x-2 font-mono text-[11px] text-muted-foreground",children:[(0,d.jsx)("span",{children:e("verification.runs.runLabel",{runId:a.id})}),(0,d.jsx)("span",{children:e("verification.runs.trigger",{trigger:a.trigger})}),null!==i&&(0,d.jsx)("span",{children:e("verification.runs.exitCode",{code:i})})]})]})})}function gB(){let a=(0,h.c)("worktree"),b=gl.map(b=>a("verification.runs.cliLegendItem",{label:a(`verification.runStatus.${b}`),code:gk[b]??0})).join(" / ");return(0,d.jsx)("p",{className:"mb-2 break-words text-[11px] text-muted-foreground","data-testid":"verification-cli-exit-legend",children:a("verification.runs.cliLegend",{items:b})})}function gC({run:a,plannedGateIds:b}){let c=(0,h.c)("worktree"),e=gk[a.status],f=a.gates.filter(a=>"skipped"===a.status),g=new Set(a.gates.map(a=>a.gateId)),i=b.filter(a=>!g.has(a));return(0,d.jsxs)("div",{className:"mb-2 space-y-1 rounded-md border border-border bg-surface-2 px-2 py-2","data-testid":"verification-run-verdict",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground",children:c("verification.gates.verdictHeading")}),(0,d.jsx)(f6.E,{variant:f9[a.status],className:"flex-shrink-0",children:c(`verification.runStatus.${a.status}`)}),null!==e&&(0,d.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:c("verification.runs.exitCode",{code:e})})]}),(0,d.jsx)("p",{className:"break-words text-xs text-muted-foreground","data-testid":"verification-run-verdict-gloss",children:c(`verification.runStatusGloss.${a.status}`)}),i.length>0&&(0,d.jsx)("p",{className:"rounded border border-warning-border bg-warning-subtle px-2 py-1 text-xs text-warning-foreground","data-testid":"verification-run-partial",children:c("verification.runs.partial",{ran:g.size,total:b.length,gates:i.join(", ")})}),f.length>0&&(0,d.jsxs)("div",{className:"space-y-0.5 pt-1","data-testid":"verification-run-skip-reasons",children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-foreground",children:c("verification.gates.skipHeading")}),(0,d.jsx)("ul",{className:"space-y-0.5",children:f.map(a=>(0,d.jsx)("li",{className:"break-words text-xs text-muted-foreground",children:c("verification.gates.skipReasonFor",{gateId:a.gateId,reason:c(`verification.gates.skipReason.${function(a){let b=a??"";return b.includes("skipped: worktreePath is the server process working directory and options.skipInPrimaryCheckout is true.")?"primaryCheckout":b.includes("skipped: the work-evidence gate did not pass.")?"workEvidence":b.includes("skipped: the verification run was cancelled.")?"cancelled":b.includes(gn.mutex)?"mutex":b.includes(gn.detachedContract)?"detachedContract":b.includes(gn.noContract)?"noContract":b.includes(gn.notRequired)?"notRequired":"unknown"}(a.logTail)}`)})},a.id))})]})]})}function gD({gate:a}){let b=(0,h.c)("worktree"),c=gb.includes(a.status),[f,g]=(0,e.useState)(null),[i,j]=(0,e.useState)(!1),k=(0,e.useCallback)(()=>j(!1),[]),l=f??c,m=(0,cQ.aJ)(a.logTail??""),n=function(a,b){let c=(a??"").replace(/\n+$/,"");if(""===c)return{lines:[],omitted:0};let d=c.split("\n");return d.length<=40?{lines:d,omitted:0}:{lines:d.slice(-40),omitted:d.length-b}}(m,40),o=function(a){if(null==a||!Number.isFinite(a))return null;if(a<1e3)return`${Math.max(0,Math.round(a))}ms`;let b=a/1e3;return b<10?`${b.toFixed(1)}s`:`${Math.round(b)}s`}(a.durationMs),p=gm[a.gateId]??null;return(0,d.jsxs)("li",{className:"rounded-md border border-border bg-surface p-2","data-testid":`verification-gate-${a.gateId}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(f6.E,{variant:ga[a.status],className:"flex-shrink-0",children:b(`verification.gateStatus.${a.status}`)}),(0,d.jsx)("span",{className:"min-w-0 break-all font-mono text-xs font-medium text-foreground",children:a.gateId}),"contract"===a.source&&(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",title:b("verification.gates.contractSourceHint"),children:b("verification.gates.contractSource")}),null!==p&&(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:b("verification.gates.builtinBadge")})]}),null!==p&&(0,d.jsx)("p",{className:"mt-1 break-words text-[11px] text-muted-foreground","data-testid":`verification-gate-about-${a.gateId}`,children:b(`verification.gates.builtin.${p}`)}),"skipped"===a.status&&(0,d.jsxs)("p",{className:"mt-1 break-words text-[11px] text-muted-foreground","data-testid":`verification-gate-skipped-${a.gateId}`,children:[b("verification.gateStatus.skipped")," — ",b("verification.gateStatusGloss.skipped")]}),(0,d.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-0.5 font-mono text-[11px] text-muted-foreground",children:[null!==a.exitCode&&void 0!==a.exitCode&&(0,d.jsx)("span",{children:b("verification.gates.exitCode",{code:a.exitCode})}),o&&(0,d.jsx)("span",{children:b("verification.gates.duration",{duration:o})}),a.command&&(0,d.jsx)("span",{className:"break-all",children:a.command})]}),(0,d.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>g(!l),"aria-expanded":l,"data-testid":`verification-gate-log-toggle-${a.gateId}`,className:"rounded text-[11px] font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:b(l?"verification.gates.hideLog":"verification.gates.showLog")}),""!==m&&(0,d.jsx)("button",{type:"button",onClick:()=>j(!0),"data-testid":`verification-gate-full-log-button-${a.gateId}`,className:"rounded text-[11px] font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:b("verification.gates.showFullLog")})]}),i&&(0,d.jsx)(gz,{gate:a,log:m,onClose:k}),l&&(0,d.jsx)("div",{className:"mt-1","data-testid":`verification-gate-log-${a.gateId}`,children:0===n.lines.length?(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground",children:b("verification.gates.noLog")}):(0,d.jsxs)(d.Fragment,{children:[n.omitted>0&&(0,d.jsx)("p",{className:"mb-1 text-[11px] text-muted-foreground",children:b("verification.gates.logOmitted",{count:n.omitted,runId:a.runId})}),(0,d.jsx)("pre",{className:"max-h-64 overflow-auto rounded bg-terminal-surface p-2 font-mono text-[11px] leading-relaxed text-terminal-foreground",children:n.lines.join("\n")})]})})]})}let gE=(0,e.memo)(function({state:a,className:b=""}){let c=(0,h.c)("worktree"),{worktreeId:f,task:g,runs:i,selectedRunId:j,selectedRun:k,loading:l,error:m,detailError:n,detailLoading:o,rerunPending:p,rerunFailure:q,cancelFailure:r,canLoadMore:s,selectRun:t,refresh:u,rerun:v,loadMore:w}=a,x=(0,e.useCallback)(()=>{v()},[v]);return(0,d.jsxs)("div",{className:`flex h-full flex-col overflow-y-auto bg-surface ${b}`.trim(),"data-testid":"verification-pane",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)(cl.A,{size:16,"aria-hidden":"true",className:"flex-shrink-0 text-muted-foreground"}),(0,d.jsx)("h2",{className:"truncate text-sm font-semibold text-foreground",children:c("verification.title")})]}),(0,d.jsx)("button",{type:"button",onClick:u,"aria-label":c("verification.refresh"),title:c("verification.refresh"),"data-testid":"verification-refresh-button",className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:(0,d.jsx)(dR.A,{size:14,"aria-hidden":"true"})})]}),m&&(0,d.jsx)("p",{className:"border-b border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-foreground","data-testid":"verification-error",role:"alert",children:c("verification.loadError",{message:m})}),l?(0,d.jsx)("p",{className:"px-3 py-4 text-xs text-muted-foreground","data-testid":"verification-loading",children:c("verification.loading")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(gv,{state:a}),(0,d.jsx)(gq,{heading:c("verification.contract.heading"),testId:"verification-contract-section",children:g?(0,d.jsx)(gs,{task:g}):(0,d.jsx)("p",{className:"whitespace-pre-line text-xs text-muted-foreground","data-testid":"verification-contract-empty",children:c("verification.contract.empty")})}),(0,d.jsxs)(gq,{heading:c("verification.runs.heading"),testId:"verification-runs-section",action:(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:x,disabled:p,"data-testid":"verification-rerun-button",children:c(p?"verification.runs.rerunPending":"verification.runs.rerun")}),children:[q&&(0,d.jsx)("p",{className:"mb-2 rounded border border-warning-border bg-warning-subtle px-2 py-1 text-xs text-warning-foreground","data-testid":"verification-rerun-failure",role:"alert",children:"conflict"===q.kind?null!==q.runningRunId?c("verification.runs.rerunConflict",{runId:q.runningRunId}):c("verification.runs.rerunConflictUnknown"):c("verification.runs.rerunError",{message:q.message})}),r&&(0,d.jsx)("p",{className:"mb-2 rounded border border-warning-border bg-warning-subtle px-2 py-1 text-xs text-warning-foreground","data-testid":"verification-runs-cancel-failure",role:"alert",children:"gone"===r.kind?c("verification.runs.cancelGone"):c("verification.runs.cancelError",{message:r.message})}),(0,d.jsx)(gw,{state:a}),(0,d.jsx)(gB,{}),0===i.length?(0,d.jsx)("p",{className:"whitespace-pre-line text-xs text-muted-foreground","data-testid":"verification-runs-empty",children:c("verification.runs.empty",{worktreeId:f})}):(0,d.jsx)("ul",{className:"space-y-1","data-testid":"verification-runs",children:i.map(a=>(0,d.jsx)(gA,{run:a,selected:a.id===j,onSelect:t},a.id))}),s&&(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"ghost",onClick:w,className:"mt-1","data-testid":"verification-load-more-button",children:c("verification.runs.loadMore",{count:10})}),(0,d.jsx)(gx,{state:a})]}),null!==j&&(0,d.jsx)(gq,{heading:c("verification.gates.heading",{runId:j}),testId:"verification-gates-section",children:null!==n?(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"verification-gates-error",role:"alert",children:"not-found"===n?c("verification.gates.notFound"):c("verification.gates.loadError",{message:n})}):null===k?(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"verification-gates-loading",children:c(o?"verification.gates.loading":"verification.gates.empty")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(gC,{run:k,plannedGateIds:a.config?.plannedGateIds??[]}),0===k.gates.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"verification-gates-empty",children:c("verification.gates.empty")}):(0,d.jsx)("ul",{className:"space-y-1.5","data-testid":"verification-gates",children:k.gates.map(a=>(0,d.jsx)(gD,{gate:a},a.id))}),k.gates.some(a=>"contract"===a.source)&&(0,d.jsx)("p",{className:"mt-2 break-words text-[11px] text-muted-foreground","data-testid":"verification-contract-source-hint",children:c("verification.gates.contractSourceHint")})]})})]})]})});var gF=c(72380);let gG=(0,x.A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var gH=c(31210),gI=c(30430),gJ=c(73790);class gK extends Error{constructor(a,b,c=[]){super(b),this.name="EnvApiError",this.code=a,this.issues=c}}async function gL(a,b){let c=await a.json().catch(()=>null);return new gK(c?.error?.code??`HTTP_${a.status}`,c?.error?.message??b,c?.error?.issues??[])}async function gM(a,b,c){var d;let e=await fetch((d=a,`/api/worktrees/${encodeURIComponent(d)}/env`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:b,content:c})});if(!e.ok)throw await gL(e,"Failed to save env file");let f=await e.json();return{file:f.file,issues:f.issues??[]}}let gN=/^[A-Za-z_][A-Za-z0-9_]*$/;function gO(a){return a.split(/\r\n|\n|\r/)}function gP(a,b,c){for(let d=c;d<a.length;d+=1){if('"'===b&&"\\"===a[d]){d+=1;continue}if(a[d]===b)return d}return -1}function gQ(a){let b=gO(a),c=[],d=[],e=new Map;for(let a=0;a<b.length;a+=1){let f,g=a+1,h=b[a].trim();if(""===h||h.startsWith("#"))continue;let i=/^export\s+/.test(h),j=i?h.replace(/^export\s+/,""):h,k=j.indexOf("=");if(-1===k){d.push({line:g,code:"invalid-syntax",severity:"error"});continue}let l=j.slice(0,k).trim();if(!gN.test(l)){d.push({line:g,code:"invalid-key",severity:"error",...l.length>0&&l.length<=64?{key:l}:{}});continue}let m=j.slice(k+1).replace(/^[ \t]+/,""),n=null,o=g;if(m.startsWith('"')||m.startsWith("'")){n=m[0];let c=m.slice(1),e=gP(c,n,0);for(;-1===e&&a+1<b.length;)a+=1,o=a+1,c+=`
24
+ `,children:[e?(0,d.jsx)(j.y,{"data-testid":"loading-indicator",size:"md",variant:"accent"}):(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),(0,d.jsx)("span",{className:"text-sm font-medium",children:g("memoAdd")})]}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:g("memoRemaining",{count:i})})]})});function d3({query:a,onQueryChange:b,matchCount:c,currentIndex:f,onNext:g,onPrev:i,onClose:j,onCompositionStart:l,onCompositionEnd:m}){let n=(0,h.c)("schedule"),o=(0,e.useRef)(null),p=(0,e.useCallback)(a=>{if("Escape"===a.key){a.preventDefault(),j();return}"Enter"!==a.key||a.nativeEvent.isComposing||(a.preventDefault(),g())},[j,g]),q=(0,e.useCallback)(a=>{b(a.target.value)},[b]),r=0===c?"0/0":`${f+1}/${c}`;return(0,d.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted border border-input rounded",role:"search","aria-label":n("memoSearchLabel"),children:[(0,d.jsx)("input",{ref:o,type:"text",value:a,onChange:q,onKeyDown:p,onCompositionStart:l,onCompositionEnd:m,placeholder:n("memoSearchPlaceholder"),className:"flex-1 min-w-0 bg-transparent text-foreground text-sm outline-none placeholder-muted-foreground","aria-label":n("memoSearchInputLabel"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}),(0,d.jsx)("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"text-muted-foreground text-xs min-w-[3rem] text-right",children:r}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:i,disabled:0===c,"aria-label":n("memoSearchPrev"),className:"text-muted-foreground hover:text-foreground dark:hover:text-white disabled:text-muted-foreground/50 min-w-[36px] min-h-[36px] flex items-center justify-center text-base",children:"▲"}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:g,disabled:0===c,"aria-label":n("memoSearchNext"),className:"text-muted-foreground hover:text-foreground dark:hover:text-white disabled:text-muted-foreground/50 min-w-[36px] min-h-[36px] flex items-center justify-center text-base",children:"▼"}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:j,"aria-label":n("memoSearchClose"),className:"text-muted-foreground hover:text-foreground dark:hover:text-white min-w-[36px] min-h-[36px] flex items-center justify-center text-base ml-1",children:"✕"})]})}let d4=(0,e.memo)(function({worktreeId:a,className:b="",onInsertToMessage:c}){let f=(0,h.c)("schedule"),g=(0,h.c)("common"),i=(0,a4.SC)(),[k,l]=(0,e.useState)([]),[m,n]=(0,e.useState)(!0),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(!1),w=(0,e.useRef)(null),{query:x,matches:y,currentMatch:z,totalCount:A,setQuery:B,reset:C,navigateNext:D,navigatePrev:E,onCompositionStart:F,onCompositionEnd:G}=function({memos:a}){let[b,c]=(0,e.useState)(""),[d,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(-1),i=(0,e.useRef)(null),j=(0,e.useRef)(""),k=(0,e.useRef)(!1);(0,e.useRef)(0===a.length?"0":a.map(a=>`${a.id}:${a.title.length}:${a.content.length}`).join("|"));let l=(0,e.useRef)(a);l.current=a;let m=d.length,n=(0,e.useCallback)(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]),o=(0,e.useCallback)(a=>{let b=function(a,b){if(b.length<bs.E2||0===a.length)return[];let c=b.toLowerCase();return a.filter(a=>-1!==a.title.toLowerCase().indexOf(c)||-1!==a.content.toLowerCase().indexOf(c))}(l.current,a);f(b),h(b.length>0?0:-1)},[]),p=(0,e.useCallback)(a=>{n(),j.current=a,k.current||(i.current=setTimeout(()=>{o(a)},bs.e1))},[n,o]),q=(0,e.useCallback)(a=>{c(a),p(a)},[p]),r=(0,e.useCallback)(()=>{c(""),j.current="",f([]),h(-1),n()},[n]),s=(0,e.useCallback)(()=>{h(a=>0===m?-1:(a+1)%m)},[m]),t=(0,e.useCallback)(()=>{h(a=>0===m?-1:(a-1+m)%m)},[m]);return{query:b,matches:d,currentMatch:g,totalCount:m,setQuery:q,reset:r,navigateNext:s,navigatePrev:t,onCompositionStart:(0,e.useCallback)(()=>{k.current=!0,n()},[n]),onCompositionEnd:(0,e.useCallback)(()=>{k.current=!1;let a=j.current;a.length>=bs.E2&&(n(),i.current=setTimeout(()=>{o(a)},bs.e1))},[n,o])}}({memos:k}),H=u&&x.length>0,I=H?y:k,J=(0,e.useCallback)(async()=>{n(!0),r(null);try{let b=await bP.$T.getAll(a);l(b.sort((a,b)=>a.position-b.position))}catch(a){r((0,bP.hS)(a))}finally{n(!1)}},[a]);(0,e.useEffect)(()=>{J()},[J]);let K=(0,e.useCallback)(async()=>{p(!0),t(null);try{let b=await bP.$T.create(a,{title:f("memoDefaultTitle"),content:""});l(a=>[...a,b])}catch(a){t((0,bP.hS)(a))}finally{p(!1)}},[a,f]),L=(0,e.useCallback)(async(b,c)=>{await bP.$T.update(a,b,c),l(a=>a.map(a=>a.id===b?{...a,...c}:a))},[a]),M=(0,e.useCallback)(async b=>{let c=k.find(a=>a.id===b);if(await i({description:g("confirmDelete",{name:c?.title??""}),variant:"danger"}))try{await bP.$T.delete(a,b),l(a=>a.filter(a=>a.id!==b))}catch(a){console.error("Failed to delete memo:",a)}},[a,k,i,g]),N=(0,e.useCallback)(async(b,c)=>{let d=b+c;if(d<0||d>=k.length)return;let e=[...k];[e[b],e[d]]=[e[d],e[b]],l(e);try{await bP.$T.reorder(a,e.map(a=>a.id))}catch(a){r((0,bP.hS)(a)),await J()}},[k,a,J]),O=(0,e.useCallback)(()=>{J()},[J]),P=(0,e.useCallback)(()=>{v(a=>(a&&C(),!a))},[C]),Q=(0,e.useCallback)(()=>{v(!1),C()},[C]);return((0,e.useEffect)(()=>{if(!H||z<0)return;let a=y[z];if(!a)return;let b=w.current?.querySelector(`[data-memo-id="${a.id}"]`);b&&(b.scrollIntoView({block:"nearest"}),b.focus({preventScroll:!0}))},[H,z,y]),m)?(0,d.jsx)("div",{"data-testid":"memo-pane",className:`flex flex-col items-center justify-center h-full p-4 ${b}`,children:(0,d.jsxs)("div",{"data-testid":"memo-loading",className:"flex flex-col items-center gap-3",children:[(0,d.jsx)(j.y,{size:"xl",variant:"accent"}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:f("memoLoading")})]})}):q?(0,d.jsx)("div",{"data-testid":"memo-pane",className:`flex flex-col items-center justify-center h-full p-4 ${b}`,children:(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,d.jsx)("svg",{className:"w-12 h-12 text-danger",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsx)("span",{className:"text-sm text-danger-foreground",children:q}),(0,d.jsx)("button",{type:"button",onClick:O,"aria-label":g("retry"),className:"px-4 py-2 text-sm font-medium text-white bg-accent-500 rounded-lg hover:bg-accent-600 transition-colors",children:g("retry")})]})}):(0,d.jsxs)("div",{ref:w,"data-testid":"memo-pane",className:`flex flex-col gap-4 p-4 overflow-y-auto ${b}`,children:[(0,d.jsx)("div",{"data-testid":"memo-pane-header",className:"flex items-center gap-2",children:u?(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsx)(d3,{query:x,onQueryChange:B,matchCount:A,currentIndex:z,onNext:D,onPrev:E,onClose:Q,onCompositionStart:F,onCompositionEnd:G})}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("button",{type:"button","data-testid":"memo-search-toggle",onClick:P,"aria-label":f("memoSearchToggle"),className:"p-1.5 text-muted-foreground hover:text-foreground transition-colors rounded",children:(0,d.jsx)(af.A,{className:"w-4 h-4","aria-hidden":"true"})})]})}),0===k.length&&!H&&!s&&(0,d.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,d.jsx)("p",{children:f("memoEmpty")}),(0,d.jsx)("p",{className:"text-sm",children:f("memoEmptyHint")})]}),H&&0===I.length&&(0,d.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:(0,d.jsx)("p",{children:f("memoNoMatch")})}),I.map((a,b)=>(0,d.jsx)(d1,{memo:a,onUpdate:L,onDelete:M,onInsertToMessage:c,onMoveUp:H?void 0:()=>N(b,-1),onMoveDown:H?void 0:()=>N(b,1),canMoveUp:!H&&b>0,canMoveDown:!H&&b<k.length-1},a.id)),s&&(0,d.jsx)("div",{className:"text-center py-2 text-sm text-danger",children:s}),!H&&(0,d.jsx)(d2,{currentCount:k.length,maxCount:20,onAdd:K,isLoading:o,className:"mt-2"})]})});async function d5(a,b){throw Error((await a.json().catch(()=>({}))).error||`${b} (${a.status})`)}let d6=["todo","doing","done"],d7={async list(a){let b=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos`);return b.ok?(await b.json()).todos??[]:d5(b,"Failed to load todos")},async create(a,b,c){let d=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(void 0!==c?{content:b,detail:c}:{content:b})});return d.ok?(await d.json()).todo:d5(d,"Failed to create todo")},async update(a,b,c){let d=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos/${encodeURIComponent(b)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});return d.ok?(await d.json()).todo:d5(d,"Failed to update todo")},async remove(a,b){let c=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos/${encodeURIComponent(b)}`,{method:"DELETE"});c.ok||await d5(c,"Failed to delete todo")},async reorder(a,b){let c=await fetch(`/api/worktrees/${encodeURIComponent(a)}/todos`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({todoIds:b})});c.ok||await d5(c,"Failed to reorder todos")}};var d8=c(62484);let d9={todo:"border-input text-muted-foreground",doing:"border-warning-border bg-warning-subtle text-warning-foreground",done:"border-success-border bg-success-subtle text-success-foreground"},ea=f().memo(function({worktreeId:a,className:b=""}){let c=(0,h.c)("worktree"),f=(0,h.c)("common"),g=(0,a4.SC)(),[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(""),[m,n]=(0,e.useState)(!0),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(!1),A=(0,e.useCallback)(a=>{switch(a){case"doing":return c("todo.statusDoing");case"done":return c("todo.statusDone");default:return c("todo.statusTodo")}},[c]),B=(0,e.useCallback)(async()=>{n(!0),r(null);try{let b=await d7.list(a);j(b)}catch(a){r(a instanceof Error?a.message:c("todo.loadError")),j([])}finally{n(!1)}},[a,c]);(0,e.useEffect)(()=>{B()},[a]);let C=(0,e.useCallback)(async()=>{let b=k.trim();if(b&&!o){p(!0),r(null);try{let c=await d7.create(a,b);j(a=>[...a,c]),l("")}catch(a){r(a instanceof Error?a.message:c("todo.addError"))}finally{p(!1)}}},[k,o,a,c]),D=(0,e.useCallback)(async b=>{let d=function(a){let b=d6.indexOf(a);return d6[(b+1)%d6.length]}(b.status);j(a=>a.map(a=>a.id===b.id?{...a,status:d,done:"done"===d}:a)),r(null);try{await d7.update(a,b.id,{status:d})}catch(a){r(a instanceof Error?a.message:c("todo.updateError")),B()}},[a,B,c]),E=(0,e.useCallback)(async b=>{if(await g({description:f("confirmDelete",{name:b.content}),variant:"danger"})){r(null);try{await d7.remove(a,b.id),j(a=>a.filter(a=>a.id!==b.id))}catch(a){r(a instanceof Error?a.message:c("todo.deleteError"))}}},[a,c,g,f]),F=(0,e.useCallback)(a=>{t(a),v(a.content),x(a.detail),r(null)},[]),G=(0,e.useCallback)(()=>{t(null),z(!1)},[]),H=(0,e.useCallback)(async()=>{if(!s)return;let b=u.trim();if(b&&!y){z(!0),r(null);try{let c=await d7.update(a,s.id,{content:b,detail:w});j(a=>a.map(a=>a.id===s.id?c:a)),G()}catch(a){r(a instanceof Error?a.message:c("todo.updateError")),z(!1)}}},[s,u,w,y,a,G,c]),I=(0,e.useCallback)(async(b,d)=>{let e=b+d;if(e<0||e>=i.length)return;let f=[...i];[f[b],f[e]]=[f[e],f[b]],j(f),r(null);try{await d7.reorder(a,f.map(a=>a.id))}catch(a){r(a instanceof Error?a.message:c("todo.reorderError")),B()}},[i,a,B,c]),J=(0,e.useCallback)(a=>{"Enter"!==a.key||a.nativeEvent.isComposing||(a.preventDefault(),C())},[C]),K=(0,e.useMemo)(()=>({todo:i.filter(a=>"todo"===a.status).length,doing:i.filter(a=>"doing"===a.status).length,done:i.filter(a=>"done"===a.status).length}),[i]);return(0,d.jsxs)("div",{"data-testid":"todo-pane",className:`flex flex-col h-full overflow-y-auto p-4 ${b}`.trim(),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("input",{type:"text",value:k,onChange:a=>l(a.target.value),onKeyDown:J,maxLength:2e3,placeholder:c("todo.addPlaceholder"),"data-testid":"todo-input",className:"flex-1 min-w-0 rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-1.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),(0,d.jsx)("button",{type:"button",onClick:C,disabled:o||0===k.trim().length,"data-testid":"todo-add-button",className:"shrink-0 rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-accent-700 disabled:opacity-50",children:c("todo.add")})]}),(0,d.jsxs)("div",{className:"mb-2 flex justify-end gap-2 text-xs text-muted-foreground",children:[(0,d.jsxs)("span",{"data-testid":"todo-count-todo",children:[A("todo")," ",K.todo]}),(0,d.jsxs)("span",{"data-testid":"todo-count-doing",children:[A("doing")," ",K.doing]}),(0,d.jsxs)("span",{"data-testid":"todo-count-done",children:[A("done")," ",K.done]})]}),q&&(0,d.jsx)("p",{className:"mb-2 text-xs text-danger-foreground","data-testid":"todo-error",children:q}),m?(0,d.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"todo-loading",children:c("todo.loading")}):0===i.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"todo-empty",children:c("todo.empty")}):(0,d.jsx)("ul",{className:"space-y-1","data-testid":"todo-list",children:i.map((a,b)=>(0,d.jsxs)("li",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-muted group","data-testid":"todo-item",children:[(0,d.jsx)("button",{type:"button",onClick:()=>D(a),"data-testid":"todo-status","data-status":a.status,"aria-label":c("todo.cycleStatus",{status:A(a.status)}),title:c("todo.cycleStatus",{status:A(a.status)}),className:`shrink-0 inline-flex min-h-[44px] items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium sm:min-h-0 ${d9[a.status]}`,children:A(a.status)}),(0,d.jsxs)("button",{type:"button",onClick:()=>F(a),"data-testid":"todo-content","aria-label":c("todo.edit"),title:c("todo.edit"),className:"group/content flex min-h-[44px] min-w-0 flex-1 items-center gap-1.5 text-left sm:min-h-0",children:[(0,d.jsx)("span",{className:`min-w-0 break-words text-sm ${"done"===a.status?"line-through text-muted-foreground":"text-foreground group-hover/content:text-accent-700 dark:group-hover/content:text-accent-300"}`,children:a.content}),""!==a.detail.trim()&&(0,d.jsxs)("svg",{"data-testid":"todo-detail-indicator","aria-label":c("todo.hasDetail"),className:"h-3.5 w-3.5 shrink-0 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,d.jsx)("title",{children:c("todo.hasDetail")}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h10"})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>I(b,-1),disabled:0===b,"aria-label":c("todo.moveUp"),"data-testid":"todo-move-up",className:"p-1 text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})})}),(0,d.jsx)("button",{type:"button",onClick:()=>I(b,1),disabled:b===i.length-1,"aria-label":c("todo.moveDown"),"data-testid":"todo-move-down",className:"p-1 text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})}),(0,d.jsx)("button",{type:"button",onClick:()=>E(a),"aria-label":c("todo.delete"),"data-testid":"todo-delete",className:"inline-flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center text-muted-foreground opacity-100 transition-opacity hover:text-danger-foreground sm:min-h-0 sm:min-w-0 sm:opacity-0 sm:group-hover:opacity-100",children:(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},a.id))}),(0,d.jsx)(b_.a,{isOpen:null!==s,onClose:G,title:c("todo.editTitle"),size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:c("todo.contentLabel")}),(0,d.jsx)("input",{type:"text",value:u,onChange:a=>v(a.target.value),maxLength:2e3,placeholder:c("todo.contentPlaceholder"),"data-testid":"todo-edit-content",className:"w-full rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),(0,d.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:c("todo.detailLabel")}),""!==w.trim()&&(0,d.jsx)(d8.i,{text:w,label:c("todo.copyDetail"),className:"!border-input !bg-surface dark:!bg-surface-2 !text-muted-foreground hover:!bg-muted"})]}),(0,d.jsx)("textarea",{value:w,onChange:a=>x(a.target.value),maxLength:4e3,rows:6,placeholder:c("todo.detailPlaceholder"),"data-testid":"todo-edit-detail",className:"w-full resize-y rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:G,"data-testid":"todo-edit-cancel",className:"rounded-md border border-input px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted",children:c("todo.cancel")}),(0,d.jsx)("button",{type:"button",onClick:H,disabled:y||0===u.trim().length,"data-testid":"todo-edit-save",className:"rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-accent-700 disabled:opacity-50",children:c("todo.save")})]})]})})]})}),eb=(0,x.A)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);function ec({isOpen:a,onClose:b,title:c,children:f,footer:g,showCloseButton:i=!0}){let j=(0,h.c)("common"),[k,l]=(0,e.useState)(null);return a?(0,ak.createPortal)((0,d.jsxs)("div",{"data-testid":"full-screen-modal",role:"dialog","aria-modal":"true",className:"fixed inset-0 flex flex-col bg-surface animate-slide-up",style:{zIndex:bo.M.MODAL,height:k?`${k}px`:"100dvh"},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[(0,d.jsx)("h3",{className:"text-base font-semibold text-foreground truncate pr-2",children:c}),i&&(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":j("close"),"data-testid":"full-screen-modal-close",className:"flex-shrink-0 -mr-1 p-1 text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(av.A,{className:"w-6 h-6"})})]}),(0,d.jsx)("div",{"data-testid":"full-screen-modal-body",className:"flex-1 min-h-0 overflow-y-auto overscroll-contain px-4 py-4",onFocusCapture:a=>{let b=a.target;b&&"function"==typeof b.scrollIntoView&&window.requestAnimationFrame(()=>{b.scrollIntoView({block:"center",behavior:"smooth"})})},children:f}),g&&(0,d.jsx)("div",{"data-testid":"full-screen-modal-footer",className:"flex-shrink-0 border-t border-border bg-surface px-4 py-3",style:{paddingBottom:"max(0.75rem, env(safe-area-inset-bottom))"},children:g})]}),document.body):null}let ed=["default","acceptEdits","plan","dontAsk","bypassPermissions"],ee=["read-only","workspace-write","danger-full-access"],ef=["allow-all-tools","yolo"],eg=["--dangerously-skip-permissions"],eh=["default","standard","plan","auto-accept","dont-ask"],ei="yolo",ej=[ei,...eh],ek=[],el=[],em=[],en="default",eo=[en,"auto"],ep=[],eq={claude:"acceptEdits",codex:"workspace-write",gemini:"","vibe-local":"",opencode:"",copilot:"allow-all-tools",antigravity:"--dangerously-skip-permissions","command-code":ei,"opencode-v2":en},er=[];function es(a){return!er.includes(a)}function et(a){switch(a){case"claude":return ed;case"codex":return ee;case"copilot":return ef;case"antigravity":return eg;case"command-code":return ej;case"gemini":return ek;case"vibe-local":return el;case"opencode":return em;case"opencode-v2":return eo;default:return ep}}let eu=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F\x80-\x9F\u200B-\u200F\u2028-\u202F\uFEFF]/;function ev(a){return a.replace(RegExp(eu.source,"g"),"")}let ew=/^[\w\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\uF900-\uFAFF\s-]{1,100}$/;function ex(a){if(a.length>100)return!1;let b=a.trim().split(/\s+/);return b.length>=5&&b.length<=6}var ey=c(90277);let ez=["edit_file","write_file","shell_command","monitor_command","kill_shell"];function eA(a){let b=new Map,c=a.split("\n"),d=null,e=!1,f=!1;for(let a of c){let c=a.trim(),g=c.match(/^##\s+(.+)$/);if(g){d=g[1].trim(),e=!1,f=!1,b.has(d)||b.set(d,[]);continue}if(!c||!c.startsWith("|")||!d)continue;if(!e){e=!0;continue}if(!f){if(c.match(/^\|[\s-:|]+\|$/)){f=!0;continue}f=!0}let h=c.split("|").slice(1,-1).map(a=>a.trim());h.length>0&&b.get(d).push(h)}return b}function eB(a,b){return"command-code"===a&&eh.includes(b.trim())}var eC=c(68232);let eD={en:{bannerTitle:"CMATE.md has schedules to check",body:"With a --permission-mode value as Permission (default / standard / plan / auto-accept / dont-ask), command-code print mode (`commandcode -p`) rejects the write tools the agent calls directly (edit_file / write_file / shell_command / monitor_command / kill_shell). This is a warning and does not stop the schedule from being saved or run. Set Permission to `yolo` if the task needs to write."},ja:{bannerTitle:"CMATE.md に確認が必要なスケジュールがあります",body:"Permission が --permission-mode の値(default / standard / plan / auto-accept / dont-ask)のとき、command-code の print モード(`commandcode -p`)は、エージェントが直接呼ぶ書き込み系ツール(edit_file / write_file / shell_command / monitor_command / kill_shell)を拒否します。これは警告で、スケジュールの登録も実行も止めません。書き込みが必要な作業なら Permission を `yolo` にしてください。"}};function eE(a){return eD[(0,eC.d9)(a)?a:eC.Xn]}let eF=[{value:"0 */1 * * *",labelKey:"cronPresetHourly"},{value:"0 9 * * *",labelKey:"cronPresetDaily9"},{value:"0 9 * * 1",labelKey:"cronPresetWeeklyMon9"}],eG={name:"",cronExpression:"0 9 * * *",message:"",cliToolId:"claude",enabled:!0,permission:eq.claude??"",model:"",agent:"",variant:"",continueSession:!1,title:""},eH="w-full px-3 py-2 text-sm border border-input rounded-md bg-surface dark:bg-surface-2 text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",eI="block text-xs font-semibold text-foreground mb-1",eJ="mt-1 text-xs text-danger-foreground";function eK({onClick:a,label:b,title:c,testId:e}){return(0,d.jsxs)("button",{type:"button","data-testid":e,onClick:a,title:c,className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded border border-info-border text-info-foreground hover:bg-info-subtle transition-colors",children:[(0,d.jsx)(ck.A,{size:14,"aria-hidden":"true"}),b]})}function eL({id:a,title:b,summary:c,icon:e,isOpen:f,onToggle:g,children:h}){let i=`schedule-section-${a}-content`;return(0,d.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,d.jsxs)("button",{type:"button","data-testid":`schedule-section-${a}`,"aria-expanded":f,"aria-controls":i,onClick:()=>g(a),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left bg-surface-2 hover:bg-muted transition-colors",children:[(0,d.jsx)("span",{className:"flex-shrink-0 text-accent-600 dark:text-accent-400",children:e}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"block text-sm font-semibold text-foreground",children:b}),c&&(0,d.jsx)("span",{"data-testid":`schedule-section-${a}-summary`,className:"block truncate text-xs text-muted-foreground",children:c})]}),(0,d.jsx)(aj.A,{className:`flex-shrink-0 w-4 h-4 text-muted-foreground transition-transform ${f?"rotate-180":""}`})]}),f&&(0,d.jsx)("div",{id:i,className:"px-3 py-3 flex flex-col gap-4",children:h})]})}function eM({isOpen:a,worktreeId:b,initialValues:c,originalName:f,onInsertToMessage:g,instances:i,onClose:j,onSaved:l}){let m=(0,h.c)("schedule"),n=(0,bG.Ym)(),o=(0,dV.a)(),p=(0,e.useMemo)(()=>(i&&i.length>0?i:(0,al.lu)([...al.XH])).filter(a=>es(a.cliTool)),[i]),[q,r]=(0,e.useState)(eG),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(()=>new Set(["basic","advanced","message"])),A=(0,e.useCallback)(a=>{z(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),C=et(q.cliToolId),D=C.length>0,E=eB(q.cliToolId,q.permission),F=ey.Vt.has(q.cliToolId),G=ey.aN.has(q.cliToolId),H=!!f,I=(0,e.useMemo)(()=>{let a=q.name.trim();return a?a.length>100?m("edit.errorNameTooLong",{max:100}):ew.test(a)?null:m("edit.errorNameInvalid"):m("edit.errorNameRequired")},[q.name,m]),J=(0,e.useMemo)(()=>ex(q.cronExpression.trim())?null:m("edit.errorCronInvalid"),[q.cronExpression,m]),K=(0,e.useMemo)(()=>q.message.trim()?q.message.length>1e4?m("edit.errorMessageTooLong",{max:1e4}):null:m("edit.errorMessageRequired"),[q.message,m]),L=(0,e.useMemo)(()=>F&&q.model.trim()?(0,ey.JY)(q.model.trim()).valid?null:m("edit.errorModelInvalid"):null,[F,q.model,m]),M=(0,e.useMemo)(()=>G&&q.agent.trim()?(0,ey.sd)(q.agent.trim(),"agent").valid?null:m("edit.errorAgentInvalid"):null,[G,q.agent,m]),N=(0,e.useMemo)(()=>G&&q.variant.trim()?(0,ey.sd)(q.variant.trim(),"variant").valid?(0,ey.z7)(q.cliToolId,q.model,q.variant)?m("edit.errorVariantNeedsModel"):null:m("edit.errorVariantInvalid"):null,[G,q.cliToolId,q.model,q.variant,m]),O=(0,e.useMemo)(()=>G&&q.title.trim()?(0,ey.kj)(q.title.trim()).valid?null:m("edit.errorTitleInvalid"):null,[G,q.title,m]),P=!I&&!J&&!K&&!L&&!M&&!N&&!O,Q=(0,e.useCallback)(a=>{r(b=>({...b,cliToolId:a,permission:function(a){let b=eq[a];if(void 0!==b)return b;let c=et(a);return c.length>0?c[0]:""}(a),model:ey.Vt.has(a)?b.model:"",agent:ey.aN.has(a)?b.agent:"",variant:ey.aN.has(a)?b.variant:"",continueSession:!!ey.aN.has(a)&&b.continueSession,title:ey.aN.has(a)?b.title:""}))},[]),R=(0,e.useCallback)(a=>{let b=p.find(b=>b.id===a);b&&(t(a),Q(b.cliTool))},[p,Q]),S=eF.some(a=>a.value===q.cronExpression)?q.cronExpression:"custom",T=(0,e.useCallback)(a=>{"custom"!==a&&r(b=>({...b,cronExpression:a}))},[]),U=(0,e.useCallback)(a=>{g?.(a),j()},[g,j]),V=(0,e.useCallback)(async()=>{if(P&&!u){v(!0),x(null);try{let a=await fetch(`/api/worktrees/${b}/cmate/schedules`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:q.name.trim(),cronExpression:q.cronExpression.trim(),message:q.message.trim(),cliToolId:q.cliToolId,enabled:q.enabled,permission:D?q.permission:"",model:F&&q.model.trim()?q.model.trim():void 0,agent:G&&q.agent.trim()?q.agent.trim():void 0,variant:G&&q.variant.trim()?q.variant.trim():void 0,continueSession:!!G&&!!q.continueSession||void 0,title:G&&q.title.trim()?q.title.trim():void 0,originalName:f??void 0})});if(!a.ok){let b=await a.json().catch(()=>({}));x(b.error||m("edit.saveError"));return}l(),j()}catch{x(m("edit.saveError"))}finally{v(!1)}}},[P,u,b,q,D,F,G,f,l,j,m]),W=p.find(a=>a.id===s)?.alias??(0,al.f_)(q.cliToolId),X=q.name.trim()?`${q.name.trim()} \xb7 ${q.cronExpression}`:q.cronExpression,Y=[W,D?q.permission:null,F&&q.model.trim()?q.model.trim():null,G&&q.agent.trim()?`--agent ${q.agent.trim()}`:null,G&&q.variant.trim()?`--variant ${q.variant.trim()}`:null,G&&q.continueSession?"--continue":null].filter(Boolean).join(" \xb7 "),Z=q.message.trim(),$=Z.length>32?`${Z.slice(0,32)}…`:Z,_=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-name-input",children:m("edit.name")}),(0,d.jsx)("input",{id:"schedule-name-input","data-testid":"schedule-name-input",type:"text",value:q.name,maxLength:100,placeholder:m("edit.namePlaceholder"),onChange:a=>r(b=>({...b,name:a.target.value})),className:eH}),I&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-name-error",children:I})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground",htmlFor:"schedule-cron-input",children:m("edit.cron")}),g&&(0,d.jsx)(eK,{testId:"schedule-cron-ask-ai",label:m("edit.askAiCron"),title:m("edit.askAiHint"),onClick:()=>U(function(a,b){let c=b.trim();return 0===c.length?a("edit.aiPrompts.cron"):a("edit.aiPrompts.cronRefine",{current:"`"+c+"`"})}(m,q.cronExpression))})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,d.jsx)("input",{id:"schedule-cron-input","data-testid":"schedule-cron-input",type:"text",value:q.cronExpression,placeholder:m("edit.cronPlaceholder"),onChange:a=>r(b=>({...b,cronExpression:a.target.value})),className:`${eH} font-mono sm:flex-1`}),(0,d.jsxs)("select",{"data-testid":"schedule-cron-preset","aria-label":m("edit.cronPreset"),value:S,onChange:a=>T(a.target.value),className:`${eH} sm:w-48`,children:[eF.map(a=>(0,d.jsx)("option",{value:a.value,children:m(`edit.${a.labelKey}`)},a.value)),(0,d.jsx)("option",{value:"custom",children:m("edit.cronPresetCustom")})]})]}),J&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-cron-error",children:J})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)(k.Sc,{"data-testid":"schedule-enabled-toggle",checked:q.enabled,onCheckedChange:a=>r(b=>({...b,enabled:!0===a}))}),(0,d.jsx)("span",{className:"text-sm text-foreground",children:m("edit.enabledLabel")})]})]}),aa=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-cli-tool-select",children:m("edit.cliTool")}),(0,d.jsx)("select",{id:"schedule-cli-tool-select","data-testid":"schedule-cli-tool-select",value:s,onChange:a=>R(a.target.value),className:eH,children:p.map(a=>(0,d.jsx)("option",{value:a.id,children:a.alias},a.id))})]}),F&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-model-input",children:m("edit.model")}),(0,d.jsx)("input",{id:"schedule-model-input","data-testid":"schedule-model-input",type:"text",value:q.model,placeholder:m("edit.modelPlaceholder"),onChange:a=>r(b=>({...b,model:a.target.value})),className:eH}),L&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-model-error",children:L})]}),G&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-agent-input",children:m("edit.opencodeAgent")}),(0,d.jsx)("input",{id:"schedule-agent-input","data-testid":"schedule-agent-input",type:"text",value:q.agent,placeholder:m("edit.opencodeAgentPlaceholder"),onChange:a=>r(b=>({...b,agent:a.target.value})),className:eH}),M&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-agent-error",children:M})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-variant-input",children:m("edit.opencodeVariant")}),(0,d.jsx)("input",{id:"schedule-variant-input","data-testid":"schedule-variant-input",type:"text",value:q.variant,placeholder:m("edit.opencodeVariantPlaceholder"),onChange:a=>r(b=>({...b,variant:a.target.value})),className:eH}),N&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-variant-error",children:N})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-title-input",children:m("edit.opencodeTitle")}),(0,d.jsx)("input",{id:"schedule-title-input","data-testid":"schedule-title-input",type:"text",value:q.title,placeholder:m("edit.opencodeTitlePlaceholder"),onChange:a=>r(b=>({...b,title:a.target.value})),className:eH}),O&&(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-title-error",children:O})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)(k.Sc,{"data-testid":"schedule-continue-toggle",checked:q.continueSession,onCheckedChange:a=>r(b=>({...b,continueSession:!0===a}))}),(0,d.jsx)("span",{className:"text-sm text-foreground",children:m("edit.opencodeContinue")})]})]}),D&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:eI,htmlFor:"schedule-permission-select",children:m("edit.permission")}),(0,d.jsx)("select",{id:"schedule-permission-select","data-testid":"schedule-permission-select",value:q.permission,onChange:a=>r(b=>({...b,permission:a.target.value})),className:eH,children:C.map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),E&&(0,d.jsx)("p",{className:"mt-1 text-xs text-warning-foreground","data-testid":"schedule-permission-write-tools-denied-note",children:eE(n).body})]})]}),ab=(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground",htmlFor:"schedule-message-input",children:m("edit.message")}),g&&(0,d.jsx)(eK,{testId:"schedule-message-ask-ai",label:m("edit.askAiMessage"),title:m("edit.askAiHint"),onClick:()=>U(function(a,b){let c=b.trim();return 0===c.length?a("edit.aiPrompts.messageDraft"):a("edit.aiPrompts.messageDraftNamed",{name:"`"+c+"`"})}(m,q.name))})]}),(0,d.jsx)("textarea",{id:"schedule-message-input","data-testid":"schedule-message-input",value:q.message,rows:4,maxLength:1e4,placeholder:m("edit.messagePlaceholder"),onChange:a=>r(b=>({...b,message:a.target.value})),className:`${eH} resize-none`}),(0,d.jsxs)("div",{className:"mt-1 flex items-center justify-between",children:[K?(0,d.jsx)("p",{className:eJ,"data-testid":"schedule-message-error",children:K}):(0,d.jsx)("span",{}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"schedule-message-count",children:m("edit.charCount",{count:q.message.length,max:1e4})})]})]}),ac=(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(eL,{id:"basic",title:m("edit.sectionBasic"),summary:X,icon:(0,d.jsx)(B.A,{className:"w-4 h-4"}),isOpen:y.has("basic"),onToggle:A,children:_}),(0,d.jsx)(eL,{id:"advanced",title:m("edit.sectionAdvanced"),summary:Y,icon:(0,d.jsx)(eb,{className:"w-4 h-4"}),isOpen:y.has("advanced"),onToggle:A,children:aa}),(0,d.jsx)(eL,{id:"message",title:m("edit.sectionMessage"),summary:$,icon:(0,d.jsx)(ay.A,{className:"w-4 h-4"}),isOpen:y.has("message"),onToggle:A,children:ab}),w&&(0,d.jsx)("div",{className:"text-xs p-2 rounded bg-danger-subtle text-danger-foreground","data-testid":"schedule-submit-error",children:w})]}),ad=(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:j,className:"px-4 py-2 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",children:m("edit.cancel")}),(0,d.jsx)("button",{type:"button","data-testid":"schedule-save-button",onClick:()=>void V(),disabled:!P||u,className:"px-4 py-2 text-sm font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-md transition-colors",children:m("edit.save")})]}),ae=H?m("edit.titleEdit"):m("edit.titleCreate");return o?(0,d.jsx)(ec,{isOpen:a,onClose:j,title:ae,footer:ad,children:ac}):(0,d.jsx)(b_.a,{isOpen:a,onClose:j,title:ae,size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[ac,(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:ad})]})})}function eN(a){return new Date(a).toLocaleString()}function eO(a,b){if(null===b)return null;let c=b-a;if(c<0)return null;let d=Math.floor(c/1e3),e=Math.floor(d/60),f=d%60;return e>0?`${e}m ${f}s`:`${f}s`}let eP=(0,e.memo)(function({worktreeId:a}){let b=(0,bG.Ym)(),[c,f]=(0,e.useState)([]);if((0,e.useEffect)(()=>{let b=!1,c=a=>{b||f(b=>0===b.length&&0===a.length?b:a)};return(async()=>{try{let b=await fetch(`/api/worktrees/${a}/files/CMATE.md`),d=b.ok?await b.json():null,e="string"==typeof d?.content?d.content:"";c(function(a){let b=[],c=0;for(let e=0;e<a.length;e++){var d;let f=a[e],g=function(a){let b=[];for(let c=0;c<a.length;c++){let d=a[c];if(d.length<3){b.push({row:c,message:`Row ${c+1}: insufficient columns (need at least 3, got ${d.length})`,field:"columns"});continue}let[e,f,g]=d,h=ev(e);ew.test(h)||b.push({row:c,message:`Row ${c+1}: invalid name "${h}"`,field:"name"}),ex(f)||b.push({row:c,message:`Row ${c+1}: invalid cron "${f}"`,field:"cron"}),ev(g).trim()||b.push({row:c,message:`Row ${c+1}: empty message`,field:"message"});let{result:i,errors:j}=(0,ey.zK)(d[3]||"");for(let a of j)b.push({row:c,message:`Row ${c+1}: ${a}`,field:a.includes("Model")?"model":"cliTool"});i&&!(0,al.hR)(i.cliToolId)&&b.push({row:c,message:`Row ${c+1}: unknown CLI Tool "${i.cliToolId}"`,field:"cliTool"}),i&&(0,al.hR)(i.cliToolId)&&!es(i.cliToolId)&&b.push({row:c,message:`Row ${c+1}: CLI Tool "${i.cliToolId}" is not supported in schedules yet`,field:"cliTool"});let k=d[5];if(void 0!==k&&""!==k.trim()){let a=k.trim(),d=i.cliToolId;("claude"===d?ed:"codex"===d?ee:"copilot"===d?ef:"antigravity"===d?eg:"command-code"===d?ej:"opencode-v2"===d?eo:[]).includes(a)||b.push({row:c,message:`Row ${c+1}: invalid permission "${a}" for ${d}`,field:"permission"})}}return b}([f]);if(g.some(a=>"permission"!==a.field))continue;if(c>=100)break;if(c++,g.length>0)continue;let[h,,,i,j,k]=f;if(d=j,void 0!==d&&""!==d&&"true"!==d.toLowerCase())continue;let{result:l}=(0,ey.zK)(i||""),m=(k??"").trim();if(!eB(l.cliToolId,m))continue;let n=ev(h);b.push({row:e,name:n,field:"permission",code:"command-code-direct-write-tools-denied",cliToolId:l.cliToolId,permission:m,message:`Row ${e+1}: schedule "${n}" runs command-code with the --permission-mode value "${m}", so commandcode -p rejects the write tools the agent calls directly (${ez.join(", ")}). This is a warning, not an error: the schedule still runs. Use "yolo" if it needs to write.`})}return b}(eA(e).get("Schedules")??[]))}catch{c([])}})(),()=>{b=!0}},[a]),0===c.length)return null;let g=eE(b);return(0,d.jsxs)("div",{role:"status","data-testid":"schedule-config-warnings",className:"rounded border border-warning-border bg-warning-subtle p-3 text-warning-foreground",children:[(0,d.jsx)("p",{className:"text-sm font-semibold",children:g.bannerTitle}),(0,d.jsx)("ul",{className:"mt-1 space-y-1",children:c.map(a=>(0,d.jsxs)("li",{"data-testid":`schedule-config-warning-${a.name}`,"data-warning-code":a.code,className:"text-xs",children:[(0,d.jsx)("span",{className:"font-medium",children:a.name}),(0,d.jsxs)("span",{className:"ml-2 font-mono",children:[a.cliToolId," / ",a.permission]})]},`${a.row}-${a.name}`))}),(0,d.jsx)("p",{className:"mt-2 text-xs",children:g.body})]})}),eQ=(0,e.memo)(function({worktreeId:a,logs:b}){let c=(0,h.c)("schedule"),[f,g]=(0,e.useState)(null),[i,j]=(0,e.useState)(null),k=(0,e.useCallback)(async b=>{if(f===b){g(null),j(null);return}try{let c=await fetch(`/api/worktrees/${a}/execution-logs/${b}`);if(c.ok){let a=await c.json();j(a.log),g(b)}}catch(a){console.error("Failed to fetch log detail:",a)}},[a,f]),l=(0,d.jsx)(eP,{worktreeId:a});return 0===b.length?(0,d.jsxs)("div",{className:"space-y-2",children:[l,(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:c("noLogs")})]}):(0,d.jsxs)("div",{className:"space-y-2","data-testid":"execution-logs-view",children:[l,b.map(a=>(0,d.jsxs)("div",{className:"border border-border rounded bg-surface","data-testid":"execution-log-row","data-warning":a.warning?"true":void 0,children:[(0,d.jsxs)("button",{type:"button",onClick:()=>void k(a.id),className:"w-full text-left p-3 hover:bg-muted transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-sm truncate max-w-[60%]",children:a.schedule_name||c("unknownSchedule")}),(0,d.jsxs)("span",{className:`text-xs px-2 py-0.5 rounded ${function(a,b){if(b&&"completed"===a)return"text-warning-foreground bg-warning-subtle";switch(a){case"completed":return"text-success-foreground bg-success-subtle";case"failed":return"text-danger-foreground bg-danger-subtle";case"timeout":return"text-warning-foreground bg-warning-subtle";case"running":return"text-accent-600 dark:text-accent-400 bg-accent-50 dark:bg-accent-900/30";case"cancelled":return"text-muted-foreground bg-muted"}}(a.status,!!a.warning)}`,"data-testid":"execution-log-status",children:[a.warning&&(0,d.jsx)("span",{"aria-hidden":"true",children:"⚠ "}),c(`status.${a.status}`)]})]}),(0,d.jsxs)("div",{className:"text-xs text-muted-foreground mt-1",children:[eN(a.started_at),eO(a.started_at,a.completed_at)&&(0,d.jsxs)("span",{className:"ml-2",children:["(",eO(a.started_at,a.completed_at),")"]}),null!==a.exit_code&&(0,d.jsxs)("span",{className:"ml-2",children:[c("exitCode"),": ",a.exit_code]})]}),a.warning&&(0,d.jsxs)("div",{className:"text-xs text-warning-foreground mt-1 break-words","data-testid":"execution-log-warning",children:[(0,d.jsx)("span",{"aria-hidden":"true",children:"⚠ "}),a.warning]})]}),f===a.id&&i&&(0,d.jsxs)("div",{className:"border-t border-border p-3 bg-muted space-y-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:c("message")}),(0,d.jsx)("pre",{className:"text-xs whitespace-pre-wrap font-mono text-foreground",children:i.message})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:c("response")}),(0,d.jsx)("pre",{className:"text-xs whitespace-pre-wrap font-mono text-foreground max-h-60 overflow-y-auto",children:i.result||c("noOutput")})]})]})]},a.id))]})});function eR(){return(0,d.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4",children:(0,d.jsx)("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-8.5 8.5a1 1 0 01-.43.26l-3 .857a.5.5 0 01-.617-.618l.857-3a1 1 0 01.26-.43l8.5-8.5z"})})}function eS(){return(0,d.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4",children:(0,d.jsx)("path",{fillRule:"evenodd",d:"M8 2a1 1 0 00-.894.553L6.382 4H3a1 1 0 000 2h.293l.668 9.357A2 2 0 005.956 17h8.088a2 2 0 001.995-1.643L16.707 6H17a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0012 2H8zm1 5a1 1 0 012 0v6a1 1 0 11-2 0V7zm-3 0a1 1 0 011 1v5a1 1 0 11-2 0V8a1 1 0 011-1z",clipRule:"evenodd"})})}let eT=(0,e.memo)(function({worktreeId:a,className:b="",onInsertToMessage:c,instances:f}){let g=(0,h.c)("schedule"),i=(0,a4.SC)(),[j,l]=(0,e.useState)([]),[m,n]=(0,e.useState)([]),[o,p]=(0,e.useState)([]),[q,r]=(0,e.useState)(!0),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)("schedules"),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(void 0),[C,D]=(0,e.useState)(void 0),E=(0,e.useCallback)(async()=>{r(!0),t(null);try{let[b,c,d]=await Promise.all([fetch(`/api/worktrees/${a}/execution-logs`),fetch(`/api/worktrees/${a}/schedules`),fetch(`/api/worktrees/${a}/schedules/active`)]);if(b.ok){let a=await b.json();l(a.logs||[])}if(c.ok){let a=await c.json();n(a.schedules||[])}if(d.ok){let a=await d.json();p(a.schedules||[])}else p([])}catch(a){t(a instanceof Error?a.message:"Failed to fetch data")}finally{r(!1)}},[a]);(0,e.useEffect)(()=>{E()},[E]);let F=(0,e.useCallback)(async b=>{try{let c=await fetch(`/api/worktrees/${a}/files/CMATE.md`);if(!c.ok)return null;let d=await c.json(),e="string"==typeof d.content?d.content:"",f=(eA(e).get("Schedules")??[]).find(a=>(a[0]??"").trim()===b);if(!f)return null;let g=(0,ey.I_)(f[3]??"claude"),h=(f[4]??"true").trim().toLowerCase();return{name:b,cronExpression:(f[1]??"").trim(),message:(f[2]??"").trim(),cliToolId:g.cliToolId||"claude",enabled:""===h||"true"===h,permission:(f[5]??"").trim(),model:g.model??""}}catch{return null}},[a]),G=(0,e.useCallback)(()=>{D(void 0),B(void 0),z(!0)},[]),H=(0,e.useCallback)(async a=>{let b=await F(a.name);D(a.name),B(b??{name:a.name,cronExpression:a.cron_expression,message:a.message,cliToolId:a.cli_tool_id,enabled:1===a.enabled,permission:"",model:""}),z(!0)},[F]),I=(0,e.useCallback)(async b=>{if(await i({description:g("edit.confirmDelete",{name:b}),variant:"danger"}))try{(await fetch(`/api/worktrees/${a}/cmate/schedules`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b})})).ok&&await E()}catch(a){console.error("Failed to delete schedule:",a)}},[a,g,E,i]),J=(0,e.useCallback)(async b=>{try{(await fetch(`/api/worktrees/${a}/cmate/schedules`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b.name,enabled:1!==b.enabled})})).ok&&await E()}catch(a){console.error("Failed to toggle schedule:",a)}},[a,E]);return q?(0,d.jsx)("div",{className:`flex items-center justify-center h-full p-4 ${b}`,children:(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,d.jsx)(k.y$,{size:"xl",variant:"accent"}),(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:g("loading")})]})}):s?(0,d.jsx)("div",{className:`flex items-center justify-center h-full p-4 ${b}`,children:(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("span",{className:"text-sm text-danger-foreground",children:s}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:()=>void E(),className:"ml-2 px-3 py-1 text-sm text-white bg-accent-500 rounded hover:bg-accent-600",children:g("retry")})]})}):(0,d.jsxs)("div",{className:`flex flex-col h-full ${b}`,children:[(0,d.jsxs)("div",{className:"flex shrink-0 border-b border-border px-4 pt-3",children:[(0,d.jsxs)("button",{type:"button","data-testid":"schedule-tab-schedules",role:"tab","aria-selected":"schedules"===u,onClick:()=>v("schedules"),className:`-mb-px px-3 py-2 text-sm font-medium border-b-2 transition-colors ${"schedules"===u?"border-accent-500 text-accent-700 dark:text-accent-300":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[g("tabs.schedules")," (",m.length,")"]}),(0,d.jsxs)("button",{type:"button","data-testid":"schedule-tab-logs",role:"tab","aria-selected":"logs"===u,onClick:()=>v("logs"),className:`-mb-px px-3 py-2 text-sm font-medium border-b-2 transition-colors ${"logs"===u?"border-accent-500 text-accent-700 dark:text-accent-300":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[g("tabs.logs")," (",j.length,")"]})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:"schedules"===u?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"rounded border border-accent-100 bg-accent-50/60 p-3 dark:border-accent-900/40 dark:bg-accent-950/20",children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-sm font-semibold text-accent-900 dark:text-accent-200",children:[g("activeSchedulesTitle")," (",o.length,")"]}),(0,d.jsx)("span",{className:"text-xs text-accent-700 dark:text-accent-300",children:g("activeSchedulesDescription")})]}),0===o.length?(0,d.jsx)("p",{className:"text-xs text-accent-800 dark:text-accent-300",children:g("noActiveSchedules")}):(0,d.jsx)("div",{className:"space-y-2",children:o.map(a=>(0,d.jsxs)("div",{className:"rounded border border-accent-200/80 bg-white/80 p-3 dark:border-accent-900/40 dark:bg-surface/60",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"font-medium text-sm text-foreground",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${a.isCronActive?"bg-success-subtle text-success-foreground":"bg-danger-subtle text-danger-foreground"}`,children:a.isCronActive?g("activeState.active"):g("activeState.inactive")}),a.isExecuting&&(0,d.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-accent-100 text-accent-700 dark:bg-accent-900/30 dark:text-accent-300",children:g("activeState.executing")})]})]}),(0,d.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(0,d.jsxs)("span",{children:[g("cron"),": ",a.cronExpression||"N/A"]}),(0,d.jsxs)("span",{className:"ml-3",children:[g("agentLabel"),": ",a.cliToolId]}),a.model&&(0,d.jsxs)("span",{className:"ml-3",children:["model: ",a.model]}),a.nextRunAt&&(0,d.jsxs)("span",{className:"ml-3",children:[g("nextRun"),": ",eN(a.nextRunAt)]})]})]},a.scheduleId))})]}),0===m.length?(0,d.jsxs)("div",{className:"flex flex-col items-center text-center py-8 px-4",children:[(0,d.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-accent-50 text-accent-600 dark:bg-accent-900/30 dark:text-accent-300",children:(0,d.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",className:"w-7 h-7",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7.5V12l3 2"})]})}),(0,d.jsx)("p",{className:"font-semibold text-foreground mb-1",children:g("emptyState.title")}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-5 max-w-xs",children:g("emptyState.description")}),(0,d.jsxs)(k.$n,{variant:"ghost",type:"button","data-testid":"schedule-empty-cta",onClick:G,className:"inline-flex items-center gap-1.5 px-5 py-2.5 text-sm font-semibold text-white bg-accent-600 hover:bg-accent-700 rounded-lg shadow-sm transition-colors",children:[(0,d.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4",children:(0,d.jsx)("path",{d:"M10 4a1 1 0 011 1v4h4a1 1 0 110 2h-4v4a1 1 0 11-2 0v-4H5a1 1 0 110-2h4V5a1 1 0 011-1z"})}),g("emptyState.createButton")]}),(0,d.jsx)("button",{type:"button","data-testid":"schedule-manual-toggle","aria-expanded":w,onClick:()=>x(a=>!a),className:"mt-5 text-xs text-accent-700 dark:text-accent-300 hover:underline",children:g("emptyState.manualToggle")}),w&&(0,d.jsxs)("ol",{"data-testid":"schedule-manual-steps",className:"mt-3 text-xs text-left inline-block space-y-1.5 list-decimal list-inside text-muted-foreground",children:[(0,d.jsx)("li",{children:g("noSchedulesStep1")}),(0,d.jsx)("li",{children:g("noSchedulesStep2")}),(0,d.jsx)("li",{children:g("noSchedulesStep3")}),(0,d.jsx)("li",{children:g("noSchedulesStep4")})]})]}):(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"mb-2 flex items-center justify-end",children:(0,d.jsxs)(k.$n,{variant:"ghost",type:"button","data-testid":"schedule-new-button",onClick:G,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-white bg-accent-600 hover:bg-accent-700 rounded transition-colors whitespace-nowrap",children:[(0,d.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",fill:"currentColor",className:"w-3.5 h-3.5",children:(0,d.jsx)("path",{d:"M10 4a1 1 0 011 1v4h4a1 1 0 110 2h-4v4a1 1 0 11-2 0v-4H5a1 1 0 110-2h4V5a1 1 0 011-1z"})}),g("edit.newSchedule")]})}),(0,d.jsx)("div",{className:"space-y-2",children:m.map(a=>{let b=1===a.enabled;return(0,d.jsxs)("div",{className:"border border-border rounded p-3 bg-white dark:bg-surface",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"font-medium text-sm truncate",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":b,"aria-label":b?g("edit.disable"):g("edit.enable"),title:b?g("edit.disable"):g("edit.enable"),"data-testid":`schedule-toggle-${a.name}`,onClick:()=>void J(a),className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors ${b?"bg-success":"bg-input"}`,children:(0,d.jsx)("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ${b?"translate-x-4":"translate-x-0.5"}`})}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button","data-testid":`schedule-edit-${a.name}`,"aria-label":g("edit.edit"),title:g("edit.edit"),onClick:()=>void H(a),className:"p-1.5 text-muted-foreground hover:text-accent-600 dark:hover:text-accent-400 hover:bg-accent-50 dark:hover:bg-accent-900/20 rounded transition-colors",children:(0,d.jsx)(eR,{})}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button","data-testid":`schedule-delete-${a.name}`,"aria-label":g("edit.delete"),title:g("edit.delete"),onClick:()=>void I(a.name),className:"p-1.5 text-muted-foreground hover:text-danger-foreground hover:bg-danger-subtle rounded transition-colors",children:(0,d.jsx)(eS,{})})]})]}),(0,d.jsxs)("div",{className:"text-xs text-muted-foreground mt-1",children:[(0,d.jsxs)("span",{children:[g("cron"),": ",a.cron_expression||"N/A"]}),a.last_executed_at&&(0,d.jsxs)("span",{className:"ml-3",children:[g("lastRun"),": ",eN(a.last_executed_at)]})]})]},a.id)})})]})]}):(0,d.jsx)(eQ,{worktreeId:a,logs:j})}),(0,d.jsx)(eM,{isOpen:y,worktreeId:a,initialValues:A,originalName:C,onInsertToMessage:c,instances:f,onClose:()=>z(!1),onSaved:()=>{E()}})]})}),eU=(0,e.memo)(function({worktreeId:a,vibeLocalModel:b,onVibeLocalModelChange:c,vibeLocalContextWindow:f,onVibeLocalContextWindowChange:g}){let i=(0,h.c)("schedule"),[k,l]=(0,e.useState)([]),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(null!=f?String(f):""),[u,v]=(0,e.useState)(!1);(0,e.useEffect)(()=>{t(null!=f?String(f):"")},[f]),(0,e.useEffect)(()=>{let a=!1;return p(!0),fetch("/api/ollama/models").then(a=>a.json()).then(b=>{a||(l(b.models),n(0===b.models.length&&b.error?b.error:null))}).catch(()=>{a||(l([]),n("Failed to fetch models"))}).finally(()=>{a||p(!1)}),()=>{a=!0}},[]);let w=(0,e.useCallback)(async b=>{let d=b.target.value,e=""===d?null:d;r(!0);try{(await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({vibeLocalModel:e})})).ok&&c(e)}catch{}finally{r(!1)}},[a,c]),x=(0,e.useCallback)(a=>{t(a.target.value)},[]),y=(0,e.useCallback)(async()=>{let b=s.trim(),c=parseInt(b,10),d=""===b||Number.isNaN(c)?null:c,e=f??null;if(d!==e){v(!0);try{(await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({vibeLocalContextWindow:d})})).ok?g?.(d):t(null!=e?String(e):"")}catch{t(null!=e?String(e):"")}finally{v(!1)}}},[s,f,a,g]);return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border",children:[(0,d.jsx)("h4",{className:"text-sm font-semibold text-foreground mb-2",children:i("vibeLocalModel")}),o?(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(j.y,{size:"xs",variant:"muted"}),i("loading")]}):m&&0===k.length?(0,d.jsx)("p",{className:"text-xs text-warning-foreground",children:i("ollamaNotAvailable")}):(0,d.jsxs)("select",{"data-testid":"vibe-local-model-select",value:b??"",onChange:w,disabled:q,className:"w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:[(0,d.jsx)("option",{value:"",children:i("vibeLocalModelDefault")}),k.map(a=>(0,d.jsxs)("option",{value:a.name,children:[a.name,a.parameterSize?` (${a.parameterSize})`:""]},a.name))]}),(0,d.jsxs)("div",{className:"mt-3",children:[(0,d.jsx)("h4",{className:"text-sm font-semibold text-foreground mb-2",children:i("vibeLocalContextWindow")}),(0,d.jsx)("input",{type:"number","data-testid":"vibe-local-context-window-input",step:"1",min:al.vz,max:al.NL,value:s,onChange:x,onBlur:y,placeholder:i("vibeLocalContextWindowDefault"),disabled:u,className:"w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"})]})]})}),eV=Object.freeze({agent:null,providerId:null,modelId:null,variant:null}),eW=[{id:"opencode",label:(0,al.oo)("opencode")}];function eX(a){let b=a.indexOf("/");return b<=0||b===a.length-1?null:{providerId:a.slice(0,b),modelId:a.slice(b+1)}}let eY=(0,e.memo)(function({worktreeId:a,instances:b}){let c=(0,h.c)("schedule"),[f,g]=(0,e.useState)({}),[i,j]=(0,e.useState)({connected:!1,providers:[],agents:[]}),[l,m]=(0,e.useState)(!0),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(null);(0,e.useEffect)(()=>{let b=!1;return m(!0),fetch(`/api/worktrees/${a}/instances/opencode`).then(a=>a.ok?a.json():Promise.reject(Error(String(a.status)))).then(a=>{b||(g(a.settings??{}),j(a.catalog??{connected:!1,providers:[],agents:[]}),q(null))}).catch(()=>{b||q(c("opencodeSettingsLoadError"))}).finally(()=>{b||m(!1)}),()=>{b=!0}},[a,c]);let r=(0,e.useCallback)(async(b,d)=>{g(a=>({...a,[b]:d})),o(!0),q(null);try{let e=await fetch(`/api/worktrees/${a}/instances/opencode`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({instanceId:b,...d})});if(!e.ok)return void q(c("opencodeSettingsSaveError"));let f=await e.json();f.settings&&g(a=>({...a,[b]:f.settings}))}catch{q(c("opencodeSettingsSaveError"))}finally{o(!1)}},[a,c]);return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border","data-testid":"opencode-instance-settings",children:[(0,d.jsx)("h4",{className:"text-sm font-semibold text-foreground mb-1",children:c("opencodeSettings")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:c("opencodeSettingsDescription")}),l?(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(k.y$,{size:"xs",variant:"muted"}),c("loading")]}):(0,d.jsxs)("div",{className:"space-y-4",children:[!i.connected&&(0,d.jsx)("p",{"data-testid":"opencode-settings-offline",className:"text-xs text-muted-foreground",children:c("opencodeSettingsOffline")}),b.map(a=>{let e=f[a.id]??{...eV},g=e.providerId&&e.modelId?`${e.providerId}/${e.modelId}`:"",h=function(a,b){if(!b.providerId||!b.modelId)return null;let c=a.providers.find(a=>a.id===b.providerId);return c?.models.find(a=>a.id===b.modelId)??null}(i,e),j=h?.variants??[],k=i.agents.filter(a=>"primary"===a.mode);return(0,d.jsxs)("div",{className:"space-y-2",children:[b.length>1&&(0,d.jsx)("p",{className:"text-xs font-medium text-foreground",children:a.label}),(0,d.jsxs)("label",{className:"block text-xs text-muted-foreground",children:[c("opencodeAgent"),k.length>0?(0,d.jsxs)("select",{"data-testid":`opencode-agent-select-${a.id}`,value:e.agent??"",disabled:n,onChange:b=>void r(a.id,{...e,agent:""===b.target.value?null:b.target.value}),className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:[(0,d.jsx)("option",{value:"",children:c("opencodeDefault")}),k.map(a=>(0,d.jsx)("option",{value:a.name,children:a.name},a.name))]}):(0,d.jsx)("input",{type:"text","data-testid":`opencode-agent-input-${a.id}`,defaultValue:e.agent??"",disabled:n,placeholder:c("opencodeAgentPlaceholder"),onBlur:b=>void r(a.id,{...e,agent:""===b.target.value.trim()?null:b.target.value.trim()}),className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"})]}),(0,d.jsxs)("label",{className:"block text-xs text-muted-foreground",children:[c("opencodeModel"),i.providers.length>0?(0,d.jsxs)("select",{"data-testid":`opencode-model-select-${a.id}`,value:g,disabled:n,onChange:b=>{let c=eX(b.target.value);r(a.id,{...e,providerId:c?.providerId??null,modelId:c?.modelId??null,variant:null})},className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:[(0,d.jsx)("option",{value:"",children:c("opencodeDefault")}),i.providers.map(a=>(0,d.jsx)("optgroup",{label:a.name,children:a.models.map(b=>(0,d.jsx)("option",{value:`${a.id}/${b.id}`,children:b.name},b.id))},a.id))]}):(0,d.jsx)("input",{type:"text","data-testid":`opencode-model-input-${a.id}`,defaultValue:g,disabled:n,placeholder:c("opencodeModelPlaceholder"),onBlur:b=>{let c=eX(b.target.value.trim());r(a.id,{...e,providerId:c?.providerId??null,modelId:c?.modelId??null})},className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"})]}),(0,d.jsxs)("label",{className:"block text-xs text-muted-foreground",children:[c("opencodeVariant"),j.length>0?(0,d.jsxs)("select",{"data-testid":`opencode-variant-select-${a.id}`,value:e.variant??"",disabled:n,onChange:b=>void r(a.id,{...e,variant:""===b.target.value?null:b.target.value}),className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:[(0,d.jsx)("option",{value:"",children:c("opencodeDefault")}),j.map(a=>(0,d.jsx)("option",{value:a,children:a},a))]}):(0,d.jsx)("input",{type:"text","data-testid":`opencode-variant-input-${a.id}`,defaultValue:e.variant??"",disabled:n,placeholder:c("opencodeVariantPlaceholder"),onBlur:b=>void r(a.id,{...e,variant:""===b.target.value.trim()?null:b.target.value.trim()}),className:"mt-1 w-full text-sm border border-input rounded-md px-3 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"})]}),h&&0===j.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("opencodeNoVariants")})]},a.id)}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("opencodeVariantLaunchNote")}),n&&(0,d.jsxs)("div",{"data-testid":"opencode-settings-loading",className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(k.y$,{size:"xs",variant:"muted"}),c("loading")]}),p&&(0,d.jsx)("p",{"data-testid":"opencode-settings-error",className:"text-xs text-danger-foreground",children:p})]})]})}),eZ=(0,e.memo)(function({worktreeId:a,selectedAgents:b,onSelectedAgentsChange:c,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:j,maxAgents:l=2,availableAgents:m=al.XH,persistToServer:n=!0}){let o=(0,h.c)("schedule"),p=b.length>l?b.slice(0,l):b,[q,r]=(0,e.useState)(()=>new Set(p)),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),w=(0,e.useRef)(q);w.current=q,(0,e.useEffect)(()=>{u||r(new Set(p))},[b,u,l]);let x=q.has("vibe-local"),y=q.has("opencode"),z=(0,e.useCallback)(async(b,d)=>{let e=new Set(w.current);if(d?e.add(b):(e.delete(b),v(!0)),r(e),e.size>=2){let b=Array.from(e);if(!n){r(new Set(b)),c(b),v(!1);return}t(!0);try{(await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedAgents:b})})).ok?(r(new Set(b)),c(b)):r(new Set(p))}catch{r(new Set(p))}finally{t(!1),v(!1)}}},[a,p,c,n]),A=q.size>=l;return(0,d.jsxs)("div",{className:"p-4",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-1",children:o("agentSettings")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:o("selectAgents")}),(0,d.jsx)("div",{className:"space-y-3",children:m.map(a=>{let b=q.has(a),c=!b&&A;return(0,d.jsxs)("label",{className:`flex items-center gap-3 p-2 rounded-lg border transition-colors ${b?"border-accent-200 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30":c?"border-border bg-muted opacity-50":"border-border hover:border-input hover:bg-muted"}`,children:[(0,d.jsx)(k.Sc,{"data-testid":`agent-checkbox-${a}`,"aria-label":(0,al.oo)(a),checked:b,disabled:c||s,onCheckedChange:b=>z(a,!0===b)}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:(0,al.oo)(a)})]},a)})}),s&&(0,d.jsxs)("div",{"data-testid":"agent-settings-loading",className:"mt-3 flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(k.y$,{size:"xs",variant:"muted"}),o("loading")]}),y&&(0,d.jsx)(eY,{worktreeId:a,instances:eW}),x&&(0,d.jsx)(eU,{worktreeId:a,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:j})]})});function e$(a,b){if(0===b.length)return[];if(null!==a){let c=new Set(a),d=b.filter(a=>c.has(a.id));if(d.length>0)return d}return[...b]}let e_=(0,x.A)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);var e0=c(16945);let e1=(0,x.A)("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);var e2=c(82788),e3=c(77917);let e4=(0,x.A)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);var e5=c(71563),e6=c(59405),e7=c(722),e8=c(31666),e9=c(4267),fa=c(89907);let fb="/api/worktrees/apply-default-agents";var fc=c(85678);let fd=["noteInstanceFlag","noteWaitOnPrompt","noteRespondNumber"];function fe({worktreeId:a,instance:b,isOpen:c,onClose:f}){let g=(0,h.c)("worktree"),[i,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(0),x=n&&p?(0,fc.kj)({binary:n.binary,worktreeId:n.worktreeId,instanceId:p.instanceId,portPrefix:n.portPrefix,messagePlaceholder:g("cliCommands.messagePlaceholder")}):null,y=(0,e.useCallback)(async(a,b)=>{try{await navigator.clipboard.writeText(b),s(a),u(!1)}catch(a){console.error("[InstanceCliCommandsModal] clipboard write failed:",a),s(null),u(!0)}},[]);return(0,d.jsx)(b_.a,{isOpen:c,onClose:f,size:"md",title:g("cliCommands.title",{alias:b.alias}),children:(0,d.jsxs)("div",{className:"space-y-4","data-testid":`cli-commands-panel-${b.id}`,children:[i&&(0,d.jsxs)("div",{"data-testid":"cli-commands-loading",className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(j.y,{size:"xs",variant:"muted"}),g("cliCommands.loading")]}),l&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("p",{"data-testid":"cli-commands-error",className:"text-xs text-danger-foreground",children:g("cliCommands.loadError")}),(0,d.jsx)("button",{type:"button","data-testid":"cli-commands-retry",onClick:()=>w(a=>a+1),className:"text-xs font-medium px-2 py-1 rounded-md border border-input text-foreground hover:bg-muted",children:g("cliCommands.retry")})]}),x&&p&&n&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{"data-testid":"cli-commands-target",className:"text-xs text-muted-foreground break-words",children:g("cliCommands.target",{instance:p.instanceId,tool:(0,al.oo)(p.cliToolId),stage:g(`cliCommands.resolvedBy.${p.resolvedBy}`)})}),p.conflict&&(0,d.jsxs)("p",{"data-testid":"cli-commands-conflict",className:"flex items-start gap-1 text-xs text-warning",children:[(0,d.jsx)(e0.A,{className:"w-3 h-3 mt-0.5 shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{children:g("cliCommands.conflict",{instance:p.conflict.instanceId,roster:(0,al.oo)(p.conflict.rosterCliTool),requested:(0,al.oo)(p.conflict.requestedCliTool)})})]}),(0,d.jsx)("ul",{className:"space-y-3",children:fc.wx.map(a=>(0,d.jsxs)("li",{className:"space-y-1",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground",children:g(`cliCommands.commandLabel.${a}`)}),(0,d.jsxs)("button",{type:"button","data-testid":`cli-commands-copy-${a}`,"aria-label":g("cliCommands.copy"),title:g("cliCommands.copy"),onClick:()=>void y(a,x[a]),className:"flex items-center gap-1 shrink-0 text-xs px-2 py-1 rounded-md border border-input text-muted-foreground hover:text-foreground hover:bg-muted",children:[r===a?(0,d.jsx)(a9.A,{className:"w-3 h-3","aria-hidden":"true"}):(0,d.jsx)(ba.A,{className:"w-3 h-3","aria-hidden":"true"}),r===a?g("cliCommands.copied"):g("cliCommands.copy")]})]}),(0,d.jsx)("code",{"data-testid":`cli-commands-command-${a}`,className:"block whitespace-pre-wrap break-all rounded-md bg-terminal-surface px-2 py-1.5 font-mono text-xs text-terminal-foreground",children:x[a]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:g(`cliCommands.commandDescription.${a}`)})]},a))}),t&&(0,d.jsx)("p",{"data-testid":"cli-commands-copy-error",className:"text-xs text-danger-foreground",children:g("cliCommands.copyFailed")}),null!==n.portPrefix&&(0,d.jsx)("p",{"data-testid":"cli-commands-port-hint",className:"text-xs text-muted-foreground",children:g("cliCommands.portHint",{port:n.portPrefix})}),(0,d.jsxs)("div",{className:"rounded-md border border-border bg-surface-2 p-3",children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-foreground",children:g("cliCommands.notesTitle")}),(0,d.jsx)("ul",{className:"mt-1 space-y-1",children:fd.map(a=>(0,d.jsx)("li",{"data-testid":`cli-commands-${a}`,className:"text-xs text-muted-foreground",children:g(`cliCommands.${a}`)},a))})]})]})]})})}var ff=c(73060),fg=c(76047);let fh=[.5,.5],fi={splits:[{cliToolId:"claude",instanceId:"claude"}],widths:[1]};al.XH;function fj(a){return"number"==typeof a&&Number.isFinite(a)&&a>0}function fk(a){return void 0===a||!!Array.isArray(a)&&2===a.length&&a.every(fj)}function fl(a,b){let c=a+b;if(!Number.isFinite(c)||c<=0)return[1,1];let d=Math.min(a,b);return!Number.isFinite(d)||d<=0?[1,1]:[a/d,b/d]}let fm=Array.from({length:4},(a,b)=>1+b),fn=["new-split","replace","roster-only"];function fo(a,b){return"new-split"!==a||b<4}function fp(a){return fo("new-split",a)?"new-split":"replace"}let fq=new Map;function fr(a,b,c){let d=(0,e.useRef)(b);d.current=b;let f=(0,e.useRef)(c);return f.current=c,(0,e.useCallback)(b=>(function(a,b,c,d){let e,f=((e=fq.get(a))||(e={tail:Promise.resolve(),pending:0,latest:null},fq.set(a,e)),e);f.pending+=1;let g=async()=>{try{let e=f.latest??b(),g=c(e);if(!g)return{status:"skipped"};let h=g.map((a,b)=>({...a,order:b}));try{if(!(await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentInstances:h})})).ok)return{status:"failed"}}catch{return{status:"failed"}}return f.latest=h,d(h),{status:"saved",roster:h}}finally{f.pending-=1,0===f.pending&&fq.delete(a)}},h=f.tail.then(g,g);return f.tail=h,h})(a,()=>d.current,b,a=>f.current(a)),[a])}function fs(a,b){let c=new Set(b.map(a=>a.id));if(!c.has(a))return a;let d=2;for(;c.has(`${a}-${d}`);)d++;return`${a}-${d}`}function ft(a,b){let c=(0,al.oo)(a);if(b===a)return c;let d=b.slice(a.length+1);return d?`${c} ${d}`:c}async function fu(){try{let a=await fetch(`${fa.zk}?include=installed`);if(!a.ok)return null;let b=await a.json();if(!b||"object"!=typeof b)return null;let c=b.installed;if(!Array.isArray(c))return null;let d=new Set(al.XH),e=c.filter(a=>"string"==typeof a&&d.has(a));return e.length>0?e:null}catch{return null}}let fv={"new-split":"placementNewSplit",replace:"placementReplace","roster-only":"placementRosterOnly"},fw=(0,e.memo)(function({worktreeId:a,instances:b,splitCount:c,onInstancesChange:f,onAdded:g}){let i=(0,h.c)("worktree"),j=(0,e.useId)(),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(void 0),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(()=>fp(c)),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),y=b.length>=al.Ab,z=fr(a,b,f),A=(0,e.useCallback)(a=>null==m||m.includes(a),[m]),B=(0,e.useMemo)(()=>al.XH.find(a=>A(a))??"",[A]);(0,e.useEffect)(()=>{if(!k)return;let a=!1;return n(void 0),fu().then(b=>{a||n(b)}),()=>{a=!0}},[k]);let C=o&&A(o)?o:B;(0,e.useEffect)(()=>{t(a=>fo(a,c)?a:fp(c))},[c]);let D=(0,e.useCallback)(()=>{r(""),x(null),t(fp(c)),l(!0)},[c]),E=(0,e.useCallback)(()=>{u||l(!1)},[u]),F=(0,e.useCallback)(async a=>{if(a.preventDefault(),!C||!A(C)||y||u||!fo(s,c))return;let b=q.trim(),d=null;v(!0),x(null);try{let a=await z(a=>{if(a.length>=al.Ab)return null;let c=fs(C,a);return d={id:c,cliTool:C,alias:b||ft(C,c),order:a.length},[...a,d]});if("saved"!==a.status||null===d)return void x(i("agentAdd.saveError"));let c=a.roster.find(a=>a.id===d.id);g?.(c??d,s),l(!1)}finally{v(!1)}},[C,A,y,u,s,c,q,z,i,g]),G=y?i("agentAdd.maxReached",{max:al.Ab}):i("agentAdd.button"),H=!u&&!y&&void 0!==m&&""!==C&&A(C);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(aw.m_,{content:G,placement:"bottom",children:(0,d.jsx)("button",{type:"button",onClick:D,disabled:y,"aria-disabled":y,"aria-label":G,"aria-haspopup":"dialog","data-testid":"agent-add-button",className:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors",children:(0,d.jsx)(bJ.A,{className:"w-4 h-4","aria-hidden":"true"})})}),(0,d.jsx)(b_.a,{isOpen:k,onClose:E,title:i("agentAdd.title"),size:"sm",children:(0,d.jsxs)("form",{id:j,onSubmit:F,"data-testid":"agent-add-form",className:"space-y-4 text-sm",children:[(0,d.jsxs)("label",{className:"block space-y-1",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("agentAdd.tool")}),(0,d.jsx)("select",{"data-testid":"agent-add-tool",value:C,disabled:u||void 0===m,onChange:a=>p(a.target.value),className:"w-full text-sm border border-input rounded-md px-2 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",children:al.XH.map(a=>{let b=A(a),c=(0,al.oo)(a);return(0,d.jsx)("option",{value:a,disabled:!b,children:b?c:i("agentAdd.notInstalled",{name:c})},a)})})]}),null===m&&(0,d.jsx)("p",{"data-testid":"agent-add-installed-unknown",className:"text-xs text-muted-foreground",children:i("agentAdd.installedUnknown")}),(0,d.jsxs)("label",{className:"block space-y-1",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("agentAdd.name")}),(0,d.jsx)("input",{type:"text","data-testid":"agent-add-name",value:q,maxLength:al.pQ,placeholder:i("agentAdd.namePlaceholder"),disabled:u,onChange:a=>r(a.target.value),className:"w-full text-sm border border-input rounded-md px-2 py-2 bg-surface text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),(0,d.jsxs)("fieldset",{className:"space-y-1",children:[(0,d.jsx)("legend",{className:"text-xs font-medium text-muted-foreground",children:i("agentAdd.placement")}),fn.map(a=>{let b=fo(a,c);return(0,d.jsxs)("label",{className:`flex items-center gap-2 py-0.5 ${b?"":"opacity-50 cursor-not-allowed"}`,children:[(0,d.jsx)("input",{type:"radio",name:`${j}-placement`,value:a,"data-testid":`agent-add-placement-${a}`,checked:s===a,disabled:!b||u,onChange:()=>t(a)}),(0,d.jsx)("span",{children:i(`agentAdd.${fv[a]}`)}),!b&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:i("agentAdd.placementNewSplitFull",{max:4})})]},a)})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:i("agentAdd.startHint")}),w&&(0,d.jsx)("p",{role:"alert","data-testid":"agent-add-error",className:"text-xs text-danger",children:w}),(0,d.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,d.jsx)("button",{type:"button",onClick:E,disabled:u,className:"px-3 py-1.5 text-sm rounded-md bg-muted hover:bg-muted/80 text-foreground disabled:opacity-50",children:i("agentAdd.cancel")}),(0,d.jsx)("button",{type:"submit","data-testid":"agent-add-submit",disabled:!H,className:"px-3 py-1.5 text-sm font-medium rounded-md border border-accent-200 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300 hover:bg-accent-100 dark:hover:bg-accent-900/50 disabled:opacity-40 disabled:cursor-not-allowed",children:i("agentAdd.submit")})]})]})})]})});function fx(a){return"prompt"===a.tone?"text-warning":"text-muted-foreground"}let fy=(0,e.memo)(function({worktreeId:a,instances:b,onInstancesChange:c,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:k,modelByInstance:l,sourceByInstance:m,composerTargetInstanceId:n,className:o=""}){let p=(0,h.c)("schedule"),q=(0,bG.Ym)(),{showToast:r}=(0,bO.dj)(),s=(0,h.c)("common"),t=(0,h.c)("worktree"),u=(0,a4.SC)(),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)({}),[B,C]=(0,e.useState)(al.XH[0]),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(null),L=(0,e.useCallback)(async b=>{let c=fg.yW["ja"===q?"ja":"en"];if((n??(0,fg.xk)())===b.id)return void r(c.self,"info");let d=await (0,fg.P0)(a,b,q);if(null===d)return void r(c.failed,"error");let e=(0,fg.oQ)(d);r(e?c.inserted:c.noComposer,e?"success":"error")},[n,q,r,a]),M=function(a,b,c){let[d,f]=(0,e.useState)({});return b.some(a=>"opencode"===a.cliTool),c??d}(0,b,m),N=(0,e7.UI)(a),O=(0,e.useCallback)(c=>c.worktreeId!==a?`${c.instanceId} @ ${c.worktreeId}`:b.find(a=>a.id===c.instanceId)?.alias??c.instanceId,[b,a]),P=b.length>=al.Ab,Q=b.length<=1,R=b.some(a=>"vibe-local"===a.cliTool),S=(0,e.useMemo)(()=>{let a=new Set,c=[];for(let d of b)a.has(d.cliTool)||(a.add(d.cliTool),c.push(d.cliTool));return c},[b]),T=function(a,b){let[c,d]=(0,e.useState)(null),[f,g]=(0,e.useState)(null),[h,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),r=(0,e.useCallback)(a=>{g("string"==typeof a?.repositoryName?a.repositoryName:null),i(a?.repoDeclaresAgents===!0)},[]),s=(0,e.useCallback)(async()=>{k(!0);try{let b=await fetch(`${fb}?worktreeId=${encodeURIComponent(a)}`);if(!b.ok)throw Error(String(b.status));let c=await b.json(),e=c?.eligible;if("number"!=typeof e||!Number.isFinite(e))throw Error("unexpected body");return d(e),r(c),q(null),e}catch{return d(null),q("count"),null}finally{k(!1)}},[a,r]);return{eligible:c,repositoryName:f,repoDeclaresAgents:h,busy:j,savedDefault:l,appliedCount:n,error:p,refreshEligible:s,saveAsDefault:(0,e.useCallback)(async()=>{k(!0),q(null),m(!1),o(null);try{let a=await fetch(fa.zk,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:b})}),c=await a.json().catch(()=>null),d=c?.defaultSelectedAgents;if(!a.ok||!Array.isArray(d))return q("save"),!1;return(0,fa.IK)(d),m(!0),!0}catch{return q("save"),!1}finally{k(!1)}},[b]),applyToUnchanged:(0,e.useCallback)(async()=>{k(!0),q(null),m(!1);try{let c=await fetch(fb,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({worktreeId:a,agents:b})}),e=await c.json().catch(()=>null),f=e?.updated;if(!c.ok||"number"!=typeof f||!Number.isFinite(f))return q("apply"),null;o(f),r(e);let g=e.eligible;return"number"==typeof g&&Number.isFinite(g)&&d(g),f}catch{return q("apply"),null}finally{k(!1)}},[a,b,r])}}(a,S),U=S.length>=e9.eu&&S.length<=e9.Wj,V=v||T.busy,W=U&&!T.repoDeclaresAgents&&null!==T.eligible&&T.eligible>0,X="count"===T.error?p("agentDefaultsCountError"):"save"===T.error?p("agentDefaultsSaveError"):"apply"===T.error?p("agentDefaultsApplyError"):null,Y=(0,e.useCallback)(()=>{let a=!H;I(a),a&&T.refreshEligible()},[H,T]),Z=(0,e.useCallback)(async()=>{if(!W)return;let a=await T.refreshEligible();null!==a&&0!==a&&await u({description:p("agentDefaultsApplyConfirm",{count:a,agents:S.map(a=>(0,al.oo)(a)).join(", ")})})&&await T.applyToUnchanged()},[W,T,u,p,S]),$=fr(a,b,c),_=(0,e.useCallback)(async a=>{w(!0),y(null);try{let b=await $(a);"failed"===b.status&&y(p("agentInstanceSaveError"))}finally{w(!1)}},[$,p]),aa=(0,e.useCallback)(()=>{b.length>=al.Ab||_(a=>{if(a.length>=al.Ab)return null;let b=fs(B,a);return[...a,{id:b,cliTool:B,alias:ft(B,b),order:a.length}]})},[B,b,_]),ab=(0,e.useCallback)(async a=>{if(b.length<=1)return;let c=b.find(b=>b.id===a);await u({description:s("confirmDelete",{name:c?.alias??""}),variant:"danger"})&&_(b=>b.length<=1||!b.some(b=>b.id===a)?null:b.filter(b=>b.id!==a))},[b,_,u,s]),ac=(0,e.useCallback)((a,c)=>{if(a===c||a<0||c<0||a>=b.length||c>=b.length)return;let d=b[a].id,e=b[c].id;_(a=>{let b=a.findIndex(a=>a.id===d),c=a.findIndex(a=>a.id===e);if(-1===b||-1===c||b===c)return null;let f=[...a],[g]=f.splice(b,1);return f.splice(c,0,g),f})},[b,_]),ad=(0,e.useCallback)((a,b)=>{ac(a,a+b)},[ac]),ae=(0,e.useCallback)((a,c)=>{A(b=>{if(!(a in b))return b;let c={...b};return delete c[a],c});let d=b.find(b=>b.id===a);d&&c!==d.alias&&_(b=>b.some(b=>b.id===a)?b.map(b=>b.id===a?{...b,alias:c}:b):null)},[b,_]),af=["flex flex-col p-4",o?"overflow-y-auto":"",o].filter(Boolean).join(" ");return(0,d.jsxs)("div",{className:af,"data-testid":"agent-instances-pane",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-1",children:p("agentInstances")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:p("agentInstancesDescription")}),(0,d.jsx)("div",{className:"space-y-2",children:b.map((c,e)=>{let f=c.id in z?z[c.id]:c.alias,g=D===e,h=l?.[c.id]??null,i=M?.[c.id],j=cy(i,t),k=!!i&&("sse"!==i.kind||"live"!==i.liveness),m=(0,e8.g)({owed:N.owedBy(c.id),awaiting:N.awaitedBy(c.id),aliasOf:O}),o=n===c.id;return(0,d.jsxs)("div",{"data-testid":`agent-instance-row-${c.id}`,draggable:!0,onDragStart:()=>E(e),onDragOver:a=>a.preventDefault(),onDrop:()=>{null!==D&&ac(D,e),E(null)},onDragEnd:()=>E(null),className:`flex items-center gap-2 p-2 rounded-lg border border-border bg-surface transition-colors hover:border-accent-300 dark:hover:border-accent-700 focus-within:border-accent-500 ${g?"opacity-50":""}`,children:[(0,d.jsx)("span",{className:"cursor-grab text-muted-foreground shrink-0","aria-hidden":"true",children:(0,d.jsx)(e_,{className:"w-4 h-4"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("input",{type:"text","data-testid":`agent-instance-alias-${c.id}`,"aria-label":p("agentInstanceAliasLabel"),value:f,maxLength:al.pQ,disabled:v,placeholder:p("agentInstanceAliasPlaceholder"),onChange:a=>A(b=>({...b,[c.id]:a.target.value})),onBlur:a=>ae(c.id,a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.nativeEvent.isComposing||a.currentTarget.blur()},className:"w-full text-sm font-medium border border-input rounded-md px-2 py-1 bg-surface dark:bg-surface-2 text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50"}),(0,d.jsx)(dE.nR,{content:(0,al.oo)(c.cliTool),className:"mt-0.5 block truncate text-xs text-muted-foreground"}),h&&(0,d.jsx)("span",{"data-testid":`agent-instance-model-${c.id}`,title:t("agentModel.modelLabel",{model:h}),className:"mt-0.5 block truncate text-xs text-muted-foreground",children:h}),j&&(0,d.jsxs)("span",{"data-testid":`agent-instance-source-${c.id}`,title:t(k?"agentSource.degradedTitle":"agentSource.healthyTitle"),className:`mt-0.5 flex items-center gap-1 truncate text-xs ${k?"text-warning":"text-muted-foreground"}`,children:[k?(0,d.jsx)(e0.A,{className:"w-3 h-3 shrink-0","aria-hidden":"true"}):(0,d.jsx)(e1,{className:"w-3 h-3 shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:j})]}),m.map(a=>(0,d.jsxs)("span",{"data-testid":`agent-instance-relay-${a.tone}-${c.id}`,title:t(`relay.${a.titleKey}`),className:`mt-0.5 flex items-center gap-1 truncate text-xs ${fx(a)}`,children:[(0,d.jsx)(e2.A,{className:"w-3 h-3 shrink-0","aria-hidden":"true"}),(0,d.jsx)("span",{className:"truncate",children:t(`relay.${a.key}`,a.params)})]},a.key))]}),(0,d.jsx)("button",{type:"button","data-testid":`agent-instance-cli-${c.id}`,"aria-label":t("cliCommands.open"),title:t("cliCommands.open"),onClick:()=>K(c.id),className:"shrink-0 p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted",children:(0,d.jsx)(e3.A,{className:"w-4 h-4"})}),J===c.id&&(0,d.jsx)(fe,{worktreeId:a,instance:c,isOpen:!0,onClose:()=>K(null)}),(0,d.jsxs)(an.rI,{children:[(0,d.jsx)(an.ty,{asChild:!0,children:(0,d.jsx)("button",{type:"button","data-testid":`agent-instance-menu-${c.id}`,"aria-label":p("agentInstanceActions"),title:p("agentInstanceActions"),disabled:v,className:"shrink-0 p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-30 disabled:cursor-not-allowed",children:(0,d.jsx)(e4,{className:"w-4 h-4"})})}),(0,d.jsxs)(an.SQ,{align:"end",children:[!o&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(an._2,{"data-testid":`agent-instance-delegate-${c.id}`,onSelect:()=>{L(c)},children:[(0,d.jsx)(e5.A,{className:"w-4 h-4"}),fg.yW["ja"===q?"ja":"en"].menuItem]}),(0,d.jsx)(an.mB,{})]}),(0,d.jsxs)(an._2,{"data-testid":`agent-instance-move-up-${c.id}`,disabled:0===e,onSelect:()=>ad(e,-1),children:[(0,d.jsx)(d$.A,{className:"w-4 h-4"}),p("agentInstanceMoveUp")]}),(0,d.jsxs)(an._2,{"data-testid":`agent-instance-move-down-${c.id}`,disabled:e===b.length-1,onSelect:()=>ad(e,1),children:[(0,d.jsx)(aj.A,{className:"w-4 h-4"}),p("agentInstanceMoveDown")]}),(0,d.jsx)(an.mB,{}),(0,d.jsxs)(an._2,{"data-testid":`agent-instance-delete-${c.id}`,disabled:Q,onSelect:()=>{ab(c.id)},className:"text-danger-foreground focus:text-danger-foreground",children:[(0,d.jsx)(dz,{className:"w-4 h-4"}),p("agentInstanceDelete")]})]})]})]},c.id)})}),(0,d.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,d.jsx)("select",{"data-testid":"agent-instance-add-tool","aria-label":p("agentInstanceBaseTool"),value:B,disabled:v||P,onChange:a=>C(a.target.value),className:"flex-1 min-w-0 text-sm border border-input rounded-md px-2 py-2 bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-accent-500 disabled:opacity-50",children:al.XH.map(a=>(0,d.jsx)("option",{value:a,children:(0,al.oo)(a)},a))}),(0,d.jsxs)("button",{type:"button","data-testid":"agent-instance-add",disabled:v||P,onClick:aa,className:"flex items-center gap-1 text-sm font-medium px-3 py-2 rounded-md border border-accent-200 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300 hover:bg-accent-100 dark:hover:bg-accent-900/50 disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:[(0,d.jsx)(bJ.A,{className:"w-4 h-4"}),p("agentInstanceAdd")]})]}),P&&(0,d.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:p("agentInstanceMax",{max:al.Ab})}),Q&&(0,d.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:p("agentInstanceMin",{min:1})}),v&&(0,d.jsxs)("div",{"data-testid":"agent-instances-loading",className:"mt-3 flex items-center gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(j.y,{size:"xs",variant:"muted"}),p("loading")]}),x&&(0,d.jsx)("p",{"data-testid":"agent-instances-error",className:"mt-3 text-xs text-danger-foreground",children:x}),R&&(0,d.jsx)(eU,{worktreeId:a,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:k}),(0,d.jsxs)("div",{className:"mt-6 border-t border-border pt-4",children:[(0,d.jsxs)("button",{type:"button","data-testid":"agent-defaults-toggle","aria-expanded":H,onClick:Y,className:"flex w-full items-center gap-1 text-left text-sm font-semibold text-foreground hover:text-accent-600 dark:hover:text-accent-400",children:[H?(0,d.jsx)(aj.A,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}):(0,d.jsx)(e6.A,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),p("agentDefaults")]}),H&&(0,d.jsxs)("div",{className:"mt-2 space-y-3","data-testid":"agent-defaults-section",children:[(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:p("agentDefaultsDescription")}),(0,d.jsx)("p",{"data-testid":"agent-defaults-roster",className:"text-xs font-medium text-foreground break-words",children:S.map(a=>(0,al.oo)(a)).join(" → ")}),!U&&(0,d.jsx)("p",{"data-testid":"agent-defaults-invalid",className:"text-xs text-warning-foreground",children:p("agentDefaultsInvalidRoster",{min:e9.eu,max:e9.Wj})}),(0,d.jsx)("button",{type:"button","data-testid":"agent-defaults-set-default",disabled:V||!U,onClick:()=>{T.saveAsDefault()},className:"w-full text-sm font-medium px-3 py-2 rounded-md border border-accent-200 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300 hover:bg-accent-100 dark:hover:bg-accent-900/50 disabled:opacity-40 disabled:cursor-not-allowed",children:p("agentDefaultsSetDefault")}),(0,d.jsxs)("div",{className:"space-y-1",children:[T.repositoryName&&(0,d.jsx)("p",{"data-testid":"agent-defaults-repository","data-repository":T.repositoryName,className:"text-xs text-muted-foreground",children:p("agentDefaultsRepositoryLabel",{repository:T.repositoryName})}),T.repoDeclaresAgents&&(0,d.jsx)("p",{"data-testid":"agent-defaults-repo-declared",className:"text-xs text-warning-foreground",children:p("agentDefaultsRepoDeclared")}),!T.repoDeclaresAgents&&(0,d.jsx)("span",{"data-testid":"agent-defaults-eligible","data-count":T.eligible??void 0,className:"block text-xs text-muted-foreground",children:null===T.eligible?p("agentDefaultsEligibleUnknown"):p("agentDefaultsEligible",{count:T.eligible})}),(0,d.jsx)("button",{type:"button","data-testid":"agent-defaults-apply",disabled:V||!W,onClick:()=>{Z()},className:"w-full text-sm font-medium px-3 py-2 rounded-md border border-border bg-surface text-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed",children:p("agentDefaultsApply")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:p("agentDefaultsApplyScope")})]}),T.savedDefault&&(0,d.jsxs)("p",{"data-testid":"agent-defaults-saved",className:"flex items-center gap-1 text-xs text-success-foreground",children:[(0,d.jsx)(a9.A,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),p("agentDefaultsSaved")]}),null!==T.appliedCount&&(0,d.jsxs)("p",{"data-testid":"agent-defaults-applied","data-count":T.appliedCount,className:"flex items-center gap-1 text-xs text-success-foreground",children:[(0,d.jsx)(a9.A,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),p("agentDefaultsApplied",{count:T.appliedCount})]}),X&&(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("p",{"data-testid":"agent-defaults-error",className:"text-xs text-danger-foreground",children:X}),"count"===T.error&&(0,d.jsx)("button",{type:"button","data-testid":"agent-defaults-retry",disabled:V,onClick:()=>{T.refreshEligible()},className:"text-xs font-medium underline text-accent-700 dark:text-accent-300 disabled:opacity-40 disabled:cursor-not-allowed",children:p("agentDefaultsRetry")})]})]})]}),(0,d.jsxs)("div",{className:"mt-6 border-t border-border pt-4",children:[(0,d.jsxs)("button",{type:"button","data-testid":"agent-updates-toggle","aria-expanded":F,onClick:()=>G(a=>!a),className:"flex w-full items-center gap-1 text-left text-sm font-semibold text-foreground hover:text-accent-600 dark:hover:text-accent-400",children:[F?(0,d.jsx)(aj.A,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}):(0,d.jsx)(e6.A,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),s("agentUpdates.title")]}),F&&(0,d.jsx)("div",{className:"mt-2",children:(0,d.jsx)(ff.uN,{worktreeId:a,instances:b.map(a=>({id:a.id,cliTool:a.cliTool,alias:a.alias})),variant:"plain"})})]})]})}),fz=(0,e.memo)(function({worktreeId:a,instances:b,onInstancesChange:c,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:j,visibleInstanceIds:l,onToggleInstanceVisible:m,modelByInstance:n,sourceByInstance:o,composerTargetInstanceId:p}){let q=(0,h.c)("schedule"),r=(0,h.c)("worktree"),s=new Set(l),t=l.length<=1,u=(0,e7.UI)(a),v=(0,e.useCallback)(c=>c.worktreeId!==a?`${c.instanceId} @ ${c.worktreeId}`:b.find(a=>a.id===c.instanceId)?.alias??c.instanceId,[b,a]);return(0,d.jsxs)("div",{"data-testid":"mobile-agent-instances-pane",children:[(0,d.jsx)(fy,{worktreeId:a,instances:b,onInstancesChange:c,vibeLocalModel:f,onVibeLocalModelChange:g,vibeLocalContextWindow:i,onVibeLocalContextWindowChange:j,modelByInstance:n,sourceByInstance:o,composerTargetInstanceId:p}),(0,d.jsxs)("div",{"data-testid":"mobile-visible-instances",className:"px-4 pb-4 border-t border-border mt-2 pt-4",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-1",children:q("mobileVisibleInstances")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:q("mobileVisibleInstancesDescription")}),(0,d.jsx)("div",{className:"space-y-1",children:b.map(a=>{let b=s.has(a.id),c=b&&t,e=n?.[a.id]??null,f=(0,e8.g)({owed:u.owedBy(a.id),awaiting:u.awaitedBy(a.id),aliasOf:v});return(0,d.jsxs)("label",{className:`flex items-center gap-2 p-2 rounded-lg cursor-pointer ${c?"opacity-60 cursor-not-allowed":"hover:bg-muted"}`,children:[(0,d.jsx)(k.Sc,{"data-testid":`mobile-visible-instance-toggle-${a.id}`,checked:b,disabled:c,onCheckedChange:()=>m(a.id)}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"block text-sm font-medium text-foreground truncate",children:(0,al.sw)(a)}),(0,d.jsx)("span",{className:"block text-xs text-muted-foreground truncate",children:(0,al.oo)(a.cliTool)}),e&&(0,d.jsx)("span",{"data-testid":`mobile-visible-instance-model-${a.id}`,title:r("agentModel.modelLabel",{model:e}),className:"block text-xs text-muted-foreground truncate",children:e}),f.map(b=>(0,d.jsx)("span",{"data-testid":`mobile-visible-instance-relay-${b.tone}-${a.id}`,title:r(`relay.${b.titleKey}`),className:`block text-xs truncate ${fx(b)}`,children:r(`relay.${b.key}`,b.params)},b.key))]})]},a.id)})}),t&&(0,d.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:q("mobileVisibleInstanceMin")})]})]})}),fA=Array.from({length:Math.floor(104)+1},(a,b)=>3e5+3e5*b);var fB=c(63643);function fC(a){let b=Math.floor(a/6e4),c=Math.floor(b/60),d=b%60;return c>0&&d>0?`${c}h ${d}m`:c>0?`${c}h`:`${d}m`}let fD="w-full px-3 py-2 text-sm border border-input rounded-md bg-surface dark:bg-surface-2 text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring";function fE({isOpen:a,worktreeId:b,instances:c,onClose:f,onSaved:g}){let i=(0,h.c)("schedule"),j=(0,dV.a)(),k=(0,e.useMemo)(()=>c&&c.length>0?c:(0,al.lu)([...al.XH]),[c]),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(()=>k[0]?.id??al.XH[0]),[p,q]=(0,e.useState)(fA[0]),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(null),v=l.trim().length>0&&!r,w=(0,e.useCallback)(async()=>{if(!l.trim()||r)return;let a=k.find(a=>a.id===n);if(a){u(null),s(!0);try{let c=await fetch(`/api/worktrees/${b}/timers`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:a.cliTool,instanceId:a.id,message:l.trim(),delayMs:p})});if(c.ok){let a=await c.json();g(),"session_not_running"===a.warning?(u("session_not_running"),m("")):f()}}catch{}finally{s(!1)}}},[b,k,n,l,p,r,g,f]),x=(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1",htmlFor:"timer-instance-select",children:i("timer.agent")}),(0,d.jsx)("select",{id:"timer-instance-select","data-testid":"timer-instance-select",value:n,onChange:a=>o(a.target.value),className:fD,children:k.map(a=>(0,d.jsx)("option",{value:a.id,children:a.alias},a.id))})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1",htmlFor:"timer-message-input",children:i("timer.message")}),(0,d.jsx)("textarea",{id:"timer-message-input","data-testid":"timer-message-input",value:l,onChange:a=>m(a.target.value),placeholder:i("timer.message"),maxLength:1e4,rows:3,className:`${fD} resize-none`})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1",htmlFor:"timer-delay-select",children:i("timer.delay")}),(0,d.jsx)("select",{id:"timer-delay-select","data-testid":"timer-delay-select",value:p,onChange:a=>q(Number(a.target.value)),className:fD,children:fA.map(a=>(0,d.jsx)("option",{value:a,children:fC(a)},a))})]}),"session_not_running"===t&&(0,d.jsx)("div",{"data-testid":"timer-session-warning",className:"text-xs p-2 rounded bg-warning-subtle text-warning-foreground",children:i("timer.sessionWarning")})]}),y=(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:f,className:"px-4 py-2 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",children:i("timer.close")}),(0,d.jsx)("button",{type:"button","data-testid":"timer-register-button",onClick:()=>void w(),disabled:!v,className:"px-4 py-2 text-sm font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-md transition-colors",children:i("timer.register")})]}),z=i("timer.titleCreate");return j?(0,d.jsx)(ec,{isOpen:a,onClose:f,title:z,footer:y,children:x}):(0,d.jsx)(b_.a,{isOpen:a,onClose:f,title:z,size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[x,(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:y})]})})}function fF(a){return new Date(a).toLocaleString()}function fG({timer:a,instances:b,onClose:c}){let e=(0,h.c)("schedule"),f=(0,dV.a)();if(!a)return null;let g=b.find(b=>b.id===a.instanceId)?.alias??a.cliToolId,i=({label:a,children:b})=>(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-muted-foreground mb-0.5",children:a}),(0,d.jsx)("div",{className:"text-sm text-foreground break-words",children:b})]}),j=(0,d.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"timer-detail-body",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-muted-foreground mb-1",children:e("timer.message")}),(0,d.jsx)("pre",{"data-testid":"timer-detail-message",className:"text-sm whitespace-pre-wrap break-words font-mono text-foreground bg-muted rounded p-2 max-h-60 overflow-y-auto",children:a.message})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,d.jsx)(i,{label:e("timer.agent"),children:(0,d.jsx)("span",{className:"text-accent-600 dark:text-accent-400 font-medium",children:g})}),(0,d.jsx)(i,{label:e("timer.statusLabel"),children:(0,d.jsx)("span",{className:function(a){switch(a){case"pending":return"text-info";case"sending":case"no_session":return"text-warning-foreground";case"sent":return"text-success-foreground";case"failed":return"text-danger-foreground";default:return"text-muted-foreground"}}(a.status),children:e(`timer.status.${a.status}`)})}),(0,d.jsx)(i,{label:e("timer.delay"),children:fC(a.delayMs)}),(0,d.jsx)(i,{label:e("timer.scheduledTime"),children:fF(a.scheduledSendTime)}),(0,d.jsx)(i,{label:e("timer.createdTime"),children:fF(a.createdAt)}),null!==a.sentAt&&(0,d.jsx)(i,{label:e("timer.sentTime"),children:fF(a.sentAt)})]}),"failed"===a.status&&a.error&&(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-xs font-semibold text-danger-foreground mb-1",children:e("timer.failureReason")}),(0,d.jsx)("pre",{"data-testid":"timer-detail-error",className:"text-xs whitespace-pre-wrap break-words font-mono text-danger-foreground bg-danger-subtle rounded p-2 max-h-40 overflow-y-auto",children:a.error})]})]}),k=(0,d.jsx)("div",{className:"flex items-center justify-end",children:(0,d.jsx)("button",{type:"button","data-testid":"timer-detail-close",onClick:c,className:"px-4 py-2 text-sm font-medium text-foreground hover:bg-muted rounded-md transition-colors",children:e("timer.close")})}),l=e("timer.detailTitle");return f?(0,d.jsx)(ec,{isOpen:!0,title:l,onClose:c,footer:k,children:j}):(0,d.jsx)(b_.a,{isOpen:!0,title:l,onClose:c,size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[j,(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:k})]})})}let fH=(0,e.memo)(function({worktreeId:a,instances:b}){let c=(0,h.c)("schedule"),f=(0,a4.SC)(),g=(0,e.useMemo)(()=>b&&b.length>0?b:(0,al.lu)([...al.XH]),[b]),[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(null),[,q]=(0,e.useState)(0),r=(0,e.useRef)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useCallback)(async()=>{try{let b=await fetch(`/api/worktrees/${a}/timers`);if(b.ok){let a=await b.json();j(a.timers),l(a.hasMore??!1),a.timers.length>0?t.current=a.timers[a.timers.length-1].createdAt:t.current=null}}catch{}},[a]),v=(0,e.useCallback)(async()=>{if(null!=t.current)try{let b=new URLSearchParams;b.set("before",String(t.current)),b.set("limit",String(50));let c=await fetch(`/api/worktrees/${a}/timers?${b}`);if(c.ok){let a=await c.json();j(b=>[...b,...a.timers]),l(a.hasMore??!1),a.timers.length>0&&(t.current=a.timers[a.timers.length-1].createdAt)}}catch{}},[a]);(0,e.useEffect)(()=>{function a(){return u(),r.current=setInterval(()=>{u()},1e4),s.current=setInterval(()=>{q(a=>a+1)},1e3),b}function b(){r.current&&clearInterval(r.current),s.current&&clearInterval(s.current),r.current=null,s.current=null}a();let c=()=>{"hidden"===document.visibilityState?b():a()};return document.addEventListener("visibilitychange",c),()=>{b(),document.removeEventListener("visibilitychange",c)}},[u]);let w=(0,e.useCallback)(async b=>{try{(await fetch(`/api/worktrees/${a}/timers?timerId=${b}`,{method:"DELETE"})).ok&&u()}catch{}},[a,u]),x=(0,e.useCallback)(async()=>{if(await f({description:c("timer.clearConfirm"),variant:"danger"}))try{(await fetch(`/api/worktrees/${a}/timers/history`,{method:"DELETE"})).ok&&u()}catch{}},[a,u,c,f]),z=i.filter(a=>"pending"===a.status).length>=5;return(0,d.jsxs)("div",{className:"flex flex-col h-full p-3 gap-3 overflow-auto",children:[0===i.length?(0,d.jsxs)("div",{className:"flex flex-col items-center text-center py-8 px-4",children:[(0,d.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-accent-50 text-accent-600 dark:bg-accent-900/30 dark:text-accent-300",children:(0,d.jsx)(y,{className:"w-7 h-7"})}),(0,d.jsx)("p",{className:"font-semibold text-foreground mb-1",children:c("timer.title")}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-5 max-w-xs",children:c("timer.noTimers")}),(0,d.jsxs)("button",{type:"button","data-testid":"timer-empty-cta",onClick:()=>n(!0),className:"inline-flex items-center gap-1.5 px-5 py-2.5 text-sm font-semibold text-white bg-accent-600 hover:bg-accent-700 rounded-lg shadow-sm transition-colors",children:[(0,d.jsx)(bJ.A,{className:"w-4 h-4"}),c("timer.createButton")]})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[z&&(0,d.jsx)("span",{className:"text-xs text-warning-foreground",children:c("timer.maxReached",{max:5})}),(0,d.jsxs)("button",{type:"button","data-testid":"timer-new-button",onClick:()=>n(!0),disabled:z,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded transition-colors whitespace-nowrap",children:[(0,d.jsx)(bJ.A,{className:"w-3.5 h-3.5"}),c("timer.newTimer")]})]}),i.map(a=>(0,d.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"timer-row",onClick:()=>p(a),onKeyDown:b=>{("Enter"===b.key||" "===b.key)&&(b.preventDefault(),p(a))},className:"flex items-center gap-2 p-2 rounded-lg border border-border bg-surface text-left cursor-pointer hover:bg-muted transition-colors",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"text-sm text-foreground truncate",children:a.message.length>60?a.message.slice(0,60)+"...":a.message}),(0,d.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,d.jsx)("span",{className:"text-accent-600 dark:text-accent-400 font-medium",children:g.find(b=>b.id===a.instanceId)?.alias??a.cliToolId}),(0,d.jsx)("span",{className:function(a){switch(a){case"pending":return"text-info";case"sending":case"no_session":return"text-warning-foreground";case"sent":return"text-success-foreground";case"failed":return"text-danger-foreground";default:return"text-muted-foreground"}}(a.status),children:c(`timer.status.${a.status}`)}),"pending"===a.status&&(0,d.jsx)("span",{className:"text-muted-foreground",children:(0,fB.$B)(a.scheduledSendTime)}),(0,d.jsx)("span",{className:"text-muted-foreground",children:fC(a.delayMs)})]})]}),"pending"===a.status&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),w(a.id)},className:"px-2 py-1 text-xs text-danger-foreground hover:bg-danger-subtle rounded transition-colors",children:c("timer.cancel")})]},a.id)),k&&(0,d.jsx)("button",{type:"button",onClick:v,className:"px-3 py-2 text-sm text-accent-600 dark:text-accent-400 hover:bg-accent-50 dark:hover:bg-accent-900/20 rounded-md transition-colors text-center",children:c("timer.loadMore")}),i.some(a=>"pending"!==a.status)&&(0,d.jsx)("button",{type:"button",onClick:x,className:"px-3 py-2 text-sm text-muted-foreground hover:bg-muted rounded-md transition-colors text-center",children:c("timer.clearHistory")})]}),(0,d.jsx)(fE,{isOpen:m,worktreeId:a,instances:b,onClose:()=>n(!1),onSaved:()=>{u()}}),(0,d.jsx)(fG,{timer:o,instances:g,onClose:()=>p(null)})]})});var fI=c(79944),fJ=c(81136);let fK={verified:"skills.compatibility.axisOutcome.verified",unsupported:"skills.compatibility.axisOutcome.unsupported",unknown:"skills.compatibility.axisOutcome.unknown"},fL={mechanical:"skills.compatibility.evidenceKind.mechanical",self_report:"skills.compatibility.evidenceKind.selfReport",not_measured:"skills.compatibility.evidenceKind.notMeasured"},fM={outcome:"unknown",evidenceKind:"not_measured",labelKey:fK.unknown,evidenceKindKey:fL.not_measured,limitationKey:null},fN={SESSION_RESTART:"skills.compatibility.reload.sessionRestart",SESSION_RESTART_NO_SLASH:"skills.compatibility.reload.sessionRestartNoSlash",PICKED_UP_LIVE:"skills.compatibility.reload.pickedUpLive",UNKNOWN:"skills.compatibility.reload.unknown"},fO={NO_SLASH_COMMAND:"skills.compatibility.limitation.noSlashCommand"};function fP(a){return{agent:a,discoveryRoots:[],discovery:fM,invocation:fM,testedVersion:null,testedDate:null,evidenceSource:null,reloadKey:fN.UNKNOWN,skipReasonKey:"skills.compatibility.skipReason.notMeasured"}}fJ.td,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fN.SESSION_RESTART,fJ.Co,fK.verified,fL.self_report,fK.unsupported,fL.mechanical,fO.NO_SLASH_COMMAND,fN.SESSION_RESTART_NO_SLASH,fP("gemini"),fP("vibe-local"),fJ.Co,fJ.td,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fO.NO_SLASH_COMMAND,fN.SESSION_RESTART,fJ.Co,fJ.td,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fN.UNKNOWN,fP("antigravity"),fJ.Co,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fN.SESSION_RESTART,fJ.Co,fJ.td,fK.verified,fL.mechanical,fK.verified,fL.mechanical,fO.NO_SLASH_COMMAND,fN.PICKED_UP_LIVE;let fQ={SATISFIED:"SKILL_COMPAT_SATISFIED",HOST_VERSION_OUT_OF_RANGE:"SKILL_COMPAT_HOST_VERSION_OUT_OF_RANGE",HOST_VERSION_UNKNOWN:"SKILL_COMPAT_HOST_VERSION_UNKNOWN",RANGE_UNSUPPORTED:"SKILL_COMPAT_RANGE_UNSUPPORTED"};fQ.SATISFIED,fQ.HOST_VERSION_OUT_OF_RANGE,fQ.HOST_VERSION_UNKNOWN,fQ.RANGE_UNSUPPORTED;let fR={CONFIRMED:"SKILL_AGENT_EVIDENCE_CONFIRMED",RESTRICTED:"SKILL_AGENT_EVIDENCE_RESTRICTED",STALE_DECLARATION:"SKILL_AGENT_EVIDENCE_STALE_DECLARATION",UNVERIFIED:"SKILL_AGENT_EVIDENCE_UNVERIFIED"};fR.CONFIRMED,fR.RESTRICTED,fR.STALE_DECLARATION,fR.UNVERIFIED;let fS=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function fT(a){if("string"!=typeof a||a.length>64)return null;let b=fS.exec(a);return b?{major:Number(b[1]),minor:Number(b[2]),patch:Number(b[3]),prerelease:b[4]?b[4].split("."):[],build:b[5]?b[5].split("."):[]}:null}let fU={UP_TO_DATE:"SKILL_UPDATE_UP_TO_DATE",HIGHEST_COMPATIBLE:"SKILL_UPDATE_RECOMMEND_HIGHEST_COMPATIBLE",LATEST_UNVERIFIED:"SKILL_UPDATE_RECOMMEND_LATEST_UNVERIFIED",NONE_COMPATIBLE:"SKILL_UPDATE_RECOMMEND_NONE_COMPATIBLE",INSTALLED_VERSION_INVALID:"SKILL_UPDATE_INSTALLED_VERSION_INVALID",RANGE_UNSUPPORTED:"SKILL_UPDATE_RANGE_UNSUPPORTED"};function fV(a,b){let c=function(a,b){let c=fT(a),d=fT(b);return c&&d?c.major!==d.major?c.major<d.major?-1:1:c.minor!==d.minor?c.minor<d.minor?-1:1:c.patch!==d.patch?c.patch<d.patch?-1:1:function(a,b){if(0===a.length&&0===b.length)return 0;if(0===a.length)return 1;if(0===b.length)return -1;let c=Math.min(a.length,b.length);for(let d=0;d<c;d++){let c=a[d],e=b[d];if(c===e)continue;let f=/^\d+$/.test(c),g=/^\d+$/.test(e);if(f&&g)return Number(c)<Number(e)?-1:1;if(f)return -1;if(g)return 1;return c<e?-1:1}return a.length===b.length?0:a.length<b.length?-1:1}(c.prerelease,d.prerelease):null}(a,b);return null!==c&&c>0}fU.UP_TO_DATE,fU.HIGHEST_COMPATIBLE,fU.LATEST_UNVERIFIED,fU.NONE_COMPATIBLE,fU.INSTALLED_VERSION_INVALID,fU.RANGE_UNSUPPORTED;var fW=c(28593),fX=c(9815),fY=c(3805),fZ=c(27884),f$=c(30156);let f_={open:!1,selectedVersion:null,busy:!1,plan:null,failure:null,riskAcknowledged:!1,riskIncreaseAcknowledged:!1,applying:!1,applyResult:null,applyFailure:null};function f0({heading:a,paths:b,testid:c}){return 0===b.length?null:(0,d.jsxs)("div",{"data-testid":c,children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a}),(0,d.jsx)("ul",{className:"mt-1 space-y-0.5",children:b.map(a=>(0,d.jsx)("li",{className:"break-all font-mono text-xs text-foreground",children:a},a))})]})}function f1({skillId:a,skillName:b,worktreeId:c,installedVersion:f,versions:g}){let i=(0,h.c)("skills"),j=(0,e.useMemo)(()=>g.filter(a=>fV(a.version,f)),[g,f]),l=(0,e.useMemo)(()=>(j.find(a=>"compatible"===a.compatibility.commandmate.status)??j[0])?.version??null,[j]),[m,n]=(0,e.useState)(f_),o=(0,e.useCallback)(()=>{n({...f_,open:!0,selectedVersion:l})},[l]),p=(0,e.useCallback)(()=>{n(f_)},[]),q=(0,e.useCallback)(async()=>{let b=m.selectedVersion;if(!b)return;n(a=>({...a,busy:!0,plan:null,failure:null,riskAcknowledged:!1,riskIncreaseAcknowledged:!1,applyResult:null,applyFailure:null}));let d=await (0,f$.Sw)(c,a,{version:b});n(a=>({...a,busy:!1,plan:d.ok?d.data.plan:null,failure:d.ok?null:d.failure}))},[a,m.selectedVersion,c]),r=(0,e.useCallback)(async()=>{var b;let d=m.plan;if(!d||!d.updatable)return;n(a=>({...a,applying:!0,applyFailure:null}));let e=await (0,f$.h2)(c,a,{planToken:d.token,version:d.update.toVersion,acknowledgeRisk:m.riskAcknowledged,acknowledgeRiskIncrease:m.riskIncreaseAcknowledged,idempotencyKey:(b=d.token,`skill-update-${b}`)});n(a=>({...a,applying:!1,applyResult:e.ok?e.data:null,applyFailure:e.ok?null:e.failure}))},[a,m.plan,m.riskAcknowledged,m.riskIncreaseAcknowledged,c]);if(0===j.length)return(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-update-uptodate",children:i("update.upToDate",{version:f})});let s=m.plan,t=m.applyResult;return(0,d.jsxs)("div",{"data-testid":"skill-update-dialog-host",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(k.Ex,{variant:"info","data-testid":"skill-update-badge",children:i("update.badge")}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:i("update.fromTo",{from:f,to:j[0].version})}),(0,d.jsx)(k.$n,{variant:"secondary",size:"sm",onClick:o,"data-testid":"skill-update-trigger",children:i("update.open")})]}),(0,d.jsx)(k.Jh,{isOpen:m.open,onClose:p,title:i("update.heading"),size:"lg",children:(0,d.jsxs)("div",{className:"space-y-3 p-4","data-testid":"skill-update-dialog",children:[(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:i("update.intro",{skill:b,version:f})}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:i("update.ready")}),(0,d.jsxs)("label",{className:"block text-xs font-medium text-muted-foreground",children:[i("update.versionPicker"),(0,d.jsx)("select",{className:"w-full rounded-md border border-input bg-surface px-3 py-2 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring mt-1",value:m.selectedVersion??"",onChange:a=>n(b=>({...b,selectedVersion:a.target.value,plan:null,failure:null})),disabled:m.busy,"data-testid":"skill-update-version-select",children:j.map(a=>(0,d.jsxs)("option",{value:a.version,children:[a.version,a.prerelease?` (${i("detail.prerelease")})`:"","compatible"!==a.compatibility.commandmate.status?` — ${i(fZ.OV[a.compatibility.commandmate.status])}`:""]},a.version))})]}),(0,d.jsx)(k.$n,{variant:"primary",disabled:m.busy||!m.selectedVersion,onClick:q,"data-testid":"skill-update-build",children:m.busy?i("update.building"):i("update.build")}),m.failure&&(0,d.jsxs)(fY.u,{tone:"danger","data-testid":"skill-update-error",children:[(0,d.jsx)("p",{children:i((0,fZ.FW)(m.failure.code))}),(0,d.jsx)("p",{className:"mt-1 break-words",children:i("state.errorCode",{code:m.failure.code})})]}),s&&(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-update-plan",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm font-semibold text-foreground",children:i("update.fromTo",{from:s.update.fromVersion,to:s.update.toVersion})}),null!==s.update.latestVersion&&s.update.latestVersion!==s.update.toVersion&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:i("update.latestAvailable",{version:s.update.latestVersion})})]}),(0,d.jsx)(fY.u,{tone:s.updatable?"info":"warning","data-testid":"skill-update-next-action",children:i((0,fZ.e5)(s.nextActionKey))}),s.blockers.length>0&&(0,d.jsx)("ul",{className:"space-y-1","data-testid":"skill-update-blockers",children:s.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),i((0,fZ.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))}),(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-update-risk",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("plan.riskHeading")}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-foreground",children:[(0,d.jsx)(fW.qW,{risk:s.securityDiff.risk.from.effective}),(0,d.jsx)("span",{"aria-hidden":"true",children:"→"}),(0,d.jsx)(fW.qW,{risk:s.securityDiff.risk.to.effective})]}),s.riskIncreased&&s.riskIncreaseMessageKey&&(0,d.jsx)(fY.u,{tone:"danger","data-testid":"skill-update-risk-increase",children:i((0,fZ.e5)(s.riskIncreaseMessageKey))}),s.requiresRiskAcknowledgement&&s.riskAcknowledgementMessageKey&&(0,d.jsx)(fY.u,{tone:"warning","data-testid":"skill-update-high-risk",children:i((0,fZ.e5)(s.riskAcknowledgementMessageKey))}),s.updatable&&!m.applyResult&&s.requiresRiskAcknowledgement&&(0,d.jsxs)("label",{className:"flex items-start gap-2 text-xs text-foreground",children:[(0,d.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:m.riskAcknowledged,onChange:a=>n(b=>({...b,riskAcknowledged:a.target.checked})),"data-testid":"skill-update-ack-risk"}),i("update.ackRisk")]}),s.updatable&&!m.applyResult&&s.riskIncreased&&(0,d.jsxs)("label",{className:"flex items-start gap-2 text-xs text-foreground",children:[(0,d.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:m.riskIncreaseAcknowledged,onChange:a=>n(b=>({...b,riskIncreaseAcknowledged:a.target.checked})),"data-testid":"skill-update-ack-risk-increase"}),i("update.ackRiskIncrease")]})]}),(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-update-security-diff",children:[s.securityDiff.permissions.added.length>0&&(0,d.jsxs)("div",{"data-testid":"skill-update-permissions-added",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("update.permissionsAdded")}),(0,d.jsx)("ul",{className:"mt-1 space-y-0.5",children:s.securityDiff.permissions.added.map(a=>(0,d.jsx)("li",{className:"text-xs text-foreground",children:i(fZ.z2[a]??"plan.permissionsNone")},a))})]}),s.securityDiff.permissions.removed.length>0&&(0,d.jsxs)("div",{"data-testid":"skill-update-permissions-removed",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("update.permissionsRemoved")}),(0,d.jsx)("ul",{className:"mt-1 space-y-0.5",children:s.securityDiff.permissions.removed.map(a=>(0,d.jsx)("li",{className:"text-xs text-foreground",children:i(fZ.z2[a]??"plan.permissionsNone")},a))})]}),(0,d.jsx)(f0,{heading:i("update.scriptsAdded"),paths:s.securityDiff.scripts.added,testid:"skill-update-scripts-added"}),(0,d.jsx)(f0,{heading:i("update.scriptsRemoved"),paths:s.securityDiff.scripts.removed,testid:"skill-update-scripts-removed"}),(0,d.jsx)(f0,{heading:i("update.executablesAdded"),paths:s.securityDiff.executables.added,testid:"skill-update-executables-added"}),(0,d.jsx)(f0,{heading:i("update.executablesRemoved"),paths:s.securityDiff.executables.removed,testid:"skill-update-executables-removed"})]}),s.securityDiff.changelogs.length>0&&(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-update-changelogs",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("detail.changelogHeading")}),s.securityDiff.changelogs.map(a=>(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-foreground",children:a.version}),(0,d.jsx)("p",{className:"whitespace-pre-wrap text-xs text-muted-foreground",children:a.changelog})]},a.version))]}),(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-update-files",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("update.filesHeading")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-update-stats",children:i("update.stats",{added:s.stats.added,updated:s.stats.updated,removed:s.stats.removed,unchanged:s.stats.unchanged})}),(0,d.jsx)("ul",{className:"space-y-1",children:s.files.filter(a=>"unchanged"!==a.change).map(a=>(0,d.jsxs)("li",{"data-testid":"skill-update-file",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(k.Ex,{variant:fZ.JD[a.change]??"gray",children:i(fZ.KS[a.change]??"update.change.update")}),(0,d.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:a.path})]}),a.diff&&(0,d.jsxs)("details",{className:"mt-1",children:[(0,d.jsx)("summary",{className:"cursor-pointer text-xs text-muted-foreground",children:i("update.showDiff")}),(0,d.jsx)("pre",{className:"mt-1 overflow-x-auto rounded-md bg-muted p-2 text-xs text-foreground",children:a.diff})]})]},a.path))})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-update-expiry",children:i("plan.expiresAt",{timestamp:s.expiresAt})}),s.updatable&&!m.applyResult&&(0,d.jsx)(k.$n,{variant:"primary",disabled:m.applying||s.requiresRiskAcknowledgement&&!m.riskAcknowledged||s.riskIncreased&&!m.riskIncreaseAcknowledged,onClick:r,"data-testid":"skill-update-apply",children:m.applying?i("update.applying"):i("update.apply")}),m.applyFailure&&(0,d.jsxs)("div",{className:"space-y-2","data-testid":"skill-update-apply-error",children:[(0,d.jsxs)(fY.u,{tone:"danger",children:[(0,d.jsx)("p",{children:i((0,fZ.FW)(m.applyFailure.code))}),(0,d.jsx)("p",{className:"mt-1 break-words",children:i("state.errorCode",{code:m.applyFailure.code})})]}),m.applyFailure.nextActionKey&&(0,d.jsx)(fY.u,{tone:"warning",children:i((0,fZ.e5)(m.applyFailure.nextActionKey))}),m.applyFailure.blockers&&m.applyFailure.blockers.length>0&&(0,d.jsx)("ul",{className:"space-y-1","data-testid":"skill-update-apply-error-blockers",children:m.applyFailure.blockers.map(a=>(0,d.jsxs)("li",{className:"text-xs text-danger-foreground",children:[a.path&&(0,d.jsx)("span",{className:"mr-1 break-all font-mono",children:a.path}),i((0,fZ.e5)(a.messageKey))]},`${a.code}:${a.path??""}`))})]})]}),t&&(0,d.jsxs)("div",{className:"space-y-3","data-testid":"skill-update-result",children:[(0,d.jsx)(fY.u,{tone:"succeeded"===t.operation.result?"info":"warning","data-testid":"skill-update-result-next-action",children:i((0,fZ.e5)(t.operation.nextActionKey))}),"reload"in t&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm font-semibold text-foreground",children:i("update.fromTo",{from:t.update.fromVersion,to:t.update.toVersion})}),(0,d.jsxs)("div",{className:"space-y-1","data-testid":"skill-update-result-reload",children:[(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("operation.reloadHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:t.reload.agents.map(a=>(0,d.jsx)("li",{className:"text-xs text-muted-foreground",children:i((0,fZ.e5)(a.messageKey),{agent:(0,al.f_)(a.agent),skillId:t.reload.skillId,version:t.reload.version})},a.agent))})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-update-result-rollback",children:i((0,fZ.e5)(t.rollback.messageKey),{version:t.rollback.backup.fromVersion})})]})]})]})})]})}let f2={status:"loading",skills:[],failure:null},f3={status:"loading",skills:[],failure:null};function f4({worktreeId:a,className:b=""}){let c=(0,h.c)("skills"),[f,g]=(0,e.useState)(f2),[i,j]=(0,e.useState)(f3),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(0),[p,q]=(0,e.useState)(0),r=(0,e.useMemo)(()=>new Map(i.skills.map(a=>[a.skillId,a.version])),[i.skills]),s=(0,e.useMemo)(()=>new Map(f.skills.map(a=>[a.id,{name:a.name,summary:a.summary,latest:a.latest}])),[f.skills]),t=(0,e.useMemo)(()=>{let a=new Map;for(let[c,d]of r){var b;a.set(c,(b=s.get(c)?.latest??null,null!==d&&null!==b&&fV(b,d)))}return a},[r,s]),u=(0,e.useMemo)(()=>f.skills.find(a=>a.id===l)??null,[f.skills,l]),v=(0,e.useMemo)(()=>i.skills.find(a=>a.skillId===l)??null,[i.skills,l]);if(l){let e=u?.compatibility??null,f=u?u.recommendedVersion:v?.version??null,g=u?u.recommendedVersion?e&&"compatible"!==e.status?c("detail.install.blockedIncompatible",{reason:c((0,fZ.e5)(e.messageKey),{range:e.requiredRange,currentVersion:e.currentVersion??""})}):null:c("detail.install.blockedNoVersion"):null;return(0,d.jsxs)("div",{className:`flex flex-col min-h-0 ${b}`.trim(),"data-testid":"worktree-skills-pane",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b border-border p-3",children:[(0,d.jsxs)(k.$n,{variant:"ghost",size:"sm",onClick:()=>{m(null),q(a=>a+1)},"data-testid":"worktree-skills-back",children:[(0,d.jsx)(fI.A,{size:14,"aria-hidden":"true",className:"mr-1"}),c("worktreePane.back")]}),(0,d.jsx)("h2",{className:"min-w-0 truncate text-sm font-semibold text-foreground",children:u?.name??l})]}),(0,d.jsxs)("div",{className:"min-h-0 flex-1 space-y-3 overflow-auto p-3",children:[v&&u&&(0,d.jsx)(f1,{skillId:l,skillName:u.name,worktreeId:a,installedVersion:v.version,versions:u.versions}),(0,d.jsx)(fX.B,{skillId:l,version:f,blockedReason:g,worktreeId:a})]})]})}return(0,d.jsx)("div",{className:`flex flex-col min-h-0 ${b}`.trim(),"data-testid":"worktree-skills-pane",children:(0,d.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-auto p-3",children:[(0,d.jsxs)("section",{className:"space-y-2","data-testid":"worktree-skills-installed",children:[(0,d.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:c("worktreePane.installedHeading")}),"loading"===i.status?(0,d.jsx)(k.EA,{className:"h-16 w-full rounded-lg","data-testid":"worktree-skills-installed-loading"}):"error"===i.status?(0,d.jsxs)(k.Zp,{className:"space-y-2","data-testid":"worktree-skills-installed-error",children:[(0,d.jsxs)(fY.u,{tone:"danger",children:[(0,d.jsx)("p",{children:c("worktreePane.installedError")}),(0,d.jsx)("p",{className:"mt-1 break-words",children:c("state.errorCode",{code:i.failure?.code??""})})]}),(0,d.jsx)(k.$n,{variant:"secondary",size:"sm",onClick:()=>q(a=>a+1),"data-testid":"worktree-skills-installed-retry",children:c("state.retry")})]}):0===i.skills.length?(0,d.jsx)(k.Zp,{"data-testid":"worktree-skills-installed-empty",children:(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:c("worktreePane.installedEmpty")})}):(0,d.jsx)("ul",{className:"space-y-2",children:i.skills.map(a=>{let b=s.get(a.skillId);return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>m(a.skillId),"data-testid":`worktree-skills-installed-${a.skillId}`,className:"w-full rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"break-all text-sm font-semibold text-foreground",children:b?.name??a.skillId}),(0,d.jsx)(fW.qW,{risk:a.effectiveRisk}),t.get(a.skillId)&&(0,d.jsx)(k.Ex,{variant:"info","data-testid":`worktree-skills-update-badge-${a.skillId}`,children:c("worktreePane.updateBadge")})]}),b?.summary&&(0,d.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-2","data-testid":`worktree-skills-installed-summary-${a.skillId}`,children:b.summary}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:c("worktreePane.version",{version:a.version})})]})},a.skillId)})})]}),(0,d.jsxs)("section",{className:"space-y-2","data-testid":"worktree-skills-catalog",children:[(0,d.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:c("worktreePane.catalogHeading")}),"loading"===f.status?(0,d.jsx)(k.EA,{className:"h-24 w-full rounded-lg","data-testid":"worktree-skills-catalog-loading"}):"error"===f.status?(0,d.jsxs)(k.Zp,{className:"space-y-2","data-testid":"worktree-skills-catalog-error",children:[(0,d.jsxs)(fY.u,{tone:"danger",children:[(0,d.jsx)("p",{children:c("state.errorNotice")}),(0,d.jsx)("p",{className:"mt-1 break-words",children:c("state.errorCode",{code:f.failure?.code??""})})]}),(0,d.jsx)(k.$n,{variant:"secondary",size:"sm",onClick:()=>o(a=>a+1),"data-testid":"worktree-skills-catalog-retry",children:c("state.retry")})]}):0===f.skills.length?(0,d.jsx)(k.Zp,{"data-testid":"worktree-skills-catalog-empty",children:(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:c("state.empty")})}):(0,d.jsx)("ul",{className:"space-y-2",children:f.skills.map(a=>{let b=(0,fZ.gh)(a),e=r.has(a.id),f=!0===t.get(a.id);return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>m(a.id),"data-testid":`worktree-skills-catalog-${a.id}`,className:"w-full rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"min-w-0 break-all text-sm font-semibold text-foreground",children:a.name}),e&&(f?(0,d.jsx)(k.Ex,{variant:"info","data-testid":`worktree-skills-catalog-update-badge-${a.id}`,children:c("worktreePane.updateBadge")}):(0,d.jsx)(k.Ex,{variant:"info","data-testid":`worktree-skills-installed-badge-${a.id}`,children:c("worktreePane.installedBadge")}))]}),(0,d.jsx)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:c("card.provider",{provider:a.provider.name})}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground","data-testid":`worktree-skills-catalog-version-${a.id}`,children:c("worktreePane.version",{version:a.latest})}),a.summary&&(0,d.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2","data-testid":`worktree-skills-catalog-summary-${a.id}`,children:a.summary}),(0,d.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[a.compatibility&&(0,d.jsx)(fW.Xz,{status:a.compatibility.status}),b&&(0,d.jsx)(fW.qW,{risk:b})]})]})},a.id)})})]})]})})}let f5=(0,x.A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var f6=c(80755),f7=c(95779);let f8={pending:"gray",running:"info",waiting_input:"warning",verifying:"info",succeeded:"success",failed:"error",not_started:"warning",cancelled:"gray"},f9={running:"info",passed:"success",failed:"error",not_started:"warning",error:"error",cancelled:"gray"},ga={running:"info",passed:"success",failed:"error",timeout:"error",skipped:"gray",error:"error"},gb=["failed","timeout","error"],gc=`${bU}/blob/main/docs/design/verification-config.md`,gd=".commandmate/verify.yaml";class ge extends Error{constructor(a,b,c=null){super(a),this.name="VerificationApiError",this.status=b,this.runningRunId=c}}async function gf(a,b){let c=await a.json().catch(()=>({})),d="string"==typeof c.error?c.error:`${b} (${a.status})`,e="number"==typeof c.runningRunId?c.runningRunId:null;throw new ge(d,a.status,e)}function gg(a){return`/api/worktrees/${encodeURIComponent(a)}`}async function gh(a,b={}){let c=await fetch(`${gg(a)}/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok)return gf(c,"Failed to start verification");let d=await c.json();if("number"!=typeof d.runId)throw new ge("Verification response carried no run id",c.status);return d.runId}async function gi(a){let b=await fetch(`${gg(a)}/verify/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!b.ok)return gf(b,"Failed to draft the verification config");let c=await b.json();return{created:!0===c.created,path:"string"==typeof c.path?c.path:gd,gates:c.gates??[],excluded:c.excluded??[],scanned:c.scanned??[]}}async function gj(a,b){let c=await fetch(`${gg(a)}/verify/runs/${b}/cancel`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!c.ok)return gf(c,"Failed to cancel the verification run");let d=await c.json();return{runId:"number"==typeof d.runId?d.runId:b,status:d.status??"cancelled"}}let gk={running:null,passed:0,failed:20,not_started:21,error:99,cancelled:99},gl=["passed","failed","not_started","error","cancelled"],gm={"work-evidence":"workEvidence",scope:"scope","env-clean":"envClean",config:"config"},gn={mutex:"reason=mutex-wait",detachedContract:"was NOT judged",noContract:"no contract is attached to this run",notRequired:"success.requireScopeClean: false"};var go=c(93467);function gp(a){if(!a)return"—";let b=new Date(a);return Number.isNaN(b.getTime())?a:b.toLocaleString()}function gq({heading:a,action:b,children:c,testId:e}){return(0,d.jsxs)("section",{className:"border-b border-border px-3 py-3 last:border-b-0","data-testid":e,children:[(0,d.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,d.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a}),b]}),c]})}function gr({label:a,children:b}){return(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:a}),(0,d.jsx)("span",{className:"min-w-0 break-words text-xs text-foreground",children:b})]})}function gs({task:a}){let b=(0,h.c)("worktree"),c=a.contract,e=c.goal??"",f=e.length>240?`${e.slice(0,240)}…`:e;return(0,d.jsxs)("div",{className:"space-y-2","data-testid":"verification-contract",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"min-w-0 break-words text-sm font-medium text-foreground",children:c.title||a.title}),(0,d.jsx)(f6.E,{variant:f8[a.status],"data-testid":"verification-task-status",children:b(`task.status.${a.status}`)})]}),(0,d.jsx)("p",{className:"whitespace-pre-wrap break-words text-xs text-muted-foreground",children:f}),(0,d.jsxs)("div",{className:"space-y-1 pt-1",children:[(0,d.jsx)(gr,{label:b("verification.contract.scopeAllow"),children:(0,d.jsx)("span",{className:"font-mono",children:c.scope.allow.join(", ")||"—"})}),c.scope.deny.length>0&&(0,d.jsx)(gr,{label:b("verification.contract.scopeDeny"),children:(0,d.jsx)("span",{className:"font-mono",children:c.scope.deny.join(", ")})}),(0,d.jsx)(gr,{label:b("verification.contract.gates"),children:(0,d.jsx)("span",{className:"font-mono",children:null===c.verify.gates?b("verification.contract.gatesAll"):c.verify.gates.join(", ")||b("verification.contract.gatesAll")})}),(0,d.jsx)(gr,{label:b("verification.contract.autoYes"),children:(0,d.jsx)("span",{className:"font-mono",children:c.autoYes.mode??b("verification.contract.autoYesUnset")})}),a.contractPath&&(0,d.jsx)(gr,{label:b("verification.contract.file"),children:(0,d.jsx)("span",{className:"font-mono",children:a.contractPath})}),(0,d.jsx)(gr,{label:b("verification.contract.updated"),children:gp(a.updatedAt)})]})]})}function gt({gate:a}){return(0,d.jsxs)("li",{className:"flex flex-col gap-0.5 rounded-md border border-border bg-surface px-2 py-1.5","data-testid":`verification-declared-gate-${a.id}`,children:[(0,d.jsx)("span",{className:"break-all font-mono text-xs font-medium text-foreground",children:a.id}),(0,d.jsx)("span",{className:"break-all font-mono text-[11px] text-muted-foreground",children:a.command})]})}function gu({children:a,testId:b,tone:c="muted"}){return(0,d.jsx)("p",{className:`whitespace-pre-line break-words ${"warning"===c?"rounded border border-warning-border bg-warning-subtle px-2 py-1 text-xs text-warning-foreground":"text-xs text-muted-foreground"}`,"data-testid":b,role:"warning"===c?"alert":void 0,children:a})}function gv({state:a}){let b=(0,h.c)("worktree"),{config:c,configError:f,phase:g,runs:i,selectedRun:j,latestRun:k}=a,l=c?.path??gd,m=(0,e.useCallback)(()=>{a.draftConfig()},[a]),n=(0,e.useCallback)(()=>{a.rerun()},[a]),o=(0,e.useCallback)(()=>{k&&a.selectRun(k.id)},[k,a]),p=(0,e.useCallback)(()=>{a.cancelRun()},[a]),q=i.find(a=>"running"===a.status)??null,r=j&&q&&j.id===q.id?j.gates:[],s=r.filter(a=>"running"!==a.status).length,t=Math.max(c?.plannedGateIds.length??0,r.length),u=q?Date.now()-new Date(q.startedAt).getTime():0;return(0,d.jsxs)("section",{className:"space-y-2 border-b border-border px-3 py-3","data-testid":"verification-onboarding","data-phase":g,children:[(0,d.jsx)(gu,{testId:"verification-onboarding-what",children:b("verification.onboarding.what",{path:l})}),(0,d.jsx)(gu,{testId:"verification-onboarding-how",children:b("verification.onboarding.how")}),null!==f&&(0,d.jsx)(gu,{tone:"warning",testId:"verification-config-error",children:b("verification.onboarding.configError",{message:f})}),c?.error!=null&&(0,d.jsx)(gu,{tone:"warning",testId:"verification-config-invalid",children:b("verification.onboarding.invalid",{path:l,message:c.error})}),"unknown"===g&&(0,d.jsx)(gu,{testId:"verification-onboarding-unknown",children:b("verification.onboarding.loading")}),"no-config"===g&&(0,d.jsxs)("div",{className:"space-y-2","data-testid":"verification-onboarding-no-config",children:[(0,d.jsx)(gu,{children:b("verification.onboarding.noConfig.body",{path:l})}),(0,d.jsx)(gu,{children:b("verification.onboarding.noConfig.hint")}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"primary",onClick:m,disabled:a.draftPending,"data-testid":"verification-draft-button",children:b(a.draftPending?"verification.onboarding.noConfig.pending":"verification.onboarding.noConfig.action")}),(0,d.jsxs)("a",{href:gc,target:"_blank",rel:"noreferrer noopener","data-testid":"verification-docs-link",className:"inline-flex items-center gap-1 rounded text-xs font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:[b("verification.onboarding.noConfig.docs"),(0,d.jsx)(f5,{size:12,"aria-hidden":"true"})]})]}),a.draftFailure&&(0,d.jsx)(gu,{tone:"warning",testId:"verification-draft-failure",children:"conflict"===a.draftFailure.kind?b("verification.onboarding.noConfig.conflict",{path:l}):"empty"===a.draftFailure.kind?b("verification.onboarding.noConfig.empty",{path:l}):b("verification.onboarding.noConfig.error",{message:a.draftFailure.message})})]}),"configured"===g&&(0,d.jsxs)("div",{className:"space-y-2","data-testid":"verification-onboarding-configured",children:[(0,d.jsx)(gu,{children:b("verification.onboarding.configured.body",{path:l,count:c?.gates.length??0})}),a.draftResult?.created&&(0,d.jsx)(gu,{testId:"verification-draft-created",children:b("verification.onboarding.noConfig.created",{path:a.draftResult.path,count:a.draftResult.gates.length})}),(0,d.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:b("verification.onboarding.configured.gatesHeading")}),(0,d.jsx)("ul",{className:"space-y-1","data-testid":"verification-declared-gates",children:(c?.gates??[]).map(a=>(0,d.jsx)(gt,{gate:a},a.id))}),(0,d.jsx)(gu,{testId:"verification-builtin-gates",children:b("verification.onboarding.configured.builtin",{gates:(function(a){if(null===a)return[];let b=new Set(a.gates.map(a=>a.id));return a.plannedGateIds.filter(a=>!b.has(a))})(c).join(", ")})}),(0,d.jsx)(gu,{testId:"verification-builtin-gates-hint",children:b("verification.onboarding.configured.builtinHint")}),(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"primary",onClick:n,disabled:a.rerunPending,"data-testid":"verification-run-button",children:b(a.rerunPending?"verification.runs.rerunPending":"verification.onboarding.configured.action")})]}),"running"===g&&null!==q&&(0,d.jsxs)("div",{className:"space-y-1","data-testid":"verification-onboarding-running",children:[(0,d.jsx)(gu,{testId:"verification-running-progress",children:b("verification.onboarding.running.progress",{done:s,total:t})}),(0,d.jsx)(gu,{testId:"verification-running-elapsed",children:b("verification.onboarding.running.elapsed",{elapsed:(0,go.C)(u)})}),(0,d.jsx)(gu,{children:b("verification.onboarding.running.hint")}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:a.refresh,"data-testid":"verification-running-refresh-button",children:b("verification.onboarding.running.action")}),(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"danger",onClick:p,disabled:a.cancelPending,"data-testid":"verification-cancel-button",children:b(a.cancelPending?"verification.runs.cancelPending":"verification.runs.cancel")})]}),(0,d.jsx)(gu,{testId:"verification-cancel-hint",children:b("verification.runs.cancelHint")}),a.cancelSettling&&(0,d.jsx)(gu,{testId:"verification-cancel-settling",children:b("verification.runs.cancelSettling")}),a.cancelFailure&&(0,d.jsx)(gu,{tone:"warning",testId:"verification-cancel-failure",children:"gone"===a.cancelFailure.kind?b("verification.runs.cancelGone"):b("verification.runs.cancelError",{message:a.cancelFailure.message})})]}),"result"===g&&null!==k&&(0,d.jsxs)("div",{className:"space-y-2","data-testid":"verification-onboarding-result",children:[(0,d.jsx)(gu,{testId:"verification-result-body",children:b("verification.onboarding.result.body",{runId:k.id,verdict:b(`verification.runStatus.${k.status}`)})}),(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:o,"data-testid":"verification-show-latest-button",children:b("verification.onboarding.result.action")})]})]})}function gw({state:a}){let b=(0,h.c)("worktree"),[c,f]=(0,e.useState)(!1),{availableGateIds:g,selectedGateIds:i,failedGateIds:j,rerunPending:k}=a,l=(0,e.useCallback)(()=>f(a=>!a),[]),m=(0,e.useCallback)(()=>a.setGateSelection(null),[a]),n=(0,e.useCallback)(()=>{a.selectFailedGates(),f(!0)},[a]),o=(0,e.useCallback)(()=>{a.rerun()},[a]);if(0===g.length)return null;let p=i??g,q=null===i,r=g.filter(a=>j.includes(a));return(0,d.jsxs)("div",{className:"mb-2 rounded-md border border-border bg-surface-2 px-2 py-2","data-testid":"verification-gate-selector","data-selection":q?"all":p.join(","),children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground",children:b("verification.selection.heading")}),(0,d.jsx)("button",{type:"button",onClick:l,"aria-expanded":c,"data-testid":"verification-gate-selector-toggle",className:"rounded text-[11px] font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:c?b("verification.selection.close"):b("verification.selection.open")})]}),(0,d.jsx)("p",{className:"mt-0.5 break-words text-[11px] text-muted-foreground","data-testid":"verification-gate-selector-summary",children:q?b("verification.selection.all",{count:g.length}):b("verification.selection.partial",{selected:p.length,total:g.length,gates:p.join(", ")})}),c&&(0,d.jsxs)("div",{className:"mt-2 space-y-2","data-testid":"verification-gate-selector-body",children:[(0,d.jsx)("ul",{className:"space-y-1","data-testid":"verification-gate-checkboxes",children:g.map(c=>{let e=`verification-gate-select-${c}`,f=j.includes(c);return(0,d.jsxs)("li",{className:"flex items-center gap-2",children:[(0,d.jsx)(f7.S,{id:e,checked:p.includes(c),onCheckedChange:()=>a.toggleGate(c),"data-testid":e,"aria-label":b("verification.selection.gateLabel",{gateId:c})}),(0,d.jsx)("label",{htmlFor:e,className:"min-w-0 flex-1 cursor-pointer break-all font-mono text-[11px] text-foreground touch-manipulation",children:c}),f&&(0,d.jsx)(f6.E,{variant:"error",className:"flex-shrink-0",children:b("verification.gateStatus.failed")})]},c)})}),(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"primary",onClick:o,disabled:k,"data-testid":"verification-run-selected-button",children:k?b("verification.runs.rerunPending"):q?b("verification.selection.runAll"):b("verification.selection.runSelected",{count:p.length})}),(0,d.jsx)("p",{className:"break-words text-[11px] text-muted-foreground",children:b("verification.selection.hint")})]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:n,disabled:0===r.length,"data-testid":"verification-failed-only-button",children:b("verification.selection.failedOnly",{count:r.length})}),!q&&(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"ghost",onClick:m,"data-testid":"verification-select-all-button",children:b("verification.selection.selectAll")})]}),0===r.length&&(0,d.jsx)("p",{className:"mt-1 break-words text-[11px] text-muted-foreground","data-testid":"verification-failed-only-empty",children:b("verification.selection.failedOnlyEmpty")})]})}function gx({state:a}){let b=(0,h.c)("worktree"),{repositoryHistoryOpen:c,repositoryHistory:f,repositoryHistoryLoading:g,repositoryHistoryError:i}=a,j=(0,e.useCallback)(()=>{a.toggleRepositoryHistory()},[a]);return(0,d.jsxs)("div",{className:"mt-2","data-testid":"verification-repository-history",children:[(0,d.jsx)("button",{type:"button",onClick:j,"aria-expanded":c,"data-testid":"verification-repository-history-toggle",className:"rounded text-[11px] font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:b(c?"verification.runs.history.close":"verification.runs.history.open")}),c&&(0,d.jsxs)("div",{className:"mt-1 space-y-1","data-testid":"verification-repository-history-body",children:[(0,d.jsx)("p",{className:"break-words text-[11px] text-muted-foreground",children:b("verification.runs.history.hint")}),null!==i?(0,d.jsx)("p",{className:"rounded border border-warning-border bg-warning-subtle px-2 py-1 text-[11px] text-warning-foreground","data-testid":"verification-repository-history-error",role:"alert",children:b("verification.runs.history.error",{message:i})}):g&&0===f.length?(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground",children:b("verification.runs.history.loading")}):0===f.length?(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"verification-repository-history-empty",children:b("verification.runs.history.empty")}):(0,d.jsx)("ul",{className:"space-y-1","data-testid":"verification-repository-history-runs",children:f.map(a=>(0,d.jsx)(gy,{run:a},a.id))})]})]})}function gy({run:a}){let b=(0,h.c)("worktree"),c=a.status,e=a.gates.filter(a=>gb.includes(a.status)).map(a=>a.gateId);return(0,d.jsxs)("li",{className:"flex flex-col gap-0.5 rounded-md border border-border bg-surface px-2 py-1.5","data-testid":`verification-history-run-${a.id}`,children:[(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)(f6.E,{variant:f9[c],className:"flex-shrink-0",children:b(`verification.runStatus.${c}`)}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:a.worktreeId})]}),(0,d.jsxs)("span",{className:"flex flex-wrap gap-x-2 font-mono text-[11px] text-muted-foreground",children:[(0,d.jsx)("span",{children:b("verification.runs.runLabel",{runId:a.id})}),(0,d.jsx)("span",{children:gp(a.startedAt)})]}),e.length>0&&(0,d.jsx)("span",{className:"break-words text-[11px] text-muted-foreground",children:b("verification.runs.history.failingGates",{gates:e.join(", ")})})]})}function gz({gate:a,log:b,onClose:c}){let f=(0,h.c)("worktree"),[g,i]=(0,e.useState)("idle"),j=(0,e.useRef)(null),k=""===b?0:b.replace(/\n+$/,"").split("\n").length,l=""!==b.trim(),m=(0,e.useCallback)(()=>{(async()=>{try{await (0,bk.l)(b),i("done")}catch{i("failed")}null!==j.current&&clearTimeout(j.current),j.current=setTimeout(()=>i("idle"),2e3)})()},[b]);return(0,d.jsx)(b_.a,{isOpen:!0,onClose:c,size:"xl",title:f("verification.gates.fullLogTitle",{gateId:a.gateId,runId:a.runId}),children:(0,d.jsxs)("div",{className:"space-y-2","data-testid":`verification-gate-full-log-${a.gateId}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsxs)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:m,disabled:!l,"data-testid":"verification-gate-log-copy-button",children:[(0,d.jsx)(ba.A,{size:12,"aria-hidden":"true",className:"mr-1"}),f("done"===g?"verification.gates.copied":"failed"===g?"verification.gates.copyFailed":"verification.gates.copyLog")]}),(0,d.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground","data-testid":"verification-gate-log-size",children:f("verification.gates.fullLogSize",{lines:k})})]}),(0,d.jsx)("p",{className:"break-words text-[11px] text-muted-foreground",children:f("verification.gates.fullLogStored")}),""===b?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("verification.gates.noLog")}):(0,d.jsx)("pre",{className:"max-h-[60vh] overflow-auto rounded bg-terminal-surface p-2 font-mono text-[11px] leading-relaxed text-terminal-foreground",children:b})]})})}function gA({run:a,selected:b,onSelect:c}){let e=(0,h.c)("worktree"),f=e(`verification.runStatus.${a.status}`),g=e(`verification.runStatusGloss.${a.status}`),i=gk[a.status];return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>c(a.id),"aria-current":b?"true":void 0,"aria-label":e("verification.runs.select",{runId:a.id,verdict:f,gloss:g}),title:g,"data-testid":`verification-run-${a.id}`,className:`flex w-full flex-col gap-0.5 rounded-md border px-2 py-2 text-left text-xs transition-colors touch-manipulation focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${b?"border-accent-500 bg-accent-50 dark:bg-accent-900/30":"border-border bg-surface hover:bg-muted"}`,children:[(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)(f6.E,{variant:f9[a.status],className:"flex-shrink-0",children:f}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:gp(a.startedAt)})]}),(0,d.jsxs)("span",{className:"flex flex-wrap gap-x-2 font-mono text-[11px] text-muted-foreground",children:[(0,d.jsx)("span",{children:e("verification.runs.runLabel",{runId:a.id})}),(0,d.jsx)("span",{children:e("verification.runs.trigger",{trigger:a.trigger})}),null!==i&&(0,d.jsx)("span",{children:e("verification.runs.exitCode",{code:i})})]})]})})}function gB(){let a=(0,h.c)("worktree"),b=gl.map(b=>a("verification.runs.cliLegendItem",{label:a(`verification.runStatus.${b}`),code:gk[b]??0})).join(" / ");return(0,d.jsx)("p",{className:"mb-2 break-words text-[11px] text-muted-foreground","data-testid":"verification-cli-exit-legend",children:a("verification.runs.cliLegend",{items:b})})}function gC({run:a,plannedGateIds:b}){let c=(0,h.c)("worktree"),e=gk[a.status],f=a.gates.filter(a=>"skipped"===a.status),g=new Set(a.gates.map(a=>a.gateId)),i=b.filter(a=>!g.has(a));return(0,d.jsxs)("div",{className:"mb-2 space-y-1 rounded-md border border-border bg-surface-2 px-2 py-2","data-testid":"verification-run-verdict",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground",children:c("verification.gates.verdictHeading")}),(0,d.jsx)(f6.E,{variant:f9[a.status],className:"flex-shrink-0",children:c(`verification.runStatus.${a.status}`)}),null!==e&&(0,d.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:c("verification.runs.exitCode",{code:e})})]}),(0,d.jsx)("p",{className:"break-words text-xs text-muted-foreground","data-testid":"verification-run-verdict-gloss",children:c(`verification.runStatusGloss.${a.status}`)}),i.length>0&&(0,d.jsx)("p",{className:"rounded border border-warning-border bg-warning-subtle px-2 py-1 text-xs text-warning-foreground","data-testid":"verification-run-partial",children:c("verification.runs.partial",{ran:g.size,total:b.length,gates:i.join(", ")})}),f.length>0&&(0,d.jsxs)("div",{className:"space-y-0.5 pt-1","data-testid":"verification-run-skip-reasons",children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-foreground",children:c("verification.gates.skipHeading")}),(0,d.jsx)("ul",{className:"space-y-0.5",children:f.map(a=>(0,d.jsx)("li",{className:"break-words text-xs text-muted-foreground",children:c("verification.gates.skipReasonFor",{gateId:a.gateId,reason:c(`verification.gates.skipReason.${function(a){let b=a??"";return b.includes("skipped: worktreePath is the server process working directory and options.skipInPrimaryCheckout is true.")?"primaryCheckout":b.includes("skipped: the work-evidence gate did not pass.")?"workEvidence":b.includes("skipped: the verification run was cancelled.")?"cancelled":b.includes(gn.mutex)?"mutex":b.includes(gn.detachedContract)?"detachedContract":b.includes(gn.noContract)?"noContract":b.includes(gn.notRequired)?"notRequired":"unknown"}(a.logTail)}`)})},a.id))})]})]})}function gD({gate:a}){let b=(0,h.c)("worktree"),c=gb.includes(a.status),[f,g]=(0,e.useState)(null),[i,j]=(0,e.useState)(!1),k=(0,e.useCallback)(()=>j(!1),[]),l=f??c,m=(0,cQ.aJ)(a.logTail??""),n=function(a,b){let c=(a??"").replace(/\n+$/,"");if(""===c)return{lines:[],omitted:0};let d=c.split("\n");return d.length<=40?{lines:d,omitted:0}:{lines:d.slice(-40),omitted:d.length-b}}(m,40),o=function(a){if(null==a||!Number.isFinite(a))return null;if(a<1e3)return`${Math.max(0,Math.round(a))}ms`;let b=a/1e3;return b<10?`${b.toFixed(1)}s`:`${Math.round(b)}s`}(a.durationMs),p=gm[a.gateId]??null;return(0,d.jsxs)("li",{className:"rounded-md border border-border bg-surface p-2","data-testid":`verification-gate-${a.gateId}`,children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(f6.E,{variant:ga[a.status],className:"flex-shrink-0",children:b(`verification.gateStatus.${a.status}`)}),(0,d.jsx)("span",{className:"min-w-0 break-all font-mono text-xs font-medium text-foreground",children:a.gateId}),"contract"===a.source&&(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",title:b("verification.gates.contractSourceHint"),children:b("verification.gates.contractSource")}),null!==p&&(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:b("verification.gates.builtinBadge")})]}),null!==p&&(0,d.jsx)("p",{className:"mt-1 break-words text-[11px] text-muted-foreground","data-testid":`verification-gate-about-${a.gateId}`,children:b(`verification.gates.builtin.${p}`)}),"skipped"===a.status&&(0,d.jsxs)("p",{className:"mt-1 break-words text-[11px] text-muted-foreground","data-testid":`verification-gate-skipped-${a.gateId}`,children:[b("verification.gateStatus.skipped")," — ",b("verification.gateStatusGloss.skipped")]}),(0,d.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-0.5 font-mono text-[11px] text-muted-foreground",children:[null!==a.exitCode&&void 0!==a.exitCode&&(0,d.jsx)("span",{children:b("verification.gates.exitCode",{code:a.exitCode})}),o&&(0,d.jsx)("span",{children:b("verification.gates.duration",{duration:o})}),a.command&&(0,d.jsx)("span",{className:"break-all",children:a.command})]}),(0,d.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>g(!l),"aria-expanded":l,"data-testid":`verification-gate-log-toggle-${a.gateId}`,className:"rounded text-[11px] font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:b(l?"verification.gates.hideLog":"verification.gates.showLog")}),""!==m&&(0,d.jsx)("button",{type:"button",onClick:()=>j(!0),"data-testid":`verification-gate-full-log-button-${a.gateId}`,className:"rounded text-[11px] font-medium text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:text-accent-400 touch-manipulation",children:b("verification.gates.showFullLog")})]}),i&&(0,d.jsx)(gz,{gate:a,log:m,onClose:k}),l&&(0,d.jsx)("div",{className:"mt-1","data-testid":`verification-gate-log-${a.gateId}`,children:0===n.lines.length?(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground",children:b("verification.gates.noLog")}):(0,d.jsxs)(d.Fragment,{children:[n.omitted>0&&(0,d.jsx)("p",{className:"mb-1 text-[11px] text-muted-foreground",children:b("verification.gates.logOmitted",{count:n.omitted,runId:a.runId})}),(0,d.jsx)("pre",{className:"max-h-64 overflow-auto rounded bg-terminal-surface p-2 font-mono text-[11px] leading-relaxed text-terminal-foreground",children:n.lines.join("\n")})]})})]})}let gE=(0,e.memo)(function({state:a,className:b=""}){let c=(0,h.c)("worktree"),{worktreeId:f,task:g,runs:i,selectedRunId:j,selectedRun:k,loading:l,error:m,detailError:n,detailLoading:o,rerunPending:p,rerunFailure:q,cancelFailure:r,canLoadMore:s,selectRun:t,refresh:u,rerun:v,loadMore:w}=a,x=(0,e.useCallback)(()=>{v()},[v]);return(0,d.jsxs)("div",{className:`flex h-full flex-col overflow-y-auto bg-surface ${b}`.trim(),"data-testid":"verification-pane",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)(cl.A,{size:16,"aria-hidden":"true",className:"flex-shrink-0 text-muted-foreground"}),(0,d.jsx)("h2",{className:"truncate text-sm font-semibold text-foreground",children:c("verification.title")})]}),(0,d.jsx)("button",{type:"button",onClick:u,"aria-label":c("verification.refresh"),title:c("verification.refresh"),"data-testid":"verification-refresh-button",className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:(0,d.jsx)(dR.A,{size:14,"aria-hidden":"true"})})]}),m&&(0,d.jsx)("p",{className:"border-b border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-foreground","data-testid":"verification-error",role:"alert",children:c("verification.loadError",{message:m})}),l?(0,d.jsx)("p",{className:"px-3 py-4 text-xs text-muted-foreground","data-testid":"verification-loading",children:c("verification.loading")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(gv,{state:a}),(0,d.jsx)(gq,{heading:c("verification.contract.heading"),testId:"verification-contract-section",children:g?(0,d.jsx)(gs,{task:g}):(0,d.jsx)("p",{className:"whitespace-pre-line text-xs text-muted-foreground","data-testid":"verification-contract-empty",children:c("verification.contract.empty")})}),(0,d.jsxs)(gq,{heading:c("verification.runs.heading"),testId:"verification-runs-section",action:(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"secondary",onClick:x,disabled:p,"data-testid":"verification-rerun-button",children:c(p?"verification.runs.rerunPending":"verification.runs.rerun")}),children:[q&&(0,d.jsx)("p",{className:"mb-2 rounded border border-warning-border bg-warning-subtle px-2 py-1 text-xs text-warning-foreground","data-testid":"verification-rerun-failure",role:"alert",children:"conflict"===q.kind?null!==q.runningRunId?c("verification.runs.rerunConflict",{runId:q.runningRunId}):c("verification.runs.rerunConflictUnknown"):c("verification.runs.rerunError",{message:q.message})}),r&&(0,d.jsx)("p",{className:"mb-2 rounded border border-warning-border bg-warning-subtle px-2 py-1 text-xs text-warning-foreground","data-testid":"verification-runs-cancel-failure",role:"alert",children:"gone"===r.kind?c("verification.runs.cancelGone"):c("verification.runs.cancelError",{message:r.message})}),(0,d.jsx)(gw,{state:a}),(0,d.jsx)(gB,{}),0===i.length?(0,d.jsx)("p",{className:"whitespace-pre-line text-xs text-muted-foreground","data-testid":"verification-runs-empty",children:c("verification.runs.empty",{worktreeId:f})}):(0,d.jsx)("ul",{className:"space-y-1","data-testid":"verification-runs",children:i.map(a=>(0,d.jsx)(gA,{run:a,selected:a.id===j,onSelect:t},a.id))}),s&&(0,d.jsx)(a2.$,{type:"button",size:"sm",variant:"ghost",onClick:w,className:"mt-1","data-testid":"verification-load-more-button",children:c("verification.runs.loadMore",{count:10})}),(0,d.jsx)(gx,{state:a})]}),null!==j&&(0,d.jsx)(gq,{heading:c("verification.gates.heading",{runId:j}),testId:"verification-gates-section",children:null!==n?(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"verification-gates-error",role:"alert",children:"not-found"===n?c("verification.gates.notFound"):c("verification.gates.loadError",{message:n})}):null===k?(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"verification-gates-loading",children:c(o?"verification.gates.loading":"verification.gates.empty")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(gC,{run:k,plannedGateIds:a.config?.plannedGateIds??[]}),0===k.gates.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"verification-gates-empty",children:c("verification.gates.empty")}):(0,d.jsx)("ul",{className:"space-y-1.5","data-testid":"verification-gates",children:k.gates.map(a=>(0,d.jsx)(gD,{gate:a},a.id))}),k.gates.some(a=>"contract"===a.source)&&(0,d.jsx)("p",{className:"mt-2 break-words text-[11px] text-muted-foreground","data-testid":"verification-contract-source-hint",children:c("verification.gates.contractSourceHint")})]})})]})]})});var gF=c(72380);let gG=(0,x.A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var gH=c(31210),gI=c(30430),gJ=c(73790);class gK extends Error{constructor(a,b,c=[]){super(b),this.name="EnvApiError",this.code=a,this.issues=c}}async function gL(a,b){let c=await a.json().catch(()=>null);return new gK(c?.error?.code??`HTTP_${a.status}`,c?.error?.message??b,c?.error?.issues??[])}async function gM(a,b,c){var d;let e=await fetch((d=a,`/api/worktrees/${encodeURIComponent(d)}/env`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:b,content:c})});if(!e.ok)throw await gL(e,"Failed to save env file");let f=await e.json();return{file:f.file,issues:f.issues??[]}}let gN=/^[A-Za-z_][A-Za-z0-9_]*$/;function gO(a){return a.split(/\r\n|\n|\r/)}function gP(a,b,c){for(let d=c;d<a.length;d+=1){if('"'===b&&"\\"===a[d]){d+=1;continue}if(a[d]===b)return d}return -1}function gQ(a){let b=gO(a),c=[],d=[],e=new Map;for(let a=0;a<b.length;a+=1){let f,g=a+1,h=b[a].trim();if(""===h||h.startsWith("#"))continue;let i=/^export\s+/.test(h),j=i?h.replace(/^export\s+/,""):h,k=j.indexOf("=");if(-1===k){d.push({line:g,code:"invalid-syntax",severity:"error"});continue}let l=j.slice(0,k).trim();if(!gN.test(l)){d.push({line:g,code:"invalid-key",severity:"error",...l.length>0&&l.length<=64?{key:l}:{}});continue}let m=j.slice(k+1).replace(/^[ \t]+/,""),n=null,o=g;if(m.startsWith('"')||m.startsWith("'")){n=m[0];let c=m.slice(1),e=gP(c,n,0);for(;-1===e&&a+1<b.length;)a+=1,o=a+1,c+=`
25
25
  ${b[a]}`,e=gP(c,n,0);if(-1===e){d.push({line:g,code:"unterminated-quote",severity:"error",key:l});continue}let h=c.slice(0,e);f='"'===n?function(a){let b="";for(let c=0;c<a.length;c+=1){let d=a[c];if("\\"!==d||c===a.length-1){b+=d;continue}let e=a[c+1];switch(c+=1,e){case"n":b+="\n";break;case"r":b+="\r";break;case"t":b+=" ";break;case"\\":b+="\\";break;case'"':b+='"';break;default:b+=`\\${e}`}}return b}(h):h}else f=(function(a){let b=/\s#/.exec(a);return b?a.slice(0,b.index):a})(m).replace(/[ \t]+$/,"");void 0!==e.get(l)&&d.push({line:g,code:"duplicate-key",severity:"warning",key:l}),e.set(l,g),c.push({key:l,value:f,line:g,endLine:o,exported:i,quote:n})}return{entries:c,issues:d}}let gR=/[\s#'"$`\\]/;function gS(a){if(!gR.test(a))return a;let b=a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t");return`"${b}"`}function gT(a,b,c){let d=gO(a),e=new Map(b.map(a=>[a.line,a])),f=new Map,g=[];for(let a of c)null!==a.sourceLine&&e.has(a.sourceLine)?f.set(a.sourceLine,a):g.push(a);let h=[],i=0;for(let a=0;a<d.length;a+=1){let b=a+1;if(b<=i)continue;let c=e.get(b);if(!c){h.push(d[a]);continue}i=c.endLine;let g=f.get(b);g&&h.push(`${c.exported?"export ":""}${g.key}=${gS(g.value)}`)}for(let a of(h.length>0&&""===h[h.length-1]&&h.pop(),g))h.push(`${a.key}=${gS(a.value)}`);return 0===h.length?"":`${h.join("\n")}
26
26
  `}let gU=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/,gV=0;function gW(){return gV+=1,`env-row-${gV}`}c(68643);let gX=(0,e.createContext)(null),gY="••••••••";function gZ(a){return 0===a.length?"":gY}let g$="flex-shrink-0 px-2 opacity-80 transition-opacity hover:opacity-100 [@media(hover:none)]:opacity-100",g_={"invalid-syntax":"envManager.issues.invalidSyntax","invalid-key":"envManager.issues.invalidKey","unterminated-quote":"envManager.issues.unterminatedQuote","duplicate-key":"envManager.issues.duplicateKey","control-character":"envManager.issues.controlCharacter","too-large":"envManager.issues.tooLarge","too-many-entries":"envManager.issues.tooManyEntries"},g0=(0,e.memo)(function({worktreeId:a,className:b=""}){let c=(0,h.c)("worktree"),f=function(a){let[b,c]=(0,e.useState)([]),[d,f]=(0,e.useState)(".env"),[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(!0),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)("kv"),[s,t]=(0,e.useState)([]),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)([]),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(new Set),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(0);(0,e.useRef)(0);let I=(0,e.useMemo)(()=>"raw"===q?u:gT(w,y,s),[q,u,w,y,s]),J=(0,e.useMemo)(()=>(function(a){let b=[];if("string"!=typeof a)return{valid:!1,issues:[{line:null,code:"invalid-syntax",severity:"error"}],entries:[]};if(new TextEncoder().encode(a).length>262144)return{valid:!1,issues:[{line:null,code:"too-large",severity:"error"}],entries:[]};let c=a.split(/\r\n|\n|\r/);for(let a=0;a<c.length;a+=1)gU.test(c[a])&&b.push({line:a+1,code:"control-character",severity:"error"});let d=gQ(a);return b.push(...d.issues),d.entries.length>1e3&&b.push({line:null,code:"too-many-entries",severity:"error"}),b.sort((a,b)=>(a.line??0)-(b.line??0)),{valid:!b.some(a=>"error"===a.severity),issues:b,entries:d.entries}})(I),[I]),K=(0,e.useMemo)(()=>"raw"===q?u!==A:w!==A||s.length!==y.length||s.some((a,b)=>a.key!==y[b]?.key||a.value!==y[b]?.value),[q,u,A,w,s,y]),L=(0,e.useCallback)(a=>{if(a!==q){if("raw"===a)v(gT(w,y,s));else{let a=gQ(u);x(u),z(a.entries),t(a.entries.map(a=>({id:gW(),key:a.key,value:a.value,sourceLine:a.line})))}r(a)}},[q,w,y,s,u]),M=(0,e.useCallback)(a=>{f(a),r("kv")},[]),N=(0,e.useCallback)(a=>{v(a),p(!1)},[]),O=(0,e.useCallback)((a,b)=>{t(c=>c.map(c=>c.id===a?{...c,...b}:c)),p(!1)},[]),P=(0,e.useCallback)(a=>{let b={id:gW(),key:a?.key??"",value:a?.value??"",sourceLine:null};t(a=>[...a,b]),p(!1),a?.key&&D(b=>new Set([...b,a.key]))},[]),Q=(0,e.useCallback)(a=>{t(b=>b.filter(b=>b.id!==a)),p(!1)},[]),R=(0,e.useCallback)(a=>{D(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),S=(0,e.useCallback)(()=>F(a=>!a),[]),T=(0,e.useCallback)(()=>{D(new Set(s.map(a=>a.key)))},[s]),U=(0,e.useCallback)(()=>D(new Set),[]),V=(0,e.useCallback)(()=>H(a=>a+1),[]),W=(0,e.useCallback)(()=>{J.valid&&!k&&(l(!0),n(null),gM(a,d,I).then(()=>{p(!0),H(a=>a+1)}).catch(a=>{let b=a instanceof gK?a:null;n({code:b?.code??"UNKNOWN",message:b?.message??(a instanceof Error?a.message:"Failed to save")})}).finally(()=>l(!1)))},[J.valid,k,a,d,I]);return{files:b,selectedFile:d,detail:g,loading:i,saving:k,error:m,saved:o,mode:q,rows:s,rawDraft:u,revealedKeys:C,rawRevealed:E,suggestions:g?.suggestions??[],issues:J.issues,canSave:J.valid,dirty:K,selectFile:M,setMode:L,setRawDraft:N,updateRow:O,addRow:P,removeRow:Q,toggleReveal:R,toggleRawReveal:S,revealAll:T,hideAll:U,reload:V,save:W}}(a);f.dirty,(0,e.useContext)(gX);let{mode:g,rows:i,revealedKeys:k,rawRevealed:l}=f,m=(0,e.useMemo)(()=>f.issues.filter(a=>"error"===a.severity),[f.issues]),n=(0,e.useMemo)(()=>f.issues.filter(a=>"warning"===a.severity),[f.issues]),o="raw"===g?l:i.length>0&&i.every(a=>k.has(a.key)),p=(0,e.useCallback)(()=>{if("raw"===g)return void f.toggleRawReveal();o?f.hideAll():f.revealAll()},[g,o,f]),q=(0,e.useMemo)(()=>"raw"!==g||l?"":function(a,b){let c=a.split(/\r\n|\n|\r/),d=new Map,e=new Set;for(let a of b){d.set(a.line,a);for(let b=a.line+1;b<=a.endLine;b+=1)e.add(b)}let f=[];for(let a=0;a<c.length;a+=1){let b=a+1;if(e.has(b))continue;let g=d.get(b);if(!g){f.push(c[a]);continue}f.push(`${g.exported?"export ":""}${g.key}=${gZ(g.value)}`)}return f.join("\n")}(f.rawDraft,gQ(f.rawDraft).entries),[g,l,f.rawDraft]),r=(0,e.useCallback)((a,b)=>(0,d.jsx)("li",{children:c(g_[a.code],{line:a.line??0,key:a.key??""})},`${a.code}-${a.line??"file"}-${b}`),[c]);return(0,d.jsxs)("div",{"data-testid":"env-manager-pane",role:"region","aria-label":c("envManager.title"),className:`flex flex-col h-full min-h-0 bg-background ${b}`.trim(),children:[(0,d.jsxs)("div",{className:"flex-shrink-0 border-b border-border bg-surface dark:bg-surface-2 p-2 space-y-2",children:[(0,d.jsx)("div",{role:"group","aria-label":c("envManager.filePickerLabel"),className:"flex gap-1 overflow-x-auto scrollbar-hide",children:f.files.map(a=>(0,d.jsxs)(a2.$,{size:"sm",variant:a.name===f.selectedFile?"primary":"ghost",onClick:()=>f.selectFile(a.name),"aria-pressed":a.name===f.selectedFile,"data-testid":`env-file-${a.name}`,className:"flex-shrink-0 whitespace-nowrap min-h-[44px] gap-1.5 font-mono text-xs",children:[a.name,!a.exists&&(0,d.jsx)(f6.E,{variant:"gray",children:c("envManager.notCreated")}),a.isExample&&(0,d.jsx)(f6.E,{variant:"info",children:c("envManager.templateBadge")})]},a.name))}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsxs)("div",{role:"group","aria-label":c("envManager.viewModeLabel"),className:"flex gap-1",children:[(0,d.jsx)(a2.$,{size:"sm",variant:"kv"===g?"primary":"ghost",onClick:()=>f.setMode("kv"),"aria-pressed":"kv"===g,"data-testid":"env-mode-kv",className:"min-h-[44px]",children:c("envManager.viewKeyValue")}),(0,d.jsx)(a2.$,{size:"sm",variant:"raw"===g?"primary":"ghost",onClick:()=>f.setMode("raw"),"aria-pressed":"raw"===g,"data-testid":"env-mode-raw",className:"min-h-[44px]",children:c("envManager.viewRaw")})]}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,d.jsxs)(a2.$,{size:"sm",variant:"ghost",onClick:p,"data-testid":"env-toggle-all","aria-pressed":o,className:"min-h-[44px] gap-1.5",children:[o?(0,d.jsx)(gF.A,{size:16,"aria-hidden":"true"}):(0,d.jsx)(bm,{size:16,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:o?c("envManager.hideAll"):c("envManager.revealAll")})]}),(0,d.jsx)(a2.$,{size:"sm",variant:"ghost",onClick:f.reload,"data-testid":"env-reload","aria-label":c("envManager.reload"),className:"min-h-[44px]",children:(0,d.jsx)(dR.A,{size:16,"aria-hidden":"true"})}),(0,d.jsxs)(a2.$,{size:"sm",variant:"primary",onClick:f.save,loading:f.saving,disabled:!f.canSave||!f.dirty,"data-testid":"env-save",className:"min-h-[44px] gap-1.5",children:[(0,d.jsx)(gG,{size:16,"aria-hidden":"true"}),c("envManager.save")]})]})]})]}),(0,d.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-2 space-y-3",children:[(0,d.jsx)("p",{"data-testid":"env-description",className:"text-xs text-muted-foreground",children:c("envManager.description")}),f.loading&&(0,d.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-muted-foreground",children:[(0,d.jsx)(j.y,{size:"sm"}),c("envManager.loading")]}),f.error&&(0,d.jsx)("div",{role:"alert","data-testid":"env-error",className:"rounded-md border border-danger-border bg-danger-subtle p-2 text-sm text-danger-foreground",children:c("envManager.loadError")}),!f.loading&&f.detail&&!f.detail.exists&&(0,d.jsx)("p",{"data-testid":"env-not-created",className:"rounded-md border border-border bg-muted p-2 text-xs text-muted-foreground",children:c("envManager.notCreatedHint",{file:f.selectedFile})}),f.saved&&!f.dirty&&(0,d.jsx)("p",{"data-testid":"env-saved",className:"text-xs text-success-foreground",children:c("envManager.saved")}),m.length>0&&(0,d.jsxs)("div",{role:"alert","data-testid":"env-errors",className:"rounded-md border border-danger-border bg-danger-subtle p-2 text-xs text-danger-foreground",children:[(0,d.jsxs)("p",{className:"flex items-center gap-1.5 font-medium",children:[(0,d.jsx)(e0.A,{size:14,"aria-hidden":"true"}),c("envManager.validationFailed")]}),(0,d.jsx)("ul",{className:"mt-1 list-disc pl-5 space-y-0.5",children:m.map(r)})]}),n.length>0&&(0,d.jsx)("div",{"data-testid":"env-warnings",className:"rounded-md border border-warning-border bg-warning-subtle p-2 text-xs text-warning-foreground",children:(0,d.jsx)("ul",{className:"list-disc pl-5 space-y-0.5",children:n.map(r)})}),!f.loading&&"kv"===g&&(0,d.jsxs)("div",{"data-testid":"env-kv-view",className:"space-y-2",children:[0===i.length&&(0,d.jsx)("p",{"data-testid":"env-empty",className:"px-1 py-4 text-center text-sm text-muted-foreground",children:c("envManager.empty")}),i.map(a=>{let b=k.has(a.key);return(0,d.jsxs)("div",{"data-testid":"env-row","data-env-key":a.key,className:"flex flex-col gap-1 rounded-md border border-border bg-surface dark:bg-surface-2 p-2 sm:flex-row sm:items-center sm:gap-2",children:[(0,d.jsx)(gI.p,{inputSize:"sm",value:a.key,onChange:b=>f.updateRow(a.id,{key:b.target.value}),"aria-label":c("envManager.keyLabel"),spellCheck:!1,autoComplete:"off","data-testid":"env-row-key",className:"font-mono text-xs sm:w-2/5"}),(0,d.jsxs)("div",{className:"flex flex-1 items-center gap-1",children:[(0,d.jsx)(gI.p,{inputSize:"sm",readOnly:!b,value:b?a.value:gZ(a.value),onChange:b=>f.updateRow(a.id,{value:b.target.value}),"aria-label":c("envManager.valueLabel",{key:a.key}),spellCheck:!1,autoComplete:"off","data-testid":"env-row-value","data-masked":b?"false":"true",className:"flex-1 font-mono text-xs"}),(0,d.jsx)(a2.$,{size:"sm",variant:"ghost",onClick:()=>f.toggleReveal(a.key),"aria-label":b?c("envManager.hideValue",{key:a.key}):c("envManager.showValue",{key:a.key}),"aria-pressed":b,"data-testid":"env-row-reveal",className:`${g$} min-h-[44px]`,children:b?(0,d.jsx)(gF.A,{size:16,"aria-hidden":"true"}):(0,d.jsx)(bm,{size:16,"aria-hidden":"true"})}),(0,d.jsx)(a2.$,{size:"sm",variant:"ghost",onClick:()=>f.removeRow(a.id),"aria-label":c("envManager.removeRow",{key:a.key}),"data-testid":"env-row-remove",className:`${g$} min-h-[44px] text-danger`,children:(0,d.jsx)(dz,{size:16,"aria-hidden":"true"})})]})]},a.id)}),(0,d.jsxs)(a2.$,{size:"sm",variant:"secondary",onClick:()=>f.addRow(),"data-testid":"env-add-row",className:"min-h-[44px] gap-1.5",children:[(0,d.jsx)(bJ.A,{size:16,"aria-hidden":"true"}),c("envManager.addRow")]}),f.suggestions.length>0&&(0,d.jsxs)(gH.Zp,{"data-testid":"env-suggestions",className:"mt-3",children:[(0,d.jsxs)(gH.aR,{children:[(0,d.jsx)(gH.ZB,{className:"text-sm",children:c("envManager.suggestionsTitle")}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("envManager.suggestionsHint")})]}),(0,d.jsx)(gH.Wu,{className:"flex flex-wrap gap-2",children:f.suggestions.map(a=>(0,d.jsxs)(a2.$,{size:"sm",variant:"secondary",onClick:()=>f.addRow({key:a.key,value:a.value}),"data-testid":`env-suggestion-${a.key}`,className:"min-h-[44px] gap-1.5 font-mono text-xs",children:[(0,d.jsx)(bJ.A,{size:14,"aria-hidden":"true"}),a.key,(0,d.jsx)("span",{className:"font-sans text-muted-foreground",children:a.source})]},`${a.source}:${a.key}`))})]})]}),!f.loading&&"raw"===g&&(0,d.jsx)("div",{"data-testid":"env-raw-view",className:"space-y-2",children:l?(0,d.jsx)(gJ.T,{value:f.rawDraft,onChange:a=>f.setRawDraft(a.target.value),"aria-label":c("envManager.rawLabel"),spellCheck:!1,"data-testid":"env-raw-editor",className:"min-h-[240px] font-mono text-xs"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(gJ.T,{readOnly:!0,value:q,"aria-label":c("envManager.rawMaskedLabel"),spellCheck:!1,"data-testid":"env-raw-masked",className:"min-h-[240px] font-mono text-xs"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:c("envManager.rawMaskedHint",{mask:gY})})]})})]})]})}),g1=[{id:"notes",labelKey:"notes"},{id:"logs",labelKey:"logs"},{id:"agent",labelKey:"agentTab"},{id:"timer",labelKey:"timerTab"},{id:"todo",labelKey:"todoTab"},{id:"skills",labelKey:"skillsTab"},{id:"verification",labelKey:"verificationTab"},{id:"env",labelKey:"envTab"}],g2=(0,e.memo)(function({worktreeId:a,className:b="",selectedAgents:c,onSelectedAgentsChange:f,vibeLocalModel:g,onVibeLocalModelChange:i,vibeLocalContextWindow:j,onVibeLocalContextWindowChange:k,maxAgents:l,availableAgents:m,persistToServer:n,onInsertToMessage:o,useInstanceManagement:p=!1,instances:q,onInstancesChange:r,visibleInstanceIds:s,onToggleInstanceVisible:t,modelByInstance:u,composerTargetInstanceId:v,verification:w,requestedSubTab:x}){let y=(0,h.c)("schedule"),[z,A]=(0,e.useState)(x?.tab??"notes"),B=(0,e.useRef)(x?.token??null);(0,e.useEffect)(()=>{x&&x.token!==B.current&&(B.current=x.token,A(x.tab))},[x]);let C=(0,e.useCallback)(a=>{A(a)},[]),D=(0,e.useRef)({});return(0,e.useEffect)(()=>{D.current[z]?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[z]),(0,d.jsxs)("div",{className:`flex flex-col h-full ${b}`,children:[(0,d.jsx)("div",{className:"flex overflow-x-auto scrollbar-hide border-b border-border bg-surface dark:bg-surface-2 flex-shrink-0",children:g1.map(a=>(0,d.jsx)("button",{type:"button",ref:b=>{D.current[a.id]=b},onClick:()=>C(a.id),className:`flex-shrink-0 whitespace-nowrap px-3 py-2 text-sm font-medium transition-colors ${z===a.id?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400 bg-accent-50 dark:bg-accent-900/30":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:y(a.labelKey)},a.id))}),(0,d.jsxs)("div",{className:"flex-1 min-h-0 overflow-hidden",children:["notes"===z&&(0,d.jsx)(d4,{worktreeId:a,className:"h-full",onInsertToMessage:o}),"logs"===z&&(0,d.jsx)(eT,{worktreeId:a,className:"h-full",onInsertToMessage:o,instances:q}),"agent"===z&&(p&&q&&r&&s&&t?(0,d.jsx)("div",{className:"h-full overflow-y-auto",children:(0,d.jsx)(fz,{worktreeId:a,instances:q,onInstancesChange:r,vibeLocalModel:g,onVibeLocalModelChange:i,vibeLocalContextWindow:j,onVibeLocalContextWindowChange:k,visibleInstanceIds:s,onToggleInstanceVisible:t,modelByInstance:u,composerTargetInstanceId:v})}):(0,d.jsx)(eZ,{worktreeId:a,selectedAgents:c,onSelectedAgentsChange:f,vibeLocalModel:g,onVibeLocalModelChange:i,vibeLocalContextWindow:j,onVibeLocalContextWindowChange:k,maxAgents:l,availableAgents:m,persistToServer:n})),"timer"===z&&(0,d.jsx)(fH,{worktreeId:a,instances:q,selectedAgents:c}),"todo"===z&&(0,d.jsx)(ea,{worktreeId:a,className:"h-full"}),"skills"===z&&(0,d.jsx)(f4,{worktreeId:a,className:"h-full"}),"verification"===z&&(0,d.jsx)(gE,{state:w,className:"h-full"}),"env"===z&&(0,d.jsx)(g0,{worktreeId:a,className:"h-full"})]})]})});var g3=c(53237);let g4=["status","changes","history","advanced"],g5="commandmate:gitPane:",g6={activeTab:`${g5}activeTab`,historyOpen:`${g5}historyOpen`,advancedOpen:`${g5}advancedOpen`};function g7(a){return"string"==typeof a&&g4.includes(a)}let g8=a=>"boolean"==typeof a,g9=e.useEffect,ha=(0,e.memo)(function({branches:a,busy:b,actionError:c,hasRunningSession:f,isMobile:g,onCheckout:i}){let j=(0,h.c)("worktree"),l=(0,h.c)("common"),[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(!1),s=(0,e.useRef)(null),t=(0,e.useRef)(null),[u,v]=(0,e.useState)(null),w=a.filter(a=>!a.isCurrent),x=(0,e.useCallback)(()=>{s.current,t.current},[]);g9(()=>m?(x(),window.addEventListener("resize",x),window.addEventListener("scroll",x,!0),()=>{window.removeEventListener("resize",x),window.removeEventListener("scroll",x,!0)}):void v(null),[m,w.length,x]);let y=(0,e.useCallback)(a=>{r(!1),p({...a}),n(!1)},[]),z=(0,e.useCallback)(()=>{o&&(i(o,q),p(null))},[o,q,i]);return(0,d.jsxs)("div",{className:"relative",ref:s,"data-testid":"branch-checkout-dropdown",children:[(0,d.jsxs)(k.$n,{variant:"ghost",type:"button",onClick:()=>n(a=>!a),disabled:b||0===w.length,className:"flex items-center gap-1 px-2 py-1 text-xs rounded border border-input text-accent-700 dark:text-accent-300 hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"branch-checkout-dropdown-toggle","aria-haspopup":"menu","aria-expanded":m,"aria-label":j("git.checkout.ariaLabel"),children:[j("git.checkout.action"),(0,d.jsx)("span",{"aria-hidden":"true",className:"text-[10px]",children:"▾"})]}),m&&"undefined"!=typeof document&&(0,ak.createPortal)((0,d.jsx)("div",{ref:t,className:"fixed z-50 min-w-[12rem] max-w-[calc(100vw-1rem)] max-h-64 overflow-y-auto rounded border border-border bg-surface shadow-lg",style:{top:u?.top??-9999,left:u?.left??-9999},role:"menu","data-testid":"branch-checkout-menu",children:0===w.length?(0,d.jsx)("div",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:j("git.checkout.noBranches")}):(0,d.jsx)("ul",{className:"divide-y divide-border",children:w.map(a=>{let c=null!==a.checkedOutWorktreePath;return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>y(a),disabled:b||c,className:"w-full text-left px-3 py-1.5 font-mono text-xs text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed","aria-label":j("git.checkout.checkoutBranch",{name:a.name}),title:c?j("git.checkout.checkedOutElsewhere",{path:a.checkedOutWorktreePath??""}):void 0,children:[a.name,a.isDefault&&(0,d.jsx)("span",{className:"ml-1.5 text-[10px] text-muted-foreground",children:j("git.checkout.defaultBadge")})]})},`${a.isRemote?"r":"l"}:${a.name}`)})})}),document.body),c&&(0,d.jsx)("div",{className:"mt-1 text-xs text-danger-foreground",role:"alert","data-testid":"branch-checkout-error",children:c}),o&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true","data-testid":"branch-checkout-confirm",children:(0,d.jsxs)("div",{className:"w-full max-w-md rounded-lg bg-surface p-4 shadow-xl flex flex-col gap-3",children:[(0,d.jsxs)("h3",{className:"text-sm font-medium text-foreground",children:[j("git.checkout.confirmTitlePrefix"),(0,d.jsx)("span",{className:"font-mono",children:o.name}),j("git.checkout.confirmTitleSuffix")]}),(0,d.jsx)("div",{className:"rounded border border-warning-border bg-warning-subtle px-3 py-2 text-xs text-warning-foreground",role:"alert","data-testid":"branch-history-loss-warning",children:j("git.checkout.historyLossWarning")}),f&&(0,d.jsx)("div",{className:"rounded border border-danger-border bg-danger-subtle px-3 py-2 text-xs text-danger-foreground",role:"alert","data-testid":"branch-session-warning",children:j("git.checkout.runningSessionWarning")}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,d.jsx)(k.Sc,{checked:q,onCheckedChange:a=>r(!0===a),"data-testid":"branch-checkout-force"}),j("git.checkout.forceLabel")]}),(0,d.jsxs)("div",{className:`flex items-center justify-end gap-2 ${g?"flex-wrap":""}`,children:[(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:()=>p(null),className:"px-3 py-1 text-xs rounded border border-input text-foreground hover:bg-muted",children:l("cancel")}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:z,disabled:b,className:"px-3 py-1 text-xs font-medium rounded bg-accent-600 text-white hover:bg-accent-700 disabled:opacity-50","data-testid":"branch-checkout-confirm-button",children:j("git.checkout.action")})]})]})})]})}),hb=(0,e.memo)(function({open:a,onToggle:b,children:c}){let e=(0,h.c)("worktree");return(0,d.jsxs)("div",{className:"flex flex-col border-t border-border","data-testid":"git-advanced-section",children:[(0,d.jsxs)("button",{type:"button",onClick:b,className:"w-full flex items-center gap-1 px-3 py-2 text-sm font-medium text-muted-foreground cursor-pointer hover:text-foreground","data-testid":"git-advanced-toggle","aria-expanded":a,children:[(0,d.jsx)("span",{className:"text-xs w-4 text-center",children:a?"▼":"▶"}),e("git.advancedOperations")]}),a&&(0,d.jsx)("div",{className:"flex flex-col","data-testid":"git-advanced-content",children:c})]})}),hc=(0,e.createContext)(null);function hd({value:a,children:b}){return(0,d.jsx)(hc.Provider,{value:a,children:b})}function he(){let a=(0,e.useContext)(hc);if(null===a)throw Error("useGitPaneContext must be used within a GitPaneProvider");return a}let hf=(0,e.memo)(function({path:a}){return(0,d.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:a})})}),hg={status:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",changes:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z",history:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",advanced:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"},hh={status:"git.tabs.status",changes:"git.tabs.changes",history:"git.tabs.history",advanced:"git.tabs.advanced"},hi=(0,e.memo)(function({activeTab:a,onTabChange:b}){let c=(0,h.c)("worktree");return(0,d.jsx)("div",{role:"tablist","aria-label":c("git.paneSections"),"data-testid":"git-pane-mobile-tabs",className:"flex shrink-0 border-b border-border bg-surface sticky top-0 z-30",children:g4.map(e=>{let f=e===a,g=c(hh[e]);return(0,d.jsxs)("button",{type:"button",role:"tab","aria-selected":f,"aria-label":g,"data-testid":`git-tab-${e}`,onClick:()=>b(e),className:`flex flex-1 flex-col items-center justify-center gap-1 py-2 px-1 text-xs transition-colors border-b-2 ${f?"text-accent-600 dark:text-accent-400 border-accent-500 bg-accent-50 dark:bg-accent-900/30":"text-muted-foreground border-transparent hover:text-foreground hover:bg-muted"}`,children:[(0,d.jsx)(hf,{path:hg[e]}),(0,d.jsx)("span",{children:g})]},e)})})});function hj({activeTab:a,onTabChange:b,className:c="",statusSection:e,quickActionsSection:f,changesSection:g,historySection:h,advancedSection:i}){let{isMobile:j}=he();return j?(0,d.jsxs)("div",{className:`flex flex-col overflow-hidden ${c}`,"data-testid":"git-pane-mobile",children:[(0,d.jsx)(hi,{activeTab:a,onTabChange:b}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col min-h-0","data-testid":"git-pane-mobile-panel","data-active-tab":a,children:["status"===a&&(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[e,f]}),"changes"===a&&(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:g}),"history"===a&&h,"advanced"===a&&(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:i})]})]}):(0,d.jsxs)("div",{className:`flex flex-col overflow-hidden ${c}`,"data-testid":"git-pane-desktop",children:[(0,d.jsx)("div",{"data-testid":"git-group-read","data-git-group":"read",className:"border-l-2 border-info-border bg-info-subtle/40 dark:bg-info-subtle/20",children:e}),(0,d.jsxs)("div",{"data-testid":"git-group-write","data-git-group":"write",className:"border-l-2 border-input bg-muted/70 dark:bg-muted/30",children:[f,g]}),(0,d.jsx)("div",{"data-testid":"git-group-history","data-git-group":"read",className:"flex-1 flex flex-col min-h-0 border-l-2 border-info-border bg-info-subtle/30 dark:bg-info-subtle/10",children:h}),(0,d.jsx)("div",{"data-testid":"git-group-advanced","data-git-group":"advanced",className:"border-l-2 border-t-2 border-input bg-muted/50 dark:bg-muted/40",children:i})]})}let hk={added:"text-success-foreground",modified:"text-warning-foreground",deleted:"text-danger-foreground",renamed:"text-info",untracked:"text-accent-600 dark:text-accent-400",unmerged:"text-warning-foreground"},hl=(0,e.memo)(function(){return(0,d.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),hm=(0,e.memo)(function({onClick:a,disabled:b=!1,testId:c,className:e=""}){let f=(0,h.c)("worktree");return(0,d.jsxs)("button",{type:"button",disabled:b,onClick:a,className:`inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded border border-info-border text-info-foreground hover:bg-info-subtle disabled:opacity-50 disabled:cursor-not-allowed ${e}`,"data-testid":c,title:f("git.askAiTooltip"),children:[(0,d.jsx)(ck.A,{size:14,"aria-hidden":"true"}),f("git.askAi")]})}),hn=(0,e.memo)(function({line:a}){let b="whitespace-pre font-mono text-xs";return a.startsWith("+")&&!a.startsWith("+++")?b+=" text-success-foreground bg-success-subtle":a.startsWith("-")&&!a.startsWith("---")?b+=" text-danger-foreground bg-danger-subtle":a.startsWith("@@")?b+=" text-info":b+=" text-foreground",(0,d.jsx)("div",{className:b,children:a})}),ho=(0,e.memo)(function({message:a}){return(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-danger-foreground",role:"alert",children:a})}),hp={no_upstream:{badgeKey:"git.currentStatus.noUpstreamBadge",tooltipKey:"git.currentStatus.noUpstreamTooltip"},upstream_gone:{badgeKey:"git.currentStatus.upstreamGoneBadge",tooltipKey:"git.currentStatus.upstreamGoneTooltip"},detached:{badgeKey:"git.currentStatus.detachedBadge",tooltipKey:"git.currentStatus.detachedTooltip"},error:{badgeKey:"git.currentStatus.aheadBehindErrorBadge",tooltipKey:"git.currentStatus.aheadBehindErrorTooltip"}},hq=(0,e.memo)(function({gitStatus:a,statusLoading:b,statusError:c,onRefresh:f,refreshing:g=!1}){let{isMobile:i}=he(),k=(0,h.c)("worktree"),l=(0,bG.Ym)(),m=(0,e.useMemo)(()=>{let b=a?.lastFetchAt;if(null==b)return k("git.currentStatus.lastFetchNever");let c=(0,ap.fw)(new Date(b).toISOString(),(0,dD.M)(l));return c?k("git.currentStatus.lastFetch",{relative:c}):k("git.currentStatus.lastFetchNever")},[a?.lastFetchAt,l,k]),n=a&&!a.aheadBehind?a.aheadBehindReason??null:null;return(0,d.jsxs)("div",{className:"flex flex-col gap-1.5 px-3 py-2 border-b border-border","data-testid":"git-status-section",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:k("git.currentStatus.title")}),(0,d.jsx)("button",{type:"button",onClick:f,disabled:g,className:"p-1 text-muted-foreground hover:text-foreground rounded disabled:opacity-50","aria-label":g?k("git.currentStatus.refreshing"):k("git.currentStatus.refresh"),"aria-busy":g,"data-testid":"git-status-refresh-button",children:g?(0,d.jsx)(j.y,{size:"sm",variant:"accent"}):(0,d.jsx)(hl,{})})]}),b&&!a&&(0,d.jsxs)("div",{className:"flex items-center gap-2 py-1",role:"status",children:[(0,d.jsx)(j.y,{size:"sm",variant:"accent"}),(0,d.jsx)("span",{className:"sr-only",children:k("git.currentStatus.loading")})]}),c&&!a&&(0,d.jsx)("div",{className:"text-xs text-danger-foreground",role:"alert","data-testid":"git-status-error",children:c}),a&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:`flex items-center flex-wrap ${i?"gap-1.5":"gap-2"}`,children:[(0,d.jsx)("span",{className:"inline-flex items-center max-w-full truncate rounded px-2 py-0.5 text-xs font-mono bg-accent-50 text-accent-700 dark:bg-accent-900/30 dark:text-accent-300","data-testid":"git-status-branch-chip",title:a.currentBranch,children:a.currentBranch}),a.statusUnknown&&(0,d.jsx)("span",{className:"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium bg-muted text-muted-foreground border border-border","data-testid":"git-status-unknown-badge",title:k("git.currentStatus.statusUnknownTooltip"),children:k("git.currentStatus.statusUnknown")}),a.isDirty&&(0,d.jsx)("span",{className:"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium bg-warning-subtle text-warning-foreground","data-testid":"git-status-dirty-badge",children:k("git.currentStatus.uncommitted")}),a.aheadBehind&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-mono bg-muted text-foreground","data-testid":"git-status-ahead-behind",children:[(0,d.jsxs)("span",{title:k("git.currentStatus.aheadTooltip"),children:["↑",a.aheadBehind.ahead]}),(0,d.jsxs)("span",{title:k("git.currentStatus.behindTooltip"),children:["↓",a.aheadBehind.behind]})]}),n&&(0,d.jsx)("span",{className:"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium bg-muted text-muted-foreground border border-border","data-testid":"git-status-ahead-behind-reason","data-reason":n,title:k(hp[n].tooltipKey),children:k(hp[n].badgeKey)})]}),(0,d.jsx)("div",{className:"text-[11px] text-muted-foreground","data-testid":"git-status-last-fetch",title:k("git.currentStatus.lastFetchTooltip"),children:m}),a.isBranchMismatch&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5 rounded px-2 py-1 text-xs bg-warning-subtle text-warning-foreground border border-warning-border",role:"alert","data-testid":"git-status-mismatch-warning",children:[(0,d.jsx)("span",{"aria-hidden":"true",children:"⚠"}),(0,d.jsxs)("span",{children:[k("branchMismatch.changedFrom")," ",(0,d.jsx)("span",{className:"font-medium",children:a.initialBranch})," ",k("branchMismatch.to")," ",(0,d.jsx)("span",{className:"font-medium",children:a.currentBranch})]})]})]})]})}),hr=(0,e.memo)(function({progressState:a,operation:b,error:c,conflict:f,conflictFiles:g,hasUpstream:i,onFetch:k,onPull:l,onPush:m,onAbort:n,extraActions:o}){let{isMobile:p}=he(),q=(0,h.c)("worktree"),r="running"===a,s=c??q("git.network.failed"),[t,u]=(0,e.useState)(0);return(0,e.useEffect)(()=>{if(!r)return void u(0);let a=setInterval(()=>u(a=>a+1),1e3);return()=>clearInterval(a)},[r]),(0,d.jsxs)("div",{className:"flex flex-col gap-1.5 px-3 py-2 border-b border-border","data-testid":"git-network-section",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:q("git.network.quickActions")}),(0,d.jsxs)("div",{className:`flex items-center ${p?"flex-wrap gap-1.5":"gap-2"}`,children:[k&&(0,d.jsx)("button",{type:"button",onClick:k,disabled:r,className:"px-2 py-1 text-xs rounded border border-border text-foreground hover:bg-muted disabled:opacity-50","data-testid":"git-fetch-button",children:q("git.network.fetch")}),(0,d.jsx)("button",{type:"button",onClick:l,disabled:r,className:"px-2 py-1 text-xs rounded border border-accent-300 dark:border-accent-700 text-accent-700 dark:text-accent-300 hover:bg-accent-50 dark:hover:bg-accent-900/30 disabled:opacity-50","data-testid":"git-pull-button",children:q("git.network.pull")}),(0,d.jsx)("button",{type:"button",onClick:m,disabled:r,className:"px-2 py-1 text-xs rounded border border-success-border text-success-foreground hover:bg-success-subtle disabled:opacity-50","data-testid":"git-push-button",title:i?void 0:q("git.network.noUpstreamTooltip"),children:q("git.network.push")}),o]}),r&&(0,d.jsxs)("div",{className:`flex items-center gap-2 rounded px-2 py-1 text-xs bg-accent-50 text-accent-800 dark:bg-accent-900/20 dark:text-accent-300 ${p?"sticky top-0 z-40":""}`,"data-testid":"git-network-progress-bar",children:[(0,d.jsxs)("span",{className:"flex items-center gap-2",role:"status","data-testid":"git-network-operation-spinner",children:[(0,d.jsx)(j.y,{size:"sm",variant:"accent"}),(0,d.jsx)("span",{children:q("git.network.progress",{operation:q("push"===b?"git.network.pushing":"pull"===b?"git.network.pulling":"git.network.fetching"),elapsed:t})})]}),(0,d.jsx)("button",{type:"button",onClick:n,className:"ml-auto px-1.5 py-0.5 rounded border border-accent-400 dark:border-accent-600 hover:bg-accent-100 dark:hover:bg-accent-900/40","data-testid":"git-network-abort-button",children:q("git.network.abort")})]}),"error"===a&&(0,d.jsx)("div",{className:"text-xs text-danger-foreground",role:"alert","data-testid":"git-network-operation-error",children:s}),f&&(0,d.jsx)("div",{className:"text-xs text-warning-foreground",role:"status","data-testid":"git-network-conflict",children:q("git.network.conflicts",{files:g.join(", ")})})]})}),hs=(0,e.memo)(function({title:a,testId:b,files:c,actionLabel:f,mode:g,defaultOpen:i,busy:j,onDiff:l,onToggleStage:m,onPreview:n}){let o=(0,h.c)("worktree"),[p,q]=(0,e.useState)(i),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(null),z=(0,e.useCallback)(async a=>{if(r===a){s(null),u(null),y(null);return}s(a),u(null),y(null),w(!0);try{let b=await n(a,g);u(b??"")}catch{y(o("git.changes.previewFailed"))}finally{w(!1)}},[r,n,g,o]);return(0,d.jsxs)("div",{className:"border-t border-border","data-testid":b,children:[(0,d.jsxs)("button",{type:"button",onClick:()=>q(a=>!a),className:"w-full flex items-center gap-1 px-3 py-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",children:[(0,d.jsx)("span",{className:"w-4 text-center",children:p?"▼":"▶"}),o("git.changes.listHeader",{title:a,count:c.length})]}),p&&0===c.length&&(0,d.jsx)("div",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:o("git.changes.empty")}),p&&c.length>0&&(0,d.jsx)("ul",{className:"divide-y divide-border",children:c.map(a=>{let b=r===a.path;return(0,d.jsxs)("li",{className:"flex flex-col",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[(0,d.jsx)("span",{className:`inline-block w-16 shrink-0 text-xs font-medium ${hk[a.status]}`,children:a.status}),(0,d.jsx)("span",{className:"flex-1 truncate font-mono text-xs text-foreground",title:a.path,children:a.path}),(0,d.jsx)("button",{type:"button",onClick:()=>z(a.path),className:"shrink-0 w-5 text-center text-xs text-muted-foreground hover:text-foreground","aria-label":o("git.changes.togglePreview",{path:a.path}),"aria-expanded":b,"data-testid":"git-changes-preview-toggle",children:b?"▼":"▶"}),(0,d.jsx)("button",{type:"button",onClick:()=>l(a.path,g),className:"shrink-0 px-1.5 py-0.5 text-xs text-accent-600 dark:text-accent-400 hover:underline","aria-label":o("git.changes.showDiff",{path:a.path}),"data-testid":"git-changes-diff-button",children:o("git.changes.diff")}),(0,d.jsx)("button",{type:"button",onClick:()=>m(a.path),disabled:j,className:"shrink-0 px-1.5 py-0.5 text-xs rounded border border-input text-foreground hover:bg-muted disabled:opacity-50","aria-label":o("git.changes.fileAction",{action:f,path:a.path}),"data-testid":"git-changes-toggle-button",children:f})]}),b&&(0,d.jsxs)("div",{className:"px-3 pb-2 bg-muted/40","data-testid":"git-changes-inline-preview",children:[v&&(0,d.jsxs)("div",{className:"flex items-center gap-2 py-2",role:"status",children:[(0,d.jsx)(k.y$,{size:"xs",variant:"accent"}),(0,d.jsx)("span",{className:"sr-only",children:o("git.changes.loadingPreview")})]}),x&&(0,d.jsx)("div",{className:"py-2 text-xs text-danger-foreground",role:"alert",children:x}),!v&&!x&&null!==t&&(""===t.trim()?(0,d.jsx)("div",{className:"py-2 text-xs text-muted-foreground",children:o("git.changes.noDiff")}):(0,d.jsxs)("div",{className:"overflow-x-auto",children:[(0,d.jsx)("pre",{className:"text-xs",children:(0,d.jsx)("code",{children:t.split("\n").slice(0,20).map((a,b)=>(0,d.jsx)(hn,{line:a},b))})}),t.split("\n").length>20&&(0,d.jsx)("button",{type:"button",onClick:()=>l(a.path,g),className:"mt-1 text-xs text-accent-600 dark:text-accent-400 hover:underline","data-testid":"git-changes-preview-more",children:o("git.changes.truncated")})]}))]})]},`${a.status}:${a.path}`)})})]})}),ht=(0,e.memo)(function({staged:a,loading:b,error:c,busy:e,commitMessage:f,amend:g,committing:i,commitError:j,onRefresh:l,onDiff:m,onPreview:n,onStage:o,onUnstage:p,onCommitMessageChange:q,onAmendChange:r,onCommit:s,onCommitAndPush:t}){let{isMobile:u}=he(),v=(0,h.c)("worktree"),w=a?.staged??[],x=a?.unstaged??[],y=a?.untracked??[],z=!i&&f.trim().length>0&&(w.length>0||g),A=!u;return(0,d.jsxs)("div",{className:"flex flex-col border-b border-border","data-testid":"git-changes-section",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:v("git.changes.title")}),(0,d.jsx)("button",{type:"button",onClick:l,className:"p-1 text-muted-foreground hover:text-foreground rounded","aria-label":v("git.changes.refresh"),children:(0,d.jsx)(hl,{})})]}),b&&!a&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pb-2",role:"status",children:[(0,d.jsx)(k.y$,{size:"sm",variant:"accent"}),(0,d.jsx)("span",{className:"sr-only",children:v("git.changes.loading")})]}),c&&!a&&(0,d.jsx)("div",{className:"px-3 pb-2 text-xs text-danger-foreground",role:"alert","data-testid":"git-changes-error",children:c}),a&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(hs,{title:v("git.changes.staged"),testId:"git-staged-list",files:w,actionLabel:v("git.changes.unstage"),mode:"staged",defaultOpen:A,busy:e,onDiff:m,onPreview:n,onToggleStage:p}),(0,d.jsx)(hs,{title:v("git.changes.unstaged"),testId:"git-unstaged-list",files:x,actionLabel:v("git.changes.stage"),mode:"unstaged",defaultOpen:A,busy:e,onDiff:m,onPreview:n,onToggleStage:o}),(0,d.jsx)(hs,{title:v("git.changes.untracked"),testId:"git-untracked-list",files:y,actionLabel:v("git.changes.stage"),mode:"untracked",defaultOpen:A,busy:e,onDiff:m,onPreview:n,onToggleStage:o}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-2 border-t border-border",children:[(0,d.jsx)("textarea",{value:f,onChange:a=>q(a.target.value),placeholder:v("git.changes.commitMessage"),rows:u?2:3,className:"w-full resize-y rounded border border-input bg-surface dark:bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"git-commit-message","aria-label":v("git.changes.commitMessage")}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,d.jsx)(k.Sc,{checked:g,onCheckedChange:a=>r(!0===a),"data-testid":"git-amend-checkbox"}),v("git.changes.amend")]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:s,disabled:!z,className:"px-3 py-1 text-xs font-medium rounded bg-accent-600 text-white hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"git-commit-button",children:v(i?"git.changes.committing":"git.changes.commit")}),(0,d.jsx)("button",{type:"button",onClick:t,disabled:!z||e,title:v("git.changes.commitAndPushTooltip"),className:"px-3 py-1 text-xs font-medium rounded border border-accent-600 text-accent-700 dark:text-accent-300 hover:bg-accent-50 dark:hover:bg-accent-900/30 disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"git-commit-push-button",children:v("git.changes.commitAndPush")})]})]}),j&&(0,d.jsx)("div",{className:"text-xs text-danger-foreground",role:"alert","data-testid":"git-commit-error",children:j})]})]})]})}),hu=(0,e.memo)(function({commits:a,isLoading:b,commitError:c,commitListOpen:f,onToggleCommitList:g,onRefresh:i,selectedCommit:k,onCommitSelect:l,inlineDiffCommit:m,inlineFiles:n,inlineFilesLoading:o,inlineFilesError:p,onToggleInlineDiff:q,onInlineDiffFile:r,changedFiles:s,isLoadingFiles:t,detailError:u,selectedFile:v,onFileSelect:w,diffContent:x,isLoadingDiff:y}){let{isMobile:z}=he(),A=(0,h.c)("worktree"),[B,C]=(0,e.useState)(!0),[D,E]=(0,e.useState)(!0);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,d.jsxs)("button",{type:"button",onClick:g,className:"flex items-center gap-1 text-sm font-medium text-muted-foreground cursor-pointer hover:text-foreground",children:[(0,d.jsx)("span",{className:"text-xs w-4 text-center",children:f?"▼":"▶"}),A("git.history.title")]}),(0,d.jsx)("button",{type:"button",onClick:i,className:"p-1 text-muted-foreground hover:text-foreground rounded","aria-label":A("git.history.refresh"),children:(0,d.jsx)(hl,{})})]}),f&&b&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-8",role:"status",children:[(0,d.jsx)(j.y,{size:"lg",variant:"accent"}),(0,d.jsx)("span",{className:"sr-only",children:A("git.history.loading")})]}),f&&c&&!b&&(0,d.jsx)("div",{className:"px-3 py-4 text-sm text-danger-foreground",role:"alert",children:c}),f&&!b&&!c&&0===a.length&&(0,d.jsx)("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:A("git.history.empty")}),!b&&!c&&a.length>0&&(0,d.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden min-h-0",children:[f&&(0,d.jsx)("div",{className:`overflow-y-auto ${k?"max-h-[40%] shrink-0":"flex-1"}`,children:(0,d.jsx)("ul",{className:"divide-y divide-border",children:a.map(a=>{let b=m===a.hash;return(0,d.jsxs)("li",{children:[(0,d.jsxs)("div",{className:"flex items-stretch",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>l(a.hash),className:`flex-1 min-w-0 text-left px-3 py-2 text-sm hover:bg-muted transition-colors ${k===a.hash?"bg-accent-50 dark:bg-accent-900/30":""}`,children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:"font-mono text-xs text-accent-600 dark:text-accent-400 shrink-0",children:a.shortHash}),(0,d.jsx)("span",{className:"truncate text-foreground",children:a.message})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 text-xs text-muted-foreground",children:[(0,d.jsx)("span",{children:a.author}),(0,d.jsx)("span",{children:new Date(a.date).toLocaleDateString()})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>q(a.hash),className:"shrink-0 px-2 text-xs text-accent-600 dark:text-accent-400 hover:bg-muted hover:underline","aria-label":A("git.history.viewDiffFor",{hash:a.shortHash}),"aria-expanded":b,"data-testid":"git-commit-view-diff-button",children:b?A("git.history.hideDiff"):A("git.history.viewDiff")})]}),b&&(0,d.jsxs)("div",{className:"border-t border-border bg-muted/40","data-testid":"git-commit-inline-files",children:[o&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-3",role:"status",children:[(0,d.jsx)(j.y,{size:"sm",variant:"accent"}),(0,d.jsx)("span",{className:"sr-only",children:A("git.history.loadingChangedFiles")})]}),p&&(0,d.jsx)(ho,{message:p}),!o&&!p&&0===n.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:A("git.history.noChangedFiles")}),!o&&n.length>0&&(0,d.jsx)("ul",{className:"divide-y divide-border",children:n.map(b=>(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>r(a.hash,b.path),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${v===b.path&&k===a.hash?"bg-accent-50 dark:bg-accent-900/30":""}`,"aria-label":A("git.history.showCommitDiff",{path:b.path}),"data-testid":"git-commit-inline-file",children:[(0,d.jsx)("span",{className:`inline-block w-14 font-medium ${hk[b.status]}`,children:b.status}),(0,d.jsx)("span",{className:"font-mono text-foreground",children:b.path})]})},b.path))})]})]},a.hash)})})}),k&&(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0 border-t border-border",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>C(a=>!a),className:"w-full flex items-center gap-1 px-3 py-2 text-xs font-medium text-muted-foreground bg-surface-2 sticky top-0 z-10 cursor-pointer hover:text-foreground",children:[(0,d.jsx)("span",{className:"w-4 text-center",children:B?"▼":"▶"}),A("git.history.changedFiles")]}),B&&(0,d.jsxs)(d.Fragment,{children:[u&&(0,d.jsx)(ho,{message:u}),t&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-4",role:"status",children:[(0,d.jsx)(j.y,{size:"sm",variant:"accent"}),(0,d.jsx)("span",{className:"sr-only",children:A("git.history.loadingChangedFiles")})]}),!t&&!u&&0===s.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:A("git.history.noChangedFiles")}),!t&&s.length>0&&(0,d.jsx)("ul",{className:"divide-y divide-border",children:s.map(a=>(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>w(a.path),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${v===a.path?"bg-accent-50 dark:bg-accent-900/30":""}`,children:[(0,d.jsx)("span",{className:`inline-block w-14 font-medium ${hk[a.status]}`,children:a.status}),(0,d.jsx)("span",{className:"font-mono text-foreground",children:a.path})]})},a.path))})]}),z&&v&&(0,d.jsxs)("div",{className:"border-t border-border",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>E(a=>!a),className:"w-full flex items-center gap-1 px-3 py-2 text-xs font-medium text-muted-foreground bg-surface-2 sticky top-0 z-10 cursor-pointer hover:text-foreground",children:[(0,d.jsx)("span",{className:"w-4 text-center",children:D?"▼":"▶"}),A("git.history.diffLabel",{file:v})]}),D&&(0,d.jsxs)(d.Fragment,{children:[y&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-4",role:"status",children:[(0,d.jsx)(j.y,{size:"sm",variant:"accent"}),(0,d.jsx)("span",{className:"sr-only",children:A("git.history.loadingDiff")})]}),!y&&x&&(0,d.jsx)("div",{className:"overflow-x-auto p-2",children:(0,d.jsx)("pre",{className:"text-xs",children:(0,d.jsx)("code",{children:x.split("\n").map((a,b)=>(0,d.jsx)(hn,{line:a},b))})})}),!y&&!x&&!u&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:A("git.history.noDiff")})]})]}),!z&&v&&!u&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground border-t border-border",children:y?A("git.history.loadingDiff"):A("git.history.diffInFilePanel",{file:v})})]})]})]})});function hv(a){return"`"+a+"`"}let hw={local:"git.branches.filterLocal",remote:"git.branches.filterRemote",all:"git.branches.filterAll"},hx=(0,e.memo)(function({branches:a,include:b,loading:c,error:f,busy:g,actionError:i,onIncludeChange:j,onRefresh:l,onCreate:m,onDelete:n}){let{isMobile:o,onInsertToMessage:p}=he(),q=(0,h.c)("worktree"),r=(0,h.c)("common"),[s,t]=(0,e.useState)(!o),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(!1),E=(0,e.useCallback)(()=>{0!==w.trim().length&&(m(w.trim(),y.trim()||void 0),v(!1),x(""),z(""))},[w,y,m]),F=(0,e.useCallback)(()=>{A&&(n(A.name,C),B(null),D(!1))},[A,C,n]);return(0,d.jsxs)("div",{className:"flex flex-col border-b border-border","data-testid":"git-branches-section",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>t(a=>!a),className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[(0,d.jsx)("span",{className:"text-xs w-4 text-center",children:s?"▼":"▶"}),q("git.branches.title")]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>v(!0),className:"px-2 py-0.5 text-xs rounded border border-input text-foreground hover:bg-muted","data-testid":"git-branch-create-open",children:q("git.branches.newButton")}),(0,d.jsx)("button",{type:"button",onClick:l,className:"p-1 text-muted-foreground hover:text-foreground rounded","aria-label":q("git.branches.refresh"),children:(0,d.jsx)(hl,{})})]})]}),s&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"flex items-center gap-1 px-3 pb-2",children:["local","remote","all"].map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>j(a),className:`px-2 py-0.5 text-xs rounded ${b===a?"bg-accent-100 text-accent-800 dark:bg-accent-900/40 dark:text-accent-200":"text-muted-foreground hover:bg-muted"}`,"data-testid":`git-branches-tab-${a}`,children:q(hw[a])},a))}),c&&0===a.length&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pb-2",role:"status",children:[(0,d.jsx)(k.y$,{size:"sm",variant:"accent"}),(0,d.jsx)("span",{className:"sr-only",children:q("git.branches.loading")})]}),f&&(0,d.jsx)("div",{className:"px-3 pb-2 text-xs text-danger-foreground",role:"alert","data-testid":"git-branches-error",children:f}),i&&(0,d.jsx)("div",{className:"px-3 pb-2 text-xs text-danger-foreground",role:"alert","data-testid":"git-branches-action-error",children:i}),!c&&!f&&0===a.length&&(0,d.jsx)("div",{className:"px-3 pb-2 text-xs text-muted-foreground",children:q("git.branches.empty")}),a.length>0&&(0,d.jsx)("ul",{className:"divide-y divide-border max-h-64 overflow-y-auto",children:a.map(a=>{let b=g||a.isCurrent||a.isDefault;return(0,d.jsxs)("li",{className:"flex items-center gap-2 px-3 py-1.5","data-testid":"git-branch-row",children:[(0,d.jsxs)("span",{className:"flex-1 truncate font-mono text-xs text-foreground",title:a.name,children:[a.isCurrent&&(0,d.jsx)("span",{className:"text-accent-600 dark:text-accent-400 mr-1",children:"●"}),a.name,a.isDefault&&(0,d.jsx)("span",{className:"ml-1.5 text-[10px] text-muted-foreground",children:q("git.branches.defaultBadge")})]}),(0,d.jsx)("button",{type:"button",onClick:()=>{D(!1),B(a)},disabled:b,className:"shrink-0 px-1.5 py-0.5 text-xs rounded border border-input text-danger-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed","aria-label":q("git.branches.deleteBranch",{name:a.name}),children:q("git.branches.delete")})]},`${a.isRemote?"r":"l"}:${a.name}`)})})]}),u&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true","data-testid":"branch-create-modal",children:(0,d.jsxs)("div",{className:"w-full max-w-md rounded-lg bg-surface p-4 shadow-xl flex flex-col gap-3",children:[(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground",children:q("git.branches.createTitle")}),(0,d.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:q("git.branches.namePlaceholder"),className:"w-full rounded border border-input bg-surface dark:bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"branch-create-name-input","aria-label":q("git.branches.nameLabel")}),(0,d.jsxs)("select",{value:y,onChange:a=>z(a.target.value),className:"w-full rounded border border-input bg-surface dark:bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"branch-create-from-select","aria-label":q("git.branches.baseLabel"),children:[(0,d.jsx)("option",{value:"",children:q("git.branches.currentHead")}),a.map(a=>(0,d.jsx)("option",{value:a.name,children:a.name},`from:${a.isRemote?"r":"l"}:${a.name}`))]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[p&&(0,d.jsx)(hm,{className:"mr-auto",testId:"branch-create-ask-ai",disabled:0===w.trim().length,onClick:()=>{p(function(a,b,c){let d=c&&c.trim().length>0?hv(c.trim()):a("git.aiPrompts.branchCreateBaseHead");return a("git.aiPrompts.branchCreate",{base:d,name:hv(b.trim())})}(q,w,y)),v(!1)}}),(0,d.jsx)("button",{type:"button",onClick:()=>v(!1),className:"px-3 py-1 text-xs rounded border border-input text-foreground hover:bg-muted",children:r("cancel")}),(0,d.jsx)("button",{type:"button",onClick:E,disabled:g||0===w.trim().length,className:"px-3 py-1 text-xs font-medium rounded bg-accent-600 text-white hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"branch-create-submit",children:q("git.branches.create")})]})]})}),A&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true","data-testid":"branch-delete-confirm",children:(0,d.jsxs)("div",{className:"w-full max-w-md rounded-lg bg-surface p-4 shadow-xl flex flex-col gap-3",children:[(0,d.jsxs)("h3",{className:"text-sm font-medium text-foreground",children:[q("git.branches.deleteTitlePrefix"),(0,d.jsx)("span",{className:"font-mono",children:A.name}),q("git.branches.deleteTitleSuffix")]}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,d.jsx)(k.Sc,{checked:C,onCheckedChange:a=>D(!0===a),"data-testid":"branch-delete-force"}),q("git.branches.forceDeleteLabel")]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[p&&A&&(0,d.jsx)(hm,{className:"mr-auto",testId:"branch-delete-ask-ai",onClick:()=>{p(q(C?"git.aiPrompts.branchDeleteForce":"git.aiPrompts.branchDelete",{name:hv(A.name)})),B(null),D(!1)}}),(0,d.jsx)("button",{type:"button",onClick:()=>B(null),className:"px-3 py-1 text-xs rounded border border-input text-foreground hover:bg-muted",children:r("cancel")}),(0,d.jsx)("button",{type:"button",onClick:F,disabled:g,className:"px-3 py-1 text-xs font-medium rounded bg-danger text-white hover:bg-danger/90 disabled:opacity-50","data-testid":"branch-delete-confirm-button",children:q("git.branches.delete")})]})]})})]})}),hy=(0,e.memo)(function({stashes:a,loading:b,error:c,busy:f,actionError:g,conflictNotice:i,hasRunningSession:j,onRefresh:l,onPush:m,onPop:n,onApply:o,onDrop:p}){let{isMobile:q,onInsertToMessage:r}=he(),s=(0,h.c)("worktree"),t=(0,h.c)("common"),[u,v]=(0,e.useState)(!q),[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(null);return(0,d.jsxs)("div",{className:"border-b border-border","data-testid":"git-stash-section",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>v(a=>!a),className:"flex items-center gap-1 text-sm font-medium text-muted-foreground cursor-pointer hover:text-foreground",children:[(0,d.jsx)("span",{className:"text-xs w-4 text-center",children:u?"▼":"▶"}),s("git.stash.titlePrefix"),a.length>0&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:s("git.stash.count",{count:a.length})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[u&&r&&a.length>0&&(0,d.jsx)(hm,{testId:"stash-cleanup-ask-ai",onClick:()=>r(function(a,b){let c=a("git.aiPrompts.stashCleanup");if(0===b.length)return c;let d=b.map(a=>`- stash@{${a.index}}: ${a.message}`).join("\n");return`${c}
27
27
 
@@ -34,4 +34,4 @@ ${b.trim()}`:c}(s,i))})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",c
34
34
  px-6 py-2 rounded-lg font-medium transition-all
35
35
  disabled:opacity-50 disabled:cursor-not-allowed
36
36
  focus:outline-none focus:ring-2 focus:ring-offset-2
37
- `.trim(),iR="bg-accent-600 text-white hover:bg-accent-700 focus:ring-ring",iS="bg-surface border-2 border-input hover:bg-muted text-foreground focus:ring-ring";function iT(a){}function iU({promptData:a,answering:b,onRespond:c,decisionId:f,onDismiss:g,labelId:i,cliToolName:j,answerable:l}){var m,n;let o=(0,h.c)("prompt"),{selectedOption:p,setSelectedOption:q,checkedNumbers:r,textInputValue:s,setTextInputValue:t,multiSelectOptions:u,takesTypedText:v,isBusy:w,isDisabled:x,handleToggleOption:y,handleYesNoClick:z,handleMultipleChoiceSubmit:A,handleMultiSelectSubmit:B,handleDecisionRespond:C}=S({promptData:a,answering:b,answerable:l,send:(0,e.useCallback)(a=>c(a,f),[c,f]),onError:iT,canRespondDecision:!!f}),D=(m=a,n=f,(0,L.ds)({...m,decisionId:n??null})),E=F(a)?a:null,G=null===E?a:null;return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("h3",{id:i,className:"text-lg font-semibold text-warning-foreground flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xl","aria-hidden":"true",children:"?"}),j?o("confirmationFrom",{toolName:j}):o("confirmationFromClaude")]}),g&&(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:g,"aria-label":"close",className:"p-1 rounded hover:bg-warning-border/50 transition-colors",children:(0,d.jsx)("svg",{className:"w-5 h-5 text-warning-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),E?.instructionText&&(0,d.jsx)("div",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap text-sm text-muted-foreground bg-muted rounded p-2 border border-border",children:E.instructionText}),"multiple_choice"===a.type&&a.askUserQuestion&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ask-user-question-progress",children:a.askUserQuestion.questionCount>1?o("askUserQuestionProgress",{index:a.askUserQuestion.questionIndex+1,total:a.askUserQuestion.questionCount}):o("askUserQuestionSource")}),(0,d.jsx)("p",{className:"text-foreground leading-relaxed",children:Q(o,D.heading)}),w&&(0,d.jsxs)("div",{"data-testid":"answering-indicator",className:"flex items-center gap-2 text-sm text-muted-foreground",role:"status","aria-live":"polite",children:[(0,d.jsx)(k.y$,{size:"sm",variant:"accent"}),(0,d.jsx)("span",{children:o("sending")})]}),"yes_no"===a.type&&(0,d.jsx)(iZ,{promptData:a,disabled:x,onYes:()=>z("yes"),onNo:()=>z("no")}),"multiple_choice"===a.type&&null!==u&&(0,d.jsx)(i_,{promptData:a,disabled:x,checkedNumbers:r,onToggleOption:y,textInputValue:s,onTextInputChange:t,showTextInput:v,onSubmit:B}),"multiple_choice"===a.type&&null===u&&(0,d.jsx)(i$,{promptData:a,disabled:x,selectedOption:p,onSelectOption:q,textInputValue:s,onTextInputChange:t,showTextInput:v,onSubmit:A}),G&&(0,d.jsx)(iV,{promptData:G,view:D,viewSource:{...G,decisionId:D.decisionId},disabled:x,onRespond:C})]})}function iV({promptData:a,view:b,viewSource:c,disabled:e,onRespond:f}){let g=(0,h.c)("prompt"),i="approval"===b.apiTarget?a.decisionOptions??null:null,j="question"===b.apiTarget?(0,L.zM)(c):null;return(0,d.jsxs)("div",{className:"space-y-2","data-testid":"unclassified-prompt-notice",children:[a.message&&a.message.includes("\n")?(0,d.jsx)("pre",{className:"max-h-60 overflow-auto whitespace-pre-wrap break-all rounded border border-border bg-muted p-2 font-mono text-xs text-foreground","data-testid":"structured-decision-message",children:a.message}):a.message?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:a.message}):null,a.askUserQuestion&&(0,d.jsxs)("div",{className:"space-y-1","data-testid":"unclassified-ask-user-question",children:[(0,d.jsx)("p",{className:"text-sm text-foreground",children:a.askUserQuestion.question}),j?(0,d.jsx)(iY,{choices:j,disabled:e,onRespond:f}):(0,d.jsx)("ul",{className:"list-disc list-inside text-sm text-muted-foreground",children:a.askUserQuestion.labels.map(a=>(0,d.jsx)("li",{children:a},a))})]}),j?null:i&&i.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(iW,{toolName:a.toolName??null,patterns:a.patterns??null,allowAlwaysLabel:i.find(a=>"always"===a.reply)?.label??null}),(0,d.jsx)(iX,{options:i,disabled:e,onRespond:f})]}):(0,d.jsx)("p",{className:"text-sm text-foreground",children:g("unclassifiedInstruction",{command:g("unclassifiedRespondCommand")})})]})}function iW({toolName:a,patterns:b,allowAlwaysLabel:c}){let e=null!==b&&b.length>0;return a||e?(0,d.jsxs)("div",{className:"space-y-1","data-testid":"structured-decision-subject",children:[a&&(0,d.jsx)("p",{className:"text-sm font-medium text-foreground font-mono break-all","data-testid":"structured-decision-tool",children:a}),e&&(0,d.jsxs)("div",{className:"text-xs text-muted-foreground",children:[c&&(0,d.jsx)("span",{"data-testid":"structured-decision-patterns-label",children:c}),(0,d.jsx)("ul",{className:"mt-0.5 flex flex-wrap gap-1","data-testid":"structured-decision-patterns",children:b.map(a=>(0,d.jsx)("li",{className:"font-mono break-all bg-muted border border-border rounded px-1.5 py-0.5",children:a},a))})]})]}):null}function iX({options:a,disabled:b,onRespond:c}){let e=(0,h.c)("prompt");return(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-2",role:"group","aria-label":e("selectAnOption"),"data-testid":"structured-decision-actions",children:a.map(a=>(0,d.jsxs)(k.$n,{variant:"ghost",type:"button",disabled:b,onClick:()=>c(String(a.number)),"data-testid":`structured-decision-option-${a.number}`,className:`${iQ} ${3===a.number?iS:iR}`,children:[a.number,". ",a.label]},a.number))})}function iY({choices:a,disabled:b,onRespond:c}){let f=(0,h.c)("prompt"),g=(0,e.useId)(),[i,j]=(0,e.useState)(null),[l,m]=(0,e.useState)(""),n=a.custom?W(l):null,o=!0===a.custom&&X(l),p=(0,e.useCallback)(a=>{let c=i===a,d=b?"opacity-50 cursor-not-allowed":"";return`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all ${c?"bg-accent-50 dark:bg-accent-900/30 border-2 border-accent-500":"bg-surface border-2 border-border hover:border-input"} ${d}`},[i,b]);return(0,d.jsxs)("div",{className:"space-y-3","data-testid":"structured-question-actions",children:[(0,d.jsxs)("fieldset",{children:[(0,d.jsx)("legend",{className:"sr-only",children:f("selectAnOption")}),(0,d.jsx)(k.z6,{name:g,value:null!=i?String(i):"",onValueChange:a=>{j(Number(a)),m("")},disabled:b,className:"flex flex-col gap-2",children:a.labels.map((a,b)=>(0,d.jsxs)("label",{className:p(b+1),children:[(0,d.jsx)(k.CU,{value:String(b+1),className:"mt-1"}),(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsxs)("span",{className:"font-medium",children:[b+1,". ",a]})})]},`${b+1}-${a}`))})]}),a.custom&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:`free-text-${g}`,className:"block text-sm text-muted-foreground mb-1",children:f("freeTextLabel")}),(0,d.jsx)("input",{id:`free-text-${g}`,"data-testid":"structured-question-free-text",type:"text",value:l,maxLength:1e3,onChange:a=>{m(a.target.value),""!==a.target.value&&j(null)},disabled:b,placeholder:f("enterValuePlaceholder"),className:"w-full px-4 py-2 border-2 border-input dark:bg-muted dark:text-foreground rounded-lg focus:outline-none focus:border-accent-500 disabled:opacity-50"}),o&&(0,d.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":"structured-question-free-text-numeric",children:f("freeTextNumericHint")})]}),(0,d.jsx)("button",{type:"button","data-testid":"structured-question-submit",onClick:()=>{null!==n?c(n):null!==i&&c(String(i))},disabled:b||null===i&&null===n,className:`w-full ${iQ} ${iR}`,children:f("submit")})]})}function iZ({promptData:a,disabled:b,onYes:c,onNo:e}){let f=(0,h.c)("prompt"),g="yes"===a.defaultOption,i="no"===a.defaultOption,j=`${iQ} ${iR} ${g?"primary default highlighted":""}`,l=`${iQ} ${i?"bg-foreground text-background hover:bg-foreground/90 primary default highlighted":iS}`;return(0,d.jsxs)("div",{className:"flex items-center gap-3",role:"group","aria-label":f("yesNoGroupLabel"),children:[(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:c,disabled:b,className:j,children:f("yes")}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:e,disabled:b,className:l,children:f("no")})]})}function i$({promptData:a,disabled:b,selectedOption:c,onSelectOption:f,textInputValue:g,onTextInputChange:i,showTextInput:j,onSubmit:l}){let m=(0,e.useId)(),n=(0,h.c)("prompt"),o=(0,e.useCallback)(a=>{let d=c===a,e=b?"opacity-50 cursor-not-allowed":"";return`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all ${d?"bg-accent-50 dark:bg-accent-900/30 border-2 border-accent-500":"bg-surface border-2 border-border hover:border-input"} ${e}`},[c,b]);return(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("fieldset",{children:[(0,d.jsx)("legend",{className:"sr-only",children:n("selectAnOption")}),(0,d.jsx)(k.z6,{name:m,value:null!=c?String(c):"",onValueChange:a=>f(Number(a)),disabled:b,className:"flex flex-col gap-2",children:a.options.map(a=>(0,d.jsxs)("label",{className:o(a.number),children:[(0,d.jsx)(k.CU,{value:String(a.number),className:"mt-1","aria-describedby":a.isDefault?`default-${a.number}`:void 0}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("span",{className:"font-medium",children:[a.number,". ",a.label]}),a.isDefault&&(0,d.jsx)("span",{id:`default-${a.number}`,className:"ml-2 text-xs text-accent-600 dark:text-accent-400 bg-accent-100 dark:bg-accent-900/30 px-2 py-0.5 rounded",children:n("default")}),a.description&&(0,d.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:a.description})]})]},a.number))})]}),j&&(0,d.jsxs)("div",{className:"mt-3",children:[(0,d.jsx)("label",{htmlFor:`text-input-${m}`,className:"sr-only",children:n("customValueInput")}),(0,d.jsx)("input",{id:`text-input-${m}`,type:"text",value:g,onChange:a=>i(a.target.value),disabled:b,placeholder:n("enterValuePlaceholder"),className:"w-full px-4 py-2 border-2 border-input dark:bg-muted dark:text-foreground rounded-lg focus:outline-none focus:border-accent-500 disabled:opacity-50"})]}),(0,d.jsx)("button",{type:"button",onClick:l,disabled:b||null===c,className:`w-full ${iQ} ${iR}`,children:n("submit")})]})}function i_({promptData:a,disabled:b,checkedNumbers:c,onToggleOption:f,textInputValue:g,onTextInputChange:i,showTextInput:j,onSubmit:l}){let m=(0,e.useId)(),n=(0,h.c)("prompt"),o=(0,e.useCallback)(a=>{let c=b?"opacity-50 cursor-not-allowed":"";return`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all ${a?"bg-accent-50 dark:bg-accent-900/30 border-2 border-accent-500":"bg-surface border-2 border-border hover:border-input"} ${c}`},[b]),p=0===c.length,q=j&&""===g.trim();return(0,d.jsxs)("div",{className:"space-y-3","data-testid":"multi-select-prompt-actions",children:[(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"multi-select-hint",children:n("multiSelectHint")}),(0,d.jsxs)("fieldset",{children:[(0,d.jsx)("legend",{className:"sr-only",children:n("selectAllThatApply")}),(0,d.jsx)("div",{role:"group","aria-label":n("selectAllThatApply"),className:"flex flex-col gap-2",children:a.options.map(a=>{let e=c.includes(a.number);return(0,d.jsxs)("label",{className:o(e),children:[(0,d.jsx)(k.Sc,{checked:e,onCheckedChange:b=>f(a.number,!0===b),disabled:b,className:"mt-1","data-testid":`multi-select-option-${a.number}`,"aria-label":`${a.number}. ${a.label}`}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("span",{className:"font-medium",children:[a.number,". ",a.label]}),a.description&&(0,d.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:a.description})]})]},a.number)})})]}),j&&(0,d.jsxs)("div",{className:"mt-3",children:[(0,d.jsx)("label",{htmlFor:`multi-text-input-${m}`,className:"sr-only",children:n("customValueInput")}),(0,d.jsx)("input",{id:`multi-text-input-${m}`,type:"text",value:g,onChange:a=>i(a.target.value),disabled:b,placeholder:n("enterValuePlaceholder"),className:"w-full px-4 py-2 border-2 border-input dark:bg-muted dark:text-foreground rounded-lg focus:outline-none focus:border-accent-500 disabled:opacity-50"})]}),(0,d.jsx)("button",{type:"button","data-testid":"multi-select-submit",onClick:l,disabled:b||p||q,className:`w-full ${iQ} ${iR}`,children:n("submit")})]})}let i0=(0,e.memo)(function({promptData:a,messageId:b,decisionId:c,visible:f,answering:g,onRespond:h,onDismiss:i,cliToolName:j,showStuckHint:k,onSwitchToDirectInput:l,answerable:m,autoYesEnterSent:n}){let o,{shouldRender:p,animationClass:q}=I({visible:f&&null!==a,duration:200}),r=(0,e.useId)();if(!p||!a)return null;let s=(o="opacity-100","animate-fade-in"===q?o="opacity-100 transform translate-y-0":"animate-fade-out"===q&&(o="opacity-0 transform translate-y-2"),`bg-warning-subtle border-2 border-warning-border rounded-lg p-4 shadow-lg transition-all duration-200 ease-in-out ${q} ${o}`);return(0,d.jsx)(G.t,{componentName:"PromptPanel",children:(0,d.jsxs)("div",{"data-testid":"prompt-panel",role:"dialog","aria-labelledby":r,"aria-modal":"true",className:s,children:[(0,d.jsx)(iU,{promptData:a,answering:g,onRespond:h,decisionId:c,onDismiss:i,labelId:r,cliToolName:j,answerable:m}),(0,d.jsx)(Y,{showStuckHint:k,onSwitchToDirectInput:l,answerable:m,autoYesEnterSent:n,linkClassName:"underline font-medium hover:no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-warning-border rounded"})]})})});var i1=c(80132);let i2=(0,x.A)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]),i3=(0,x.A)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),i4=(0,e.memo)(function({worktreeId:a,cliToolId:b,instanceId:c,diff:f,disabled:g=!1}){let i=(0,h.c)("worktree"),j=(0,k.SC)(),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),r=f?.revertedMessageId!=null,s=(0,e.useMemo)(()=>r?f?.revertedFiles??[]:f?.files??[],[r,f]),t=(0,e.useCallback)(async d=>{o(null),m(d);try{let e=await fetch(`/api/worktrees/${a}/opencode/diff`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:d,instanceId:c??b})}),f=await e.json().catch(()=>({}));if(409===e.status&&"SESSION_BUSY"===f.code)return void o("busy");if(!e.ok)return void o("failed");!1===f.applied&&o("noop")}catch{o("failed")}finally{m(null)}},[a,b,c]),u=(0,e.useCallback)(async()=>{await j({title:i("opencodeDiff.revertConfirmTitle"),description:i("opencodeDiff.revertConfirmBody",{count:s.length}),confirmLabel:i("opencodeDiff.revertConfirmLabel"),variant:"danger"})&&await t("revert")},[j,i,s.length,t]),v=(0,e.useCallback)(async()=>{await j({title:i("opencodeDiff.unrevertConfirmTitle"),description:i("opencodeDiff.unrevertConfirmBody",{count:s.length}),confirmLabel:i("opencodeDiff.unrevertConfirmLabel")})&&await t("unrevert")},[j,i,s.length,t]);return"opencode"!==b?null:f&&(f.files.length>0||f.revertedFiles.length>0)?(0,d.jsxs)("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs","data-testid":"opencode-turn-diff-panel",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(i2,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,d.jsx)("span",{className:"font-medium text-foreground",children:r?i("opencodeDiff.revertedTitle"):i("opencodeDiff.title")}),(0,d.jsx)("span",{className:"text-muted-foreground",children:r?i("opencodeDiff.revertedSubtitle",{count:s.length}):i("opencodeDiff.subtitle",{count:s.length})}),(0,d.jsxs)("span",{className:"ml-auto flex items-center gap-1",children:[null!==l?(0,d.jsx)(k.y$,{size:"sm"}):null,r?(0,d.jsxs)(k.$n,{variant:"ghost",size:"sm",onClick:v,disabled:g||null!==l,children:[(0,d.jsx)(i3,{className:"mr-1 h-3.5 w-3.5","aria-hidden":"true"}),i("opencodeDiff.unrevert")]}):(0,d.jsxs)(k.$n,{variant:"ghost",size:"sm",onClick:u,disabled:g||null!==l,children:[(0,d.jsx)(dS.A,{className:"mr-1 h-3.5 w-3.5","aria-hidden":"true"}),i("opencodeDiff.revert")]})]})]}),null!==n?(0,d.jsx)("p",{className:"mt-1 text-danger-foreground",role:"status",children:i(`opencodeDiff.${n}`)}):null,(0,d.jsx)("ul",{className:"mt-1 space-y-0.5",children:s.map((a,b)=>{let c=a.file??i("opencodeDiff.unnamedFile"),e=function(a){let b=[];return a.additions>0&&b.push(`+${a.additions}`),a.deletions>0&&b.push(`−${a.deletions}`),b.join(" ")}(a);return(0,d.jsxs)("li",{className:"flex items-center gap-2",children:[null!==a.patch&&null!==a.file?(0,d.jsx)("button",{type:"button",className:"truncate text-info underline-offset-2 hover:underline",onClick:()=>q(a),title:i("opencodeDiff.openDiff",{file:c}),children:c}):(0,d.jsx)("span",{className:"truncate text-muted-foreground",children:c}),null!==a.status?(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground",children:i(`opencodeDiff.status.${a.status}`)}):null,""!==e?(0,d.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground",children:e}):null]},`${a.file??"unnamed"}-${b}`)})}),(0,d.jsx)(k.Jh,{isOpen:null!==p,onClose:()=>q(null),title:p?.file??void 0,size:"xl",children:null!==p?(0,d.jsx)(ih,{diff:p.patch??"",filePath:p.file??"",onClose:()=>q(null)}):null})]}):null});var i5=c(12712),i6=c(18219),i7=c(15783);function i8(a,b,c,d){let e={answer:a,cliTool:b};if(d&&d!==b&&(e.instanceId=d),c&&(e.promptType=c.type,"multiple_choice"===c.type)){let a=c.options.find(a=>a.isDefault);a&&(e.defaultOptionNumber=a.number),c.submitMode&&(e.submitMode=c.submitMode)}return e}function i9(a,b,c,d){return{decisionId:a,answer:b,cliTool:c,...d&&d!==c?{instanceId:d}:{}}}var ja=c(1401);function jb(a,b){let c=a.target instanceof Element?a.target:null,d=c?.closest("[data-split-index]");if(d){if(Number(d.getAttribute("data-split-index"))!==b)return!1}else if(0!==b||c?.closest('input, textarea, select, [contenteditable="true"]'))return!1;return!0}let jc=(0,e.memo)(function({worktreeId:a,splitIndex:b,cliToolId:c,instanceId:g,instance:i,availableInstances:j,onInstanceChange:k,onFocus:l,disabled:m=!1,pendingInsertText:n,onInsertConsumed:o,onMessageSent:p,cliStatus:q="idle",cliStatusUnclassified:r=!1,autoYes:s,autoYesBlockedByContract:t=!1,autoYesReleasedByRestart:u=!1,autoYesAnswerMode:v,history:w,onDropInstance:x,draggedInstanceId:y,onRequestSessionEnd:z,agentModel:A,onAgentSessionChange:B,isMaximized:C=!1,onToggleMaximize:D,maximizeDisabled:E=!1,showFocusFrame:G=!1,branchName:H}){let I=g??c,J=s.enabled??!1,K=s.expiresAt??null,M=s.lastAutoResponse??null,N=s.onToggle,O=w?.showArchived??!1,P=w?.onShowArchivedChange,Q=w?.historyDisplayLimit,S=w?.onHistoryDisplayLimitChange,T=w?.historyUserOnly??!1,V=w?.onHistoryUserOnlyChange,W=w?.onInsertToMessage,X=w?.onFilePathClick,Y=w?.showToast,Z=(0,h.c)("worktree"),$=(0,bG.Ym)(),[_,aa]=(0,e.useState)(null),[ab,ac]=(0,e.useState)(null),ad=(0,i6.b4)(_,ab,i7.LA),ae=(0,e.useMemo)(()=>(0,i7.h0)(b),[b]),{surfaceMode:af,handleSurfaceModeChange:ag}=dj((0,e.useMemo)(()=>(0,di.$2)(a,b),[a,b])),ai=(0,e.useRef)(af);ai.current=af,(0,e.useEffect)(()=>{function a(a){a.shiftKey&&!a.altKey&&(a.metaKey||a.ctrlKey)&&"m"===a.key.toLowerCase()&&jb(a,b)&&(a.preventDefault(),ag("chat"===ai.current?"terminal":"chat"))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[b,ag]);let aj=(0,e.useRef)(D);aj.current=D;let ak=(0,e.useRef)(E);ak.current=E,(0,e.useEffect)(()=>{function a(a){if(!a.shiftKey||a.altKey||!a.metaKey&&!a.ctrlKey||"Enter"!==a.key||!jb(a,b))return;let c=aj.current;c&&(ak.current||(a.preventDefault(),c()))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[b]);let{terminal:am,prompt:an,agentSession:ao,setAutoScroll:ap,setPromptAnswering:aq,clearPrompt:ar,refresh:as}=(0,c$.NK)({worktreeId:a,cliToolId:c,instanceId:I,enabled:!m}),at=(0,cM.Bj)((0,cM.qi)(a,I),am.startingSince),au=at.starting,[ax,ay]=(0,e.useState)(!1);(0,e.useEffect)(()=>{ay(!1)},[a,c,I]),(0,e.useEffect)(()=>{am.isRunning||ay(!1)},[am.isRunning]);let az=Z("directInput.toggle"),aA=Z("directInput.toggleAria"),aB=(0,e.useCallback)(()=>{ay(a=>!a)},[]),aC=(0,e.useCallback)(()=>{ay(!1)},[]),aD=function({visible:a,isStarting:b,autoYesEnabled:c,data:d,answerable:e,autoYesDecision:f}){return a&&!b&&(!c||R(d,e,f))}({visible:an.visible,isStarting:au,autoYesEnabled:J,data:an.data,answerable:an.answerable,autoYesDecision:an.autoYesDecision}),aF=(0,e.useContext)(im),aG=aD&&!aF,{showStuckHint:aH,markSubmitted:aI}=(0,i1.Cb)({promptData:aG?an.data:null,targetKey:`${a}:${c}:${I}`}),aJ=(0,e.useCallback)(()=>{ay(!0)},[]),{messages:aK,isLoading:aL,refresh:aM}=(0,c_.Md)({worktreeId:a,cliToolId:c,instanceId:I,limit:Q,includeArchived:O,enabled:!m}),{messages:aN,sendOptimistic:aO,retry:aP,discard:aQ}=c2({worktreeId:a,serverMessages:aK,onSent:aM}),{visible:aR,width:aS,toggle:aT,setWidth:aU}=(0,iu.TG)(),aV=f().useRef(null),aW=(0,e.useCallback)(a=>{let b=aV.current;if(!b)return;let c=b.offsetWidth;0!==c&&aU(aS+a/c*100)},[aS,aU]),aX="opencode"===c||"copilot"===c,{compactTuiLayoutPadding:aY,preservePaintedPanelRows:aZ}=(0,e.useMemo)(()=>(0,dh.EK)(c),[c]),a$=(0,e.useCallback)(a=>ap(a),[ap]),a_=(0,e.useCallback)(a=>{as(),aM(),p?.(a)},[as,aM,p]),a2=c3(aQ,W),a3=(0,e.useCallback)(async(b,d)=>{let e;aI(),aq(!0);try{let f=d?i9(d,b,c,I):i8(b,c,F(an.data)?an.data:null,I),g=await fetch(d?`/api/worktrees/${a}/respond`:`/api/worktrees/${a}/prompt-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});e=await (0,ja.a_)(g)}catch(a){console.error("[TerminalSplitPaneContent] prompt response error:",a),e="failed"}try{if("answered"===e)ar();else{let a=ja.J4[e];Y?.(Z(a.messageKey),a.type)}await as()}finally{aq(!1)}},[a,c,I,an.data,aq,ar,as,Y,Z,aI]),a4=(0,e.useCallback)(()=>{ar()},[ar]),a5="chat"===af,a6=am.isSelectionListActive,a7=function({isSelectionListFrame:a,isChatSurface:b,isStarting:c}){return a&&!b&&!c}({isSelectionListFrame:a6,isChatSurface:a5,isStarting:au}),a8="running"===am.sessionStatus&&!r,a9=(0,L.ds)(an.data)?.decisionId??null,ba=(0,e.useMemo)(()=>U(an.data,c),[an.data,c]),bb=function({isUnclassifiedActive:a,isSelectionListFrame:b,promptVisible:c,isChatSurface:d,isStarting:e}){return a&&!b&&!c&&!d&&!e}({isUnclassifiedActive:am.isUnclassifiedActive,isSelectionListFrame:a6,promptVisible:an.visible,isChatSurface:a5,isStarting:au}),bc=cO(am.composerText),bd=cV(c,am.realtimeSnippet||am.output),be=(0,e.useMemo)(()=>({messages:aN,worktreeId:a,onFilePathClick:X??(()=>{}),isLoading:aL,className:"h-full",showToast:Y,onInsertToMessage:W,onRetryPending:aP,onDiscardPending:a2,showArchived:O,onShowArchivedChange:P,historyDisplayLimit:Q,onHistoryDisplayLimitChange:S,historyUserOnly:T,onHistoryUserOnlyChange:V,splitIndex:b,cliToolId:c}),[aN,aP,a2,a,X,aL,Y,W,O,P,Q,S,T,V,b,c]),bf=(0,e.useMemo)(()=>(0,d.jsx)(ds.bl,{...be,onCollapse:aT}),[be,aT]),bg=(0,e.useMemo)(()=>at.noticeVisible&&null!==at.startingSince?(0,d.jsx)(cL.TE,{cliToolId:c,startingSince:at.startingSince,onShowTerminal:at.revealTerminal}):(0,d.jsx)(cJ.D,{output:am.output,isActive:am.isRunning,attaching:am.attaching,isThinking:am.isThinking,autoScroll:am.autoScroll,onScrollChange:a$,disableAutoFollow:aX,compactTuiLayoutPadding:aY,preservePaintedPanelRows:aZ}),[at.noticeVisible,at.revealTerminal,at.startingSince,c,am.output,am.isRunning,am.attaching,am.isThinking,am.autoScroll,a$,aX,aY,aZ]),bh=cZ(am,an),bi=a5&&(0,cY.BM)(bh,am.output,c),bj=(0,e.useMemo)(()=>(0,d.jsx)("div",{"data-testid":`split-chat-slot-${b}`,"aria-label":Z("surfaceMode.chatSurfaceLabel"),className:"flex h-full min-h-0 w-full overflow-hidden bg-surface text-surface-foreground",children:(0,d.jsx)("div",{className:"min-w-0 min-h-0 flex-1 overflow-hidden",children:(0,d.jsx)(cY.wY,{messages:be.messages,worktreeId:a,cliToolId:c,instanceId:I,history:be,live:bh,onSurfaceModeChange:ag,frame:am.output,onKeysSent:as})})}),[be,b,Z,a,c,I,bh,am.output,as,ag]),bk=(0,e.useMemo)(()=>aR?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{id:(0,ds.Ce)(b),"data-testid":`split-history-slot-${b}`,"aria-label":"History pane",style:{width:`${aS}%`},className:"flex-shrink-0 overflow-hidden min-h-0",children:bf}),(0,d.jsx)(hG.f,{onResize:aW,orientation:"horizontal",ariaValueNow:aS})]}):null,[aR,aS,bf,aW,b]),bl=(0,e.useMemo)(()=>(0,d.jsxs)("div",{ref:aV,"data-testid":`split-terminal-row-${b}`,className:"flex h-full min-h-0 w-full",children:[bk,(0,d.jsx)("div",{"data-testid":`split-terminal-slot-${b}`,style:aR?void 0:{width:"100%"},className:"flex-grow overflow-hidden min-w-0 min-h-0 relative",children:bg})]}),[aR,bk,bg,b]),bm=(0,e.useMemo)(()=>(0,d.jsxs)("div",{ref:aV,"data-testid":`split-chat-row-${b}`,className:"flex h-full min-h-0 w-full",children:[bk,(0,d.jsx)("div",{"data-testid":`split-chat-output-${b}`,style:aR?void 0:{width:"100%"},className:"flex-grow overflow-hidden min-w-0 min-h-0",children:bj})]}),[aR,bk,bj,b]),{text:bn,aria:bo}=function(a,b,c,d){let e=(0,al.sw)(b??{cliTool:c}),f=d?.trim()?d.trim():null;return{text:f?a("terminal.composerTarget",{agent:e,branch:f}):a("terminal.composerTargetNoBranch",{agent:e}),aria:f?a("terminal.composerTargetLabel",{agent:e,branch:f}):a("terminal.composerTargetLabelNoBranch",{agent:e})}}(Z,i,c,H),bp=(0,e.useMemo)(()=>(0,d.jsxs)("div",{ref:ac,className:"space-y-2","data-testid":`split-footer-${b}`,children:[a7?(0,d.jsx)(a1.Z,{worktreeId:a,cliToolId:c,instanceId:I,onKeysSent:as,frame:am.output,surface:"terminal",showPagerKeys:am.isPagerActive}):null,bb?(0,d.jsx)(cK.U,{worktreeId:a,cliToolId:c,instanceId:I,onKeysSent:as}):null,bc?(0,d.jsx)(cP,{worktreeId:a,cliToolId:c,instanceId:I,composerText:am.composerText,onActionSent:as}):null,bd?(0,d.jsx)(cW,{cliToolId:c,frame:am.realtimeSnippet||am.output}):null,aD?(0,d.jsx)(i0,{promptData:ba,messageId:an.messageId,decisionId:a9,visible:an.visible,answering:an.answering,onRespond:a3,onDismiss:a4,cliToolName:(0,al.oo)(c),showStuckHint:aH,onSwitchToDirectInput:am.isRunning?aJ:void 0,answerable:an.answerable,autoYesEnterSent:an.autoYesEnterSent}):null,am.isRunning&&!bi?(0,d.jsx)(cX.XU,{worktreeId:a,cliToolId:c,instanceId:I,hasAgentSession:null!==ao.session,onKeysSent:as,collapsible:!0,layout:"desktop"}):null,(0,d.jsx)(i4,{worktreeId:a,cliToolId:c,instanceId:I,diff:ao.diff,disabled:!am.isRunning}),ax?(0,d.jsx)(iP,{worktreeId:a,cliToolId:c,instanceId:I,onKeysSent:as,onClose:aC}):null,(0,d.jsxs)("div",{className:"relative","data-testid":`split-composer-${b}`,children:[(0,d.jsx)("div",{"data-testid":`split-composer-target-${b}`,"aria-label":bo,title:bo,className:"pointer-events-none absolute left-3 top-0 z-10 max-w-[calc(100%-1.5rem)] -translate-y-1/2 truncate rounded-sm bg-surface-2 px-1 text-[11px] leading-none text-muted-foreground",children:bn}),(0,d.jsx)(a0.E,{worktreeId:a,onMessageSent:a_,onOptimisticSend:aO,cliToolId:c,instanceId:I,isSessionRunning:am.isRunning,isSessionStarting:au,pendingInsertText:n??null,onInsertConsumed:o,splitIndex:b,onFocus:l,heightScope:ae,maxHeight:ad,isProcessing:a8,showToast:Y,agentModeSlot:(0,d.jsx)(iO,{worktreeId:a,cliToolId:c,instanceId:I,agentMode:am.agentMode,sessionStatus:am.sessionStatus,isPromptWaiting:an.visible,isSelectionListActive:am.isSelectionListActive,isDismissablePanelActive:am.isDismissablePanelActive,isUnclassifiedActive:am.isUnclassifiedActive,onKeysSent:as}),autoYesSlot:(0,d.jsx)(i5.T,{enabled:J,expiresAt:K??null,onToggle:N,lastAutoResponse:M??null,cliToolName:c,inline:!0,blockedByContract:t,releasedByRestart:u,answerMode:v}),directInputSlot:(0,d.jsxs)("button",{type:"button","data-testid":"direct-input-toggle","aria-pressed":ax,"aria-label":aA,title:aA,disabled:!am.isRunning,onClick:aB,className:`shrink-0 inline-flex items-center gap-1 h-[22px] px-1 @min-[520px]:px-2 rounded-md border text-[11px] font-medium leading-none whitespace-nowrap transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${ax?"bg-info-subtle border-info-border text-info-foreground":"bg-surface border-border text-muted-foreground hover:bg-muted"}`,children:[(0,d.jsx)(ah.A,{size:14,"aria-hidden":"true",className:"shrink-0"}),(0,d.jsx)("span",{className:"hidden @min-[520px]:inline","data-testid":"direct-input-toggle-label",children:az})]})})]})]}),[a7,aD,bb,bc,bd,am.realtimeSnippet,am.output,ao.session,bi,am.composerText,am.agentMode,am.sessionStatus,am.isSelectionListActive,am.isDismissablePanelActive,am.isUnclassifiedActive,am.isPagerActive,a,c,I,as,ba,an.messageId,a9,an.visible,an.answering,an.answerable,an.autoYesEnterSent,a3,a4,aH,aJ,a_,aO,am.isRunning,au,a8,n,o,b,l,J,K,t,u,v,M,N,ax,aB,aC,az,aA,Y,ae,ad,ao.diff,bn,bo]),bq=(0,al.sw)(i??{cliTool:c}),br=(0,e.useCallback)(()=>{z?.({cliToolId:c,instanceId:I,label:bq})},[z,c,I,bq]),bs=(0,e.useMemo)(()=>{if(!z||!am.isRunning)return null;let a=Z("terminal.endSessionFor",{name:bq});return(0,d.jsx)(aw.m_,{content:a,placement:"bottom",children:(0,d.jsx)("button",{type:"button",onClick:br,"aria-label":a,"data-testid":`terminal-end-session-button-${b}`,className:"flex items-center justify-center p-0.5 rounded text-muted-foreground hover:text-danger focus:text-danger hover:bg-danger/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-danger/50 transition-colors",children:(0,d.jsx)(av.A,{size:14,"aria-hidden":"true"})})})},[z,am.isRunning,Z,bq,br,b]);(0,e.useEffect)(()=>{B?.(I,ao)},[B,I,ao]);let{model:bt,usage:bu,usageDetail:bv}=dk(A,ao,Z,$);return(0,d.jsx)(aE,{worktreeId:a,splitIndex:b,cliToolId:c,instanceId:I,instance:i,availableInstances:j,onInstanceChange:k,headerExtras:bs,status:q,statusUnclassified:r,agentModel:bt,agentUsage:bu,agentUsageDetail:bv,onFocus:l,attaching:am.attaching,surfaceMode:af,onSurfaceModeChange:ag,isMaximized:C,onToggleMaximize:D,maximizeDisabled:E,showFocusFrame:G,onEndSession:z&&am.isRunning?br:void 0,terminal:"chat"===af?bm:bl,footer:bp,bodyRef:aa,onDropInstance:x,draggedInstanceId:y})}),jd=bo.M.MODAL;function je(a){return!!a&&!!a.isConnected&&("function"!=typeof a.checkVisibility||a.checkVisibility())}function jf(a,b){let c=(0,e.useRef)(null);return(null!==a&&b&&b.length>0&&(c.current={runId:a.id,gates:b}),b&&b.length>0)?b:null!==a&&c.current?.runId===a.id?c.current.gates:null}let jg=(0,e.memo)(function({task:a,latestRun:b,latestRunGates:c,onOpen:f,paneOpen:g=!1,className:i="",popover:j="inline"}){var k;let l=(0,h.c)("worktree"),[m,n]=(0,e.useState)(!1),o=(0,e.useRef)(null),p=(0,e.useRef)(null),[q,r]=(0,e.useState)(null),s=(0,e.useId)(),t=jf(b,c),u=(0,e.useMemo)(()=>{let c=[a?l("verification.chip.taskReason",{title:a.title,status:l(`task.status.${a.status}`)}):l("verification.chip.noTask")];if(b){if(c.push(l("verification.chip.runReason",{verdict:l(`verification.runStatus.${b.status}`),runId:b.id})),c.push(l(`verification.runStatusGloss.${b.status}`)),t&&t.length>0){let a=t.filter(a=>gb.includes(a.status));c.push(a.length>0?l("verification.chip.failingGates",{gates:a.map(a=>a.gateId).join(", ")}):l("verification.chip.gatesPassed",{count:t.length}))}}else c.push(l("verification.chip.noRun"));return c.push(l(g?"verification.chip.closeHint":"verification.chip.openHint")),c},[a,b,t,g,l]),v=u.join(" \xb7 "),w=(0,e.useCallback)(()=>{n(!1),f()},[f]),x=(0,e.useRef)(null),y=(0,e.useRef)(null),z=(0,e.useCallback)(()=>{let a=p.current??y.current;return null!==a&&(0,bw.DO)(a)},[]),A=(0,e.useCallback)(()=>{m||x.current?.focus(),n(!m)},[m]),C=(0,e.useCallback)(a=>{m&&(0,bw.V$)(a.nativeEvent)&&(z()||(a.preventDefault(),n(!1)))},[m,z]);(0,e.useEffect)(()=>{if(!m)return;let a=a=>{!(o.current?.contains(a.target)||p.current?.contains(a.target))&&je(o.current)&&n(!1)},b=a=>{(0,bw.V$)(a)&&(z()||((0,bw.sr)(a),n(!1)))};return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)}},[m,z]),(0,e.useLayoutEffect)(()=>{if(!m||"floating"!==j)return void r(null);let a=0,b=()=>{let a=o.current;if(!a||!je(a))return void r(a=>null===a?a:null);let b=function(a){let b=Math.max(8,Math.min(a.left,8));return{top:a.bottom+4,left:b,width:272}}(a.getBoundingClientRect());r(a=>a&&a.top===b.top&&a.left===b.left&&a.width===b.width?a:b)},c=()=>{b(),a=window.requestAnimationFrame(c)};return b(),a=window.requestAnimationFrame(c),()=>window.cancelAnimationFrame(a)},[m,j]);let D=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"mb-1 font-semibold",children:l("verification.chip.reasonHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:u.map(a=>(0,d.jsx)("li",{className:"break-words",children:a},a))})]});return(0,d.jsxs)("div",{ref:o,"data-activity-entry":"verification",onKeyDown:C,className:`relative inline-flex max-w-full ${i}`.trim(),children:[(0,d.jsxs)("div",{className:"inline-flex min-w-0 max-w-full grow items-center gap-1 rounded-full border border-border bg-surface-2 pr-1 text-xs text-foreground",children:[(0,d.jsxs)("button",{type:"button",onClick:w,"data-testid":"verification-status-chip","aria-label":v,title:v,className:"inline-flex min-w-0 flex-1 items-center gap-1.5 rounded-full px-2 py-1 transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:[(0,d.jsx)(cl.A,{size:14,"aria-hidden":"true",className:"flex-shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"truncate font-medium","data-testid":"verification-chip-title",children:a?(k=a.title,k.length<=36?k:`${k.slice(0,35)}…`):l("verification.title")}),a&&(0,d.jsx)(f6.E,{variant:f8[a.status],className:"flex-shrink-0 px-1.5 py-0","data-testid":"verification-chip-task-status",children:l(`task.status.${a.status}`)}),(0,d.jsx)(f6.E,{variant:b?f9[b.status]:"gray",className:"flex-shrink-0 px-1.5 py-0 font-mono","data-testid":"verification-chip-run-status",children:b?l("verification.chip.resultBadge",{verdict:l(`verification.runStatus.${b.status}`)}):l("verification.chip.unverified")})]}),(0,d.jsx)("button",{type:"button",ref:x,onClick:A,"data-testid":"verification-chip-reason-toggle","aria-expanded":m,"aria-controls":s,"aria-label":l(m?"verification.chip.hideReason":"verification.chip.showReason"),className:"inline-flex min-h-[32px] min-w-[32px] flex-shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:(0,d.jsx)(B.A,{size:14,"aria-hidden":"true"})})]}),m&&"inline"===j&&(0,d.jsx)("div",{ref:y,id:s,role:"tooltip","data-testid":"verification-chip-reason-popover",style:{zIndex:jd},className:"absolute left-0 top-full mt-1 w-72 max-w-[80vw] rounded-lg border border-border bg-surface p-3 text-xs leading-relaxed text-foreground shadow-lg",children:D}),m&&"floating"===j&&"undefined"!=typeof document&&(0,ak.createPortal)((0,d.jsx)("div",{ref:p,id:s,role:"tooltip","data-testid":"verification-chip-reason-popover","data-floating-layer":"true",style:q?{top:q.top,left:q.left,width:q.width,zIndex:jd}:{visibility:"hidden",zIndex:jd},className:"fixed rounded-lg border border-border bg-surface p-3 text-xs leading-relaxed text-foreground shadow-lg",children:D}),document.body)]})}),jh=(0,e.memo)(function({isBranchMismatch:a,currentBranch:b,initialBranch:c}){let f=(0,h.c)("worktree"),[g,i]=(0,e.useState)(!1);return((0,e.useEffect)(()=>{i(!1)},[b]),!a||g||null===c)?null:(0,d.jsxs)("div",{"data-testid":"branch-mismatch-alert",role:"alert",className:"flex items-center gap-3 px-4 py-2 bg-warning-subtle border border-warning-border text-warning-foreground rounded-lg",children:[(0,d.jsx)(e0.A,{className:"w-5 h-5 text-warning flex-shrink-0"}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsxs)("span",{className:"text-sm",children:[f("branchMismatch.changedFrom")," ",(0,d.jsx)("span",{className:"font-medium",children:c})," ",f("branchMismatch.to")," ",(0,d.jsx)("span",{className:"font-medium",children:b})]})}),(0,d.jsx)("button",{type:"button",onClick:()=>i(!0),className:"p-1 rounded hover:bg-warning-subtle transition-colors","aria-label":f("branchMismatch.dismiss"),children:(0,d.jsx)(av.A,{className:"w-4 h-4"})})]})});var ji=c(15350),jj=c(15917);let jk=(0,e.memo)(function({isOpen:a,onClose:b,onConfirm:c,worktreeId:f,sourcePath:g,sourceType:i}){let j=(0,h.c)("worktree"),l=(0,h.c)("common"),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(new Set([""])),[q,r]=(0,e.useState)([]),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(new Set),w=g.includes("/")?g.substring(0,g.lastIndexOf("/")):"";(0,e.useEffect)(()=>{a&&(n(w),p(new Set([""])),r([]),x())},[a,f]);let x=(0,e.useCallback)(async()=>{t(!0);try{let a=await fetch(`/api/worktrees/${f}/tree`);if(!a.ok)return;let b=(await a.json()).items.filter(a=>"directory"===a.type).map(a=>({name:a.name,path:a.name,loaded:!1}));r(b)}catch{}finally{t(!1)}},[f]),y=(0,e.useCallback)(async a=>{v(b=>new Set(b).add(a));try{let b=await fetch(`/api/worktrees/${f}/tree/${a}`);if(!b.ok)return;let c=(await b.json()).items.filter(a=>"directory"===a.type).map(b=>({name:b.name,path:`${a}/${b.name}`,loaded:!1}));r(b=>(function a(b,c,d){return b.map(b=>b.path===c?{...b,children:d,loaded:!0}:b.children?{...b,children:a(b.children,c,d)}:b)})(b,a,c))}catch{}finally{v(b=>{let c=new Set(b);return c.delete(a),c})}},[f]),z=(0,e.useCallback)(async a=>{p(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c});let b=function a(b,c){for(let d of b){if(d.path===c)return d;if(d.children){let b=a(d.children,c);if(b)return b}}return null}(q,a);b&&!b.loaded&&await y(a)},[q,y]),A=(0,e.useCallback)(a=>!(a===w||"directory"===i&&(a===g||a.startsWith(g+"/")))&&!0,[w,g,i]),B=(a,b=0)=>{let c=o.has(a.path),e=m===a.path,f=u.has(a.path),g=A(a.path);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`flex items-center gap-1 py-1.5 px-2 cursor-pointer rounded text-sm transition-colors ${e?"bg-accent-100 text-accent-800":"hover:bg-muted text-foreground"} ${!g?"opacity-40 cursor-not-allowed":""}`,style:{paddingLeft:`${.5+1.25*b}rem`},onClick:()=>{g&&n(a.path)},children:[(0,d.jsx)("button",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",onClick:b=>{b.stopPropagation(),z(a.path)},children:f?(0,d.jsx)(k.y$,{size:"xs",variant:"muted"}):(0,d.jsx)(e6.A,{className:`w-3 h-3 text-muted-foreground transition-transform ${c?"rotate-90":""}`})}),c?(0,d.jsx)(ji.A,{className:"w-4 h-4 text-warning flex-shrink-0"}):(0,d.jsx)(jj.A,{className:"w-4 h-4 text-warning flex-shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]}),c&&a.children&&(0,d.jsx)("div",{children:a.children.map(a=>B(a,b+1))})]},a.path)},C=A(m);return(0,d.jsx)(b_.a,{isOpen:a,onClose:b,title:j("fileTree.moveDialogTitle"),size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"text-sm text-muted-foreground",children:[j("fileTree.moveTo"),": ",(0,d.jsx)("span",{className:"font-mono text-foreground",children:g})]}),(0,d.jsxs)("div",{className:"border border-border rounded-lg max-h-64 overflow-y-auto p-2",children:[(0,d.jsxs)("div",{className:`flex items-center gap-1 py-1.5 px-2 cursor-pointer rounded text-sm transition-colors ${""===m?"bg-accent-100 text-accent-800":"hover:bg-muted text-foreground"} ${!A("")?"opacity-40 cursor-not-allowed":""}`,onClick:()=>{A("")&&n("")},children:[(0,d.jsx)("span",{className:"w-4 h-4"}),(0,d.jsx)(jj.A,{className:"w-4 h-4 text-warning flex-shrink-0"}),(0,d.jsx)("span",{children:j("fileTree.rootDirectory")})]}),s?(0,d.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,d.jsx)(k.y$,{size:"md",variant:"muted"})}):q.map(a=>B(a,1))]}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)(k.$n,{variant:"ghost",onClick:b,className:"px-4 py-2 text-sm text-foreground bg-white border border-border rounded-md hover:bg-muted transition-colors",children:l("cancel")}),(0,d.jsx)(k.$n,{variant:"ghost",onClick:()=>c(m),disabled:!C,className:"px-4 py-2 text-sm text-white bg-accent-600 rounded-md hover:bg-accent-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:j("fileTree.moveConfirm")})]})]})})});function jl(a,b){let c=a.trim();return c?0>=c.lastIndexOf(".")?c+b:c:""}let jm=(0,e.memo)(function({isOpen:a,parentPath:b,onConfirm:c,onCancel:f}){let g=(0,h.c)("worktree"),i=(0,h.c)("common"),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(".md"),n=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(a){k(""),m(".md");let a=setTimeout(()=>{n.current?.focus()},100);return()=>clearTimeout(a)}},[a]);let o=(0,e.useCallback)(()=>{let a=jl(j,l);a&&c(a)},[j,l,c]),p=(0,e.useCallback)(a=>{"Enter"!==a.key||a.nativeEvent.isComposing||(a.preventDefault(),o())},[o]),q=jl(j,l),r=b?`${b}/${q}`:q;return(0,d.jsx)(b_.a,{isOpen:a,onClose:f,title:g("newFileDialog.title"),size:"sm",children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"new-file-name",className:"block text-sm font-medium text-foreground mb-1",children:g("newFileDialog.fileNameLabel")}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{ref:n,id:"new-file-name","data-testid":"new-file-name-input",type:"text",value:j,onChange:a=>k(a.target.value),onKeyDown:p,placeholder:g("newFileDialog.placeholder"),className:"flex-1 px-3 py-2 border border-input rounded-lg bg-surface text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),(0,d.jsx)("select",{"data-testid":"new-file-ext-select",value:l,onChange:a=>m(a.target.value),className:"px-3 py-2 border border-input rounded-lg bg-surface text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",children:bi.map(a=>(0,d.jsx)("option",{value:a,children:a},a))})]})]}),q&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground font-mono bg-muted rounded px-2 py-1",children:r}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:f,className:"px-4 py-2 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg transition-colors",children:i("cancel")}),(0,d.jsx)("button",{type:"button","data-testid":"new-file-confirm-button",onClick:o,disabled:!q,className:"px-4 py-2 text-sm font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-lg transition-colors",children:g("newFileDialog.create")})]})]})})}),jn=['[data-testid="header-tool-bar"]',"[data-activity-entry]",'[data-testid="split-action-bar-items-overflow"]'],jo=(0,e.memo)(function({worktreeId:a,worktree:b,worktreeName:c,worktreeStatus:g,instances:i,rosterReady:j,activeInstanceId:k,setActiveInstanceId:l,instanceSelectionRequest:m=null,onInstanceSelectionHandled:n,hasUpdate:o,lastAutoResponse:p,activeActivity:q,onActivityToggle:r,verification:s,onInfoClick:t,pendingInsertTextMap:u,setFocusedSplitIndex:v,handleInsertToSplit:w,handleInsertConsumed:x,handleInsertToMessage:y,autoYesStateMap:z,makeAutoYesToggleHandler:A,showArchived:B,onShowArchivedChange:C,historyDisplayLimit:D,onHistoryDisplayLimitChange:E,historyUserOnly:F,onHistoryUserOnlyChange:H,onMessageSent:I,onFilePathClick:J,showToast:K,tabsState:L,tabsActions:M,onLoadContent:N,onLoadError:O,onSetLoading:P,onFilePanelSave:Q,onDirtyChange:R,onOpenFile:S,diffContent:T,diffFilePath:U,onCloseDiff:V,fileSearch:W,fileTreeRefresh:X,onFileSelect:Y,onNewFile:Z,onNewDirectory:$,onRename:_,onDelete:aa,onUpload:ab,onMove:ac,onFileTreeReset:ad,onDiffSelect:ae,onAgentInstancesChange:af,vibeLocalModel:ag,onVibeLocalModelChange:ah,vibeLocalContextWindow:ai,onVibeLocalContextWindowChange:aj,isInfoModalOpen:ak,onInfoModalClose:al,onWorktreeUpdate:am,fileInputRef:an,onFileInputChange:ao,onKillSession:ap,onRequestSessionEnd:aq,killTarget:ar,isKillPending:as,onKillCancel:at,onKillConfirm:au,moveTarget:av,isMoveDialogOpen:aw,onMoveCancel:ax,onMoveConfirm:ay,showNewFileDialog:az,newFileParentPath:aA,onNewFileConfirm:aB,onNewFileCancel:aC,killDialogTitle:aD,killDialogWarning:aE,cancelLabel:aF,endLabel:aG}){let aH=(0,h.c)("worktree"),[aI,aJ]=f().useState(null),aK=(0,e.useCallback)(a=>aJ(a),[]),aL=(0,e.useCallback)(()=>aJ(null),[]),aM=(0,e.useMemo)(()=>cB(b?.sessionStatusByInstance),[b?.sessionStatusByInstance]),[aN,aO]=(0,e.useState)({}),aP=(0,e.useCallback)((a,b)=>{aO(c=>c[a]===b?c:{...c,[a]:b})},[]),[aQ,aR]=f().useState(null),aS=f().useRef(0),aT=(0,e.useCallback)(a=>{aS.current+=1,aR({instanceId:a,token:aS.current})},[]),[aU,aV]=(0,e.useState)(null),aW=aU?.instanceId??null,aX=f().useRef(k);aX.current=k,f().useEffect(()=>{aW&&i.some(a=>a.id===aW)&&aX.current!==aW&&l(aW)},[aW,i,l]);let[aY,aZ]=(0,e.useState)(1),{request:a$,requestPlacement:a_,handleApplied:a0}=function(){let[a,b]=(0,e.useState)(null),c=(0,e.useRef)(0);return{request:a,requestPlacement:(0,e.useCallback)((a,d)=>{"roster-only"!==d&&(c.current+=1,b({instanceId:a,placement:d,token:c.current}))},[]),handleApplied:(0,e.useCallback)(a=>{b(b=>b?.token===a?null:b)},[])}}(),a1=(0,e.useCallback)((a,b)=>{a_(a.id,b)},[a_]),a2=(0,e.useMemo)(()=>(0,d.jsx)(fw,{worktreeId:a,instances:i,splitCount:aY,onInstancesChange:af,onAdded:a1}),[a,i,aY,af,a1]),a3=b?.gitStatus?.currentBranch,a4=a3&&"(unknown)"!==a3?a3:c,a5=f().useRef(0);f().useEffect(()=>{m&&m.token!==a5.current&&(a5.current=m.token,aT(m.instanceId),n?.(m.token))},[m,aT,n]);let a6=(0,e.useCallback)(()=>{r(co)},[r]),a7=(0,e.useCallback)(({splitIndex:c,cliToolId:e,instanceId:f,instance:g,availableInstances:h,onInstanceChange:i,onFocus:j,onDropInstance:k,isMaximized:l,onToggleMaximize:m,maximizeDisabled:n,showFocusFrame:o})=>{let q=u.get(c)??null,r=z.get(f),s=r?.enabled??!1,t=r?.expiresAt??null,v=r?.blockedByContract===!0,y=(0,fB.S9)(r),G=r?.answerMode,L=b?.sessionStatusByInstance?.[f]??b?.sessionStatusByCli?.[e],M=(0,b0.kA)(L),N=(0,b0.px)(L);return(0,d.jsx)(jc,{worktreeId:a,splitIndex:c,cliToolId:e,instanceId:f,instance:g,availableInstances:h,onInstanceChange:i,onFocus:j,pendingInsertText:q,onInsertConsumed:()=>x(c),onMessageSent:I,cliStatus:M,cliStatusUnclassified:N,onAgentSessionChange:aP,agentModel:cx(b?.sessionStatusByInstance?.[f]?.model,b?.sessionStatusByInstance?.[f]?.reasoningEffort),autoYes:{enabled:s,expiresAt:t,lastAutoResponse:p,onToggle:A(e,f)},autoYesBlockedByContract:v,autoYesReleasedByRestart:y,autoYesAnswerMode:G,history:{showArchived:B,onShowArchivedChange:C,historyDisplayLimit:D,onHistoryDisplayLimitChange:E,historyUserOnly:F,onHistoryUserOnlyChange:H,onInsertToMessage:a=>w(c,a),onFilePathClick:J,showToast:K},onDropInstance:k,draggedInstanceId:aI,isMaximized:l,onToggleMaximize:m,maximizeDisabled:n,showFocusFrame:o??!1,branchName:a4,onRequestSessionEnd:aq})},[a,u,z,x,I,p,A,b?.sessionStatusByCli,b?.sessionStatusByInstance,J,K,w,B,C,D,E,F,H,aI,aq,aP,a4]),a8=function(a,b,c=!1){let{task:f,latestRun:g,selectedRun:h}=a,i=jf(g,null!==h&&h.id===g?.id?h.gates:null);return(0,e.useMemo)(()=>(0,d.jsx)(jg,{task:f,latestRun:g,latestRunGates:i,onOpen:b,paneOpen:c,popover:"floating"}),[f,g,i,b,c])}(s,a6,q===co),a9=(0,e.useMemo)(()=>(0,d.jsx)(iJ,{worktreeId:a,instances:i,rosterReady:j,renderPane:a7,onFocusedSplitChange:v,showToast:K,onActiveInstanceChange:l,headerInstanceSelection:aQ,instancePlacementRequest:a$,onInstancePlacementApplied:a0,onSplitCountChange:aZ,onSelectedSplitChange:aV,actionBarItems:a8}),[a,i,j,a7,v,K,l,aQ,a$,a0,a8]),ba=(0,e.useMemo)(()=>(0,d.jsx)(il,{terminal:a9,terminalHeader:null,fileTabs:L,worktreeId:a,onCloseTab:M.closeTab,onActivateTab:M.activateTab,onLoadContent:N,onLoadError:O,onSetLoading:P,onFileSaved:Q,diffContent:T,diffFilePath:U,onCloseDiff:V,onDirtyChange:R,onMoveToFront:M.moveToFront,onOpenFile:S}),[a9,L,a,M.closeTab,M.activateTab,N,O,P,Q,T,U,V,R,M.moveToFront,S]),{pinned:bb,togglePinned:bc}=function(a){let[b,c]=(0,e.useState)(!1),d=(0,e.useRef)(b);return d.current=b,{pinned:b,togglePinned:(0,e.useCallback)(()=>{c(!d.current)},[a])}}("commandmate.worktree.activityPanePinned"),bd=(0,e.useCallback)(a=>{null!==q&&(r(q),a&&function(a){if("undefined"==typeof document)return;let b=document.querySelector(`[data-activity-entry="${a}"]`),c=null===b?document.querySelector(a===co?'[data-testid="split-action-bar-items-overflow"]':'[data-testid="header-tool-more"]'):b instanceof HTMLButtonElement?b:b.querySelector("button");c?.focus()}(q))},[q,r]),be=(0,e.useCallback)(()=>bd(!0),[bd]),{reportDirty:bf,isDirty:bg}=function(){let a=(0,e.useRef)(null);return{reportDirty:(0,e.useCallback)(b=>{a.current=b},[]),isDirty:(0,e.useCallback)(()=>a.current??void 0,[])}}(),bi=(0,e.useCallback)(a=>bd("escape"===a),[bd]),bj=(0,e.useCallback)(a=>{let b="undefined"!=typeof document&&document.activeElement?.closest('[data-testid="activity-pane-slot"]')!=null;Y(a),bb||bd(b)},[Y,bb,bd]),bk=(0,e.useMemo)(()=>({files:(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(dZ,{query:W.query,mode:W.mode,isSearching:W.isSearching,error:W.error,onQueryChange:W.setQuery,onModeChange:W.setMode,onClear:W.clearSearch}),(0,d.jsx)(dU,{worktreeId:a,onFileSelect:bj,onNewFile:Z,onNewDirectory:$,onRename:_,onDelete:aa,onUpload:ab,onMove:ac,onResetView:ad,refreshTrigger:X,pollingEnabled:"files"===q,searchQuery:W.query,searchMode:W.mode,searchResults:W.results?.results,className:"flex-1 min-h-0"})]}),git:(0,d.jsx)(hB,{worktreeId:a,onDiffSelect:ae,isMobile:!1,worktree:b??void 0,onInsertToMessage:y,className:"h-full"}),notes:(0,d.jsx)(d4,{worktreeId:a,className:"h-full",onInsertToMessage:y}),schedules:(0,d.jsx)(eT,{worktreeId:a,className:"h-full",onInsertToMessage:y,instances:i}),agent:(0,d.jsx)(fy,{worktreeId:a,instances:i,onInstancesChange:af,vibeLocalModel:ag,onVibeLocalModelChange:ah,vibeLocalContextWindow:ai,onVibeLocalContextWindowChange:aj,modelByInstance:aM,className:"h-full"}),timer:(0,d.jsx)(fH,{worktreeId:a,instances:i}),todo:(0,d.jsx)(ea,{worktreeId:a,className:"h-full"}),skills:(0,d.jsx)(f4,{worktreeId:a,className:"h-full"}),verification:(0,d.jsx)(gE,{state:s,className:"h-full"}),env:(0,d.jsx)(g0,{worktreeId:a,className:"h-full"})}),[a,b,q,W.query,W.mode,W.isSearching,W.error,W.setQuery,W.setMode,W.clearSearch,W.results?.results,bj,Z,$,_,aa,ab,ac,ad,X,ae,y,i,af,ag,ah,ai,aj,aM,s]),bl=(0,e.useMemo)(()=>{let a=cn.find(a=>a.id===q);return a?aH(a.labelKey):""},[q,aH]),bm=(0,e.useMemo)(()=>null===q?null:(0,d.jsx)(hM,{active:q,activities:bk,onDirtyChange:bf}),[q,bk,bf]),bn=(0,e.useMemo)(()=>({title:bl,onTogglePinned:bc,onClose:be,onDismiss:bi,ignoreOutsideSelectors:jn,isDirty:bg,resetKey:q,testIdPrefix:"activity-pane"}),[bl,bc,be,bi,bg,q]);return(0,d.jsx)(G.t,{componentName:"WorktreeDetailRefactored",children:(0,d.jsxs)("div",{className:"flex h-full overflow-hidden relative",children:[(0,d.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 min-w-0",children:[(0,d.jsx)(cE,{worktreeId:a,worktreeName:c,repositoryName:b?.repositoryDisplayName??b?.repositoryName??aH("detail.unknownRepository"),description:b?.description,status:g,gitStatus:b?.gitStatus,onInfoClick:t,hasUpdate:o,sessionStatusByCli:b?.sessionStatusByCli,sessionStatusByInstance:b?.sessionStatusByInstance,instances:i,activeInstanceId:k,onActiveInstanceChange:aT,onAgentDragStart:aK,onAgentDragEnd:aL,onKillSession:ap,agentSessionByInstance:aN,agentAddControl:a2,splitInstanceIds:aU?.splitInstanceIds,activeActivity:q,onActivityToggle:r}),b?.gitStatus&&(0,d.jsx)(jh,{isBranchMismatch:b.gitStatus.isBranchMismatch,currentBranch:b.gitStatus.currentBranch,initialBranch:b.gitStatus.initialBranch}),(0,d.jsx)("div",{className:"flex-1 min-h-0 min-w-0",children:(0,d.jsx)(hH,{activityPane:bm,activityPanePinned:bb,activityPaneFrame:bn,rightPane:(0,d.jsx)(hJ.cV,{terminal:ba})})})]}),(0,d.jsx)(cF,{worktreeId:a,worktree:b,isOpen:ak,onClose:al,onWorktreeUpdate:am}),(0,d.jsx)("input",{ref:an,type:"file",accept:bh.join(","),onChange:ao,className:"hidden","aria-label":aH("detail.uploadFile")}),(0,d.jsx)(b_.a,{isOpen:null!==ar,onClose:at,title:aD,size:"sm",showCloseButton:!0,children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("p",{className:"text-sm text-foreground",children:aE}),(0,d.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,d.jsx)("button",{type:"button",onClick:at,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:aF}),(0,d.jsx)("button",{type:"button",onClick:au,disabled:as,"data-testid":"kill-session-confirm-button",className:"px-4 py-2 text-sm font-medium rounded-md bg-danger hover:bg-danger/90 text-white disabled:opacity-60 disabled:cursor-not-allowed",children:aG})]})]})}),av&&(0,d.jsx)(jk,{isOpen:aw,onClose:ax,onConfirm:ay,worktreeId:a,sourcePath:av.path,sourceType:av.type}),(0,d.jsx)(jm,{isOpen:az,parentPath:aA,onConfirm:aB,onCancel:aC})]})})});al.oo;var jp=c(21787),jq=c(51919);function jr(a,b){switch(b.type){case"SET_PHASE":return{...a,phase:b.phase};case"SHOW_PROMPT":return{...a,phase:"prompt",prompt:{data:b.data,messageId:b.messageId,visible:!0,answering:!1}};case"CLEAR_PROMPT":return{...a,prompt:{...am.kQ}};case"SET_PROMPT_ANSWERING":return{...a,prompt:{...a.prompt,answering:b.answering}};case"SET_LAYOUT_MODE":return{...a,layout:{...a.layout,mode:b.mode}};case"SET_MOBILE_ACTIVE_PANE":return{...a,layout:{...a.layout,mobileActivePane:b.pane}};case"SET_SPLIT_RATIO":return{...a,layout:{...a.layout,splitRatio:b.ratio}};case"SET_LEFT_PANE_TAB":return{...a,layout:{...a.layout,leftPaneTab:b.tab}};case"TOGGLE_LEFT_PANE":return{...a,layout:{...a.layout,leftPaneCollapsed:!a.layout.leftPaneCollapsed}};case"SET_LEFT_PANE_COLLAPSED":return{...a,layout:{...a.layout,leftPaneCollapsed:b.collapsed}};case"SET_ACTIVE_ACTIVITY":return{...a,layout:{...a.layout,activityBar:{...a.layout.activityBar,active:b.activity}}};case"TOGGLE_ACTIVITY":{let c=a.layout.activityBar.active===b.activity?null:b.activity;return{...a,layout:{...a.layout,activityBar:{...a.layout.activityBar,active:c}}}}case"TOGGLE_HISTORY_PANE":{let b=!a.layout.historyPane.visible;return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,visible:b,collapsed:!b}}}}case"SET_HISTORY_PANE_VISIBLE":return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,visible:b.visible,collapsed:!b.visible}}};case"SET_HISTORY_WIDTH":return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,width:b.width}}};case"SET_ERROR":return{...a,error:b.error};case"CLEAR_ERROR":return{...a,error:{...am.mS}};case"INCREMENT_RETRY_COUNT":return{...a,error:{...a.error,retryCount:a.error.retryCount+1}};case"SET_MESSAGES":return{...a,messages:b.messages};case"ADD_MESSAGE":return{...a,messages:[...a.messages,b.message]};case"UPDATE_MESSAGE":return{...a,messages:a.messages.map(a=>a.id===b.id?{...a,...b.updates}:a)};case"CLEAR_MESSAGES":return{...a,messages:[]};case"SET_WS_CONNECTED":return{...a,wsConnected:b.connected};default:return a}}function js(a,b){if(a.length!==b.length)return!1;let c=new Set(a);return b.every(a=>c.has(a))}function jt(a,b){return a instanceof Error&&a.message?a.message:b}var ju=c(30872),jv=c(12529),jw=c(21768),jx=c(31179),jy=c(11801),jz=c(6225);let jA="activeCliTab-",jB="activeInstanceId-",jC=Object.freeze({...jx.b,offersPlanApprove:!1,isTrustConfirmationActive:!1}),jD=[2e3,5e3,1e4],jE={timeoutMs:hR.K3,retries:0},jF=(0,e.memo)(function({label:a}){return(0,d.jsxs)("div",{role:"status","aria-live":"polite","data-testid":"worktree-detail-reconnecting-banner",className:"fixed top-2 left-1/2 z-50 flex -translate-x-1/2 items-center gap-2 rounded-full border border-warning-border bg-warning-subtle px-3 py-1 text-xs text-warning-foreground shadow-sm",children:[(0,d.jsx)(j.y,{size:"xs"}),(0,d.jsx)("span",{children:a})]})}),jG=(0,e.memo)(function({message:a,loginLabel:b,onLogin:c}){return(0,d.jsx)("div",{className:"flex h-full min-h-[200px] items-center justify-center",role:"alert","aria-live":"assertive","data-testid":"worktree-detail-session-expired",children:(0,d.jsxs)("div",{className:"max-w-md rounded-lg border border-border bg-surface p-6 text-center",children:[(0,d.jsx)("p",{className:"font-medium text-foreground",children:a}),(0,d.jsx)(a2.$,{variant:"primary",type:"button",onClick:c,className:"mt-4","data-testid":"worktree-detail-relogin",children:b})]})})}),jH=()=>{},jI=["terminal","history","files","memo","info"],jJ=(0,e.memo)(function({worktreeId:a,cliToolId:b,instanceId:c,onMessageSent:e,isSessionRunning:f,isSessionStarting:g,isProcessing:h,showToast:i,pendingInsertText:j,onInsertConsumed:k,autoYesSlot:l,agentModeSlot:m}){let n=c8({cliToolId:b,instanceId:c});return(0,d.jsx)(a0.E,{worktreeId:a,onMessageSent:e,cliToolId:b,instanceId:c,isSessionRunning:f,isSessionStarting:g,isProcessing:h,showToast:i,pendingInsertText:j,onInsertConsumed:k,onOptimisticSend:n,autoYesSlot:l,agentModeSlot:m})}),jK=(0,e.memo)(function({worktreeId:a}){let{activeActivity:b,activeCliTab:c,activeInstanceId:f,activeTab:j,agentInstances:k,autoYesEnabled:n,autoYesExpiresAt:o,autoYesBlockedByContract:q,autoYesReleasedByRestart:r,autoYesAnswerMode:s,autoYesStateMap:t,diffContent:u,diffFilePath:w,disableAutoFollow:x,displayedInstances:y,error:z,fetchCurrentOutput:A,fileInputRef:B,fileSearch:C,fileTreeRefresh:D,handleActivityOpen:H,handleActivityToggle:I,handleAgentInstancesChange:J,handleAutoYesToggle:M,handleCloseDiff:N,handleDelete:O,handleDiffSelect:P,handleDirtyChange:Q,handleEditorSave:S,handleFileInputChange:T,handleFilePanelSave:V,handleFilePathClick:W,handleFileSelect:X,handleHistoryDisplayLimitChange:Y,handleHistoryUserOnlyChange:Z,handleInfoClick:_,handleInfoModalClose:aa,handleInsertConsumed:ab,handleInsertConsumedSingle:ac,handleInsertToMessage:ad,handleInsertToSplit:ae,handleKillCancel:af,handleKillConfirm:ag,openKillConfirm:ah,openActiveKillConfirm:ai,killTarget:aj,isKillPending:ak,handleLoadContent:an,handleLoadError:ap,handleMessageSent:aq,handleMobileFileViewerClose:ar,handleMobileTabChange:as,handleMove:at,handleMoveCancel:au,handleMoveConfirm:av,handleNewDirectory:aw,handleNewFile:ax,handleNewFileCancel:ay,handleNewFileConfirm:az,handleOpenFile:aA,handlePromptDismiss:aB,handlePromptRespond:aC,handleRename:aD,handleReLogin:aE,handleRetry:aF,handleSetLoading:aH,handleShowArchivedChange:aI,handleUpload:aJ,handleVibeLocalContextWindowChange:aK,handleVibeLocalModelChange:aL,hasUpdate:aM,historyDisplayLimit:aN,historySubTab:aO,historyUserOnly:aP,isAuthExpired:aQ,isInfoModalOpen:aR,isMobile:aS,isMoveDialogOpen:aT,isReconnecting:aU,isSelectionListActive:aV,isPagerActive:aW,promptAnswerable:aX,promptAutoYesEnterSent:aY,promptAutoYesDecision:aZ,selectionListReading:a$,isTrustConfirmationActive:a0,isDismissablePanelActive:a2,isUnclassifiedActive:a3,sessionStatus:a5,agentMode:a6,startingSince:a7,lastAutoResponse:a8,loading:a9,makeAutoYesToggleHandler:ba,mobileFileViewerPath:bb,mobileSelectedAgents:bc,moveTarget:bd,newFileParentPath:be,openMobileDrawer:bf,pendingInsertText:bi,pendingInsertTextMap:bj,rosterReady:bk,instanceSelectionRequest:bl,acknowledgeInstanceSelection:bm,setActiveInstanceId:bn,setFocusedSplitIndex:bo,setHistorySubTab:bq,setWorktree:br,showArchived:bs,showNewFileDialog:bt,showToast:bu,state:bv,tCommon:bw,tWorktree:bx,tabsActions:by,tabsState:bz,resetFileTreeView:bA,toggleInstanceVisible:bB,verification:bC,vibeLocalContextWindow:bD,vibeLocalModel:bE,visibleInstanceIds:bG,worktree:bH,worktreeName:bI,worktreeStatus:bJ}=function({worktreeId:a}){var b;let c=(0,dV.a)(),d=(0,e.useRef)(c);d.current=c;let{openMobileDrawer:f}=(0,b3.VF)();(0,g.useRouter)(),(0,g.usePathname)();let i=(0,g.useSearchParams)();i?.get(b7.Kp);let{state:j,actions:k}=function(){let[a,b]=(0,e.useReducer)(jr,void 0,am.mR),{value:c,setValue:d}=(0,g3.V)({key:"commandmate.worktree.leftPaneCollapsed",defaultValue:!1,validate:a=>"boolean"==typeof a}),f=(0,e.useRef)(a.layout.leftPaneCollapsed);f.current=a.layout.leftPaneCollapsed,(0,e.useRef)(!1);let g=(0,e.useMemo)(()=>({setPhase:a=>b({type:"SET_PHASE",phase:a}),showPrompt:(a,c)=>b({type:"SHOW_PROMPT",data:a,messageId:c}),clearPrompt:()=>b({type:"CLEAR_PROMPT"}),setPromptAnswering:a=>b({type:"SET_PROMPT_ANSWERING",answering:a}),setError:a=>b({type:"SET_ERROR",error:a}),clearError:()=>b({type:"CLEAR_ERROR"}),setMessages:a=>b({type:"SET_MESSAGES",messages:a}),addMessage:a=>b({type:"ADD_MESSAGE",message:a}),updateMessage:(a,c)=>b({type:"UPDATE_MESSAGE",id:a,updates:c}),clearMessages:()=>b({type:"CLEAR_MESSAGES"}),setMobileActivePane:a=>b({type:"SET_MOBILE_ACTIVE_PANE",pane:a}),setLeftPaneTab:a=>b({type:"SET_LEFT_PANE_TAB",tab:a}),setLayoutMode:a=>b({type:"SET_LAYOUT_MODE",mode:a}),setSplitRatio:a=>b({type:"SET_SPLIT_RATIO",ratio:a}),setWsConnected:a=>b({type:"SET_WS_CONNECTED",connected:a}),toggleLeftPane:()=>{let a=!f.current;b({type:"SET_LEFT_PANE_COLLAPSED",collapsed:a}),d(a)},setActiveActivity:a=>b({type:"SET_ACTIVE_ACTIVITY",activity:a}),toggleActivity:a=>b({type:"TOGGLE_ACTIVITY",activity:a}),toggleHistoryPane:()=>b({type:"TOGGLE_HISTORY_PANE"}),setHistoryPaneVisible:a=>b({type:"SET_HISTORY_PANE_VISIBLE",visible:a}),setHistoryWidth:a=>b({type:"SET_HISTORY_WIDTH",width:a})}),[d]);return{state:a,dispatch:b,actions:g}}(),l=(0,h.c)("worktree"),m=(0,h.c)("error"),n=(0,h.c)("common");(0,h.c)("autoYes");let o=(0,a4.SC)(),q=(0,ao.rC)(),r=q?.worktrees.find(b=>b.id===a)??null,[s,t]=(0,e.useState)(r),[u,v]=(0,e.useState)(null===r),w=q?.worktrees.find(b=>b.id===a)?.status;(0,e.useRef)(w);let x=(0,e.useRef)({at:0,status:void 0}),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,G]=(0,e.useState)(0),H=(0,e.useRef)(0),I=(0,e.useRef)(0),J=(0,e.useRef)(null),K=(0,e.useRef)(async()=>null),L=(0,e.useCallback)(()=>{null!==J.current&&(clearTimeout(J.current),J.current=null)},[]);(0,e.useRef)(null!==r);let[M,N]=(0,e.useState)(!1),[O,P]=function(a){let[b,c]=(0,e.useReducer)(function a(b,c){switch(c.type){case"OPEN_FILE":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1!==a){if(b.activeIndex===a)return b;return{...b,activeIndex:a}}if(b.tabs.length>=30)return b;let d={path:c.path,name:h8(c.path),content:null,loading:!1,error:null,isDirty:!1},e=[...b.tabs,d];return{tabs:e,activeIndex:e.length-1}}case"CLOSE_TAB":{var d,e;let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a)return b;let f=b.tabs.filter((b,c)=>c!==a),g=(d=b.activeIndex,0===(e=f.length)||null===d?null:a<d?d-1:a===d?Math.min(a,e-1):d);return{tabs:f,activeIndex:g}}case"ACTIVATE_TAB":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a||b.activeIndex===a)return b;return{...b,activeIndex:a}}case"SET_CONTENT":{let a=h9(b.tabs,c.path,a=>({...a,content:c.content,loading:!1,error:null,isDirty:!1}));if(!a)return b;return{...b,tabs:a}}case"SET_LOADING":{let a=h9(b.tabs,c.path,a=>({...a,loading:c.loading}));if(!a)return b;return{...b,tabs:a}}case"SET_ERROR":{let a=h9(b.tabs,c.path,a=>({...a,error:c.error,loading:!1}));if(!a)return b;return{...b,tabs:a}}case"RENAME_FILE":{let a=b.tabs.findIndex(a=>a.path===c.oldPath);if(-1===a)return b;let d=[...b.tabs];return d[a]={...d[a],path:c.newPath,name:h8(c.newPath)},{...b,tabs:d}}case"DELETE_FILE":return a(b,{type:"CLOSE_TAB",path:c.path});case"RESTORE":{let a=c.paths.slice(0,30).map(a=>({path:a,name:h8(a),content:null,loading:!1,error:null,isDirty:!1}));if(0===a.length)return ib;let b=c.activePath?Math.max(0,a.findIndex(a=>a.path===c.activePath)):0;return{tabs:a,activeIndex:b}}case"SET_DIRTY":{let a=b.tabs.find(a=>a.path===c.path);if(a&&a.isDirty===c.isDirty)return b;let d=h9(b.tabs,c.path,a=>({...a,isDirty:c.isDirty}));if(!d)return b;return{...b,tabs:d}}case"MOVE_TO_FRONT":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a||0===a)return b;return{tabs:[b.tabs[a],...b.tabs.filter((b,c)=>c!==a)],activeIndex:0}}case"CLOSE_ALL":if(0===b.tabs.length)return b;return ib;case"CLOSE_OTHERS":case"CLOSE_TO_RIGHT":{let a="CLOSE_OTHERS"===c.type?"others":"right",d=new Set(ia(b.tabs,c.path,a));if(0===d.size)return b;let e=b.tabs.filter(a=>!d.has(a.path));return{tabs:e,activeIndex:function(a,b,c){if(0===b.length)return null;let d=null!==a.activeIndex?a.tabs[a.activeIndex]?.path:void 0;if(void 0!==d){let a=b.findIndex(a=>a.path===d);if(-1!==a)return a}let e=b.findIndex(a=>a.path===c);return -1!==e?e:0}(b,e,c.path)}}default:return b}},ib);(0,e.useRef)(!1),(0,e.useRef)(a);let d=(0,e.useRef)(b);d.current=b;let f=(0,e.useCallback)(a=>{let b=d.current.tabs;return -1!==b.findIndex(b=>b.path===a)?(c({type:"OPEN_FILE",path:a}),"activated"):b.length>=30?"limit_reached":(c({type:"OPEN_FILE",path:a}),"opened")},[]),g=(0,e.useCallback)(a=>{c({type:"CLOSE_TAB",path:a})},[]),h=(0,e.useCallback)(a=>{c({type:"ACTIVATE_TAB",path:a})},[]),i=(0,e.useCallback)((a,b)=>{c({type:"RENAME_FILE",oldPath:a,newPath:b})},[]),j=(0,e.useCallback)(a=>{c({type:"DELETE_FILE",path:a})},[]),k=(0,e.useCallback)(a=>{c({type:"MOVE_TO_FRONT",path:a})},[]),l=(0,e.useCallback)(()=>{c({type:"CLOSE_ALL"})},[]),m=(0,e.useCallback)(a=>{c({type:"CLOSE_OTHERS",path:a})},[]),n=(0,e.useCallback)(a=>{c({type:"CLOSE_TO_RIGHT",path:a})},[]),o=(0,e.useMemo)(()=>({dispatch:c,openFile:f,closeTab:g,activateTab:h,onFileRenamed:i,onFileDeleted:j,moveToFront:k,closeAllTabs:l,closeOtherTabs:m,closeTabsToRight:n}),[c,f,g,h,i,j,k,l,m,n]);return[b,o]}(a),[Q,R]=(0,e.useState)(null),[S,T]=(0,e.useState)(jv.bk),[U,V]=(0,e.useState)(new Map),[W,X]=(0,e.useState)(null),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(void 0),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(void 0),[ae,af]=(0,e.useState)(jC),ag=(0,e.useRef)(!1),[ah,ai]=(0,e.useState)(null),[aj,ak]=(0,e.useState)(fa.sA),an=(0,e.useRef)(aj);an.current=aj;let ap=(0,e.useRef)(s);ap.current=s;let[aq,ar]=(0,e.useState)(()=>(0,al.lu)((0,fa.sA)())),as=(0,e.useRef)(aq);as.current=aq;let[at,au]=(0,e.useState)(null),av=at===a,[aw,ax]=(0,e.useState)(null),[ay,az]=(0,e.useState)(null),[aA,aB]=(0,e.useState)(()=>{try{let b=window.localStorage.getItem(jA+a);if(b&&(0,al.hR)(b))return b}catch{}return(0,fa.sA)()[0]}),aC=(0,e.useCallback)(b=>{aB(b);try{window.localStorage.setItem(jA+a,b)}catch{}},[a]),aD=(0,e.useRef)(aA);aD.current=aA;let[aE,aF]=(0,e.useState)(()=>{try{let b=window.localStorage.getItem(jB+a);if(b&&(0,al.n6)(b))return b;let c=window.localStorage.getItem(jA+a);if(c&&(0,al.hR)(c))return c}catch{}return(0,fa.sA)()[0]}),aG=(0,e.useCallback)(b=>{aF(b);try{window.localStorage.setItem(jB+a,b)}catch{}let c=as.current.find(a=>a.id===b);c&&aC(c.cliTool)},[a,aC]),aH=(0,e.useRef)(aE);aH.current=aE;let aI=(0,e.useRef)(0),aJ=(0,e.useRef)(0),aK=(0,e.useRef)(0),aL=U.get(aE)?.enabled??!1,aM=U.get(aE)?.expiresAt??null,aN=U.get(aE)?.blockedByContract===!0,aO=(0,fB.S9)(U.get(aE)),aP=U.get(aE)?.answerMode;(0,e.useMemo)(()=>Array.from(U.values()).some(a=>a.enabled),[U]),(0,e.useMemo)(()=>Array.from(U.values()).some(a=>(0,fB.S9)(a)),[U]);let[aQ,aR]=(0,e.useState)(0),[aS,aT]=(0,e.useState)(!1),[aU,aV]=(0,e.useState)(""),{active:aW,setActive:aX,toggle:aY}=function(a){let[b,c]=(0,e.useState)(null),d=(0,e.useRef)(b);d.current=b;let f=(0,e.useRef)(a);return f.current=a,{active:b,setActive:(0,e.useCallback)(a=>{c(a),f.current},[]),toggle:(0,e.useCallback)(a=>{if(d.current===a){c(null),f.current;return}c(a),f.current},[])}}(a),{historySubTab:aZ,setHistorySubTab:a$,showArchived:a_,handleShowArchivedChange:a0,historyUserOnly:a1,handleHistoryUserOnlyChange:a2,historyDisplayLimit:a3,handleHistoryDisplayLimitChange:a5}=function(){let[a,b]=(0,e.useState)("message"),[c,d]=(0,e.useState)(()=>!1),f=(0,e.useCallback)(a=>{d(a),localStorage.setItem("commandmate:showArchived",String(a))},[]),[g,h]=(0,e.useState)(()=>!1),i=(0,e.useCallback)(a=>{h(a);try{localStorage.setItem(jy.gP,String(a))}catch{}},[]),[j,k]=(0,e.useState)(()=>jy.v8);return{historySubTab:a,setHistorySubTab:b,showArchived:c,handleShowArchivedChange:f,historyUserOnly:g,handleHistoryUserOnlyChange:i,historyDisplayLimit:j,handleHistoryDisplayLimitChange:(0,e.useCallback)(a=>{k(a);try{localStorage.setItem(jy.wP,String(a))}catch{}},[])}}(),a6=(0,e.useRef)(a_),a7=(0,e.useRef)(a3),{pendingInsertTextMap:a8,pendingInsertText:a9,setFocusedSplitIndex:ba,handleInsertToMessage:bb,handleInsertToSplit:bc,handleInsertConsumed:bd,handleInsertConsumedSingle:be}=function(){let[a,b]=(0,e.useState)(()=>new Map),[c,d]=(0,e.useState)(0),f=(0,e.useCallback)(a=>{b(b=>{let d=new Map(b);return d.set(c,a),d})},[c]),g=(0,e.useCallback)((a,c)=>{b(b=>{let d=new Map(b);return d.set(a,c),d})},[]),h=(0,e.useCallback)(a=>{b(b=>{if(!b.has(a))return b;let c=new Map(b);return c.delete(a),c})},[]),i=a.get(0)??null,j=(0,e.useCallback)(()=>h(0),[h]);return{pendingInsertTextMap:a,pendingInsertText:i,focusedSplitIndex:c,setFocusedSplitIndex:d,handleInsertToMessage:f,handleInsertToSplit:g,handleInsertConsumed:h,handleInsertConsumedSingle:j}}(),{diffContent:bf,diffFilePath:bi,handleDiffSelect:bj,handleCloseDiff:bk}=function(a){let[b,c]=(0,e.useState)(null),[d,f]=(0,e.useState)(null);return{diffContent:b,diffFilePath:d,handleDiffSelect:(0,e.useCallback)((b,d)=>{a||(c(b),f(d))},[a]),handleCloseDiff:(0,e.useCallback)(()=>{c(null),f(null)},[])}}(c),bl=function(a){let{worktreeId:b,initialMode:c="name",debounceMs:d=300}=a,[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(c),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(null),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useMemo)(()=>(function(a,b){let c=null,d=(...d)=>{c&&clearTimeout(c),c=setTimeout(()=>{a(...d),c=null},b)};return d.cancel=()=>{c&&clearTimeout(c),c=null},d})(a=>{i(a)},d),[d]),u=(0,e.useCallback)(a=>{g(a),t(a),r(null)},[t]),v=(0,e.useCallback)(()=>{g(""),i(""),o(null),r(null),m(!1),s.current&&(s.current.abort(),s.current=null)},[]),w=(0,e.useCallback)(a=>{if(!h.trim())return a;let b=h.toLowerCase();return a.filter(a=>a.name.toLowerCase().includes(b))},[h]),x=(0,e.useCallback)(()=>n&&0!==n.results.length?p(n.results.map(a=>a.filePath)):new Set,[n]);return{query:f,mode:j,isSearching:l,results:n,error:q,setQuery:u,setMode:k,clearSearch:v,filterByName:w,getMatchedPaths:x}}({worktreeId:a});(0,e.useRef)(!1),(0,e.useRef)(a);let bm=(0,e.useCallback)(async()=>{let b=(0,cv.Xg)();try{let c=await (0,bP.E)(`/api/worktrees/${a}`,jE),d=(0,bP.O0)(c);if(d)throw d;if(!c.ok)throw new bP.hD(`Failed to fetch worktree: ${c.status}`,c.status);let e=(0,bP.xd)(c);if(e)throw e;let f=await c.json(),g=(0,cv.PX)(a,f.status,b,x.current),h=g===f.status?f:{...f,status:g};if(t(h),h.selectedAgents){let a=an.current;h.selectedAgents.length===a.length&&h.selectedAgents.every((b,c)=>b===a[c])||ak(h.selectedAgents)}if(h.agentInstances){let b=as.current,c=h.agentInstances;c.length===b.length&&c.every((a,c)=>a.id===b[c].id&&a.cliTool===b[c].cliTool&&a.alias===b[c].alias)||ar(c),au(a)}return"vibeLocalModel"in h&&ax(h.vibeLocalModel??null),"vibeLocalContextWindow"in h&&az(h.vibeLocalContextWindow??null),H.current=0,I.current=0,L(),B(!1),D(!1),z(null),h}catch(d){let a=d instanceof Error?d.message:"Unknown error",b=d instanceof bP.hD?d.status:0;if(H.current+=1,401===b)return D(!0),B(!1),z(null),null;if(null!==ap.current)return H.current>=3&&B(!0),console.error("[WorktreeDetailRefactored] Error fetching worktree:",d),null;z(a);let c=I.current;return c<jD.length&&(I.current=c+1,L(),J.current=setTimeout(()=>{J.current=null,K.current()},jD[c])),null}},[a,L]);K.current=bm;let bn=(0,e.useCallback)(async()=>{let b=aD.current,c=d.current,e=aH.current,f=++aI.current,g=()=>aI.current!==f||aD.current!==b||c&&aH.current!==e;try{let d=new URLSearchParams({cliTool:b,unit:"pairs"});c&&d.set("instance",e),a6.current&&d.set("includeArchived","true"),d.set("limit",String(a7.current));let f=await (0,bP.E)(`/api/worktrees/${a}/messages?${d.toString()}`,jE);if(!f.ok)throw Error(`Failed to fetch messages: ${f.status}`);let h=await f.json();if(g())return;k.setMessages(h.map(a=>({...a,timestamp:new Date(a.timestamp)})))}catch(a){if(g())return;console.error("[WorktreeDetailRefactored] Error fetching messages:",a)}},[a,k]),bo=(0,e.useCallback)(async()=>{let b=aD.current,c=d.current,e=aH.current,f=++aJ.current,g=()=>aJ.current!==f||aD.current!==b||c&&aH.current!==e;try{let d=c?`/api/worktrees/${a}/current-output?cliTool=${b}&instance=${encodeURIComponent(e)}`:`/api/worktrees/${a}/current-output?cliTool=${b}`,f=await (0,bP.E)(d,jE);if(!f.ok){409===f.status&&await (0,c$.y$)(f)&&!g()&&(k.clearPrompt(),_(void 0),ab(!1),ad(void 0),T(jv.bk),af(jC));return}let h=await f.json();if(g()||h.cliToolId&&h.cliToolId!==b)return;let i=h.isSelectionListActive?(0,jv.gO)(h.fullOutput??h.realtimeSnippet):jv.bk;T(a=>(0,jv.hq)(a,i)?a:i),h.isPromptWaiting&&h.promptData?(k.showPrompt(h.promptData,`prompt-${Date.now()}`),_(h.promptAnswerable),ab((0,jz.r)(h.autoYes?.lastEnterFallback)),ad(h.autoYesDecision)):!h.isPromptWaiting&&j.prompt.visible&&k.clearPrompt();let l={isSelectionListActive:h.isSelectionListActive??!1,isPagerActive:h.isPagerActive??!1,offersPlanApprove:(0,ju.S$)(h.realtimeSnippet||h.fullOutput).offersPlanApprove,isTrustConfirmationActive:(h.isSelectionListActive??!1)&&(0,ju.pw)(h.fullOutput??h.realtimeSnippet,b),isDismissablePanelActive:h.isDismissablePanelActive??!1,isUnclassifiedActive:h.isUnclassifiedActive??!1,sessionStatus:h.sessionStatus??"",agentMode:h.agentMode??jq.J_,startingSince:"number"==typeof h.startingSince?h.startingSince:null};if(af(a=>(0,jx.B)(a,l)?a:l),X(h.lastServerResponseTimestamp??null),Z(h.serverPollerActive??!1),h.autoYes){let a=ag.current,d=h.autoYes,f=c?e:b;V(a=>{let b=new Map(a),c=d.enabled&&a.get(f)?.blockedByContract===!0,e=d.enabled?(0,jw.wn)(h.autoYesAnswerMode)?h.autoYesAnswerMode:a.get(f)?.answerMode:void 0;return b.set(f,{enabled:d.enabled,expiresAt:d.expiresAt,...c?{blockedByContract:!0}:{},...e?{answerMode:e}:{},...!d.enabled&&"server-restart"===d.stopReason?{stopReason:"server-restart"}:{}}),b}),ag.current=d.enabled,a&&!h.autoYes.enabled&&("stop_pattern_matched"===h.autoYes.stopReason||"consecutive_errors"===h.autoYes.stopReason)&&ai(h.autoYes.stopReason)}}catch(a){if(g())return;console.error("[WorktreeDetailRefactored] Error fetching current output:",a)}},[a,k,j.prompt.visible]),bq=(0,e.useCallback)(async()=>{let b=++aK.current;try{let c=await (0,bP.E)(`/api/worktrees/${a}/auto-yes`,jE);if(!c.ok)return;let d=await c.json();if(aK.current!==b)return;let e=d?.instances;if(!e||"object"!=typeof e)return;let f=d.answerModeByInstance&&"object"==typeof d.answerModeByInstance?d.answerModeByInstance:{},g=new Map;for(let[a,b]of Object.entries(e))if(b&&"object"==typeof b){let c=b.enabled??!1,d=f[a];g.set(a,{enabled:c,expiresAt:b.expiresAt??null,...c&&!0===b.blockedByContract?{blockedByContract:!0}:{},...c&&(0,jw.wn)(d)?{answerMode:d}:{},...!c&&"server-restart"===b.stopReason?{stopReason:"server-restart"}:{}})}V(g)}catch(a){if(aK.current!==b)return;console.error("[WorktreeDetailRefactored] Error fetching auto-yes states:",a)}},[a]),{visibleInstances:br,visibleInstanceIds:bs,toggleInstanceVisible:bt,showInstances:bu}=function({worktreeId:a,roster:b}){let[c,d]=(0,e.useState)(null),f=(0,e.useMemo)(()=>e$(c,b),[c,b]),g=(0,e.useMemo)(()=>f.map(a=>a.id),[f]),h=(0,e.useMemo)(()=>null!==c&&b.some(a=>c.includes(a.id)),[c,b]),i=(0,e.useCallback)(a=>{let c=new Set(a),e=b.filter(a=>c.has(a.id)).map(a=>a.id);!(e.length<1)&&d(e)},[b,a]),j=(0,e.useCallback)(a=>i(a),[i]);return{visibleInstances:f,visibleInstanceIds:g,hasStoredPreference:h,toggleInstanceVisible:(0,e.useCallback)(a=>{let d=e$(c,b).map(a=>a.id);if(d.includes(a)){if(d.length<=1)return;i(d.filter(b=>b!==a))}else i([...d,a])},[c,b,i]),setVisibleInstanceIds:j,showInstances:(0,e.useCallback)(a=>{null!==c&&i([...e$(c,b).map(a=>a.id),...a])},[c,b,i])}}({worktreeId:a,roster:aq}),bv=c?br:aq,bw=(0,e.useMemo)(()=>Array.from(new Set(br.map(a=>a.cliTool))),[br]),[bx,by]=(0,e.useState)(null);(0,e.useRef)(0),(0,e.useRef)(null);let bz=(0,e.useCallback)(a=>{by(b=>null!==b&&b.token===a?null:b)},[]),bA="opencode"===aA||"copilot"===aA,bB=(0,e.useCallback)(b=>{ar(b),au(a)},[a]),bC=(0,e.useCallback)(a=>{ax(a)},[]),bD=(0,e.useCallback)(a=>{az(a)},[]),bE=`${aA}::${c?aE:aA}`;(0,e.useRef)(bE);let{showToast:bF}=(0,bO.dj)(),bG=(0,e.useCallback)(()=>{bF("Maximum 30 file tabs. Close a tab first.","info")},[bF]),bH=(0,e.useCallback)(a=>{c?R(a):"limit_reached"===P.openFile(a)&&bG()},[c,P,bG]),bI=(0,e.useCallback)(a=>{c?R(a):"limit_reached"===P.openFile(a)&&bG()},[c,P,bG]),bJ=(0,e.useCallback)(a=>{"limit_reached"===P.openFile(a)&&bG()},[P,bG]),bK=(0,e.useCallback)(()=>{R(null)},[]),bL=(0,e.useCallback)(a=>{aR(a=>a+1)},[]),bM=(0,e.useCallback)(()=>{bl.clearSearch(),P.closeAllTabs(),R(null)},[bl,P]),bN=(0,e.useCallback)(a=>{aY(a)},[aY]),bQ=(0,e.useCallback)(a=>{aX(a)},[aX]),bS=(0,e.useCallback)(()=>{N(!0)},[]),bT=(0,e.useCallback)(()=>{N(!1)},[]),bU=(0,e.useCallback)(async b=>{let c;k.setPromptAnswering(!0);try{let e=i8(b,aA,F(j.prompt.data)?j.prompt.data:null,d.current?aH.current:void 0),f=await fetch(`/api/worktrees/${a}/prompt-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});c=await (0,ja.a_)(f)}catch(a){console.error("[WorktreeDetailRefactored] Error sending prompt response:",a),c="failed"}try{if("answered"===c)k.clearPrompt();else{let a=ja.J4[c];bF(l(a.messageKey),a.type)}await bo()}finally{k.setPromptAnswering(!1)}},[a,k,bo,aA,j.prompt.data,bF,l]),bV=(0,e.useCallback)(()=>{k.clearPrompt()},[k]),bW=(0,e.useCallback)(a=>{k.setMobileActivePane(a)},[k]),bX=(0,e.useCallback)(()=>{bn(),bo()},[bn,bo]),bY=(0,e.useCallback)((b,c)=>async d=>{let e=c??b;try{let c=await fetch(`/api/worktrees/${a}/auto-yes`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:d.enabled,cliToolId:b,instanceId:e,duration:d.duration,stopPattern:d.stopPattern,...d.enabled?{answerMode:d.answerMode??jw.Rb}:{}})});if(c.ok){let a=await c.json();++aK.current,V(b=>{let c=new Map(b),d=!0===a.enabled&&a.contractPolicy?.mode==="off",f=!0===a.enabled&&(0,jw.wn)(a.answerMode)?a.answerMode:void 0;return c.set(e,{enabled:a.enabled,expiresAt:a.expiresAt,...d?{blockedByContract:!0}:{},...f?{answerMode:f}:{}}),c}),e===aH.current&&(ag.current=a.enabled),bq()}}catch(a){console.error("[WorktreeDetailRefactored] Error toggling auto-yes:",a)}},[a,bq]),bZ=(0,e.useCallback)(a=>bY(aA,aE)(a),[bY,aA,aE]),[b$,b_]=(0,e.useState)(null),[b0,b1]=(0,e.useState)(!1),b2=(0,e.useRef)(!1),b4=(0,e.useCallback)(a=>{b_(a)},[]),b5=(0,e.useCallback)(()=>{let a=aH.current,b=aD.current,c=(0,al.O6)(as.current,a,b);b_({cliToolId:b,instanceId:a,label:c})},[]),b6=(0,e.useCallback)(async()=>{if(!b$||b2.current)return;b2.current=!0,b1(!0);let b=()=>{b$.instanceId===aH.current&&(k.clearMessages(),k.clearPrompt())};try{await bP.y.killSession(a,b$.cliToolId,b$.instanceId),b(),await bm(),b_(null)}catch(a){a instanceof bP.hD&&404===a.status?(b(),await bm(),b_(null)):bF(l("session.failedToKill"),"error")}finally{b2.current=!1,b1(!1)}},[b$,a,k,bm,bF,l]),b8=(0,e.useCallback)(()=>{b2.current||b_(null)},[]),b9=(0,e.useCallback)(a=>{aV(a),aT(!0)},[]),ca=(0,e.useCallback)(async b=>{aT(!1);let c=aU?`${aU}/${b}`:b;try{if(!(await fetch(`/api/worktrees/${a}/files/${(0,bp.o)(c)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"file",content:""})})).ok)throw Error("Failed to create file");aR(a=>a+1)}catch{window.alert(m("fileOps.failedToCreateFile"))}},[a,aU,m]),cb=(0,e.useCallback)(()=>{aT(!1)},[]),cc=(0,e.useCallback)(async b=>{let c=window.prompt("Enter directory name:");if(!c)return;let d=b?`${b}/${c}`:c;try{if(!(await fetch(`/api/worktrees/${a}/files/${(0,bp.o)(d)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"directory"})})).ok)throw Error("Failed to create directory");aR(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to create directory:",a),window.alert(m("fileOps.failedToCreateDirectory"))}},[a,m]),cd=(0,e.useCallback)(async b=>{let c=b.split("/").pop()||"",d=window.prompt("Enter new name:",c);if(d&&d!==c)try{if(!(await fetch(`/api/worktrees/${a}/files/${(0,bp.o)(b)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",newName:d})})).ok)throw Error("Failed to rename");let c=b.includes("/")?b.substring(0,b.lastIndexOf("/")+1):"";P.onFileRenamed(b,`${c}${d}`),aR(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to rename:",a),window.alert(m("fileOps.failedToRename"))}},[a,P,m]),ce=(0,e.useCallback)(async b=>{let c=b.split("/").pop()||b;if(await o({description:n("confirmDelete",{name:c}),variant:"danger"}))try{if(!(await fetch(`/api/worktrees/${a}/files/${(0,bp.o)(b)}?recursive=true`,{method:"DELETE"})).ok)throw Error("Failed to delete");P.onFileDeleted(b),aR(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to delete:",a),window.alert(m("fileOps.failedToDelete"))}},[a,P,n,m,o]),{moveTarget:cf,isMoveDialogOpen:cg,handleMove:ch,handleMoveConfirm:ci,handleMoveCancel:cj}=function(a,b,c,d){let[f,g]=(0,e.useState)(null),[h,i]=(0,e.useState)(!1),j=(0,e.useCallback)((a,b)=>{g({path:a,type:b}),i(!0)},[]),k=(0,e.useCallback)(async e=>{if(f)try{let g=await fetch(`/api/worktrees/${a}/files/${f.path}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"move",destination:e})}),h=await g.json();if(!g.ok||!h.success){let a=h.error?.message||"Failed to move";d?.(a);return}c?.("Moved successfully"),b()}catch{d?.("Failed to move")}finally{g(null),i(!1)}},[f,a,b,c,d]);return{moveTarget:f,isMoveDialogOpen:h,handleMove:j,handleMoveConfirm:k,handleMoveCancel:(0,e.useCallback)(()=>{g(null),i(!1)},[])}}(a,()=>aR(a=>a+1),a=>bF(a,"success"),a=>bF(a,"error")),ck=(0,e.useRef)(null),cl=(0,e.useRef)(""),cm=(0,e.useCallback)(a=>{cl.current=a,ck.current?.click()},[]),cn=(0,e.useCallback)(async b=>{let c=b.target.files?.[0];if(!c)return;b.target.value="";let d=cl.current,e=`.${c.name.split(".").pop()?.toLowerCase()}`;if(!function(a){if(!a)return!1;let b=a.toLowerCase();return bh.includes(b)}(e))return void bF(`Unsupported file type: ${e}. Allowed: ${bh.join(", ")}`,"error");let f=function(a){let b=function(a){let b=a.toLowerCase();return bg.find(a=>a.extension===b)}(a);return b?.maxFileSize??0x1400000}(e);if(c.size>f)return void bF(`File too large. Maximum size: ${(f/1024/1024).toFixed(1)}MB`,"error");let g=new FormData;g.append("file",c);try{let b=await fetch(`/api/worktrees/${a}/upload/${(0,bp.o)(d||".")}`,{method:"POST",body:g});if(!b.ok){let a=await b.json().catch(()=>({})),c=a?.error?.message||"Failed to upload file";bF(c,"error");return}let c=await b.json();bF(`Uploaded: ${c.filename}`,"success"),aR(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to upload:",a),bF("Upload failed. Please try again.","error")}},[a,bF]),{hasUpdate:co}=(0,bR.Y)(),{lastAutoResponse:cp}=(j.prompt.visible,b=j.prompt.data,{lastAutoResponse:null}),cq=(0,e.useCallback)(async()=>{z(null),B(!1),D(!1),H.current=0,I.current=0,L(),v(!0),await bm()&&await Promise.all([bn(),bo()]),v(!1)},[bm,bn,bo,L]),cr=(0,e.useCallback)(()=>{window.location.href="/login"},[]);!function({error:a,handleRetry:b,fetchWorktree:c,fetchMessages:d,fetchCurrentOutput:f,setError:g}){let h=(0,e.useRef)(0);(0,e.useCallback)(async()=>{if("visible"!==document.visibilityState)return;let e=Date.now();if(!(e-h.current<5e3)){if(h.current=e,a)return void b();try{await Promise.all([c(),d(),f()])}finally{g(null)}}},[a,b,c,d,f,g])}({error:y,handleRetry:cq,fetchWorktree:bm,fetchMessages:bn,fetchCurrentOutput:bo,setError:z}),s?.sessionStatusByCli?.[aA]?.isRunning;let cs=(0,e.useMemo)(()=>(function(a,b,c="claude"){if(b)return"error";if(!a)return"idle";let d=a.sessionStatusByCli?.[c];if(d){if(d.isWaitingForResponse)return"waiting";if(d.isProcessing)return"running";if(d.isRunning)return"ready"}if("claude"===c){if(a.isWaitingForResponse)return"waiting";if(a.isProcessing)return"running";if(a.isSessionRunning)return"ready"}return"idle"})(s,null!==j.error.type,aA),[s,j.error.type,aA]),ct=(0,e.useMemo)(()=>j.layout.mobileActivePane,[j.layout.mobileActivePane]),cu=s?.name??"Unknown",cw=(0,e.useCallback)((a,b)=>{P.dispatch({type:"SET_CONTENT",path:a,content:b})},[P]),cx=(0,e.useCallback)((a,b)=>{P.dispatch({type:"SET_ERROR",path:a,error:b})},[P]),cy=(0,e.useCallback)((a,b)=>{P.dispatch({type:"SET_LOADING",path:a,loading:b})},[P]),cz=(0,e.useCallback)((a,b)=>{P.dispatch({type:"SET_DIRTY",path:a,isDirty:b})},[P]),cA=function({worktreeId:a,refreshToken:b=0,enabled:c=!0,limit:d=10}){let[f,g]=(0,e.useState)(null),[h,i]=(0,e.useState)([]),[j,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!0),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(null),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(null),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(null),[R,S]=(0,e.useState)(d),[T,U]=(0,e.useState)(d),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)([]),[Z,$]=(0,e.useState)(!1),[_,aa]=(0,e.useState)(null),[ab,ac]=(0,e.useState)(0);(0,e.useRef)(0);let ad=(0,e.useRef)(0);(0,e.useRef)(!1);let ae=(0,e.useRef)(!1),af=(0,e.useRef)(!1),ag=(0,e.useRef)(!1),ah=(0,e.useRef)(!1);(0,e.useRef)(!1);let ai=(0,e.useRef)(null);ai.current=P,(0,e.useRef)(d).current=R,ae.current=f?.status==="verifying"||h.some(a=>"running"===a.status);let aj=j??h[0]?.id??null;(0,e.useMemo)(()=>{if(null===aj)return null;let a=h.find(a=>a.id===aj);return a?.status==="running"?`${aj}:running:${b}:${ab}`:`${aj}:${a?.status??"unlisted"}:${a?.finishedAt??""}`},[aj,h,b,ab]);let ak=(0,e.useMemo)(()=>z?.plannedGateIds??[],[z]),al=(0,e.useMemo)(()=>(l?.gates??[]).filter(a=>gb.includes(a.status)).map(a=>a.gateId),[l]),am=(0,e.useMemo)(()=>h.find(a=>"running"===a.status)??null,[h]),an=(0,e.useCallback)(a=>{Q(null===a||js(a,ak)?null:a)},[ak]),ao=(0,e.useCallback)(a=>{Q(b=>{let c=new Set(b??ak);c.has(a)?c.delete(a):c.add(a);let d=ak.filter(a=>c.has(a));return js(d,ak)?null:d})},[ak]),ap=(0,e.useCallback)(()=>{let a=ak.filter(a=>al.includes(a));Q(0===a.length||js(a,ak)?null:a)},[ak,al]),aq=(0,e.useCallback)(()=>{ad.current=0,S(a=>Math.min(a+10,100))},[]),ar=(0,e.useCallback)(()=>{W(a=>!a)},[]),as=(0,e.useCallback)(()=>{ad.current=0,ac(a=>a+1)},[]),at=(0,e.useCallback)(a=>{k(a)},[]),au=(0,e.useCallback)(async b=>{if(!af.current){af.current=!0,w(!0),y(null),M(null);try{let c=void 0===b?ai.current:b,d=await gh(a,null!==c&&c.length>0?{gateIds:c}:{});k(d),ad.current=0,ac(a=>a+1)}catch(b){let a=b instanceof ge&&409===b.status;y({kind:a?"conflict":"error",message:jt(b,"Failed to start verification"),runningRunId:b instanceof ge?b.runningRunId:null}),a&&(ad.current=0,ac(a=>a+1))}finally{af.current=!1,w(!1)}}},[a]),av=(0,e.useCallback)(async()=>{if(!ah.current&&null!==am){ah.current=!0,K(!0),M(null);try{let b=await gj(a,am.id);O("running"===b.status?am.id:null)}catch(a){M({kind:409===(a instanceof ge?a.status:0)?"gone":"error",message:jt(a,"Failed to cancel the verification run")})}finally{ah.current=!1,K(!1),ad.current=0,ac(a=>a+1)}}},[a,am]),aw=(0,e.useCallback)(async()=>{if(!ag.current){ag.current=!0,E(!0),G(null);try{let b=await gi(a);I(b),ad.current=0,ac(a=>a+1)}catch(b){let a=b instanceof ge?b.status:0;G({kind:409===a?"conflict":422===a?"empty":"error",message:jt(b,"Failed to draft the verification config")}),409===a&&(ad.current=0,ac(a=>a+1))}finally{ag.current=!1,E(!1)}}},[a]);return{worktreeId:a,task:f,runs:h,latestRun:h[0]??null,selectedRunId:aj,selectedRun:l,loading:n,error:p,detailError:r,detailLoading:t,rerunPending:v,rerunFailure:x,config:z,configError:B,phase:h.some(a=>"running"===a.status)?"running":null===z?"unknown":z.exists?0===h.length?"configured":"result":"no-config",draftPending:D,draftFailure:F,draftResult:H,availableGateIds:ak,selectedGateIds:P,failedGateIds:al,toggleGate:ao,setGateSelection:an,selectFailedGates:ap,runningRun:am,cancelPending:J,cancelSettling:null!==N&&am?.id===N,cancelFailure:L,historyLimit:R,canLoadMore:h.length>=T&&T<100,repositoryHistoryOpen:V,repositoryHistory:X,repositoryHistoryLoading:Z,repositoryHistoryError:_,selectRun:at,refresh:as,rerun:au,cancelRun:av,loadMore:aq,toggleRepositoryHistory:ar,draftConfig:aw}}({worktreeId:a,refreshToken:E,enabled:!u&&!y});return{activeActivity:aW,activeCliTab:aA,activeInstanceId:aE,activeTab:ct,agentInstances:aq,autoYesEnabled:aL,autoYesExpiresAt:aM,autoYesBlockedByContract:aN,autoYesReleasedByRestart:aO,autoYesAnswerMode:aP,autoYesStateMap:U,diffContent:bf,diffFilePath:bi,disableAutoFollow:bA,displayedInstances:bv,error:y,fetchCurrentOutput:bo,fileInputRef:ck,fileSearch:bl,fileTreeRefresh:aQ,handleActivityOpen:bQ,handleActivityToggle:bN,handleAgentInstancesChange:bB,handleAutoYesToggle:bZ,handleCloseDiff:bk,handleDelete:ce,handleDiffSelect:bj,handleDirtyChange:cz,handleEditorSave:bL,handleFileInputChange:cn,handleFilePanelSave:bL,handleFilePathClick:bH,handleFileSelect:bI,handleHistoryDisplayLimitChange:a5,handleHistoryUserOnlyChange:a2,handleInfoClick:bS,handleInfoModalClose:bT,handleInsertConsumed:bd,handleInsertConsumedSingle:be,handleInsertToMessage:bb,handleInsertToSplit:bc,handleKillCancel:b8,handleKillConfirm:b6,openKillConfirm:b4,openActiveKillConfirm:b5,killTarget:b$,isKillPending:b0,handleLoadContent:cw,handleLoadError:cx,handleMessageSent:bX,handleMobileFileViewerClose:bK,handleMobileTabChange:bW,handleMove:ch,resetFileTreeView:bM,handleMoveCancel:cj,handleMoveConfirm:ci,handleNewDirectory:cc,handleNewFile:b9,handleNewFileCancel:cb,handleNewFileConfirm:ca,handleOpenFile:bJ,handlePromptDismiss:bV,handlePromptRespond:bU,handleRename:cd,handleReLogin:cr,handleRetry:cq,handleSetLoading:cy,handleShowArchivedChange:a0,handleUpload:cm,handleVibeLocalContextWindowChange:bD,rosterReady:av,instanceSelectionRequest:bx,acknowledgeInstanceSelection:bz,handleVibeLocalModelChange:bC,hasUpdate:co,historyDisplayLimit:a3,historySubTab:aZ,historyUserOnly:a1,isAuthExpired:C,isInfoModalOpen:M,isMobile:c,isMoveDialogOpen:cg,isReconnecting:A,isSelectionListActive:ae.isSelectionListActive,isPagerActive:ae.isPagerActive,promptAnswerable:$,promptAutoYesEnterSent:aa,promptAutoYesDecision:ac,offersPlanApprove:ae.offersPlanApprove,isTrustConfirmationActive:ae.isTrustConfirmationActive,isDismissablePanelActive:ae.isDismissablePanelActive,isUnclassifiedActive:ae.isUnclassifiedActive,sessionStatus:ae.sessionStatus,agentMode:ae.agentMode,startingSince:ae.startingSince,lastAutoResponse:cp,loading:u,makeAutoYesToggleHandler:bY,mobileFileViewerPath:Q,mobileSelectedAgents:bw,moveTarget:cf,newFileParentPath:aU,openMobileDrawer:f,pendingInsertText:a9,pendingInsertTextMap:a8,selectedAgents:aj,selectionListReading:S,setActiveInstanceId:aG,setFocusedSplitIndex:ba,setHistorySubTab:a$,setWorktree:t,showArchived:a_,showNewFileDialog:aS,showToast:bF,state:j,tCommon:n,tWorktree:l,tabsActions:P,tabsState:O,toggleInstanceVisible:bt,vibeLocalContextWindow:ay,verification:cA,vibeLocalModel:aw,visibleInstanceIds:bs,worktree:s,worktreeName:cu,worktreeStatus:cs}}({worktreeId:a});(0,jp.uH)();let bK=(0,h.c)("auth"),[bL,bM]=(0,e.useState)(!1),[bN,bQ]=(0,e.useState)(null),[bS,bT]=(0,e.useState)(am.wf),bU="terminal"===j&&"chat"===bS,bV=(0,e.useCallback)(a=>{"memo"!==a&&bQ(null),as(a)},[as]),bW=(0,e.useCallback)(()=>{bQ(a=>({tab:"verification",token:(a?.token??0)+1})),as("memo")},[as]),bX=function({worktreeId:a,active:b}){let{addListener:c}=(0,db.xM)(),[d,f]=(0,e.useState)(!1);return(0,e.useRef)(b).current=b,!b&&d}({worktreeId:a,active:"terminal"===j}),{viewportHeight:bY}=function(){let[a,b]=(0,e.useState)(!1),[c,d]=(0,e.useState)(0),[f,g]=(0,e.useState)(null);return(0,e.useCallback)(()=>{},[]),{isKeyboardVisible:a,keyboardHeight:c,viewportHeight:f}}(),bZ=(0,e.useCallback)(a=>{let b=jI.indexOf(j);if(-1===b)return;let c=b+a;c<0||c>=jI.length||bV(jI[c])},[j,bV]),{ref:b$}=K({axis:"horizontal",threshold:60,edgeStartZone:32*("terminal"===j),onSwipeLeft:()=>bZ(1),onSwipeRight:()=>bZ(-1)}),b1=(0,e.useMemo)(()=>({worktreePath:bH?.path,openFile:W}),[bH?.path,W]),b2=(bH?.sessionStatusByInstance?.[f]??bH?.sessionStatusByCli?.[c])?.isRunning??!1,b4="number"==typeof a7||"number"==typeof bH?.sessionStatusByInstance?.[f]?.startingSince,[b5,b6]=(0,e.useState)(!1),b8="terminal"!==j?"tab":"chat"===bS?"chat":b2?null:"session",b9=b5&&null===b8;(0,e.useEffect)(()=>{b6(!1)},[a,c,f]),(0,e.useEffect)(()=>{b2||b6(!1)},[b2]),(0,e.useEffect)(()=>{("terminal"!==j||"chat"===bS)&&b6(!1)},[j,bS]);let ca=(0,e.useCallback)(()=>b6(!0),[]),cb=(0,e.useCallback)(()=>b6(!1),[]),cc=aS&&!b9&&!b4&&(!n||R(bv.prompt.data,aX,aZ)),{showStuckHint:cd,markSubmitted:ce}=(0,i1.Cb)({promptData:cc&&bv.prompt.visible?bv.prompt.data:null,targetKey:`${a}:${c}:${f}`}),cf=(0,L.KX)(bv.prompt.visible?bv.prompt.data:null),cg=(0,e.useMemo)(()=>U(bv.prompt.data,c),[bv.prompt.data,c]),ch=(0,e.useCallback)(async b=>{let d;if(ce(),!cf)return void await aC(b);try{let e=await fetch(`/api/worktrees/${a}/respond`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i9(cf,b,c,f))});d=await (0,ja.a_)(e)}catch(a){console.error("[WorktreeDetailRefactored] Error answering a decision:",a),d="failed"}if("answered"===d)aB();else{let a=ja.J4[d];bu(bx(a.messageKey),a.type)}await A()},[ce,aC,cf,a,c,f,bu,bx,A,aB]),[ci,cj]=(0,e.useState)(0),ck=(0,e.useCallback)(()=>{(0,di.CO)(),(0,di.If)((0,di.NP)(a),"terminal"),as("terminal"),bT("terminal"),cj(a=>a+1),b6(!0)},[a,as]);if(a9)return(0,d.jsx)(cG,{});if(aQ)return(0,d.jsx)(jG,{message:bx("editor.sessionExpired"),loginLabel:bK("login.submitButton"),onLogin:aE});if(z)return(0,d.jsx)(cH,{message:z,onRetry:aF});let cl=(0,al.O6)(k,f,c),cm=aj?.label??cl,cn=(bH?.sessionStatusByInstance?.[f]??bH?.sessionStatusByCli?.[c])?.isProcessing??!1;return aS?(0,d.jsx)(G.t,{componentName:"WorktreeDetailRefactored",children:(0,d.jsx)(c7,{onInsertToComposer:ad,children:(0,d.jsxs)(c9.k,{value:b1,children:[aU&&(0,d.jsx)(jF,{label:bw("connection.reconnecting")}),(0,d.jsxs)("div",{className:"flex flex-col overflow-hidden",style:{height:null!=bY?`${bY}px`:"100%"},"data-testid":"mobile-worktree-shell",children:[(0,d.jsx)("div",{className:"flex-shrink-0",children:(0,d.jsx)(v,{worktreeName:bI,repositoryName:bH?.repositoryName,status:bJ,statusUnclassified:cw(bJ,bH?.sessionStatusByCli,c),gitStatus:bH?.gitStatus,onMenuClick:bf})}),bC.task&&!b9&&(0,d.jsx)("div",{className:"flex-shrink-0 border-b border-border bg-surface px-3 py-1.5",children:(0,d.jsx)(jg,{task:bC.task,latestRun:bC.latestRun,latestRunGates:null!==bC.selectedRun&&bC.selectedRun.id===bC.latestRun?.id?bC.selectedRun.gates:null,onOpen:bW,className:"w-full justify-start"})}),bH?.gitStatus&&bH.gitStatus.isBranchMismatch&&!b9&&(0,d.jsx)("div",{className:"z-35 flex-shrink-0",children:(0,d.jsx)(jh,{isBranchMismatch:bH.gitStatus.isBranchMismatch,currentBranch:bH.gitStatus.currentBranch,initialBranch:bH.gitStatus.initialBranch})}),(0,d.jsxs)("div",{className:"flex-shrink-0 z-30 flex items-center gap-2 px-3 py-1.5 bg-surface-2 border-b border-border",children:[(0,d.jsx)("nav",{className:"flex gap-1 flex-1 min-w-0 overflow-x-auto scrollbar-hide","aria-label":bx("detail.agentInstanceSelection"),children:y.map(a=>{let b=bH?.sessionStatusByInstance?.[a.id]??bH?.sessionStatusByCli?.[a.cliTool],c=(0,b0.kA)(b),e=(0,m.Mq)(c,(0,b0.px)(b)),g=bw(e?m.rH:`status.${c}`),h=f===a.id;return(0,d.jsxs)("button",{onClick:()=>bn(a.id),className:`flex-shrink-0 whitespace-nowrap min-h-[44px] px-1.5 py-1 font-medium text-xs transition-colors flex items-center gap-1 border-b-2 touch-manipulation ${h?"text-accent-600 dark:text-accent-400 border-accent-500":"text-muted-foreground hover:text-foreground border-transparent"}`,"aria-current":h?"page":void 0,children:[(0,d.jsx)(l.m,{status:c,size:"sm",label:bx("detail.statusPill",{label:(0,al.sw)(a),status:g}),className:e?m.Jd:void 0,"data-unclassified":e?"true":void 0}),(0,al.sw)(a)]},a.id)})}),(0,d.jsx)("button",{type:"button",onClick:()=>bM(!0),className:"flex-shrink-0 flex items-center justify-center min-h-[44px] min-w-[44px] rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors touch-manipulation","aria-label":bx("terminal.moreActions"),"data-testid":"mobile-more-actions-button",children:(0,d.jsx)(i.A,{size:18,"aria-hidden":"true"})})]}),(0,d.jsx)("main",{className:"flex-1 min-h-0 overflow-y-auto",ref:b$,children:(0,d.jsx)(hD,{activeTab:j,worktreeId:a,worktree:bH,messages:bv.messages,cliToolId:c,instanceId:f,onFilePathClick:W,onFileSelect:X,onWorktreeUpdate:br,onNewFile:ax,onNewDirectory:aw,onRename:aD,onDelete:O,onUpload:aJ,onMove:at,onFileTreeReset:bA,refreshTrigger:D,fileSearch:C,showToast:bu,selectedAgents:bc,onSelectedAgentsChange:jH,useInstanceManagement:!0,instances:k,onInstancesChange:J,visibleInstanceIds:bG,onToggleInstanceVisible:bB,vibeLocalModel:bE,onVibeLocalModelChange:aL,vibeLocalContextWindow:bD,onVibeLocalContextWindowChange:aK,disableAutoFollow:x,historySubTab:aO,onHistorySubTabChange:bq,onDiffSelect:P,onInsertToMessage:ad,showArchived:bs,onShowArchivedChange:aI,historyDisplayLimit:aN,onHistoryDisplayLimitChange:Y,historyUserOnly:aP,onHistoryUserOnlyChange:Z,verification:bC,toolsSubTabRequest:bN,onSurfaceModeChange:bT,directInputOpen:b9},ci)}),(0,d.jsxs)("div",{className:"flex-shrink-0 border-t border-border bg-surface z-30",children:[b9?(0,d.jsx)(a_,{worktreeId:a,cliToolId:c,instanceId:f,onKeysSent:A,onClose:cb},`${a}:${c}:${f}`):null,aV&&!bU&&!b9&&!b4&&(0,d.jsx)("div",{className:"px-2 pt-1 border-b border-border",children:(0,d.jsx)(a1.Z,{worktreeId:a,cliToolId:c,instanceId:f,onKeysSent:A,reading:a$,trustConfirmation:a0,surface:"terminal",showPagerKeys:aW})}),(0,d.jsx)("div",{className:b9?"p-2 hidden":"p-2","aria-hidden":!!b9||void 0,"data-testid":"mobile-composer-wrapper",children:(0,d.jsx)(jJ,{worktreeId:a,onMessageSent:aq,cliToolId:c,instanceId:f,isSessionRunning:b2,isSessionStarting:b4,isProcessing:cn,showToast:bu,pendingInsertText:bi,onInsertConsumed:ac,agentModeSlot:(0,d.jsx)(iO,{worktreeId:a,cliToolId:c,instanceId:f,agentMode:a6,sessionStatus:a5,isPromptWaiting:bv.prompt.visible,isSelectionListActive:aV,isDismissablePanelActive:a2,isUnclassifiedActive:a3,onKeysSent:A}),autoYesSlot:(0,d.jsx)(i5.T,{enabled:n,expiresAt:o,onToggle:M,lastAutoResponse:a8,cliToolName:c,inline:!0,showToolName:!1,blockedByContract:q,releasedByRestart:r,answerMode:s})})})]}),(0,d.jsx)(E,{activeTab:j,onTabChange:bV,hasNewOutput:bX,hasPrompt:bv.prompt.visible,hasUpdate:aM,inFlow:!0}),cc&&(0,d.jsx)($,{promptData:cg,visible:bv.prompt.visible,answering:bv.prompt.answering,onRespond:ch,onDismiss:aB,cliToolName:(0,al.oo)(c),showStuckHint:cd,onSwitchToDirectInput:b2?ck:void 0,answerable:aX,autoYesEnterSent:aY}),(0,d.jsx)(aG,{open:bL,onClose:()=>bM(!1),searchTarget:bU?"chat":"terminal",onSearch:()=>window.dispatchEvent(new CustomEvent(bU?"chat-search-open":"terminal-search-open")),onEnd:ai,endDisabled:!b2,onDirectInput:ca,directInputUnavailableReason:b8}),(0,d.jsx)(bF,{isOpen:null!==bb,onClose:ar,worktreeId:a,filePath:bb??"",onFileSaved:S,onOpenFile:W}),(0,d.jsx)("input",{ref:B,type:"file",accept:bh.join(","),onChange:T,className:"hidden","aria-label":bx("detail.uploadFile")}),(0,d.jsx)(b_.a,{isOpen:null!==aj,onClose:af,title:bx("session.confirmEnd",{tool:cm}),size:"sm",showCloseButton:!0,children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("p",{className:"text-sm text-foreground",children:bx("session.endWarning")}),(0,d.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,d.jsx)("button",{type:"button",onClick:af,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:bw("cancel")}),(0,d.jsx)("button",{type:"button",onClick:ag,disabled:ak,className:"px-4 py-2 text-sm font-medium rounded-md bg-danger hover:bg-danger/90 text-white disabled:opacity-60 disabled:cursor-not-allowed",children:bw("end")})]})]})}),bd&&(0,d.jsx)(jk,{isOpen:aT,onClose:au,onConfirm:av,worktreeId:a,sourcePath:bd.path,sourceType:bd.type}),(0,d.jsx)(jm,{isOpen:bt,parentPath:be,onConfirm:az,onCancel:ay})]})]})})}):(0,d.jsxs)(c9.k,{value:b1,children:[aU&&(0,d.jsx)(jF,{label:bw("connection.reconnecting")}),(0,d.jsx)(jo,{worktreeId:a,worktree:bH,worktreeName:bI,worktreeStatus:bJ,instances:k,rosterReady:bk,activeInstanceId:f,setActiveInstanceId:bn,instanceSelectionRequest:bl,onInstanceSelectionHandled:bm,hasUpdate:aM,lastAutoResponse:a8,activeActivity:b,onActivityToggle:I,onActivityOpen:H,verification:bC,onInfoClick:_,pendingInsertTextMap:bj,setFocusedSplitIndex:bo,handleInsertToSplit:ae,handleInsertConsumed:ab,handleInsertToMessage:ad,autoYesStateMap:t,makeAutoYesToggleHandler:ba,showArchived:bs,onShowArchivedChange:aI,historyDisplayLimit:aN,onHistoryDisplayLimitChange:Y,historyUserOnly:aP,onHistoryUserOnlyChange:Z,onMessageSent:aq,onFilePathClick:W,showToast:bu,tabsState:bz,tabsActions:by,onLoadContent:an,onLoadError:ap,onSetLoading:aH,onFilePanelSave:V,onDirtyChange:Q,onOpenFile:aA,diffContent:u,diffFilePath:w,onCloseDiff:N,fileSearch:C,fileTreeRefresh:D,onFileSelect:X,onNewFile:ax,onNewDirectory:aw,onRename:aD,onDelete:O,onUpload:aJ,onMove:at,onFileTreeReset:bA,onDiffSelect:P,onAgentInstancesChange:J,vibeLocalModel:bE,onVibeLocalModelChange:aL,vibeLocalContextWindow:bD,onVibeLocalContextWindowChange:aK,isInfoModalOpen:aR,onInfoModalClose:aa,onWorktreeUpdate:br,fileInputRef:B,onFileInputChange:T,onKillSession:ai,onRequestSessionEnd:ah,killTarget:aj,isKillPending:ak,onKillCancel:af,onKillConfirm:ag,moveTarget:bd,isMoveDialogOpen:aT,onMoveCancel:au,onMoveConfirm:av,showNewFileDialog:bt,newFileParentPath:be,onNewFileConfirm:az,onNewFileCancel:ay,killDialogTitle:bx("session.confirmEnd",{tool:cm}),killDialogWarning:bx("session.endWarning"),cancelLabel:bw("cancel"),endLabel:bw("end")})]})});function jL(){let a=(0,g.useParams)().id;return(0,d.jsx)(jK,{worktreeId:a})}c(45848)},75662:a=>{a.exports=function(a){return{name:"Dust",aliases:["dst"],case_insensitive:!0,subLanguage:"xml",contains:[{className:"template-tag",begin:/\{[#\/]/,end:/\}/,illegal:/;/,contains:[{className:"name",begin:/[a-zA-Z\.-]+/,starts:{endsWithParent:!0,relevance:0,contains:[a.QUOTE_STRING_MODE]}}]},{className:"template-variable",begin:/\{/,end:/\}/,illegal:/;/,keywords:"if eq ne lt lte gt gte select default math sep"}]}}},75796:(a,b,c)=>{Promise.resolve().then(c.bind(c,75099))},76760:a=>{"use strict";a.exports=require("node:path")},77227:a=>{var b="[0-9](_*[0-9])*",c=`\\.(${b})`,d="[0-9a-fA-F](_*[0-9a-fA-F])*",e={className:"number",variants:[{begin:`(\\b(${b})((${c})|\\.)?|(${c}))[eE][+-]?(${b})[fFdD]?\\b`},{begin:`\\b(${b})((${c})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${c})[fFdD]?\\b`},{begin:`\\b(${b})[fFdD]\\b`},{begin:`\\b0[xX]((${d})\\.?|(${d})?\\.(${d}))[pP][+-]?(${b})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${d})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};a.exports=function(a){let b={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},c={className:"symbol",begin:a.UNDERSCORE_IDENT_RE+"@"},d={className:"subst",begin:/\$\{/,end:/\}/,contains:[a.C_NUMBER_MODE]},f={className:"variable",begin:"\\$"+a.UNDERSCORE_IDENT_RE},g={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[f,d]},{begin:"'",end:"'",illegal:/\n/,contains:[a.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[a.BACKSLASH_ESCAPE,f,d]}]};d.contains.push(g);let h={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+a.UNDERSCORE_IDENT_RE+")?"},i={className:"meta",begin:"@"+a.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[a.inherit(g,{className:"string"}),"self"]}]},j=a.COMMENT("/\\*","\\*/",{contains:[a.C_BLOCK_COMMENT_MODE]}),k={variants:[{className:"type",begin:a.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]};return k.variants[1].contains=[k],k.variants[1].contains=[k],{name:"Kotlin",aliases:["kt","kts"],keywords:b,contains:[a.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),a.C_LINE_COMMENT_MODE,j,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},c,h,i,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:b,relevance:5,contains:[{begin:a.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[a.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:b,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[k,a.C_LINE_COMMENT_MODE,j],relevance:0},a.C_LINE_COMMENT_MODE,j,h,i,g,a.C_NUMBER_MODE]},j]},{begin:[/class|interface|trait/,/\s+/,a.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},a.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},h,i]},g,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},e]}}},77525:a=>{a.exports=function(a){let b={keyword:"bool break call callexe checkinterrupt clear clearg closeall cls comlog compile continue create debug declare delete disable dlibrary dllcall do dos ed edit else elseif enable end endfor endif endp endo errorlog errorlogat expr external fn for format goto gosub graph if keyword let lib library line load loadarray loadexe loadf loadk loadm loadp loads loadx local locate loopnextindex lprint lpwidth lshow matrix msym ndpclex new open output outwidth plot plotsym pop prcsn print printdos proc push retp return rndcon rndmod rndmult rndseed run save saveall screen scroll setarray show sparse stop string struct system trace trap threadfor threadendfor threadbegin threadjoin threadstat threadend until use while winprint ne ge le gt lt and xor or not eq eqv",built_in:"abs acf aconcat aeye amax amean AmericanBinomCall AmericanBinomCall_Greeks AmericanBinomCall_ImpVol AmericanBinomPut AmericanBinomPut_Greeks AmericanBinomPut_ImpVol AmericanBSCall AmericanBSCall_Greeks AmericanBSCall_ImpVol AmericanBSPut AmericanBSPut_Greeks AmericanBSPut_ImpVol amin amult annotationGetDefaults annotationSetBkd annotationSetFont annotationSetLineColor annotationSetLineStyle annotationSetLineThickness annualTradingDays arccos arcsin areshape arrayalloc arrayindex arrayinit arraytomat asciiload asclabel astd astds asum atan atan2 atranspose axmargin balance band bandchol bandcholsol bandltsol bandrv bandsolpd bar base10 begwind besselj bessely beta box boxcox cdfBeta cdfBetaInv cdfBinomial cdfBinomialInv cdfBvn cdfBvn2 cdfBvn2e cdfCauchy cdfCauchyInv cdfChic cdfChii cdfChinc cdfChincInv cdfExp cdfExpInv cdfFc cdfFnc cdfFncInv cdfGam cdfGenPareto cdfHyperGeo cdfLaplace cdfLaplaceInv cdfLogistic cdfLogisticInv cdfmControlCreate cdfMvn cdfMvn2e cdfMvnce cdfMvne cdfMvt2e cdfMvtce cdfMvte cdfN cdfN2 cdfNc cdfNegBinomial cdfNegBinomialInv cdfNi cdfPoisson cdfPoissonInv cdfRayleigh cdfRayleighInv cdfTc cdfTci cdfTnc cdfTvn cdfWeibull cdfWeibullInv cdir ceil ChangeDir chdir chiBarSquare chol choldn cholsol cholup chrs close code cols colsf combinate combinated complex con cond conj cons ConScore contour conv convertsatostr convertstrtosa corrm corrms corrvc corrx corrxs cos cosh counts countwts crossprd crout croutp csrcol csrlin csvReadM csvReadSA cumprodc cumsumc curve cvtos datacreate datacreatecomplex datalist dataload dataloop dataopen datasave date datestr datestring datestrymd dayinyr dayofweek dbAddDatabase dbClose dbCommit dbCreateQuery dbExecQuery dbGetConnectOptions dbGetDatabaseName dbGetDriverName dbGetDrivers dbGetHostName dbGetLastErrorNum dbGetLastErrorText dbGetNumericalPrecPolicy dbGetPassword dbGetPort dbGetTableHeaders dbGetTables dbGetUserName dbHasFeature dbIsDriverAvailable dbIsOpen dbIsOpenError dbOpen dbQueryBindValue dbQueryClear dbQueryCols dbQueryExecPrepared dbQueryFetchAllM dbQueryFetchAllSA dbQueryFetchOneM dbQueryFetchOneSA dbQueryFinish dbQueryGetBoundValue dbQueryGetBoundValues dbQueryGetField dbQueryGetLastErrorNum dbQueryGetLastErrorText dbQueryGetLastInsertID dbQueryGetLastQuery dbQueryGetPosition dbQueryIsActive dbQueryIsForwardOnly dbQueryIsNull dbQueryIsSelect dbQueryIsValid dbQueryPrepare dbQueryRows dbQuerySeek dbQuerySeekFirst dbQuerySeekLast dbQuerySeekNext dbQuerySeekPrevious dbQuerySetForwardOnly dbRemoveDatabase dbRollback dbSetConnectOptions dbSetDatabaseName dbSetHostName dbSetNumericalPrecPolicy dbSetPort dbSetUserName dbTransaction DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl dfft dffti diag diagrv digamma doswin DOSWinCloseall DOSWinOpen dotfeq dotfeqmt dotfge dotfgemt dotfgt dotfgtmt dotfle dotflemt dotflt dotfltmt dotfne dotfnemt draw drop dsCreate dstat dstatmt dstatmtControlCreate dtdate dtday dttime dttodtv dttostr dttoutc dtvnormal dtvtodt dtvtoutc dummy dummybr dummydn eig eigh eighv eigv elapsedTradingDays endwind envget eof eqSolve eqSolvemt eqSolvemtControlCreate eqSolvemtOutCreate eqSolveset erf erfc erfccplx erfcplx error etdays ethsec etstr EuropeanBinomCall EuropeanBinomCall_Greeks EuropeanBinomCall_ImpVol EuropeanBinomPut EuropeanBinomPut_Greeks EuropeanBinomPut_ImpVol EuropeanBSCall EuropeanBSCall_Greeks EuropeanBSCall_ImpVol EuropeanBSPut EuropeanBSPut_Greeks EuropeanBSPut_ImpVol exctsmpl exec execbg exp extern eye fcheckerr fclearerr feq feqmt fflush fft ffti fftm fftmi fftn fge fgemt fgets fgetsa fgetsat fgetst fgt fgtmt fileinfo filesa fle flemt floor flt fltmt fmod fne fnemt fonts fopen formatcv formatnv fputs fputst fseek fstrerror ftell ftocv ftos ftostrC gamma gammacplx gammaii gausset gdaAppend gdaCreate gdaDStat gdaDStatMat gdaGetIndex gdaGetName gdaGetNames gdaGetOrders gdaGetType gdaGetTypes gdaGetVarInfo gdaIsCplx gdaLoad gdaPack gdaRead gdaReadByIndex gdaReadSome gdaReadSparse gdaReadStruct gdaReportVarInfo gdaSave gdaUpdate gdaUpdateAndPack gdaVars gdaWrite gdaWrite32 gdaWriteSome getarray getdims getf getGAUSShome getmatrix getmatrix4D getname getnamef getNextTradingDay getNextWeekDay getnr getorders getpath getPreviousTradingDay getPreviousWeekDay getRow getscalar3D getscalar4D getTrRow getwind glm gradcplx gradMT gradMTm gradMTT gradMTTm gradp graphprt graphset hasimag header headermt hess hessMT hessMTg hessMTgw hessMTm hessMTmw hessMTT hessMTTg hessMTTgw hessMTTm hessMTw hessp hist histf histp hsec imag indcv indexcat indices indices2 indicesf indicesfn indnv indsav integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 inthpControlCreate intquad1 intquad2 intquad3 intrleav intrleavsa intrsect intsimp inv invpd invswp iscplx iscplxf isden isinfnanmiss ismiss key keyav keyw lag lag1 lagn lapEighb lapEighi lapEighvb lapEighvi lapgEig lapgEigh lapgEighv lapgEigv lapgSchur lapgSvdcst lapgSvds lapgSvdst lapSvdcusv lapSvds lapSvdusv ldlp ldlsol linSolve listwise ln lncdfbvn lncdfbvn2 lncdfmvn lncdfn lncdfn2 lncdfnc lnfact lngammacplx lnpdfmvn lnpdfmvt lnpdfn lnpdft loadd loadstruct loadwind loess loessmt loessmtControlCreate log loglog logx logy lower lowmat lowmat1 ltrisol lu lusol machEpsilon make makevars makewind margin matalloc matinit mattoarray maxbytes maxc maxindc maxv maxvec mbesselei mbesselei0 mbesselei1 mbesseli mbesseli0 mbesseli1 meanc median mergeby mergevar minc minindc minv miss missex missrv moment momentd movingave movingaveExpwgt movingaveWgt nextindex nextn nextnevn nextwind ntos null null1 numCombinations ols olsmt olsmtControlCreate olsqr olsqr2 olsqrmt ones optn optnevn orth outtyp pacf packedToSp packr parse pause pdfCauchy pdfChi pdfExp pdfGenPareto pdfHyperGeo pdfLaplace pdfLogistic pdfn pdfPoisson pdfRayleigh pdfWeibull pi pinv pinvmt plotAddArrow plotAddBar plotAddBox plotAddHist plotAddHistF plotAddHistP plotAddPolar plotAddScatter plotAddShape plotAddTextbox plotAddTS plotAddXY plotArea plotBar plotBox plotClearLayout plotContour plotCustomLayout plotGetDefaults plotHist plotHistF plotHistP plotLayout plotLogLog plotLogX plotLogY plotOpenWindow plotPolar plotSave plotScatter plotSetAxesPen plotSetBar plotSetBarFill plotSetBarStacked plotSetBkdColor plotSetFill plotSetGrid plotSetLegend plotSetLineColor plotSetLineStyle plotSetLineSymbol plotSetLineThickness plotSetNewWindow plotSetTitle plotSetWhichYAxis plotSetXAxisShow plotSetXLabel plotSetXRange plotSetXTicInterval plotSetXTicLabel plotSetYAxisShow plotSetYLabel plotSetYRange plotSetZAxisShow plotSetZLabel plotSurface plotTS plotXY polar polychar polyeval polygamma polyint polymake polymat polymroot polymult polyroot pqgwin previousindex princomp printfm printfmt prodc psi putarray putf putvals pvCreate pvGetIndex pvGetParNames pvGetParVector pvLength pvList pvPack pvPacki pvPackm pvPackmi pvPacks pvPacksi pvPacksm pvPacksmi pvPutParVector pvTest pvUnpack QNewton QNewtonmt QNewtonmtControlCreate QNewtonmtOutCreate QNewtonSet QProg QProgmt QProgmtInCreate qqr qqre qqrep qr qre qrep qrsol qrtsol qtyr qtyre qtyrep quantile quantiled qyr qyre qyrep qz rank rankindx readr real reclassify reclassifyCuts recode recserar recsercp recserrc rerun rescale reshape rets rev rfft rffti rfftip rfftn rfftnp rfftp rndBernoulli rndBeta rndBinomial rndCauchy rndChiSquare rndCon rndCreateState rndExp rndGamma rndGeo rndGumbel rndHyperGeo rndi rndKMbeta rndKMgam rndKMi rndKMn rndKMnb rndKMp rndKMu rndKMvm rndLaplace rndLCbeta rndLCgam rndLCi rndLCn rndLCnb rndLCp rndLCu rndLCvm rndLogNorm rndMTu rndMVn rndMVt rndn rndnb rndNegBinomial rndp rndPoisson rndRayleigh rndStateSkip rndu rndvm rndWeibull rndWishart rotater round rows rowsf rref sampleData satostrC saved saveStruct savewind scale scale3d scalerr scalinfnanmiss scalmiss schtoc schur searchsourcepath seekr select selif seqa seqm setdif setdifsa setvars setvwrmode setwind shell shiftr sin singleindex sinh sleep solpd sortc sortcc sortd sorthc sorthcc sortind sortindc sortmc sortr sortrc spBiconjGradSol spChol spConjGradSol spCreate spDenseSubmat spDiagRvMat spEigv spEye spLDL spline spLU spNumNZE spOnes spreadSheetReadM spreadSheetReadSA spreadSheetWrite spScale spSubmat spToDense spTrTDense spTScalar spZeros sqpSolve sqpSolveMT sqpSolveMTControlCreate sqpSolveMTlagrangeCreate sqpSolveMToutCreate sqpSolveSet sqrt statements stdc stdsc stocv stof strcombine strindx strlen strput strrindx strsect strsplit strsplitPad strtodt strtof strtofcplx strtriml strtrimr strtrunc strtruncl strtruncpad strtruncr submat subscat substute subvec sumc sumr surface svd svd1 svd2 svdcusv svds svdusv sysstate tab tan tanh tempname time timedt timestr timeutc title tkf2eps tkf2ps tocart todaydt toeplitz token topolar trapchk trigamma trimr trunc type typecv typef union unionsa uniqindx uniqindxsa unique uniquesa upmat upmat1 upper utctodt utctodtv utrisol vals varCovMS varCovXS varget vargetl varmall varmares varput varputl vartypef vcm vcms vcx vcxs vec vech vecr vector vget view viewxyz vlist vnamecv volume vput vread vtypecv wait waitc walkindex where window writer xlabel xlsGetSheetCount xlsGetSheetSize xlsGetSheetTypes xlsMakeRange xlsReadM xlsReadSA xlsWrite xlsWriteM xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics cdfEmpirical dot h5create h5open h5read h5readAttribute h5write h5writeAttribute ldl plotAddErrorBar plotAddSurface plotCDFEmpirical plotSetColormap plotSetContourLabels plotSetLegendFont plotSetTextInterpreter plotSetXTicCount plotSetYTicCount plotSetZLevels powerm strjoin sylvester strtrim",literal:"DB_AFTER_LAST_ROW DB_ALL_TABLES DB_BATCH_OPERATIONS DB_BEFORE_FIRST_ROW DB_BLOB DB_EVENT_NOTIFICATIONS DB_FINISH_QUERY DB_HIGH_PRECISION DB_LAST_INSERT_ID DB_LOW_PRECISION_DOUBLE DB_LOW_PRECISION_INT32 DB_LOW_PRECISION_INT64 DB_LOW_PRECISION_NUMBERS DB_MULTIPLE_RESULT_SETS DB_NAMED_PLACEHOLDERS DB_POSITIONAL_PLACEHOLDERS DB_PREPARED_QUERIES DB_QUERY_SIZE DB_SIMPLE_LOCKING DB_SYSTEM_TABLES DB_TABLES DB_TRANSACTIONS DB_UNICODE DB_VIEWS __STDIN __STDOUT __STDERR __FILE_DIR"},c=a.COMMENT("@","@"),d={className:"meta",begin:"#",end:"$",keywords:{keyword:"define definecs|10 undef ifdef ifndef iflight ifdllcall ifmac ifos2win ifunix else endif lineson linesoff srcfile srcline"},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",end:"$",keywords:{keyword:"include"},contains:[{className:"string",begin:'"',end:'"',illegal:"\\n"}]},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,c]},e={begin:/\bstruct\s+/,end:/\s/,keywords:"struct",contains:[{className:"type",begin:a.UNDERSCORE_IDENT_RE,relevance:0}]},f=[{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,endsWithParent:!0,relevance:0,contains:[{className:"literal",begin:/\.\.\./},a.C_NUMBER_MODE,a.C_BLOCK_COMMENT_MODE,c,e]}],g={className:"title",begin:a.UNDERSCORE_IDENT_RE,relevance:0},h=function(b,d,e){let h=a.inherit({className:"function",beginKeywords:b,end:d,excludeEnd:!0,contains:[].concat(f)},{});return h.contains.push(g),h.contains.push(a.C_NUMBER_MODE),h.contains.push(a.C_BLOCK_COMMENT_MODE),h.contains.push(c),h},i={className:"built_in",begin:"\\b("+b.built_in.split(" ").join("|")+")\\b"},j={className:"string",begin:'"',end:'"',contains:[a.BACKSLASH_ESCAPE],relevance:0},k={begin:a.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,keywords:b,relevance:0,contains:[{beginKeywords:b.keyword},i,{className:"built_in",begin:a.UNDERSCORE_IDENT_RE,relevance:0}]},l={begin:/\(/,end:/\)/,relevance:0,keywords:{built_in:b.built_in,literal:b.literal},contains:[a.C_NUMBER_MODE,a.C_BLOCK_COMMENT_MODE,c,i,k,j,"self"]};return k.contains.push(l),{name:"GAUSS",aliases:["gss"],case_insensitive:!0,keywords:b,illegal:/(\{[%#]|[%#]\}| <- )/,contains:[a.C_NUMBER_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,c,j,d,{className:"keyword",begin:/\bexternal (matrix|string|array|sparse matrix|struct|proc|keyword|fn)/},h("proc keyword",";"),h("fn","="),{beginKeywords:"for threadfor",end:/;/,relevance:0,contains:[a.C_BLOCK_COMMENT_MODE,c,l]},{variants:[{begin:a.UNDERSCORE_IDENT_RE+"\\."+a.UNDERSCORE_IDENT_RE},{begin:a.UNDERSCORE_IDENT_RE+"\\s*="}],relevance:0},k,e]}}},77917:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(23339).A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},78267:a=>{a.exports=function(a){let b="[ \\t\\f]*",c=b+"[:=]"+b,d="[ \\t\\f]+",e="([^\\\\:= \\t\\f\\n]|\\\\.)+";return{name:".properties",disableAutodetect:!0,case_insensitive:!0,illegal:/\S/,contains:[a.COMMENT("^\\s*[!#]","$"),{returnBegin:!0,variants:[{begin:e+c},{begin:e+d}],contains:[{className:"attr",begin:e,endsParent:!0}],starts:{end:"("+c+"|"+d+")",relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\\\"},{begin:"\\\\\\n"}]}}},{className:"attr",begin:e+b+"$"}]}}},78460:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(23339).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},79001:a=>{let b="[A-Za-z$_][0-9A-Za-z$_]*",c=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],d=["true","false","null","undefined","NaN","Infinity"],e=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],f=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],g=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],h=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],i=[].concat(g,e,f);a.exports=function(a){let j=a.regex,k=function(a){var j;let k=a.regex,l=/<[A-Za-z0-9\\._:-]+/,m=/\/[A-Za-z0-9\\._:-]+>|\/>/,n={$pattern:b,keyword:c,literal:d,built_in:i,"variable.language":h},o="[0-9](_?[0-9])*",p=`\\.(${o})`,q="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",r={className:"number",variants:[{begin:`(\\b(${q})((${p})|\\.)?|(${p}))[eE][+-]?(${o})\\b`},{begin:`\\b(${q})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},s={className:"subst",begin:"\\$\\{",end:"\\}",keywords:n,contains:[]},t={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,s],subLanguage:"xml"}},u={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,s],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,s],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[a.BACKSLASH_ESCAPE,s]},x={className:"comment",variants:[a.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:b+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),a.C_BLOCK_COMMENT_MODE,a.C_LINE_COMMENT_MODE]},y=[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,t,u,v,w,{match:/\$\d+/},r];s.contains=y.concat({begin:/\{/,end:/\}/,keywords:n,contains:["self"].concat(y)});let z=[].concat(x,s.contains),A=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:n,contains:["self"].concat(z)}]),B={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:A},C={variants:[{match:[/class/,/\s+/,b,/\s+/,/extends/,/\s+/,k.concat(b,"(",k.concat(/\./,b),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,b],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:k.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...e,...f]}},E={match:k.concat(/\b/,(j=[...g,"super","import"].map(a=>`${a}\\s*\\(`),k.concat("(?!",j.join("|"),")")),b,k.lookahead(/\s*\(/)),className:"title.function",relevance:0},F={begin:k.concat(/\./,k.lookahead(k.concat(b,/(?![0-9A-Za-z$_(])/))),end:b,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+a.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,b,/\s*/,/=\s*/,/(async\s*)?/,k.lookahead(G)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[B]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:n,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[a.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,t,u,v,w,x,{match:/\$\d+/},r,D,{scope:"attr",match:b+k.lookahead(":"),relevance:0},H,{begin:"("+a.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,a.REGEXP_MODE,{className:"function",begin:G,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:a.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:l,"on:begin":(a,b)=>{let c,d=a[0].length+a.index,e=a.input[d];if("<"===e||","===e)return void b.ignoreMatch();">"!==e||((a,{after:b})=>{let c="</"+a[0].slice(1);return -1!==a.input.indexOf(c,b)})(a,{after:d})||b.ignoreMatch();let f=a.input.substring(d);if((c=f.match(/^\s*=/))||(c=f.match(/^\s+extends\s+/))&&0===c.index)return void b.ignoreMatch()},end:m}],subLanguage:"xml",contains:[{begin:l,end:m,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,b,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[B],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+a.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[B,a.inherit(a.TITLE_MODE,{begin:b,className:"title.function"})]},{match:/\.\.\./,relevance:0},F,{match:"\\$"+b,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[B]},E,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},C,{match:[/get|set/,/\s+/,b,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},B]},{match:/\$[(.]/}]}}(a),l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],m={begin:[/namespace/,/\s+/,a.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},n={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[k.exports.CLASS_REFERENCE]},o={$pattern:b,keyword:c.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:d,built_in:i.concat(l),"variable.language":h},p={className:"meta",begin:"@"+b},q=(a,b,c)=>{let d=a.contains.findIndex(a=>a.label===b);if(-1===d)throw Error("can not find mode to replace");a.contains.splice(d,1,c)};Object.assign(k.keywords,o),k.exports.PARAMS_CONTAINS.push(p);let r=k.contains.find(a=>"attr"===a.scope),s=Object.assign({},r,{match:j.concat(b,j.lookahead(/\s*\?:/))});return k.exports.PARAMS_CONTAINS.push([k.exports.CLASS_REFERENCE,r,s]),k.contains=k.contains.concat([p,m,n,s]),q(k,"shebang",a.SHEBANG()),q(k,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),k.contains.find(a=>"func.def"===a.label).relevance=0,Object.assign(k,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),k}},79322:a=>{a.exports=function(a){let b=a.regex,c="[A-Za-z_][0-9A-Za-z_]*",d={keyword:["break","case","catch","continue","debugger","do","else","export","for","function","if","import","in","new","of","return","switch","try","var","void","while"],literal:["BackSlash","DoubleQuote","ForwardSlash","Infinity","NaN","NewLine","PI","SingleQuote","Tab","TextFormatting","false","null","true","undefined"],built_in:["Abs","Acos","All","Angle","Any","Area","AreaGeodetic","Array","Asin","Atan","Atan2","Attachments","Average","Back","Bearing","Boolean","Buffer","BufferGeodetic","Ceil","Centroid","ChangeTimeZone","Clip","Concatenate","Console","Constrain","Contains","ConvertDirection","ConvexHull","Cos","Count","Crosses","Cut","Date|0","DateAdd","DateDiff","DateOnly","Day","Decode","DefaultValue","Densify","DensifyGeodetic","Dictionary","Difference","Disjoint","Distance","DistanceGeodetic","DistanceToCoordinate","Distinct","Domain","DomainCode","DomainName","EnvelopeIntersects","Equals","Erase","Exp","Expects","Extent","Feature","FeatureInFilter","FeatureSet","FeatureSetByAssociation","FeatureSetById","FeatureSetByName","FeatureSetByPortalItem","FeatureSetByRelationshipClass","FeatureSetByRelationshipName","Filter","FilterBySubtypeCode","Find","First|0","Floor","FromCharCode","FromCodePoint","FromJSON","Front","GdbVersion","Generalize","Geometry","GetEnvironment","GetFeatureSet","GetFeatureSetInfo","GetUser","GroupBy","Guid","HasKey","HasValue","Hash","Hour","IIf","ISOMonth","ISOWeek","ISOWeekday","ISOYear","Includes","IndexOf","Insert","Intersection","Intersects","IsEmpty","IsNan","IsSelfIntersecting","IsSimple","KnowledgeGraphByPortalItem","Left|0","Length","Length3D","LengthGeodetic","Log","Lower","Map","Max","Mean","MeasureToCoordinate","Mid","Millisecond","Min","Minute","Month","MultiPartToSinglePart","Multipoint","NearestCoordinate","NearestVertex","NextSequenceValue","None","Now","Number","Offset","OrderBy","Overlaps","Point","PointToCoordinate","Polygon","Polyline","Pop","Portal","Pow","Proper","Push","QueryGraph","Random","Reduce","Relate","Replace","Resize","Reverse","Right|0","RingIsClockwise","Rotate","Round","Schema","Second","SetGeometry","Simplify","Sin","Slice","Sort","Splice","Split","Sqrt","StandardizeFilename","StandardizeGuid","Stdev","SubtypeCode","SubtypeName","Subtypes","Sum","SymmetricDifference","Tan","Text","Time","TimeZone","TimeZoneOffset","Timestamp","ToCharCode","ToCodePoint","ToHex","ToLocal","ToUTC","Today","Top|0","Touches","TrackAccelerationAt","TrackAccelerationWindow","TrackCurrentAcceleration","TrackCurrentDistance","TrackCurrentSpeed","TrackCurrentTime","TrackDistanceAt","TrackDistanceWindow","TrackDuration","TrackFieldWindow","TrackGeometryWindow","TrackIndex","TrackSpeedAt","TrackSpeedWindow","TrackStartTime","TrackWindow","Trim","TypeOf","Union","Upper","UrlEncode","Variance","Week","Weekday","When|0","Within","Year|0"]},e={className:"symbol",begin:"\\$"+b.either("aggregatedFeatures","analytic","config","datapoint","datastore","editcontext","feature","featureSet","feedfeature","fencefeature","fencenotificationtype","graph","join","layer","locationupdate","map","measure","measure","originalFeature","record","reference","rowindex","sourcedatastore","sourcefeature","sourcelayer","target","targetdatastore","targetfeature","targetlayer","userInput","value","variables","view")},f={className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:a.C_NUMBER_RE}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},h={className:"string",begin:"`",end:"`",contains:[a.BACKSLASH_ESCAPE,g]};g.contains=[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,h,f,a.REGEXP_MODE];let i=g.contains.concat([a.C_BLOCK_COMMENT_MODE,a.C_LINE_COMMENT_MODE]);return{name:"ArcGIS Arcade",case_insensitive:!0,keywords:d,contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,h,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,e,f,{begin:/[{,]\s*/,relevance:0,contains:[{begin:c+"\\s*:",returnBegin:!0,relevance:0,contains:[{className:"attr",begin:c,relevance:0}]}]},{begin:"("+a.RE_STARTERS_RE+"|\\b(return)\\b)\\s*",keywords:"return",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+c+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:c},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:i}]}]}],relevance:0},{beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[a.inherit(a.TITLE_MODE,{className:"title.function",begin:c}),{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:i}],illegal:/\[|%/},{begin:/\$[(.]/}],illegal:/#(?!!)/}}},79428:a=>{"use strict";a.exports=require("buffer")},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},79996:a=>{a.exports=function(a){let b=["true","false","null"],c={scope:"literal",beginKeywords:b.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:b},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},a.QUOTE_STRING_MODE,c,a.C_NUMBER_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}},80014:a=>{a.exports=function(a){let b=a.COMMENT(/^\s*@?rem\b/,/$/,{relevance:10});return{name:"Batch file (DOS)",aliases:["bat","cmd"],case_insensitive:!0,illegal:/\/\*/,keywords:{keyword:["if","else","goto","for","in","do","call","exit","not","exist","errorlevel","defined","equ","neq","lss","leq","gtr","geq"],built_in:["prn","nul","lpt3","lpt2","lpt1","con","com4","com3","com2","com1","aux","shift","cd","dir","echo","setlocal","endlocal","set","pause","copy","append","assoc","at","attrib","break","cacls","cd","chcp","chdir","chkdsk","chkntfs","cls","cmd","color","comp","compact","convert","date","dir","diskcomp","diskcopy","doskey","erase","fs","find","findstr","format","ftype","graftabl","help","keyb","label","md","mkdir","mode","more","move","path","pause","print","popd","pushd","promt","rd","recover","rem","rename","replace","restore","rmdir","shift","sort","start","subst","time","title","tree","type","ver","verify","vol","ping","net","ipconfig","taskkill","xcopy","ren","del"]},contains:[{className:"variable",begin:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{className:"function",begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",end:"goto:eof",contains:[a.inherit(a.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),b]},{className:"number",begin:"\\b\\d+",relevance:0},b]}}},80038:a=>{a.exports=function(a){return{name:"XQuery",aliases:["xpath","xq","xqm"],case_insensitive:!1,illegal:/(proc)|(abstract)|(extends)|(until)|(#)/,keywords:{$pattern:/[a-zA-Z$][a-zA-Z0-9_:-]*/,keyword:["module","schema","namespace","boundary-space","preserve","no-preserve","strip","default","collation","base-uri","ordering","context","decimal-format","decimal-separator","copy-namespaces","empty-sequence","except","exponent-separator","external","grouping-separator","inherit","no-inherit","lax","minus-sign","per-mille","percent","schema-attribute","schema-element","strict","unordered","zero-digit","declare","import","option","function","validate","variable","for","at","in","let","where","order","group","by","return","if","then","else","tumbling","sliding","window","start","when","only","end","previous","next","stable","ascending","descending","allowing","empty","greatest","least","some","every","satisfies","switch","case","typeswitch","try","catch","and","or","to","union","intersect","instance","of","treat","as","castable","cast","map","array","delete","insert","into","replace","value","rename","copy","modify","update"],type:["item","document-node","node","attribute","document","element","comment","namespace","namespace-node","processing-instruction","text","construction","xs:anyAtomicType","xs:untypedAtomic","xs:duration","xs:time","xs:decimal","xs:float","xs:double","xs:gYearMonth","xs:gYear","xs:gMonthDay","xs:gMonth","xs:gDay","xs:boolean","xs:base64Binary","xs:hexBinary","xs:anyURI","xs:QName","xs:NOTATION","xs:dateTime","xs:dateTimeStamp","xs:date","xs:string","xs:normalizedString","xs:token","xs:language","xs:NMTOKEN","xs:Name","xs:NCName","xs:ID","xs:IDREF","xs:ENTITY","xs:integer","xs:nonPositiveInteger","xs:negativeInteger","xs:long","xs:int","xs:short","xs:byte","xs:nonNegativeInteger","xs:unisignedLong","xs:unsignedInt","xs:unsignedShort","xs:unsignedByte","xs:positiveInteger","xs:yearMonthDuration","xs:dayTimeDuration"],literal:["eq","ne","lt","le","gt","ge","is","self::","child::","descendant::","descendant-or-self::","attribute::","following::","following-sibling::","parent::","ancestor::","ancestor-or-self::","preceding::","preceding-sibling::","NaN"]},contains:[{className:"variable",begin:/[$][\w\-:]+/},{className:"built_in",variants:[{begin:/\barray:/,end:/(?:append|filter|flatten|fold-(?:left|right)|for-each(?:-pair)?|get|head|insert-before|join|put|remove|reverse|size|sort|subarray|tail)\b/},{begin:/\bmap:/,end:/(?:contains|entry|find|for-each|get|keys|merge|put|remove|size)\b/},{begin:/\bmath:/,end:/(?:a(?:cos|sin|tan[2]?)|cos|exp(?:10)?|log(?:10)?|pi|pow|sin|sqrt|tan)\b/},{begin:/\bop:/,end:/\(/,excludeEnd:!0},{begin:/\bfn:/,end:/\(/,excludeEnd:!0},{begin:/[^</$:'"-]\b(?:abs|accumulator-(?:after|before)|adjust-(?:date(?:Time)?|time)-to-timezone|analyze-string|apply|available-(?:environment-variables|system-properties)|avg|base-uri|boolean|ceiling|codepoints?-(?:equal|to-string)|collation-key|collection|compare|concat|contains(?:-token)?|copy-of|count|current(?:-)?(?:date(?:Time)?|time|group(?:ing-key)?|output-uri|merge-(?:group|key))?data|dateTime|days?-from-(?:date(?:Time)?|duration)|deep-equal|default-(?:collation|language)|distinct-values|document(?:-uri)?|doc(?:-available)?|element-(?:available|with-id)|empty|encode-for-uri|ends-with|environment-variable|error|escape-html-uri|exactly-one|exists|false|filter|floor|fold-(?:left|right)|for-each(?:-pair)?|format-(?:date(?:Time)?|time|integer|number)|function-(?:arity|available|lookup|name)|generate-id|has-children|head|hours-from-(?:dateTime|duration|time)|id(?:ref)?|implicit-timezone|in-scope-prefixes|index-of|innermost|insert-before|iri-to-uri|json-(?:doc|to-xml)|key|lang|last|load-xquery-module|local-name(?:-from-QName)?|(?:lower|upper)-case|matches|max|minutes-from-(?:dateTime|duration|time)|min|months?-from-(?:date(?:Time)?|duration)|name(?:space-uri-?(?:for-prefix|from-QName)?)?|nilled|node-name|normalize-(?:space|unicode)|not|number|one-or-more|outermost|parse-(?:ietf-date|json)|path|position|(?:prefix-from-)?QName|random-number-generator|regex-group|remove|replace|resolve-(?:QName|uri)|reverse|root|round(?:-half-to-even)?|seconds-from-(?:dateTime|duration|time)|snapshot|sort|starts-with|static-base-uri|stream-available|string-?(?:join|length|to-codepoints)?|subsequence|substring-?(?:after|before)?|sum|system-property|tail|timezone-from-(?:date(?:Time)?|time)|tokenize|trace|trans(?:form|late)|true|type-available|unordered|unparsed-(?:entity|text)?-?(?:public-id|uri|available|lines)?|uri-collection|xml-to-json|years?-from-(?:date(?:Time)?|duration)|zero-or-one)\b/},{begin:/\blocal:/,end:/\(/,excludeEnd:!0},{begin:/\bzip:/,end:/(?:zip-file|(?:xml|html|text|binary)-entry| (?:update-)?entries)\b/},{begin:/\b(?:util|db|functx|app|xdmp|xmldb):/,end:/\(/,excludeEnd:!0}]},{className:"string",variants:[{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]},{className:"number",begin:/(\b0[0-7_]+)|(\b0x[0-9a-fA-F_]+)|(\b[1-9][0-9_]*(\.[0-9_]+)?)|[0_]\b/,relevance:0},{className:"comment",begin:/\(:/,end:/:\)/,relevance:10,contains:[{className:"doctag",begin:/@\w+/}]},{className:"meta",begin:/%[\w\-:]+/},{className:"title",begin:/\bxquery version "[13]\.[01]"\s?(?:encoding ".+")?/,end:/;/},{beginKeywords:"element attribute comment document processing-instruction",end:/\{/,excludeEnd:!0},{begin:/<([\w._:-]+)(\s+\S*=('|").*('|"))?>/,end:/(\/[\w._:-]+>)/,subLanguage:"xml",contains:[{begin:/\{/,end:/\}/,subLanguage:"xquery"},"self"]}]}}},80580:(a,b,c)=>{"use strict";c.d(b,{u:()=>h});var d=c(21124),e=c(38301),f=c(20481),g=c(17793);function h({src:a,onError:b}){let c=(0,f.c)("worktree"),[h,i]=(0,e.useState)(!0),[j,k]=(0,e.useState)(!1);return j?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,d.jsx)("svg",{className:"w-16 h-16 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsx)("p",{className:"text-sm",children:c("videoViewer.loadError")})]}):(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center p-4",children:[h&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,d.jsx)(g.y,{size:"xl",variant:"accent"}),(0,d.jsx)("p",{className:"ml-3 text-muted-foreground",children:c("videoViewer.loading")})]}),(0,d.jsx)("video",{controls:!0,src:a,onLoadedData:()=>{i(!1)},onError:()=>{i(!1),k(!0),b?.()},style:{maxWidth:"100%",maxHeight:"500px",display:h?"none":"block"},className:"rounded-lg shadow-sm",children:c("videoViewer.unsupported")})]})}},80978:a=>{let b=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],c=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),d=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),e=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();a.exports=function(a){let g={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:a.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:a.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},h="@[a-z-]+",i={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,g.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},g.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+b.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+d.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+e.join("|")+")"},i,{begin:/\(/,end:/\)/,contains:[g.CSS_NUMBER_MODE]},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[g.BLOCK_COMMENT,i,g.HEXCOLOR,g.CSS_NUMBER_MODE,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,g.IMPORTANT,g.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:h,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:c.join(" ")},contains:[{begin:h,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},i,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,g.HEXCOLOR,g.CSS_NUMBER_MODE]},g.FUNCTION_DISPATCH]}}},81044:a=>{a.exports=function(a){return{name:"Dockerfile",aliases:["docker"],case_insensitive:!0,keywords:["from","maintainer","expose","env","arg","user","onbuild","stopsignal"],contains:[a.HASH_COMMENT_MODE,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.NUMBER_MODE,{beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell",starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"</"}}},81636:a=>{a.exports=function(a){let b=a.regex,c=/\b/;function d(a,b){if(0===a.index)return;let c=a.input[a.index-1];c>="0"&&c<="9"||"_"!==c&&b.ignoreMatch()}let e=/[+-]?((\.\d+)|(\d+)(\.\d*)?)/,f=/[GM]\s*\d+(\.\d+)?/,g=/T\s*\d+/,h=/O\s*\d+/,i=/O<.+>/,j=/[ABCUVWXYZ]\s*/,k=/[FHIJKPQRS]\s*/;return{name:"G-code (ISO 6983)",aliases:["nc"],case_insensitive:!0,disableAutodetect:!0,keywords:{$pattern:/[A-Z]+|%/,keyword:["THEN","ELSE","ENDIF","IF","GOTO","DO","WHILE","WH","END","CALL","SUB","ENDSUB","EQ","NE","LT","GT","LE","GE","AND","OR","XOR","%"],built_in:["ATAN","ABS","ACOS","ASIN","COS","EXP","FIX","FUP","ROUND","LN","SIN","SQRT","TAN","EXISTS"]},contains:[a.COMMENT(/\(/,/\)/),a.COMMENT(/;/,/$/),a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.C_NUMBER_MODE,{scope:"title.function",variants:[{match:b.concat(c,f)},{begin:f,"on:begin":d},{match:b.concat(c,g)},{begin:g,"on:begin":d}]},{scope:"symbol",variants:[{match:b.concat(c,h)},{begin:h,"on:begin":d},{match:b.concat(c,i)},{begin:i,"on:begin":d},{match:/\*\s*\d+\s*$/}]},{scope:"operator",match:/^N\s*\d+/},{scope:"variable",match:/-?#\s*\d+/},{scope:"property",variants:[{match:b.concat(c,j,e)},{begin:b.concat(j,e),"on:begin":d}]},{scope:"params",variants:[{match:b.concat(c,k,e)},{begin:b.concat(k,e),"on:begin":d}]}]}}},82705:a=>{a.exports=function(a){let b={begin:/\(/,end:/\)/,relevance:0},c={begin:/\[/,end:/\]/},d={className:"comment",begin:/%/,end:/$/,contains:[a.PHRASAL_WORDS_MODE]},e={className:"string",begin:/`/,end:/`/,contains:[a.BACKSLASH_ESCAPE]},f=[{begin:/[a-z][A-Za-z0-9_]*/,relevance:0},{className:"symbol",variants:[{begin:/[A-Z][a-zA-Z0-9_]*/},{begin:/_[A-Za-z0-9_]*/}],relevance:0},b,{begin:/:-/},c,d,a.C_BLOCK_COMMENT_MODE,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,e,{className:"string",begin:/0'(\\'|.)/},{className:"string",begin:/0'\\s/},a.C_NUMBER_MODE];return b.contains=f,c.contains=f,{name:"Prolog",contains:f.concat([{begin:/\.$/}])}}},83844:a=>{a.exports=function(a){return{name:"Clojure REPL",contains:[{className:"meta.prompt",begin:/^([\w.-]+|\s*#_)?=>/,starts:{end:/$/,subLanguage:"clojure"}}]}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},88674:a=>{a.exports=function(a){let b={className:"variable",variants:[{begin:"\\b([gtps][A-Z]{1}[a-zA-Z0-9]*)(\\[.+\\])?(?:\\s*?)"},{begin:"\\$_[A-Z]+"}],relevance:0},c=[a.C_BLOCK_COMMENT_MODE,a.HASH_COMMENT_MODE,a.COMMENT("--","$"),a.COMMENT("[^:]//","$")],d=a.inherit(a.TITLE_MODE,{variants:[{begin:"\\b_*rig[A-Z][A-Za-z0-9_\\-]*"},{begin:"\\b_[a-z0-9\\-]+"}]}),e=a.inherit(a.TITLE_MODE,{begin:"\\b([A-Za-z0-9_\\-]+)\\b"});return{name:"LiveCode",case_insensitive:!1,keywords:{keyword:"$_COOKIE $_FILES $_GET $_GET_BINARY $_GET_RAW $_POST $_POST_BINARY $_POST_RAW $_SESSION $_SERVER codepoint codepoints segment segments codeunit codeunits sentence sentences trueWord trueWords paragraph after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word words fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",literal:"SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",built_in:"put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg avgDev base64Decode base64Encode baseConvert binaryDecode binaryEncode byteOffset byteToNum cachedURL cachedURLs charToNum cipherNames codepointOffset codepointProperty codepointToNum codeunitOffset commandNames compound compress constantNames cos date dateFormat decompress difference directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames geometricMean global globals hasMemory harmonicMean hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge messageAuthenticationCode messageDigest millisec millisecs millisecond milliseconds min monthNames nativeCharToNum normalizeText num number numToByte numToChar numToCodepoint numToNativeChar offset open openfiles openProcesses openProcessIDs openSockets paragraphOffset paramCount param params peerAddress pendingMessages platform popStdDev populationStandardDeviation populationVariance popVariance processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLCreateTreeFromFileWithNamespaces revXMLCreateTreeWithNamespaces revXMLDataFromXPathQuery revXMLEvaluateXPath revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_Execute revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sampVariance sec secs seconds sentenceOffset sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName textDecode textEncode tick ticks time to tokenOffset toLower toUpper transpose truewordOffset trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus uuid value variableNames variance version waitDepth weekdayNames wordOffset xsltApplyStylesheet xsltApplyStylesheetFromFile xsltLoadStylesheet xsltLoadStylesheetFromFile add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetDriver libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load extension loadedExtensions multiply socket prepare process post seek rel relative read from process rename replace require resetAll resolve revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split start stop subtract symmetric union unload vectorDotProduct wait write"},contains:[b,{className:"keyword",begin:"\\bend\\sif\\b"},{className:"function",beginKeywords:"function",end:"$",contains:[b,e,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE,d]},{className:"function",begin:"\\bend\\s+",end:"$",keywords:"end",contains:[e,d],relevance:0},{beginKeywords:"command on",end:"$",contains:[b,e,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE,d]},{className:"meta",variants:[{begin:"<\\?(rev|lc|livecode)",relevance:10},{begin:"<\\?"},{begin:"\\?>"}]},a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE,d].concat(c),illegal:";$|^\\[|^=|&|\\{"}}},89394:a=>{a.exports=function(a){let b="(_?[ui](8|16|32|64|128))?",c="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~|]|//|//=|&[-+*]=?|&\\*\\*|\\[\\][=?]?",d="[A-Za-z_]\\w*(::\\w+)*(\\?|!)?",e={$pattern:"[a-zA-Z_]\\w*[!?=]?",keyword:"abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__",literal:"false nil true"},f={className:"subst",begin:/#\{/,end:/\}/,keywords:e},g={className:"template-variable",variants:[{begin:"\\{\\{",end:"\\}\\}"},{begin:"\\{%",end:"%\\}"}],keywords:e};function h(a,b){let c=[{begin:a,end:b}];return c[0].contains=c,c}let i={className:"string",contains:[a.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[Qwi]?\\(",end:"\\)",contains:h("\\(","\\)")},{begin:"%[Qwi]?\\[",end:"\\]",contains:h("\\[","\\]")},{begin:"%[Qwi]?\\{",end:/\}/,contains:h(/\{/,/\}/)},{begin:"%[Qwi]?<",end:">",contains:h("<",">")},{begin:"%[Qwi]?\\|",end:"\\|"},{begin:/<<-\w+$/,end:/^\s*\w+$/}],relevance:0},j={className:"string",variants:[{begin:"%q\\(",end:"\\)",contains:h("\\(","\\)")},{begin:"%q\\[",end:"\\]",contains:h("\\[","\\]")},{begin:"%q\\{",end:/\}/,contains:h(/\{/,/\}/)},{begin:"%q<",end:">",contains:h("<",">")},{begin:"%q\\|",end:"\\|"},{begin:/<<-'\w+'$/,end:/^\s*\w+$/}],relevance:0},k={begin:"(?!%\\})("+a.RE_STARTERS_RE+"|\\n|\\b(case|if|select|unless|until|when|while)\\b)\\s*",keywords:"case if select unless until when while",contains:[{className:"regexp",contains:[a.BACKSLASH_ESCAPE,f],variants:[{begin:"//[a-z]*",relevance:0},{begin:"/(?!\\/)",end:"/[a-z]*"}]}],relevance:0},l=[g,i,j,{className:"regexp",contains:[a.BACKSLASH_ESCAPE,f],variants:[{begin:"%r\\(",end:"\\)",contains:h("\\(","\\)")},{begin:"%r\\[",end:"\\]",contains:h("\\[","\\]")},{begin:"%r\\{",end:/\}/,contains:h(/\{/,/\}/)},{begin:"%r<",end:">",contains:h("<",">")},{begin:"%r\\|",end:"\\|"}],relevance:0},k,{className:"meta",begin:"@\\[",end:"\\]",contains:[a.inherit(a.QUOTE_STRING_MODE,{className:"string"})]},{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},a.HASH_COMMENT_MODE,{className:"class",beginKeywords:"class module struct",end:"$|;",illegal:/=/,contains:[a.HASH_COMMENT_MODE,a.inherit(a.TITLE_MODE,{begin:d}),{begin:"<"}]},{className:"class",beginKeywords:"lib enum union",end:"$|;",illegal:/=/,contains:[a.HASH_COMMENT_MODE,a.inherit(a.TITLE_MODE,{begin:d})]},{beginKeywords:"annotation",end:"$|;",illegal:/=/,contains:[a.HASH_COMMENT_MODE,a.inherit(a.TITLE_MODE,{begin:d})],relevance:2},{className:"function",beginKeywords:"def",end:/\B\b/,contains:[a.inherit(a.TITLE_MODE,{begin:c,endsParent:!0})]},{className:"function",beginKeywords:"fun macro",end:/\B\b/,contains:[a.inherit(a.TITLE_MODE,{begin:c,endsParent:!0})],relevance:2},{className:"symbol",begin:a.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":",contains:[i,{begin:c}],relevance:0},{className:"number",variants:[{begin:"\\b0b([01_]+)"+b},{begin:"\\b0o([0-7_]+)"+b},{begin:"\\b0x([A-Fa-f0-9_]+)"+b},{begin:"\\b([1-9][0-9_]*[0-9]|[0-9])(\\.[0-9][0-9_]*)?([eE]_?[-+]?[0-9_]*)?(_?f(32|64))?(?!_)"},{begin:"\\b([1-9][0-9_]*|0)"+b}],relevance:0}];return f.contains=l,g.contains=l.slice(1),{name:"Crystal",aliases:["cr"],keywords:e,contains:l}}},89815:a=>{let b=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],c=["true","false","null","undefined","NaN","Infinity"],d=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);a.exports=function(a){let e={keyword:b.concat(["then","unless","until","loop","of","by","when","and","or","is","isnt","not","it","that","otherwise","from","to","til","fallthrough","case","enum","native","list","map","__hasProp","__extends","__slice","__bind","__indexOf"]),literal:c.concat(["yes","no","on","off","it","that","void"]),built_in:d.concat(["npm","print"])},f="[A-Za-z$_](?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*",g=a.inherit(a.TITLE_MODE,{begin:f}),h={className:"subst",begin:/#\{/,end:/\}/,keywords:e},i={className:"subst",begin:/#[A-Za-z$_]/,end:/(?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*/,keywords:e},j=[a.BINARY_NUMBER_MODE,{className:"number",begin:"(\\b0[xX][a-fA-F0-9_]+)|(\\b\\d(\\d|_\\d)*(\\.(\\d(\\d|_\\d)*)?)?(_*[eE]([-+]\\d(_\\d|\\d)*)?)?[_a-z]*)",relevance:0,starts:{end:"(\\s*/)?",relevance:0}},{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[a.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[a.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[a.BACKSLASH_ESCAPE,h,i]},{begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE,h,i]},{begin:/\\/,end:/(\s|$)/,excludeEnd:!0}]},{className:"regexp",variants:[{begin:"//",end:"//[gim]*",contains:[h,a.HASH_COMMENT_MODE]},{begin:/\/(?![ *])(\\.|[^\\\n])*?\/[gim]*(?=\W)/}]},{begin:"@"+f},{begin:"``",end:"``",excludeBegin:!0,excludeEnd:!0,subLanguage:"javascript"}];h.contains=j;let k={className:"params",begin:"\\(",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:e,contains:["self"].concat(j)}]};return{name:"LiveScript",aliases:["ls"],keywords:e,illegal:/\/\*/,contains:j.concat([a.COMMENT("\\/\\*","\\*\\/"),a.HASH_COMMENT_MODE,{begin:"(#=>|=>|\\|>>|-?->|!->)"},{className:"function",contains:[g,k],returnBegin:!0,variants:[{begin:"("+f+"\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B->\\*?",end:"->\\*?"},{begin:"("+f+"\\s*(?:=|:=)\\s*)?!?(\\(.*\\)\\s*)?\\B[-~]{1,2}>\\*?",end:"[-~]{1,2}>\\*?"},{begin:"("+f+"\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B!?[-~]{1,2}>\\*?",end:"!?[-~]{1,2}>\\*?"}]},{variants:[{match:[/class\s+/,f,/\s+extends\s+/,f]},{match:[/class\s+/,f]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:e},{begin:f+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}},89838:a=>{a.exports=function(a){let b=[a.C_NUMBER_MODE,{className:"string",begin:"'|\"",end:"'|\"",contains:[a.BACKSLASH_ESCAPE,{begin:"''"}]}];return{name:"Scilab",aliases:["sci"],keywords:{$pattern:/%?\w+/,keyword:"abort break case clear catch continue do elseif else endfunction end for function global if pause return resume select try then while",literal:"%f %F %t %T %pi %eps %inf %nan %e %i %z %s",built_in:"abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan type typename warning zeros matrix"},illegal:'("|#|/\\*|\\s+/\\w+)',contains:[{className:"function",beginKeywords:"function",end:"$",contains:[a.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)"}]},{begin:"[a-zA-Z_][a-zA-Z_0-9]*[\\.']+",relevance:0},{begin:"\\[",end:"\\][\\.']*",relevance:0,contains:b},a.COMMENT("//","$")].concat(b)}}},89866:a=>{a.exports=function(a){return{name:"MEL",keywords:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",illegal:"</",contains:[a.C_NUMBER_MODE,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,{className:"string",begin:"`",end:"`",contains:[a.BACKSLASH_ESCAPE]},{begin:/[$%@](\^\w\b|#\w+|[^\s\w{]|\{\w+\}|\w+)/},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]}}},89992:a=>{let b=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],c=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),d=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),e=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();a.exports=function(a){let g={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:a.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:a.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},h={className:"variable",begin:"\\$"+a.IDENT_RE},i="(?=[.\\s\\n[:,(])";return{name:"Stylus",aliases:["styl"],case_insensitive:!1,keywords:"if else for in",illegal:"(\\?|(\\bReturn\\b)|(\\bEnd\\b)|(\\bend\\b)|(\\bdef\\b)|;|#\\s|\\*\\s|===\\s|\\||%)",contains:[a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,g.HEXCOLOR,{begin:"\\.[a-zA-Z][a-zA-Z0-9_-]*"+i,className:"selector-class"},{begin:"#[a-zA-Z][a-zA-Z0-9_-]*"+i,className:"selector-id"},{begin:"\\b("+b.join("|")+")"+i,className:"selector-tag"},{className:"selector-pseudo",begin:"&?:("+d.join("|")+")"+i},{className:"selector-pseudo",begin:"&?:(:)?("+e.join("|")+")"+i},g.ATTRIBUTE_SELECTOR_MODE,{className:"keyword",begin:/@media/,starts:{end:/[{;}]/,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:c.join(" ")},contains:[g.CSS_NUMBER_MODE]}},{className:"keyword",begin:"@((-(o|moz|ms|webkit)-)?(charset|css|debug|extend|font-face|for|import|include|keyframes|media|mixin|page|warn|while))\\b"},h,g.CSS_NUMBER_MODE,{className:"function",begin:"^[a-zA-Z][a-zA-Z0-9_-]*\\(.*\\)",illegal:"[\\n]",returnBegin:!0,contains:[{className:"title",begin:"\\b[a-zA-Z][a-zA-Z0-9_-]*"},{className:"params",begin:/\(/,end:/\)/,contains:[g.HEXCOLOR,h,a.APOS_STRING_MODE,g.CSS_NUMBER_MODE,a.QUOTE_STRING_MODE]}]},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.join("|")+")\\b",starts:{end:/;|$/,contains:[g.HEXCOLOR,h,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,g.CSS_NUMBER_MODE,a.C_BLOCK_COMMENT_MODE,g.IMPORTANT,g.FUNCTION_DISPATCH],illegal:/\./,relevance:0}},g.FUNCTION_DISPATCH]}}},90429:a=>{a.exports=function(a){let b=a.UNDERSCORE_IDENT_RE,c={keyword:["abstract","as","asc","avg","break","breakpoint","by","byref","case","catch","changecompany","class","client","client","common","const","continue","count","crosscompany","delegate","delete_from","desc","display","div","do","edit","else","eventhandler","exists","extends","final","finally","firstfast","firstonly","firstonly1","firstonly10","firstonly100","firstonly1000","flush","for","forceliterals","forcenestedloop","forceplaceholders","forceselectorder","forupdate","from","generateonly","group","hint","if","implements","in","index","insert_recordset","interface","internal","is","join","like","maxof","minof","mod","namespace","new","next","nofetch","notexists","optimisticlock","order","outer","pessimisticlock","print","private","protected","public","readonly","repeatableread","retry","return","reverse","select","server","setting","static","sum","super","switch","this","throw","try","ttsabort","ttsbegin","ttscommit","unchecked","update_recordset","using","validtimestate","void","where","while"],built_in:["anytype","boolean","byte","char","container","date","double","enum","guid","int","int64","long","real","short","str","utcdatetime","var"],literal:["default","false","null","true"]};return{name:"X++",aliases:["x++"],keywords:c,contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.C_NUMBER_MODE,{className:"meta",begin:"#",end:"$"},{variants:[{match:[/(class|interface)\s+/,b,/\s+(extends|implements)\s+/,b]},{match:[/class\s+/,b]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:c}]}}},90535:a=>{a.exports=function(a){let b={begin:"`[\\s\\S]"};return{name:"AutoHotkey",case_insensitive:!0,aliases:["ahk"],keywords:{keyword:"Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group",literal:"true false NOT AND OR",built_in:"ComSpec Clipboard ClipboardAll ErrorLevel"},contains:[b,a.inherit(a.QUOTE_STRING_MODE,{contains:[b]}),a.COMMENT(";","$",{relevance:0}),a.C_BLOCK_COMMENT_MODE,{className:"number",begin:a.NUMBER_RE,relevance:0},{className:"variable",begin:"%[a-zA-Z0-9#_$@]+%"},{className:"built_in",begin:"^\\s*\\w+\\s*(,|%)"},{className:"title",variants:[{begin:'^[^\\n";]+::(?!=)'},{begin:'^[^\\n";]+:(?!=)',relevance:0}]},{className:"meta",begin:"^\\s*#\\w+",end:"$",relevance:0},{className:"built_in",begin:"A_[a-zA-Z0-9]+"},{begin:",\\s*,"}]}}},90599:a=>{a.exports=function(a){let b=a.regex,c=/[a-zA-Z_$][a-zA-Z0-9_$]*/,d=b.concat(c,b.concat("(\\.",c,")*"));return{name:"ActionScript",aliases:["as"],keywords:{keyword:["as","break","case","catch","class","const","continue","default","delete","do","dynamic","each","else","extends","final","finally","for","function","get","if","implements","import","in","include","instanceof","interface","internal","is","namespace","native","new","override","package","private","protected","public","return","set","static","super","switch","this","throw","try","typeof","use","var","void","while","with"],literal:["true","false","null","undefined"]},contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.C_NUMBER_MODE,{match:[/\bpackage/,/\s+/,d],className:{1:"keyword",3:"title.class"}},{match:[/\b(?:class|interface|extends|implements)/,/\s+/,c],className:{1:"keyword",3:"title.class"}},{className:"meta",beginKeywords:"import include",end:/;/,keywords:{keyword:"import include"}},{beginKeywords:"function",end:/[{;]/,excludeEnd:!0,illegal:/\S/,contains:[a.inherit(a.TITLE_MODE,{className:"title.function"}),{className:"params",begin:/\(/,end:/\)/,contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{className:"rest_arg",begin:/[.]{3}/,end:c,relevance:10}]},{begin:b.concat(/:\s*/,/([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)/)}]},a.METHOD_GUARD],illegal:/#/}}},90855:a=>{a.exports=function(a){return{name:"CMake",aliases:["cmake.in"],case_insensitive:!0,keywords:{keyword:"break cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue elseif else endforeach endfunction endif endmacro endwhile execute_process file find_file find_library find_package find_path find_program foreach function get_cmake_property get_directory_property get_filename_component get_property if include include_guard list macro mark_as_advanced math message option return separate_arguments set_directory_properties set_property set site_name string unset variable_watch while add_compile_definitions add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_link_options add_subdirectory add_test aux_source_directory build_command create_test_sourcelist define_property enable_language enable_testing export fltk_wrap_ui get_source_file_property get_target_property get_test_property include_directories include_external_msproject include_regular_expression install link_directories link_libraries load_cache project qt_wrap_cpp qt_wrap_ui remove_definitions set_source_files_properties set_target_properties set_tests_properties source_group target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_directories target_link_libraries target_link_options target_sources try_compile try_run ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload build_name exec_program export_library_dependencies install_files install_programs install_targets load_command make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or not command policy target test exists is_newer_than is_directory is_symlink is_absolute matches less greater equal less_equal greater_equal strless strgreater strequal strless_equal strgreater_equal version_less version_greater version_equal version_less_equal version_greater_equal in_list defined"},contains:[{className:"variable",begin:/\$\{/,end:/\}/},a.COMMENT(/#\[\[/,/]]/),a.HASH_COMMENT_MODE,a.QUOTE_STRING_MODE,a.NUMBER_MODE]}}},91109:a=>{a.exports=function(a){return{keywords:"dsconfig",contains:[{className:"keyword",begin:"^dsconfig",end:/\s/,excludeEnd:!0,relevance:10},{className:"built_in",begin:/(list|create|get|set|delete)-(\w+)/,end:/\s/,excludeEnd:!0,illegal:"!@#$%^&*()",relevance:10},{className:"built_in",begin:/--(\w+)/,end:/\s/,excludeEnd:!0},{className:"string",begin:/"/,end:/"/},{className:"string",begin:/'/,end:/'/},{className:"string",begin:/[\w\-?]+:\w+/,end:/\W/,relevance:0},{className:"string",begin:/\w+(\-\w+)*/,end:/(?=\W)/,relevance:0},a.HASH_COMMENT_MODE]}}},91445:a=>{a.exports=function(a){return{name:"Gradle",case_insensitive:!0,keywords:["task","project","allprojects","subprojects","artifacts","buildscript","configurations","dependencies","repositories","sourceSets","description","delete","from","into","include","exclude","source","classpath","destinationDir","includes","options","sourceCompatibility","targetCompatibility","group","flatDir","doLast","doFirst","flatten","todir","fromdir","ant","def","abstract","break","case","catch","continue","default","do","else","extends","final","finally","for","if","implements","instanceof","native","new","private","protected","public","return","static","switch","synchronized","throw","throws","transient","try","volatile","while","strictfp","package","import","false","null","super","this","true","antlrtask","checkstyle","codenarc","copy","boolean","byte","char","class","double","float","int","interface","long","short","void","compile","runTime","file","fileTree","abs","any","append","asList","asWritable","call","collect","compareTo","count","div","dump","each","eachByte","eachFile","eachLine","every","find","findAll","flatten","getAt","getErr","getIn","getOut","getText","grep","immutable","inject","inspect","intersect","invokeMethods","isCase","join","leftShift","minus","multiply","newInputStream","newOutputStream","newPrintWriter","newReader","newWriter","next","plus","pop","power","previous","print","println","push","putAt","read","readBytes","readLines","reverse","reverseEach","round","size","sort","splitEachLine","step","subMap","times","toInteger","toList","tokenize","upto","waitForOrKill","withPrintWriter","withReader","withStream","withWriter","withWriterAppend","write","writeLine"],contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.NUMBER_MODE,a.REGEXP_MODE]}}},91508:a=>{a.exports=function(a){let b={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:b,illegal:"</",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{className:"string",variants:[a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[a.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:b,illegal:/["']/}]}]}}},91645:a=>{"use strict";a.exports=require("net")},91916:a=>{a.exports=function(a){return{name:"OCaml",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:"\\[(\\|\\|)?\\]|\\(\\)",relevance:0},a.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*",relevance:0},a.inherit(a.APOS_STRING_MODE,{className:"string",relevance:0}),a.inherit(a.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/->/}]}}},92037:a=>{a.exports=function(a){let b=a.COMMENT("%","$"),c=a.inherit(a.APOS_STRING_MODE,{relevance:0}),d=a.inherit(a.QUOTE_STRING_MODE,{relevance:0});return d.contains=d.contains.slice(),d.contains.push({className:"subst",begin:"\\\\[abfnrtv]\\|\\\\x[0-9a-fA-F]*\\\\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]",relevance:0}),{name:"Mercury",aliases:["m","moo"],keywords:{keyword:"module use_module import_module include_module end_module initialise mutable initialize finalize finalise interface implementation pred mode func type inst solver any_pred any_func is semidet det nondet multi erroneous failure cc_nondet cc_multi typeclass instance where pragma promise external trace atomic or_else require_complete_switch require_det require_semidet require_multi require_nondet require_cc_multi require_cc_nondet require_erroneous require_failure",meta:"inline no_inline type_spec source_file fact_table obsolete memo loop_check minimal_model terminates does_not_terminate check_termination promise_equivalent_clauses foreign_proc foreign_decl foreign_code foreign_type foreign_import_module foreign_export_enum foreign_export foreign_enum may_call_mercury will_not_call_mercury thread_safe not_thread_safe maybe_thread_safe promise_pure promise_semipure tabled_for_io local untrailed trailed attach_to_io_state can_pass_as_mercury_type stable will_not_throw_exception may_modify_trail will_not_modify_trail may_duplicate may_not_duplicate affects_liveness does_not_affect_liveness doesnt_affect_liveness no_sharing unknown_sharing sharing",built_in:"some all not if then else true fail false try catch catch_any semidet_true semidet_false semidet_fail impure_true impure semipure"},contains:[{className:"built_in",variants:[{begin:"<=>"},{begin:"<=",relevance:0},{begin:"=>",relevance:0},{begin:"/\\\\"},{begin:"\\\\/"}]},{className:"built_in",variants:[{begin:":-\\|--\x3e"},{begin:"=",relevance:0}]},b,a.C_BLOCK_COMMENT_MODE,{className:"number",begin:"0'.\\|0[box][0-9a-fA-F]*"},a.NUMBER_MODE,c,d,{begin:/:-/},{begin:/\.$/}]}}},92474:a=>{a.exports=function(a){return{name:"GLSL",keywords:{keyword:"break continue discard do else for if return while switch case default attribute binding buffer ccw centroid centroid varying coherent column_major const cw depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip triangles triangles_adjacency uniform varying vertices volatile writeonly",type:"atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void",built_in:"gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow",literal:"true false"},illegal:'"',contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.C_NUMBER_MODE,{className:"meta",begin:"#",end:"$"}]}}},92583:a=>{a.exports=function(a){let b={className:"number",relevance:0,variants:[{begin:"[$][a-fA-F0-9]+"},a.NUMBER_MODE]},c={variants:[{match:[/(function|method)/,/\s+/,a.UNDERSCORE_IDENT_RE]}],scope:{1:"keyword",3:"title.function"}},d={variants:[{match:[/(class|interface|extends|implements)/,/\s+/,a.UNDERSCORE_IDENT_RE]}],scope:{1:"keyword",3:"title.class"}};return{name:"Monkey",case_insensitive:!0,keywords:{keyword:["public","private","property","continue","exit","extern","new","try","catch","eachin","not","abstract","final","select","case","default","const","local","global","field","end","if","then","else","elseif","endif","while","wend","repeat","until","forever","for","to","step","next","return","module","inline","throw","import","and","or","shl","shr","mod"],built_in:["DebugLog","DebugStop","Error","Print","ACos","ACosr","ASin","ASinr","ATan","ATan2","ATan2r","ATanr","Abs","Abs","Ceil","Clamp","Clamp","Cos","Cosr","Exp","Floor","Log","Max","Max","Min","Min","Pow","Sgn","Sgn","Sin","Sinr","Sqrt","Tan","Tanr","Seed","PI","HALFPI","TWOPI"],literal:["true","false","null"]},illegal:/\/\*/,contains:[a.COMMENT("#rem","#end"),a.COMMENT("'","$",{relevance:0}),c,d,{className:"variable.language",begin:/\b(self|super)\b/},{className:"meta",begin:/\s*#/,end:"$",keywords:{keyword:"if else elseif endif end then"}},{match:[/^\s*/,/strict\b/],scope:{2:"meta"}},{beginKeywords:"alias",end:"=",contains:[a.UNDERSCORE_TITLE_MODE]},a.QUOTE_STRING_MODE,b]}}},93014:a=>{a.exports=function(a){let b=a.regex,c={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"},{begin:/\$\{/,end:/\}/}]},d={className:"string",variants:[{begin:'"""',end:'"""'},{begin:'"',end:'"',illegal:"\\n",contains:[a.BACKSLASH_ESCAPE]},{begin:'[a-z]+"',end:'"',illegal:"\\n",contains:[a.BACKSLASH_ESCAPE,c]},{className:"string",begin:'[a-z]+"""',end:'"""',contains:[c],relevance:10}]},e={className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},f={className:"title",begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,relevance:0},g={className:"class",beginKeywords:"class object trait type",end:/[:={\[\n;]/,excludeEnd:!0,contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{beginKeywords:"extends with",relevance:10},{begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[e,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[e,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},f]},h={className:"function",beginKeywords:"def",end:b.lookahead(/[:={\[(\n;]/),contains:[f]};return{name:"Scala",keywords:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if then forSome for while do throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit export enum given transparent"},contains:[{begin:["//>",/\s+/,/using/,/\s+/,/\S+/],beginScope:{1:"comment",3:"keyword",5:"type"},end:/$/,contains:[{className:"string",begin:/\S+/}]},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,d,e,h,g,a.C_NUMBER_MODE,{begin:[/^\s*/,"extension",/\s+(?=[[(])/],beginScope:{2:"keyword"}},{begin:[/^\s*/,/end/,/\s+/,/(extension\b)?/],beginScope:{2:"keyword",4:"keyword"}},{match:/\.inline\b/},{begin:/\binline(?=\s)/,keywords:"inline"},{begin:[/\(\s*/,/using/,/\s+(?!\))/],beginScope:{2:"keyword"}},{className:"meta",begin:"@[A-Za-z]+"}]}}},93275:a=>{a.exports=function(a){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},"self"]}],relevance:10},{className:"keyword",begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:"variable",begin:/%[_a-zA-Z0-9:]+%/},{className:"symbol",begin:/\\[\\nt$%,()]/},{className:"symbol",begin:/\\u[a-fA-F0-9]{4}/}]}}},93501:a=>{a.exports=function(a){let b={match:[/(message|enum|service)\s+/,a.IDENT_RE],scope:{1:"keyword",2:"title.class"}};return{name:"Protocol Buffers",aliases:["proto"],keywords:{keyword:["package","import","option","optional","required","repeated","group","oneof"],type:["double","float","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","bool","string","bytes"],literal:["true","false"]},contains:[a.QUOTE_STRING_MODE,a.NUMBER_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,b,{className:"function",beginKeywords:"rpc",end:/[{;]/,excludeEnd:!0,keywords:"rpc returns"},{begin:/^\s*[A-Z_]+(?=\s*=[^\n]+;$)/}]}}},93526:a=>{a.exports=function(a){return{name:"BASIC",case_insensitive:!0,illegal:"^.",keywords:{$pattern:"[a-zA-Z][a-zA-Z0-9_$%!#]*",keyword:["ABS","ASC","AND","ATN","AUTO|0","BEEP","BLOAD|10","BSAVE|10","CALL","CALLS","CDBL","CHAIN","CHDIR","CHR$|10","CINT","CIRCLE","CLEAR","CLOSE","CLS","COLOR","COM","COMMON","CONT","COS","CSNG","CSRLIN","CVD","CVI","CVS","DATA","DATE$","DEFDBL","DEFINT","DEFSNG","DEFSTR","DEF|0","SEG","USR","DELETE","DIM","DRAW","EDIT","END","ENVIRON","ENVIRON$","EOF","EQV","ERASE","ERDEV","ERDEV$","ERL","ERR","ERROR","EXP","FIELD","FILES","FIX","FOR|0","FRE","GET","GOSUB|10","GOTO","HEX$","IF","THEN","ELSE|0","INKEY$","INP","INPUT","INPUT#","INPUT$","INSTR","IMP","INT","IOCTL","IOCTL$","KEY","ON","OFF","LIST","KILL","LEFT$","LEN","LET","LINE","LLIST","LOAD","LOC","LOCATE","LOF","LOG","LPRINT","USING","LSET","MERGE","MID$","MKDIR","MKD$","MKI$","MKS$","MOD","NAME","NEW","NEXT","NOISE","NOT","OCT$","ON","OR","PEN","PLAY","STRIG","OPEN","OPTION","BASE","OUT","PAINT","PALETTE","PCOPY","PEEK","PMAP","POINT","POKE","POS","PRINT","PRINT]","PSET","PRESET","PUT","RANDOMIZE","READ","REM","RENUM","RESET|0","RESTORE","RESUME","RETURN|0","RIGHT$","RMDIR","RND","RSET","RUN","SAVE","SCREEN","SGN","SHELL","SIN","SOUND","SPACE$","SPC","SQR","STEP","STICK","STOP","STR$","STRING$","SWAP","SYSTEM","TAB","TAN","TIME$","TIMER","TROFF","TRON","TO","USR","VAL","VARPTR","VARPTR$","VIEW","WAIT","WHILE","WEND","WIDTH","WINDOW","WRITE","XOR"]},contains:[{scope:"string",begin:/"/,end:/"|$/,contains:[a.BACKSLASH_ESCAPE]},a.COMMENT("REM","$",{relevance:10}),a.COMMENT("'","$",{relevance:0}),{className:"symbol",begin:"^[0-9]+ ",relevance:10},{className:"number",begin:"\\b\\d+(\\.\\d+)?([edED]\\d+)?[#!]?",relevance:0},{className:"number",begin:"(&[hH][0-9a-fA-F]{1,4})"},{className:"number",begin:"(&[oO][0-7]{1,6})"}]}}},93598:a=>{a.exports=function(a){return{name:"Node REPL",contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"javascript"}},variants:[{begin:/^>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}},94995:a=>{a.exports=function(a){return{name:"Julia REPL",contains:[{className:"meta.prompt",begin:/^julia>/,relevance:10,starts:{end:/^(?![ ]{6})/,subLanguage:"julia"}}],aliases:["jldoctest"]}}},95881:a=>{a.exports=function(a){let b={className:"keyword",begin:"\\$(f[asn]|t|vp[rtd]|children)"},c={className:"number",begin:"\\b\\d+(\\.\\d+)?(e-?\\d+)?",relevance:0},d=a.inherit(a.QUOTE_STRING_MODE,{illegal:null}),e={className:"function",beginKeywords:"module function",end:/=|\{/,contains:[{className:"params",begin:"\\(",end:"\\)",contains:["self",c,d,b,{className:"literal",begin:"false|true|PI|undef"}]},a.UNDERSCORE_TITLE_MODE]};return{name:"OpenSCAD",aliases:["scad"],keywords:{keyword:"function module include use for intersection_for if else \\%",literal:"false true PI undef",built_in:"circle square polygon text sphere cube cylinder polyhedron translate rotate scale resize mirror multmatrix color offset hull minkowski union difference intersection abs sign sin cos tan acos asin atan atan2 floor round ceil ln log pow sqrt exp rands min max concat lookup str chr search version version_num norm cross parent_module echo import import_dxf dxf_linear_extrude linear_extrude rotate_extrude surface projection render children dxf_cross dxf_dim let assign"},contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,c,{className:"meta",keywords:{keyword:"include use"},begin:"include|use <",end:">"},d,b,{begin:"[*!#%]",relevance:0},e]}}},95929:a=>{a.exports=function(a){let b={className:"string",variants:[a.inherit(a.QUOTE_STRING_MODE,{begin:'((u8?|U)|L)?"'}),{begin:'(u8?|U)?R"',end:'"',contains:[a.BACKSLASH_ESCAPE]},{begin:"'\\\\?.",end:"'",illegal:"."}]},c={className:"number",variants:[{begin:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},{begin:a.C_NUMBER_RE}],relevance:0},d={className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef ifdef ifndef"},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",end:"$",keywords:{keyword:"include"},contains:[a.inherit(b,{className:"string"}),{className:"string",begin:"<",end:">",illegal:"\\n"}]},b,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},e={className:"variable",begin:/&[a-z\d_]*\b/};return{name:"Device Tree",contains:[{className:"title.class",begin:/^\/(?=\s*\{)/,relevance:10},e,{className:"keyword",begin:"/[a-z][a-z\\d-]*/"},{className:"symbol",begin:"^\\s*[a-zA-Z_][a-zA-Z\\d_]*:"},{className:"title.class",begin:/[a-zA-Z_][a-zA-Z\d_@-]*(?=\s\{)/,relevance:.2},{relevance:0,match:[/[a-z][a-z-,]+/,/\s*/,/=/],scope:{1:"attr",3:"operator"}},{match:/[a-z][a-z-,]+(?=;)/,relevance:0,scope:"attr"},{className:"params",relevance:0,begin:"<",end:">",contains:[c,e]},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,c,b,d,{scope:"punctuation",relevance:0,match:/\};|[;{}]/},{begin:a.IDENT_RE+"::",keywords:""}]}}},96108:a=>{function b(a){return RegExp(a.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function c(a){return a?"string"==typeof a?a:a.source:null}function d(a){return e("(?=",a,")")}function e(...a){return a.map(a=>c(a)).join("")}function f(...a){return"("+(function(a){let b=a[a.length-1];return"object"==typeof b&&b.constructor===Object?(a.splice(a.length-1,1),b):{}}(a).capture?"":"?:")+a.map(a=>c(a)).join("|")+")"}a.exports=function(a){let c={scope:"keyword",match:/\b(yield|return|let|do|match|use)!/},g=["bool","byte","sbyte","int8","int16","int32","uint8","uint16","uint32","int","uint","int64","uint64","nativeint","unativeint","decimal","float","double","float32","single","char","string","unit","bigint","option","voption","list","array","seq","byref","exn","inref","nativeptr","obj","outref","voidptr","Result"],h={keyword:["abstract","and","as","assert","base","begin","class","default","delegate","do","done","downcast","downto","elif","else","end","exception","extern","finally","fixed","for","fun","function","global","if","in","inherit","inline","interface","internal","lazy","let","match","member","module","mutable","namespace","new","of","open","or","override","private","public","rec","return","static","struct","then","to","try","type","upcast","use","val","void","when","while","with","yield"],literal:["true","false","null","Some","None","Ok","Error","infinity","infinityf","nan","nanf"],built_in:["not","ref","raise","reraise","dict","readOnlyDict","set","get","enum","sizeof","typeof","typedefof","nameof","nullArg","invalidArg","invalidOp","id","fst","snd","ignore","lock","using","box","unbox","tryUnbox","printf","printfn","sprintf","eprintf","eprintfn","fprintf","fprintfn","failwith","failwithf"],"variable.constant":["__LINE__","__SOURCE_DIRECTORY__","__SOURCE_FILE__"]},i={variants:[a.COMMENT(/\(\*(?!\))/,/\*\)/,{contains:["self"]}),a.C_LINE_COMMENT_MODE]},j={scope:"variable",begin:/``/,end:/``/},k=/\B('|\^)/,l={scope:"symbol",variants:[{match:e(k,/``.*?``/)},{match:e(k,a.UNDERSCORE_IDENT_RE)}],relevance:0},m=function({includeEqual:a}){let c=e("[",...Array.from(a?"!%&*+-/<=>@^|~?":"!%&*+-/<>@^|~?").map(b),"]"),g=f(c,/\./),h=e(g,d(g)),i=f(e(h,g,"*"),e(c,"+"));return{scope:"operator",match:f(i,/:\?>/,/:\?/,/:>/,/:=/,/::?/,/\$/),relevance:0}},n=m({includeEqual:!0}),o=m({includeEqual:!1}),p=function(b,c){return{begin:e(b,d(e(/\s*/,f(/\w/,/'/,/\^/,/#/,/``/,/\(/,/{\|/)))),beginScope:c,end:d(f(/\n/,/=/)),relevance:0,keywords:a.inherit(h,{type:g}),contains:[i,l,a.inherit(j,{scope:null}),o]}},q=p(/:/,"operator"),r=p(/\bof\b/,"keyword"),s={begin:[/(^|\s+)/,/type/,/\s+/,/[a-zA-Z_](\w|')*/],beginScope:{2:"keyword",4:"title.class"},end:d(/\(|=|$/),keywords:h,contains:[i,a.inherit(j,{scope:null}),l,{scope:"operator",match:/<|>/},q]},t={scope:"computation-expression",match:/\b[_a-z]\w*(?=\s*\{)/},u={begin:[/^\s*/,e(/#/,f("if","else","endif","line","nowarn","light","r","i","I","load","time","help","quit")),/\b/],beginScope:{2:"meta"},end:d(/\s|$/)},v={variants:[a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE]},w={scope:"string",begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE]},x={scope:"string",begin:/@"/,end:/"/,contains:[{match:/""/},a.BACKSLASH_ESCAPE]},y={scope:"string",begin:/"""/,end:/"""/,relevance:2},z={scope:"subst",begin:/\{/,end:/\}/,keywords:h},A={scope:"string",begin:/\$"/,end:/"/,contains:[{match:/\{\{/},{match:/\}\}/},a.BACKSLASH_ESCAPE,z]},B={scope:"string",begin:/(\$@|@\$)"/,end:/"/,contains:[{match:/\{\{/},{match:/\}\}/},{match:/""/},a.BACKSLASH_ESCAPE,z]},C={scope:"string",match:e(/'/,f(/[^\\']/,/\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8})/),/'/)};return z.contains=[B,A,x,w,C,c,i,j,q,t,u,v,l,n],{name:"F#",aliases:["fs","f#"],keywords:h,illegal:/\/\*/,classNameAliases:{"computation-expression":"keyword"},contains:[c,{variants:[{scope:"string",begin:/\$"""/,end:/"""/,contains:[{match:/\{\{/},{match:/\}\}/},z],relevance:2},B,A,y,x,w,C]},i,j,s,{scope:"meta",begin:/\[</,end:/>\]/,relevance:2,contains:[j,y,x,w,C,v]},r,q,t,u,v,l,n]}}},96696:a=>{a.exports=function(a){let b=a.regex,c={};Object.assign(c,{className:"variable",variants:[{begin:b.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},{begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[c]}]}]});let d={className:"subst",begin:/\$\(/,end:/\)/,contains:[a.BACKSLASH_ESCAPE]},e=a.inherit(a.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),f={begin:/<<-?\s*(?=\w+)/,starts:{contains:[a.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},g={className:"string",begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE,c,d]};d.contains.push(g);let h={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},a.NUMBER_MODE,c]},i=a.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),j={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[a.inherit(a.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[i,a.SHEBANG(),j,h,e,f,{match:/(\/[a-z._-]+)+/},g,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},c]}}},97369:a=>{a.exports=function(a){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.COMMENT("/\\*\\*!","\\*/"),a.C_NUMBER_MODE,a.inherit(a.APOS_STRING_MODE,{illegal:null}),a.inherit(a.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}},97467:a=>{a.exports=function(a){return{name:"DNS Zone",aliases:["bind","zone"],keywords:["IN","A","AAAA","AFSDB","APL","CAA","CDNSKEY","CDS","CERT","CNAME","DHCID","DLV","DNAME","DNSKEY","DS","HIP","IPSECKEY","KEY","KX","LOC","MX","NAPTR","NS","NSEC","NSEC3","NSEC3PARAM","PTR","RRSIG","RP","SIG","SOA","SRV","SSHFP","TA","TKEY","TLSA","TSIG","TXT"],contains:[a.COMMENT(";","$",{relevance:0}),{className:"meta",begin:/^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/},{className:"number",begin:"((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b"},{className:"number",begin:"((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b"},a.inherit(a.NUMBER_MODE,{begin:/\b\d+[dhwm]?/})]}}},97694:a=>{a.exports=function(a){let b=a.regex,c={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:a.NUMBER_RE}]},d=a.COMMENT();d.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let e={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},f={className:"literal",begin:/\bon|off|true|false|yes|no\b/},g={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},h=b.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[d,{className:"section",begin:/\[+/,end:/\]+/},{begin:b.concat(h,"(\\s*\\.\\s*",h,")*",b.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[d,{begin:/\[/,end:/\]/,contains:[d,f,e,g,c,"self"],relevance:0},f,e,g,c]}}]}}},98758:a=>{a.exports=function(a){return{name:"Inform 7",aliases:["i7"],case_insensitive:!0,keywords:{keyword:"thing room person man woman animal container supporter backdrop door scenery open closed locked inside gender is are say understand kind of rule"},contains:[{className:"string",begin:'"',end:'"',relevance:0,contains:[{className:"subst",begin:"\\[",end:"\\]"}]},{className:"section",begin:/^(Volume|Book|Part|Chapter|Section|Table)\b/,end:"$"},{begin:/^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,end:":",contains:[{begin:"\\(This",end:"\\)"}]},{className:"comment",begin:"\\[",end:"\\]",contains:["self"]}]}}},98803:a=>{a.exports=function(a){let b=a.regex,c=/[a-zA-Z_][a-zA-Z0-9_]*/,d={className:"number",variants:[a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[a.COMMENT(";[ \\t]*#","$"),a.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:b.concat(/\$/,b.optional(/::/),c,"(::",c,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[d]}]},{className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[a.inherit(a.QUOTE_STRING_MODE,{illegal:null})]},d]}}},99134:a=>{a.exports=function(a){let b=a.regex,c=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,d=b.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),e=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,f=b.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:c,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[a.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:b.lookahead(b.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:c},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),a.HASH_COMMENT_MODE,{scope:"string",contains:[a.BACKSLASH_ESCAPE],variants:[a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[e,d]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,d]},{scope:{1:"punctuation",2:"number"},match:[f,d]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,d]}]},{scope:{3:"operator"},match:[c,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:e},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:f},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}},99896:a=>{a.exports=function(a){return{name:"JBoss CLI",aliases:["wildfly-cli"],keywords:{$pattern:"[a-z-]+",keyword:"alias batch cd clear command connect connection-factory connection-info data-source deploy deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias undeploy unset version xa-data-source",literal:"true false"},contains:[a.HASH_COMMENT_MODE,a.QUOTE_STRING_MODE,{className:"params",begin:/--[\w\-=\/]+/},{className:"function",begin:/:[\w\-.]+/,relevance:0},{className:"string",begin:/\B([\/.])[\w\-.\/=]+/},{className:"params",begin:/\(/,end:/\)/,contains:[{begin:/[\w-]+ *=/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/[\w-]+/}]}],relevance:0}]}}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[3897,641,3722,4072,2335,9701,9862,6345,4390,9627,8807,406,8581,6722,5737,8782,1945,4243,3730],()=>b(b.s=31975));module.exports=c})();
37
+ `.trim(),iR="bg-accent-600 text-white hover:bg-accent-700 focus:ring-ring",iS="bg-surface border-2 border-input hover:bg-muted text-foreground focus:ring-ring";function iT(a){}function iU({promptData:a,answering:b,onRespond:c,decisionId:f,onDismiss:g,labelId:i,cliToolName:j,answerable:l}){var m,n;let o=(0,h.c)("prompt"),{selectedOption:p,setSelectedOption:q,checkedNumbers:r,textInputValue:s,setTextInputValue:t,multiSelectOptions:u,takesTypedText:v,isBusy:w,isDisabled:x,handleToggleOption:y,handleYesNoClick:z,handleMultipleChoiceSubmit:A,handleMultiSelectSubmit:B,handleDecisionRespond:C}=S({promptData:a,answering:b,answerable:l,send:(0,e.useCallback)(a=>c(a,f),[c,f]),onError:iT,canRespondDecision:!!f}),D=(m=a,n=f,(0,L.ds)({...m,decisionId:n??null})),E=F(a)?a:null,G=null===E?a:null;return(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("h3",{id:i,className:"text-lg font-semibold text-warning-foreground flex items-center gap-2",children:[(0,d.jsx)("span",{className:"text-xl","aria-hidden":"true",children:"?"}),j?o("confirmationFrom",{toolName:j}):o("confirmationFromClaude")]}),g&&(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:g,"aria-label":"close",className:"p-1 rounded hover:bg-warning-border/50 transition-colors",children:(0,d.jsx)("svg",{className:"w-5 h-5 text-warning-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),E?.instructionText&&(0,d.jsx)("div",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap text-sm text-muted-foreground bg-muted rounded p-2 border border-border",children:E.instructionText}),"multiple_choice"===a.type&&a.askUserQuestion&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ask-user-question-progress",children:a.askUserQuestion.questionCount>1?o("askUserQuestionProgress",{index:a.askUserQuestion.questionIndex+1,total:a.askUserQuestion.questionCount}):o("askUserQuestionSource")}),(0,d.jsx)("p",{className:"text-foreground leading-relaxed",children:Q(o,D.heading)}),w&&(0,d.jsxs)("div",{"data-testid":"answering-indicator",className:"flex items-center gap-2 text-sm text-muted-foreground",role:"status","aria-live":"polite",children:[(0,d.jsx)(k.y$,{size:"sm",variant:"accent"}),(0,d.jsx)("span",{children:o("sending")})]}),"yes_no"===a.type&&(0,d.jsx)(iZ,{promptData:a,disabled:x,onYes:()=>z("yes"),onNo:()=>z("no")}),"multiple_choice"===a.type&&null!==u&&(0,d.jsx)(i_,{promptData:a,disabled:x,checkedNumbers:r,onToggleOption:y,textInputValue:s,onTextInputChange:t,showTextInput:v,onSubmit:B}),"multiple_choice"===a.type&&null===u&&(0,d.jsx)(i$,{promptData:a,disabled:x,selectedOption:p,onSelectOption:q,textInputValue:s,onTextInputChange:t,showTextInput:v,onSubmit:A}),G&&(0,d.jsx)(iV,{promptData:G,view:D,viewSource:{...G,decisionId:D.decisionId},disabled:x,onRespond:C})]})}function iV({promptData:a,view:b,viewSource:c,disabled:e,onRespond:f}){let g=(0,h.c)("prompt"),i="approval"===b.apiTarget?a.decisionOptions??null:null,j="question"===b.apiTarget?(0,L.zM)(c):null;return(0,d.jsxs)("div",{className:"space-y-2","data-testid":"unclassified-prompt-notice",children:[a.message&&a.message.includes("\n")?(0,d.jsx)("pre",{className:"max-h-60 overflow-auto whitespace-pre-wrap break-all rounded border border-border bg-muted p-2 font-mono text-xs text-foreground","data-testid":"structured-decision-message",children:a.message}):a.message?(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:a.message}):null,a.askUserQuestion&&(0,d.jsxs)("div",{className:"space-y-1","data-testid":"unclassified-ask-user-question",children:[(0,d.jsx)("p",{className:"text-sm text-foreground",children:a.askUserQuestion.question}),j?(0,d.jsx)(iY,{choices:j,disabled:e,onRespond:f}):(0,d.jsx)("ul",{className:"list-disc list-inside text-sm text-muted-foreground",children:a.askUserQuestion.labels.map(a=>(0,d.jsx)("li",{children:a},a))})]}),j?null:i&&i.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(iW,{toolName:a.toolName??null,patterns:a.patterns??null,allowAlwaysLabel:i.find(a=>"always"===a.reply)?.label??null}),(0,d.jsx)(iX,{options:i,disabled:e,onRespond:f})]}):(0,d.jsx)("p",{className:"text-sm text-foreground",children:g("unclassifiedInstruction",{command:g("unclassifiedRespondCommand")})})]})}function iW({toolName:a,patterns:b,allowAlwaysLabel:c}){let e=null!==b&&b.length>0;return a||e?(0,d.jsxs)("div",{className:"space-y-1","data-testid":"structured-decision-subject",children:[a&&(0,d.jsx)("p",{className:"text-sm font-medium text-foreground font-mono break-all","data-testid":"structured-decision-tool",children:a}),e&&(0,d.jsxs)("div",{className:"text-xs text-muted-foreground",children:[c&&(0,d.jsx)("span",{"data-testid":"structured-decision-patterns-label",children:c}),(0,d.jsx)("ul",{className:"mt-0.5 flex flex-wrap gap-1","data-testid":"structured-decision-patterns",children:b.map(a=>(0,d.jsx)("li",{className:"font-mono break-all bg-muted border border-border rounded px-1.5 py-0.5",children:a},a))})]})]}):null}function iX({options:a,disabled:b,onRespond:c}){let e=(0,h.c)("prompt");return(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-2",role:"group","aria-label":e("selectAnOption"),"data-testid":"structured-decision-actions",children:a.map(a=>(0,d.jsxs)(k.$n,{variant:"ghost",type:"button",disabled:b,onClick:()=>c(String(a.number)),"data-testid":`structured-decision-option-${a.number}`,className:`${iQ} ${3===a.number?iS:iR}`,children:[a.number,". ",a.label]},a.number))})}function iY({choices:a,disabled:b,onRespond:c}){let f=(0,h.c)("prompt"),g=(0,e.useId)(),[i,j]=(0,e.useState)(null),[l,m]=(0,e.useState)(""),n=a.custom?W(l):null,o=!0===a.custom&&X(l),p=(0,e.useCallback)(a=>{let c=i===a,d=b?"opacity-50 cursor-not-allowed":"";return`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all ${c?"bg-accent-50 dark:bg-accent-900/30 border-2 border-accent-500":"bg-surface border-2 border-border hover:border-input"} ${d}`},[i,b]);return(0,d.jsxs)("div",{className:"space-y-3","data-testid":"structured-question-actions",children:[(0,d.jsxs)("fieldset",{children:[(0,d.jsx)("legend",{className:"sr-only",children:f("selectAnOption")}),(0,d.jsx)(k.z6,{name:g,value:null!=i?String(i):"",onValueChange:a=>{j(Number(a)),m("")},disabled:b,className:"flex flex-col gap-2",children:a.labels.map((a,b)=>(0,d.jsxs)("label",{className:p(b+1),children:[(0,d.jsx)(k.CU,{value:String(b+1),className:"mt-1"}),(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsxs)("span",{className:"font-medium",children:[b+1,". ",a]})})]},`${b+1}-${a}`))})]}),a.custom&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:`free-text-${g}`,className:"block text-sm text-muted-foreground mb-1",children:f("freeTextLabel")}),(0,d.jsx)("input",{id:`free-text-${g}`,"data-testid":"structured-question-free-text",type:"text",value:l,maxLength:1e3,onChange:a=>{m(a.target.value),""!==a.target.value&&j(null)},disabled:b,placeholder:f("enterValuePlaceholder"),className:"w-full px-4 py-2 border-2 border-input dark:bg-muted dark:text-foreground rounded-lg focus:outline-none focus:border-accent-500 disabled:opacity-50"}),o&&(0,d.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":"structured-question-free-text-numeric",children:f("freeTextNumericHint")})]}),(0,d.jsx)("button",{type:"button","data-testid":"structured-question-submit",onClick:()=>{null!==n?c(n):null!==i&&c(String(i))},disabled:b||null===i&&null===n,className:`w-full ${iQ} ${iR}`,children:f("submit")})]})}function iZ({promptData:a,disabled:b,onYes:c,onNo:e}){let f=(0,h.c)("prompt"),g="yes"===a.defaultOption,i="no"===a.defaultOption,j=`${iQ} ${iR} ${g?"primary default highlighted":""}`,l=`${iQ} ${i?"bg-foreground text-background hover:bg-foreground/90 primary default highlighted":iS}`;return(0,d.jsxs)("div",{className:"flex items-center gap-3",role:"group","aria-label":f("yesNoGroupLabel"),children:[(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:c,disabled:b,className:j,children:f("yes")}),(0,d.jsx)(k.$n,{variant:"ghost",type:"button",onClick:e,disabled:b,className:l,children:f("no")})]})}function i$({promptData:a,disabled:b,selectedOption:c,onSelectOption:f,textInputValue:g,onTextInputChange:i,showTextInput:j,onSubmit:l}){let m=(0,e.useId)(),n=(0,h.c)("prompt"),o=(0,e.useCallback)(a=>{let d=c===a,e=b?"opacity-50 cursor-not-allowed":"";return`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all ${d?"bg-accent-50 dark:bg-accent-900/30 border-2 border-accent-500":"bg-surface border-2 border-border hover:border-input"} ${e}`},[c,b]);return(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("fieldset",{children:[(0,d.jsx)("legend",{className:"sr-only",children:n("selectAnOption")}),(0,d.jsx)(k.z6,{name:m,value:null!=c?String(c):"",onValueChange:a=>f(Number(a)),disabled:b,className:"flex flex-col gap-2",children:a.options.map(a=>(0,d.jsxs)("label",{className:o(a.number),children:[(0,d.jsx)(k.CU,{value:String(a.number),className:"mt-1","aria-describedby":a.isDefault?`default-${a.number}`:void 0}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("span",{className:"font-medium",children:[a.number,". ",a.label]}),a.isDefault&&(0,d.jsx)("span",{id:`default-${a.number}`,className:"ml-2 text-xs text-accent-600 dark:text-accent-400 bg-accent-100 dark:bg-accent-900/30 px-2 py-0.5 rounded",children:n("default")}),a.description&&(0,d.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:a.description})]})]},a.number))})]}),j&&(0,d.jsxs)("div",{className:"mt-3",children:[(0,d.jsx)("label",{htmlFor:`text-input-${m}`,className:"sr-only",children:n("customValueInput")}),(0,d.jsx)("input",{id:`text-input-${m}`,type:"text",value:g,onChange:a=>i(a.target.value),disabled:b,placeholder:n("enterValuePlaceholder"),className:"w-full px-4 py-2 border-2 border-input dark:bg-muted dark:text-foreground rounded-lg focus:outline-none focus:border-accent-500 disabled:opacity-50"})]}),(0,d.jsx)("button",{type:"button",onClick:l,disabled:b||null===c,className:`w-full ${iQ} ${iR}`,children:n("submit")})]})}function i_({promptData:a,disabled:b,checkedNumbers:c,onToggleOption:f,textInputValue:g,onTextInputChange:i,showTextInput:j,onSubmit:l}){let m=(0,e.useId)(),n=(0,h.c)("prompt"),o=(0,e.useCallback)(a=>{let c=b?"opacity-50 cursor-not-allowed":"";return`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all ${a?"bg-accent-50 dark:bg-accent-900/30 border-2 border-accent-500":"bg-surface border-2 border-border hover:border-input"} ${c}`},[b]),p=0===c.length,q=j&&""===g.trim();return(0,d.jsxs)("div",{className:"space-y-3","data-testid":"multi-select-prompt-actions",children:[(0,d.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"multi-select-hint",children:n("multiSelectHint")}),(0,d.jsxs)("fieldset",{children:[(0,d.jsx)("legend",{className:"sr-only",children:n("selectAllThatApply")}),(0,d.jsx)("div",{role:"group","aria-label":n("selectAllThatApply"),className:"flex flex-col gap-2",children:a.options.map(a=>{let e=c.includes(a.number);return(0,d.jsxs)("label",{className:o(e),children:[(0,d.jsx)(k.Sc,{checked:e,onCheckedChange:b=>f(a.number,!0===b),disabled:b,className:"mt-1","data-testid":`multi-select-option-${a.number}`,"aria-label":`${a.number}. ${a.label}`}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("span",{className:"font-medium",children:[a.number,". ",a.label]}),a.description&&(0,d.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:a.description})]})]},a.number)})})]}),j&&(0,d.jsxs)("div",{className:"mt-3",children:[(0,d.jsx)("label",{htmlFor:`multi-text-input-${m}`,className:"sr-only",children:n("customValueInput")}),(0,d.jsx)("input",{id:`multi-text-input-${m}`,type:"text",value:g,onChange:a=>i(a.target.value),disabled:b,placeholder:n("enterValuePlaceholder"),className:"w-full px-4 py-2 border-2 border-input dark:bg-muted dark:text-foreground rounded-lg focus:outline-none focus:border-accent-500 disabled:opacity-50"})]}),(0,d.jsx)("button",{type:"button","data-testid":"multi-select-submit",onClick:l,disabled:b||p||q,className:`w-full ${iQ} ${iR}`,children:n("submit")})]})}let i0=(0,e.memo)(function({promptData:a,messageId:b,decisionId:c,visible:f,answering:g,onRespond:h,onDismiss:i,cliToolName:j,showStuckHint:k,onSwitchToDirectInput:l,answerable:m,autoYesEnterSent:n}){let o,{shouldRender:p,animationClass:q}=I({visible:f&&null!==a,duration:200}),r=(0,e.useId)();if(!p||!a)return null;let s=(o="opacity-100","animate-fade-in"===q?o="opacity-100 transform translate-y-0":"animate-fade-out"===q&&(o="opacity-0 transform translate-y-2"),`bg-warning-subtle border-2 border-warning-border rounded-lg p-4 shadow-lg transition-all duration-200 ease-in-out ${q} ${o}`);return(0,d.jsx)(G.t,{componentName:"PromptPanel",children:(0,d.jsxs)("div",{"data-testid":"prompt-panel",role:"dialog","aria-labelledby":r,"aria-modal":"true",className:s,children:[(0,d.jsx)(iU,{promptData:a,answering:g,onRespond:h,decisionId:c,onDismiss:i,labelId:r,cliToolName:j,answerable:m}),(0,d.jsx)(Y,{showStuckHint:k,onSwitchToDirectInput:l,answerable:m,autoYesEnterSent:n,linkClassName:"underline font-medium hover:no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-warning-border rounded"})]})})});var i1=c(80132);let i2=(0,x.A)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]),i3=(0,x.A)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),i4=(0,e.memo)(function({worktreeId:a,cliToolId:b,instanceId:c,diff:f,disabled:g=!1}){let i=(0,h.c)("worktree"),j=(0,k.SC)(),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(null),r=f?.revertedMessageId!=null,s=(0,e.useMemo)(()=>r?f?.revertedFiles??[]:f?.files??[],[r,f]),t=(0,e.useCallback)(async d=>{o(null),m(d);try{let e=await fetch(`/api/worktrees/${a}/opencode/diff`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:d,instanceId:c??b})}),f=await e.json().catch(()=>({}));if(409===e.status&&"SESSION_BUSY"===f.code)return void o("busy");if(!e.ok)return void o("failed");!1===f.applied&&o("noop")}catch{o("failed")}finally{m(null)}},[a,b,c]),u=(0,e.useCallback)(async()=>{await j({title:i("opencodeDiff.revertConfirmTitle"),description:i("opencodeDiff.revertConfirmBody",{count:s.length}),confirmLabel:i("opencodeDiff.revertConfirmLabel"),variant:"danger"})&&await t("revert")},[j,i,s.length,t]),v=(0,e.useCallback)(async()=>{await j({title:i("opencodeDiff.unrevertConfirmTitle"),description:i("opencodeDiff.unrevertConfirmBody",{count:s.length}),confirmLabel:i("opencodeDiff.unrevertConfirmLabel")})&&await t("unrevert")},[j,i,s.length,t]);return"opencode"!==b?null:f&&(f.files.length>0||f.revertedFiles.length>0)?(0,d.jsxs)("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs","data-testid":"opencode-turn-diff-panel",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(i2,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,d.jsx)("span",{className:"font-medium text-foreground",children:r?i("opencodeDiff.revertedTitle"):i("opencodeDiff.title")}),(0,d.jsx)("span",{className:"text-muted-foreground",children:r?i("opencodeDiff.revertedSubtitle",{count:s.length}):i("opencodeDiff.subtitle",{count:s.length})}),(0,d.jsxs)("span",{className:"ml-auto flex items-center gap-1",children:[null!==l?(0,d.jsx)(k.y$,{size:"sm"}):null,r?(0,d.jsxs)(k.$n,{variant:"ghost",size:"sm",onClick:v,disabled:g||null!==l,children:[(0,d.jsx)(i3,{className:"mr-1 h-3.5 w-3.5","aria-hidden":"true"}),i("opencodeDiff.unrevert")]}):(0,d.jsxs)(k.$n,{variant:"ghost",size:"sm",onClick:u,disabled:g||null!==l,children:[(0,d.jsx)(dS.A,{className:"mr-1 h-3.5 w-3.5","aria-hidden":"true"}),i("opencodeDiff.revert")]})]})]}),null!==n?(0,d.jsx)("p",{className:"mt-1 text-danger-foreground",role:"status",children:i(`opencodeDiff.${n}`)}):null,(0,d.jsx)("ul",{className:"mt-1 space-y-0.5",children:s.map((a,b)=>{let c=a.file??i("opencodeDiff.unnamedFile"),e=function(a){let b=[];return a.additions>0&&b.push(`+${a.additions}`),a.deletions>0&&b.push(`−${a.deletions}`),b.join(" ")}(a);return(0,d.jsxs)("li",{className:"flex items-center gap-2",children:[null!==a.patch&&null!==a.file?(0,d.jsx)("button",{type:"button",className:"truncate text-info underline-offset-2 hover:underline",onClick:()=>q(a),title:i("opencodeDiff.openDiff",{file:c}),children:c}):(0,d.jsx)("span",{className:"truncate text-muted-foreground",children:c}),null!==a.status?(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground",children:i(`opencodeDiff.status.${a.status}`)}):null,""!==e?(0,d.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground",children:e}):null]},`${a.file??"unnamed"}-${b}`)})}),(0,d.jsx)(k.Jh,{isOpen:null!==p,onClose:()=>q(null),title:p?.file??void 0,size:"xl",children:null!==p?(0,d.jsx)(ih,{diff:p.patch??"",filePath:p.file??"",onClose:()=>q(null)}):null})]}):null});var i5=c(12712),i6=c(18219),i7=c(15783);function i8(a,b,c,d){let e={answer:a,cliTool:b};if(d&&d!==b&&(e.instanceId=d),c&&(e.promptType=c.type,"multiple_choice"===c.type)){let a=c.options.find(a=>a.isDefault);a&&(e.defaultOptionNumber=a.number),c.submitMode&&(e.submitMode=c.submitMode)}return e}function i9(a,b,c,d){return{decisionId:a,answer:b,cliTool:c,...d&&d!==c?{instanceId:d}:{}}}var ja=c(1401);function jb(a,b){let c=a.target instanceof Element?a.target:null,d=c?.closest("[data-split-index]");if(d){if(Number(d.getAttribute("data-split-index"))!==b)return!1}else if(0!==b||c?.closest('input, textarea, select, [contenteditable="true"]'))return!1;return!0}let jc=(0,e.memo)(function({worktreeId:a,splitIndex:b,cliToolId:c,instanceId:g,instance:i,availableInstances:j,onInstanceChange:k,onFocus:l,disabled:m=!1,pendingInsertText:n,onInsertConsumed:o,onMessageSent:p,cliStatus:q="idle",cliStatusUnclassified:r=!1,autoYes:s,autoYesBlockedByContract:t=!1,autoYesReleasedByRestart:u=!1,autoYesAnswerMode:v,history:w,onDropInstance:x,draggedInstanceId:y,onRequestSessionEnd:z,agentModel:A,onAgentSessionChange:B,isMaximized:C=!1,onToggleMaximize:D,maximizeDisabled:E=!1,showFocusFrame:G=!1,branchName:H}){let I=g??c,J=s.enabled??!1,K=s.expiresAt??null,M=s.lastAutoResponse??null,N=s.onToggle,O=w?.showArchived??!1,P=w?.onShowArchivedChange,Q=w?.historyDisplayLimit,S=w?.onHistoryDisplayLimitChange,T=w?.historyUserOnly??!1,V=w?.onHistoryUserOnlyChange,W=w?.onInsertToMessage,X=w?.onFilePathClick,Y=w?.showToast,Z=(0,h.c)("worktree"),$=(0,bG.Ym)(),[_,aa]=(0,e.useState)(null),[ab,ac]=(0,e.useState)(null),ad=(0,i6.b4)(_,ab,i7.LA),ae=(0,e.useMemo)(()=>(0,i7.h0)(b),[b]),{surfaceMode:af,handleSurfaceModeChange:ag}=dj((0,e.useMemo)(()=>(0,di.$2)(a,b),[a,b])),ai=(0,e.useRef)(af);ai.current=af,(0,e.useEffect)(()=>{function a(a){a.shiftKey&&!a.altKey&&(a.metaKey||a.ctrlKey)&&"m"===a.key.toLowerCase()&&jb(a,b)&&(a.preventDefault(),ag("chat"===ai.current?"terminal":"chat"))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[b,ag]);let aj=(0,e.useRef)(D);aj.current=D;let ak=(0,e.useRef)(E);ak.current=E,(0,e.useEffect)(()=>{function a(a){if(!a.shiftKey||a.altKey||!a.metaKey&&!a.ctrlKey||"Enter"!==a.key||!jb(a,b))return;let c=aj.current;c&&(ak.current||(a.preventDefault(),c()))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[b]);let{terminal:am,prompt:an,agentSession:ao,setAutoScroll:ap,setPromptAnswering:aq,clearPrompt:ar,refresh:as}=(0,c$.NK)({worktreeId:a,cliToolId:c,instanceId:I,enabled:!m}),at=(0,cM.Bj)((0,cM.qi)(a,I),am.startingSince),au=at.starting,[ax,ay]=(0,e.useState)(!1);(0,e.useEffect)(()=>{ay(!1)},[a,c,I]),(0,e.useEffect)(()=>{am.isRunning||ay(!1)},[am.isRunning]);let az=Z("directInput.toggle"),aA=Z("directInput.toggleAria"),aB=(0,e.useCallback)(()=>{ay(a=>!a)},[]),aC=(0,e.useCallback)(()=>{ay(!1)},[]),aD=function({visible:a,isStarting:b,autoYesEnabled:c,data:d,answerable:e,autoYesDecision:f}){return a&&!b&&(!c||R(d,e,f))}({visible:an.visible,isStarting:au,autoYesEnabled:J,data:an.data,answerable:an.answerable,autoYesDecision:an.autoYesDecision}),aF=(0,e.useContext)(im),aG=aD&&!aF,{showStuckHint:aH,markSubmitted:aI}=(0,i1.Cb)({promptData:aG?an.data:null,targetKey:`${a}:${c}:${I}`}),aJ=(0,e.useCallback)(()=>{ay(!0)},[]),{messages:aK,isLoading:aL,refresh:aM}=(0,c_.Md)({worktreeId:a,cliToolId:c,instanceId:I,limit:Q,includeArchived:O,enabled:!m}),{messages:aN,sendOptimistic:aO,retry:aP,discard:aQ}=c2({worktreeId:a,serverMessages:aK,onSent:aM}),{visible:aR,width:aS,toggle:aT,setWidth:aU}=(0,iu.TG)(),aV=f().useRef(null),aW=(0,e.useCallback)(a=>{let b=aV.current;if(!b)return;let c=b.offsetWidth;0!==c&&aU(aS+a/c*100)},[aS,aU]),aX="opencode"===c||"copilot"===c,{compactTuiLayoutPadding:aY,preservePaintedPanelRows:aZ}=(0,e.useMemo)(()=>(0,dh.EK)(c),[c]),a$=(0,e.useCallback)(a=>ap(a),[ap]),a_=(0,e.useCallback)(a=>{as(),aM(),p?.(a)},[as,aM,p]),a2=c3(aQ,W),a3=(0,e.useCallback)(async(b,d)=>{let e;aI(),aq(!0);try{let f=d?i9(d,b,c,I):i8(b,c,F(an.data)?an.data:null,I),g=await fetch(d?`/api/worktrees/${a}/respond`:`/api/worktrees/${a}/prompt-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});e=await (0,ja.a_)(g)}catch(a){console.error("[TerminalSplitPaneContent] prompt response error:",a),e="failed"}try{if("answered"===e)ar();else{let a=ja.J4[e];Y?.(Z(a.messageKey),a.type)}await as()}finally{aq(!1)}},[a,c,I,an.data,aq,ar,as,Y,Z,aI]),a4=(0,e.useCallback)(()=>{ar()},[ar]),a5="chat"===af,a6=am.isSelectionListActive,a7=function({isSelectionListFrame:a,isChatSurface:b,isStarting:c}){return a&&!b&&!c}({isSelectionListFrame:a6,isChatSurface:a5,isStarting:au}),a8="running"===am.sessionStatus&&!r,a9=(0,L.ds)(an.data)?.decisionId??null,ba=(0,e.useMemo)(()=>U(an.data,c),[an.data,c]),bb=function({isUnclassifiedActive:a,isSelectionListFrame:b,promptVisible:c,isChatSurface:d,isStarting:e}){return a&&!b&&!c&&!d&&!e}({isUnclassifiedActive:am.isUnclassifiedActive,isSelectionListFrame:a6,promptVisible:an.visible,isChatSurface:a5,isStarting:au}),bc=cO(am.composerText),bd=cV(c,am.realtimeSnippet||am.output),be=(0,e.useMemo)(()=>({messages:aN,worktreeId:a,onFilePathClick:X??(()=>{}),isLoading:aL,className:"h-full",showToast:Y,onInsertToMessage:W,onRetryPending:aP,onDiscardPending:a2,showArchived:O,onShowArchivedChange:P,historyDisplayLimit:Q,onHistoryDisplayLimitChange:S,historyUserOnly:T,onHistoryUserOnlyChange:V,splitIndex:b,cliToolId:c}),[aN,aP,a2,a,X,aL,Y,W,O,P,Q,S,T,V,b,c]),bf=(0,e.useMemo)(()=>(0,d.jsx)(ds.bl,{...be,onCollapse:aT}),[be,aT]),bg=(0,e.useMemo)(()=>at.noticeVisible&&null!==at.startingSince?(0,d.jsx)(cL.TE,{cliToolId:c,startingSince:at.startingSince,onShowTerminal:at.revealTerminal}):(0,d.jsx)(cJ.D,{output:am.output,isActive:am.isRunning,attaching:am.attaching,isThinking:am.isThinking,autoScroll:am.autoScroll,onScrollChange:a$,disableAutoFollow:aX,compactTuiLayoutPadding:aY,preservePaintedPanelRows:aZ}),[at.noticeVisible,at.revealTerminal,at.startingSince,c,am.output,am.isRunning,am.attaching,am.isThinking,am.autoScroll,a$,aX,aY,aZ]),bh=cZ(am,an),bi=a5&&(0,cY.BM)(bh,am.output,c),bj=(0,e.useMemo)(()=>(0,d.jsx)("div",{"data-testid":`split-chat-slot-${b}`,"aria-label":Z("surfaceMode.chatSurfaceLabel"),className:"flex h-full min-h-0 w-full overflow-hidden bg-surface text-surface-foreground",children:(0,d.jsx)("div",{className:"min-w-0 min-h-0 flex-1 overflow-hidden",children:(0,d.jsx)(cY.wY,{messages:be.messages,worktreeId:a,cliToolId:c,instanceId:I,history:be,live:bh,onSurfaceModeChange:ag,frame:am.output,onKeysSent:as})})}),[be,b,Z,a,c,I,bh,am.output,as,ag]),bk=(0,e.useMemo)(()=>aR?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{id:(0,ds.Ce)(b),"data-testid":`split-history-slot-${b}`,"aria-label":"History pane",style:{width:`${aS}%`},className:"flex-shrink-0 overflow-hidden min-h-0",children:bf}),(0,d.jsx)(hG.f,{onResize:aW,orientation:"horizontal",ariaValueNow:aS})]}):null,[aR,aS,bf,aW,b]),bl=(0,e.useMemo)(()=>(0,d.jsxs)("div",{ref:aV,"data-testid":`split-terminal-row-${b}`,className:"flex h-full min-h-0 w-full",children:[bk,(0,d.jsx)("div",{"data-testid":`split-terminal-slot-${b}`,style:aR?void 0:{width:"100%"},className:"flex-grow overflow-hidden min-w-0 min-h-0 relative",children:bg})]}),[aR,bk,bg,b]),bm=(0,e.useMemo)(()=>(0,d.jsxs)("div",{ref:aV,"data-testid":`split-chat-row-${b}`,className:"flex h-full min-h-0 w-full",children:[bk,(0,d.jsx)("div",{"data-testid":`split-chat-output-${b}`,style:aR?void 0:{width:"100%"},className:"flex-grow overflow-hidden min-w-0 min-h-0",children:bj})]}),[aR,bk,bj,b]),{text:bn,aria:bo}=function(a,b,c,d){let e=(0,al.sw)(b??{cliTool:c}),f=d?.trim()?d.trim():null;return{text:f?a("terminal.composerTarget",{agent:e,branch:f}):a("terminal.composerTargetNoBranch",{agent:e}),aria:f?a("terminal.composerTargetLabel",{agent:e,branch:f}):a("terminal.composerTargetLabelNoBranch",{agent:e})}}(Z,i,c,H),bp=(0,e.useMemo)(()=>(0,d.jsxs)("div",{ref:ac,className:"space-y-2","data-testid":`split-footer-${b}`,children:[a7?(0,d.jsx)(a1.Z,{worktreeId:a,cliToolId:c,instanceId:I,onKeysSent:as,frame:am.output,surface:"terminal",showPagerKeys:am.isPagerActive}):null,bb?(0,d.jsx)(cK.U,{worktreeId:a,cliToolId:c,instanceId:I,onKeysSent:as}):null,bc?(0,d.jsx)(cP,{worktreeId:a,cliToolId:c,instanceId:I,composerText:am.composerText,onActionSent:as}):null,bd?(0,d.jsx)(cW,{cliToolId:c,frame:am.realtimeSnippet||am.output}):null,aD?(0,d.jsx)(i0,{promptData:ba,messageId:an.messageId,decisionId:a9,visible:an.visible,answering:an.answering,onRespond:a3,onDismiss:a4,cliToolName:(0,al.oo)(c),showStuckHint:aH,onSwitchToDirectInput:am.isRunning?aJ:void 0,answerable:an.answerable,autoYesEnterSent:an.autoYesEnterSent}):null,am.isRunning&&!bi?(0,d.jsx)(cX.XU,{worktreeId:a,cliToolId:c,instanceId:I,hasAgentSession:null!==ao.session,onKeysSent:as,collapsible:!0,layout:"desktop"}):null,(0,d.jsx)(i4,{worktreeId:a,cliToolId:c,instanceId:I,diff:ao.diff,disabled:!am.isRunning}),ax?(0,d.jsx)(iP,{worktreeId:a,cliToolId:c,instanceId:I,onKeysSent:as,onClose:aC}):null,(0,d.jsxs)("div",{className:"relative","data-testid":`split-composer-${b}`,children:[(0,d.jsx)("div",{"data-testid":`split-composer-target-${b}`,"aria-label":bo,title:bo,className:"pointer-events-none absolute left-3 top-0 z-10 max-w-[calc(100%-1.5rem)] -translate-y-1/2 truncate rounded-sm bg-surface-2 px-1 text-[11px] leading-none text-muted-foreground",children:bn}),(0,d.jsx)(a0.E,{worktreeId:a,onMessageSent:a_,onOptimisticSend:aO,cliToolId:c,instanceId:I,isSessionRunning:am.isRunning,isSessionStarting:au,pendingInsertText:n??null,onInsertConsumed:o,splitIndex:b,onFocus:l,heightScope:ae,maxHeight:ad,isProcessing:a8,showToast:Y,agentModeSlot:(0,d.jsx)(iO,{worktreeId:a,cliToolId:c,instanceId:I,agentMode:am.agentMode,sessionStatus:am.sessionStatus,isPromptWaiting:an.visible,isSelectionListActive:am.isSelectionListActive,isDismissablePanelActive:am.isDismissablePanelActive,isUnclassifiedActive:am.isUnclassifiedActive,onKeysSent:as}),autoYesSlot:(0,d.jsx)(i5.T,{enabled:J,expiresAt:K??null,onToggle:N,lastAutoResponse:M??null,cliToolName:c,inline:!0,blockedByContract:t,releasedByRestart:u,answerMode:v}),directInputSlot:(0,d.jsxs)("button",{type:"button","data-testid":"direct-input-toggle","aria-pressed":ax,"aria-label":aA,title:aA,disabled:!am.isRunning,onClick:aB,className:`shrink-0 inline-flex items-center gap-1 h-[22px] px-1 @min-[520px]:px-2 rounded-md border text-[11px] font-medium leading-none whitespace-nowrap transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${ax?"bg-info-subtle border-info-border text-info-foreground":"bg-surface border-border text-muted-foreground hover:bg-muted"}`,children:[(0,d.jsx)(ah.A,{size:14,"aria-hidden":"true",className:"shrink-0"}),(0,d.jsx)("span",{className:"hidden @min-[520px]:inline","data-testid":"direct-input-toggle-label",children:az})]})})]})]}),[a7,aD,bb,bc,bd,am.realtimeSnippet,am.output,ao.session,bi,am.composerText,am.agentMode,am.sessionStatus,am.isSelectionListActive,am.isDismissablePanelActive,am.isUnclassifiedActive,am.isPagerActive,a,c,I,as,ba,an.messageId,a9,an.visible,an.answering,an.answerable,an.autoYesEnterSent,a3,a4,aH,aJ,a_,aO,am.isRunning,au,a8,n,o,b,l,J,K,t,u,v,M,N,ax,aB,aC,az,aA,Y,ae,ad,ao.diff,bn,bo]),bq=(0,al.sw)(i??{cliTool:c}),br=(0,e.useCallback)(()=>{z?.({cliToolId:c,instanceId:I,label:bq})},[z,c,I,bq]),bs=(0,e.useMemo)(()=>{if(!z||!am.isRunning)return null;let a=Z("terminal.endSessionFor",{name:bq});return(0,d.jsx)(aw.m_,{content:a,placement:"bottom",children:(0,d.jsx)("button",{type:"button",onClick:br,"aria-label":a,"data-testid":`terminal-end-session-button-${b}`,className:"flex items-center justify-center p-0.5 rounded text-muted-foreground hover:text-danger focus:text-danger hover:bg-danger/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-danger/50 transition-colors",children:(0,d.jsx)(av.A,{size:14,"aria-hidden":"true"})})})},[z,am.isRunning,Z,bq,br,b]);(0,e.useEffect)(()=>{B?.(I,ao)},[B,I,ao]);let{model:bt,usage:bu,usageDetail:bv}=dk(A,ao,Z,$);return(0,d.jsx)(aE,{worktreeId:a,splitIndex:b,cliToolId:c,instanceId:I,instance:i,availableInstances:j,onInstanceChange:k,headerExtras:bs,status:q,statusUnclassified:r,agentModel:bt,agentUsage:bu,agentUsageDetail:bv,onFocus:l,attaching:am.attaching,surfaceMode:af,onSurfaceModeChange:ag,isMaximized:C,onToggleMaximize:D,maximizeDisabled:E,showFocusFrame:G,onEndSession:z&&am.isRunning?br:void 0,terminal:"chat"===af?bm:bl,footer:bp,bodyRef:aa,onDropInstance:x,draggedInstanceId:y})}),jd=bo.M.MODAL;function je(a){return!!a&&!!a.isConnected&&("function"!=typeof a.checkVisibility||a.checkVisibility())}function jf(a,b){let c=(0,e.useRef)(null);return(null!==a&&b&&b.length>0&&(c.current={runId:a.id,gates:b}),b&&b.length>0)?b:null!==a&&c.current?.runId===a.id?c.current.gates:null}let jg=(0,e.memo)(function({task:a,latestRun:b,latestRunGates:c,onOpen:f,paneOpen:g=!1,className:i="",popover:j="inline"}){var k;let l=(0,h.c)("worktree"),[m,n]=(0,e.useState)(!1),o=(0,e.useRef)(null),p=(0,e.useRef)(null),[q,r]=(0,e.useState)(null),s=(0,e.useId)(),t=jf(b,c),u=(0,e.useMemo)(()=>{let c=[a?l("verification.chip.taskReason",{title:a.title,status:l(`task.status.${a.status}`)}):l("verification.chip.noTask")];if(b){if(c.push(l("verification.chip.runReason",{verdict:l(`verification.runStatus.${b.status}`),runId:b.id})),c.push(l(`verification.runStatusGloss.${b.status}`)),t&&t.length>0){let a=t.filter(a=>gb.includes(a.status));c.push(a.length>0?l("verification.chip.failingGates",{gates:a.map(a=>a.gateId).join(", ")}):l("verification.chip.gatesPassed",{count:t.length}))}}else c.push(l("verification.chip.noRun"));return c.push(l(g?"verification.chip.closeHint":"verification.chip.openHint")),c},[a,b,t,g,l]),v=u.join(" \xb7 "),w=(0,e.useCallback)(()=>{n(!1),f()},[f]),x=(0,e.useRef)(null),y=(0,e.useRef)(null),z=(0,e.useCallback)(()=>{let a=p.current??y.current;return null!==a&&(0,bw.DO)(a)},[]),A=(0,e.useCallback)(()=>{m||x.current?.focus(),n(!m)},[m]),C=(0,e.useCallback)(a=>{m&&(0,bw.V$)(a.nativeEvent)&&(z()||(a.preventDefault(),n(!1)))},[m,z]);(0,e.useEffect)(()=>{if(!m)return;let a=a=>{!(o.current?.contains(a.target)||p.current?.contains(a.target))&&je(o.current)&&n(!1)},b=a=>{(0,bw.V$)(a)&&(z()||((0,bw.sr)(a),n(!1)))};return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)}},[m,z]),(0,e.useLayoutEffect)(()=>{if(!m||"floating"!==j)return void r(null);let a=0,b=()=>{let a=o.current;if(!a||!je(a))return void r(a=>null===a?a:null);let b=function(a){let b=Math.max(8,Math.min(a.left,8));return{top:a.bottom+4,left:b,width:272}}(a.getBoundingClientRect());r(a=>a&&a.top===b.top&&a.left===b.left&&a.width===b.width?a:b)},c=()=>{b(),a=window.requestAnimationFrame(c)};return b(),a=window.requestAnimationFrame(c),()=>window.cancelAnimationFrame(a)},[m,j]);let D=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"mb-1 font-semibold",children:l("verification.chip.reasonHeading")}),(0,d.jsx)("ul",{className:"space-y-1",children:u.map(a=>(0,d.jsx)("li",{className:"break-words",children:a},a))})]});return(0,d.jsxs)("div",{ref:o,"data-activity-entry":"verification",onKeyDown:C,className:`relative inline-flex max-w-full ${i}`.trim(),children:[(0,d.jsxs)("div",{className:"inline-flex min-w-0 max-w-full grow items-center gap-1 rounded-full border border-border bg-surface-2 pr-1 text-xs text-foreground",children:[(0,d.jsxs)("button",{type:"button",onClick:w,"data-testid":"verification-status-chip","aria-label":v,title:v,className:"inline-flex min-w-0 flex-1 items-center gap-1.5 rounded-full px-2 py-1 transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:[(0,d.jsx)(cl.A,{size:14,"aria-hidden":"true",className:"flex-shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"truncate font-medium","data-testid":"verification-chip-title",children:a?(k=a.title,k.length<=36?k:`${k.slice(0,35)}…`):l("verification.title")}),a&&(0,d.jsx)(f6.E,{variant:f8[a.status],className:"flex-shrink-0 px-1.5 py-0","data-testid":"verification-chip-task-status",children:l(`task.status.${a.status}`)}),(0,d.jsx)(f6.E,{variant:b?f9[b.status]:"gray",className:"flex-shrink-0 px-1.5 py-0 font-mono","data-testid":"verification-chip-run-status",children:b?l("verification.chip.resultBadge",{verdict:l(`verification.runStatus.${b.status}`)}):l("verification.chip.unverified")})]}),(0,d.jsx)("button",{type:"button",ref:x,onClick:A,"data-testid":"verification-chip-reason-toggle","aria-expanded":m,"aria-controls":s,"aria-label":l(m?"verification.chip.hideReason":"verification.chip.showReason"),className:"inline-flex min-h-[32px] min-w-[32px] flex-shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring touch-manipulation",children:(0,d.jsx)(B.A,{size:14,"aria-hidden":"true"})})]}),m&&"inline"===j&&(0,d.jsx)("div",{ref:y,id:s,role:"tooltip","data-testid":"verification-chip-reason-popover",style:{zIndex:jd},className:"absolute left-0 top-full mt-1 w-72 max-w-[80vw] rounded-lg border border-border bg-surface p-3 text-xs leading-relaxed text-foreground shadow-lg",children:D}),m&&"floating"===j&&"undefined"!=typeof document&&(0,ak.createPortal)((0,d.jsx)("div",{ref:p,id:s,role:"tooltip","data-testid":"verification-chip-reason-popover","data-floating-layer":"true",style:q?{top:q.top,left:q.left,width:q.width,zIndex:jd}:{visibility:"hidden",zIndex:jd},className:"fixed rounded-lg border border-border bg-surface p-3 text-xs leading-relaxed text-foreground shadow-lg",children:D}),document.body)]})}),jh=(0,e.memo)(function({isBranchMismatch:a,currentBranch:b,initialBranch:c}){let f=(0,h.c)("worktree"),[g,i]=(0,e.useState)(!1);return((0,e.useEffect)(()=>{i(!1)},[b]),!a||g||null===c)?null:(0,d.jsxs)("div",{"data-testid":"branch-mismatch-alert",role:"alert",className:"flex items-center gap-3 px-4 py-2 bg-warning-subtle border border-warning-border text-warning-foreground rounded-lg",children:[(0,d.jsx)(e0.A,{className:"w-5 h-5 text-warning flex-shrink-0"}),(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsxs)("span",{className:"text-sm",children:[f("branchMismatch.changedFrom")," ",(0,d.jsx)("span",{className:"font-medium",children:c})," ",f("branchMismatch.to")," ",(0,d.jsx)("span",{className:"font-medium",children:b})]})}),(0,d.jsx)("button",{type:"button",onClick:()=>i(!0),className:"p-1 rounded hover:bg-warning-subtle transition-colors","aria-label":f("branchMismatch.dismiss"),children:(0,d.jsx)(av.A,{className:"w-4 h-4"})})]})});var ji=c(15350),jj=c(15917);let jk=(0,e.memo)(function({isOpen:a,onClose:b,onConfirm:c,worktreeId:f,sourcePath:g,sourceType:i}){let j=(0,h.c)("worktree"),l=(0,h.c)("common"),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(new Set([""])),[q,r]=(0,e.useState)([]),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(new Set),w=g.includes("/")?g.substring(0,g.lastIndexOf("/")):"";(0,e.useEffect)(()=>{a&&(n(w),p(new Set([""])),r([]),x())},[a,f]);let x=(0,e.useCallback)(async()=>{t(!0);try{let a=await fetch(`/api/worktrees/${f}/tree`);if(!a.ok)return;let b=(await a.json()).items.filter(a=>"directory"===a.type).map(a=>({name:a.name,path:a.name,loaded:!1}));r(b)}catch{}finally{t(!1)}},[f]),y=(0,e.useCallback)(async a=>{v(b=>new Set(b).add(a));try{let b=await fetch(`/api/worktrees/${f}/tree/${a}`);if(!b.ok)return;let c=(await b.json()).items.filter(a=>"directory"===a.type).map(b=>({name:b.name,path:`${a}/${b.name}`,loaded:!1}));r(b=>(function a(b,c,d){return b.map(b=>b.path===c?{...b,children:d,loaded:!0}:b.children?{...b,children:a(b.children,c,d)}:b)})(b,a,c))}catch{}finally{v(b=>{let c=new Set(b);return c.delete(a),c})}},[f]),z=(0,e.useCallback)(async a=>{p(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c});let b=function a(b,c){for(let d of b){if(d.path===c)return d;if(d.children){let b=a(d.children,c);if(b)return b}}return null}(q,a);b&&!b.loaded&&await y(a)},[q,y]),A=(0,e.useCallback)(a=>!(a===w||"directory"===i&&(a===g||a.startsWith(g+"/")))&&!0,[w,g,i]),B=(a,b=0)=>{let c=o.has(a.path),e=m===a.path,f=u.has(a.path),g=A(a.path);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`flex items-center gap-1 py-1.5 px-2 cursor-pointer rounded text-sm transition-colors ${e?"bg-accent-100 text-accent-800":"hover:bg-muted text-foreground"} ${!g?"opacity-40 cursor-not-allowed":""}`,style:{paddingLeft:`${.5+1.25*b}rem`},onClick:()=>{g&&n(a.path)},children:[(0,d.jsx)("button",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",onClick:b=>{b.stopPropagation(),z(a.path)},children:f?(0,d.jsx)(k.y$,{size:"xs",variant:"muted"}):(0,d.jsx)(e6.A,{className:`w-3 h-3 text-muted-foreground transition-transform ${c?"rotate-90":""}`})}),c?(0,d.jsx)(ji.A,{className:"w-4 h-4 text-warning flex-shrink-0"}):(0,d.jsx)(jj.A,{className:"w-4 h-4 text-warning flex-shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]}),c&&a.children&&(0,d.jsx)("div",{children:a.children.map(a=>B(a,b+1))})]},a.path)},C=A(m);return(0,d.jsx)(b_.a,{isOpen:a,onClose:b,title:j("fileTree.moveDialogTitle"),size:"md",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"text-sm text-muted-foreground",children:[j("fileTree.moveTo"),": ",(0,d.jsx)("span",{className:"font-mono text-foreground",children:g})]}),(0,d.jsxs)("div",{className:"border border-border rounded-lg max-h-64 overflow-y-auto p-2",children:[(0,d.jsxs)("div",{className:`flex items-center gap-1 py-1.5 px-2 cursor-pointer rounded text-sm transition-colors ${""===m?"bg-accent-100 text-accent-800":"hover:bg-muted text-foreground"} ${!A("")?"opacity-40 cursor-not-allowed":""}`,onClick:()=>{A("")&&n("")},children:[(0,d.jsx)("span",{className:"w-4 h-4"}),(0,d.jsx)(jj.A,{className:"w-4 h-4 text-warning flex-shrink-0"}),(0,d.jsx)("span",{children:j("fileTree.rootDirectory")})]}),s?(0,d.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,d.jsx)(k.y$,{size:"md",variant:"muted"})}):q.map(a=>B(a,1))]}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)(k.$n,{variant:"ghost",onClick:b,className:"px-4 py-2 text-sm text-foreground bg-white border border-border rounded-md hover:bg-muted transition-colors",children:l("cancel")}),(0,d.jsx)(k.$n,{variant:"ghost",onClick:()=>c(m),disabled:!C,className:"px-4 py-2 text-sm text-white bg-accent-600 rounded-md hover:bg-accent-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:j("fileTree.moveConfirm")})]})]})})});function jl(a,b){let c=a.trim();return c?0>=c.lastIndexOf(".")?c+b:c:""}let jm=(0,e.memo)(function({isOpen:a,parentPath:b,onConfirm:c,onCancel:f}){let g=(0,h.c)("worktree"),i=(0,h.c)("common"),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(".md"),n=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(a){k(""),m(".md");let a=setTimeout(()=>{n.current?.focus()},100);return()=>clearTimeout(a)}},[a]);let o=(0,e.useCallback)(()=>{let a=jl(j,l);a&&c(a)},[j,l,c]),p=(0,e.useCallback)(a=>{"Enter"!==a.key||a.nativeEvent.isComposing||(a.preventDefault(),o())},[o]),q=jl(j,l),r=b?`${b}/${q}`:q;return(0,d.jsx)(b_.a,{isOpen:a,onClose:f,title:g("newFileDialog.title"),size:"sm",children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"new-file-name",className:"block text-sm font-medium text-foreground mb-1",children:g("newFileDialog.fileNameLabel")}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("input",{ref:n,id:"new-file-name","data-testid":"new-file-name-input",type:"text",value:j,onChange:a=>k(a.target.value),onKeyDown:p,placeholder:g("newFileDialog.placeholder"),className:"flex-1 px-3 py-2 border border-input rounded-lg bg-surface text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),(0,d.jsx)("select",{"data-testid":"new-file-ext-select",value:l,onChange:a=>m(a.target.value),className:"px-3 py-2 border border-input rounded-lg bg-surface text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",children:bi.map(a=>(0,d.jsx)("option",{value:a,children:a},a))})]})]}),q&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground font-mono bg-muted rounded px-2 py-1",children:r}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:f,className:"px-4 py-2 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg transition-colors",children:i("cancel")}),(0,d.jsx)("button",{type:"button","data-testid":"new-file-confirm-button",onClick:o,disabled:!q,className:"px-4 py-2 text-sm font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-lg transition-colors",children:g("newFileDialog.create")})]})]})})}),jn=['[data-testid="header-tool-bar"]',"[data-activity-entry]",'[data-testid="split-action-bar-items-overflow"]'],jo=(0,e.memo)(function({worktreeId:a,worktree:b,worktreeName:c,worktreeStatus:g,instances:i,rosterReady:j,activeInstanceId:k,setActiveInstanceId:l,instanceSelectionRequest:m=null,onInstanceSelectionHandled:n,hasUpdate:o,lastAutoResponse:p,activeActivity:q,onActivityToggle:r,verification:s,onInfoClick:t,pendingInsertTextMap:u,setFocusedSplitIndex:v,handleInsertToSplit:w,handleInsertConsumed:x,handleInsertToMessage:y,autoYesStateMap:z,makeAutoYesToggleHandler:A,showArchived:B,onShowArchivedChange:C,historyDisplayLimit:D,onHistoryDisplayLimitChange:E,historyUserOnly:F,onHistoryUserOnlyChange:H,onMessageSent:I,onFilePathClick:J,showToast:K,tabsState:L,tabsActions:M,onLoadContent:N,onLoadError:O,onSetLoading:P,onFilePanelSave:Q,onDirtyChange:R,onOpenFile:S,diffContent:T,diffFilePath:U,onCloseDiff:V,fileSearch:W,fileTreeRefresh:X,onFileSelect:Y,onNewFile:Z,onNewDirectory:$,onRename:_,onDelete:aa,onUpload:ab,onMove:ac,onFileTreeReset:ad,onDiffSelect:ae,onAgentInstancesChange:af,vibeLocalModel:ag,onVibeLocalModelChange:ah,vibeLocalContextWindow:ai,onVibeLocalContextWindowChange:aj,isInfoModalOpen:ak,onInfoModalClose:al,onWorktreeUpdate:am,fileInputRef:an,onFileInputChange:ao,onKillSession:ap,onRequestSessionEnd:aq,killTarget:ar,isKillPending:as,onKillCancel:at,onKillConfirm:au,moveTarget:av,isMoveDialogOpen:aw,onMoveCancel:ax,onMoveConfirm:ay,showNewFileDialog:az,newFileParentPath:aA,onNewFileConfirm:aB,onNewFileCancel:aC,killDialogTitle:aD,killDialogWarning:aE,cancelLabel:aF,endLabel:aG}){let aH=(0,h.c)("worktree"),[aI,aJ]=f().useState(null),aK=(0,e.useCallback)(a=>aJ(a),[]),aL=(0,e.useCallback)(()=>aJ(null),[]),aM=(0,e.useMemo)(()=>cB(b?.sessionStatusByInstance),[b?.sessionStatusByInstance]),[aN,aO]=(0,e.useState)({}),aP=(0,e.useCallback)((a,b)=>{aO(c=>c[a]===b?c:{...c,[a]:b})},[]),[aQ,aR]=f().useState(null),aS=f().useRef(0),aT=(0,e.useCallback)(a=>{aS.current+=1,aR({instanceId:a,token:aS.current})},[]),[aU,aV]=(0,e.useState)(null),aW=aU?.instanceId??null,aX=f().useRef(k);aX.current=k,f().useEffect(()=>{aW&&i.some(a=>a.id===aW)&&aX.current!==aW&&l(aW)},[aW,i,l]);let[aY,aZ]=(0,e.useState)(1),{request:a$,requestPlacement:a_,handleApplied:a0}=function(){let[a,b]=(0,e.useState)(null),c=(0,e.useRef)(0);return{request:a,requestPlacement:(0,e.useCallback)((a,d)=>{"roster-only"!==d&&(c.current+=1,b({instanceId:a,placement:d,token:c.current}))},[]),handleApplied:(0,e.useCallback)(a=>{b(b=>b?.token===a?null:b)},[])}}(),a1=(0,e.useCallback)((a,b)=>{a_(a.id,b)},[a_]),a2=(0,e.useMemo)(()=>(0,d.jsx)(fw,{worktreeId:a,instances:i,splitCount:aY,onInstancesChange:af,onAdded:a1}),[a,i,aY,af,a1]),a3=b?.gitStatus?.currentBranch,a4=a3&&"(unknown)"!==a3?a3:c,a5=f().useRef(0);f().useEffect(()=>{m&&m.token!==a5.current&&(a5.current=m.token,aT(m.instanceId),n?.(m.token))},[m,aT,n]);let a6=(0,e.useCallback)(()=>{r(co)},[r]),a7=(0,e.useCallback)(({splitIndex:c,cliToolId:e,instanceId:f,instance:g,availableInstances:h,onInstanceChange:i,onFocus:j,onDropInstance:k,isMaximized:l,onToggleMaximize:m,maximizeDisabled:n,showFocusFrame:o})=>{let q=u.get(c)??null,r=z.get(f),s=r?.enabled??!1,t=r?.expiresAt??null,v=r?.blockedByContract===!0,y=(0,fB.S9)(r),G=r?.answerMode,L=b?.sessionStatusByInstance?.[f]??b?.sessionStatusByCli?.[e],M=(0,b0.kA)(L),N=(0,b0.px)(L);return(0,d.jsx)(jc,{worktreeId:a,splitIndex:c,cliToolId:e,instanceId:f,instance:g,availableInstances:h,onInstanceChange:i,onFocus:j,pendingInsertText:q,onInsertConsumed:()=>x(c),onMessageSent:I,cliStatus:M,cliStatusUnclassified:N,onAgentSessionChange:aP,agentModel:cx(b?.sessionStatusByInstance?.[f]?.model,b?.sessionStatusByInstance?.[f]?.reasoningEffort),autoYes:{enabled:s,expiresAt:t,lastAutoResponse:p,onToggle:A(e,f)},autoYesBlockedByContract:v,autoYesReleasedByRestart:y,autoYesAnswerMode:G,history:{showArchived:B,onShowArchivedChange:C,historyDisplayLimit:D,onHistoryDisplayLimitChange:E,historyUserOnly:F,onHistoryUserOnlyChange:H,onInsertToMessage:a=>w(c,a),onFilePathClick:J,showToast:K},onDropInstance:k,draggedInstanceId:aI,isMaximized:l,onToggleMaximize:m,maximizeDisabled:n,showFocusFrame:o??!1,branchName:a4,onRequestSessionEnd:aq})},[a,u,z,x,I,p,A,b?.sessionStatusByCli,b?.sessionStatusByInstance,J,K,w,B,C,D,E,F,H,aI,aq,aP,a4]),a8=function(a,b,c=!1){let{task:f,latestRun:g,selectedRun:h}=a,i=jf(g,null!==h&&h.id===g?.id?h.gates:null);return(0,e.useMemo)(()=>(0,d.jsx)(jg,{task:f,latestRun:g,latestRunGates:i,onOpen:b,paneOpen:c,popover:"floating"}),[f,g,i,b,c])}(s,a6,q===co),a9=(0,e.useMemo)(()=>(0,d.jsx)(iJ,{worktreeId:a,instances:i,rosterReady:j,renderPane:a7,onFocusedSplitChange:v,showToast:K,onActiveInstanceChange:l,headerInstanceSelection:aQ,instancePlacementRequest:a$,onInstancePlacementApplied:a0,onSplitCountChange:aZ,onSelectedSplitChange:aV,actionBarItems:a8}),[a,i,j,a7,v,K,l,aQ,a$,a0,a8]),ba=(0,e.useMemo)(()=>(0,d.jsx)(il,{terminal:a9,terminalHeader:null,fileTabs:L,worktreeId:a,onCloseTab:M.closeTab,onActivateTab:M.activateTab,onLoadContent:N,onLoadError:O,onSetLoading:P,onFileSaved:Q,diffContent:T,diffFilePath:U,onCloseDiff:V,onDirtyChange:R,onMoveToFront:M.moveToFront,onOpenFile:S}),[a9,L,a,M.closeTab,M.activateTab,N,O,P,Q,T,U,V,R,M.moveToFront,S]),{pinned:bb,togglePinned:bc}=function(a){let[b,c]=(0,e.useState)(!1),d=(0,e.useRef)(b);return d.current=b,{pinned:b,togglePinned:(0,e.useCallback)(()=>{c(!d.current)},[a])}}("commandmate.worktree.activityPanePinned"),bd=(0,e.useCallback)(a=>{null!==q&&(r(q),a&&function(a){if("undefined"==typeof document)return;let b=document.querySelector(`[data-activity-entry="${a}"]`),c=null===b?document.querySelector(a===co?'[data-testid="split-action-bar-items-overflow"]':'[data-testid="header-tool-more"]'):b instanceof HTMLButtonElement?b:b.querySelector("button");c?.focus()}(q))},[q,r]),be=(0,e.useCallback)(()=>bd(!0),[bd]),{reportDirty:bf,isDirty:bg}=function(){let a=(0,e.useRef)(null);return{reportDirty:(0,e.useCallback)(b=>{a.current=b},[]),isDirty:(0,e.useCallback)(()=>a.current??void 0,[])}}(),bi=(0,e.useCallback)(a=>bd("escape"===a),[bd]),bj=(0,e.useCallback)(a=>{let b="undefined"!=typeof document&&document.activeElement?.closest('[data-testid="activity-pane-slot"]')!=null;Y(a),bb||bd(b)},[Y,bb,bd]),bk=(0,e.useMemo)(()=>({files:(0,d.jsxs)("div",{className:"h-full flex flex-col",children:[(0,d.jsx)(dZ,{query:W.query,mode:W.mode,isSearching:W.isSearching,error:W.error,onQueryChange:W.setQuery,onModeChange:W.setMode,onClear:W.clearSearch}),(0,d.jsx)(dU,{worktreeId:a,onFileSelect:bj,onNewFile:Z,onNewDirectory:$,onRename:_,onDelete:aa,onUpload:ab,onMove:ac,onResetView:ad,refreshTrigger:X,pollingEnabled:"files"===q,searchQuery:W.query,searchMode:W.mode,searchResults:W.results?.results,className:"flex-1 min-h-0"})]}),git:(0,d.jsx)(hB,{worktreeId:a,onDiffSelect:ae,isMobile:!1,worktree:b??void 0,onInsertToMessage:y,className:"h-full"}),notes:(0,d.jsx)(d4,{worktreeId:a,className:"h-full",onInsertToMessage:y}),schedules:(0,d.jsx)(eT,{worktreeId:a,className:"h-full",onInsertToMessage:y,instances:i}),agent:(0,d.jsx)(fy,{worktreeId:a,instances:i,onInstancesChange:af,vibeLocalModel:ag,onVibeLocalModelChange:ah,vibeLocalContextWindow:ai,onVibeLocalContextWindowChange:aj,modelByInstance:aM,className:"h-full"}),timer:(0,d.jsx)(fH,{worktreeId:a,instances:i}),todo:(0,d.jsx)(ea,{worktreeId:a,className:"h-full"}),skills:(0,d.jsx)(f4,{worktreeId:a,className:"h-full"}),verification:(0,d.jsx)(gE,{state:s,className:"h-full"}),env:(0,d.jsx)(g0,{worktreeId:a,className:"h-full"})}),[a,b,q,W.query,W.mode,W.isSearching,W.error,W.setQuery,W.setMode,W.clearSearch,W.results?.results,bj,Z,$,_,aa,ab,ac,ad,X,ae,y,i,af,ag,ah,ai,aj,aM,s]),bl=(0,e.useMemo)(()=>{let a=cn.find(a=>a.id===q);return a?aH(a.labelKey):""},[q,aH]),bm=(0,e.useMemo)(()=>null===q?null:(0,d.jsx)(hM,{active:q,activities:bk,onDirtyChange:bf}),[q,bk,bf]),bn=(0,e.useMemo)(()=>({title:bl,onTogglePinned:bc,onClose:be,onDismiss:bi,ignoreOutsideSelectors:jn,isDirty:bg,resetKey:q,testIdPrefix:"activity-pane"}),[bl,bc,be,bi,bg,q]);return(0,d.jsx)(G.t,{componentName:"WorktreeDetailRefactored",children:(0,d.jsxs)("div",{className:"flex h-full overflow-hidden relative",children:[(0,d.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 min-w-0",children:[(0,d.jsx)(cE,{worktreeId:a,worktreeName:c,repositoryName:b?.repositoryDisplayName??b?.repositoryName??aH("detail.unknownRepository"),description:b?.description,status:g,gitStatus:b?.gitStatus,onInfoClick:t,hasUpdate:o,sessionStatusByCli:b?.sessionStatusByCli,sessionStatusByInstance:b?.sessionStatusByInstance,instances:i,activeInstanceId:k,onActiveInstanceChange:aT,onAgentDragStart:aK,onAgentDragEnd:aL,onKillSession:ap,agentSessionByInstance:aN,agentAddControl:a2,splitInstanceIds:aU?.splitInstanceIds,activeActivity:q,onActivityToggle:r}),b?.gitStatus&&(0,d.jsx)(jh,{isBranchMismatch:b.gitStatus.isBranchMismatch,currentBranch:b.gitStatus.currentBranch,initialBranch:b.gitStatus.initialBranch}),(0,d.jsx)("div",{className:"flex-1 min-h-0 min-w-0",children:(0,d.jsx)(hH,{activityPane:bm,activityPanePinned:bb,activityPaneFrame:bn,rightPane:(0,d.jsx)(hJ.cV,{terminal:ba})})})]}),(0,d.jsx)(cF,{worktreeId:a,worktree:b,isOpen:ak,onClose:al,onWorktreeUpdate:am}),(0,d.jsx)("input",{ref:an,type:"file",accept:bh.join(","),onChange:ao,className:"hidden","aria-label":aH("detail.uploadFile")}),(0,d.jsx)(b_.a,{isOpen:null!==ar,onClose:at,title:aD,size:"sm",showCloseButton:!0,children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("p",{className:"text-sm text-foreground",children:aE}),(0,d.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,d.jsx)("button",{type:"button",onClick:at,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:aF}),(0,d.jsx)("button",{type:"button",onClick:au,disabled:as,"data-testid":"kill-session-confirm-button",className:"px-4 py-2 text-sm font-medium rounded-md bg-danger hover:bg-danger/90 text-white disabled:opacity-60 disabled:cursor-not-allowed",children:aG})]})]})}),av&&(0,d.jsx)(jk,{isOpen:aw,onClose:ax,onConfirm:ay,worktreeId:a,sourcePath:av.path,sourceType:av.type}),(0,d.jsx)(jm,{isOpen:az,parentPath:aA,onConfirm:aB,onCancel:aC})]})})});al.oo;var jp=c(21787),jq=c(51919);function jr(a,b){switch(b.type){case"SET_PHASE":return{...a,phase:b.phase};case"SHOW_PROMPT":return{...a,phase:"prompt",prompt:{data:b.data,messageId:b.messageId,visible:!0,answering:!1}};case"CLEAR_PROMPT":return{...a,prompt:{...am.kQ}};case"SET_PROMPT_ANSWERING":return{...a,prompt:{...a.prompt,answering:b.answering}};case"SET_LAYOUT_MODE":return{...a,layout:{...a.layout,mode:b.mode}};case"SET_MOBILE_ACTIVE_PANE":return{...a,layout:{...a.layout,mobileActivePane:b.pane}};case"SET_SPLIT_RATIO":return{...a,layout:{...a.layout,splitRatio:b.ratio}};case"SET_LEFT_PANE_TAB":return{...a,layout:{...a.layout,leftPaneTab:b.tab}};case"TOGGLE_LEFT_PANE":return{...a,layout:{...a.layout,leftPaneCollapsed:!a.layout.leftPaneCollapsed}};case"SET_LEFT_PANE_COLLAPSED":return{...a,layout:{...a.layout,leftPaneCollapsed:b.collapsed}};case"SET_ACTIVE_ACTIVITY":return{...a,layout:{...a.layout,activityBar:{...a.layout.activityBar,active:b.activity}}};case"TOGGLE_ACTIVITY":{let c=a.layout.activityBar.active===b.activity?null:b.activity;return{...a,layout:{...a.layout,activityBar:{...a.layout.activityBar,active:c}}}}case"TOGGLE_HISTORY_PANE":{let b=!a.layout.historyPane.visible;return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,visible:b,collapsed:!b}}}}case"SET_HISTORY_PANE_VISIBLE":return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,visible:b.visible,collapsed:!b.visible}}};case"SET_HISTORY_WIDTH":return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,width:b.width}}};case"SET_ERROR":return{...a,error:b.error};case"CLEAR_ERROR":return{...a,error:{...am.mS}};case"INCREMENT_RETRY_COUNT":return{...a,error:{...a.error,retryCount:a.error.retryCount+1}};case"SET_MESSAGES":return{...a,messages:b.messages};case"ADD_MESSAGE":return{...a,messages:[...a.messages,b.message]};case"UPDATE_MESSAGE":return{...a,messages:a.messages.map(a=>a.id===b.id?{...a,...b.updates}:a)};case"CLEAR_MESSAGES":return{...a,messages:[]};case"SET_WS_CONNECTED":return{...a,wsConnected:b.connected};default:return a}}function js(a,b){if(a.length!==b.length)return!1;let c=new Set(a);return b.every(a=>c.has(a))}function jt(a,b){return a instanceof Error&&a.message?a.message:b}var ju=c(30872),jv=c(12529),jw=c(21768),jx=c(31179),jy=c(11801),jz=c(6225);let jA="activeCliTab-",jB="activeInstanceId-",jC=Object.freeze({...jx.b,offersPlanApprove:!1,isTrustConfirmationActive:!1}),jD=[2e3,5e3,1e4],jE={timeoutMs:hR.K3,retries:0},jF=(0,e.memo)(function({label:a}){return(0,d.jsxs)("div",{role:"status","aria-live":"polite","data-testid":"worktree-detail-reconnecting-banner",className:"fixed top-2 left-1/2 z-50 flex -translate-x-1/2 items-center gap-2 rounded-full border border-warning-border bg-warning-subtle px-3 py-1 text-xs text-warning-foreground shadow-sm",children:[(0,d.jsx)(j.y,{size:"xs"}),(0,d.jsx)("span",{children:a})]})}),jG=(0,e.memo)(function({message:a,loginLabel:b,onLogin:c}){return(0,d.jsx)("div",{className:"flex h-full min-h-[200px] items-center justify-center",role:"alert","aria-live":"assertive","data-testid":"worktree-detail-session-expired",children:(0,d.jsxs)("div",{className:"max-w-md rounded-lg border border-border bg-surface p-6 text-center",children:[(0,d.jsx)("p",{className:"font-medium text-foreground",children:a}),(0,d.jsx)(a2.$,{variant:"primary",type:"button",onClick:c,className:"mt-4","data-testid":"worktree-detail-relogin",children:b})]})})}),jH=()=>{},jI=["terminal","history","files","memo","info"],jJ=(0,e.memo)(function({worktreeId:a,cliToolId:b,instanceId:c,onMessageSent:e,isSessionRunning:f,isSessionStarting:g,isProcessing:h,showToast:i,pendingInsertText:j,onInsertConsumed:k,autoYesSlot:l,agentModeSlot:m}){let n=c8({cliToolId:b,instanceId:c});return(0,d.jsx)(a0.E,{worktreeId:a,onMessageSent:e,cliToolId:b,instanceId:c,isSessionRunning:f,isSessionStarting:g,isProcessing:h,showToast:i,pendingInsertText:j,onInsertConsumed:k,onOptimisticSend:n,autoYesSlot:l,agentModeSlot:m})}),jK=(0,e.memo)(function({worktreeId:a}){let{activeActivity:b,activeCliTab:c,activeInstanceId:f,activeTab:j,agentInstances:k,autoYesEnabled:n,autoYesExpiresAt:o,autoYesBlockedByContract:q,autoYesReleasedByRestart:r,autoYesAnswerMode:s,autoYesStateMap:t,diffContent:u,diffFilePath:w,disableAutoFollow:x,displayedInstances:y,error:z,fetchCurrentOutput:A,fileInputRef:B,fileSearch:C,fileTreeRefresh:D,handleActivityOpen:H,handleActivityToggle:I,handleAgentInstancesChange:J,handleAutoYesToggle:M,handleCloseDiff:N,handleDelete:O,handleDiffSelect:P,handleDirtyChange:Q,handleEditorSave:S,handleFileInputChange:T,handleFilePanelSave:V,handleFilePathClick:W,handleFileSelect:X,handleHistoryDisplayLimitChange:Y,handleHistoryUserOnlyChange:Z,handleInfoClick:_,handleInfoModalClose:aa,handleInsertConsumed:ab,handleInsertConsumedSingle:ac,handleInsertToMessage:ad,handleInsertToSplit:ae,handleKillCancel:af,handleKillConfirm:ag,openKillConfirm:ah,openActiveKillConfirm:ai,killTarget:aj,isKillPending:ak,handleLoadContent:an,handleLoadError:ap,handleMessageSent:aq,handleMobileFileViewerClose:ar,handleMobileTabChange:as,handleMove:at,handleMoveCancel:au,handleMoveConfirm:av,handleNewDirectory:aw,handleNewFile:ax,handleNewFileCancel:ay,handleNewFileConfirm:az,handleOpenFile:aA,handlePromptDismiss:aB,handlePromptRespond:aC,handleRename:aD,handleReLogin:aE,handleRetry:aF,handleSetLoading:aH,handleShowArchivedChange:aI,handleUpload:aJ,handleVibeLocalContextWindowChange:aK,handleVibeLocalModelChange:aL,hasUpdate:aM,historyDisplayLimit:aN,historySubTab:aO,historyUserOnly:aP,isAuthExpired:aQ,isInfoModalOpen:aR,isMobile:aS,isMoveDialogOpen:aT,isReconnecting:aU,isSelectionListActive:aV,isPagerActive:aW,promptAnswerable:aX,promptAutoYesEnterSent:aY,promptAutoYesDecision:aZ,selectionListReading:a$,isTrustConfirmationActive:a0,isDismissablePanelActive:a2,isUnclassifiedActive:a3,sessionStatus:a5,agentMode:a6,startingSince:a7,lastAutoResponse:a8,loading:a9,makeAutoYesToggleHandler:ba,mobileFileViewerPath:bb,mobileSelectedAgents:bc,moveTarget:bd,newFileParentPath:be,openMobileDrawer:bf,pendingInsertText:bi,pendingInsertTextMap:bj,rosterReady:bk,instanceSelectionRequest:bl,acknowledgeInstanceSelection:bm,setActiveInstanceId:bn,setFocusedSplitIndex:bo,setHistorySubTab:bq,setWorktree:br,showArchived:bs,showNewFileDialog:bt,showToast:bu,state:bv,tCommon:bw,tWorktree:bx,tabsActions:by,tabsState:bz,resetFileTreeView:bA,toggleInstanceVisible:bB,verification:bC,vibeLocalContextWindow:bD,vibeLocalModel:bE,visibleInstanceIds:bG,worktree:bH,worktreeName:bI,worktreeStatus:bJ}=function({worktreeId:a}){var b;let c=(0,dV.a)(),d=(0,e.useRef)(c);d.current=c;let{openMobileDrawer:f}=(0,b3.VF)();(0,g.useRouter)(),(0,g.usePathname)();let i=(0,g.useSearchParams)();i?.get(b7.Kp);let{state:j,actions:k}=function(){let[a,b]=(0,e.useReducer)(jr,void 0,am.mR),{value:c,setValue:d}=(0,g3.V)({key:"commandmate.worktree.leftPaneCollapsed",defaultValue:!1,validate:a=>"boolean"==typeof a}),f=(0,e.useRef)(a.layout.leftPaneCollapsed);f.current=a.layout.leftPaneCollapsed,(0,e.useRef)(!1);let g=(0,e.useMemo)(()=>({setPhase:a=>b({type:"SET_PHASE",phase:a}),showPrompt:(a,c)=>b({type:"SHOW_PROMPT",data:a,messageId:c}),clearPrompt:()=>b({type:"CLEAR_PROMPT"}),setPromptAnswering:a=>b({type:"SET_PROMPT_ANSWERING",answering:a}),setError:a=>b({type:"SET_ERROR",error:a}),clearError:()=>b({type:"CLEAR_ERROR"}),setMessages:a=>b({type:"SET_MESSAGES",messages:a}),addMessage:a=>b({type:"ADD_MESSAGE",message:a}),updateMessage:(a,c)=>b({type:"UPDATE_MESSAGE",id:a,updates:c}),clearMessages:()=>b({type:"CLEAR_MESSAGES"}),setMobileActivePane:a=>b({type:"SET_MOBILE_ACTIVE_PANE",pane:a}),setLeftPaneTab:a=>b({type:"SET_LEFT_PANE_TAB",tab:a}),setLayoutMode:a=>b({type:"SET_LAYOUT_MODE",mode:a}),setSplitRatio:a=>b({type:"SET_SPLIT_RATIO",ratio:a}),setWsConnected:a=>b({type:"SET_WS_CONNECTED",connected:a}),toggleLeftPane:()=>{let a=!f.current;b({type:"SET_LEFT_PANE_COLLAPSED",collapsed:a}),d(a)},setActiveActivity:a=>b({type:"SET_ACTIVE_ACTIVITY",activity:a}),toggleActivity:a=>b({type:"TOGGLE_ACTIVITY",activity:a}),toggleHistoryPane:()=>b({type:"TOGGLE_HISTORY_PANE"}),setHistoryPaneVisible:a=>b({type:"SET_HISTORY_PANE_VISIBLE",visible:a}),setHistoryWidth:a=>b({type:"SET_HISTORY_WIDTH",width:a})}),[d]);return{state:a,dispatch:b,actions:g}}(),l=(0,h.c)("worktree"),m=(0,h.c)("error"),n=(0,h.c)("common");(0,h.c)("autoYes");let o=(0,a4.SC)(),q=(0,ao.rC)(),r=q?.worktrees.find(b=>b.id===a)??null,[s,t]=(0,e.useState)(r),[u,v]=(0,e.useState)(null===r),w=q?.worktrees.find(b=>b.id===a)?.status;(0,e.useRef)(w);let x=(0,e.useRef)({at:0,status:void 0}),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,G]=(0,e.useState)(0),H=(0,e.useRef)(0),I=(0,e.useRef)(0),J=(0,e.useRef)(null),K=(0,e.useRef)(async()=>null),L=(0,e.useCallback)(()=>{null!==J.current&&(clearTimeout(J.current),J.current=null)},[]);(0,e.useRef)(null!==r);let[M,N]=(0,e.useState)(!1),[O,P]=function(a){let[b,c]=(0,e.useReducer)(function a(b,c){switch(c.type){case"OPEN_FILE":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1!==a){if(b.activeIndex===a)return b;return{...b,activeIndex:a}}if(b.tabs.length>=30)return b;let d={path:c.path,name:h8(c.path),content:null,loading:!1,error:null,isDirty:!1},e=[...b.tabs,d];return{tabs:e,activeIndex:e.length-1}}case"CLOSE_TAB":{var d,e;let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a)return b;let f=b.tabs.filter((b,c)=>c!==a),g=(d=b.activeIndex,0===(e=f.length)||null===d?null:a<d?d-1:a===d?Math.min(a,e-1):d);return{tabs:f,activeIndex:g}}case"ACTIVATE_TAB":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a||b.activeIndex===a)return b;return{...b,activeIndex:a}}case"SET_CONTENT":{let a=h9(b.tabs,c.path,a=>({...a,content:c.content,loading:!1,error:null,isDirty:!1}));if(!a)return b;return{...b,tabs:a}}case"SET_LOADING":{let a=h9(b.tabs,c.path,a=>({...a,loading:c.loading}));if(!a)return b;return{...b,tabs:a}}case"SET_ERROR":{let a=h9(b.tabs,c.path,a=>({...a,error:c.error,loading:!1}));if(!a)return b;return{...b,tabs:a}}case"RENAME_FILE":{let a=b.tabs.findIndex(a=>a.path===c.oldPath);if(-1===a)return b;let d=[...b.tabs];return d[a]={...d[a],path:c.newPath,name:h8(c.newPath)},{...b,tabs:d}}case"DELETE_FILE":return a(b,{type:"CLOSE_TAB",path:c.path});case"RESTORE":{let a=c.paths.slice(0,30).map(a=>({path:a,name:h8(a),content:null,loading:!1,error:null,isDirty:!1}));if(0===a.length)return ib;let b=c.activePath?Math.max(0,a.findIndex(a=>a.path===c.activePath)):0;return{tabs:a,activeIndex:b}}case"SET_DIRTY":{let a=b.tabs.find(a=>a.path===c.path);if(a&&a.isDirty===c.isDirty)return b;let d=h9(b.tabs,c.path,a=>({...a,isDirty:c.isDirty}));if(!d)return b;return{...b,tabs:d}}case"MOVE_TO_FRONT":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a||0===a)return b;return{tabs:[b.tabs[a],...b.tabs.filter((b,c)=>c!==a)],activeIndex:0}}case"CLOSE_ALL":if(0===b.tabs.length)return b;return ib;case"CLOSE_OTHERS":case"CLOSE_TO_RIGHT":{let a="CLOSE_OTHERS"===c.type?"others":"right",d=new Set(ia(b.tabs,c.path,a));if(0===d.size)return b;let e=b.tabs.filter(a=>!d.has(a.path));return{tabs:e,activeIndex:function(a,b,c){if(0===b.length)return null;let d=null!==a.activeIndex?a.tabs[a.activeIndex]?.path:void 0;if(void 0!==d){let a=b.findIndex(a=>a.path===d);if(-1!==a)return a}let e=b.findIndex(a=>a.path===c);return -1!==e?e:0}(b,e,c.path)}}default:return b}},ib);(0,e.useRef)(!1),(0,e.useRef)(a);let d=(0,e.useRef)(b);d.current=b;let f=(0,e.useCallback)(a=>{let b=d.current.tabs;return -1!==b.findIndex(b=>b.path===a)?(c({type:"OPEN_FILE",path:a}),"activated"):b.length>=30?"limit_reached":(c({type:"OPEN_FILE",path:a}),"opened")},[]),g=(0,e.useCallback)(a=>{c({type:"CLOSE_TAB",path:a})},[]),h=(0,e.useCallback)(a=>{c({type:"ACTIVATE_TAB",path:a})},[]),i=(0,e.useCallback)((a,b)=>{c({type:"RENAME_FILE",oldPath:a,newPath:b})},[]),j=(0,e.useCallback)(a=>{c({type:"DELETE_FILE",path:a})},[]),k=(0,e.useCallback)(a=>{c({type:"MOVE_TO_FRONT",path:a})},[]),l=(0,e.useCallback)(()=>{c({type:"CLOSE_ALL"})},[]),m=(0,e.useCallback)(a=>{c({type:"CLOSE_OTHERS",path:a})},[]),n=(0,e.useCallback)(a=>{c({type:"CLOSE_TO_RIGHT",path:a})},[]),o=(0,e.useMemo)(()=>({dispatch:c,openFile:f,closeTab:g,activateTab:h,onFileRenamed:i,onFileDeleted:j,moveToFront:k,closeAllTabs:l,closeOtherTabs:m,closeTabsToRight:n}),[c,f,g,h,i,j,k,l,m,n]);return[b,o]}(a),[Q,R]=(0,e.useState)(null),[S,T]=(0,e.useState)(jv.bk),[U,V]=(0,e.useState)(new Map),[W,X]=(0,e.useState)(null),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(void 0),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(void 0),[ae,af]=(0,e.useState)(jC),ag=(0,e.useRef)(!1),[ah,ai]=(0,e.useState)(null),[aj,ak]=(0,e.useState)(fa.sA),an=(0,e.useRef)(aj);an.current=aj;let ap=(0,e.useRef)(s);ap.current=s;let[aq,ar]=(0,e.useState)(()=>(0,al.lu)((0,fa.sA)())),as=(0,e.useRef)(aq);as.current=aq;let[at,au]=(0,e.useState)(null),av=at===a,[aw,ax]=(0,e.useState)(null),[ay,az]=(0,e.useState)(null),[aA,aB]=(0,e.useState)(()=>{try{let b=window.localStorage.getItem(jA+a);if(b&&(0,al.hR)(b))return b}catch{}return(0,fa.sA)()[0]}),aC=(0,e.useCallback)(b=>{aB(b);try{window.localStorage.setItem(jA+a,b)}catch{}},[a]),aD=(0,e.useRef)(aA);aD.current=aA;let[aE,aF]=(0,e.useState)(()=>{try{let b=window.localStorage.getItem(jB+a);if(b&&(0,al.n6)(b))return b;let c=window.localStorage.getItem(jA+a);if(c&&(0,al.hR)(c))return c}catch{}return(0,fa.sA)()[0]}),aG=(0,e.useCallback)(b=>{aF(b);try{window.localStorage.setItem(jB+a,b)}catch{}let c=as.current.find(a=>a.id===b);c&&aC(c.cliTool)},[a,aC]),aH=(0,e.useRef)(aE);aH.current=aE;let aI=(0,e.useRef)(0),aJ=(0,e.useRef)(0),aK=(0,e.useRef)(0),aL=U.get(aE)?.enabled??!1,aM=U.get(aE)?.expiresAt??null,aN=U.get(aE)?.blockedByContract===!0,aO=(0,fB.S9)(U.get(aE)),aP=U.get(aE)?.answerMode;(0,e.useMemo)(()=>Array.from(U.values()).some(a=>a.enabled),[U]),(0,e.useMemo)(()=>Array.from(U.values()).some(a=>(0,fB.S9)(a)),[U]);let[aQ,aR]=(0,e.useState)(0),[aS,aT]=(0,e.useState)(!1),[aU,aV]=(0,e.useState)(""),{active:aW,setActive:aX,toggle:aY}=function(a){let[b,c]=(0,e.useState)(null),d=(0,e.useRef)(b);d.current=b;let f=(0,e.useRef)(a);return f.current=a,{active:b,setActive:(0,e.useCallback)(a=>{c(a),f.current},[]),toggle:(0,e.useCallback)(a=>{if(d.current===a){c(null),f.current;return}c(a),f.current},[])}}(a),{historySubTab:aZ,setHistorySubTab:a$,showArchived:a_,handleShowArchivedChange:a0,historyUserOnly:a1,handleHistoryUserOnlyChange:a2,historyDisplayLimit:a3,handleHistoryDisplayLimitChange:a5}=function(){let[a,b]=(0,e.useState)("message"),[c,d]=(0,e.useState)(()=>!1),f=(0,e.useCallback)(a=>{d(a),localStorage.setItem("commandmate:showArchived",String(a))},[]),[g,h]=(0,e.useState)(()=>!1),i=(0,e.useCallback)(a=>{h(a);try{localStorage.setItem(jy.gP,String(a))}catch{}},[]),[j,k]=(0,e.useState)(()=>jy.v8);return{historySubTab:a,setHistorySubTab:b,showArchived:c,handleShowArchivedChange:f,historyUserOnly:g,handleHistoryUserOnlyChange:i,historyDisplayLimit:j,handleHistoryDisplayLimitChange:(0,e.useCallback)(a=>{k(a);try{localStorage.setItem(jy.wP,String(a))}catch{}},[])}}(),a6=(0,e.useRef)(a_),a7=(0,e.useRef)(a3),{pendingInsertTextMap:a8,pendingInsertText:a9,setFocusedSplitIndex:ba,handleInsertToMessage:bb,handleInsertToSplit:bc,handleInsertConsumed:bd,handleInsertConsumedSingle:be}=function(){let[a,b]=(0,e.useState)(()=>new Map),[c,d]=(0,e.useState)(0),f=(0,e.useCallback)(a=>{b(b=>{let d=new Map(b);return d.set(c,a),d})},[c]),g=(0,e.useCallback)((a,c)=>{b(b=>{let d=new Map(b);return d.set(a,c),d})},[]),h=(0,e.useCallback)(a=>{b(b=>{if(!b.has(a))return b;let c=new Map(b);return c.delete(a),c})},[]),i=a.get(0)??null,j=(0,e.useCallback)(()=>h(0),[h]);return{pendingInsertTextMap:a,pendingInsertText:i,focusedSplitIndex:c,setFocusedSplitIndex:d,handleInsertToMessage:f,handleInsertToSplit:g,handleInsertConsumed:h,handleInsertConsumedSingle:j}}(),{diffContent:bf,diffFilePath:bi,handleDiffSelect:bj,handleCloseDiff:bk}=function(a){let[b,c]=(0,e.useState)(null),[d,f]=(0,e.useState)(null);return{diffContent:b,diffFilePath:d,handleDiffSelect:(0,e.useCallback)((b,d)=>{a||(c(b),f(d))},[a]),handleCloseDiff:(0,e.useCallback)(()=>{c(null),f(null)},[])}}(c),bl=function(a){let{worktreeId:b,initialMode:c="name",debounceMs:d=300}=a,[f,g]=(0,e.useState)(""),[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(c),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(null),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useMemo)(()=>(function(a,b){let c=null,d=(...d)=>{c&&clearTimeout(c),c=setTimeout(()=>{a(...d),c=null},b)};return d.cancel=()=>{c&&clearTimeout(c),c=null},d})(a=>{i(a)},d),[d]),u=(0,e.useCallback)(a=>{g(a),t(a),r(null)},[t]),v=(0,e.useCallback)(()=>{g(""),i(""),o(null),r(null),m(!1),s.current&&(s.current.abort(),s.current=null)},[]),w=(0,e.useCallback)(a=>{if(!h.trim())return a;let b=h.toLowerCase();return a.filter(a=>a.name.toLowerCase().includes(b))},[h]),x=(0,e.useCallback)(()=>n&&0!==n.results.length?p(n.results.map(a=>a.filePath)):new Set,[n]);return{query:f,mode:j,isSearching:l,results:n,error:q,setQuery:u,setMode:k,clearSearch:v,filterByName:w,getMatchedPaths:x}}({worktreeId:a});(0,e.useRef)(!1),(0,e.useRef)(a);let bm=(0,e.useCallback)(async()=>{let b=(0,cv.Xg)();try{let c=await (0,bP.E)(`/api/worktrees/${a}`,jE),d=(0,bP.O0)(c);if(d)throw d;if(!c.ok)throw new bP.hD(`Failed to fetch worktree: ${c.status}`,c.status);let e=(0,bP.xd)(c);if(e)throw e;let f=await c.json(),g=(0,cv.PX)(a,f.status,b,x.current),h=g===f.status?f:{...f,status:g};if(t(h),h.selectedAgents){let a=an.current;h.selectedAgents.length===a.length&&h.selectedAgents.every((b,c)=>b===a[c])||ak(h.selectedAgents)}if(h.agentInstances){let b=as.current,c=h.agentInstances;c.length===b.length&&c.every((a,c)=>a.id===b[c].id&&a.cliTool===b[c].cliTool&&a.alias===b[c].alias)||ar(c),au(a)}return"vibeLocalModel"in h&&ax(h.vibeLocalModel??null),"vibeLocalContextWindow"in h&&az(h.vibeLocalContextWindow??null),H.current=0,I.current=0,L(),B(!1),D(!1),z(null),h}catch(d){let a=d instanceof Error?d.message:"Unknown error",b=d instanceof bP.hD?d.status:0;if(H.current+=1,401===b)return D(!0),B(!1),z(null),null;if(null!==ap.current)return H.current>=3&&B(!0),console.error("[WorktreeDetailRefactored] Error fetching worktree:",d),null;z(a);let c=I.current;return c<jD.length&&(I.current=c+1,L(),J.current=setTimeout(()=>{J.current=null,K.current()},jD[c])),null}},[a,L]);K.current=bm;let bn=(0,e.useCallback)(async()=>{let b=aD.current,c=d.current,e=aH.current,f=++aI.current,g=()=>aI.current!==f||aD.current!==b||c&&aH.current!==e;try{let d=new URLSearchParams({cliTool:b,unit:"pairs"});c&&d.set("instance",e),a6.current&&d.set("includeArchived","true"),d.set("limit",String(a7.current));let f=await (0,bP.E)(`/api/worktrees/${a}/messages?${d.toString()}`,jE);if(!f.ok)throw Error(`Failed to fetch messages: ${f.status}`);let h=await f.json();if(g())return;k.setMessages(h.map(a=>({...a,timestamp:new Date(a.timestamp)})))}catch(a){if(g())return;console.error("[WorktreeDetailRefactored] Error fetching messages:",a)}},[a,k]),bo=(0,e.useCallback)(async()=>{let b=aD.current,c=d.current,e=aH.current,f=++aJ.current,g=()=>aJ.current!==f||aD.current!==b||c&&aH.current!==e;try{let d=c?`/api/worktrees/${a}/current-output?cliTool=${b}&instance=${encodeURIComponent(e)}`:`/api/worktrees/${a}/current-output?cliTool=${b}`,f=await (0,bP.E)(d,jE);if(!f.ok){409===f.status&&await (0,c$.y$)(f)&&!g()&&(k.clearPrompt(),_(void 0),ab(!1),ad(void 0),T(jv.bk),af(jC));return}let h=await f.json();if(g()||h.cliToolId&&h.cliToolId!==b)return;let i=h.isSelectionListActive?(0,jv.gO)(h.fullOutput??h.realtimeSnippet):jv.bk;T(a=>(0,jv.hq)(a,i)?a:i),h.isPromptWaiting&&h.promptData?(k.showPrompt(h.promptData,`prompt-${Date.now()}`),_(h.promptAnswerable),ab((0,jz.r)(h.autoYes?.lastEnterFallback)),ad(h.autoYesDecision)):!h.isPromptWaiting&&j.prompt.visible&&k.clearPrompt();let l={isSelectionListActive:h.isSelectionListActive??!1,isPagerActive:h.isPagerActive??!1,offersPlanApprove:(0,ju.S$)(h.realtimeSnippet||h.fullOutput).offersPlanApprove,isTrustConfirmationActive:(h.isSelectionListActive??!1)&&(0,ju.pw)(h.fullOutput??h.realtimeSnippet,b),isDismissablePanelActive:h.isDismissablePanelActive??!1,isUnclassifiedActive:h.isUnclassifiedActive??!1,sessionStatus:h.sessionStatus??"",agentMode:h.agentMode??jq.J_,startingSince:"number"==typeof h.startingSince?h.startingSince:null};if(af(a=>(0,jx.B)(a,l)?a:l),X(h.lastServerResponseTimestamp??null),Z(h.serverPollerActive??!1),h.autoYes){let a=ag.current,d=h.autoYes,f=c?e:b;V(a=>{let b=new Map(a),c=d.enabled&&a.get(f)?.blockedByContract===!0,e=d.enabled?(0,jw.wn)(h.autoYesAnswerMode)?h.autoYesAnswerMode:a.get(f)?.answerMode:void 0;return b.set(f,{enabled:d.enabled,expiresAt:d.expiresAt,...c?{blockedByContract:!0}:{},...e?{answerMode:e}:{},...!d.enabled&&"server-restart"===d.stopReason?{stopReason:"server-restart"}:{}}),b}),ag.current=d.enabled,a&&!h.autoYes.enabled&&("stop_pattern_matched"===h.autoYes.stopReason||"consecutive_errors"===h.autoYes.stopReason)&&ai(h.autoYes.stopReason)}}catch(a){if(g())return;console.error("[WorktreeDetailRefactored] Error fetching current output:",a)}},[a,k,j.prompt.visible]),bq=(0,e.useCallback)(async()=>{let b=++aK.current;try{let c=await (0,bP.E)(`/api/worktrees/${a}/auto-yes`,jE);if(!c.ok)return;let d=await c.json();if(aK.current!==b)return;let e=d?.instances;if(!e||"object"!=typeof e)return;let f=d.answerModeByInstance&&"object"==typeof d.answerModeByInstance?d.answerModeByInstance:{},g=new Map;for(let[a,b]of Object.entries(e))if(b&&"object"==typeof b){let c=b.enabled??!1,d=f[a];g.set(a,{enabled:c,expiresAt:b.expiresAt??null,...c&&!0===b.blockedByContract?{blockedByContract:!0}:{},...c&&(0,jw.wn)(d)?{answerMode:d}:{},...!c&&"server-restart"===b.stopReason?{stopReason:"server-restart"}:{}})}V(g)}catch(a){if(aK.current!==b)return;console.error("[WorktreeDetailRefactored] Error fetching auto-yes states:",a)}},[a]),{visibleInstances:br,visibleInstanceIds:bs,toggleInstanceVisible:bt,showInstances:bu}=function({worktreeId:a,roster:b}){let[c,d]=(0,e.useState)(null),f=(0,e.useMemo)(()=>e$(c,b),[c,b]),g=(0,e.useMemo)(()=>f.map(a=>a.id),[f]),h=(0,e.useMemo)(()=>null!==c&&b.some(a=>c.includes(a.id)),[c,b]),i=(0,e.useCallback)(a=>{let c=new Set(a),e=b.filter(a=>c.has(a.id)).map(a=>a.id);!(e.length<1)&&d(e)},[b,a]),j=(0,e.useCallback)(a=>i(a),[i]);return{visibleInstances:f,visibleInstanceIds:g,hasStoredPreference:h,toggleInstanceVisible:(0,e.useCallback)(a=>{let d=e$(c,b).map(a=>a.id);if(d.includes(a)){if(d.length<=1)return;i(d.filter(b=>b!==a))}else i([...d,a])},[c,b,i]),setVisibleInstanceIds:j,showInstances:(0,e.useCallback)(a=>{null!==c&&i([...e$(c,b).map(a=>a.id),...a])},[c,b,i])}}({worktreeId:a,roster:aq}),bv=c?br:aq,bw=(0,e.useMemo)(()=>Array.from(new Set(br.map(a=>a.cliTool))),[br]),[bx,by]=(0,e.useState)(null);(0,e.useRef)(0),(0,e.useRef)(null);let bz=(0,e.useCallback)(a=>{by(b=>null!==b&&b.token===a?null:b)},[]),bA="opencode"===aA||"copilot"===aA,bB=(0,e.useCallback)(b=>{ar(b),au(a)},[a]),bC=(0,e.useCallback)(a=>{ax(a)},[]),bD=(0,e.useCallback)(a=>{az(a)},[]),bE=`${aA}::${c?aE:aA}`;(0,e.useRef)(bE);let{showToast:bF}=(0,bO.dj)(),bG=(0,e.useCallback)(()=>{bF("Maximum 30 file tabs. Close a tab first.","info")},[bF]),bH=(0,e.useCallback)(a=>{c?R(a):"limit_reached"===P.openFile(a)&&bG()},[c,P,bG]),bI=(0,e.useCallback)(a=>{c?R(a):"limit_reached"===P.openFile(a)&&bG()},[c,P,bG]),bJ=(0,e.useCallback)(a=>{"limit_reached"===P.openFile(a)&&bG()},[P,bG]),bK=(0,e.useCallback)(()=>{R(null)},[]),bL=(0,e.useCallback)(a=>{aR(a=>a+1)},[]),bM=(0,e.useCallback)(()=>{bl.clearSearch(),P.closeAllTabs(),R(null)},[bl,P]),bN=(0,e.useCallback)(a=>{aY(a)},[aY]),bQ=(0,e.useCallback)(a=>{aX(a)},[aX]),bS=(0,e.useCallback)(()=>{N(!0)},[]),bT=(0,e.useCallback)(()=>{N(!1)},[]),bU=(0,e.useCallback)(async b=>{let c;k.setPromptAnswering(!0);try{let e=i8(b,aA,F(j.prompt.data)?j.prompt.data:null,d.current?aH.current:void 0),f=await fetch(`/api/worktrees/${a}/prompt-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});c=await (0,ja.a_)(f)}catch(a){console.error("[WorktreeDetailRefactored] Error sending prompt response:",a),c="failed"}try{if("answered"===c)k.clearPrompt();else{let a=ja.J4[c];bF(l(a.messageKey),a.type)}await bo()}finally{k.setPromptAnswering(!1)}},[a,k,bo,aA,j.prompt.data,bF,l]),bV=(0,e.useCallback)(()=>{k.clearPrompt()},[k]),bW=(0,e.useCallback)(a=>{k.setMobileActivePane(a)},[k]),bX=(0,e.useCallback)(()=>{bn(),bo()},[bn,bo]),bY=(0,e.useCallback)((b,c)=>async d=>{let e=c??b;try{let c=await fetch(`/api/worktrees/${a}/auto-yes`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:d.enabled,cliToolId:b,instanceId:e,duration:d.duration,stopPattern:d.stopPattern,...d.enabled?{answerMode:d.answerMode??jw.Rb}:{}})});if(c.ok){let a=await c.json();++aK.current,V(b=>{let c=new Map(b),d=!0===a.enabled&&a.contractPolicy?.mode==="off",f=!0===a.enabled&&(0,jw.wn)(a.answerMode)?a.answerMode:void 0;return c.set(e,{enabled:a.enabled,expiresAt:a.expiresAt,...d?{blockedByContract:!0}:{},...f?{answerMode:f}:{}}),c}),e===aH.current&&(ag.current=a.enabled),bq()}}catch(a){console.error("[WorktreeDetailRefactored] Error toggling auto-yes:",a)}},[a,bq]),bZ=(0,e.useCallback)(a=>bY(aA,aE)(a),[bY,aA,aE]),[b$,b_]=(0,e.useState)(null),[b0,b1]=(0,e.useState)(!1),b2=(0,e.useRef)(!1),b4=(0,e.useCallback)(a=>{b_(a)},[]),b5=(0,e.useCallback)(()=>{let a=aH.current,b=aD.current,c=(0,al.O6)(as.current,a,b);b_({cliToolId:b,instanceId:a,label:c})},[]),b6=(0,e.useCallback)(async()=>{if(!b$||b2.current)return;b2.current=!0,b1(!0);let b=()=>{b$.instanceId===aH.current&&(k.clearMessages(),k.clearPrompt())};try{await bP.y.killSession(a,b$.cliToolId,b$.instanceId),b(),await bm(),b_(null)}catch(a){a instanceof bP.hD&&404===a.status?(b(),await bm(),b_(null)):bF(l("session.failedToKill"),"error")}finally{b2.current=!1,b1(!1)}},[b$,a,k,bm,bF,l]),b8=(0,e.useCallback)(()=>{b2.current||b_(null)},[]),b9=(0,e.useCallback)(a=>{aV(a),aT(!0)},[]),ca=(0,e.useCallback)(async b=>{aT(!1);let c=aU?`${aU}/${b}`:b;try{if(!(await fetch(`/api/worktrees/${a}/files/${(0,bp.o)(c)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"file",content:""})})).ok)throw Error("Failed to create file");aR(a=>a+1)}catch{window.alert(m("fileOps.failedToCreateFile"))}},[a,aU,m]),cb=(0,e.useCallback)(()=>{aT(!1)},[]),cc=(0,e.useCallback)(async b=>{let c=window.prompt("Enter directory name:");if(!c)return;let d=b?`${b}/${c}`:c;try{if(!(await fetch(`/api/worktrees/${a}/files/${(0,bp.o)(d)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"directory"})})).ok)throw Error("Failed to create directory");aR(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to create directory:",a),window.alert(m("fileOps.failedToCreateDirectory"))}},[a,m]),cd=(0,e.useCallback)(async b=>{let c=b.split("/").pop()||"",d=window.prompt("Enter new name:",c);if(d&&d!==c)try{if(!(await fetch(`/api/worktrees/${a}/files/${(0,bp.o)(b)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",newName:d})})).ok)throw Error("Failed to rename");let c=b.includes("/")?b.substring(0,b.lastIndexOf("/")+1):"";P.onFileRenamed(b,`${c}${d}`),aR(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to rename:",a),window.alert(m("fileOps.failedToRename"))}},[a,P,m]),ce=(0,e.useCallback)(async b=>{let c=b.split("/").pop()||b;if(await o({description:n("confirmDelete",{name:c}),variant:"danger"}))try{if(!(await fetch(`/api/worktrees/${a}/files/${(0,bp.o)(b)}?recursive=true`,{method:"DELETE"})).ok)throw Error("Failed to delete");P.onFileDeleted(b),aR(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to delete:",a),window.alert(m("fileOps.failedToDelete"))}},[a,P,n,m,o]),{moveTarget:cf,isMoveDialogOpen:cg,handleMove:ch,handleMoveConfirm:ci,handleMoveCancel:cj}=function(a,b,c,d){let[f,g]=(0,e.useState)(null),[h,i]=(0,e.useState)(!1),j=(0,e.useCallback)((a,b)=>{g({path:a,type:b}),i(!0)},[]),k=(0,e.useCallback)(async e=>{if(f)try{let g=await fetch(`/api/worktrees/${a}/files/${f.path}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"move",destination:e})}),h=await g.json();if(!g.ok||!h.success){let a=h.error?.message||"Failed to move";d?.(a);return}c?.("Moved successfully"),b()}catch{d?.("Failed to move")}finally{g(null),i(!1)}},[f,a,b,c,d]);return{moveTarget:f,isMoveDialogOpen:h,handleMove:j,handleMoveConfirm:k,handleMoveCancel:(0,e.useCallback)(()=>{g(null),i(!1)},[])}}(a,()=>aR(a=>a+1),a=>bF(a,"success"),a=>bF(a,"error")),ck=(0,e.useRef)(null),cl=(0,e.useRef)(""),cm=(0,e.useCallback)(a=>{cl.current=a,ck.current?.click()},[]),cn=(0,e.useCallback)(async b=>{let c=b.target.files?.[0];if(!c)return;b.target.value="";let d=cl.current,e=`.${c.name.split(".").pop()?.toLowerCase()}`;if(!function(a){if(!a)return!1;let b=a.toLowerCase();return bh.includes(b)}(e))return void bF(`Unsupported file type: ${e}. Allowed: ${bh.join(", ")}`,"error");let f=function(a){let b=function(a){let b=a.toLowerCase();return bg.find(a=>a.extension===b)}(a);return b?.maxFileSize??0x1400000}(e);if(c.size>f)return void bF(`File too large. Maximum size: ${(f/1024/1024).toFixed(1)}MB`,"error");let g=new FormData;g.append("file",c);try{let b=await fetch(`/api/worktrees/${a}/upload/${(0,bp.o)(d||".")}`,{method:"POST",body:g});if(!b.ok){let a=await b.json().catch(()=>({})),c=a?.error?.message||"Failed to upload file";bF(c,"error");return}let c=await b.json();bF(`Uploaded: ${c.filename}`,"success"),aR(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to upload:",a),bF("Upload failed. Please try again.","error")}},[a,bF]),{hasUpdate:co}=(0,bR.Y)(),{lastAutoResponse:cp}=(j.prompt.visible,b=j.prompt.data,{lastAutoResponse:null}),cq=(0,e.useCallback)(async()=>{z(null),B(!1),D(!1),H.current=0,I.current=0,L(),v(!0),await bm()&&await Promise.all([bn(),bo()]),v(!1)},[bm,bn,bo,L]),cr=(0,e.useCallback)(()=>{window.location.href="/login"},[]);!function({error:a,handleRetry:b,fetchWorktree:c,fetchMessages:d,fetchCurrentOutput:f,setError:g}){let h=(0,e.useRef)(0);(0,e.useCallback)(async()=>{if("visible"!==document.visibilityState)return;let e=Date.now();if(!(e-h.current<5e3)){if(h.current=e,a)return void b();try{await Promise.all([c(),d(),f()])}finally{g(null)}}},[a,b,c,d,f,g])}({error:y,handleRetry:cq,fetchWorktree:bm,fetchMessages:bn,fetchCurrentOutput:bo,setError:z}),s?.sessionStatusByCli?.[aA]?.isRunning;let cs=(0,e.useMemo)(()=>(function(a,b,c="claude"){if(b)return"error";if(!a)return"idle";let d=a.sessionStatusByCli?.[c];if(d){if(d.isWaitingForResponse)return"waiting";if(d.isProcessing)return"running";if(d.isRunning)return"ready"}if("claude"===c){if(a.isWaitingForResponse)return"waiting";if(a.isProcessing)return"running";if(a.isSessionRunning)return"ready"}return"idle"})(s,null!==j.error.type,aA),[s,j.error.type,aA]),ct=(0,e.useMemo)(()=>j.layout.mobileActivePane,[j.layout.mobileActivePane]),cu=s?.name??"Unknown",cw=(0,e.useCallback)((a,b)=>{P.dispatch({type:"SET_CONTENT",path:a,content:b})},[P]),cx=(0,e.useCallback)((a,b)=>{P.dispatch({type:"SET_ERROR",path:a,error:b})},[P]),cy=(0,e.useCallback)((a,b)=>{P.dispatch({type:"SET_LOADING",path:a,loading:b})},[P]),cz=(0,e.useCallback)((a,b)=>{P.dispatch({type:"SET_DIRTY",path:a,isDirty:b})},[P]),cA=function({worktreeId:a,refreshToken:b=0,enabled:c=!0,limit:d=10}){let[f,g]=(0,e.useState)(null),[h,i]=(0,e.useState)([]),[j,k]=(0,e.useState)(null),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(!0),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(null),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(null),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(null),[R,S]=(0,e.useState)(d),[T,U]=(0,e.useState)(d),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)([]),[Z,$]=(0,e.useState)(!1),[_,aa]=(0,e.useState)(null),[ab,ac]=(0,e.useState)(0);(0,e.useRef)(0);let ad=(0,e.useRef)(0);(0,e.useRef)(!1);let ae=(0,e.useRef)(!1),af=(0,e.useRef)(!1),ag=(0,e.useRef)(!1),ah=(0,e.useRef)(!1);(0,e.useRef)(!1);let ai=(0,e.useRef)(null);ai.current=P,(0,e.useRef)(d).current=R,ae.current=f?.status==="verifying"||h.some(a=>"running"===a.status);let aj=j??h[0]?.id??null;(0,e.useMemo)(()=>{if(null===aj)return null;let a=h.find(a=>a.id===aj);return a?.status==="running"?`${aj}:running:${b}:${ab}`:`${aj}:${a?.status??"unlisted"}:${a?.finishedAt??""}`},[aj,h,b,ab]);let ak=(0,e.useMemo)(()=>z?.plannedGateIds??[],[z]),al=(0,e.useMemo)(()=>(l?.gates??[]).filter(a=>gb.includes(a.status)).map(a=>a.gateId),[l]),am=(0,e.useMemo)(()=>h.find(a=>"running"===a.status)??null,[h]),an=(0,e.useCallback)(a=>{Q(null===a||js(a,ak)?null:a)},[ak]),ao=(0,e.useCallback)(a=>{Q(b=>{let c=new Set(b??ak);c.has(a)?c.delete(a):c.add(a);let d=ak.filter(a=>c.has(a));return js(d,ak)?null:d})},[ak]),ap=(0,e.useCallback)(()=>{let a=ak.filter(a=>al.includes(a));Q(0===a.length||js(a,ak)?null:a)},[ak,al]),aq=(0,e.useCallback)(()=>{ad.current=0,S(a=>Math.min(a+10,100))},[]),ar=(0,e.useCallback)(()=>{W(a=>!a)},[]),as=(0,e.useCallback)(()=>{ad.current=0,ac(a=>a+1)},[]),at=(0,e.useCallback)(a=>{k(a)},[]),au=(0,e.useCallback)(async b=>{if(!af.current){af.current=!0,w(!0),y(null),M(null);try{let c=void 0===b?ai.current:b,d=await gh(a,null!==c&&c.length>0?{gateIds:c}:{});k(d),ad.current=0,ac(a=>a+1)}catch(b){let a=b instanceof ge&&409===b.status;y({kind:a?"conflict":"error",message:jt(b,"Failed to start verification"),runningRunId:b instanceof ge?b.runningRunId:null}),a&&(ad.current=0,ac(a=>a+1))}finally{af.current=!1,w(!1)}}},[a]),av=(0,e.useCallback)(async()=>{if(!ah.current&&null!==am){ah.current=!0,K(!0),M(null);try{let b=await gj(a,am.id);O("running"===b.status?am.id:null)}catch(a){M({kind:409===(a instanceof ge?a.status:0)?"gone":"error",message:jt(a,"Failed to cancel the verification run")})}finally{ah.current=!1,K(!1),ad.current=0,ac(a=>a+1)}}},[a,am]),aw=(0,e.useCallback)(async()=>{if(!ag.current){ag.current=!0,E(!0),G(null);try{let b=await gi(a);I(b),ad.current=0,ac(a=>a+1)}catch(b){let a=b instanceof ge?b.status:0;G({kind:409===a?"conflict":422===a?"empty":"error",message:jt(b,"Failed to draft the verification config")}),409===a&&(ad.current=0,ac(a=>a+1))}finally{ag.current=!1,E(!1)}}},[a]);return{worktreeId:a,task:f,runs:h,latestRun:h[0]??null,selectedRunId:aj,selectedRun:l,loading:n,error:p,detailError:r,detailLoading:t,rerunPending:v,rerunFailure:x,config:z,configError:B,phase:h.some(a=>"running"===a.status)?"running":null===z?"unknown":z.exists?0===h.length?"configured":"result":"no-config",draftPending:D,draftFailure:F,draftResult:H,availableGateIds:ak,selectedGateIds:P,failedGateIds:al,toggleGate:ao,setGateSelection:an,selectFailedGates:ap,runningRun:am,cancelPending:J,cancelSettling:null!==N&&am?.id===N,cancelFailure:L,historyLimit:R,canLoadMore:h.length>=T&&T<100,repositoryHistoryOpen:V,repositoryHistory:X,repositoryHistoryLoading:Z,repositoryHistoryError:_,selectRun:at,refresh:as,rerun:au,cancelRun:av,loadMore:aq,toggleRepositoryHistory:ar,draftConfig:aw}}({worktreeId:a,refreshToken:E,enabled:!u&&!y});return{activeActivity:aW,activeCliTab:aA,activeInstanceId:aE,activeTab:ct,agentInstances:aq,autoYesEnabled:aL,autoYesExpiresAt:aM,autoYesBlockedByContract:aN,autoYesReleasedByRestart:aO,autoYesAnswerMode:aP,autoYesStateMap:U,diffContent:bf,diffFilePath:bi,disableAutoFollow:bA,displayedInstances:bv,error:y,fetchCurrentOutput:bo,fileInputRef:ck,fileSearch:bl,fileTreeRefresh:aQ,handleActivityOpen:bQ,handleActivityToggle:bN,handleAgentInstancesChange:bB,handleAutoYesToggle:bZ,handleCloseDiff:bk,handleDelete:ce,handleDiffSelect:bj,handleDirtyChange:cz,handleEditorSave:bL,handleFileInputChange:cn,handleFilePanelSave:bL,handleFilePathClick:bH,handleFileSelect:bI,handleHistoryDisplayLimitChange:a5,handleHistoryUserOnlyChange:a2,handleInfoClick:bS,handleInfoModalClose:bT,handleInsertConsumed:bd,handleInsertConsumedSingle:be,handleInsertToMessage:bb,handleInsertToSplit:bc,handleKillCancel:b8,handleKillConfirm:b6,openKillConfirm:b4,openActiveKillConfirm:b5,killTarget:b$,isKillPending:b0,handleLoadContent:cw,handleLoadError:cx,handleMessageSent:bX,handleMobileFileViewerClose:bK,handleMobileTabChange:bW,handleMove:ch,resetFileTreeView:bM,handleMoveCancel:cj,handleMoveConfirm:ci,handleNewDirectory:cc,handleNewFile:b9,handleNewFileCancel:cb,handleNewFileConfirm:ca,handleOpenFile:bJ,handlePromptDismiss:bV,handlePromptRespond:bU,handleRename:cd,handleReLogin:cr,handleRetry:cq,handleSetLoading:cy,handleShowArchivedChange:a0,handleUpload:cm,handleVibeLocalContextWindowChange:bD,rosterReady:av,instanceSelectionRequest:bx,acknowledgeInstanceSelection:bz,handleVibeLocalModelChange:bC,hasUpdate:co,historyDisplayLimit:a3,historySubTab:aZ,historyUserOnly:a1,isAuthExpired:C,isInfoModalOpen:M,isMobile:c,isMoveDialogOpen:cg,isReconnecting:A,isSelectionListActive:ae.isSelectionListActive,isPagerActive:ae.isPagerActive,promptAnswerable:$,promptAutoYesEnterSent:aa,promptAutoYesDecision:ac,offersPlanApprove:ae.offersPlanApprove,isTrustConfirmationActive:ae.isTrustConfirmationActive,isDismissablePanelActive:ae.isDismissablePanelActive,isUnclassifiedActive:ae.isUnclassifiedActive,sessionStatus:ae.sessionStatus,agentMode:ae.agentMode,startingSince:ae.startingSince,lastAutoResponse:cp,loading:u,makeAutoYesToggleHandler:bY,mobileFileViewerPath:Q,mobileSelectedAgents:bw,moveTarget:cf,newFileParentPath:aU,openMobileDrawer:f,pendingInsertText:a9,pendingInsertTextMap:a8,selectedAgents:aj,selectionListReading:S,setActiveInstanceId:aG,setFocusedSplitIndex:ba,setHistorySubTab:a$,setWorktree:t,showArchived:a_,showNewFileDialog:aS,showToast:bF,state:j,tCommon:n,tWorktree:l,tabsActions:P,tabsState:O,toggleInstanceVisible:bt,vibeLocalContextWindow:ay,verification:cA,vibeLocalModel:aw,visibleInstanceIds:bs,worktree:s,worktreeName:cu,worktreeStatus:cs}}({worktreeId:a});(0,jp.uH)();let bK=(0,h.c)("auth"),[bL,bM]=(0,e.useState)(!1),[bN,bQ]=(0,e.useState)(null),[bS,bT]=(0,e.useState)(am.wf),bU="terminal"===j&&"chat"===bS,bV=(0,e.useCallback)(a=>{"memo"!==a&&bQ(null),as(a)},[as]),bW=(0,e.useCallback)(()=>{bQ(a=>({tab:"verification",token:(a?.token??0)+1})),as("memo")},[as]),bX=function({worktreeId:a,active:b}){let{addListener:c}=(0,db.xM)(),[d,f]=(0,e.useState)(!1);return(0,e.useRef)(b).current=b,!b&&d}({worktreeId:a,active:"terminal"===j}),{viewportHeight:bY}=function(){let[a,b]=(0,e.useState)(!1),[c,d]=(0,e.useState)(0),[f,g]=(0,e.useState)(null);return(0,e.useCallback)(()=>{},[]),{isKeyboardVisible:a,keyboardHeight:c,viewportHeight:f}}(),bZ=(0,e.useCallback)(a=>{let b=jI.indexOf(j);if(-1===b)return;let c=b+a;c<0||c>=jI.length||bV(jI[c])},[j,bV]),{ref:b$}=K({axis:"horizontal",threshold:60,edgeStartZone:32*("terminal"===j),onSwipeLeft:()=>bZ(1),onSwipeRight:()=>bZ(-1)}),b1=(0,e.useMemo)(()=>({worktreePath:bH?.path,openFile:W}),[bH?.path,W]),b2=(bH?.sessionStatusByInstance?.[f]??bH?.sessionStatusByCli?.[c])?.isRunning??!1,b4="number"==typeof a7||"number"==typeof bH?.sessionStatusByInstance?.[f]?.startingSince,[b5,b6]=(0,e.useState)(!1),b8="terminal"!==j?"tab":"chat"===bS?"chat":b2?null:"session",b9=b5&&null===b8;(0,e.useEffect)(()=>{b6(!1)},[a,c,f]),(0,e.useEffect)(()=>{b2||b6(!1)},[b2]),(0,e.useEffect)(()=>{("terminal"!==j||"chat"===bS)&&b6(!1)},[j,bS]);let ca=(0,e.useCallback)(()=>b6(!0),[]),cb=(0,e.useCallback)(()=>b6(!1),[]),cc=aS&&!b9&&!b4&&(!n||R(bv.prompt.data,aX,aZ)),{showStuckHint:cd,markSubmitted:ce}=(0,i1.Cb)({promptData:cc&&bv.prompt.visible?bv.prompt.data:null,targetKey:`${a}:${c}:${f}`}),cf=(0,L.KX)(bv.prompt.visible?bv.prompt.data:null),cg=(0,e.useMemo)(()=>U(bv.prompt.data,c),[bv.prompt.data,c]),ch=(0,e.useCallback)(async b=>{let d;if(ce(),!cf)return void await aC(b);try{let e=await fetch(`/api/worktrees/${a}/respond`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i9(cf,b,c,f))});d=await (0,ja.a_)(e)}catch(a){console.error("[WorktreeDetailRefactored] Error answering a decision:",a),d="failed"}if("answered"===d)aB();else{let a=ja.J4[d];bu(bx(a.messageKey),a.type)}await A()},[ce,aC,cf,a,c,f,bu,bx,A,aB]),[ci,cj]=(0,e.useState)(0),ck=(0,e.useCallback)(()=>{(0,di.CO)(),(0,di.If)((0,di.NP)(a),"terminal"),as("terminal"),bT("terminal"),cj(a=>a+1),b6(!0)},[a,as]);if(a9)return(0,d.jsx)(cG,{});if(aQ)return(0,d.jsx)(jG,{message:bx("editor.sessionExpired"),loginLabel:bK("login.submitButton"),onLogin:aE});if(z)return(0,d.jsx)(cH,{message:z,onRetry:aF});let cl=(0,al.O6)(k,f,c),cm=aj?.label??cl,cn=(bH?.sessionStatusByInstance?.[f]??bH?.sessionStatusByCli?.[c])?.isProcessing??!1;return aS?(0,d.jsx)(G.t,{componentName:"WorktreeDetailRefactored",children:(0,d.jsx)(c7,{onInsertToComposer:ad,children:(0,d.jsxs)(c9.k,{value:b1,children:[aU&&(0,d.jsx)(jF,{label:bw("connection.reconnecting")}),(0,d.jsxs)("div",{className:"flex flex-col overflow-hidden",style:{height:null!=bY?`${bY}px`:"100%"},"data-testid":"mobile-worktree-shell",children:[(0,d.jsx)("div",{className:"flex-shrink-0",children:(0,d.jsx)(v,{worktreeName:bI,repositoryName:bH?.repositoryName,status:bJ,statusUnclassified:cw(bJ,bH?.sessionStatusByCli,c),gitStatus:bH?.gitStatus,onMenuClick:bf})}),bC.task&&!b9&&(0,d.jsx)("div",{className:"flex-shrink-0 border-b border-border bg-surface px-3 py-1.5",children:(0,d.jsx)(jg,{task:bC.task,latestRun:bC.latestRun,latestRunGates:null!==bC.selectedRun&&bC.selectedRun.id===bC.latestRun?.id?bC.selectedRun.gates:null,onOpen:bW,className:"w-full justify-start"})}),bH?.gitStatus&&bH.gitStatus.isBranchMismatch&&!b9&&(0,d.jsx)("div",{className:"z-35 flex-shrink-0",children:(0,d.jsx)(jh,{isBranchMismatch:bH.gitStatus.isBranchMismatch,currentBranch:bH.gitStatus.currentBranch,initialBranch:bH.gitStatus.initialBranch})}),(0,d.jsxs)("div",{className:"flex-shrink-0 z-30 flex items-center gap-2 px-3 py-1.5 bg-surface-2 border-b border-border",children:[(0,d.jsx)("nav",{className:"flex gap-1 flex-1 min-w-0 overflow-x-auto scrollbar-hide","aria-label":bx("detail.agentInstanceSelection"),children:y.map(a=>{let b=bH?.sessionStatusByInstance?.[a.id]??bH?.sessionStatusByCli?.[a.cliTool],c=(0,b0.kA)(b),e=(0,m.Mq)(c,(0,b0.px)(b)),g=bw(e?m.rH:`status.${c}`),h=f===a.id;return(0,d.jsxs)("button",{onClick:()=>bn(a.id),className:`flex-shrink-0 whitespace-nowrap min-h-[44px] px-1.5 py-1 font-medium text-xs transition-colors flex items-center gap-1 border-b-2 touch-manipulation ${h?"text-accent-600 dark:text-accent-400 border-accent-500":"text-muted-foreground hover:text-foreground border-transparent"}`,"aria-current":h?"page":void 0,children:[(0,d.jsx)(l.m,{status:c,size:"sm",label:bx("detail.statusPill",{label:(0,al.sw)(a),status:g}),className:e?m.Jd:void 0,"data-unclassified":e?"true":void 0}),(0,al.sw)(a)]},a.id)})}),(0,d.jsx)("button",{type:"button",onClick:()=>bM(!0),className:"flex-shrink-0 flex items-center justify-center min-h-[44px] min-w-[44px] rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors touch-manipulation","aria-label":bx("terminal.moreActions"),"data-testid":"mobile-more-actions-button",children:(0,d.jsx)(i.A,{size:18,"aria-hidden":"true"})})]}),(0,d.jsx)("main",{className:"flex-1 min-h-0 overflow-y-auto",ref:b$,children:(0,d.jsx)(hD,{activeTab:j,worktreeId:a,worktree:bH,messages:bv.messages,cliToolId:c,instanceId:f,onFilePathClick:W,onFileSelect:X,onWorktreeUpdate:br,onNewFile:ax,onNewDirectory:aw,onRename:aD,onDelete:O,onUpload:aJ,onMove:at,onFileTreeReset:bA,refreshTrigger:D,fileSearch:C,showToast:bu,selectedAgents:bc,onSelectedAgentsChange:jH,useInstanceManagement:!0,instances:k,onInstancesChange:J,visibleInstanceIds:bG,onToggleInstanceVisible:bB,vibeLocalModel:bE,onVibeLocalModelChange:aL,vibeLocalContextWindow:bD,onVibeLocalContextWindowChange:aK,disableAutoFollow:x,historySubTab:aO,onHistorySubTabChange:bq,onDiffSelect:P,onInsertToMessage:ad,showArchived:bs,onShowArchivedChange:aI,historyDisplayLimit:aN,onHistoryDisplayLimitChange:Y,historyUserOnly:aP,onHistoryUserOnlyChange:Z,verification:bC,toolsSubTabRequest:bN,onSurfaceModeChange:bT,directInputOpen:b9},ci)}),(0,d.jsxs)("div",{className:"flex-shrink-0 border-t border-border bg-surface z-30",children:[b9?(0,d.jsx)(a_,{worktreeId:a,cliToolId:c,instanceId:f,onKeysSent:A,onClose:cb},`${a}:${c}:${f}`):null,aV&&!bU&&!b9&&!b4&&(0,d.jsx)("div",{className:"px-2 pt-1 border-b border-border",children:(0,d.jsx)(a1.Z,{worktreeId:a,cliToolId:c,instanceId:f,onKeysSent:A,reading:a$,trustConfirmation:a0,surface:"terminal",showPagerKeys:aW})}),(0,d.jsx)("div",{className:b9?"p-2 hidden":"p-2","aria-hidden":!!b9||void 0,"data-testid":"mobile-composer-wrapper",children:(0,d.jsx)(jJ,{worktreeId:a,onMessageSent:aq,cliToolId:c,instanceId:f,isSessionRunning:b2,isSessionStarting:b4,isProcessing:cn,showToast:bu,pendingInsertText:bi,onInsertConsumed:ac,agentModeSlot:(0,d.jsx)(iO,{worktreeId:a,cliToolId:c,instanceId:f,agentMode:a6,sessionStatus:a5,isPromptWaiting:bv.prompt.visible,isSelectionListActive:aV,isDismissablePanelActive:a2,isUnclassifiedActive:a3,onKeysSent:A}),autoYesSlot:(0,d.jsx)(i5.T,{enabled:n,expiresAt:o,onToggle:M,lastAutoResponse:a8,cliToolName:c,inline:!0,showToolName:!1,blockedByContract:q,releasedByRestart:r,answerMode:s})})})]}),(0,d.jsx)(E,{activeTab:j,onTabChange:bV,hasNewOutput:bX,hasPrompt:bv.prompt.visible,hasUpdate:aM,inFlow:!0}),cc&&(0,d.jsx)($,{promptData:cg,visible:bv.prompt.visible,answering:bv.prompt.answering,onRespond:ch,onDismiss:aB,cliToolName:(0,al.oo)(c),showStuckHint:cd,onSwitchToDirectInput:b2?ck:void 0,answerable:aX,autoYesEnterSent:aY}),(0,d.jsx)(aG,{open:bL,onClose:()=>bM(!1),searchTarget:bU?"chat":"terminal",onSearch:()=>window.dispatchEvent(new CustomEvent(bU?"chat-search-open":"terminal-search-open")),onEnd:ai,endDisabled:!b2,onDirectInput:ca,directInputUnavailableReason:b8}),(0,d.jsx)(bF,{isOpen:null!==bb,onClose:ar,worktreeId:a,filePath:bb??"",onFileSaved:S,onOpenFile:W}),(0,d.jsx)("input",{ref:B,type:"file",accept:bh.join(","),onChange:T,className:"hidden","aria-label":bx("detail.uploadFile")}),(0,d.jsx)(b_.a,{isOpen:null!==aj,onClose:af,title:bx("session.confirmEnd",{tool:cm}),size:"sm",showCloseButton:!0,children:(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)("p",{className:"text-sm text-foreground",children:bx("session.endWarning")}),(0,d.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,d.jsx)("button",{type:"button",onClick:af,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:bw("cancel")}),(0,d.jsx)("button",{type:"button",onClick:ag,disabled:ak,className:"px-4 py-2 text-sm font-medium rounded-md bg-danger hover:bg-danger/90 text-white disabled:opacity-60 disabled:cursor-not-allowed",children:bw("end")})]})]})}),bd&&(0,d.jsx)(jk,{isOpen:aT,onClose:au,onConfirm:av,worktreeId:a,sourcePath:bd.path,sourceType:bd.type}),(0,d.jsx)(jm,{isOpen:bt,parentPath:be,onConfirm:az,onCancel:ay})]})]})})}):(0,d.jsxs)(c9.k,{value:b1,children:[aU&&(0,d.jsx)(jF,{label:bw("connection.reconnecting")}),(0,d.jsx)(jo,{worktreeId:a,worktree:bH,worktreeName:bI,worktreeStatus:bJ,instances:k,rosterReady:bk,activeInstanceId:f,setActiveInstanceId:bn,instanceSelectionRequest:bl,onInstanceSelectionHandled:bm,hasUpdate:aM,lastAutoResponse:a8,activeActivity:b,onActivityToggle:I,onActivityOpen:H,verification:bC,onInfoClick:_,pendingInsertTextMap:bj,setFocusedSplitIndex:bo,handleInsertToSplit:ae,handleInsertConsumed:ab,handleInsertToMessage:ad,autoYesStateMap:t,makeAutoYesToggleHandler:ba,showArchived:bs,onShowArchivedChange:aI,historyDisplayLimit:aN,onHistoryDisplayLimitChange:Y,historyUserOnly:aP,onHistoryUserOnlyChange:Z,onMessageSent:aq,onFilePathClick:W,showToast:bu,tabsState:bz,tabsActions:by,onLoadContent:an,onLoadError:ap,onSetLoading:aH,onFilePanelSave:V,onDirtyChange:Q,onOpenFile:aA,diffContent:u,diffFilePath:w,onCloseDiff:N,fileSearch:C,fileTreeRefresh:D,onFileSelect:X,onNewFile:ax,onNewDirectory:aw,onRename:aD,onDelete:O,onUpload:aJ,onMove:at,onFileTreeReset:bA,onDiffSelect:P,onAgentInstancesChange:J,vibeLocalModel:bE,onVibeLocalModelChange:aL,vibeLocalContextWindow:bD,onVibeLocalContextWindowChange:aK,isInfoModalOpen:aR,onInfoModalClose:aa,onWorktreeUpdate:br,fileInputRef:B,onFileInputChange:T,onKillSession:ai,onRequestSessionEnd:ah,killTarget:aj,isKillPending:ak,onKillCancel:af,onKillConfirm:ag,moveTarget:bd,isMoveDialogOpen:aT,onMoveCancel:au,onMoveConfirm:av,showNewFileDialog:bt,newFileParentPath:be,onNewFileConfirm:az,onNewFileCancel:ay,killDialogTitle:bx("session.confirmEnd",{tool:cm}),killDialogWarning:bx("session.endWarning"),cancelLabel:bw("cancel"),endLabel:bw("end")})]})});function jL(){let a=(0,g.useParams)().id;return(0,d.jsx)(jK,{worktreeId:a})}c(45848)},75662:a=>{a.exports=function(a){return{name:"Dust",aliases:["dst"],case_insensitive:!0,subLanguage:"xml",contains:[{className:"template-tag",begin:/\{[#\/]/,end:/\}/,illegal:/;/,contains:[{className:"name",begin:/[a-zA-Z\.-]+/,starts:{endsWithParent:!0,relevance:0,contains:[a.QUOTE_STRING_MODE]}}]},{className:"template-variable",begin:/\{/,end:/\}/,illegal:/;/,keywords:"if eq ne lt lte gt gte select default math sep"}]}}},75796:(a,b,c)=>{Promise.resolve().then(c.bind(c,75099))},76760:a=>{"use strict";a.exports=require("node:path")},77227:a=>{var b="[0-9](_*[0-9])*",c=`\\.(${b})`,d="[0-9a-fA-F](_*[0-9a-fA-F])*",e={className:"number",variants:[{begin:`(\\b(${b})((${c})|\\.)?|(${c}))[eE][+-]?(${b})[fFdD]?\\b`},{begin:`\\b(${b})((${c})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${c})[fFdD]?\\b`},{begin:`\\b(${b})[fFdD]\\b`},{begin:`\\b0[xX]((${d})\\.?|(${d})?\\.(${d}))[pP][+-]?(${b})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${d})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};a.exports=function(a){let b={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},c={className:"symbol",begin:a.UNDERSCORE_IDENT_RE+"@"},d={className:"subst",begin:/\$\{/,end:/\}/,contains:[a.C_NUMBER_MODE]},f={className:"variable",begin:"\\$"+a.UNDERSCORE_IDENT_RE},g={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[f,d]},{begin:"'",end:"'",illegal:/\n/,contains:[a.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[a.BACKSLASH_ESCAPE,f,d]}]};d.contains.push(g);let h={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+a.UNDERSCORE_IDENT_RE+")?"},i={className:"meta",begin:"@"+a.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[a.inherit(g,{className:"string"}),"self"]}]},j=a.COMMENT("/\\*","\\*/",{contains:[a.C_BLOCK_COMMENT_MODE]}),k={variants:[{className:"type",begin:a.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]};return k.variants[1].contains=[k],k.variants[1].contains=[k],{name:"Kotlin",aliases:["kt","kts"],keywords:b,contains:[a.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),a.C_LINE_COMMENT_MODE,j,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},c,h,i,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:b,relevance:5,contains:[{begin:a.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[a.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:b,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[k,a.C_LINE_COMMENT_MODE,j],relevance:0},a.C_LINE_COMMENT_MODE,j,h,i,g,a.C_NUMBER_MODE]},j]},{begin:[/class|interface|trait/,/\s+/,a.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},a.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},h,i]},g,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},e]}}},77525:a=>{a.exports=function(a){let b={keyword:"bool break call callexe checkinterrupt clear clearg closeall cls comlog compile continue create debug declare delete disable dlibrary dllcall do dos ed edit else elseif enable end endfor endif endp endo errorlog errorlogat expr external fn for format goto gosub graph if keyword let lib library line load loadarray loadexe loadf loadk loadm loadp loads loadx local locate loopnextindex lprint lpwidth lshow matrix msym ndpclex new open output outwidth plot plotsym pop prcsn print printdos proc push retp return rndcon rndmod rndmult rndseed run save saveall screen scroll setarray show sparse stop string struct system trace trap threadfor threadendfor threadbegin threadjoin threadstat threadend until use while winprint ne ge le gt lt and xor or not eq eqv",built_in:"abs acf aconcat aeye amax amean AmericanBinomCall AmericanBinomCall_Greeks AmericanBinomCall_ImpVol AmericanBinomPut AmericanBinomPut_Greeks AmericanBinomPut_ImpVol AmericanBSCall AmericanBSCall_Greeks AmericanBSCall_ImpVol AmericanBSPut AmericanBSPut_Greeks AmericanBSPut_ImpVol amin amult annotationGetDefaults annotationSetBkd annotationSetFont annotationSetLineColor annotationSetLineStyle annotationSetLineThickness annualTradingDays arccos arcsin areshape arrayalloc arrayindex arrayinit arraytomat asciiload asclabel astd astds asum atan atan2 atranspose axmargin balance band bandchol bandcholsol bandltsol bandrv bandsolpd bar base10 begwind besselj bessely beta box boxcox cdfBeta cdfBetaInv cdfBinomial cdfBinomialInv cdfBvn cdfBvn2 cdfBvn2e cdfCauchy cdfCauchyInv cdfChic cdfChii cdfChinc cdfChincInv cdfExp cdfExpInv cdfFc cdfFnc cdfFncInv cdfGam cdfGenPareto cdfHyperGeo cdfLaplace cdfLaplaceInv cdfLogistic cdfLogisticInv cdfmControlCreate cdfMvn cdfMvn2e cdfMvnce cdfMvne cdfMvt2e cdfMvtce cdfMvte cdfN cdfN2 cdfNc cdfNegBinomial cdfNegBinomialInv cdfNi cdfPoisson cdfPoissonInv cdfRayleigh cdfRayleighInv cdfTc cdfTci cdfTnc cdfTvn cdfWeibull cdfWeibullInv cdir ceil ChangeDir chdir chiBarSquare chol choldn cholsol cholup chrs close code cols colsf combinate combinated complex con cond conj cons ConScore contour conv convertsatostr convertstrtosa corrm corrms corrvc corrx corrxs cos cosh counts countwts crossprd crout croutp csrcol csrlin csvReadM csvReadSA cumprodc cumsumc curve cvtos datacreate datacreatecomplex datalist dataload dataloop dataopen datasave date datestr datestring datestrymd dayinyr dayofweek dbAddDatabase dbClose dbCommit dbCreateQuery dbExecQuery dbGetConnectOptions dbGetDatabaseName dbGetDriverName dbGetDrivers dbGetHostName dbGetLastErrorNum dbGetLastErrorText dbGetNumericalPrecPolicy dbGetPassword dbGetPort dbGetTableHeaders dbGetTables dbGetUserName dbHasFeature dbIsDriverAvailable dbIsOpen dbIsOpenError dbOpen dbQueryBindValue dbQueryClear dbQueryCols dbQueryExecPrepared dbQueryFetchAllM dbQueryFetchAllSA dbQueryFetchOneM dbQueryFetchOneSA dbQueryFinish dbQueryGetBoundValue dbQueryGetBoundValues dbQueryGetField dbQueryGetLastErrorNum dbQueryGetLastErrorText dbQueryGetLastInsertID dbQueryGetLastQuery dbQueryGetPosition dbQueryIsActive dbQueryIsForwardOnly dbQueryIsNull dbQueryIsSelect dbQueryIsValid dbQueryPrepare dbQueryRows dbQuerySeek dbQuerySeekFirst dbQuerySeekLast dbQuerySeekNext dbQuerySeekPrevious dbQuerySetForwardOnly dbRemoveDatabase dbRollback dbSetConnectOptions dbSetDatabaseName dbSetHostName dbSetNumericalPrecPolicy dbSetPort dbSetUserName dbTransaction DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl dfft dffti diag diagrv digamma doswin DOSWinCloseall DOSWinOpen dotfeq dotfeqmt dotfge dotfgemt dotfgt dotfgtmt dotfle dotflemt dotflt dotfltmt dotfne dotfnemt draw drop dsCreate dstat dstatmt dstatmtControlCreate dtdate dtday dttime dttodtv dttostr dttoutc dtvnormal dtvtodt dtvtoutc dummy dummybr dummydn eig eigh eighv eigv elapsedTradingDays endwind envget eof eqSolve eqSolvemt eqSolvemtControlCreate eqSolvemtOutCreate eqSolveset erf erfc erfccplx erfcplx error etdays ethsec etstr EuropeanBinomCall EuropeanBinomCall_Greeks EuropeanBinomCall_ImpVol EuropeanBinomPut EuropeanBinomPut_Greeks EuropeanBinomPut_ImpVol EuropeanBSCall EuropeanBSCall_Greeks EuropeanBSCall_ImpVol EuropeanBSPut EuropeanBSPut_Greeks EuropeanBSPut_ImpVol exctsmpl exec execbg exp extern eye fcheckerr fclearerr feq feqmt fflush fft ffti fftm fftmi fftn fge fgemt fgets fgetsa fgetsat fgetst fgt fgtmt fileinfo filesa fle flemt floor flt fltmt fmod fne fnemt fonts fopen formatcv formatnv fputs fputst fseek fstrerror ftell ftocv ftos ftostrC gamma gammacplx gammaii gausset gdaAppend gdaCreate gdaDStat gdaDStatMat gdaGetIndex gdaGetName gdaGetNames gdaGetOrders gdaGetType gdaGetTypes gdaGetVarInfo gdaIsCplx gdaLoad gdaPack gdaRead gdaReadByIndex gdaReadSome gdaReadSparse gdaReadStruct gdaReportVarInfo gdaSave gdaUpdate gdaUpdateAndPack gdaVars gdaWrite gdaWrite32 gdaWriteSome getarray getdims getf getGAUSShome getmatrix getmatrix4D getname getnamef getNextTradingDay getNextWeekDay getnr getorders getpath getPreviousTradingDay getPreviousWeekDay getRow getscalar3D getscalar4D getTrRow getwind glm gradcplx gradMT gradMTm gradMTT gradMTTm gradp graphprt graphset hasimag header headermt hess hessMT hessMTg hessMTgw hessMTm hessMTmw hessMTT hessMTTg hessMTTgw hessMTTm hessMTw hessp hist histf histp hsec imag indcv indexcat indices indices2 indicesf indicesfn indnv indsav integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 inthpControlCreate intquad1 intquad2 intquad3 intrleav intrleavsa intrsect intsimp inv invpd invswp iscplx iscplxf isden isinfnanmiss ismiss key keyav keyw lag lag1 lagn lapEighb lapEighi lapEighvb lapEighvi lapgEig lapgEigh lapgEighv lapgEigv lapgSchur lapgSvdcst lapgSvds lapgSvdst lapSvdcusv lapSvds lapSvdusv ldlp ldlsol linSolve listwise ln lncdfbvn lncdfbvn2 lncdfmvn lncdfn lncdfn2 lncdfnc lnfact lngammacplx lnpdfmvn lnpdfmvt lnpdfn lnpdft loadd loadstruct loadwind loess loessmt loessmtControlCreate log loglog logx logy lower lowmat lowmat1 ltrisol lu lusol machEpsilon make makevars makewind margin matalloc matinit mattoarray maxbytes maxc maxindc maxv maxvec mbesselei mbesselei0 mbesselei1 mbesseli mbesseli0 mbesseli1 meanc median mergeby mergevar minc minindc minv miss missex missrv moment momentd movingave movingaveExpwgt movingaveWgt nextindex nextn nextnevn nextwind ntos null null1 numCombinations ols olsmt olsmtControlCreate olsqr olsqr2 olsqrmt ones optn optnevn orth outtyp pacf packedToSp packr parse pause pdfCauchy pdfChi pdfExp pdfGenPareto pdfHyperGeo pdfLaplace pdfLogistic pdfn pdfPoisson pdfRayleigh pdfWeibull pi pinv pinvmt plotAddArrow plotAddBar plotAddBox plotAddHist plotAddHistF plotAddHistP plotAddPolar plotAddScatter plotAddShape plotAddTextbox plotAddTS plotAddXY plotArea plotBar plotBox plotClearLayout plotContour plotCustomLayout plotGetDefaults plotHist plotHistF plotHistP plotLayout plotLogLog plotLogX plotLogY plotOpenWindow plotPolar plotSave plotScatter plotSetAxesPen plotSetBar plotSetBarFill plotSetBarStacked plotSetBkdColor plotSetFill plotSetGrid plotSetLegend plotSetLineColor plotSetLineStyle plotSetLineSymbol plotSetLineThickness plotSetNewWindow plotSetTitle plotSetWhichYAxis plotSetXAxisShow plotSetXLabel plotSetXRange plotSetXTicInterval plotSetXTicLabel plotSetYAxisShow plotSetYLabel plotSetYRange plotSetZAxisShow plotSetZLabel plotSurface plotTS plotXY polar polychar polyeval polygamma polyint polymake polymat polymroot polymult polyroot pqgwin previousindex princomp printfm printfmt prodc psi putarray putf putvals pvCreate pvGetIndex pvGetParNames pvGetParVector pvLength pvList pvPack pvPacki pvPackm pvPackmi pvPacks pvPacksi pvPacksm pvPacksmi pvPutParVector pvTest pvUnpack QNewton QNewtonmt QNewtonmtControlCreate QNewtonmtOutCreate QNewtonSet QProg QProgmt QProgmtInCreate qqr qqre qqrep qr qre qrep qrsol qrtsol qtyr qtyre qtyrep quantile quantiled qyr qyre qyrep qz rank rankindx readr real reclassify reclassifyCuts recode recserar recsercp recserrc rerun rescale reshape rets rev rfft rffti rfftip rfftn rfftnp rfftp rndBernoulli rndBeta rndBinomial rndCauchy rndChiSquare rndCon rndCreateState rndExp rndGamma rndGeo rndGumbel rndHyperGeo rndi rndKMbeta rndKMgam rndKMi rndKMn rndKMnb rndKMp rndKMu rndKMvm rndLaplace rndLCbeta rndLCgam rndLCi rndLCn rndLCnb rndLCp rndLCu rndLCvm rndLogNorm rndMTu rndMVn rndMVt rndn rndnb rndNegBinomial rndp rndPoisson rndRayleigh rndStateSkip rndu rndvm rndWeibull rndWishart rotater round rows rowsf rref sampleData satostrC saved saveStruct savewind scale scale3d scalerr scalinfnanmiss scalmiss schtoc schur searchsourcepath seekr select selif seqa seqm setdif setdifsa setvars setvwrmode setwind shell shiftr sin singleindex sinh sleep solpd sortc sortcc sortd sorthc sorthcc sortind sortindc sortmc sortr sortrc spBiconjGradSol spChol spConjGradSol spCreate spDenseSubmat spDiagRvMat spEigv spEye spLDL spline spLU spNumNZE spOnes spreadSheetReadM spreadSheetReadSA spreadSheetWrite spScale spSubmat spToDense spTrTDense spTScalar spZeros sqpSolve sqpSolveMT sqpSolveMTControlCreate sqpSolveMTlagrangeCreate sqpSolveMToutCreate sqpSolveSet sqrt statements stdc stdsc stocv stof strcombine strindx strlen strput strrindx strsect strsplit strsplitPad strtodt strtof strtofcplx strtriml strtrimr strtrunc strtruncl strtruncpad strtruncr submat subscat substute subvec sumc sumr surface svd svd1 svd2 svdcusv svds svdusv sysstate tab tan tanh tempname time timedt timestr timeutc title tkf2eps tkf2ps tocart todaydt toeplitz token topolar trapchk trigamma trimr trunc type typecv typef union unionsa uniqindx uniqindxsa unique uniquesa upmat upmat1 upper utctodt utctodtv utrisol vals varCovMS varCovXS varget vargetl varmall varmares varput varputl vartypef vcm vcms vcx vcxs vec vech vecr vector vget view viewxyz vlist vnamecv volume vput vread vtypecv wait waitc walkindex where window writer xlabel xlsGetSheetCount xlsGetSheetSize xlsGetSheetTypes xlsMakeRange xlsReadM xlsReadSA xlsWrite xlsWriteM xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics cdfEmpirical dot h5create h5open h5read h5readAttribute h5write h5writeAttribute ldl plotAddErrorBar plotAddSurface plotCDFEmpirical plotSetColormap plotSetContourLabels plotSetLegendFont plotSetTextInterpreter plotSetXTicCount plotSetYTicCount plotSetZLevels powerm strjoin sylvester strtrim",literal:"DB_AFTER_LAST_ROW DB_ALL_TABLES DB_BATCH_OPERATIONS DB_BEFORE_FIRST_ROW DB_BLOB DB_EVENT_NOTIFICATIONS DB_FINISH_QUERY DB_HIGH_PRECISION DB_LAST_INSERT_ID DB_LOW_PRECISION_DOUBLE DB_LOW_PRECISION_INT32 DB_LOW_PRECISION_INT64 DB_LOW_PRECISION_NUMBERS DB_MULTIPLE_RESULT_SETS DB_NAMED_PLACEHOLDERS DB_POSITIONAL_PLACEHOLDERS DB_PREPARED_QUERIES DB_QUERY_SIZE DB_SIMPLE_LOCKING DB_SYSTEM_TABLES DB_TABLES DB_TRANSACTIONS DB_UNICODE DB_VIEWS __STDIN __STDOUT __STDERR __FILE_DIR"},c=a.COMMENT("@","@"),d={className:"meta",begin:"#",end:"$",keywords:{keyword:"define definecs|10 undef ifdef ifndef iflight ifdllcall ifmac ifos2win ifunix else endif lineson linesoff srcfile srcline"},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",end:"$",keywords:{keyword:"include"},contains:[{className:"string",begin:'"',end:'"',illegal:"\\n"}]},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,c]},e={begin:/\bstruct\s+/,end:/\s/,keywords:"struct",contains:[{className:"type",begin:a.UNDERSCORE_IDENT_RE,relevance:0}]},f=[{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,endsWithParent:!0,relevance:0,contains:[{className:"literal",begin:/\.\.\./},a.C_NUMBER_MODE,a.C_BLOCK_COMMENT_MODE,c,e]}],g={className:"title",begin:a.UNDERSCORE_IDENT_RE,relevance:0},h=function(b,d,e){let h=a.inherit({className:"function",beginKeywords:b,end:d,excludeEnd:!0,contains:[].concat(f)},{});return h.contains.push(g),h.contains.push(a.C_NUMBER_MODE),h.contains.push(a.C_BLOCK_COMMENT_MODE),h.contains.push(c),h},i={className:"built_in",begin:"\\b("+b.built_in.split(" ").join("|")+")\\b"},j={className:"string",begin:'"',end:'"',contains:[a.BACKSLASH_ESCAPE],relevance:0},k={begin:a.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,keywords:b,relevance:0,contains:[{beginKeywords:b.keyword},i,{className:"built_in",begin:a.UNDERSCORE_IDENT_RE,relevance:0}]},l={begin:/\(/,end:/\)/,relevance:0,keywords:{built_in:b.built_in,literal:b.literal},contains:[a.C_NUMBER_MODE,a.C_BLOCK_COMMENT_MODE,c,i,k,j,"self"]};return k.contains.push(l),{name:"GAUSS",aliases:["gss"],case_insensitive:!0,keywords:b,illegal:/(\{[%#]|[%#]\}| <- )/,contains:[a.C_NUMBER_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,c,j,d,{className:"keyword",begin:/\bexternal (matrix|string|array|sparse matrix|struct|proc|keyword|fn)/},h("proc keyword",";"),h("fn","="),{beginKeywords:"for threadfor",end:/;/,relevance:0,contains:[a.C_BLOCK_COMMENT_MODE,c,l]},{variants:[{begin:a.UNDERSCORE_IDENT_RE+"\\."+a.UNDERSCORE_IDENT_RE},{begin:a.UNDERSCORE_IDENT_RE+"\\s*="}],relevance:0},k,e]}}},77917:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(23339).A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},78267:a=>{a.exports=function(a){let b="[ \\t\\f]*",c=b+"[:=]"+b,d="[ \\t\\f]+",e="([^\\\\:= \\t\\f\\n]|\\\\.)+";return{name:".properties",disableAutodetect:!0,case_insensitive:!0,illegal:/\S/,contains:[a.COMMENT("^\\s*[!#]","$"),{returnBegin:!0,variants:[{begin:e+c},{begin:e+d}],contains:[{className:"attr",begin:e,endsParent:!0}],starts:{end:"("+c+"|"+d+")",relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\\\"},{begin:"\\\\\\n"}]}}},{className:"attr",begin:e+b+"$"}]}}},78460:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(23339).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},79001:a=>{let b="[A-Za-z$_][0-9A-Za-z$_]*",c=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],d=["true","false","null","undefined","NaN","Infinity"],e=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],f=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],g=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],h=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],i=[].concat(g,e,f);a.exports=function(a){let j=a.regex,k=function(a){var j;let k=a.regex,l=/<[A-Za-z0-9\\._:-]+/,m=/\/[A-Za-z0-9\\._:-]+>|\/>/,n={$pattern:b,keyword:c,literal:d,built_in:i,"variable.language":h},o="[0-9](_?[0-9])*",p=`\\.(${o})`,q="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",r={className:"number",variants:[{begin:`(\\b(${q})((${p})|\\.)?|(${p}))[eE][+-]?(${o})\\b`},{begin:`\\b(${q})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},s={className:"subst",begin:"\\$\\{",end:"\\}",keywords:n,contains:[]},t={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,s],subLanguage:"xml"}},u={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,s],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[a.BACKSLASH_ESCAPE,s],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[a.BACKSLASH_ESCAPE,s]},x={className:"comment",variants:[a.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:b+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),a.C_BLOCK_COMMENT_MODE,a.C_LINE_COMMENT_MODE]},y=[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,t,u,v,w,{match:/\$\d+/},r];s.contains=y.concat({begin:/\{/,end:/\}/,keywords:n,contains:["self"].concat(y)});let z=[].concat(x,s.contains),A=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:n,contains:["self"].concat(z)}]),B={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:A},C={variants:[{match:[/class/,/\s+/,b,/\s+/,/extends/,/\s+/,k.concat(b,"(",k.concat(/\./,b),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,b],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:k.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...e,...f]}},E={match:k.concat(/\b/,(j=[...g,"super","import"].map(a=>`${a}\\s*\\(`),k.concat("(?!",j.join("|"),")")),b,k.lookahead(/\s*\(/)),className:"title.function",relevance:0},F={begin:k.concat(/\./,k.lookahead(k.concat(b,/(?![0-9A-Za-z$_(])/))),end:b,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+a.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,b,/\s*/,/=\s*/,/(async\s*)?/,k.lookahead(G)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[B]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:n,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[a.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,t,u,v,w,x,{match:/\$\d+/},r,D,{scope:"attr",match:b+k.lookahead(":"),relevance:0},H,{begin:"("+a.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,a.REGEXP_MODE,{className:"function",begin:G,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:a.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:l,"on:begin":(a,b)=>{let c,d=a[0].length+a.index,e=a.input[d];if("<"===e||","===e)return void b.ignoreMatch();">"!==e||((a,{after:b})=>{let c="</"+a[0].slice(1);return -1!==a.input.indexOf(c,b)})(a,{after:d})||b.ignoreMatch();let f=a.input.substring(d);if((c=f.match(/^\s*=/))||(c=f.match(/^\s+extends\s+/))&&0===c.index)return void b.ignoreMatch()},end:m}],subLanguage:"xml",contains:[{begin:l,end:m,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,b,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[B],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+a.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[B,a.inherit(a.TITLE_MODE,{begin:b,className:"title.function"})]},{match:/\.\.\./,relevance:0},F,{match:"\\$"+b,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[B]},E,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},C,{match:[/get|set/,/\s+/,b,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},B]},{match:/\$[(.]/}]}}(a),l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],m={begin:[/namespace/,/\s+/,a.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},n={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[k.exports.CLASS_REFERENCE]},o={$pattern:b,keyword:c.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:d,built_in:i.concat(l),"variable.language":h},p={className:"meta",begin:"@"+b},q=(a,b,c)=>{let d=a.contains.findIndex(a=>a.label===b);if(-1===d)throw Error("can not find mode to replace");a.contains.splice(d,1,c)};Object.assign(k.keywords,o),k.exports.PARAMS_CONTAINS.push(p);let r=k.contains.find(a=>"attr"===a.scope),s=Object.assign({},r,{match:j.concat(b,j.lookahead(/\s*\?:/))});return k.exports.PARAMS_CONTAINS.push([k.exports.CLASS_REFERENCE,r,s]),k.contains=k.contains.concat([p,m,n,s]),q(k,"shebang",a.SHEBANG()),q(k,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),k.contains.find(a=>"func.def"===a.label).relevance=0,Object.assign(k,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),k}},79322:a=>{a.exports=function(a){let b=a.regex,c="[A-Za-z_][0-9A-Za-z_]*",d={keyword:["break","case","catch","continue","debugger","do","else","export","for","function","if","import","in","new","of","return","switch","try","var","void","while"],literal:["BackSlash","DoubleQuote","ForwardSlash","Infinity","NaN","NewLine","PI","SingleQuote","Tab","TextFormatting","false","null","true","undefined"],built_in:["Abs","Acos","All","Angle","Any","Area","AreaGeodetic","Array","Asin","Atan","Atan2","Attachments","Average","Back","Bearing","Boolean","Buffer","BufferGeodetic","Ceil","Centroid","ChangeTimeZone","Clip","Concatenate","Console","Constrain","Contains","ConvertDirection","ConvexHull","Cos","Count","Crosses","Cut","Date|0","DateAdd","DateDiff","DateOnly","Day","Decode","DefaultValue","Densify","DensifyGeodetic","Dictionary","Difference","Disjoint","Distance","DistanceGeodetic","DistanceToCoordinate","Distinct","Domain","DomainCode","DomainName","EnvelopeIntersects","Equals","Erase","Exp","Expects","Extent","Feature","FeatureInFilter","FeatureSet","FeatureSetByAssociation","FeatureSetById","FeatureSetByName","FeatureSetByPortalItem","FeatureSetByRelationshipClass","FeatureSetByRelationshipName","Filter","FilterBySubtypeCode","Find","First|0","Floor","FromCharCode","FromCodePoint","FromJSON","Front","GdbVersion","Generalize","Geometry","GetEnvironment","GetFeatureSet","GetFeatureSetInfo","GetUser","GroupBy","Guid","HasKey","HasValue","Hash","Hour","IIf","ISOMonth","ISOWeek","ISOWeekday","ISOYear","Includes","IndexOf","Insert","Intersection","Intersects","IsEmpty","IsNan","IsSelfIntersecting","IsSimple","KnowledgeGraphByPortalItem","Left|0","Length","Length3D","LengthGeodetic","Log","Lower","Map","Max","Mean","MeasureToCoordinate","Mid","Millisecond","Min","Minute","Month","MultiPartToSinglePart","Multipoint","NearestCoordinate","NearestVertex","NextSequenceValue","None","Now","Number","Offset","OrderBy","Overlaps","Point","PointToCoordinate","Polygon","Polyline","Pop","Portal","Pow","Proper","Push","QueryGraph","Random","Reduce","Relate","Replace","Resize","Reverse","Right|0","RingIsClockwise","Rotate","Round","Schema","Second","SetGeometry","Simplify","Sin","Slice","Sort","Splice","Split","Sqrt","StandardizeFilename","StandardizeGuid","Stdev","SubtypeCode","SubtypeName","Subtypes","Sum","SymmetricDifference","Tan","Text","Time","TimeZone","TimeZoneOffset","Timestamp","ToCharCode","ToCodePoint","ToHex","ToLocal","ToUTC","Today","Top|0","Touches","TrackAccelerationAt","TrackAccelerationWindow","TrackCurrentAcceleration","TrackCurrentDistance","TrackCurrentSpeed","TrackCurrentTime","TrackDistanceAt","TrackDistanceWindow","TrackDuration","TrackFieldWindow","TrackGeometryWindow","TrackIndex","TrackSpeedAt","TrackSpeedWindow","TrackStartTime","TrackWindow","Trim","TypeOf","Union","Upper","UrlEncode","Variance","Week","Weekday","When|0","Within","Year|0"]},e={className:"symbol",begin:"\\$"+b.either("aggregatedFeatures","analytic","config","datapoint","datastore","editcontext","feature","featureSet","feedfeature","fencefeature","fencenotificationtype","graph","join","layer","locationupdate","map","measure","measure","originalFeature","record","reference","rowindex","sourcedatastore","sourcefeature","sourcelayer","target","targetdatastore","targetfeature","targetlayer","userInput","value","variables","view")},f={className:"number",variants:[{begin:"\\b(0[bB][01]+)"},{begin:"\\b(0[oO][0-7]+)"},{begin:a.C_NUMBER_RE}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},h={className:"string",begin:"`",end:"`",contains:[a.BACKSLASH_ESCAPE,g]};g.contains=[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,h,f,a.REGEXP_MODE];let i=g.contains.concat([a.C_BLOCK_COMMENT_MODE,a.C_LINE_COMMENT_MODE]);return{name:"ArcGIS Arcade",case_insensitive:!0,keywords:d,contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,h,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,e,f,{begin:/[{,]\s*/,relevance:0,contains:[{begin:c+"\\s*:",returnBegin:!0,relevance:0,contains:[{className:"attr",begin:c,relevance:0}]}]},{begin:"("+a.RE_STARTERS_RE+"|\\b(return)\\b)\\s*",keywords:"return",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+c+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:c},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:i}]}]}],relevance:0},{beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[a.inherit(a.TITLE_MODE,{className:"title.function",begin:c}),{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:i}],illegal:/\[|%/},{begin:/\$[(.]/}],illegal:/#(?!!)/}}},79428:a=>{"use strict";a.exports=require("buffer")},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},79996:a=>{a.exports=function(a){let b=["true","false","null"],c={scope:"literal",beginKeywords:b.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:b},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},a.QUOTE_STRING_MODE,c,a.C_NUMBER_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}},80014:a=>{a.exports=function(a){let b=a.COMMENT(/^\s*@?rem\b/,/$/,{relevance:10});return{name:"Batch file (DOS)",aliases:["bat","cmd"],case_insensitive:!0,illegal:/\/\*/,keywords:{keyword:["if","else","goto","for","in","do","call","exit","not","exist","errorlevel","defined","equ","neq","lss","leq","gtr","geq"],built_in:["prn","nul","lpt3","lpt2","lpt1","con","com4","com3","com2","com1","aux","shift","cd","dir","echo","setlocal","endlocal","set","pause","copy","append","assoc","at","attrib","break","cacls","cd","chcp","chdir","chkdsk","chkntfs","cls","cmd","color","comp","compact","convert","date","dir","diskcomp","diskcopy","doskey","erase","fs","find","findstr","format","ftype","graftabl","help","keyb","label","md","mkdir","mode","more","move","path","pause","print","popd","pushd","promt","rd","recover","rem","rename","replace","restore","rmdir","shift","sort","start","subst","time","title","tree","type","ver","verify","vol","ping","net","ipconfig","taskkill","xcopy","ren","del"]},contains:[{className:"variable",begin:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{className:"function",begin:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",end:"goto:eof",contains:[a.inherit(a.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),b]},{className:"number",begin:"\\b\\d+",relevance:0},b]}}},80038:a=>{a.exports=function(a){return{name:"XQuery",aliases:["xpath","xq","xqm"],case_insensitive:!1,illegal:/(proc)|(abstract)|(extends)|(until)|(#)/,keywords:{$pattern:/[a-zA-Z$][a-zA-Z0-9_:-]*/,keyword:["module","schema","namespace","boundary-space","preserve","no-preserve","strip","default","collation","base-uri","ordering","context","decimal-format","decimal-separator","copy-namespaces","empty-sequence","except","exponent-separator","external","grouping-separator","inherit","no-inherit","lax","minus-sign","per-mille","percent","schema-attribute","schema-element","strict","unordered","zero-digit","declare","import","option","function","validate","variable","for","at","in","let","where","order","group","by","return","if","then","else","tumbling","sliding","window","start","when","only","end","previous","next","stable","ascending","descending","allowing","empty","greatest","least","some","every","satisfies","switch","case","typeswitch","try","catch","and","or","to","union","intersect","instance","of","treat","as","castable","cast","map","array","delete","insert","into","replace","value","rename","copy","modify","update"],type:["item","document-node","node","attribute","document","element","comment","namespace","namespace-node","processing-instruction","text","construction","xs:anyAtomicType","xs:untypedAtomic","xs:duration","xs:time","xs:decimal","xs:float","xs:double","xs:gYearMonth","xs:gYear","xs:gMonthDay","xs:gMonth","xs:gDay","xs:boolean","xs:base64Binary","xs:hexBinary","xs:anyURI","xs:QName","xs:NOTATION","xs:dateTime","xs:dateTimeStamp","xs:date","xs:string","xs:normalizedString","xs:token","xs:language","xs:NMTOKEN","xs:Name","xs:NCName","xs:ID","xs:IDREF","xs:ENTITY","xs:integer","xs:nonPositiveInteger","xs:negativeInteger","xs:long","xs:int","xs:short","xs:byte","xs:nonNegativeInteger","xs:unisignedLong","xs:unsignedInt","xs:unsignedShort","xs:unsignedByte","xs:positiveInteger","xs:yearMonthDuration","xs:dayTimeDuration"],literal:["eq","ne","lt","le","gt","ge","is","self::","child::","descendant::","descendant-or-self::","attribute::","following::","following-sibling::","parent::","ancestor::","ancestor-or-self::","preceding::","preceding-sibling::","NaN"]},contains:[{className:"variable",begin:/[$][\w\-:]+/},{className:"built_in",variants:[{begin:/\barray:/,end:/(?:append|filter|flatten|fold-(?:left|right)|for-each(?:-pair)?|get|head|insert-before|join|put|remove|reverse|size|sort|subarray|tail)\b/},{begin:/\bmap:/,end:/(?:contains|entry|find|for-each|get|keys|merge|put|remove|size)\b/},{begin:/\bmath:/,end:/(?:a(?:cos|sin|tan[2]?)|cos|exp(?:10)?|log(?:10)?|pi|pow|sin|sqrt|tan)\b/},{begin:/\bop:/,end:/\(/,excludeEnd:!0},{begin:/\bfn:/,end:/\(/,excludeEnd:!0},{begin:/[^</$:'"-]\b(?:abs|accumulator-(?:after|before)|adjust-(?:date(?:Time)?|time)-to-timezone|analyze-string|apply|available-(?:environment-variables|system-properties)|avg|base-uri|boolean|ceiling|codepoints?-(?:equal|to-string)|collation-key|collection|compare|concat|contains(?:-token)?|copy-of|count|current(?:-)?(?:date(?:Time)?|time|group(?:ing-key)?|output-uri|merge-(?:group|key))?data|dateTime|days?-from-(?:date(?:Time)?|duration)|deep-equal|default-(?:collation|language)|distinct-values|document(?:-uri)?|doc(?:-available)?|element-(?:available|with-id)|empty|encode-for-uri|ends-with|environment-variable|error|escape-html-uri|exactly-one|exists|false|filter|floor|fold-(?:left|right)|for-each(?:-pair)?|format-(?:date(?:Time)?|time|integer|number)|function-(?:arity|available|lookup|name)|generate-id|has-children|head|hours-from-(?:dateTime|duration|time)|id(?:ref)?|implicit-timezone|in-scope-prefixes|index-of|innermost|insert-before|iri-to-uri|json-(?:doc|to-xml)|key|lang|last|load-xquery-module|local-name(?:-from-QName)?|(?:lower|upper)-case|matches|max|minutes-from-(?:dateTime|duration|time)|min|months?-from-(?:date(?:Time)?|duration)|name(?:space-uri-?(?:for-prefix|from-QName)?)?|nilled|node-name|normalize-(?:space|unicode)|not|number|one-or-more|outermost|parse-(?:ietf-date|json)|path|position|(?:prefix-from-)?QName|random-number-generator|regex-group|remove|replace|resolve-(?:QName|uri)|reverse|root|round(?:-half-to-even)?|seconds-from-(?:dateTime|duration|time)|snapshot|sort|starts-with|static-base-uri|stream-available|string-?(?:join|length|to-codepoints)?|subsequence|substring-?(?:after|before)?|sum|system-property|tail|timezone-from-(?:date(?:Time)?|time)|tokenize|trace|trans(?:form|late)|true|type-available|unordered|unparsed-(?:entity|text)?-?(?:public-id|uri|available|lines)?|uri-collection|xml-to-json|years?-from-(?:date(?:Time)?|duration)|zero-or-one)\b/},{begin:/\blocal:/,end:/\(/,excludeEnd:!0},{begin:/\bzip:/,end:/(?:zip-file|(?:xml|html|text|binary)-entry| (?:update-)?entries)\b/},{begin:/\b(?:util|db|functx|app|xdmp|xmldb):/,end:/\(/,excludeEnd:!0}]},{className:"string",variants:[{begin:/"/,end:/"/,contains:[{begin:/""/,relevance:0}]},{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]}]},{className:"number",begin:/(\b0[0-7_]+)|(\b0x[0-9a-fA-F_]+)|(\b[1-9][0-9_]*(\.[0-9_]+)?)|[0_]\b/,relevance:0},{className:"comment",begin:/\(:/,end:/:\)/,relevance:10,contains:[{className:"doctag",begin:/@\w+/}]},{className:"meta",begin:/%[\w\-:]+/},{className:"title",begin:/\bxquery version "[13]\.[01]"\s?(?:encoding ".+")?/,end:/;/},{beginKeywords:"element attribute comment document processing-instruction",end:/\{/,excludeEnd:!0},{begin:/<([\w._:-]+)(\s+\S*=('|").*('|"))?>/,end:/(\/[\w._:-]+>)/,subLanguage:"xml",contains:[{begin:/\{/,end:/\}/,subLanguage:"xquery"},"self"]}]}}},80580:(a,b,c)=>{"use strict";c.d(b,{u:()=>h});var d=c(21124),e=c(38301),f=c(20481),g=c(17793);function h({src:a,onError:b}){let c=(0,f.c)("worktree"),[h,i]=(0,e.useState)(!0),[j,k]=(0,e.useState)(!1);return j?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,d.jsx)("svg",{className:"w-16 h-16 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.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,d.jsx)("p",{className:"text-sm",children:c("videoViewer.loadError")})]}):(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center p-4",children:[h&&(0,d.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,d.jsx)(g.y,{size:"xl",variant:"accent"}),(0,d.jsx)("p",{className:"ml-3 text-muted-foreground",children:c("videoViewer.loading")})]}),(0,d.jsx)("video",{controls:!0,src:a,onLoadedData:()=>{i(!1)},onError:()=>{i(!1),k(!0),b?.()},style:{maxWidth:"100%",maxHeight:"500px",display:h?"none":"block"},className:"rounded-lg shadow-sm",children:c("videoViewer.unsupported")})]})}},80978:a=>{let b=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],c=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),d=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),e=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();a.exports=function(a){let g={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:a.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:a.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},h="@[a-z-]+",i={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,g.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},g.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+b.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+d.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+e.join("|")+")"},i,{begin:/\(/,end:/\)/,contains:[g.CSS_NUMBER_MODE]},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[g.BLOCK_COMMENT,i,g.HEXCOLOR,g.CSS_NUMBER_MODE,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,g.IMPORTANT,g.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:h,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:c.join(" ")},contains:[{begin:h,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},i,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,g.HEXCOLOR,g.CSS_NUMBER_MODE]},g.FUNCTION_DISPATCH]}}},81044:a=>{a.exports=function(a){return{name:"Dockerfile",aliases:["docker"],case_insensitive:!0,keywords:["from","maintainer","expose","env","arg","user","onbuild","stopsignal"],contains:[a.HASH_COMMENT_MODE,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.NUMBER_MODE,{beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell",starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"</"}}},81636:a=>{a.exports=function(a){let b=a.regex,c=/\b/;function d(a,b){if(0===a.index)return;let c=a.input[a.index-1];c>="0"&&c<="9"||"_"!==c&&b.ignoreMatch()}let e=/[+-]?((\.\d+)|(\d+)(\.\d*)?)/,f=/[GM]\s*\d+(\.\d+)?/,g=/T\s*\d+/,h=/O\s*\d+/,i=/O<.+>/,j=/[ABCUVWXYZ]\s*/,k=/[FHIJKPQRS]\s*/;return{name:"G-code (ISO 6983)",aliases:["nc"],case_insensitive:!0,disableAutodetect:!0,keywords:{$pattern:/[A-Z]+|%/,keyword:["THEN","ELSE","ENDIF","IF","GOTO","DO","WHILE","WH","END","CALL","SUB","ENDSUB","EQ","NE","LT","GT","LE","GE","AND","OR","XOR","%"],built_in:["ATAN","ABS","ACOS","ASIN","COS","EXP","FIX","FUP","ROUND","LN","SIN","SQRT","TAN","EXISTS"]},contains:[a.COMMENT(/\(/,/\)/),a.COMMENT(/;/,/$/),a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.C_NUMBER_MODE,{scope:"title.function",variants:[{match:b.concat(c,f)},{begin:f,"on:begin":d},{match:b.concat(c,g)},{begin:g,"on:begin":d}]},{scope:"symbol",variants:[{match:b.concat(c,h)},{begin:h,"on:begin":d},{match:b.concat(c,i)},{begin:i,"on:begin":d},{match:/\*\s*\d+\s*$/}]},{scope:"operator",match:/^N\s*\d+/},{scope:"variable",match:/-?#\s*\d+/},{scope:"property",variants:[{match:b.concat(c,j,e)},{begin:b.concat(j,e),"on:begin":d}]},{scope:"params",variants:[{match:b.concat(c,k,e)},{begin:b.concat(k,e),"on:begin":d}]}]}}},82705:a=>{a.exports=function(a){let b={begin:/\(/,end:/\)/,relevance:0},c={begin:/\[/,end:/\]/},d={className:"comment",begin:/%/,end:/$/,contains:[a.PHRASAL_WORDS_MODE]},e={className:"string",begin:/`/,end:/`/,contains:[a.BACKSLASH_ESCAPE]},f=[{begin:/[a-z][A-Za-z0-9_]*/,relevance:0},{className:"symbol",variants:[{begin:/[A-Z][a-zA-Z0-9_]*/},{begin:/_[A-Za-z0-9_]*/}],relevance:0},b,{begin:/:-/},c,d,a.C_BLOCK_COMMENT_MODE,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,e,{className:"string",begin:/0'(\\'|.)/},{className:"string",begin:/0'\\s/},a.C_NUMBER_MODE];return b.contains=f,c.contains=f,{name:"Prolog",contains:f.concat([{begin:/\.$/}])}}},83844:a=>{a.exports=function(a){return{name:"Clojure REPL",contains:[{className:"meta.prompt",begin:/^([\w.-]+|\s*#_)?=>/,starts:{end:/$/,subLanguage:"clojure"}}]}}},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},88674:a=>{a.exports=function(a){let b={className:"variable",variants:[{begin:"\\b([gtps][A-Z]{1}[a-zA-Z0-9]*)(\\[.+\\])?(?:\\s*?)"},{begin:"\\$_[A-Z]+"}],relevance:0},c=[a.C_BLOCK_COMMENT_MODE,a.HASH_COMMENT_MODE,a.COMMENT("--","$"),a.COMMENT("[^:]//","$")],d=a.inherit(a.TITLE_MODE,{variants:[{begin:"\\b_*rig[A-Z][A-Za-z0-9_\\-]*"},{begin:"\\b_[a-z0-9\\-]+"}]}),e=a.inherit(a.TITLE_MODE,{begin:"\\b([A-Za-z0-9_\\-]+)\\b"});return{name:"LiveCode",case_insensitive:!1,keywords:{keyword:"$_COOKIE $_FILES $_GET $_GET_BINARY $_GET_RAW $_POST $_POST_BINARY $_POST_RAW $_SESSION $_SERVER codepoint codepoints segment segments codeunit codeunits sentence sentences trueWord trueWords paragraph after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word words fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",literal:"SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",built_in:"put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg avgDev base64Decode base64Encode baseConvert binaryDecode binaryEncode byteOffset byteToNum cachedURL cachedURLs charToNum cipherNames codepointOffset codepointProperty codepointToNum codeunitOffset commandNames compound compress constantNames cos date dateFormat decompress difference directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames geometricMean global globals hasMemory harmonicMean hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge messageAuthenticationCode messageDigest millisec millisecs millisecond milliseconds min monthNames nativeCharToNum normalizeText num number numToByte numToChar numToCodepoint numToNativeChar offset open openfiles openProcesses openProcessIDs openSockets paragraphOffset paramCount param params peerAddress pendingMessages platform popStdDev populationStandardDeviation populationVariance popVariance processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLCreateTreeFromFileWithNamespaces revXMLCreateTreeWithNamespaces revXMLDataFromXPathQuery revXMLEvaluateXPath revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_Execute revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sampVariance sec secs seconds sentenceOffset sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName textDecode textEncode tick ticks time to tokenOffset toLower toUpper transpose truewordOffset trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus uuid value variableNames variance version waitDepth weekdayNames wordOffset xsltApplyStylesheet xsltApplyStylesheetFromFile xsltLoadStylesheet xsltLoadStylesheetFromFile add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetDriver libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load extension loadedExtensions multiply socket prepare process post seek rel relative read from process rename replace require resetAll resolve revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split start stop subtract symmetric union unload vectorDotProduct wait write"},contains:[b,{className:"keyword",begin:"\\bend\\sif\\b"},{className:"function",beginKeywords:"function",end:"$",contains:[b,e,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE,d]},{className:"function",begin:"\\bend\\s+",end:"$",keywords:"end",contains:[e,d],relevance:0},{beginKeywords:"command on",end:"$",contains:[b,e,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE,d]},{className:"meta",variants:[{begin:"<\\?(rev|lc|livecode)",relevance:10},{begin:"<\\?"},{begin:"\\?>"}]},a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE,d].concat(c),illegal:";$|^\\[|^=|&|\\{"}}},89394:a=>{a.exports=function(a){let b="(_?[ui](8|16|32|64|128))?",c="[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~|]|//|//=|&[-+*]=?|&\\*\\*|\\[\\][=?]?",d="[A-Za-z_]\\w*(::\\w+)*(\\?|!)?",e={$pattern:"[a-zA-Z_]\\w*[!?=]?",keyword:"abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__",literal:"false nil true"},f={className:"subst",begin:/#\{/,end:/\}/,keywords:e},g={className:"template-variable",variants:[{begin:"\\{\\{",end:"\\}\\}"},{begin:"\\{%",end:"%\\}"}],keywords:e};function h(a,b){let c=[{begin:a,end:b}];return c[0].contains=c,c}let i={className:"string",contains:[a.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[Qwi]?\\(",end:"\\)",contains:h("\\(","\\)")},{begin:"%[Qwi]?\\[",end:"\\]",contains:h("\\[","\\]")},{begin:"%[Qwi]?\\{",end:/\}/,contains:h(/\{/,/\}/)},{begin:"%[Qwi]?<",end:">",contains:h("<",">")},{begin:"%[Qwi]?\\|",end:"\\|"},{begin:/<<-\w+$/,end:/^\s*\w+$/}],relevance:0},j={className:"string",variants:[{begin:"%q\\(",end:"\\)",contains:h("\\(","\\)")},{begin:"%q\\[",end:"\\]",contains:h("\\[","\\]")},{begin:"%q\\{",end:/\}/,contains:h(/\{/,/\}/)},{begin:"%q<",end:">",contains:h("<",">")},{begin:"%q\\|",end:"\\|"},{begin:/<<-'\w+'$/,end:/^\s*\w+$/}],relevance:0},k={begin:"(?!%\\})("+a.RE_STARTERS_RE+"|\\n|\\b(case|if|select|unless|until|when|while)\\b)\\s*",keywords:"case if select unless until when while",contains:[{className:"regexp",contains:[a.BACKSLASH_ESCAPE,f],variants:[{begin:"//[a-z]*",relevance:0},{begin:"/(?!\\/)",end:"/[a-z]*"}]}],relevance:0},l=[g,i,j,{className:"regexp",contains:[a.BACKSLASH_ESCAPE,f],variants:[{begin:"%r\\(",end:"\\)",contains:h("\\(","\\)")},{begin:"%r\\[",end:"\\]",contains:h("\\[","\\]")},{begin:"%r\\{",end:/\}/,contains:h(/\{/,/\}/)},{begin:"%r<",end:">",contains:h("<",">")},{begin:"%r\\|",end:"\\|"}],relevance:0},k,{className:"meta",begin:"@\\[",end:"\\]",contains:[a.inherit(a.QUOTE_STRING_MODE,{className:"string"})]},{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},a.HASH_COMMENT_MODE,{className:"class",beginKeywords:"class module struct",end:"$|;",illegal:/=/,contains:[a.HASH_COMMENT_MODE,a.inherit(a.TITLE_MODE,{begin:d}),{begin:"<"}]},{className:"class",beginKeywords:"lib enum union",end:"$|;",illegal:/=/,contains:[a.HASH_COMMENT_MODE,a.inherit(a.TITLE_MODE,{begin:d})]},{beginKeywords:"annotation",end:"$|;",illegal:/=/,contains:[a.HASH_COMMENT_MODE,a.inherit(a.TITLE_MODE,{begin:d})],relevance:2},{className:"function",beginKeywords:"def",end:/\B\b/,contains:[a.inherit(a.TITLE_MODE,{begin:c,endsParent:!0})]},{className:"function",beginKeywords:"fun macro",end:/\B\b/,contains:[a.inherit(a.TITLE_MODE,{begin:c,endsParent:!0})],relevance:2},{className:"symbol",begin:a.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":",contains:[i,{begin:c}],relevance:0},{className:"number",variants:[{begin:"\\b0b([01_]+)"+b},{begin:"\\b0o([0-7_]+)"+b},{begin:"\\b0x([A-Fa-f0-9_]+)"+b},{begin:"\\b([1-9][0-9_]*[0-9]|[0-9])(\\.[0-9][0-9_]*)?([eE]_?[-+]?[0-9_]*)?(_?f(32|64))?(?!_)"},{begin:"\\b([1-9][0-9_]*|0)"+b}],relevance:0}];return f.contains=l,g.contains=l.slice(1),{name:"Crystal",aliases:["cr"],keywords:e,contains:l}}},89815:a=>{let b=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],c=["true","false","null","undefined","NaN","Infinity"],d=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);a.exports=function(a){let e={keyword:b.concat(["then","unless","until","loop","of","by","when","and","or","is","isnt","not","it","that","otherwise","from","to","til","fallthrough","case","enum","native","list","map","__hasProp","__extends","__slice","__bind","__indexOf"]),literal:c.concat(["yes","no","on","off","it","that","void"]),built_in:d.concat(["npm","print"])},f="[A-Za-z$_](?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*",g=a.inherit(a.TITLE_MODE,{begin:f}),h={className:"subst",begin:/#\{/,end:/\}/,keywords:e},i={className:"subst",begin:/#[A-Za-z$_]/,end:/(?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*/,keywords:e},j=[a.BINARY_NUMBER_MODE,{className:"number",begin:"(\\b0[xX][a-fA-F0-9_]+)|(\\b\\d(\\d|_\\d)*(\\.(\\d(\\d|_\\d)*)?)?(_*[eE]([-+]\\d(_\\d|\\d)*)?)?[_a-z]*)",relevance:0,starts:{end:"(\\s*/)?",relevance:0}},{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[a.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[a.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[a.BACKSLASH_ESCAPE,h,i]},{begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE,h,i]},{begin:/\\/,end:/(\s|$)/,excludeEnd:!0}]},{className:"regexp",variants:[{begin:"//",end:"//[gim]*",contains:[h,a.HASH_COMMENT_MODE]},{begin:/\/(?![ *])(\\.|[^\\\n])*?\/[gim]*(?=\W)/}]},{begin:"@"+f},{begin:"``",end:"``",excludeBegin:!0,excludeEnd:!0,subLanguage:"javascript"}];h.contains=j;let k={className:"params",begin:"\\(",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:e,contains:["self"].concat(j)}]};return{name:"LiveScript",aliases:["ls"],keywords:e,illegal:/\/\*/,contains:j.concat([a.COMMENT("\\/\\*","\\*\\/"),a.HASH_COMMENT_MODE,{begin:"(#=>|=>|\\|>>|-?->|!->)"},{className:"function",contains:[g,k],returnBegin:!0,variants:[{begin:"("+f+"\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B->\\*?",end:"->\\*?"},{begin:"("+f+"\\s*(?:=|:=)\\s*)?!?(\\(.*\\)\\s*)?\\B[-~]{1,2}>\\*?",end:"[-~]{1,2}>\\*?"},{begin:"("+f+"\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B!?[-~]{1,2}>\\*?",end:"!?[-~]{1,2}>\\*?"}]},{variants:[{match:[/class\s+/,f,/\s+extends\s+/,f]},{match:[/class\s+/,f]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:e},{begin:f+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}},89838:a=>{a.exports=function(a){let b=[a.C_NUMBER_MODE,{className:"string",begin:"'|\"",end:"'|\"",contains:[a.BACKSLASH_ESCAPE,{begin:"''"}]}];return{name:"Scilab",aliases:["sci"],keywords:{$pattern:/%?\w+/,keyword:"abort break case clear catch continue do elseif else endfunction end for function global if pause return resume select try then while",literal:"%f %F %t %T %pi %eps %inf %nan %e %i %z %s",built_in:"abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan type typename warning zeros matrix"},illegal:'("|#|/\\*|\\s+/\\w+)',contains:[{className:"function",beginKeywords:"function",end:"$",contains:[a.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)"}]},{begin:"[a-zA-Z_][a-zA-Z_0-9]*[\\.']+",relevance:0},{begin:"\\[",end:"\\][\\.']*",relevance:0,contains:b},a.COMMENT("//","$")].concat(b)}}},89866:a=>{a.exports=function(a){return{name:"MEL",keywords:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",illegal:"</",contains:[a.C_NUMBER_MODE,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,{className:"string",begin:"`",end:"`",contains:[a.BACKSLASH_ESCAPE]},{begin:/[$%@](\^\w\b|#\w+|[^\s\w{]|\{\w+\}|\w+)/},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]}}},89992:a=>{let b=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],c=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),d=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),e=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();a.exports=function(a){let g={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:a.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:a.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},h={className:"variable",begin:"\\$"+a.IDENT_RE},i="(?=[.\\s\\n[:,(])";return{name:"Stylus",aliases:["styl"],case_insensitive:!1,keywords:"if else for in",illegal:"(\\?|(\\bReturn\\b)|(\\bEnd\\b)|(\\bend\\b)|(\\bdef\\b)|;|#\\s|\\*\\s|===\\s|\\||%)",contains:[a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,g.HEXCOLOR,{begin:"\\.[a-zA-Z][a-zA-Z0-9_-]*"+i,className:"selector-class"},{begin:"#[a-zA-Z][a-zA-Z0-9_-]*"+i,className:"selector-id"},{begin:"\\b("+b.join("|")+")"+i,className:"selector-tag"},{className:"selector-pseudo",begin:"&?:("+d.join("|")+")"+i},{className:"selector-pseudo",begin:"&?:(:)?("+e.join("|")+")"+i},g.ATTRIBUTE_SELECTOR_MODE,{className:"keyword",begin:/@media/,starts:{end:/[{;}]/,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:c.join(" ")},contains:[g.CSS_NUMBER_MODE]}},{className:"keyword",begin:"@((-(o|moz|ms|webkit)-)?(charset|css|debug|extend|font-face|for|import|include|keyframes|media|mixin|page|warn|while))\\b"},h,g.CSS_NUMBER_MODE,{className:"function",begin:"^[a-zA-Z][a-zA-Z0-9_-]*\\(.*\\)",illegal:"[\\n]",returnBegin:!0,contains:[{className:"title",begin:"\\b[a-zA-Z][a-zA-Z0-9_-]*"},{className:"params",begin:/\(/,end:/\)/,contains:[g.HEXCOLOR,h,a.APOS_STRING_MODE,g.CSS_NUMBER_MODE,a.QUOTE_STRING_MODE]}]},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.join("|")+")\\b",starts:{end:/;|$/,contains:[g.HEXCOLOR,h,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,g.CSS_NUMBER_MODE,a.C_BLOCK_COMMENT_MODE,g.IMPORTANT,g.FUNCTION_DISPATCH],illegal:/\./,relevance:0}},g.FUNCTION_DISPATCH]}}},90429:a=>{a.exports=function(a){let b=a.UNDERSCORE_IDENT_RE,c={keyword:["abstract","as","asc","avg","break","breakpoint","by","byref","case","catch","changecompany","class","client","client","common","const","continue","count","crosscompany","delegate","delete_from","desc","display","div","do","edit","else","eventhandler","exists","extends","final","finally","firstfast","firstonly","firstonly1","firstonly10","firstonly100","firstonly1000","flush","for","forceliterals","forcenestedloop","forceplaceholders","forceselectorder","forupdate","from","generateonly","group","hint","if","implements","in","index","insert_recordset","interface","internal","is","join","like","maxof","minof","mod","namespace","new","next","nofetch","notexists","optimisticlock","order","outer","pessimisticlock","print","private","protected","public","readonly","repeatableread","retry","return","reverse","select","server","setting","static","sum","super","switch","this","throw","try","ttsabort","ttsbegin","ttscommit","unchecked","update_recordset","using","validtimestate","void","where","while"],built_in:["anytype","boolean","byte","char","container","date","double","enum","guid","int","int64","long","real","short","str","utcdatetime","var"],literal:["default","false","null","true"]};return{name:"X++",aliases:["x++"],keywords:c,contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.C_NUMBER_MODE,{className:"meta",begin:"#",end:"$"},{variants:[{match:[/(class|interface)\s+/,b,/\s+(extends|implements)\s+/,b]},{match:[/class\s+/,b]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:c}]}}},90535:a=>{a.exports=function(a){let b={begin:"`[\\s\\S]"};return{name:"AutoHotkey",case_insensitive:!0,aliases:["ahk"],keywords:{keyword:"Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group",literal:"true false NOT AND OR",built_in:"ComSpec Clipboard ClipboardAll ErrorLevel"},contains:[b,a.inherit(a.QUOTE_STRING_MODE,{contains:[b]}),a.COMMENT(";","$",{relevance:0}),a.C_BLOCK_COMMENT_MODE,{className:"number",begin:a.NUMBER_RE,relevance:0},{className:"variable",begin:"%[a-zA-Z0-9#_$@]+%"},{className:"built_in",begin:"^\\s*\\w+\\s*(,|%)"},{className:"title",variants:[{begin:'^[^\\n";]+::(?!=)'},{begin:'^[^\\n";]+:(?!=)',relevance:0}]},{className:"meta",begin:"^\\s*#\\w+",end:"$",relevance:0},{className:"built_in",begin:"A_[a-zA-Z0-9]+"},{begin:",\\s*,"}]}}},90599:a=>{a.exports=function(a){let b=a.regex,c=/[a-zA-Z_$][a-zA-Z0-9_$]*/,d=b.concat(c,b.concat("(\\.",c,")*"));return{name:"ActionScript",aliases:["as"],keywords:{keyword:["as","break","case","catch","class","const","continue","default","delete","do","dynamic","each","else","extends","final","finally","for","function","get","if","implements","import","in","include","instanceof","interface","internal","is","namespace","native","new","override","package","private","protected","public","return","set","static","super","switch","this","throw","try","typeof","use","var","void","while","with"],literal:["true","false","null","undefined"]},contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.C_NUMBER_MODE,{match:[/\bpackage/,/\s+/,d],className:{1:"keyword",3:"title.class"}},{match:[/\b(?:class|interface|extends|implements)/,/\s+/,c],className:{1:"keyword",3:"title.class"}},{className:"meta",beginKeywords:"import include",end:/;/,keywords:{keyword:"import include"}},{beginKeywords:"function",end:/[{;]/,excludeEnd:!0,illegal:/\S/,contains:[a.inherit(a.TITLE_MODE,{className:"title.function"}),{className:"params",begin:/\(/,end:/\)/,contains:[a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{className:"rest_arg",begin:/[.]{3}/,end:c,relevance:10}]},{begin:b.concat(/:\s*/,/([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)/)}]},a.METHOD_GUARD],illegal:/#/}}},90855:a=>{a.exports=function(a){return{name:"CMake",aliases:["cmake.in"],case_insensitive:!0,keywords:{keyword:"break cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue elseif else endforeach endfunction endif endmacro endwhile execute_process file find_file find_library find_package find_path find_program foreach function get_cmake_property get_directory_property get_filename_component get_property if include include_guard list macro mark_as_advanced math message option return separate_arguments set_directory_properties set_property set site_name string unset variable_watch while add_compile_definitions add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_link_options add_subdirectory add_test aux_source_directory build_command create_test_sourcelist define_property enable_language enable_testing export fltk_wrap_ui get_source_file_property get_target_property get_test_property include_directories include_external_msproject include_regular_expression install link_directories link_libraries load_cache project qt_wrap_cpp qt_wrap_ui remove_definitions set_source_files_properties set_target_properties set_tests_properties source_group target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_directories target_link_libraries target_link_options target_sources try_compile try_run ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload build_name exec_program export_library_dependencies install_files install_programs install_targets load_command make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or not command policy target test exists is_newer_than is_directory is_symlink is_absolute matches less greater equal less_equal greater_equal strless strgreater strequal strless_equal strgreater_equal version_less version_greater version_equal version_less_equal version_greater_equal in_list defined"},contains:[{className:"variable",begin:/\$\{/,end:/\}/},a.COMMENT(/#\[\[/,/]]/),a.HASH_COMMENT_MODE,a.QUOTE_STRING_MODE,a.NUMBER_MODE]}}},91109:a=>{a.exports=function(a){return{keywords:"dsconfig",contains:[{className:"keyword",begin:"^dsconfig",end:/\s/,excludeEnd:!0,relevance:10},{className:"built_in",begin:/(list|create|get|set|delete)-(\w+)/,end:/\s/,excludeEnd:!0,illegal:"!@#$%^&*()",relevance:10},{className:"built_in",begin:/--(\w+)/,end:/\s/,excludeEnd:!0},{className:"string",begin:/"/,end:/"/},{className:"string",begin:/'/,end:/'/},{className:"string",begin:/[\w\-?]+:\w+/,end:/\W/,relevance:0},{className:"string",begin:/\w+(\-\w+)*/,end:/(?=\W)/,relevance:0},a.HASH_COMMENT_MODE]}}},91445:a=>{a.exports=function(a){return{name:"Gradle",case_insensitive:!0,keywords:["task","project","allprojects","subprojects","artifacts","buildscript","configurations","dependencies","repositories","sourceSets","description","delete","from","into","include","exclude","source","classpath","destinationDir","includes","options","sourceCompatibility","targetCompatibility","group","flatDir","doLast","doFirst","flatten","todir","fromdir","ant","def","abstract","break","case","catch","continue","default","do","else","extends","final","finally","for","if","implements","instanceof","native","new","private","protected","public","return","static","switch","synchronized","throw","throws","transient","try","volatile","while","strictfp","package","import","false","null","super","this","true","antlrtask","checkstyle","codenarc","copy","boolean","byte","char","class","double","float","int","interface","long","short","void","compile","runTime","file","fileTree","abs","any","append","asList","asWritable","call","collect","compareTo","count","div","dump","each","eachByte","eachFile","eachLine","every","find","findAll","flatten","getAt","getErr","getIn","getOut","getText","grep","immutable","inject","inspect","intersect","invokeMethods","isCase","join","leftShift","minus","multiply","newInputStream","newOutputStream","newPrintWriter","newReader","newWriter","next","plus","pop","power","previous","print","println","push","putAt","read","readBytes","readLines","reverse","reverseEach","round","size","sort","splitEachLine","step","subMap","times","toInteger","toList","tokenize","upto","waitForOrKill","withPrintWriter","withReader","withStream","withWriter","withWriterAppend","write","writeLine"],contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,a.NUMBER_MODE,a.REGEXP_MODE]}}},91508:a=>{a.exports=function(a){let b={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:b,illegal:"</",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{className:"string",variants:[a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[a.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:b,illegal:/["']/}]}]}}},91645:a=>{"use strict";a.exports=require("net")},91916:a=>{a.exports=function(a){return{name:"OCaml",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",built_in:"array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref",literal:"true false"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:"\\[(\\|\\|)?\\]|\\(\\)",relevance:0},a.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*",relevance:0},a.inherit(a.APOS_STRING_MODE,{className:"string",relevance:0}),a.inherit(a.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/->/}]}}},92037:a=>{a.exports=function(a){let b=a.COMMENT("%","$"),c=a.inherit(a.APOS_STRING_MODE,{relevance:0}),d=a.inherit(a.QUOTE_STRING_MODE,{relevance:0});return d.contains=d.contains.slice(),d.contains.push({className:"subst",begin:"\\\\[abfnrtv]\\|\\\\x[0-9a-fA-F]*\\\\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]",relevance:0}),{name:"Mercury",aliases:["m","moo"],keywords:{keyword:"module use_module import_module include_module end_module initialise mutable initialize finalize finalise interface implementation pred mode func type inst solver any_pred any_func is semidet det nondet multi erroneous failure cc_nondet cc_multi typeclass instance where pragma promise external trace atomic or_else require_complete_switch require_det require_semidet require_multi require_nondet require_cc_multi require_cc_nondet require_erroneous require_failure",meta:"inline no_inline type_spec source_file fact_table obsolete memo loop_check minimal_model terminates does_not_terminate check_termination promise_equivalent_clauses foreign_proc foreign_decl foreign_code foreign_type foreign_import_module foreign_export_enum foreign_export foreign_enum may_call_mercury will_not_call_mercury thread_safe not_thread_safe maybe_thread_safe promise_pure promise_semipure tabled_for_io local untrailed trailed attach_to_io_state can_pass_as_mercury_type stable will_not_throw_exception may_modify_trail will_not_modify_trail may_duplicate may_not_duplicate affects_liveness does_not_affect_liveness doesnt_affect_liveness no_sharing unknown_sharing sharing",built_in:"some all not if then else true fail false try catch catch_any semidet_true semidet_false semidet_fail impure_true impure semipure"},contains:[{className:"built_in",variants:[{begin:"<=>"},{begin:"<=",relevance:0},{begin:"=>",relevance:0},{begin:"/\\\\"},{begin:"\\\\/"}]},{className:"built_in",variants:[{begin:":-\\|--\x3e"},{begin:"=",relevance:0}]},b,a.C_BLOCK_COMMENT_MODE,{className:"number",begin:"0'.\\|0[box][0-9a-fA-F]*"},a.NUMBER_MODE,c,d,{begin:/:-/},{begin:/\.$/}]}}},92474:a=>{a.exports=function(a){return{name:"GLSL",keywords:{keyword:"break continue discard do else for if return while switch case default attribute binding buffer ccw centroid centroid varying coherent column_major const cw depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip triangles triangles_adjacency uniform varying vertices volatile writeonly",type:"atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void",built_in:"gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow",literal:"true false"},illegal:'"',contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.C_NUMBER_MODE,{className:"meta",begin:"#",end:"$"}]}}},92583:a=>{a.exports=function(a){let b={className:"number",relevance:0,variants:[{begin:"[$][a-fA-F0-9]+"},a.NUMBER_MODE]},c={variants:[{match:[/(function|method)/,/\s+/,a.UNDERSCORE_IDENT_RE]}],scope:{1:"keyword",3:"title.function"}},d={variants:[{match:[/(class|interface|extends|implements)/,/\s+/,a.UNDERSCORE_IDENT_RE]}],scope:{1:"keyword",3:"title.class"}};return{name:"Monkey",case_insensitive:!0,keywords:{keyword:["public","private","property","continue","exit","extern","new","try","catch","eachin","not","abstract","final","select","case","default","const","local","global","field","end","if","then","else","elseif","endif","while","wend","repeat","until","forever","for","to","step","next","return","module","inline","throw","import","and","or","shl","shr","mod"],built_in:["DebugLog","DebugStop","Error","Print","ACos","ACosr","ASin","ASinr","ATan","ATan2","ATan2r","ATanr","Abs","Abs","Ceil","Clamp","Clamp","Cos","Cosr","Exp","Floor","Log","Max","Max","Min","Min","Pow","Sgn","Sgn","Sin","Sinr","Sqrt","Tan","Tanr","Seed","PI","HALFPI","TWOPI"],literal:["true","false","null"]},illegal:/\/\*/,contains:[a.COMMENT("#rem","#end"),a.COMMENT("'","$",{relevance:0}),c,d,{className:"variable.language",begin:/\b(self|super)\b/},{className:"meta",begin:/\s*#/,end:"$",keywords:{keyword:"if else elseif endif end then"}},{match:[/^\s*/,/strict\b/],scope:{2:"meta"}},{beginKeywords:"alias",end:"=",contains:[a.UNDERSCORE_TITLE_MODE]},a.QUOTE_STRING_MODE,b]}}},93014:a=>{a.exports=function(a){let b=a.regex,c={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"},{begin:/\$\{/,end:/\}/}]},d={className:"string",variants:[{begin:'"""',end:'"""'},{begin:'"',end:'"',illegal:"\\n",contains:[a.BACKSLASH_ESCAPE]},{begin:'[a-z]+"',end:'"',illegal:"\\n",contains:[a.BACKSLASH_ESCAPE,c]},{className:"string",begin:'[a-z]+"""',end:'"""',contains:[c],relevance:10}]},e={className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},f={className:"title",begin:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,relevance:0},g={className:"class",beginKeywords:"class object trait type",end:/[:={\[\n;]/,excludeEnd:!0,contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{beginKeywords:"extends with",relevance:10},{begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[e,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[e,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},f]},h={className:"function",beginKeywords:"def",end:b.lookahead(/[:={\[(\n;]/),contains:[f]};return{name:"Scala",keywords:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if then forSome for while do throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit export enum given transparent"},contains:[{begin:["//>",/\s+/,/using/,/\s+/,/\S+/],beginScope:{1:"comment",3:"keyword",5:"type"},end:/$/,contains:[{className:"string",begin:/\S+/}]},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,d,e,h,g,a.C_NUMBER_MODE,{begin:[/^\s*/,"extension",/\s+(?=[[(])/],beginScope:{2:"keyword"}},{begin:[/^\s*/,/end/,/\s+/,/(extension\b)?/],beginScope:{2:"keyword",4:"keyword"}},{match:/\.inline\b/},{begin:/\binline(?=\s)/,keywords:"inline"},{begin:[/\(\s*/,/using/,/\s+(?!\))/],beginScope:{2:"keyword"}},{className:"meta",begin:"@[A-Za-z]+"}]}}},93275:a=>{a.exports=function(a){return{name:"Tagger Script",contains:[{className:"comment",begin:/\$noop\(/,end:/\)/,contains:[{begin:/\\[()]/},{begin:/\(/,end:/\)/,contains:[{begin:/\\[()]/},"self"]}],relevance:10},{className:"keyword",begin:/\$[_a-zA-Z0-9]+(?=\()/},{className:"variable",begin:/%[_a-zA-Z0-9:]+%/},{className:"symbol",begin:/\\[\\nt$%,()]/},{className:"symbol",begin:/\\u[a-fA-F0-9]{4}/}]}}},93501:a=>{a.exports=function(a){let b={match:[/(message|enum|service)\s+/,a.IDENT_RE],scope:{1:"keyword",2:"title.class"}};return{name:"Protocol Buffers",aliases:["proto"],keywords:{keyword:["package","import","option","optional","required","repeated","group","oneof"],type:["double","float","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","bool","string","bytes"],literal:["true","false"]},contains:[a.QUOTE_STRING_MODE,a.NUMBER_MODE,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,b,{className:"function",beginKeywords:"rpc",end:/[{;]/,excludeEnd:!0,keywords:"rpc returns"},{begin:/^\s*[A-Z_]+(?=\s*=[^\n]+;$)/}]}}},93526:a=>{a.exports=function(a){return{name:"BASIC",case_insensitive:!0,illegal:"^.",keywords:{$pattern:"[a-zA-Z][a-zA-Z0-9_$%!#]*",keyword:["ABS","ASC","AND","ATN","AUTO|0","BEEP","BLOAD|10","BSAVE|10","CALL","CALLS","CDBL","CHAIN","CHDIR","CHR$|10","CINT","CIRCLE","CLEAR","CLOSE","CLS","COLOR","COM","COMMON","CONT","COS","CSNG","CSRLIN","CVD","CVI","CVS","DATA","DATE$","DEFDBL","DEFINT","DEFSNG","DEFSTR","DEF|0","SEG","USR","DELETE","DIM","DRAW","EDIT","END","ENVIRON","ENVIRON$","EOF","EQV","ERASE","ERDEV","ERDEV$","ERL","ERR","ERROR","EXP","FIELD","FILES","FIX","FOR|0","FRE","GET","GOSUB|10","GOTO","HEX$","IF","THEN","ELSE|0","INKEY$","INP","INPUT","INPUT#","INPUT$","INSTR","IMP","INT","IOCTL","IOCTL$","KEY","ON","OFF","LIST","KILL","LEFT$","LEN","LET","LINE","LLIST","LOAD","LOC","LOCATE","LOF","LOG","LPRINT","USING","LSET","MERGE","MID$","MKDIR","MKD$","MKI$","MKS$","MOD","NAME","NEW","NEXT","NOISE","NOT","OCT$","ON","OR","PEN","PLAY","STRIG","OPEN","OPTION","BASE","OUT","PAINT","PALETTE","PCOPY","PEEK","PMAP","POINT","POKE","POS","PRINT","PRINT]","PSET","PRESET","PUT","RANDOMIZE","READ","REM","RENUM","RESET|0","RESTORE","RESUME","RETURN|0","RIGHT$","RMDIR","RND","RSET","RUN","SAVE","SCREEN","SGN","SHELL","SIN","SOUND","SPACE$","SPC","SQR","STEP","STICK","STOP","STR$","STRING$","SWAP","SYSTEM","TAB","TAN","TIME$","TIMER","TROFF","TRON","TO","USR","VAL","VARPTR","VARPTR$","VIEW","WAIT","WHILE","WEND","WIDTH","WINDOW","WRITE","XOR"]},contains:[{scope:"string",begin:/"/,end:/"|$/,contains:[a.BACKSLASH_ESCAPE]},a.COMMENT("REM","$",{relevance:10}),a.COMMENT("'","$",{relevance:0}),{className:"symbol",begin:"^[0-9]+ ",relevance:10},{className:"number",begin:"\\b\\d+(\\.\\d+)?([edED]\\d+)?[#!]?",relevance:0},{className:"number",begin:"(&[hH][0-9a-fA-F]{1,4})"},{className:"number",begin:"(&[oO][0-7]{1,6})"}]}}},93598:a=>{a.exports=function(a){return{name:"Node REPL",contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"javascript"}},variants:[{begin:/^>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}},94995:a=>{a.exports=function(a){return{name:"Julia REPL",contains:[{className:"meta.prompt",begin:/^julia>/,relevance:10,starts:{end:/^(?![ ]{6})/,subLanguage:"julia"}}],aliases:["jldoctest"]}}},95881:a=>{a.exports=function(a){let b={className:"keyword",begin:"\\$(f[asn]|t|vp[rtd]|children)"},c={className:"number",begin:"\\b\\d+(\\.\\d+)?(e-?\\d+)?",relevance:0},d=a.inherit(a.QUOTE_STRING_MODE,{illegal:null}),e={className:"function",beginKeywords:"module function",end:/=|\{/,contains:[{className:"params",begin:"\\(",end:"\\)",contains:["self",c,d,b,{className:"literal",begin:"false|true|PI|undef"}]},a.UNDERSCORE_TITLE_MODE]};return{name:"OpenSCAD",aliases:["scad"],keywords:{keyword:"function module include use for intersection_for if else \\%",literal:"false true PI undef",built_in:"circle square polygon text sphere cube cylinder polyhedron translate rotate scale resize mirror multmatrix color offset hull minkowski union difference intersection abs sign sin cos tan acos asin atan atan2 floor round ceil ln log pow sqrt exp rands min max concat lookup str chr search version version_num norm cross parent_module echo import import_dxf dxf_linear_extrude linear_extrude rotate_extrude surface projection render children dxf_cross dxf_dim let assign"},contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,c,{className:"meta",keywords:{keyword:"include use"},begin:"include|use <",end:">"},d,b,{begin:"[*!#%]",relevance:0},e]}}},95929:a=>{a.exports=function(a){let b={className:"string",variants:[a.inherit(a.QUOTE_STRING_MODE,{begin:'((u8?|U)|L)?"'}),{begin:'(u8?|U)?R"',end:'"',contains:[a.BACKSLASH_ESCAPE]},{begin:"'\\\\?.",end:"'",illegal:"."}]},c={className:"number",variants:[{begin:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},{begin:a.C_NUMBER_RE}],relevance:0},d={className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef ifdef ifndef"},contains:[{begin:/\\\n/,relevance:0},{beginKeywords:"include",end:"$",keywords:{keyword:"include"},contains:[a.inherit(b,{className:"string"}),{className:"string",begin:"<",end:">",illegal:"\\n"}]},b,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},e={className:"variable",begin:/&[a-z\d_]*\b/};return{name:"Device Tree",contains:[{className:"title.class",begin:/^\/(?=\s*\{)/,relevance:10},e,{className:"keyword",begin:"/[a-z][a-z\\d-]*/"},{className:"symbol",begin:"^\\s*[a-zA-Z_][a-zA-Z\\d_]*:"},{className:"title.class",begin:/[a-zA-Z_][a-zA-Z\d_@-]*(?=\s\{)/,relevance:.2},{relevance:0,match:[/[a-z][a-z-,]+/,/\s*/,/=/],scope:{1:"attr",3:"operator"}},{match:/[a-z][a-z-,]+(?=;)/,relevance:0,scope:"attr"},{className:"params",relevance:0,begin:"<",end:">",contains:[c,e]},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,c,b,d,{scope:"punctuation",relevance:0,match:/\};|[;{}]/},{begin:a.IDENT_RE+"::",keywords:""}]}}},96108:a=>{function b(a){return RegExp(a.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function c(a){return a?"string"==typeof a?a:a.source:null}function d(a){return e("(?=",a,")")}function e(...a){return a.map(a=>c(a)).join("")}function f(...a){return"("+(function(a){let b=a[a.length-1];return"object"==typeof b&&b.constructor===Object?(a.splice(a.length-1,1),b):{}}(a).capture?"":"?:")+a.map(a=>c(a)).join("|")+")"}a.exports=function(a){let c={scope:"keyword",match:/\b(yield|return|let|do|match|use)!/},g=["bool","byte","sbyte","int8","int16","int32","uint8","uint16","uint32","int","uint","int64","uint64","nativeint","unativeint","decimal","float","double","float32","single","char","string","unit","bigint","option","voption","list","array","seq","byref","exn","inref","nativeptr","obj","outref","voidptr","Result"],h={keyword:["abstract","and","as","assert","base","begin","class","default","delegate","do","done","downcast","downto","elif","else","end","exception","extern","finally","fixed","for","fun","function","global","if","in","inherit","inline","interface","internal","lazy","let","match","member","module","mutable","namespace","new","of","open","or","override","private","public","rec","return","static","struct","then","to","try","type","upcast","use","val","void","when","while","with","yield"],literal:["true","false","null","Some","None","Ok","Error","infinity","infinityf","nan","nanf"],built_in:["not","ref","raise","reraise","dict","readOnlyDict","set","get","enum","sizeof","typeof","typedefof","nameof","nullArg","invalidArg","invalidOp","id","fst","snd","ignore","lock","using","box","unbox","tryUnbox","printf","printfn","sprintf","eprintf","eprintfn","fprintf","fprintfn","failwith","failwithf"],"variable.constant":["__LINE__","__SOURCE_DIRECTORY__","__SOURCE_FILE__"]},i={variants:[a.COMMENT(/\(\*(?!\))/,/\*\)/,{contains:["self"]}),a.C_LINE_COMMENT_MODE]},j={scope:"variable",begin:/``/,end:/``/},k=/\B('|\^)/,l={scope:"symbol",variants:[{match:e(k,/``.*?``/)},{match:e(k,a.UNDERSCORE_IDENT_RE)}],relevance:0},m=function({includeEqual:a}){let c=e("[",...Array.from(a?"!%&*+-/<=>@^|~?":"!%&*+-/<>@^|~?").map(b),"]"),g=f(c,/\./),h=e(g,d(g)),i=f(e(h,g,"*"),e(c,"+"));return{scope:"operator",match:f(i,/:\?>/,/:\?/,/:>/,/:=/,/::?/,/\$/),relevance:0}},n=m({includeEqual:!0}),o=m({includeEqual:!1}),p=function(b,c){return{begin:e(b,d(e(/\s*/,f(/\w/,/'/,/\^/,/#/,/``/,/\(/,/{\|/)))),beginScope:c,end:d(f(/\n/,/=/)),relevance:0,keywords:a.inherit(h,{type:g}),contains:[i,l,a.inherit(j,{scope:null}),o]}},q=p(/:/,"operator"),r=p(/\bof\b/,"keyword"),s={begin:[/(^|\s+)/,/type/,/\s+/,/[a-zA-Z_](\w|')*/],beginScope:{2:"keyword",4:"title.class"},end:d(/\(|=|$/),keywords:h,contains:[i,a.inherit(j,{scope:null}),l,{scope:"operator",match:/<|>/},q]},t={scope:"computation-expression",match:/\b[_a-z]\w*(?=\s*\{)/},u={begin:[/^\s*/,e(/#/,f("if","else","endif","line","nowarn","light","r","i","I","load","time","help","quit")),/\b/],beginScope:{2:"meta"},end:d(/\s|$/)},v={variants:[a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE]},w={scope:"string",begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE]},x={scope:"string",begin:/@"/,end:/"/,contains:[{match:/""/},a.BACKSLASH_ESCAPE]},y={scope:"string",begin:/"""/,end:/"""/,relevance:2},z={scope:"subst",begin:/\{/,end:/\}/,keywords:h},A={scope:"string",begin:/\$"/,end:/"/,contains:[{match:/\{\{/},{match:/\}\}/},a.BACKSLASH_ESCAPE,z]},B={scope:"string",begin:/(\$@|@\$)"/,end:/"/,contains:[{match:/\{\{/},{match:/\}\}/},{match:/""/},a.BACKSLASH_ESCAPE,z]},C={scope:"string",match:e(/'/,f(/[^\\']/,/\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8})/),/'/)};return z.contains=[B,A,x,w,C,c,i,j,q,t,u,v,l,n],{name:"F#",aliases:["fs","f#"],keywords:h,illegal:/\/\*/,classNameAliases:{"computation-expression":"keyword"},contains:[c,{variants:[{scope:"string",begin:/\$"""/,end:/"""/,contains:[{match:/\{\{/},{match:/\}\}/},z],relevance:2},B,A,y,x,w,C]},i,j,s,{scope:"meta",begin:/\[</,end:/>\]/,relevance:2,contains:[j,y,x,w,C,v]},r,q,t,u,v,l,n]}}},96696:a=>{a.exports=function(a){let b=a.regex,c={};Object.assign(c,{className:"variable",variants:[{begin:b.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},{begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[c]}]}]});let d={className:"subst",begin:/\$\(/,end:/\)/,contains:[a.BACKSLASH_ESCAPE]},e=a.inherit(a.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),f={begin:/<<-?\s*(?=\w+)/,starts:{contains:[a.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},g={className:"string",begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE,c,d]};d.contains.push(g);let h={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},a.NUMBER_MODE,c]},i=a.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),j={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[a.inherit(a.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[i,a.SHEBANG(),j,h,e,f,{match:/(\/[a-z._-]+)+/},g,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},c]}}},97369:a=>{a.exports=function(a){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.COMMENT("/\\*\\*!","\\*/"),a.C_NUMBER_MODE,a.inherit(a.APOS_STRING_MODE,{illegal:null}),a.inherit(a.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}},97467:a=>{a.exports=function(a){return{name:"DNS Zone",aliases:["bind","zone"],keywords:["IN","A","AAAA","AFSDB","APL","CAA","CDNSKEY","CDS","CERT","CNAME","DHCID","DLV","DNAME","DNSKEY","DS","HIP","IPSECKEY","KEY","KX","LOC","MX","NAPTR","NS","NSEC","NSEC3","NSEC3PARAM","PTR","RRSIG","RP","SIG","SOA","SRV","SSHFP","TA","TKEY","TLSA","TSIG","TXT"],contains:[a.COMMENT(";","$",{relevance:0}),{className:"meta",begin:/^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/},{className:"number",begin:"((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b"},{className:"number",begin:"((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b"},a.inherit(a.NUMBER_MODE,{begin:/\b\d+[dhwm]?/})]}}},97694:a=>{a.exports=function(a){let b=a.regex,c={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:a.NUMBER_RE}]},d=a.COMMENT();d.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let e={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},f={className:"literal",begin:/\bon|off|true|false|yes|no\b/},g={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},h=b.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[d,{className:"section",begin:/\[+/,end:/\]+/},{begin:b.concat(h,"(\\s*\\.\\s*",h,")*",b.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[d,{begin:/\[/,end:/\]/,contains:[d,f,e,g,c,"self"],relevance:0},f,e,g,c]}}]}}},98758:a=>{a.exports=function(a){return{name:"Inform 7",aliases:["i7"],case_insensitive:!0,keywords:{keyword:"thing room person man woman animal container supporter backdrop door scenery open closed locked inside gender is are say understand kind of rule"},contains:[{className:"string",begin:'"',end:'"',relevance:0,contains:[{className:"subst",begin:"\\[",end:"\\]"}]},{className:"section",begin:/^(Volume|Book|Part|Chapter|Section|Table)\b/,end:"$"},{begin:/^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,end:":",contains:[{begin:"\\(This",end:"\\)"}]},{className:"comment",begin:"\\[",end:"\\]",contains:["self"]}]}}},98803:a=>{a.exports=function(a){let b=a.regex,c=/[a-zA-Z_][a-zA-Z0-9_]*/,d={className:"number",variants:[a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[a.COMMENT(";[ \\t]*#","$"),a.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:b.concat(/\$/,b.optional(/::/),c,"(::",c,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[d]}]},{className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[a.inherit(a.QUOTE_STRING_MODE,{illegal:null})]},d]}}},99134:a=>{a.exports=function(a){let b=a.regex,c=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,d=b.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),e=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,f=b.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:c,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[a.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:b.lookahead(b.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:c},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),a.HASH_COMMENT_MODE,{scope:"string",contains:[a.BACKSLASH_ESCAPE],variants:[a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[e,d]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,d]},{scope:{1:"punctuation",2:"number"},match:[f,d]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,d]}]},{scope:{3:"operator"},match:[c,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:e},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:f},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}},99896:a=>{a.exports=function(a){return{name:"JBoss CLI",aliases:["wildfly-cli"],keywords:{$pattern:"[a-z-]+",keyword:"alias batch cd clear command connect connection-factory connection-info data-source deploy deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias undeploy unset version xa-data-source",literal:"true false"},contains:[a.HASH_COMMENT_MODE,a.QUOTE_STRING_MODE,{className:"params",begin:/--[\w\-=\/]+/},{className:"function",begin:/:[\w\-.]+/,relevance:0},{className:"string",begin:/\B([\/.])[\w\-.\/=]+/},{className:"params",begin:/\(/,end:/\)/,contains:[{begin:/[\w-]+ *=/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/[\w-]+/}]}],relevance:0}]}}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[3897,641,3722,4072,2335,9701,9862,6345,4390,9627,8807,406,8581,2069,5737,8782,1945,4243,3730],()=>b(b.s=31975));module.exports=c})();