@open-mercato/cezar 0.19.0-pr1908.4332 → 0.19.0-pr1908.4683

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 (608) hide show
  1. package/README.md +3 -2
  2. package/dist/agent-config/account-identity.js +3 -0
  3. package/dist/agent-config/account-identity.js.map +1 -1
  4. package/dist/agent-config/catalog.d.ts +7 -1
  5. package/dist/agent-config/catalog.js +174 -4
  6. package/dist/agent-config/catalog.js.map +1 -1
  7. package/dist/agent-config/model-settings/gemini.d.ts +8 -0
  8. package/dist/agent-config/model-settings/gemini.js +16 -0
  9. package/dist/agent-config/model-settings/gemini.js.map +1 -0
  10. package/dist/agent-config/model-settings/kimi.d.ts +7 -0
  11. package/dist/agent-config/model-settings/kimi.js +13 -0
  12. package/dist/agent-config/model-settings/kimi.js.map +1 -0
  13. package/dist/agent-config/model-settings/omp.d.ts +11 -0
  14. package/dist/agent-config/model-settings/omp.js +17 -0
  15. package/dist/agent-config/model-settings/omp.js.map +1 -0
  16. package/dist/agent-config/model-settings/shared.d.ts +6 -0
  17. package/dist/agent-config/model-settings/shared.js +17 -3
  18. package/dist/agent-config/model-settings/shared.js.map +1 -1
  19. package/dist/agent-config/models.js +6 -0
  20. package/dist/agent-config/models.js.map +1 -1
  21. package/dist/agent-config/validate.js +15 -0
  22. package/dist/agent-config/validate.js.map +1 -1
  23. package/dist/automations/automation-cli.d.ts +2 -0
  24. package/dist/automations/automation-cli.js +82 -2
  25. package/dist/automations/automation-cli.js.map +1 -1
  26. package/dist/automations/deferred-start.d.ts +5 -4
  27. package/dist/automations/deferred-start.js +5 -1
  28. package/dist/automations/deferred-start.js.map +1 -1
  29. package/dist/automations/paused-work.d.ts +24 -0
  30. package/dist/automations/paused-work.js +61 -0
  31. package/dist/automations/paused-work.js.map +1 -0
  32. package/dist/automations/pr-head.d.ts +3 -0
  33. package/dist/automations/pr-head.js +8 -4
  34. package/dist/automations/pr-head.js.map +1 -1
  35. package/dist/automations/prompts.js +1 -0
  36. package/dist/automations/prompts.js.map +1 -1
  37. package/dist/automations/store.d.ts +16 -0
  38. package/dist/automations/store.js +44 -0
  39. package/dist/automations/store.js.map +1 -1
  40. package/dist/automations/task-template.js +1 -0
  41. package/dist/automations/task-template.js.map +1 -1
  42. package/dist/automations/templates.js +1 -0
  43. package/dist/automations/templates.js.map +1 -1
  44. package/dist/automations/types.d.ts +24 -0
  45. package/dist/automations/types.js +2 -0
  46. package/dist/automations/types.js.map +1 -1
  47. package/dist/automations/validate-input.d.ts +188 -0
  48. package/dist/automations/validate-input.js +85 -0
  49. package/dist/automations/validate-input.js.map +1 -0
  50. package/dist/config.d.ts +12 -5
  51. package/dist/config.js +4 -12
  52. package/dist/config.js.map +1 -1
  53. package/dist/contract/agent-config.d.ts +9 -0
  54. package/dist/contract/agent-profiles.d.ts +74 -20
  55. package/dist/contract/agent.d.ts +12 -0
  56. package/dist/contract/artifacts.d.ts +138 -0
  57. package/dist/contract/assets.d.ts +83 -0
  58. package/dist/contract/automations.d.ts +158 -0
  59. package/dist/contract/dashboard-costs.d.ts +2 -0
  60. package/dist/contract/dashboard.d.ts +8 -0
  61. package/dist/contract/deferred-start.d.ts +33 -0
  62. package/dist/contract/dispatch.d.ts +9 -0
  63. package/dist/contract/events.d.ts +6 -0
  64. package/dist/contract/github.d.ts +13 -0
  65. package/dist/contract/health.d.ts +12 -0
  66. package/dist/contract/impact.d.ts +134 -0
  67. package/dist/contract/index.d.ts +6 -0
  68. package/dist/contract/index.js +2955 -2547
  69. package/dist/contract/managers.d.ts +79 -0
  70. package/dist/contract/runners.d.ts +15 -0
  71. package/dist/contract/runs.d.ts +292 -0
  72. package/dist/contract/skills.d.ts +67 -0
  73. package/dist/contract/telemetry.d.ts +5 -1
  74. package/dist/contract/transfer.d.ts +1932 -0
  75. package/dist/contract/workflows.d.ts +87 -0
  76. package/dist/contract/workspace-layouts.d.ts +6 -0
  77. package/dist/contract/workspace.d.ts +111 -37
  78. package/dist/core/agent-env.js +43 -1
  79. package/dist/core/agent-env.js.map +1 -1
  80. package/dist/core/agent-errors.d.ts +3 -0
  81. package/dist/core/agent-errors.js +13 -0
  82. package/dist/core/agent-errors.js.map +1 -1
  83. package/dist/core/agent-model-policy.d.ts +1 -1
  84. package/dist/core/agent-model-policy.js +1 -1
  85. package/dist/core/agent-model-policy.js.map +1 -1
  86. package/dist/core/agent-profiles.d.ts +19 -3
  87. package/dist/core/agent-profiles.js +27 -3
  88. package/dist/core/agent-profiles.js.map +1 -1
  89. package/dist/core/agent-runner.d.ts +44 -10
  90. package/dist/core/agent-runner.js +21 -7
  91. package/dist/core/agent-runner.js.map +1 -1
  92. package/dist/core/antigravity-runner.js +2 -1
  93. package/dist/core/antigravity-runner.js.map +1 -1
  94. package/dist/core/backend-detect.d.ts +3 -2
  95. package/dist/core/backend-detect.js +80 -1
  96. package/dist/core/backend-detect.js.map +1 -1
  97. package/dist/core/claude-cli-runner.js +30 -3
  98. package/dist/core/claude-cli-runner.js.map +1 -1
  99. package/dist/core/claude-model-catalog.d.ts +6 -1
  100. package/dist/core/claude-model-catalog.js +20 -0
  101. package/dist/core/claude-model-catalog.js.map +1 -1
  102. package/dist/core/claude-usage-status.d.ts +8 -0
  103. package/dist/core/claude-usage-status.js +48 -0
  104. package/dist/core/claude-usage-status.js.map +1 -0
  105. package/dist/core/codex-app-server-runner.d.ts +8 -0
  106. package/dist/core/codex-app-server-runner.js +84 -13
  107. package/dist/core/codex-app-server-runner.js.map +1 -1
  108. package/dist/core/codex-model-catalog.js +42 -0
  109. package/dist/core/codex-model-catalog.js.map +1 -1
  110. package/dist/core/codex-ui-mapper.d.ts +7 -0
  111. package/dist/core/codex-ui-mapper.js +12 -2
  112. package/dist/core/codex-ui-mapper.js.map +1 -1
  113. package/dist/core/copilot-acp-runner.js +5 -1
  114. package/dist/core/copilot-acp-runner.js.map +1 -1
  115. package/dist/core/cursor-agent-runner.js +5 -1
  116. package/dist/core/cursor-agent-runner.js.map +1 -1
  117. package/dist/core/gemini-acp-runner.d.ts +37 -0
  118. package/dist/core/gemini-acp-runner.js +537 -0
  119. package/dist/core/gemini-acp-runner.js.map +1 -0
  120. package/dist/core/gemini-credentials.d.ts +21 -0
  121. package/dist/core/gemini-credentials.js +80 -0
  122. package/dist/core/gemini-credentials.js.map +1 -0
  123. package/dist/core/gemini-sessions.d.ts +18 -0
  124. package/dist/core/gemini-sessions.js +41 -0
  125. package/dist/core/gemini-sessions.js.map +1 -0
  126. package/dist/core/gemini-ui-mapper.d.ts +30 -0
  127. package/dist/core/gemini-ui-mapper.js +80 -0
  128. package/dist/core/gemini-ui-mapper.js.map +1 -0
  129. package/dist/core/junie-runner.js +2 -1
  130. package/dist/core/junie-runner.js.map +1 -1
  131. package/dist/core/kimi-home.d.ts +7 -0
  132. package/dist/core/kimi-home.js +13 -0
  133. package/dist/core/kimi-home.js.map +1 -0
  134. package/dist/core/kimi-model-catalog.d.ts +17 -0
  135. package/dist/core/kimi-model-catalog.js +45 -0
  136. package/dist/core/kimi-model-catalog.js.map +1 -0
  137. package/dist/core/kimi-runner.d.ts +90 -0
  138. package/dist/core/kimi-runner.js +874 -0
  139. package/dist/core/kimi-runner.js.map +1 -0
  140. package/dist/core/kimi-ui-mapper.d.ts +71 -0
  141. package/dist/core/kimi-ui-mapper.js +399 -0
  142. package/dist/core/kimi-ui-mapper.js.map +1 -0
  143. package/dist/core/model-identity.js +11 -0
  144. package/dist/core/model-identity.js.map +1 -1
  145. package/dist/core/model-presets.js +10 -0
  146. package/dist/core/model-presets.js.map +1 -1
  147. package/dist/core/omp-rpc-runner.d.ts +41 -0
  148. package/dist/core/omp-rpc-runner.js +451 -0
  149. package/dist/core/omp-rpc-runner.js.map +1 -0
  150. package/dist/core/omp-ui-mapper.d.ts +56 -0
  151. package/dist/core/omp-ui-mapper.js +468 -0
  152. package/dist/core/omp-ui-mapper.js.map +1 -0
  153. package/dist/core/opencode-http.d.ts +2 -0
  154. package/dist/core/opencode-http.js +2 -2
  155. package/dist/core/opencode-http.js.map +1 -1
  156. package/dist/core/opencode-server-runner.d.ts +3 -1
  157. package/dist/core/opencode-server-runner.js +197 -25
  158. package/dist/core/opencode-server-runner.js.map +1 -1
  159. package/dist/core/opencode-v2-events.d.ts +11 -0
  160. package/dist/core/opencode-v2-events.js +105 -0
  161. package/dist/core/opencode-v2-events.js.map +1 -0
  162. package/dist/core/pi-runner.js +5 -1
  163. package/dist/core/pi-runner.js.map +1 -1
  164. package/dist/core/private-mcp.d.ts +1 -1
  165. package/dist/core/private-mcp.js +2 -2
  166. package/dist/core/private-mcp.js.map +1 -1
  167. package/dist/core/process-signals.d.ts +29 -0
  168. package/dist/core/process-signals.js +85 -0
  169. package/dist/core/process-signals.js.map +1 -0
  170. package/dist/core/provider-auth.d.ts +25 -2
  171. package/dist/core/provider-auth.js +132 -12
  172. package/dist/core/provider-auth.js.map +1 -1
  173. package/dist/core/runner-factory.d.ts +1 -0
  174. package/dist/core/runner-factory.js +38 -1
  175. package/dist/core/runner-factory.js.map +1 -1
  176. package/dist/core/runner-model-catalog.d.ts +8 -0
  177. package/dist/core/runner-model-catalog.js +3 -0
  178. package/dist/core/runner-model-catalog.js.map +1 -1
  179. package/dist/core/tool-display.js +2 -0
  180. package/dist/core/tool-display.js.map +1 -1
  181. package/dist/core/ui-events.d.ts +1 -1
  182. package/dist/core/usage-limit.d.ts +2 -2
  183. package/dist/core/usage-limit.js +5 -3
  184. package/dist/core/usage-limit.js.map +1 -1
  185. package/dist/data-gitignore.d.ts +1 -1
  186. package/dist/data-gitignore.js +1 -0
  187. package/dist/data-gitignore.js.map +1 -1
  188. package/dist/dispatch/engine.d.ts +4 -0
  189. package/dist/dispatch/engine.js +9 -0
  190. package/dist/dispatch/engine.js.map +1 -1
  191. package/dist/e2e-setup.d.ts +8 -3
  192. package/dist/e2e-setup.js +31 -16
  193. package/dist/e2e-setup.js.map +1 -1
  194. package/dist/handoff.d.ts +2 -2
  195. package/dist/handoff.js +5 -5
  196. package/dist/handoff.js.map +1 -1
  197. package/dist/impact/demo-review.json +781 -0
  198. package/dist/impact/diff.d.ts +21 -0
  199. package/dist/impact/diff.js +81 -0
  200. package/dist/impact/diff.js.map +1 -0
  201. package/dist/impact/evidence.d.ts +67 -0
  202. package/dist/impact/evidence.js +238 -0
  203. package/dist/impact/evidence.js.map +1 -0
  204. package/dist/impact/impact-cli.d.ts +12 -0
  205. package/dist/impact/impact-cli.js +141 -0
  206. package/dist/impact/impact-cli.js.map +1 -0
  207. package/dist/impact/launch.d.ts +46 -0
  208. package/dist/impact/launch.js +145 -0
  209. package/dist/impact/launch.js.map +1 -0
  210. package/dist/impact/model.d.ts +551 -0
  211. package/dist/impact/model.js +188 -0
  212. package/dist/impact/model.js.map +1 -0
  213. package/dist/impact/publish.d.ts +30 -0
  214. package/dist/impact/publish.js +119 -0
  215. package/dist/impact/publish.js.map +1 -0
  216. package/dist/impact/render.d.ts +41 -0
  217. package/dist/impact/render.js +109 -0
  218. package/dist/impact/render.js.map +1 -0
  219. package/dist/impact/template.html +670 -0
  220. package/dist/impact/validate.d.ts +25 -0
  221. package/dist/impact/validate.js +273 -0
  222. package/dist/impact/validate.js.map +1 -0
  223. package/dist/index.js +19 -4
  224. package/dist/index.js.map +1 -1
  225. package/dist/managers/engine.js +5 -2
  226. package/dist/managers/engine.js.map +1 -1
  227. package/dist/pack-check.d.ts +1 -0
  228. package/dist/pack-check.js +14 -0
  229. package/dist/pack-check.js.map +1 -1
  230. package/dist/paths.d.ts +6 -0
  231. package/dist/paths.js +19 -1
  232. package/dist/paths.js.map +1 -1
  233. package/dist/runs/agent-error-telemetry.js +7 -4
  234. package/dist/runs/agent-error-telemetry.js.map +1 -1
  235. package/dist/runs/agent-tmpdir.d.ts +25 -6
  236. package/dist/runs/agent-tmpdir.js +136 -25
  237. package/dist/runs/agent-tmpdir.js.map +1 -1
  238. package/dist/runs/artifacts.d.ts +52 -0
  239. package/dist/runs/artifacts.js +243 -0
  240. package/dist/runs/artifacts.js.map +1 -0
  241. package/dist/runs/event-history.d.ts +12 -0
  242. package/dist/runs/event-history.js +61 -0
  243. package/dist/runs/event-history.js.map +1 -1
  244. package/dist/runs/project-assets.d.ts +9 -0
  245. package/dist/runs/project-assets.js +57 -0
  246. package/dist/runs/project-assets.js.map +1 -0
  247. package/dist/runs/review-gate.d.ts +10 -0
  248. package/dist/runs/review-gate.js +12 -0
  249. package/dist/runs/review-gate.js.map +1 -1
  250. package/dist/runs/store.d.ts +70 -4
  251. package/dist/runs/store.js +139 -26
  252. package/dist/runs/store.js.map +1 -1
  253. package/dist/server/agent-setup.d.ts +1 -1
  254. package/dist/server/agent-setup.js +2 -1
  255. package/dist/server/agent-setup.js.map +1 -1
  256. package/dist/server/artifacts.d.ts +33 -0
  257. package/dist/server/artifacts.js +133 -0
  258. package/dist/server/artifacts.js.map +1 -0
  259. package/dist/server/dashboard.d.ts +5 -0
  260. package/dist/server/forge/github-assets.d.ts +7 -0
  261. package/dist/server/forge/github-assets.js +100 -0
  262. package/dist/server/forge/github-assets.js.map +1 -0
  263. package/dist/server/forge/github.d.ts +11 -0
  264. package/dist/server/forge/github.js +42 -0
  265. package/dist/server/forge/github.js.map +1 -1
  266. package/dist/server/open-in-app.js +3 -0
  267. package/dist/server/open-in-app.js.map +1 -1
  268. package/dist/server/provider-action-gate.js +12 -4
  269. package/dist/server/provider-action-gate.js.map +1 -1
  270. package/dist/server/server.d.ts +10012 -6701
  271. package/dist/server/server.js +353 -193
  272. package/dist/server/server.js.map +1 -1
  273. package/dist/server/star-count.d.ts +5 -5
  274. package/dist/server/star-count.js +5 -5
  275. package/dist/server/star-count.js.map +1 -1
  276. package/dist/server-install/steps.js +1 -0
  277. package/dist/server-install/steps.js.map +1 -1
  278. package/dist/skills-provision.js +7 -1
  279. package/dist/skills-provision.js.map +1 -1
  280. package/dist/skills.d.ts +10 -6
  281. package/dist/skills.js +11 -6
  282. package/dist/skills.js.map +1 -1
  283. package/dist/transfer/automations-file.d.ts +46 -0
  284. package/dist/transfer/automations-file.js +172 -0
  285. package/dist/transfer/automations-file.js.map +1 -0
  286. package/dist/transfer/config-bundle.d.ts +100 -0
  287. package/dist/transfer/config-bundle.js +430 -0
  288. package/dist/transfer/config-bundle.js.map +1 -0
  289. package/dist/webhooks/outbox.js +83 -63
  290. package/dist/webhooks/outbox.js.map +1 -1
  291. package/dist/workflows/graph.d.ts +27 -0
  292. package/dist/workflows/load.js +2 -2
  293. package/dist/workflows/load.js.map +1 -1
  294. package/dist/workflows/resume-fallback.d.ts +13 -6
  295. package/dist/workflows/resume-fallback.js +26 -6
  296. package/dist/workflows/resume-fallback.js.map +1 -1
  297. package/dist/workflows/run.d.ts +121 -10
  298. package/dist/workflows/run.js +363 -61
  299. package/dist/workflows/run.js.map +1 -1
  300. package/dist/workflows/templates.d.ts +27 -16
  301. package/dist/workflows/templates.js +17 -0
  302. package/dist/workflows/templates.js.map +1 -1
  303. package/dist/workflows/types.d.ts +21 -0
  304. package/dist/workflows/types.js +3 -1
  305. package/dist/workflows/types.js.map +1 -1
  306. package/dist/workspace/agent-accounts.d.ts +27 -15
  307. package/dist/workspace/agent-accounts.js +4 -14
  308. package/dist/workspace/agent-accounts.js.map +1 -1
  309. package/dist/workspace/agent-profiles.js +3 -0
  310. package/dist/workspace/agent-profiles.js.map +1 -1
  311. package/dist/workspace/config.d.ts +12 -6
  312. package/dist/workspace/config.js +3 -13
  313. package/dist/workspace/config.js.map +1 -1
  314. package/dist/workspace/dashboard-costs.d.ts +1 -0
  315. package/dist/workspace/dashboard-costs.js +1 -0
  316. package/dist/workspace/dashboard-costs.js.map +1 -1
  317. package/dist/workspace/dashboard-insights.d.ts +1 -0
  318. package/dist/workspace/dashboard-insights.js +5 -2
  319. package/dist/workspace/dashboard-insights.js.map +1 -1
  320. package/dist/workspace/dashboard-overview.js +2 -0
  321. package/dist/workspace/dashboard-overview.js.map +1 -1
  322. package/dist/workspace/dashboard.d.ts +1 -0
  323. package/package.json +5 -4
  324. package/scripts/check-pack.mjs +3 -2
  325. package/scripts/copy-assets.mjs +17 -0
  326. package/scripts/mock-claude.mjs +106 -1
  327. package/scripts/mock-gemini-acp.mjs +195 -0
  328. package/scripts/mock-kimi-acp.mjs +126 -0
  329. package/scripts/mock-omp-rpc.mjs +194 -0
  330. package/skills/change-impact/SKILL.md +117 -0
  331. package/skills/change-impact/references/analysis-contract.md +141 -0
  332. package/skills/change-impact/references/public-api.md +92 -0
  333. package/skills/change-impact/references/visual-contract.md +71 -0
  334. package/web/dist/assets/{active-forge-DEmP_h4r.js → active-forge-DO2AaQ-s.js} +1 -1
  335. package/web/dist/assets/agent-task-pickers-CZpw4vcZ.js +1 -0
  336. package/web/dist/assets/{alert-dialog-BZkKvKiu.js → alert-dialog-BihfE0uZ.js} +1 -1
  337. package/web/dist/assets/arrow-down-DACdHKjc.js +1 -0
  338. package/web/dist/assets/arrow-left-BtT8zuL0.js +1 -0
  339. package/web/dist/assets/arrow-up-BAPSgozC.js +1 -0
  340. package/web/dist/assets/ask-answer-Co3javaA.js +1 -0
  341. package/web/dist/assets/{ask-card-CfNUHYt9.js → ask-card-DLtNyMH_.js} +2 -2
  342. package/web/dist/assets/assets-view-CLCckPll.js +1 -0
  343. package/web/dist/assets/{automation-format-BPrWgGBz.js → automation-format-BXwiLf2G.js} +1 -1
  344. package/web/dist/assets/automations-route-JizzZrRf.js +1 -0
  345. package/web/dist/assets/blink-1oEUjxch.webp +0 -0
  346. package/web/dist/assets/blink-B4Y4PYCR.webp +0 -0
  347. package/web/dist/assets/blink-BpqW08tf.webp +0 -0
  348. package/web/dist/assets/blink-C380t2a5.webp +0 -0
  349. package/web/dist/assets/blink-CLn5VMYQ.webp +0 -0
  350. package/web/dist/assets/blink-Cn_tI5Yd.webp +0 -0
  351. package/web/dist/assets/blink-D4EaTnc2.webp +0 -0
  352. package/web/dist/assets/blink-DY4Sm5aw.webp +0 -0
  353. package/web/dist/assets/blink-mcM10OfP.webp +0 -0
  354. package/web/dist/assets/body-CXEwT_gR.webp +0 -0
  355. package/web/dist/assets/body-D-UrLURv.webp +0 -0
  356. package/web/dist/assets/body-D7Q8eJDv.webp +0 -0
  357. package/web/dist/assets/body-DdNSx4-d.webp +0 -0
  358. package/web/dist/assets/body-DlFNtp32.webp +0 -0
  359. package/web/dist/assets/body-EreQeu3g.webp +0 -0
  360. package/web/dist/assets/body-Goc64z5o.webp +0 -0
  361. package/web/dist/assets/body-_FLmHm_q.webp +0 -0
  362. package/web/dist/assets/body-v5xTmq5E.webp +0 -0
  363. package/web/dist/assets/{bot-qZRkHkDp.js → bot-Cm-PLA1M.js} +1 -1
  364. package/web/dist/assets/{button-BrxohNcK.js → button-BqkA8Ovk.js} +1 -1
  365. package/web/dist/assets/{centered-state-CSW_o4N7.js → centered-state-CquGIOsq.js} +1 -1
  366. package/web/dist/assets/check-B1z-_MCO.js +1 -0
  367. package/web/dist/assets/chevron-left-CDAxCC2p.js +1 -0
  368. package/web/dist/assets/chevron-right-DPaV033p.js +1 -0
  369. package/web/dist/assets/chunk-KS7C4IRE-DtL2Gzw3.js +3 -0
  370. package/web/dist/assets/{circle-alert-COKQc-87.js → circle-alert-B7VNkPC2.js} +1 -1
  371. package/web/dist/assets/circle-check-LWKCYKhA.js +1 -0
  372. package/web/dist/assets/{collapsible-BJ0sxcz9.js → collapsible-BuSDxSYs.js} +1 -1
  373. package/web/dist/assets/command-CfdVVS0V.js +1 -0
  374. package/web/dist/assets/{commit-list-HXZj01RO.js → commit-list-D5Nuv2HC.js} +1 -1
  375. package/web/dist/assets/compare-variants-BBOnUKfp.js +1 -0
  376. package/web/dist/assets/composer-BPIW4tmM.js +18 -0
  377. package/web/dist/assets/composer-attachments-DyC9yyGs.js +3 -0
  378. package/web/dist/assets/concerned-BIuYysOA.webp +0 -0
  379. package/web/dist/assets/concerned-BWTrkjRS.webp +0 -0
  380. package/web/dist/assets/concerned-BW_ywmzK.webp +0 -0
  381. package/web/dist/assets/concerned-CXQVACqJ.webp +0 -0
  382. package/web/dist/assets/concerned-DdsJa1t2.webp +0 -0
  383. package/web/dist/assets/concerned-Dlln-1nu.webp +0 -0
  384. package/web/dist/assets/concerned-DrSCYUQV.webp +0 -0
  385. package/web/dist/assets/concerned-TOjmS1qX.webp +0 -0
  386. package/web/dist/assets/concerned-tIx9dV3J.webp +0 -0
  387. package/web/dist/assets/dashboard-B_ytEQ_y.js +44 -0
  388. package/web/dist/assets/diff-BQScRHXz.js +3 -0
  389. package/web/dist/assets/diff-stat-CxDTnfya.js +1 -0
  390. package/web/dist/assets/diff-view-8m9Rnct7.js +13 -0
  391. package/web/dist/assets/{directional-usage-BtjgT5nc.js → directional-usage-BerE4wJK.js} +1 -1
  392. package/web/dist/assets/dist-Br4Ra_c5.js +1 -0
  393. package/web/dist/assets/{download-DH68Y5Vz.js → download-HBguClwD.js} +1 -1
  394. package/web/dist/assets/dropdown-menu-CDv5Teql.js +1 -0
  395. package/web/dist/assets/excited-8dK2gfAF.webp +0 -0
  396. package/web/dist/assets/excited-B-w6ozXs.webp +0 -0
  397. package/web/dist/assets/excited-B4Sch7Ub.webp +0 -0
  398. package/web/dist/assets/excited-BPQk8ECE.webp +0 -0
  399. package/web/dist/assets/excited-BRFi0cue.webp +0 -0
  400. package/web/dist/assets/excited-BvbUAHvw.webp +0 -0
  401. package/web/dist/assets/excited-CCH-VUDr.webp +0 -0
  402. package/web/dist/assets/excited-TMExhEMj.webp +0 -0
  403. package/web/dist/assets/excited-cSRbau5J.webp +0 -0
  404. package/web/dist/assets/{external-link-BVYdhpSK.js → external-link-Bclznsu3.js} +1 -1
  405. package/web/dist/assets/file-preview-DQ7iQhe0.js +2 -0
  406. package/web/dist/assets/{file-DYpKJvYs.js → file-rCLi_p-R.js} +1 -1
  407. package/web/dist/assets/file-tree-Bm38qEZP.js +1 -0
  408. package/web/dist/assets/focused-XMnI1Trp.webp +0 -0
  409. package/web/dist/assets/{folder-CeFUSrsO.js → folder-leteY9jH.js} +1 -1
  410. package/web/dist/assets/follow-up-engine-Q1EcpRpB.js +1 -0
  411. package/web/dist/assets/git-pull-request-CURFMFaU.js +1 -0
  412. package/web/dist/assets/{git-pull-request-draft-DL1VMp1L.js → git-pull-request-draft-BZgJrUou.js} +1 -1
  413. package/web/dist/assets/git-tab-loading-CF0flOMS.js +1 -0
  414. package/web/dist/assets/github-DcvXvc4J.js +1 -0
  415. package/web/dist/assets/happy-B7LJPne_.webp +0 -0
  416. package/web/dist/assets/happy-CCpAho8w.webp +0 -0
  417. package/web/dist/assets/happy-Ch9wxHii.webp +0 -0
  418. package/web/dist/assets/happy-CnoCjXOf.webp +0 -0
  419. package/web/dist/assets/happy-DVeEwiyo.webp +0 -0
  420. package/web/dist/assets/happy-URIT6hFl.webp +0 -0
  421. package/web/dist/assets/happy-ZufSdCLm.webp +0 -0
  422. package/web/dist/assets/happy-kfLwwDLp.webp +0 -0
  423. package/web/dist/assets/happy-nVffy2Sx.webp +0 -0
  424. package/web/dist/assets/{host-usage-o1rC0TiP.js → host-usage-CX8OXl8q.js} +1 -1
  425. package/web/dist/assets/icon-tooltip-BMkyRHLt.js +1 -0
  426. package/web/dist/assets/impact-control-Deh1F44q.js +1 -0
  427. package/web/dist/assets/impact-model-Dj6tIycu.js +1 -0
  428. package/web/dist/assets/index-DuW72uFI.js +33 -0
  429. package/web/dist/assets/index-jRkTI5kE.css +2 -0
  430. package/web/dist/assets/{input-BxjGaO_P.js → input-BO795Un9.js} +1 -1
  431. package/web/dist/assets/laptop-D2EKUOdE.webp +0 -0
  432. package/web/dist/assets/layers-YoqiEcNh.js +1 -0
  433. package/web/dist/assets/layout-cards-Cvq2XaJL.js +1 -0
  434. package/web/dist/assets/{layout-grid-C4d5rrDE.js → layout-grid-CSvbdC6i.js} +1 -1
  435. package/web/dist/assets/left-BBmAC9hS.webp +0 -0
  436. package/web/dist/assets/left-BUX98ijg.webp +0 -0
  437. package/web/dist/assets/left-CCrTs359.webp +0 -0
  438. package/web/dist/assets/left-CxWtAZHp.webp +0 -0
  439. package/web/dist/assets/left-DDCoVDRG.webp +0 -0
  440. package/web/dist/assets/left-DFGwPnRL.webp +0 -0
  441. package/web/dist/assets/left-D_qxT7z_.webp +0 -0
  442. package/web/dist/assets/left-QXVHT2zO.webp +0 -0
  443. package/web/dist/assets/left-S_rwAL-X.webp +0 -0
  444. package/web/dist/assets/leg-left-0EW5L4pu.webp +0 -0
  445. package/web/dist/assets/leg-left-BGo9dZbQ.webp +0 -0
  446. package/web/dist/assets/leg-left-BZ8ETYLj.webp +0 -0
  447. package/web/dist/assets/leg-left-BahG1x_b.webp +0 -0
  448. package/web/dist/assets/leg-left-C-DJQ3Pt.webp +0 -0
  449. package/web/dist/assets/leg-left-C6ZvH8fW.webp +0 -0
  450. package/web/dist/assets/leg-left-DsfFyCf7.webp +0 -0
  451. package/web/dist/assets/leg-left-Iq6VC-OZ.webp +0 -0
  452. package/web/dist/assets/leg-left-rVU9cV-d.webp +0 -0
  453. package/web/dist/assets/leg-right-2MnCGKHj.webp +0 -0
  454. package/web/dist/assets/leg-right-BCgv_Tjj.webp +0 -0
  455. package/web/dist/assets/leg-right-BOxKTHZ9.webp +0 -0
  456. package/web/dist/assets/leg-right-BeDSbUV7.webp +0 -0
  457. package/web/dist/assets/leg-right-BwrF93s6.webp +0 -0
  458. package/web/dist/assets/leg-right-CU-y_n5h.webp +0 -0
  459. package/web/dist/assets/leg-right-DKSfNi2y.webp +0 -0
  460. package/web/dist/assets/leg-right-Dq0ze2e4.webp +0 -0
  461. package/web/dist/assets/leg-right-t34e1CvD.webp +0 -0
  462. package/web/dist/assets/lib-BQXq3kEf.js +1 -0
  463. package/web/dist/assets/loader-circle-DjzuGw6j.js +1 -0
  464. package/web/dist/assets/manager-chat-C4QqN-w6.js +1 -0
  465. package/web/dist/assets/manager-index-BGNDfiIy.js +1 -0
  466. package/web/dist/assets/manager-new-Dek6H9Bg.js +2 -0
  467. package/web/dist/assets/managers-Dufza9IX.js +1 -0
  468. package/web/dist/assets/{markdown-Di8pirEb.js → markdown-CP2EQDsL.js} +1 -1
  469. package/web/dist/assets/{markdown-rDA5iFAU.js → markdown-YWy3FUHK.js} +2 -2
  470. package/web/dist/assets/mascot-picker-0_LGzV_f.js +1 -0
  471. package/web/dist/assets/{message-square-CstvkIHe.js → message-square-beq8DjLH.js} +1 -1
  472. package/web/dist/assets/new-task-form-BgMiEphZ.js +2 -0
  473. package/web/dist/assets/pencil-RUM53auZ.js +1 -0
  474. package/web/dist/assets/picker-pill-BO6YUs1F.js +1 -0
  475. package/web/dist/assets/play-Cj3p2Q5t.js +1 -0
  476. package/web/dist/assets/plus-Bdmhj8CR.js +1 -0
  477. package/web/dist/assets/portrait-BJ2e30PF.webp +0 -0
  478. package/web/dist/assets/portrait-BeDbYw8Z.webp +0 -0
  479. package/web/dist/assets/portrait-Bq7D7LzX.webp +0 -0
  480. package/web/dist/assets/portrait-C6HtaggP.webp +0 -0
  481. package/web/dist/assets/portrait-CcOzDXGs.webp +0 -0
  482. package/web/dist/assets/portrait-D44z6yep.webp +0 -0
  483. package/web/dist/assets/portrait-DHLQRy13.webp +0 -0
  484. package/web/dist/assets/portrait-DU3qlTxc.webp +0 -0
  485. package/web/dist/assets/portrait-q94U_uD6.webp +0 -0
  486. package/web/dist/assets/project-router-xmadY-N9.js +1 -0
  487. package/web/dist/assets/queries-ba5qZ3kd.js +1 -0
  488. package/web/dist/assets/reasoning-effort-pill-B8Z1RaXL.js +1 -0
  489. package/web/dist/assets/reference-chip-C9pVQk05.js +1 -0
  490. package/web/dist/assets/reference-conflict-action-DxUm18aD.js +1 -0
  491. package/web/dist/assets/repo-git-DFf8ZGZv.js +1 -0
  492. package/web/dist/assets/right-BFOa1Ihi.webp +0 -0
  493. package/web/dist/assets/right-BLsBZrK1.webp +0 -0
  494. package/web/dist/assets/right-BVU3rYuj.webp +0 -0
  495. package/web/dist/assets/right-BbES4jIG.webp +0 -0
  496. package/web/dist/assets/right-C2klSA-G.webp +0 -0
  497. package/web/dist/assets/right-Cte2BTL5.webp +0 -0
  498. package/web/dist/assets/right-Dz7jYN17.webp +0 -0
  499. package/web/dist/assets/right-W2oGaUHb.webp +0 -0
  500. package/web/dist/assets/right-XJjUU0AU.webp +0 -0
  501. package/web/dist/assets/run-actions-CLIUiXwS.js +1 -0
  502. package/web/dist/assets/{run-diff-CFHlmgGA.js → run-diff-CxS_a1EO.js} +2 -2
  503. package/web/dist/assets/{save-C4TDysfG.js → save-zfKVAo2Y.js} +1 -1
  504. package/web/dist/assets/{scroll-within-D3mqUngk.js → scroll-within-DhWf-4MN.js} +1 -1
  505. package/web/dist/assets/search-CCE2KMtX.js +1 -0
  506. package/web/dist/assets/{search-x-BkezzsKh.js → search-x-BxcYdvqm.js} +1 -1
  507. package/web/dist/assets/{settings-2-DIHmg7wZ.js → settings-2-B0yYRU0q.js} +1 -1
  508. package/web/dist/assets/sheet-DxqNqi5S.js +1 -0
  509. package/web/dist/assets/skills-BmQ9hZ2c.js +1 -0
  510. package/web/dist/assets/sortable.esm-Dj7Kk-Wk.js +5 -0
  511. package/web/dist/assets/square--LrBHma0.js +1 -0
  512. package/web/dist/assets/standing-C42GacCE.webp +0 -0
  513. package/web/dist/assets/standing-C5Tul1Nv.webp +0 -0
  514. package/web/dist/assets/standing-CUU2Jka6.webp +0 -0
  515. package/web/dist/assets/standing-Ca5nprIS.webp +0 -0
  516. package/web/dist/assets/standing-CgOaMKRT.webp +0 -0
  517. package/web/dist/assets/standing-ClF4PE2-.webp +0 -0
  518. package/web/dist/assets/standing-CoS9fBjb.webp +0 -0
  519. package/web/dist/assets/standing-DZrhVTuG.webp +0 -0
  520. package/web/dist/assets/standing-MhG0Chks.webp +0 -0
  521. package/web/dist/assets/status-dot-Dxb9pPsK.js +1 -0
  522. package/web/dist/assets/tabs-CmEFauE4.js +1 -0
  523. package/web/dist/assets/{tag-B56iP2zA.js → tag-TWBVKabJ.js} +1 -1
  524. package/web/dist/assets/task-commits-sdhrDSta.js +1 -0
  525. package/web/dist/assets/{task-graph-ZjFyDrAV.js → task-graph-DqXUw-PM.js} +1 -1
  526. package/web/dist/assets/task-notes-ur3eZYQs.js +1 -0
  527. package/web/dist/assets/task-workspace-BvamqKbw.js +28 -0
  528. package/web/dist/assets/terminal-CmRAOyqu.js +1 -0
  529. package/web/dist/assets/terminal-drawer-BiRjtnip.js +1 -0
  530. package/web/dist/assets/{terminal-pane-CeYi-FvS.js → terminal-pane-YnSc_Vhs.js} +2 -2
  531. package/web/dist/assets/{textarea-BXN4nZ0d.js → textarea-C58jseO-.js} +1 -1
  532. package/web/dist/assets/toaster-5ad4wwJ9.js +1 -0
  533. package/web/dist/assets/tooltip-45rfBiq8.js +1 -0
  534. package/web/dist/assets/tracker-CcyqVPEo.js +4 -0
  535. package/web/dist/assets/triangle-alert-C1mTIqxM.js +1 -0
  536. package/web/dist/assets/typing-left-BWPbVi7e.webp +0 -0
  537. package/web/dist/assets/typing-right-HDY0V90O.webp +0 -0
  538. package/web/dist/assets/{upload-D_kW6AjR.js → upload-C2gxSnMR.js} +1 -1
  539. package/web/dist/assets/use-now-DD2atNhs.js +1 -0
  540. package/web/dist/assets/utils-Br_dqwn-.js +60 -0
  541. package/web/dist/assets/{workflow-j8scU63W.js → workflow-WvO4bTRt.js} +1 -1
  542. package/web/dist/assets/workflow-graph-B2oESW5u.js +13 -0
  543. package/web/dist/assets/worktree-lifecycle-BxYvSKsA.js +1 -0
  544. package/web/dist/assets/{worktree-lifecycle-operation-mYB7KCpQ.js → worktree-lifecycle-operation-BRID04bW.js} +1 -1
  545. package/web/dist/assets/x-CZSnHsZ4.js +1 -0
  546. package/web/dist/assets/{zoomable-image-CW-pQ6ZO.js → zoomable-image-DCITEnK-.js} +1 -1
  547. package/web/dist/index.html +70 -60
  548. package/web/dist/assets/agent-task-pickers-8skJH9bS.js +0 -1
  549. package/web/dist/assets/arrow-down-cBTb_EjO.js +0 -1
  550. package/web/dist/assets/arrow-left-BvR1Oqhc.js +0 -1
  551. package/web/dist/assets/arrow-up-Cn0IS81u.js +0 -1
  552. package/web/dist/assets/ask-answer-Cfb0vEFv.js +0 -1
  553. package/web/dist/assets/automations-route-B4axw9eb.js +0 -1
  554. package/web/dist/assets/check-B5omShEO.js +0 -1
  555. package/web/dist/assets/chevron-left-D74_-PJ_.js +0 -1
  556. package/web/dist/assets/chevron-right-C3fLn_fF.js +0 -1
  557. package/web/dist/assets/circle-check-j6r9xbE5.js +0 -1
  558. package/web/dist/assets/compare-variants-CDrFR7P_.js +0 -1
  559. package/web/dist/assets/composer-GntpkeQD.js +0 -18
  560. package/web/dist/assets/composer-attachments-Xa-qW8Eq.js +0 -3
  561. package/web/dist/assets/dashboard-CJW-Xk7f.js +0 -44
  562. package/web/dist/assets/diff-RPASOQVF.js +0 -3
  563. package/web/dist/assets/diff-view-Ckaab4uQ.js +0 -13
  564. package/web/dist/assets/file-preview-DOSEbcqV.js +0 -2
  565. package/web/dist/assets/git-tab-loading-DhclV71X.js +0 -1
  566. package/web/dist/assets/git-toolbar-Bk-3i42V.js +0 -1
  567. package/web/dist/assets/github-TdBnzj-H.js +0 -1
  568. package/web/dist/assets/icon-tooltip-CUJLXOxf.js +0 -1
  569. package/web/dist/assets/index-CDhEdFaZ.js +0 -33
  570. package/web/dist/assets/index-Dk1VTlxY.css +0 -2
  571. package/web/dist/assets/layout-cards-BYOEsNbu.js +0 -1
  572. package/web/dist/assets/lib-D2__YoPr.js +0 -1
  573. package/web/dist/assets/loader-circle-DCpZCAyT.js +0 -1
  574. package/web/dist/assets/manager-chat-B1Taq3Eg.js +0 -1
  575. package/web/dist/assets/manager-index-COwisKDf.js +0 -1
  576. package/web/dist/assets/manager-new-BdJPiBs2.js +0 -2
  577. package/web/dist/assets/manager-pickers-CvYpd5cU.js +0 -1
  578. package/web/dist/assets/managers-CDiETPHi.js +0 -1
  579. package/web/dist/assets/pencil-DWtoOm2f.js +0 -1
  580. package/web/dist/assets/picker-pill-DQICTO2N.js +0 -1
  581. package/web/dist/assets/play-BYwEI1EA.js +0 -1
  582. package/web/dist/assets/plus-BPopgSYQ.js +0 -1
  583. package/web/dist/assets/popover-DzdYqnHw.js +0 -1
  584. package/web/dist/assets/project-router-CmpQcVZp.js +0 -1
  585. package/web/dist/assets/queries-DOHu2y2B.js +0 -1
  586. package/web/dist/assets/reference-chip-ty5g_OLC.js +0 -1
  587. package/web/dist/assets/reference-conflict-action-B2LrO-o3.js +0 -1
  588. package/web/dist/assets/repo-git-CyoBxHfP.js +0 -1
  589. package/web/dist/assets/sheet-7RYAcp_E.js +0 -1
  590. package/web/dist/assets/skills-BBqk5FoM.js +0 -1
  591. package/web/dist/assets/sortable.esm-O2daV3YI.js +0 -5
  592. package/web/dist/assets/square-BPbl10lx.js +0 -1
  593. package/web/dist/assets/status-dot-C_5ryAFi.js +0 -1
  594. package/web/dist/assets/tabs-EEnYYrJF.js +0 -1
  595. package/web/dist/assets/task-commits-DFalvqkF.js +0 -1
  596. package/web/dist/assets/task-notes-DRDKGsIw.js +0 -1
  597. package/web/dist/assets/task-workspace-D2ak5sTE.js +0 -28
  598. package/web/dist/assets/terminal-B-JX8x9P.js +0 -1
  599. package/web/dist/assets/terminal-drawer-S0cBMANF.js +0 -1
  600. package/web/dist/assets/toaster-DrFdGtNN.js +0 -3
  601. package/web/dist/assets/tooltip-p6YPEpXC.js +0 -1
  602. package/web/dist/assets/tracker-CFDEuaFt.js +0 -4
  603. package/web/dist/assets/triangle-alert-Crbc2knA.js +0 -1
  604. package/web/dist/assets/use-now-DQpgbshl.js +0 -1
  605. package/web/dist/assets/utils-Df_1kJEk.js +0 -60
  606. package/web/dist/assets/workflow-graph-Cye5SBdg.js +0 -13
  607. package/web/dist/assets/worktree-lifecycle-Da61xsLH.js +0 -1
  608. package/web/dist/assets/x-sQR-jRBj.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ei as r,F as i,Gr as a,It as o,Kt as s,Mi as c,Mr as l,Xr as u,Yr as d,cn as f,co as p,in as m,na as h,oo as g,pr as _,pt as ee,qi as te,r as v,so as y,uo as b,wi as x,ya as S,za as ne}from"./queries-ba5qZ3kd.js";import{B as C,F as re,G as w,I as ie,It as ae,K as oe,L as T,P as se,R as E,U as D,V as ce,c as O,t as k,z as A}from"./utils-Br_dqwn-.js";import{f as le,p as ue}from"./chunk-KS7C4IRE-DtL2Gzw3.js";import{a as de,c as fe,d as pe,f as me,g as he,i as ge,l as _e,o as ve,p as ye,s as be,t as xe,u as Se}from"./sortable.esm-Dj7Kk-Wk.js";import{a as Ce,i as we,o as Te,r as Ee,t as De}from"./sheet-DxqNqi5S.js";import{N as j,t as M}from"./button-BqkA8Ovk.js";import{t as Oe}from"./arrow-down-DACdHKjc.js";import{t as ke}from"./arrow-left-BtT8zuL0.js";import{m as Ae,p as je}from"./worktree-lifecycle-operation-BRID04bW.js";import{u as Me}from"./reference-chip-C9pVQk05.js";import{t as Ne}from"./arrow-up-BAPSgozC.js";import{D as N}from"./run-actions-CLIUiXwS.js";import{a as Pe,c as Fe,d as Ie,f as P,i as Le,l as Re,m as ze,n as Be,o as Ve,p as He,r as Ue,s as We,t as Ge,u as Ke}from"./automation-format-BXwiLf2G.js";import{t as qe}from"./chevron-left-CDAxCC2p.js";import{s as Je}from"./dist-Br4Ra_c5.js";import{t as Ye}from"./chevron-right-DPaV033p.js";import{l as Xe,n as Ze,r as Qe,s as $e,t as et}from"./dropdown-menu-CDv5Teql.js";import{n as tt,t as nt}from"./pencil-RUM53auZ.js";import{t as rt}from"./download-HBguClwD.js";import{a as it}from"./reference-conflict-action-DxUm18aD.js";import{y as at}from"./impact-model-Dj6tIycu.js";import{t as ot}from"./upload-C2gxSnMR.js";import{n as st,t as ct}from"./settings-2-B0yYRU0q.js";import{a as lt,c as ut,g as dt,o as ft}from"./composer-BPIW4tmM.js";import{t as pt}from"./play-Cj3p2Q5t.js";import{t as mt}from"./plus-Bdmhj8CR.js";import{t as ht}from"./terminal-CmRAOyqu.js";import{n as gt,t as _t}from"./textarea-C58jseO-.js";import{t as vt}from"./triangle-alert-C1mTIqxM.js";import{n as yt,r as bt,t as xt}from"./collapsible-BuSDxSYs.js";import{a as St,c as Ct,i as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt}from"./alert-dialog-BihfE0uZ.js";import{A as At,D as jt,E as Mt,O as Nt,T as Pt,k as Ft,t as It}from"./use-now-DD2atNhs.js";import{t as F}from"./input-BO795Un9.js";import{r as Lt}from"./toaster-5ad4wwJ9.js";import{v as Rt}from"./new-task-form-BgMiEphZ.js";import{t as I}from"./status-dot-Dxb9pPsK.js";import{c as L,s as zt,t as R}from"./project-router-xmadY-N9.js";import{n as Bt}from"./format-DHK74MwW.js";import{r as Vt}from"./directional-usage-BerE4wJK.js";import{r as z,t as Ht}from"./picker-pill-BO6YUs1F.js";import{t as Ut}from"./centered-state-CquGIOsq.js";import{$ as B,F as Wt,G as Gt,I as Kt,J as qt,K as Jt,L as Yt,M as Xt,N as Zt,P as Qt,Q as V,R as $t,U as en,W as tn,X as nn,Y as rn,a as an,at as on,bt as sn,c as cn,et as H,gt as ln,i as un,it as U,nt as W,ot as G,p as dn,q as fn,st as pn,tt as K,z as mn}from"./index-DuW72uFI.js";var hn=j(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),gn=j(`list-x`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`m15.5 9.5 5 5`,key:`ytk86i`}],[`path`,{d:`m20.5 9.5-5 5`,key:`17o44f`}]]),_n=j(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),vn=j(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),yn=j(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=e(t(),1),J=n();function bn({association:e,selected:t,onSelect:n,onRemove:i}){let a=g({queryKey:[`tracker`,O(),`label-suggestions`,e],initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>r({association:e,state:`all`,limit:50,cursor:t},{signal:n}),getNextPageParam:e=>e.available&&e.truncated?e.nextCursor:void 0,retry:!1,staleTime:6e4}),o=a.data?.pages??[],s=o.at(-1),c=o.find(e=>!e.available),l=a.isError||!!c,u=[...new Set([...t,...l?[]:o.flatMap(e=>e.available?e.items.flatMap(e=>e.labels):[])])].filter(e=>t.includes(e)||e.length>0&&e.length<=200).sort((e,t)=>e.localeCompare(t));return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,"aria-label":`Project label suggestions`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Required labels`}),(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`All selected labels must match. Leave unselected to allow any label.`}),(0,J.jsx)(`div`,{role:`group`,"aria-label":`Required labels`,className:`flex flex-wrap gap-1.5`,children:u.map(e=>(0,J.jsx)(z,{active:t.includes(e),"aria-pressed":t.includes(e),disabled:!t.includes(e)&&t.length>=100,onClick:()=>t.includes(e)?i(e):n(e),children:e},e))}),a.isFetching?(0,J.jsx)(`p`,{role:`status`,children:`Loading labels…`}):null,l?(0,J.jsxs)(`div`,{role:`alert`,children:[(0,J.jsx)(`p`,{children:`Could not load labels. Your selection is preserved.`}),(0,J.jsx)(M,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void a.refetch(),children:`Retry label suggestions`})]}):(0,J.jsxs)(J.Fragment,{children:[!a.isPending&&!a.isFetching&&u.length===0?(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No labels found in the loaded tasks.`}):null,a.hasNextPage?(0,J.jsx)(M,{type:`button`,variant:`outline`,size:`sm`,disabled:a.isFetching,onClick:()=>void a.fetchNextPage(),children:`Load labels from more tasks`}):null,!a.hasNextPage&&s?.available&&s.truncated?(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The provider returned a limited task list.`}):null]})]})}var xn=[`pull_request.opened`,`issue.opened`,`issue.labeled`,`issue.unlabeled`,`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`,`pull_request.closed`,`pull_request.merged`];function Sn(e){return[{id:`task`,name:e,skill:e,prompt:`{{task}}`}]}function Cn(e){let[t,...n]=e??[];return t&&n.length===0&&t.skill&&t.prompt===`{{task}}`?t.skill:null}function wn(e){return e.skill?{source:`skill`,ref:e.skill}:e.workflow&&e.workflow!==`quick-task`?{source:`workflow`,ref:e.workflow}:null}function Tn(e){return e?.source===`skill`?{skill:e.ref,workflow:Rt,customSteps:null}:{skill:null,workflow:e?.ref??`quick-task`,customSteps:null}}var En=[2,5,10,15,30,60],Dn=[1,2,4,6,8],On={authors:``,assignees:``,anyLabels:``,allLabels:``,excludeLabels:``,changedLabels:``,reviewers:``,lookbackDays:7,maxRecords:25},kn={type:`daily`,hour:4,minute:0};function An(){return{name:``,kind:`schedule`,schedule:{...kn},events:[`issue.opened`],intervalSeconds:300,filters:{...On},prompt:``,workflow:Rt,skill:null,customSteps:null,runner:null,account:null,model:null,reasoningEffort:null,autonomous:!0,dispatch:!1,maxSubtasks:4,reviewChild:!0,enabled:!1}}var Y=e=>(e??[]).join(`, `);function jn(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}function Mn(e){return{authors:Y(e.authors),assignees:Y(e.assignees),anyLabels:Y(e.anyLabels),allLabels:Y(e.allLabels),excludeLabels:Y(e.excludeLabels),changedLabels:Y(e.changedLabels),reviewers:Y(e.reviewers),lookbackDays:e.lookbackDays,maxRecords:e.maxRecords}}function Nn(e){let t=An(),{task:n,filters:r}=e,i=Cn(n.steps);return{...t,name:e.name,kind:e.kind,trackerTrigger:e.trackerTrigger,schedule:e.schedule?{...e.schedule}:t.schedule,schedules:e.schedules?.map(e=>({...e})),events:e.events?.length?[...e.events]:t.events,intervalSeconds:e.intervalSeconds??t.intervalSeconds,filters:r?Mn(r):t.filters,prompt:n.prompt,workflow:n.workflow??t.workflow,skill:i,customSteps:n.steps&&!i?n.steps:null,runner:n.runner??null,account:n.agentProfile??null,model:n.model??null,reasoningEffort:n.reasoningEffort??null,autonomous:n.autonomous??!1,dispatch:n.dispatch!==void 0,maxSubtasks:n.dispatch?.maxSubtasks??t.maxSubtasks,reviewChild:n.dispatch?.reviewChild??t.reviewChild,enabled:e.enabled,...n.checkout===void 0?{}:{checkout:n.checkout},...n.allowForkHeads===void 0?{}:{allowForkHeads:n.allowForkHeads}}}function Pn(e){return{name:e.name,kind:e.kind,...e.schedule?{schedule:e.schedule}:{},...e.schedules?{schedules:e.schedules}:{},...e.events?{events:e.events}:{},...e.intervalSeconds===void 0?{}:{intervalSeconds:e.intervalSeconds},...e.filters?{filters:e.filters}:{},prompt:e.task.prompt,...e.task.workflow?{workflow:e.task.workflow}:{},...e.task.steps?{steps:e.task.steps}:{},...e.task.runner?{runner:e.task.runner}:{},...e.task.model===void 0?{}:{model:e.task.model},...e.task.reasoningEffort?{reasoningEffort:e.task.reasoningEffort}:{},...e.task.autonomous===void 0?{}:{autonomous:e.task.autonomous},...e.task.dispatch?{dispatch:e.task.dispatch}:{},...e.task.checkout?{checkout:e.task.checkout}:{},...e.task.allowForkHeads===void 0?{}:{allowForkHeads:e.task.allowForkHeads}}}var Fn=e=>ae.safeParse(e).success;function In(e,t){let n=Cn(t.steps);return{...e,name:t.name,kind:t.kind,schedule:t.schedule?{...t.schedule}:e.schedule,schedules:t.schedules?.map(e=>({...e})),events:t.events?.length?[...t.events]:e.events,intervalSeconds:t.intervalSeconds??e.intervalSeconds,filters:t.filters?Mn(t.filters):{...On},prompt:t.prompt,...t.steps?{skill:n,customSteps:n?null:t.steps,workflow:Rt}:Tn(t.workflow?{source:`workflow`,ref:t.workflow}:null),checkout:t.checkout,allowForkHeads:t.allowForkHeads,runner:t.runner!==void 0&&Fn(t.runner)?t.runner:e.runner,account:t.runner!==void 0&&Fn(t.runner)?null:e.account,model:t.model??e.model,reasoningEffort:t.reasoningEffort??(t.runner!==void 0||t.model!==void 0?null:e.reasoningEffort),autonomous:t.autonomous??e.autonomous,dispatch:t.dispatch!==void 0,maxSubtasks:t.dispatch?.maxSubtasks??e.maxSubtasks,reviewChild:t.dispatch?.reviewChild??e.reviewChild}}function Ln(e){let t=ce(e);switch(t.type){case`hours`:return{type:`hours`,every:t.every};case`weekly`:return{type:`weekly`,hour:t.hour,minute:t.minute,day:t.day};case`once`:return{type:`once`,hour:t.hour,minute:t.minute,...t.date?{date:t.date}:{}};default:return{type:t.type,hour:t.hour,minute:t.minute}}}function Rn(e){let t={prompt:e.prompt,...e.skill?{steps:Sn(e.skill)}:e.customSteps?{steps:e.customSteps}:e.workflow?{workflow:e.workflow}:{},...e.runner?{runner:e.runner}:{},...e.account?{agentProfile:e.account}:{},...e.model?{model:e.model}:{},...e.reasoningEffort?{reasoningEffort:e.reasoningEffort}:{},autonomous:e.autonomous,...e.dispatch?{dispatch:{maxSubtasks:e.maxSubtasks,reviewChild:e.reviewChild}}:{}};if(e.kind===`schedule`)return{name:e.name.trim(),kind:`schedule`,schedule:Ln(e.schedule),...e.schedules?{schedules:[e.schedule,...e.schedules.slice(1)].map(Ln)}:{},task:t};if(e.kind===`tracker`)return{name:e.name.trim(),kind:`tracker`,trackerTrigger:e.trackerTrigger,intervalSeconds:e.intervalSeconds,filters:{lookbackDays:zn(e.filters.lookbackDays,1,90),maxRecords:zn(e.filters.maxRecords,1,100)},task:t};let n=e.filters,r=(e,t)=>{let n=jn(e);return n.length>0?{[t]:n}:{}};return{name:e.name.trim(),kind:`github`,events:[...e.events],intervalSeconds:e.intervalSeconds,filters:{...r(n.authors,`authors`),...r(n.assignees,`assignees`),...r(n.anyLabels,`anyLabels`),...r(n.allLabels,`allLabels`),...r(n.excludeLabels,`excludeLabels`),...r(n.changedLabels,`changedLabels`),...r(n.reviewers,`reviewers`),lookbackDays:zn(n.lookbackDays,1,90),maxRecords:zn(n.maxRecords,1,100)},task:{...t,...e.checkout===void 0?{}:{checkout:e.checkout},...e.allowForkHeads===void 0?{}:{allowForkHeads:e.allowForkHeads}}}}function zn(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function Bn(e){let t=Rn(e);return{name:t.name,kind:e.kind,...t.trackerTrigger?{trackerTrigger:t.trackerTrigger}:{},...t.schedule?{schedule:t.schedule}:{},...t.schedules?{schedules:t.schedules}:{},...t.events?{events:t.events}:{},...t.intervalSeconds===void 0?{}:{intervalSeconds:t.intervalSeconds},...t.filters?{filters:t.filters}:{},task:t.task,...e.enabled?{enable:!0}:{}}}var Vn=`([a-z\\d](?:[a-z\\d]|-(?=[a-z\\d])){0,38})`,Hn=RegExp(`\\b(?:user|author|by)\\s+(?:\`@?${Vn}\`|@${Vn}(?![\\w/-]))`,`gi`),Un=[`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`],Wn=new Set(`a an the this that these those any all each every some me my you your it its them their us our we he she they who whom which what someone anyone everyone others other pull pr prs issue issues review reviews reviewer reviewers request requests team teams user users human humans changes code now approval merge`.split(` `)),Gn=`(?:\`@?${Vn}\`|@${Vn}(?![\\w/-]))`,Kn=RegExp(`\\breview(?:s|\\s+requests?)?\\s+(?:(?:is|are)\\s+)?(?:requested\\s+)?(?:for|from|of)\\s+(?:${Gn}|${Vn}\\b(?![/@-]))`,`gi`),qn=RegExp(`\\b(?:requested\\s+)?reviewer\\s+${Gn}`,`gi`),Jn=RegExp(`${Gn}\\s+(?:(?:is|are|gets?)\\s+)?requested\\s+as\\s+(?:a\\s+)?reviewer\\b`,`gi`);function Yn(e){if(e.kind!==`github`)return[];let t=new Set([e.filters.authors,e.filters.assignees,e.filters.reviewers].flatMap(jn).map(e=>e.replace(/^@/,``).toLowerCase())),n=new Map,r=(e,r)=>{let i=e?.toLowerCase();!e||!i||t.has(i)||n.has(i)||n.set(i,{login:e,field:r})};if(e.events?.some(e=>Un.includes(e)))for(let t of[Kn,qn,Jn])for(let n of e.prompt.matchAll(t)){let e=n[1]??n[2]??n[3];e&&!Wn.has(e.toLowerCase())&&r(e,`reviewers`)}for(let t of e.prompt.matchAll(Hn))r(t[1]??t[2],`authors`);return[...n.values()]}function Xn(e){return e.includes(`issue.labeled`)||e.includes(`issue.unlabeled`)}var Zn=e=>[1,2,3,4,6,8,12].includes(e);function Qn({trigger:e,intervalSeconds:t,onChange:n,onValid:r}){let[i,a]=(0,q.useState)(``),o=O(),s=g({queryKey:[`tracker`,o,`automation-options`,``],initialPageParam:void 0,queryFn:({signal:e,pageParam:t})=>x({...t?{cursor:t}:{}},{signal:e}),getNextPageParam:e=>e.available?e.nextCursor:void 0,retry:!1}),c=g({queryKey:[`tracker`,o,`automation-options`,i],enabled:!!i&&s.data?.pages[0]?.available===!0,initialPageParam:void 0,queryFn:({signal:e,pageParam:t})=>x({...i?{search:i}:{},...t?{cursor:t}:{}},{signal:e}),getNextPageParam:e=>e.available?e.nextCursor:void 0,retry:!1}),l=i?c:s,u=s.data?.pages[0],d=u?.available?u:void 0,f=!!d&&!!e&&JSON.stringify(d.association)===JSON.stringify(e.association),p=!!e?.access&&f&&!!e?.events.length&&e.events.every(e=>d?.events.includes(e))&&(e.requiredLabels?.length??0)<=100&&(e.requiredLabels??[]).every(e=>e.length>0&&e.length<=200)&&(!e.events.includes(`issue.status_changed`)||!!e.targetStatusIds?.length)&&(!(e.events.includes(`issue.labeled`)||e.events.includes(`issue.unlabeled`))||!!e.changedLabelIds?.length);(0,q.useEffect)(()=>(r(p),()=>r(!1)),[p,r]);let m=l.data?.pages.flatMap(e=>e.available?[e]:[])??[],h=[...new Map(m.flatMap(e=>e.statuses).map(e=>[e.id,e])).values()],_=new Map((s.data?.pages.flatMap(e=>e.available?e.statuses:[])??[]).map(e=>[e.id,e.name])),ee=(e?.targetStatusIds??[]).filter(e=>!h.some(t=>t.id===e)),te=[...new Map(m.flatMap(e=>e.labels).map(e=>[e.id,e])).values()],v=e?.events.includes(`issue.status_changed`),y=e?.events.some(e=>e===`issue.labeled`||e===`issue.unlabeled`),b=v&&y?`Search tracker statuses and labels`:y?`Search tracker labels`:`Search tracker statuses`;return(0,J.jsxs)(`div`,{"data-slot":`editor-tracker`,className:`flex flex-col gap-3 text-sm`,children:[s.isPending?(0,J.jsx)(`p`,{children:`Loading tracker events…`}):null,s.isError||u&&!u.available?(0,J.jsxs)(`div`,{role:`alert`,children:[(0,J.jsxs)(`p`,{children:[u&&!u.available?u.reason:`Could not load tracker events.`,` Check the project’s Issue tracker settings.`]}),(0,J.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>void s.refetch(),children:`Retry`})]}):null,d?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{children:[d.association.kind===`jira`?`Jira`:`Linear`,` · `,d.association.externalName]}),e&&!f?(0,J.jsx)(`p`,{role:`alert`,children:`The tracker connection changed. Select an event again before saving.`}):null,e?null:(0,J.jsx)(`p`,{children:`Select an event to complete this automation.`}),(0,J.jsx)(`div`,{role:`group`,"aria-label":`Tracker events`,className:`flex flex-wrap gap-1.5`,children:d.events.map(t=>(0,J.jsx)(z,{active:f&&e?.events.includes(t),"aria-pressed":f&&e?.events.includes(t),onClick:()=>{let r=f?e.events:[],i=r.includes(t)?r.filter(e=>e!==t):[...r,t],a=e?.access??(e?void 0:{version:1,writes:[]}),o={...f?e:{},...a?{access:a}:{},association:d.association,events:i};t===`issue.status_changed`&&!i.includes(t)&&delete o.targetStatusIds,n({trackerTrigger:o,...f?{}:{enabled:!1}})},children:t},t))}),f&&e?(0,J.jsx)(bn,{association:d.association,selected:e.requiredLabels??[],onRemove:t=>n({trackerTrigger:{...e,requiredLabels:(e.requiredLabels??[]).filter(e=>e!==t)}}),onSelect:t=>n({trackerTrigger:{...e,requiredLabels:[...new Set([...e.requiredLabels??[],t])]}})},JSON.stringify(d.association)):null,(0,J.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,J.jsx)(`summary`,{className:`cursor-pointer`,children:`Integration details`}),(0,J.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,J.jsx)(`p`,{children:`Label choices come from loaded tasks in this project, including closed tasks. Saved selections remain available.`}),d.limitations.map(e=>(0,J.jsx)(`p`,{children:e},e))]})]}),e?.events.some(e=>e!==`issue.opened`)?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(F,{"aria-label":b,placeholder:b,value:i,onChange:e=>a(e.target.value)}),l.isFetching?(0,J.jsx)(`p`,{role:`status`,children:`Searching…`}):null,l.isError||l.data?.pages[0]&&!l.data.pages[0].available?(0,J.jsxs)(`div`,{role:`alert`,children:[`Could not load search results. `,(0,J.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>void l.refetch(),children:`Retry search`})]}):null,!l.isFetching&&l.data?.pages[0]?.available&&v&&h.length===0?(0,J.jsx)(`p`,{children:`No matching statuses.`}):null,!l.isFetching&&l.data?.pages[0]?.available&&y&&te.length===0?(0,J.jsx)(`p`,{children:`No matching labels.`}):null,e.events.includes(`issue.status_changed`)?(0,J.jsxs)(`div`,{role:`group`,"aria-label":`Target statuses`,className:`flex flex-wrap gap-1.5`,children:[h.map(t=>(0,J.jsx)(z,{active:e.targetStatusIds?.includes(t.id),"aria-pressed":e.targetStatusIds?.includes(t.id),onClick:()=>{let r=e.targetStatusIds??[];n({trackerTrigger:{...e,targetStatusIds:r.includes(t.id)?r.filter(e=>e!==t.id):[...r,t.id]}})},children:t.name},t.id)),ee.map(t=>(0,J.jsxs)(z,{active:!0,"aria-pressed":!0,onClick:()=>{n({trackerTrigger:{...e,targetStatusIds:(e.targetStatusIds??[]).filter(e=>e!==t)}})},children:[_.get(t)??t,` (not in current results)`]},t))]}):null,e.events.some(e=>e===`issue.labeled`||e===`issue.unlabeled`)?(0,J.jsx)(`div`,{role:`group`,"aria-label":`Changed labels`,className:`flex flex-wrap gap-1.5`,children:te.map(t=>(0,J.jsx)(z,{active:e.changedLabelIds?.includes(t.id),"aria-pressed":e.changedLabelIds?.includes(t.id),onClick:()=>{let r=e.changedLabelIds??[];n({trackerTrigger:{...e,changedLabelIds:r.includes(t.id)?r.filter(e=>e!==t.id):[...r,t.id]}})},children:t.name},t.id))}):null,l.hasNextPage?(0,J.jsx)(M,{variant:`outline`,size:`sm`,disabled:l.isFetchingNextPage,onClick:()=>void l.fetchNextPage(),children:`Load more`}):null]}):null]}):null,(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[`Check every`,(0,J.jsxs)(V,{value:String(t/60),onValueChange:e=>n({intervalSeconds:Number(e)*60}),children:[(0,J.jsx)(K,{"aria-label":`Tracker poll interval`,className:`w-28`,children:(0,J.jsx)(W,{})}),(0,J.jsx)(B,{children:En.map(e=>(0,J.jsxs)(H,{value:String(e),children:[e,` min`]},e))})]})]}),e&&f?(0,J.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`legend`,{children:`Tracker access`}),e.access?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{children:`Fresh issue details and accessible comments are read by cezar. Attachments and custom fields are not included. Tokens stay with cezar.`}),[`comment`,`transition`].map(t=>(0,J.jsxs)(`label`,{className:`flex gap-2`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:e.access.writes.includes(t),onChange:r=>n({trackerTrigger:{...e,access:{version:1,writes:r.target.checked?[...e.access.writes,t]:e.access.writes.filter(e=>e!==t)}}})}),`Allow agent to `,t===`comment`?`post comments`:`change status`,` on this issue without further approval`]},t))]}):(0,J.jsxs)(`div`,{role:`alert`,children:[`This automation previously gave its agent a tracker token. Review the prompt: only reading this issue, comments and status transitions are now supported. Other operations need a revised workflow.`,(0,J.jsx)(M,{type:`button`,variant:`outline`,onClick:()=>n({trackerTrigger:{...e,access:{version:1,writes:[]}}}),children:`Confirm migration to read-only access`})]})]}):null,(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Only events after enabling are eligible. Existing backlog is not launched. Use a token with minimal read permissions; grant provider write permissions only for selected write actions.`})]})}function $n({definition:e}){let t=nn(e),n=(0,q.useMemo)(()=>rn(e),[e]);return(0,J.jsxs)(P,{flush:!0,"data-slot":`copy-as-cli`,className:`px-3.5 py-3`,children:[(0,J.jsxs)(`div`,{className:`mb-2 flex items-center`,children:[(0,J.jsx)(`span`,{className:`eyebrow text-soft-foreground`,children:`Copy as CLI`}),(0,J.jsxs)(M,{variant:`ghost`,size:`sm`,className:`ml-auto h-6`,onClick:()=>void tn(n,t?qt:void 0),children:[(0,J.jsx)(tt,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})]}),(0,J.jsx)(`pre`,{className:`m-0 rounded-lg border border-border bg-card-2 px-2.5 py-2 font-mono text-meta leading-[1.6] break-words whitespace-pre-wrap text-muted-foreground`,children:n}),(0,J.jsx)(`p`,{className:`mt-2 mb-0 text-meta leading-[1.5] text-soft-foreground`,children:t?qt:(0,J.jsxs)(J.Fragment,{children:[`The same definition the cockpit saves — `,(0,J.jsx)(`code`,{className:`text-meta`,children:`cez automation schema`}),` prints its shape.`]})})]})}function er({available:e,enabled:t,maxSubtasks:n,reviewChild:r,onChange:i}){if(!e)return null;let a=Dn.includes(n)?Dn:[...Dn,n].sort((e,t)=>e-t);return(0,J.jsxs)(`div`,{"data-slot":`editor-dispatch`,"data-enabled":t?`true`:void 0,title:`Let this run start its own subtasks with cez task create — each in a worktree forked off its branch, reporting back into the parent session.`,className:`flex flex-wrap items-center gap-2.5 border-t border-border pt-3 text-ui text-muted-foreground`,children:[(0,J.jsxs)(G,{className:`text-ui font-medium text-foreground`,children:[(0,J.jsx)(st,{"aria-hidden":`true`,className:k(`size-3.5`,t?`text-violet`:`text-soft-foreground`)}),`Dispatch`,(0,J.jsx)(on,{"aria-label":`Dispatch`,checked:t,onCheckedChange:e=>i(e?{dispatch:!0}:{dispatch:!1,reviewChild:!1})})]}),t?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`up to`,(0,J.jsxs)(V,{value:String(n),onValueChange:e=>i({maxSubtasks:Number(e)}),children:[(0,J.jsx)(K,{size:`sm`,"aria-label":`Max subtasks`,className:`h-7 px-2 text-label`,children:(0,J.jsx)(W,{})}),(0,J.jsx)(B,{children:a.map(e=>(0,J.jsx)(H,{value:String(e),children:e},e))})]}),`subtasks`]}),(0,J.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,J.jsxs)(G,{className:`text-ui font-normal text-muted-foreground`,children:[(0,J.jsx)(on,{size:`sm`,"aria-label":`Review child`,checked:r,onCheckedChange:e=>i({reviewChild:e})}),`review child`]}),(0,J.jsxs)(`span`,{"data-slot":`editor-dispatch-hint`,className:`ml-auto text-meta whitespace-nowrap text-soft-foreground`,children:[`≤ `,n+1,` agents`]})]}):null]})}var tr={"pull_request.opened":`A pull request opens`,"issue.opened":`An issue opens`,"issue.labeled":`An issue gets a label`,"issue.unlabeled":`An issue loses a label`,"pull_request.reviewed":`A review is submitted`,"pull_request.review_requested":`A review is requested`,"pull_request.rereview_requested":`A re-review is requested`,"pull_request.closed":`A pull request closes`,"pull_request.merged":`A pull request merges`};function nr({events:e,intervalSeconds:t,filters:n,onChange:r}){let i=[`authors`,`assignees`,`anyLabels`,`allLabels`,`excludeLabels`,`changedLabels`,`reviewers`].filter(e=>n[e].trim().length>0),[a,o]=(0,q.useState)(i.length>0||n.lookbackDays!==7||n.maxRecords!==25),s=(e,t)=>r({filters:{...n,[e]:t}}),c=t=>{let n=e.includes(t)?e.filter(e=>e!==t):[...e,t];r({events:xn.filter(e=>n.includes(e))})},l=Xn(e),u=l&&n.changedLabels.trim().length===0;return(0,J.jsxs)(`div`,{"data-slot":`editor-github`,className:`flex flex-col gap-4`,children:[(0,J.jsx)(`div`,{role:`group`,"aria-label":`GitHub events`,className:`flex flex-wrap gap-1.5`,children:xn.map(t=>(0,J.jsxs)(z,{active:e.includes(t),"aria-pressed":e.includes(t),"aria-label":t,title:t,className:`h-8 gap-2 px-3`,onClick:()=>c(t),children:[tr[t],(0,J.jsx)(`span`,{className:`font-mono text-micro font-normal text-soft-foreground`,children:t})]},t))}),e.length===0?(0,J.jsx)(`p`,{className:`m-0 text-label text-danger`,children:`Pick at least one event.`}):null,(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-ui text-muted-foreground`,children:[`Checks GitHub every`,(0,J.jsxs)(V,{value:String(Math.round(t/60)),onValueChange:e=>r({intervalSeconds:Number(e)*60}),children:[(0,J.jsx)(K,{size:`sm`,"aria-label":`Poll interval`,className:`text-ui`,children:(0,J.jsx)(W,{})}),(0,J.jsx)(B,{children:En.map(e=>(0,J.jsxs)(H,{value:String(e),children:[e,` min`]},e))})]}),(0,J.jsxs)(`span`,{children:[`while this cockpit is open, looking back `,n.lookbackDays,` days, at most `,n.maxRecords,` records.`]})]}),(0,J.jsxs)(`p`,{"data-slot":`editor-github-how`,className:`-mt-2 m-0 text-label text-soft-foreground`,children:[`Through your `,(0,J.jsx)(`code`,{className:`text-xs`,children:`gh`}),`. No webhook or public URL needed.`]}),(0,J.jsxs)(xt,{open:a,onOpenChange:o,children:[(0,J.jsx)(bt,{asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 items-center gap-1 text-ui text-muted-foreground hover:text-foreground`,children:[(0,J.jsx)(Je,{"aria-hidden":`true`,className:k(`size-3 transition-transform`,a?``:`-rotate-90`)}),`Filters`,u?(0,J.jsx)(`span`,{className:`text-danger`,children:`· changed labels required`}):i.length>0?(0,J.jsxs)(`span`,{className:`text-soft-foreground`,children:[`· `,i.length,` set`]}):(0,J.jsx)(`span`,{className:`text-soft-foreground`,children:`· authors, labels, reviewers`})]})}),(0,J.jsxs)(yt,{children:[(0,J.jsx)(`p`,{className:`m-0 pt-2 text-label text-soft-foreground`,children:`Only matching events start a task. Names in the prompt do not narrow it down; these do.`}),(0,J.jsxs)(`div`,{"data-slot":`editor-github-filters`,className:`grid grid-cols-1 gap-3 pt-3 sm:grid-cols-2`,children:[(0,J.jsx)(X,{id:`filter-authors`,label:`Authors`,value:n.authors,onChange:e=>s(`authors`,e)}),(0,J.jsx)(X,{id:`filter-assignees`,label:`Assignees`,value:n.assignees,onChange:e=>s(`assignees`,e)}),(0,J.jsx)(X,{id:`filter-any-labels`,label:`Any of labels`,value:n.anyLabels,onChange:e=>s(`anyLabels`,e)}),(0,J.jsx)(X,{id:`filter-all-labels`,label:`All of labels`,value:n.allLabels,onChange:e=>s(`allLabels`,e)}),(0,J.jsx)(X,{id:`filter-exclude-labels`,label:`Exclude labels`,value:n.excludeLabels,onChange:e=>s(`excludeLabels`,e)}),(0,J.jsx)(X,{id:`filter-changed-labels`,label:l?`Changed labels (required)`:`Changed labels`,value:n.changedLabels,invalid:u,onChange:e=>s(`changedLabels`,e)}),(0,J.jsx)(X,{id:`filter-reviewers`,label:`Reviewers`,value:n.reviewers,onChange:e=>s(`reviewers`,e)}),(0,J.jsx)(rr,{id:`filter-lookback`,label:`Lookback days (1–90)`,value:n.lookbackDays,min:1,max:90,onChange:e=>s(`lookbackDays`,e)}),(0,J.jsx)(rr,{id:`filter-max-records`,label:`Max records (1–100)`,value:n.maxRecords,min:1,max:100,onChange:e=>s(`maxRecords`,e)})]})]})]})]})}function X({id:e,label:t,value:n,invalid:r=!1,onChange:i}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(G,{htmlFor:e,className:`text-xs text-muted-foreground`,children:t}),(0,J.jsx)(F,{id:e,value:n,placeholder:`comma-separated`,"aria-invalid":r||void 0,onChange:e=>i(e.target.value),className:`h-8 text-ui`})]})}function rr({id:e,label:t,value:n,min:r,max:i,onChange:a}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(G,{htmlFor:e,className:`text-xs text-muted-foreground`,children:t}),(0,J.jsx)(F,{id:e,type:`number`,min:r,max:i,value:n,onChange:e=>a(zn(Number(e.target.value),r,i)),className:`h-8 w-28 font-mono text-ui tabular-nums`})]})}function ir({source:e,sourcesReady:t,skills:n,skillUsage:r,workflows:i,onSource:a,pick:o,onPick:s,baseBranch:c,autonomous:l,onAutonomous:u}){return(0,J.jsxs)(`div`,{"data-slot":`editor-run-as`,className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(cn,{source:e,ready:t,skills:n,skillUsage:r,workflows:i,onPick:a}),(0,J.jsx)(dn,{pick:o,onChange:s,accounts:!0}),(0,J.jsx)(Ht,{slot:`editor-base-pill`,ariaLabel:`Base branch`,readOnly:!0,hint:`Every run branches off the project's base branch.`,label:(0,J.jsxs)(`span`,{className:`text-meta`,children:[`base: `,c??`…`]}),value:c??``,options:[],onPick:()=>void 0}),(0,J.jsx)(`span`,{className:`flex-1`}),(0,J.jsxs)(G,{className:`text-ui font-medium`,children:[`Autonomous`,(0,J.jsx)(on,{"aria-label":`Autonomous`,checked:l,onCheckedChange:u})]})]})}function ar({className:e,...t}){return(0,J.jsx)(`span`,{"data-slot":`branch-chip`,className:k(`inline-block rounded-md bg-muted px-1.5 py-0.5 font-mono text-meta leading-[1.3] font-medium whitespace-nowrap text-muted-foreground`,e),...t})}var or=[[`daily`,`Every day`],[`weekdays`,`Weekdays`],[`weekly`,`Weekly`],[`hours`,`Every N hours`],[`once`,`Once`]],sr=e=>String(e).padStart(2,`0`);function cr(e){let t=Date.now()+864e5,n=w(t,e);return n?`${n.year}-${sr(n.month)}-${sr(n.day)}`:new Date(t).toISOString().slice(0,10)}function lr({schedule:e,timeZone:t,onChange:n,allowOnce:r=!0}){let i=ce(e),a=e=>{let{date:r,...a}=i,o={...a,...r?{date:r}:{},...e};o.type===`once`&&!o.date&&(o.date=cr(t)),n(o)},o=i.type===`once`&&i.date!==null&&A({type:`once`,date:i.date,hour:i.hour,minute:i.minute},Date.now(),t)===null;return(0,J.jsxs)(`div`,{"data-slot":`editor-schedule`,className:`flex flex-col gap-3.5`,children:[(0,J.jsx)(`div`,{role:`group`,"aria-label":`Schedule type`,className:`flex flex-wrap gap-1.5`,children:or.filter(([e])=>r||e!==`once`).map(([e,t])=>(0,J.jsx)(z,{active:i.type===e,"aria-pressed":i.type===e,onClick:()=>a({type:e}),children:t},e))}),i.type===`weekly`?(0,J.jsx)(`div`,{role:`group`,"aria-label":`Weekday`,className:`flex flex-wrap gap-1.5`,children:re.map((e,t)=>(0,J.jsx)(z,{active:i.day===t+1,"aria-pressed":i.day===t+1,className:`px-[9px]`,onClick:()=>a({day:t+1}),children:e},e))}):null,i.type===`once`?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-ui text-muted-foreground`,children:[`on`,(0,J.jsx)(F,{type:`date`,"aria-label":`Date`,value:i.date??``,onChange:e=>{e.target.value&&a({date:e.target.value})},className:`w-40 font-mono`})]}):null,i.type===`hours`?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-ui text-muted-foreground`,children:[`every`,(0,J.jsxs)(V,{value:String(i.every),onValueChange:e=>{let t=Number(e);Zn(t)&&a({every:t})},children:[(0,J.jsx)(K,{size:`sm`,"aria-label":`Every N hours`,className:`text-ui`,children:(0,J.jsx)(W,{})}),(0,J.jsx)(B,{children:se.map(e=>(0,J.jsxs)(H,{value:String(e),children:[e,` h`]},e))})]}),`starting at 00:00`]}):(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-ui text-muted-foreground`,children:[`at`,(0,J.jsx)(F,{"aria-label":`Hour`,inputMode:`numeric`,value:sr(i.hour),onChange:e=>a({hour:Math.min(23,Math.max(0,Number(e.target.value)||0))}),className:`w-14 text-center font-mono`}),`:`,(0,J.jsx)(F,{"aria-label":`Minute`,inputMode:`numeric`,value:sr(i.minute),onChange:e=>a({minute:Math.min(59,Math.max(0,Number(e.target.value)||0))}),className:`w-14 text-center font-mono`}),(0,J.jsx)(`span`,{className:`font-mono text-xs`,children:t})]}),i.type===`once`?(0,J.jsx)(`p`,{"data-slot":`editor-once-note`,className:`m-0 text-xs ${o?`text-danger`:`text-soft-foreground`}`,children:o?`This time has passed — pick a later one to enable it.`:`Runs a single time, then pauses itself.`}):(0,J.jsxs)(`div`,{className:`flex items-center gap-2.5 font-mono text-xs text-soft-foreground`,children:[(0,J.jsx)(`span`,{children:`cron`}),(0,J.jsx)(ar,{"data-slot":`editor-cron`,children:T(e)})]})]})}var ur={schedule:[`{{date}}`,`{{project}}`],github:[`{{github.url}}`,`{{github.title}}`,`{{github.number}}`,`{{github.author}}`,`{{github.labels}}`,`{{date}}`,`{{project}}`],tracker:[`{{tracker.key}}`,`{{tracker.title}}`,`{{tracker.url}}`,`{{tracker.status}}`,`{{date}}`,`{{project}}`]};function dr(e){return Ke({kind:e.kind,events:e.events,intervalSeconds:e.intervalSeconds,schedule:e.schedule,...e.trackerTrigger?{trackerTrigger:e.trackerTrigger}:{}})}function fr(e,t){let n=dr(e),r=wn(e),i=[`${r?`${r.source===`skill`?`skill`:`workflow`} ${r.ref}`:`a quick task`} on ${e.runner??`the default agent`}${e.model?` (${e.model})`:``}`];return i.push(e.autonomous?`autonomous`:`pausing when it needs you`),t&&e.dispatch&&i.push(`up to ${e.maxSubtasks} subtasks`),`${n.charAt(0).toUpperCase()+n.slice(1)}: ${i.join(`, `)}.`}function pr(e,t){return e.kind===`schedule`?!0:e.kind===`tracker`?t:e.events.length>0&&(!Xn(e.events)||e.filters.changedLabels.trim().length>0)}function mr(e,t){let n=[pr(e,t),e.prompt.trim().length>0,e.name.trim().length>0],r=n.indexOf(!1);return[{id:`when`,label:`When`},{id:`what`,label:`What`},{id:`live`,label:`Go live`}].map((e,t)=>({...e,state:n[t]&&(r===-1||t<r)?`done`:t===r||r===-1&&t===2?`current`:`next`}))}function hr({automationId:e,onRunNow:t,onLog:n,busy:r=!1,now:i}){let a=b(),s=O(),c=(0,q.useMemo)(()=>[s,`automation-log`,e],[s,e]),l=p({queryKey:c,queryFn:({signal:t})=>d(e,{signal:t})}),u=(0,q.useMemo)(()=>gr(l.data?.records??[]),[l.data?.records]),f=o((0,q.useMemo)(()=>{let e=new Set(u.map(e=>e.runId));return t=>t.filter(t=>e.has(t.id)).map(({id:e,title:t,status:n,costUsd:r})=>({id:e,title:t,status:n,costUsd:r}))},[u]));return(0,q.useEffect)(()=>he((t,n)=>{if(t!==`automation-change`)return;let r=n;r?.automationId===e&&(s==="default"||r.project===void 0||r.project===s)&&a.invalidateQueries({queryKey:c})}),[e,s,a,c]),(0,J.jsxs)(P,{flush:!0,"data-slot":`recent-runs-card`,className:`min-w-0 px-3.5 py-3`,children:[(0,J.jsx)(`h2`,{className:`m-0 mb-2 text-meta font-semibold tracking-[.05em] uppercase text-soft-foreground`,children:`Recent runs`}),l.isPending?(0,J.jsx)(`p`,{role:`status`,className:`m-0 text-xs text-muted-foreground`,children:`Loading recent runs…`}):null,l.isError?(0,J.jsxs)(`div`,{role:`alert`,className:`text-xs text-muted-foreground`,children:[(0,J.jsx)(`p`,{className:`m-0`,children:l.data?`Could not refresh recent runs.`:`Could not load recent runs.`}),(0,J.jsx)(M,{variant:`ghost`,size:`sm`,disabled:l.isFetching,onClick:()=>void l.refetch(),children:`Retry`})]}):null,l.data&&u.length===0?(0,J.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`No runs launched yet.`}):null,u.length>0?(0,J.jsx)(`ul`,{"aria-label":`Recent runs`,className:`m-0 list-none divide-y divide-border p-0`,children:u.map(e=>{let t=f.data?.find(t=>t.id===e.runId)??l.data?.runs[e.runId],n=t?.title||`Task ${e.runId.slice(0,8)}`;return(0,J.jsxs)(`li`,{className:`min-w-0 py-2 first:pt-0 last:pb-0`,children:[(0,J.jsx)(R,{to:`/tasks/${encodeURIComponent(e.runId)}`,title:n,className:`block truncate rounded-sm text-ui font-medium hover:underline focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2`,children:n}),(0,J.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-meta text-muted-foreground`,children:[(0,J.jsx)(I,{"aria-hidden":`true`,tone:t?Fe(t.status):`neutral`}),(0,J.jsx)(`span`,{children:t?We(t.status):`Status unavailable`}),(0,J.jsx)(`time`,{dateTime:e.ts,title:e.ts,children:Bt(e.ts,i)}),null]})]},e.runId)})}):null,(0,J.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap gap-1.5`,children:[t?(0,J.jsxs)(M,{variant:`outline`,size:`sm`,disabled:r,onClick:t,children:[(0,J.jsx)(pt,{"aria-hidden":`true`,className:`size-3`}),`Run now`]}):null,n?(0,J.jsxs)(M,{variant:`ghost`,size:`sm`,onClick:n,children:[(0,J.jsx)(yn,{"aria-hidden":`true`,className:`size-3`}),`View log`]}):null]})]})}function gr(e){let t=new Set;return[...e].sort((e,t)=>t.seq-e.seq).filter(e=>!e.runId||t.has(e.runId)?!1:(t.add(e.runId),!0)).slice(0,5)}var _r=864e5;function vr({kind:e,schedule:t,schedules:n,intervalSeconds:r,timeZone:i,now:a}){let[o,s]=(0,q.useState)(()=>Date.now());(0,q.useEffect)(()=>{if(a!==void 0)return;let e=setInterval(()=>s(Date.now()),6e4);return()=>clearInterval(e)},[a]);let c=a??o,l=(0,q.useMemo)(()=>{if(e!==`schedule`)return[];if(t.type===`once`){let e=C({schedule:t,schedules:n},c,i);return e===null?[]:[e]}return D({schedule:t,schedules:n},c,c+9*_r,i,5)},[e,t,n,c,i]);return(0,J.jsxs)(P,{flush:!0,"data-slot":`next-runs-preview`,className:`pt-3 pb-2`,children:[(0,J.jsx)(`div`,{className:`px-3.5 pb-2 eyebrow text-soft-foreground`,children:e===`schedule`?t.type===`once`?`Runs once`:`Next 5 runs`:`How it polls`}),e===`schedule`?l.length===0?(0,J.jsx)(`p`,{className:`m-0 px-3.5 pb-1.5 text-label leading-[1.5] text-muted-foreground`,children:t.type===`once`?`This time has already passed.`:`Nothing in the next nine days.`}):l.map(e=>(0,J.jsxs)(`div`,{"data-slot":`next-run`,className:`flex gap-2.5 px-3.5 py-[5px] text-ui`,children:[(0,J.jsx)(`span`,{className:`w-[82px] shrink-0 font-mono text-xs font-medium whitespace-nowrap text-foreground tabular-nums`,children:Ue(e,i)}),(0,J.jsx)(`span`,{className:`text-meta whitespace-nowrap text-soft-foreground`,children:Pe(e,c)})]},e)):(0,J.jsx)(`p`,{className:`m-0 px-3.5 pb-1.5 text-label leading-[1.5] text-muted-foreground`,children:e===`tracker`?(0,J.jsxs)(J.Fragment,{children:[`Checks the project tracker every `,Math.round(r/60),` min while this cockpit is open. No webhook or public URL required.`]}):(0,J.jsxs)(J.Fragment,{children:[`Checks GitHub every `,Math.round(r/60),` min while this cockpit is open, through your `,(0,J.jsx)(`code`,{className:`text-xs`,children:`gh`}),`. No webhook or public URL required.`]})})]})}var yr=[{name:`Nightly dependency bump`,when:`Every day at 04:00`,kind:`schedule`,schedule:{type:`daily`,hour:4,minute:0},prompt:`Run npm outdated, bump patch and minor versions, run the test suite, open a draft PR if anything changed.`},{name:`Triage new issues`,when:`On issue.opened · every 5 min`,kind:`github`,events:[`issue.opened`],intervalSeconds:300,prompt:`Read {{github.url}}. Label it, add a repro or a clarification request. Never close it.`},{name:`Weekly changelog draft`,when:`Fridays at 16:00`,kind:`schedule`,schedule:{type:`weekly`,day:5,hour:16,minute:0},prompt:`Collect merged PRs since last week, write CHANGELOG entries, open a draft PR.`},{name:`Stale PR nudge`,when:`Every 6 hours`,kind:`schedule`,schedule:{type:`hours`,every:6},prompt:`Comment on PRs idle for 48h with what is blocking them.`},{name:`Flaky test hunt`,when:`Tuesdays at 02:00`,kind:`schedule`,schedule:{type:`weekly`,day:2,hour:2,minute:0},prompt:`Run the suite 5×, quarantine intermittent tests, open an issue per test.`,dispatch:{maxSubtasks:8,reviewChild:!0}},{name:`Security advisories`,when:`Every day at 06:00`,kind:`schedule`,schedule:{type:`daily`,hour:6,minute:0},prompt:`Run npm audit; for each high/critical advisory open a task with the upgrade path.`}],br=e=>[O(),`automation-templates`,e??``];function xr({onPick:e}){let[t,n]=(0,q.useState)(`builtin`),r=zt(),i=p({queryKey:br(r),queryFn:({signal:e})=>u(r,{signal:e}),enabled:t===`mine`}),a=t===`builtin`?yr.map(e=>({...e,key:e.name})):(i.data?.templates??[]).map(e=>({...Pn(e),key:`${e.project.id}:${e.id}`,when:Ke(e),project:e.project.name}));return(0,J.jsxs)(P,{flush:!0,"data-slot":`template-palette`,className:`pb-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-end gap-3 border-b border-border px-4 pt-2.5`,children:[(0,J.jsxs)(`div`,{role:`tablist`,"aria-label":`Template source`,className:`flex shrink-0`,children:[(0,J.jsx)(Sr,{active:t===`builtin`,onClick:()=>n(`builtin`),children:`Built-in`}),(0,J.jsx)(Sr,{active:t===`mine`,onClick:()=>n(`mine`),children:`From your other projects`})]}),(0,J.jsx)(`span`,{className:`ml-auto min-w-0 overflow-hidden pb-2 text-xs text-ellipsis whitespace-nowrap text-soft-foreground`,children:t===`builtin`?`Built-in`:`Registered in ~/.cezar/config.json`})]}),t===`mine`&&i.isPending?(0,J.jsx)(`p`,{className:`px-4 pt-3 text-xs text-soft-foreground`,children:`Loading…`}):t===`mine`&&i.isError?(0,J.jsx)(`p`,{role:`alert`,className:`px-4 pt-3 text-xs text-danger`,children:i.error.message}):a.length===0?(0,J.jsx)(`p`,{className:`px-4 pt-3 text-xs text-soft-foreground`,children:`No automations in your other projects yet.`}):(0,J.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2.5 px-4 pt-3`,children:a.map(t=>(0,J.jsxs)(`div`,{"data-slot":`template-card`,className:`flex flex-col gap-1.5 rounded-[10px] border border-border bg-card-2 px-3 py-2.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-ui font-semibold`,children:[t.kind===`github`?(0,J.jsx)(U,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-soft-foreground`}):(0,J.jsx)(sn,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-soft-foreground`}),(0,J.jsx)(`span`,{className:`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`,children:t.name}),t.project?(0,J.jsx)(ar,{className:`ml-auto`,children:t.project}):null]}),(0,J.jsx)(`div`,{className:`font-mono text-meta text-muted-foreground`,children:t.when}),(0,J.jsx)(`div`,{className:`line-clamp-2 text-xs leading-[1.45] text-soft-foreground`,children:t.prompt}),(0,J.jsx)(M,{variant:`outline`,size:`sm`,className:`mt-0.5 self-start`,"aria-label":`Use this: ${t.name}`,onClick:()=>e(t),children:`Use this`})]},t.key))})]})}function Sr({active:e,onClick:t,children:n}){return(0,J.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e,onClick:t,className:k(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-ui font-medium`,e?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`),children:n})}function Cr(e){let t=e.toLowerCase();return/\b(events?|filters?|schedule|interval|changedlabels|changed labels|lookback|maxrecords)\b/.test(t)?`when`:/\b(prompt|workflow|runner|model|dispatch)\b/.test(t)?`what`:`top`}var wr={tracker:`Implement {{tracker.key}} and prepare a pull request.`,schedule:`What should the agent do each time? Say it the way you would in New task.`,github:`What should the agent do for each match? Say it the way you would in New task.`};function Tr({data:e,automation:t,actions:n,initialKind:r,onBack:a,onSaved:o,onLog:c}){let u=b(),d=L(),p=i(),h=m(),g=f(),te=s(),v=ee(),y=r===`github`&&e?.available===!1?`schedule`:r,[x,S]=(0,q.useState)(()=>t?Nn(t):y?{...An(),kind:y,...y===`tracker`?{intervalSeconds:1800,enabled:!1}:{}}:An()),[C,re]=(0,q.useState)(!t&&!y),[w,ie]=(0,q.useState)(!1),[ae,oe]=(0,q.useState)(!1),[T,se]=(0,q.useState)(null),[E,D]=(0,q.useState)(!1),ce=(0,q.useRef)(null),O=t?.revision,k=(0,q.useRef)(O);(0,q.useEffect)(()=>{!t||O===k.current||(k.current=O,S(Nn(t)),D(!1),se(null))},[t,O]);let A=e=>S(t=>({...t,...e})),le=e?.timeZone??`UTC`,ue=e?.available!==!1,de=p.data?.capabilities.dispatch===!0,fe=(0,q.useMemo)(()=>lt(ut(h.data?.promptTemplates),p.data?.capabilities),[h.data?.promptTemplates,p.data?.capabilities]),pe=g.data?.workflows??[],me=pe.map(e=>e.name),he=te.data,ge=(he??[]).map(e=>e.name),_e=h.data?.skillUsage,ve=(0,q.useMemo)(()=>dt(he??[],_e),[he,_e]),ye=te.data!==void 0&&g.data!==void 0&&!h.isPending,be=v.data?.baseBranch??v.data?.info?.branch??void 0,xe=(0,q.useMemo)(()=>Bn(x),[x]),Se=(0,q.useMemo)(()=>Yn(x),[x]),Ce=e=>Se.filter(t=>t.field===e).map(e=>e.login),we=x.name.trim().length>0&&x.prompt.trim().length>0&&!ae&&(x.kind!==`tracker`||w),Te=mr(x,w),Ee=fr(x,de),De=e=>{let t=ce.current,n=t?.selectionStart??x.prompt.length,r=ft(x.prompt,n,e);A({prompt:r.text}),requestAnimationFrame(()=>{t&&(t.focus(),t.setSelectionRange(r.caret,r.caret))})},j=e=>{let t=ce.current,n=t?.selectionStart??x.prompt.length,r=x.prompt.slice(0,n),i=x.prompt.slice(n),a=r.length>0&&!/\s$/.test(r)?` `:``,o=`${r}${a}${e}${i.length>0&&!/^\s/.test(i)?` `:``}${i}`,s=r.length+a.length+e.length;A({prompt:o}),requestAnimationFrame(()=>{t&&(t.focus(),t.setSelectionRange(s,s))})},Oe=async()=>{oe(!0),se(null),D(!1);try{let e=Rn(x);t?await ne(t.id,{...e,enabled:x.enabled,expectedRevision:t.revision}):await l({...e,enable:x.enabled}),await u.invalidateQueries({queryKey:en()}),o()}catch(e){if(t&&e instanceof _&&e.status===409)D(!0);else{let t=e instanceof Error?e.message:String(e);se({message:t,section:e instanceof _&&e.status===400?Cr(t):`top`})}}finally{oe(!1)}},je=()=>void u.invalidateQueries({queryKey:en()}),Me=t?`Save changes`:x.enabled?`Save and enable`:`Save paused`,Ne=`Change the kind by creating a new automation`,N=!!t,Pe=e=>{e!==x.kind&&A({kind:e,...e===`tracker`?{intervalSeconds:1800,enabled:!1}:{}})};return(0,J.jsxs)(`div`,{"data-route":`automations`,"data-slot":`automation-editor`,"data-onboarding":``,className:`flex min-h-full flex-col`,children:[(0,J.jsxs)(`header`,{className:`sticky top-0 z-10 flex min-h-14 shrink-0 flex-wrap items-center gap-3 border-b border-border bg-background px-5 max-md:py-2 md:h-14 md:flex-nowrap`,children:[(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":`Back`,onClick:a,children:(0,J.jsx)(ke,{"aria-hidden":`true`,className:`size-[15px]`})}),(0,J.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:t?`Edit automation`:`New automation`}),t?(0,J.jsx)(Vt,{dot:t.enabled?`success`:`neutral`,children:t.enabled?`enabled`:`paused`}):null,(0,J.jsx)(`span`,{className:`flex-1`}),t?null:(0,J.jsxs)(M,{variant:`ghost`,size:`sm`,"aria-expanded":C,"aria-label":C?`Hide templates`:`Start from a template`,onClick:()=>re(e=>!e),children:[(0,J.jsx)(hn,{"aria-hidden":`true`,className:`size-3.5`}),(0,J.jsx)(`span`,{className:`max-md:hidden`,children:C?`Hide templates`:`Start from a template`})]}),(0,J.jsx)(M,{variant:`outline`,className:`font-normal`,onClick:a,children:`Cancel`}),(0,J.jsx)(M,{className:`font-normal`,disabled:!we,onClick:()=>void Oe(),children:Me})]}),(0,J.jsx)(`div`,{className:`flex justify-center px-5 pb-16`,children:(0,J.jsxs)(`div`,{className:`flex w-full max-w-3xl flex-col items-center`,children:[(0,J.jsxs)(`div`,{"data-slot":`editor-strip`,className:`sticky top-14 z-10 flex w-full flex-wrap items-center gap-x-6 gap-y-1.5 border-b border-border bg-background/95 py-2.5 backdrop-blur max-md:static`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3 max-md:basis-full`,children:[(0,J.jsx)(`span`,{className:`shrink-0 text-ui text-muted-foreground`,"aria-hidden":`true`,children:`Name`}),(0,J.jsx)(F,{"aria-label":`Name`,placeholder:`Nightly dependency bump`,value:x.name,onChange:e=>A({name:e.target.value}),className:`h-9 w-full max-w-md text-lead md:text-lead`})]}),(0,J.jsx)(Wt,{steps:Te})]}),E||T?.section===`top`||C&&!t?(0,J.jsxs)(`div`,{className:`mt-6 flex w-full flex-col gap-4`,children:[E?(0,J.jsxs)(`div`,{role:`alert`,"data-slot":`editor-conflict`,className:`flex flex-wrap items-center gap-3 rounded-lg border border-danger/40 bg-danger/10 px-3.5 py-2.5 text-ui text-foreground`,children:[`Edited elsewhere — reload to see the latest version`,(0,J.jsx)(M,{variant:`outline`,size:`sm`,className:`ml-auto`,onClick:je,children:`Reload`})]}):null,T?.section===`top`?(0,J.jsx)(Dr,{children:T.message}):null,C&&!t?(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(`p`,{className:`m-0 text-center text-ui text-muted-foreground`,children:`Start from a template, or fill in the three parts below.`}),(0,J.jsx)(xr,{onPick:e=>{let t=e.workflow&&me.includes(e.workflow)?e.workflow:void 0,n=e.steps?.every(e=>!e.skill||ge.includes(e.skill))?e.steps:void 0;S(r=>In(r,{...e,workflow:t,steps:n})),re(!1)}})]}):null]}):null,(0,J.jsxs)(Er,{slot:`when`,title:`When`,why:N?`The trigger is fixed once saved; change it by creating a new automation.`:`What starts a run. Pick one, then say how often or on which change.`,children:[(0,J.jsxs)(`div`,{"data-slot":`editor-kind`,role:`group`,"aria-label":`Trigger`,className:`grid gap-3 sm:grid-cols-3`,children:[(0,J.jsx)(Yt,{value:`schedule`,title:`On a schedule`,description:`At a time you set.`,selected:x.kind===`schedule`,disabled:N&&x.kind!==`schedule`,reason:N&&x.kind!==`schedule`?Ne:void 0,onClick:()=>Pe(`schedule`),picture:(0,J.jsx)(Or,{})}),(0,J.jsx)(Yt,{value:`github`,title:`When GitHub changes`,description:`A pull request, an issue, a review.`,selected:x.kind===`github`,disabled:!ue||N&&x.kind!==`github`,reason:ue?N&&x.kind!==`github`?Ne:void 0:e?.reason??`GitHub is unavailable`,onClick:()=>Pe(`github`),picture:(0,J.jsx)(U,{className:`size-7 text-muted-foreground`,"aria-hidden":!0})}),(0,J.jsx)(Yt,{value:`tracker`,title:`When Jira / Linear changes`,description:`An issue is created or moves.`,selected:x.kind===`tracker`,disabled:N&&x.kind!==`tracker`,reason:N&&x.kind!==`tracker`?Ne:void 0,onClick:()=>Pe(`tracker`),picture:(0,J.jsx)(kr,{})})]}),(0,J.jsx)(`div`,{className:`mt-5`,children:x.kind===`schedule`?(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[[x.schedule,...x.schedules?.slice(1)??[]].map((e,t,n)=>(0,J.jsxs)(`fieldset`,{className:`min-w-0 rounded-md border p-3`,children:[(0,J.jsxs)(`legend`,{className:`px-1 text-xs text-muted-foreground`,children:[`Schedule `,t+1]}),(0,J.jsx)(lr,{schedule:e,timeZone:le,allowOnce:n.length===1,onChange:e=>{let r=n.map((n,r)=>r===t?e:n),i=r[0];i&&A({schedule:i,schedules:r.length>1?r:void 0})}}),n.length>1?(0,J.jsx)(M,{variant:`ghost`,size:`sm`,"aria-label":`Remove schedule ${t+1}`,onClick:()=>{let e=n.filter((e,n)=>n!==t),r=e[0];r&&A({schedule:r,schedules:e.length>1?e:void 0})},children:`Remove schedule`}):null]},t)),(0,J.jsx)(M,{variant:`outline`,size:`sm`,disabled:(x.schedules?.length??1)>=16||x.schedule.type===`once`,onClick:()=>A({schedules:[x.schedule,...x.schedules?.slice(1)??[],{type:`daily`,hour:4,minute:0}]}),children:`Add schedule`}),(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Times that coincide start one task. One-time schedules run on their own.`})]}):x.kind===`tracker`?(0,J.jsx)(Qn,{trigger:x.trackerTrigger,intervalSeconds:x.intervalSeconds,onChange:A,onValid:ie}):(0,J.jsx)(nr,{events:x.events,intervalSeconds:x.intervalSeconds,filters:x.filters,onChange:e=>A(e)})}),x.kind===`schedule`?(0,J.jsx)(`div`,{className:`mt-5`,children:(0,J.jsx)(vr,{kind:x.kind,schedule:x.schedule,schedules:x.schedules,intervalSeconds:x.intervalSeconds,timeZone:le})}):null,T?.section===`when`?(0,J.jsx)(Dr,{children:T.message}):null]}),(0,J.jsxs)(Er,{slot:`what`,title:`What the agent does`,why:`The same words you would type into New task. Placeholders fill in per run.`,children:[(0,J.jsxs)(`div`,{"data-slot":`editor-placeholders`,className:`flex flex-wrap items-center gap-1.5 text-xs text-soft-foreground`,children:[`Insert`,ur[x.kind].map(e=>(0,J.jsx)(z,{className:`h-6 font-mono text-meta`,title:`Insert ${e} at the caret`,onClick:()=>j(e),children:e},e))]}),(0,J.jsx)(_t,{ref:ce,"aria-label":`Prompt`,rows:5,placeholder:wr[x.kind],value:x.prompt,onChange:e=>A({prompt:e.target.value}),className:`mt-3 min-h-[120px] rounded-xl px-4 py-3 text-lead leading-[1.55] md:text-lead`}),(0,J.jsxs)(`div`,{"data-slot":`editor-prompt-templates`,className:`mt-3 flex flex-wrap items-center gap-1.5 text-xs text-soft-foreground`,children:[(0,J.jsx)(Ae,{"aria-hidden":`true`,className:`size-3`}),`Prompt templates`,fe.map(e=>(0,J.jsx)(z,{className:`h-6 text-meta`,title:e.text,onClick:()=>De(e.text),children:e.label},e.id)),(0,J.jsx)(z,{dashed:!0,className:`h-6 text-meta`,icon:(0,J.jsx)(ct,{"aria-hidden":`true`,className:`size-3`}),onClick:()=>d(`${an(`project`,`instructions`)}#prompt-templates`),children:`Manage…`})]}),Se.length>0?(0,J.jsxs)(`div`,{role:`status`,"data-slot":`editor-prompt-condition`,className:`mt-3 flex flex-wrap items-center gap-2 rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-label text-foreground`,children:[(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`The prompt names `,Se.map(({login:e})=>`@${e}`).join(`, `),`, but prompt text does not decide what launches — without a filter every matching event starts a task.`]}),[`authors`,`reviewers`].map(e=>Ce(e).length>0?(0,J.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>A({filters:{...x.filters,[e]:[...jn(x.filters[e]),...Ce(e)].join(`, `)}}),children:e===`authors`?`Add to Authors`:`Add to Reviewers`},e):null)]}):null,(0,J.jsx)(`div`,{className:`mt-5`,children:(0,J.jsx)(ir,{source:wn(x),sourcesReady:ye,skills:ve,skillUsage:_e,workflows:pe,onSource:e=>A(Tn(e)),pick:{runner:x.runner,model:x.model,reasoningEffort:x.reasoningEffort,account:x.account},onPick:e=>A({runner:e.runner,model:e.model,reasoningEffort:e.reasoningEffort??null,account:e.account}),baseBranch:be,autonomous:x.autonomous,onAutonomous:e=>A({autonomous:e})})}),(0,J.jsx)(`p`,{className:`mt-3 mb-0 text-xs leading-[1.5] text-soft-foreground`,children:`Each run is an ordinary cezar task in its own worktree — it queues behind the parallel cap like anything else and never auto-merges.`}),(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsx)(er,{available:de,enabled:x.dispatch,maxSubtasks:x.maxSubtasks,reviewChild:x.reviewChild,onChange:e=>A(e)})}),T?.section===`what`?(0,J.jsx)(Dr,{children:T.message}):null]}),(0,J.jsxs)(Er,{slot:`live`,title:`Go live`,why:`Paused, it waits in the list where you can preview it. Enabled, it starts counting from now.`,children:[(0,J.jsx)(`p`,{"data-slot":`editor-summary`,className:`m-0 rounded-xl border border-violet/40 bg-violet/10 px-4 py-3 text-body text-foreground`,children:Ee}),(0,J.jsxs)(G,{className:`mt-4 flex items-start gap-3 text-ui font-normal`,children:[(0,J.jsx)(on,{"aria-label":`Enabled`,checked:x.enabled,onCheckedChange:e=>A({enabled:e}),className:`mt-0.5`}),(0,J.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`text-body text-foreground`,children:`Enabled`}),(0,J.jsx)(`span`,{className:`text-label text-muted-foreground`,children:x.kind===`schedule`?x.enabled?`Runs at the next time listed above.`:`Saved paused. Enable it from the list, or Run now to try it once.`:`Counts from a current-time baseline; existing matches will not launch.`})]})]}),(0,J.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[(0,J.jsx)($n,{definition:xe}),t&&t.kind!==`schedule`&&n?(0,J.jsx)(M,{variant:`outline`,className:`self-start font-normal`,disabled:n.busy,onClick:()=>void n.preview(t),children:`Preview saved matches`}):null,t?(0,J.jsx)(hr,{automationId:t.id,busy:n?.busy,onRunNow:n?()=>void n.runNow(t):void 0,onLog:c}):null]})]})]})})]})}function Er({slot:e,title:t,why:n,children:r}){return(0,J.jsxs)(`section`,{"data-slot":`editor-section`,"data-section":e,className:`mt-7 w-full border-t border-border pt-6 first-of-type:mt-6 first-of-type:border-t-0 first-of-type:pt-0`,children:[(0,J.jsx)(`h2`,{className:`text-xl font-light tracking-tight text-foreground`,children:t}),(0,J.jsx)(`p`,{className:`mt-1 mb-5 text-ui text-muted-foreground`,children:n}),r]})}function Dr({children:e}){return(0,J.jsx)(`div`,{role:`alert`,className:k(`mt-3 rounded-lg border border-danger/40 bg-danger/10 px-3.5 py-2.5 text-ui text-foreground`),children:e})}function Or(){return(0,J.jsxs)(`span`,{className:`flex w-12 flex-col gap-1`,children:[(0,J.jsxs)(`span`,{className:`flex items-center justify-between rounded-md border border-violet bg-violet/15 px-1 py-0.5 font-mono text-[7px] text-foreground`,children:[`09:00`,(0,J.jsx)(`span`,{className:`size-1 rounded-full bg-violet`})]}),(0,J.jsxs)(`span`,{className:`flex items-center justify-between rounded-md border border-border px-1 py-0.5 font-mono text-[7px] text-muted-foreground`,children:[`16:00`,(0,J.jsx)(`span`,{className:`size-1 rounded-full bg-muted-foreground/50`})]})]})}function kr(){return(0,J.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-[7px]`,children:[(0,J.jsx)(`span`,{className:`rounded border border-border px-1 py-0.5 text-muted-foreground`,children:`To do`}),(0,J.jsx)(`span`,{className:`h-px w-1.5 bg-violet`}),(0,J.jsx)(`span`,{className:`rounded border border-violet bg-violet/15 px-1 py-0.5 text-foreground`,children:`Ready`})]})}function Ar({automationId:e,automation:t,timeZone:n,onBack:r}){let i=L(),a=b(),o=O(),s=(0,q.useMemo)(()=>[o,`automation-log`,e],[o,e]),c=p({queryKey:s,queryFn:({signal:t})=>d(e,{signal:t})}),[l,u]=(0,q.useState)(`all`),[f,m]=(0,q.useState)(`all`);(0,q.useEffect)(()=>he((t,n)=>{t===`automation-change`&&n.automationId===e&&a.invalidateQueries({queryKey:s})}),[e,a,s]);let h=y({mutationFn:e=>S(e),onSuccess:()=>a.invalidateQueries({queryKey:s}),onError:e=>Lt(e instanceof Error?e.message:String(e),{tone:`danger`})}),g=n??`UTC`,_=c.data?.records.filter(e=>(l===`all`||e.result===l)&&(f===`all`||e.event===f));return(0,J.jsxs)(`div`,{"data-route":`automations`,"data-slot":`automation-log`,className:`flex min-h-full flex-col`,children:[(0,J.jsxs)(`header`,{className:`sticky top-0 z-10 flex h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5`,children:[(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":`Back`,onClick:r,children:(0,J.jsx)(ke,{className:`size-[15px]`})}),(0,J.jsx)(`h1`,{className:`m-0 text-base font-semibold`,children:t?t.name:`Automation`}),(0,J.jsx)(`span`,{className:`text-ui text-muted-foreground`,children:`· execution log`}),(0,J.jsxs)(`div`,{className:`flex flex-1 items-center justify-end gap-2`,children:[(0,J.jsxs)(V,{value:l,onValueChange:e=>u(e),children:[(0,J.jsx)(K,{size:`sm`,"aria-label":`Filter by result`,className:`text-label`,children:(0,J.jsx)(W,{placeholder:`All results`})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(H,{value:`all`,children:`All results`}),jr.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]}),(0,J.jsxs)(V,{value:f,onValueChange:e=>m(e),children:[(0,J.jsx)(K,{size:`sm`,"aria-label":`Filter by event`,className:`text-label`,children:(0,J.jsx)(W,{placeholder:`All events`})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(H,{value:`all`,children:`All events`}),Mr.map(e=>(0,J.jsx)(H,{value:e,children:e},e))]})]})]}),(0,J.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>i(`/automations/${encodeURIComponent(e)}`),children:[(0,J.jsx)(nt,{className:`size-[13px]`}),`Edit`]})]}),(0,J.jsx)(`div`,{className:`flex justify-center p-5`,children:c.isError?(0,J.jsx)(`div`,{className:`w-full max-w-[820px]`,children:(0,J.jsx)($,{text:c.error instanceof Error?c.error.message:String(c.error)})}):_===void 0?(0,J.jsx)(`div`,{className:`w-full max-w-[820px]`,children:(0,J.jsx)($,{text:`Loading execution log…`})}):_.length===0?(0,J.jsx)(`div`,{className:`w-full max-w-[820px]`,children:(0,J.jsx)($,{text:`No checks have run yet.`})}):(0,J.jsx)(P,{flush:!0,className:`w-full max-w-[820px]`,children:_.map((e,t)=>(0,J.jsx)(Pr,{record:e,run:e.runId===void 0?void 0:c.data?.runs[e.runId],last:t===_.length-1,timeZone:g,retrying:h.isPending&&h.variables===e.receiptId,onRetry:e=>h.mutate(e)},e.seq))})})]})}var jr=[`launched`,`no-match`,`duplicate`,`rate-limited`,`error`,`baseline`,`preview`,`manual`,`catch-up`,`skipped`,`failed`],Mr=[`pull_request.opened`,`issue.opened`,`issue.labeled`,`issue.unlabeled`,`pull_request.reviewed`,`pull_request.review_requested`,`pull_request.rereview_requested`,`pull_request.closed`,`pull_request.merged`];function Nr(e){return e.result===`failed`&&e.runId===void 0?e.receiptId:void 0}function Pr({record:e,run:t,last:n,timeZone:r,retrying:i,onRetry:a}){let o=Ve(e.result),s=t?.children??[],c=Nr(e);return(0,J.jsxs)(`div`,{"data-slot":`log-row`,"data-result":e.result,className:`grid grid-cols-[90px_110px_1fr_auto] items-center gap-x-3 gap-y-2 px-4 py-3 text-ui ${n?``:`border-b border-border`}`,children:[(0,J.jsx)(`span`,{className:`font-mono text-xs font-medium text-muted-foreground tabular-nums`,children:Le(e.ts,r)}),(0,J.jsx)(Vt,{dot:o,className:`w-fit`,children:e.result}),(0,J.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap ${o===`danger`?`text-danger`:`text-muted-foreground`}`,title:e.reason,children:e.reason??``}),null,e.runId===void 0?c===void 0?(0,J.jsx)(`span`,{}):(0,J.jsxs)(M,{variant:`ghost`,size:`sm`,disabled:i,onClick:()=>a(c),children:[(0,J.jsx)(ln,{className:`size-3`}),`Retry task`]}):(0,J.jsx)(M,{variant:`ghost`,size:`sm`,asChild:!0,children:(0,J.jsxs)(R,{to:`/tasks/${encodeURIComponent(e.runId)}`,children:[`Open task`,(0,J.jsx)(Me,{className:`size-3`})]})}),s.length>0?(0,J.jsx)(`div`,{className:`col-span-full flex flex-col gap-1 pl-3.5`,children:s.map(e=>(0,J.jsxs)(`div`,{"data-slot":`log-child`,className:`grid grid-cols-[14px_70px_1fr_auto] items-center gap-2.5 text-label`,children:[(0,J.jsx)(`span`,{className:`font-mono text-meta text-soft-foreground`,children:`└`}),(0,J.jsx)(`span`,{className:`w-fit rounded-full bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:e.kind??`implement`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(I,{tone:Fe(e.status)}),(0,J.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.title})]}),null,(0,J.jsx)(M,{variant:`ghost`,size:`sm`,className:`h-6`,asChild:!0,children:(0,J.jsxs)(R,{to:`/tasks/${encodeURIComponent(e.runId)}`,children:[`Open`,(0,J.jsx)(Me,{className:`size-[11px]`})]})})]},e.runId))}):null]})}function Fr({data:e}){let t=L(),[n,r]=q.useState(!1),i=e.available===!1,a=e=>t(`/automations/new?kind=${e}`);return(0,J.jsxs)(Qt,{wide:!0,slot:`automations`,title:`Let the routine run itself`,why:`An automation is a prompt cezar turns into a task on its own: at a time you set, when something happens on GitHub, or when an issue moves in Jira or Linear.`,children:[(0,J.jsxs)(`div`,{"data-slot":`automation-triggers`,className:`mt-8 grid w-full gap-3 sm:grid-cols-3`,children:[(0,J.jsx)(Xt,{title:`On a schedule`,description:`Every weekday at 9:00, Fridays at 16:00, every six hours.`,recommended:!0,onClick:()=>a(`schedule`),picture:(0,J.jsx)(Vr,{})}),(0,J.jsx)(Xt,{title:`When GitHub changes`,description:i?`Sign in to the GitHub CLI first.`:`A new pull request, an issue labelled, a review requested.`,onClick:()=>i?t(`/github`):a(`github`),picture:i?(0,J.jsx)(U,{className:`size-9 text-muted-foreground`,"aria-hidden":!0}):(0,J.jsx)(Hr,{})}),(0,J.jsx)(Xt,{title:`When an issue moves`,description:`A Jira or Linear issue is created or changes status.`,onClick:()=>a(`tracker`),picture:(0,J.jsx)(Ur,{})})]}),(0,J.jsx)(`ol`,{"data-slot":`automation-steps`,className:`mt-10 grid w-full gap-6 text-left sm:grid-cols-3`,children:Ir.map((e,t)=>(0,J.jsxs)(`li`,{className:`flex gap-3`,children:[(0,J.jsx)(`span`,{className:`mt-0.5 grid size-6 shrink-0 place-items-center rounded-full border border-violet font-mono text-meta text-foreground`,"aria-hidden":`true`,children:t+1}),(0,J.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-lead text-foreground`,children:e.title}),(0,J.jsx)(`span`,{className:`text-label text-muted-foreground`,children:e.body})]})]},e.title))}),(0,J.jsxs)(`div`,{className:`mt-10 flex flex-col items-center gap-4`,children:[(0,J.jsx)(M,{asChild:!0,className:`font-normal`,children:(0,J.jsxs)(R,{to:`/automations/new`,children:[(0,J.jsx)(mt,{className:`size-[15px]`,"aria-hidden":`true`}),`New automation`]})}),(0,J.jsxs)(`button`,{type:`button`,className:mn,onClick:()=>r(!0),children:[(0,J.jsx)(He,{className:`size-3.5`,"aria-hidden":`true`}),`See it in pictures`]})]}),n?(0,J.jsx)(Rr,{onOpenChange:r}):null]})}var Ir=[{title:`Write it as a prompt`,body:`Say what the agent should do each time. Placeholders such as {{github.url}} or {{date}} fill in per run.`},{title:`Preview, then enable`,body:`A new automation starts paused. A poll shows what it would have matched, a schedule shows its next runs. Enable it when that looks right.`},{title:`Every run is a task`,body:`Each match starts an ordinary task in its own worktree. It ends at the review gate, never merges on its own, and the log keeps every run.`}];function Lr(){let[e,t]=q.useState(!1);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(M,{variant:`ghost`,size:`sm`,"data-slot":`automations-guide`,"aria-label":`How automations work`,className:`text-muted-foreground`,onClick:()=>t(!0),children:[(0,J.jsx)(He,{"aria-hidden":`true`,className:`size-3.5`}),(0,J.jsx)(`span`,{className:`max-md:hidden`,children:`How it works`})]}),e?(0,J.jsx)(Rr,{onOpenChange:t}):null]})}function Rr({onOpenChange:e}){let t=L();return(0,J.jsx)(Zt,{slot:`automations-guide-page`,title:`How automations work`,description:`Four things to know.`,pages:[{id:`prompt`,title:`A prompt that runs itself`,body:`An automation is the same thing you type into New task, kept and run for you. Placeholders fill in what changed: the pull request, the issue, the date.`,picture:(0,J.jsx)(Wr,{})},{id:`triggers`,title:`Three ways to start`,body:`On a schedule, when GitHub changes, or when an issue moves in Jira or Linear. A GitHub or tracker automation polls every few minutes and starts one task per match.`,picture:(0,J.jsx)(Gr,{})},{id:`paused`,title:`Paused first, then live`,body:`A new automation is paused. Preview shows what it would have matched, or when it runs next. Enable it when that looks right, and pause it again any time.`,picture:(0,J.jsx)(Kr,{})},{id:`tasks`,title:`Every run is a task`,body:`Each run shows up in the task list like one you started yourself, in its own worktree, ending at the review gate. The automation’s log keeps every run.`,picture:(0,J.jsx)(qr,{}),action:{label:`New automation`,onClick:()=>t(`/automations/new`)}}],onOpenChange:e})}var zr=`flex items-center gap-2 rounded-md px-2 py-1 text-micro`;function Br({on:e=!0}){return(0,J.jsx)(`span`,{className:k(`flex h-3.5 w-6 items-center rounded-full px-0.5`,e?`justify-end bg-violet`:`justify-start bg-muted-foreground/40`),children:(0,J.jsx)(`span`,{className:`size-2.5 rounded-full bg-background`})})}function Vr(){return(0,J.jsx)(`span`,{className:`flex w-20 flex-col gap-1`,children:[`Mon 09:00`,`Fri 16:00`].map((e,t)=>(0,J.jsxs)(`span`,{className:k(`flex items-center justify-between rounded-md border px-1.5 py-1 font-mono text-[9px]`,t===0?`border-violet bg-violet/15 text-foreground`:`border-border text-muted-foreground`),children:[e,(0,J.jsx)(`span`,{className:k(`size-1.5 rounded-full`,t===0?`bg-violet`:`bg-muted-foreground/50`)})]},e))})}function Hr(){return(0,J.jsxs)(`span`,{className:`flex w-20 flex-col gap-1.5`,children:[(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-md border border-violet bg-violet/15 px-1.5 py-1`,children:[(0,J.jsx)(`span`,{className:`size-1.5 rounded-full bg-violet`}),(0,J.jsx)(`span`,{className:`h-1 flex-1 rounded bg-violet/60`}),(0,J.jsx)(`span`,{className:`rounded-sm bg-violet/40 px-1 text-[7px] text-foreground`,children:`PR`})]}),(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-md border border-border px-1.5 py-1`,children:[(0,J.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50`}),(0,J.jsx)(`span`,{className:`h-1 w-2/3 rounded bg-muted`})]})]})}function Ur(){return(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[9px]`,children:[(0,J.jsx)(`span`,{className:`rounded-md border border-border px-1.5 py-1 text-muted-foreground`,children:`To do`}),(0,J.jsx)(`span`,{className:`h-px w-3 bg-violet`}),(0,J.jsx)(`span`,{className:`rounded-md border border-violet bg-violet/15 px-1.5 py-1 text-foreground`,children:`Ready`})]})}function Wr(){return(0,J.jsxs)(Kt,{bar:(0,J.jsx)(`span`,{className:`ml-3 text-micro text-soft-foreground`,children:`What to run`}),children:[(0,J.jsxs)(`p`,{className:`text-meta leading-relaxed text-foreground`,children:[`Review `,(0,J.jsx)(`span`,{className:`rounded-sm bg-violet/15 px-1 text-violet`,children:`{{github.url}}`}),` for real issues only and leave one comment per finding.`]}),(0,J.jsx)(`div`,{className:k($t,`mt-3 w-1/2`)})]})}function Gr(){return(0,J.jsx)(Kt,{children:[`Every weekday at 9:00`,`When a pull request opens`,`When PROJ-42 reaches Ready`].map((e,t)=>(0,J.jsxs)(`div`,{style:{"--i":t},className:k(zr,`tip-rise justify-between text-foreground`),children:[(0,J.jsx)(`span`,{children:e}),(0,J.jsx)(Br,{})]},e))})}function Kr(){return(0,J.jsxs)(Kt,{children:[(0,J.jsxs)(`div`,{className:k(zr,`justify-between text-foreground`),children:[(0,J.jsx)(`span`,{children:`Triage new issues`}),(0,J.jsxs)(`span`,{className:`flex items-center gap-2 text-[9.5px] text-soft-foreground`,children:[`paused`,(0,J.jsx)(Br,{on:!1})]})]}),(0,J.jsx)(`div`,{style:{"--i":2},className:`tip-rise mt-2 rounded-md border border-violet/50 bg-violet/10 px-2 py-1.5 text-micro text-foreground`,children:`Preview: would have matched 3 issues this week`}),(0,J.jsxs)(`div`,{style:{"--i":5},className:k(zr,`tip-rise mt-2 justify-between text-foreground`),children:[(0,J.jsx)(`span`,{children:`Triage new issues`}),(0,J.jsxs)(`span`,{className:`flex items-center gap-2 text-[9.5px] text-violet`,children:[`enabled`,(0,J.jsx)(Br,{})]})]})]})}function qr(){return(0,J.jsx)(Kt,{bar:(0,J.jsx)(`span`,{className:`ml-3 text-micro text-soft-foreground`,children:`Tasks`}),children:[[`needs review`,`Triage issue 412: missing repro`,`text-violet`],[`running`,`Nightly dependency bump`,`text-success`],[`done`,`Weekly changelog draft`,`text-muted-foreground`]].map(([e,t,n],r)=>(0,J.jsxs)(`div`,{style:{"--i":r},className:k(zr,`tip-rise text-foreground`),children:[(0,J.jsx)(`span`,{className:k(`w-16 shrink-0 text-[9.5px]`,n),children:e}),(0,J.jsx)(`span`,{className:`truncate`,children:t})]},t))})}var Jr=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function Yr(e){let t=[],n=e.queued.filter(e=>e.kind===`continuation`).length,r=e.queued.length-n;if(e.queued.length){let i=[r?`${r} never started`:``,n?`${n} continuing earlier work`:``].filter(Boolean).join(`, `);t.push(`${Jr(e.queued.length,`queued task`)} (${i}) will still start when a slot frees up, unless you cancel them.`)}return e.active.length&&t.push(`${Jr(e.active.length,`task`)} ${e.active.length===1?`is`:`are`} running or waiting and will keep going — stop them from Tasks. They can no longer dispatch new subtasks.`),t}function Xr(e){return e.queued.length>0||e.active.length>0}function Zr({automation:e,work:t,pausing:n,onOpenChange:r,onConfirm:i}){let a=e=>e.stopPropagation(),o=t?Yr(t):[],s=t?.queued.length??0;return(0,J.jsx)(kt,{open:t!==void 0,onOpenChange:r,children:(0,J.jsxs)(wt,{onClick:a,children:[(0,J.jsxs)(Ot,{children:[(0,J.jsx)(Ct,{children:n?`Pause “${e.name}”?`:`Work still pending for “${e.name}”`}),(0,J.jsx)(St,{asChild:!0,children:(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(`p`,{children:n?`Pausing stops new launches. Tasks it already started are not stopped:`:`This automation is paused, but tasks it started earlier remain:`}),o.length?(0,J.jsx)(`ul`,{className:`list-disc space-y-1 pl-5`,children:o.map(e=>(0,J.jsx)(`li`,{children:e},e))}):(0,J.jsx)(`p`,{children:`Nothing is queued or running.`})]})})]}),(0,J.jsxs)(Et,{children:[(0,J.jsx)(Dt,{children:n?`Cancel`:`Close`}),n?(0,J.jsx)(Tt,{onClick:()=>i(!1),children:`Pause`}):null,s>0?(0,J.jsx)(Tt,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>i(!0),children:n?`Pause and cancel ${Jr(s,`queued task`)}`:`Cancel ${Jr(s,`queued task`)}`}):null]})]})})}function Qr({automation:e,actions:t}){let n=L(),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(),s=async()=>{if(!e.enabled)return t.toggleEnabled(e);let n=await t.loadWork(e);n&&Xr(n)?o({work:n,pausing:!0}):await t.toggleEnabled(e)},c=async()=>{let n=await t.loadWork(e);n&&o({work:n,pausing:!1})},l=async n=>{let r=a?.pausing??!1;o(void 0),r&&await t.toggleEnabled(e),n&&await t.cancelQueued(e)},u=e=>e.stopPropagation(),d=`/automations/${encodeURIComponent(e.id)}`;return(0,J.jsxs)(`span`,{"data-slot":`row-actions`,className:`inline-flex gap-0.5`,onClick:u,children:[e.kind===`schedule`?null:(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,title:`Preview matches`,"aria-label":`Preview matches`,disabled:t.busy,onClick:()=>void t.preview(e),children:(0,J.jsx)(at,{className:`size-[13px]`})}),(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,title:`Run now`,"aria-label":`Run now`,disabled:t.busy,onClick:()=>void t.runNow(e),children:(0,J.jsx)(pt,{className:`size-[13px]`})}),(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,title:e.enabled?`Pause`:`Enable`,"aria-label":e.enabled?`Pause`:`Enable`,disabled:t.busy,onClick:()=>void s(),children:e.enabled?(0,J.jsx)(_n,{className:`size-[13px]`}):(0,J.jsx)(vn,{className:`size-[13px]`})}),(0,J.jsxs)(et,{children:[(0,J.jsx)(Xe,{asChild:!0,children:(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":`More`,children:(0,J.jsx)(it,{className:`size-3.5`})})}),(0,J.jsxs)(Ze,{align:`end`,className:`w-[200px]`,onClick:u,children:[(0,J.jsxs)(Qe,{onSelect:()=>n(d),children:[(0,J.jsx)(nt,{}),`Edit`]}),(0,J.jsxs)(Qe,{onSelect:()=>n(`${d}/log`),children:[(0,J.jsx)(yn,{}),`View log`]}),(0,J.jsxs)(Qe,{onSelect:()=>void t.duplicate(e),children:[(0,J.jsx)(tt,{}),`Duplicate`]}),(0,J.jsxs)(Qe,{onSelect:()=>void t.copyCli(e),children:[(0,J.jsx)(ht,{}),`Copy as CLI`]}),e.enabled?null:(0,J.jsxs)(Qe,{onSelect:()=>void c(),children:[(0,J.jsx)(gn,{}),`Pending tasks…`]}),(0,J.jsx)($e,{}),(0,J.jsxs)(Qe,{variant:`destructive`,onSelect:()=>i(!0),children:[(0,J.jsx)(gt,{}),`Delete`]})]})]}),(0,J.jsx)(Zr,{automation:e,work:a?.work,pausing:a?.pausing??!1,onOpenChange:e=>{e||o(void 0)},onConfirm:e=>void l(e)}),(0,J.jsx)(kt,{open:r,onOpenChange:i,children:(0,J.jsxs)(wt,{onClick:u,children:[(0,J.jsxs)(Ot,{children:[(0,J.jsxs)(Ct,{children:[`Delete “`,e.name,`”?`]}),(0,J.jsx)(St,{children:`The automation is removed for good. Tasks it already launched and its execution log stay.`})]}),(0,J.jsxs)(Et,{children:[(0,J.jsx)(Dt,{children:`Cancel`}),(0,J.jsx)(Tt,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>void t.remove(e),children:`Delete`})]})]})})]})}function $r(e){let t=typeof e==`object`&&e&&!Array.isArray(e)?e:{},n=t.sort===`manual`||t.sort===`nextRun`?t.sort:`name`,r=new Set;if(Array.isArray(t.order))for(let e of t.order){if(typeof e!=`string`)continue;let t=e.trim();if(t&&t.length<=200&&r.add(t),r.size>=200)break}return{sort:n,order:[...r]}}function ei(e,t,n){if(!e.enabled||e.kind!==`schedule`)return null;if(e.nextRunAt!==void 0){let t=Date.parse(e.nextRunAt);return Number.isFinite(t)?t:null}let r=`schedules`in e?e.schedules:void 0,i=null;for(let a of Array.isArray(r)?r:[e.schedule]){let e=ie.safeParse(a);if(!e.success)continue;let r=A(e.data,n,t);r!==null&&Number.isFinite(r)&&(i===null||r<i)&&(i=r)}return i}var ti=(e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id);function ni(e,t,n,r){if(t.sort===`manual`){let n=new Map(t.order.map((e,t)=>[e,t])),r=e.filter(e=>!n.has(e.id)).sort(ti),i=e.filter(e=>n.has(e.id)).sort((e,t)=>(n.get(e.id)??0)-(n.get(t.id)??0));return[...r,...i]}if(t.sort===`name`)return[...e].sort(ti);let i=e=>{let t=ei(e,n,r);return t===null?[e.enabled&&e.kind!==`schedule`?1:2,0]:[0,t]},a=new Map(e.map(e=>[e.id,i(e)]));return[...e].sort((e,t)=>{let n=a.get(e.id),r=a.get(t.id);return n===void 0||r===void 0?ti(e,t):n[0]-r[0]||n[1]-r[1]||ti(e,t)})}function ri(e,t,n){if(t<0||n<0||t>=e.length||n>=e.length||t===n)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}var Z=`h-[38px] border-b border-border px-[10px] text-left eyebrow whitespace-nowrap text-soft-foreground`,Q=`h-12 border-b border-border px-[10px] text-ui leading-none whitespace-nowrap`,ii=`cz-auto-wide max-[1280px]:hidden`,ai=(0,J.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`—`});function oi({data:e,actions:t,now:n=Date.now(),automations:r=e.automations,reorder:i}){let a=me(pe(_e,{activationConstraint:{distance:4}}),pe(fe,{coordinateGetter:ge})),o=e=>{let t=r.findIndex(t=>t.id===e),n=r[t];return n?`${n.name}, position ${t+1} of ${r.length}`:`automation`};return(0,J.jsx)(be,{sensors:a,collisionDetection:Se,accessibility:{announcements:{onDragStart:({active:e})=>`Picked up ${o(e.id)}.`,onDragOver:({active:e,over:t})=>t?`${o(e.id)} moved to ${o(t.id)}.`:`No drop position.`,onDragEnd:({active:e,over:t})=>t?`${o(e.id)} dropped at ${o(t.id)}.`:`Order unchanged.`,onDragCancel:()=>`Reordering cancelled. The order is unchanged.`}},onDragEnd:({active:e,over:t})=>{if(!i?.enabled||t===null)return;let n=r.findIndex(t=>t.id===e.id),a=r.findIndex(e=>e.id===t.id);n>=0&&a>=0&&n!==a&&i.onMove(n,a)},children:(0,J.jsx)(P,{flush:!0,"data-slot":`automations-table`,className:`min-w-0 overflow-x-auto`,children:(0,J.jsxs)(`table`,{className:`w-full border-collapse [&_tbody_tr:last-child>td]:border-b-0`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[i?(0,J.jsx)(`th`,{className:Z,children:`Order`}):null,(0,J.jsx)(`th`,{className:k(Z,`pl-4`),children:`State`}),(0,J.jsx)(`th`,{className:Z,children:`Automation`}),(0,J.jsx)(`th`,{className:Z,children:`Trigger`}),(0,J.jsx)(`th`,{className:k(Z,ii),children:`Runs as`}),(0,J.jsx)(`th`,{className:Z,children:`Next run`}),(0,J.jsx)(`th`,{className:Z,children:`Last run`}),(0,J.jsx)(`th`,{className:k(Z,ii,`text-right`),children:`Runs 7d`}),null,(0,J.jsx)(`th`,{className:k(Z,`pr-4`)})]})}),(0,J.jsx)(`tbody`,{children:(0,J.jsx)(xe,{items:r.map(e=>e.id),strategy:ve,children:r.map((a,o)=>(0,J.jsx)(si,{automation:a,actions:t,timeZone:e.timeZone,available:e.available,showCost:!1,now:n,position:o,total:r.length,...i?{reorder:i}:{}},a.id))})})]})})})}function si({automation:e,actions:t,timeZone:n,available:r,showCost:i,now:a,position:o,total:s,reorder:c}){let l=L(),u=de({id:e.id,disabled:!c?.enabled}),d=e.kind===`github`,f=d&&!r,p=e.task.dispatch,m=Ke(e),h=[e.task.workflow,e.task.runner].filter(Boolean),g=e=>e.stopPropagation();return(0,J.jsxs)(`tr`,{ref:u.setNodeRef,style:{transform:ye.Transform.toString(u.transform),transition:u.transition},"data-slot":`automation-row`,"data-automation":e.id,"data-enabled":e.enabled?`true`:`false`,className:k(`cursor-pointer hover:bg-muted`,!e.enabled&&`opacity-60`),onClick:()=>l(`/automations/${encodeURIComponent(e.id)}`),children:[c?(0,J.jsx)(`td`,{className:k(Q,`w-px`),onClick:g,children:(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,className:`touch-none cursor-grab`,ref:u.setActivatorNodeRef,...u.attributes,...u.listeners,"aria-label":`Reorder ${e.name}`,disabled:!c.enabled,children:(0,J.jsx)(je,{className:`size-3.5`})}),(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move ${e.name} up`,disabled:!c.enabled||o===0,onClick:()=>c.onMove(o,o-1),children:(0,J.jsx)(Ne,{className:`size-3.5`})}),(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":`Move ${e.name} down`,disabled:!c.enabled||o===s-1,onClick:()=>c.onMove(o,o+1),children:(0,J.jsx)(Oe,{className:`size-3.5`})})]})}):null,(0,J.jsx)(`td`,{className:k(Q,`pl-4`),children:f?(0,J.jsx)(Vt,{dot:`neutral`,children:`paused by capability`}):(0,J.jsx)(Vt,{dot:e.enabled?`success`:`neutral`,pulse:e.enabled&&d,children:e.enabled?`enabled`:`paused`})}),(0,J.jsx)(`td`,{className:k(Q,`max-w-0 min-w-[200px]`),children:(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[d?(0,J.jsx)(U,{className:`size-3.5 shrink-0 text-soft-foreground`}):e.kind===`tracker`?(0,J.jsx)(N,{className:`size-3.5 shrink-0 text-soft-foreground`}):(0,J.jsx)(sn,{className:`size-3.5 shrink-0 text-soft-foreground`}),(0,J.jsx)(`span`,{className:`overflow-hidden text-ui font-medium text-ellipsis whitespace-nowrap`,children:e.name}),p?(0,J.jsxs)(`span`,{"data-slot":`dispatch-badge`,title:`dispatch · up to ${p.maxSubtasks??1} subtasks`,className:`inline-flex shrink-0 items-center gap-[3px] rounded-full bg-muted px-1.5 py-px text-micro font-medium text-muted-foreground`,children:[(0,J.jsx)(st,{className:`size-2.5`}),`×`,p.maxSubtasks??1]}):null,e.kind===`tracker`&&e.trackerTrigger&&!e.trackerTrigger.access?(0,J.jsx)(`span`,{"data-slot":`needs-review-badge`,title:`Tracker access changed: open this automation and review its access before it can run again`,className:`inline-flex shrink-0 items-center rounded-full bg-warning/15 px-1.5 py-px text-micro font-medium text-warning`,children:`Needs review`}):null]})}),(0,J.jsx)(`td`,{className:k(Q,`max-w-[260px] overflow-hidden font-mono text-xs text-ellipsis text-muted-foreground`),title:m,children:m}),(0,J.jsx)(`td`,{className:k(Q,ii,`text-xs text-muted-foreground`),children:h.length?(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[h.map((e,t)=>(0,J.jsxs)(`span`,{className:`contents`,children:[t>0?(0,J.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}):null,e]},e)),e.task.autonomous?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,J.jsx)(`span`,{title:`autonomous`,"data-slot":`autonomous-mark`,className:`inline-flex`,children:(0,J.jsx)(N,{"aria-hidden":`true`,className:`size-[11px] text-soft-foreground`})})]}):null]}):ai}),(0,J.jsx)(`td`,{"data-slot":`next-run`,className:k(Q,`font-mono text-xs tabular-nums`,e.enabled?`text-foreground`:`text-soft-foreground`),children:ci(e,n,a)}),(0,J.jsx)(`td`,{className:Q,children:e.lastRun?(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,J.jsx)(I,{tone:Fe(e.lastRun.status)}),(0,J.jsx)(`span`,{className:`text-label text-muted-foreground`,children:We(e.lastRun.status)}),(0,J.jsx)(`span`,{className:`text-meta text-soft-foreground`,children:Bt(e.lastRun.ts,a)}),(0,J.jsxs)(R,{to:`/tasks/${encodeURIComponent(e.lastRun.runId)}`,"data-slot":`task-link`,onClick:g,className:`inline-flex items-center gap-0.5 rounded-full border border-violet/40 px-1.5 py-px font-mono text-micro font-semibold text-violet`,children:[`task`,(0,J.jsx)(Me,{className:`size-[9px]`})]})]}):ai}),(0,J.jsx)(`td`,{className:k(Q,ii,`text-right font-mono text-xs text-muted-foreground tabular-nums`),children:e.runs7d}),i?(0,J.jsx)(`td`,{className:k(Q,ii,`text-right font-mono text-xs text-muted-foreground tabular-nums`),children:e.costUsd7d===void 0?ai:Ie(e.costUsd7d)}):null,(0,J.jsx)(`td`,{className:k(Q,`pr-3 text-right`),children:(0,J.jsx)(Qr,{automation:e,actions:t})})]})}function ci(e,t,n){if(!e.enabled)return`—`;if(e.kind!==`schedule`)return`continuous`;let r=ei(e,t,n);return r===null?`—`:Ue(r,t)||`—`}var li=new WeakMap;function ui(){let e=b(),t=m(),n=O(),r=(0,q.useMemo)(()=>v.uiState,[n]),i=$r(t.data?.automationList),a=t=>{let i=e.getQueryData(r);if(i===void 0)return;let a=i.automationList,o={...typeof a==`object`&&a&&!Array.isArray(a)?a:{},...$r(a),...t};e.setQueryData(r,{...i,automationList:o});let s=li.get(e);s===void 0&&(s=new Map,li.set(e,s));let c=s.get(n);c===void 0&&(c={sequence:0,chain:Promise.resolve()},s.set(n,c));let l=++c.sequence,u=c,d=c.chain.then(async()=>{let t=await h({automationList:o},n);l===u.sequence&&e.setQueryData(r,t)});c.chain=d.catch(t=>{Lt(t instanceof Error?t.message:String(t),{tone:`danger`}),l===u.sequence&&e.invalidateQueries({queryKey:r})})};return{preferences:i,canSave:t.data!==void 0,loadError:t.isError&&t.data===void 0,retry:()=>{t.refetch()},setSort:e=>a({sort:e}),setOrder:e=>a({order:$r({order:e}).order})}}function di(e){return e.hour*60+e.minute}function fi(e,t,n=0){let r=w(e,t);if(!r)return null;let i=new Date(Date.UTC(r.year,r.month-1,r.day+n));return oe(i.getUTCFullYear(),i.getUTCMonth()+1,i.getUTCDate(),0,0,t)}function pi(e,t,n,r){let i=[];for(let a of e)if(!(a.kind!==`schedule`||!a.schedule))for(let e of D(a,t,n,r)){let t=w(e,r);t&&i.push({automation:a,at:e,parts:t})}return i.sort((e,t)=>e.at-t.at)}function mi(e){let t=new Map;return e.map(e=>{let n=di(e.parts),r=t.get(n)??0;return t.set(n,r+1),{occurrence:e,stack:r}})}function hi({automation:e,minute:t,stack:n=0,wide:r=!1}){let i=L(),a=E(Math.floor(t/60),t%60),o=[e.task.workflow,e.task.runner].filter(Boolean).join(` · `);return(0,J.jsxs)(`button`,{type:`button`,"data-slot":`event-block`,"data-automation":e.id,"data-enabled":e.enabled?`true`:`false`,title:`${e.name} · ${a}`,onClick:()=>i(`/automations/${encodeURIComponent(e.id)}`),className:k(`absolute right-[3px] left-[3px] flex cursor-pointer overflow-hidden rounded-[6px] border border-border bg-card text-left text-meta leading-[1.3] font-medium text-foreground shadow-xs`,r?`h-12 flex-col items-start gap-[3px] px-2 py-[5px]`:`h-6 flex-row items-center gap-1.5 px-1.5`,!e.enabled&&`opacity-50`),style:{top:t/60*34+1+26*n},children:[(0,J.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,J.jsx)(I,{tone:e.task.runner===`codex`?`violet`:`success`}),(0,J.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.name})]}),r?(0,J.jsxs)(`span`,{className:`max-w-full overflow-hidden font-mono text-micro leading-[1.3] font-normal text-ellipsis whitespace-nowrap text-muted-foreground`,children:[a,o?` · ${o}`:``]}):null]})}function gi(){return(0,J.jsx)(`div`,{"data-slot":`hour-gutter`,className:`w-12 shrink-0`,children:Array.from({length:24},(e,t)=>(0,J.jsx)(`div`,{className:`-translate-y-[6px] pr-2 text-right font-mono text-micro text-soft-foreground`,style:{height:34},children:t?E(t):``},t))})}function _i({minute:e}){return(0,J.jsx)(`div`,{"aria-hidden":`true`,"data-slot":`now-line`,className:`absolute inset-x-0 z-[2] h-[2px] bg-primary`,style:{top:e/60*34},children:(0,J.jsx)(`span`,{className:`absolute -top-[3px] -left-[3px] size-[8px] rounded-full bg-primary`})})}function vi(){return(0,J.jsx)(J.Fragment,{children:Array.from({length:24},(e,t)=>(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-x-0 h-px bg-border`,style:{top:t*34}},t))})}function yi({automations:e}){let t=e.filter(e=>e.kind===`github`&&e.enabled);return t.length?(0,J.jsxs)(`div`,{"data-slot":`poll-band`,className:`grid grid-cols-[48px_minmax(0,1fr)] border-b border-border`,children:[(0,J.jsx)(`div`,{className:`py-2 pr-2 text-right font-mono text-micro text-soft-foreground`,children:`poll`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-1 border-l border-border px-2 py-1.5`,children:t.map(e=>(0,J.jsxs)(`div`,{"data-slot":`poll-row`,className:`flex h-[22px] min-w-0 items-center gap-2 overflow-hidden rounded-[6px] border border-violet/25 bg-violet/8 px-2 text-meta font-medium`,children:[(0,J.jsx)(U,{className:`size-3 shrink-0 text-violet`}),(0,J.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.name}),(0,J.jsx)(`span`,{className:`overflow-hidden font-mono text-micro font-normal text-ellipsis whitespace-nowrap text-muted-foreground`,children:Ke(e)}),(0,J.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-micro font-normal whitespace-nowrap text-soft-foreground`,children:[e.runs7d,` runs`]})]},e.id))})]}):null}var bi=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function xi({data:e}){let t=It(6e4),n=L(),[r,i]=(0,q.useState)(0),a=e.timeZone,o=fi(t,a,r),s=fi(t,a,r+1),c=o===null?null:w(o,a),l=w(t,a);if(o===null||s===null||!c||!l)return(0,J.jsx)(`div`,{"data-slot":`day-view`,className:`p-5`,children:(0,J.jsxs)(`p`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:[`Cannot draw the day: unknown time zone “`,a,`”.`]})});let u=r===0,d=mi(pi(e.automations,o,s,a)),f=e.automations.filter(e=>e.kind===`github`&&e.enabled),p=`${Be(c.weekday)} ${c.day} ${bi[c.month-1]??``}`;return(0,J.jsxs)(`div`,{"data-slot":`day-view`,className:`grid grid-cols-[minmax(0,1fr)_320px] items-start gap-4 p-5 max-md:grid-cols-1`,children:[(0,J.jsxs)(P,{flush:!0,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3.5 py-2.5`,children:[(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":`Previous day`,onClick:()=>i(e=>e-1),children:(0,J.jsx)(qe,{className:`size-3.5`})}),(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":`Next day`,onClick:()=>i(e=>e+1),children:(0,J.jsx)(Ye,{className:`size-3.5`})}),(0,J.jsx)(`span`,{"data-slot":`day-title`,className:`text-sm font-semibold whitespace-nowrap`,children:p}),u?(0,J.jsx)(Vt,{dot:`success`,children:`today`}):null,(0,J.jsxs)(`span`,{className:`ml-auto text-xs whitespace-nowrap text-muted-foreground`,children:[d.length,` scheduled runs`,f.length?` · ${f.length} GitHub poll${f.length===1?``:`s`}`:``]})]}),(0,J.jsx)(yi,{automations:e.automations}),(0,J.jsxs)(`div`,{className:`flex max-h-[600px] overflow-y-auto`,children:[(0,J.jsx)(gi,{}),(0,J.jsxs)(`div`,{"data-slot":`day-column`,"data-today":u?`true`:void 0,className:`relative flex-1 border-l border-border`,style:{height:816},children:[(0,J.jsx)(vi,{}),u?(0,J.jsx)(_i,{minute:di(l)}):null,d.map(({occurrence:e,stack:t})=>(0,J.jsx)(hi,{automation:e.automation,minute:di(e.parts),stack:t,wide:!0},`${e.automation.id}-${e.at}`))]})]})]}),(0,J.jsxs)(P,{flush:!0,"data-slot":`agenda`,className:`py-3`,children:[(0,J.jsx)(`div`,{className:`px-3.5 pb-2 eyebrow text-soft-foreground`,children:`Agenda`}),f.map(e=>(0,J.jsxs)(`button`,{type:`button`,"data-slot":`agenda-poll`,onClick:()=>n(`/automations/${encodeURIComponent(e.id)}`),className:`grid w-full cursor-pointer grid-cols-[48px_1fr] gap-2.5 px-3.5 py-2 text-left hover:bg-muted`,children:[(0,J.jsx)(`span`,{className:`font-mono text-micro font-medium text-soft-foreground`,children:`poll`}),(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsxs)(`span`,{className:`flex items-center gap-2 text-ui font-medium`,children:[(0,J.jsx)(U,{className:`size-3 shrink-0 text-violet`}),(0,J.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:e.name})]}),(0,J.jsxs)(`span`,{className:`mt-0.5 block overflow-hidden font-mono text-meta leading-[1.4] text-ellipsis whitespace-nowrap text-soft-foreground`,children:[Ke(e),` · continuous`]})]})]},e.id)),d.map(({occurrence:e})=>{let r=e.at<t,{automation:i}=e;return(0,J.jsxs)(`button`,{type:`button`,"data-slot":`agenda-row`,"data-past":r?`true`:`false`,onClick:()=>n(`/automations/${encodeURIComponent(i.id)}`),className:`grid w-full cursor-pointer grid-cols-[48px_1fr] gap-2.5 px-3.5 py-2 text-left hover:bg-muted`,children:[(0,J.jsx)(`span`,{className:k(`font-mono text-xs font-medium tabular-nums`,r?`text-soft-foreground`:`text-foreground`),children:E(e.parts.hour,e.parts.minute)}),(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsxs)(`span`,{className:k(`flex items-center gap-2 text-ui font-medium`,r&&`text-muted-foreground`),children:[(0,J.jsx)(I,{tone:r&&i.lastRun?Fe(i.lastRun.status):`neutral`}),(0,J.jsx)(`span`,{className:`overflow-hidden text-ellipsis whitespace-nowrap`,children:i.name})]}),(0,J.jsx)(`span`,{className:`mt-0.5 block overflow-hidden text-meta leading-[1.4] text-ellipsis whitespace-nowrap text-soft-foreground`,children:i.task.prompt})]})]},`${i.id}-${e.at}`)}),d.length===0?(0,J.jsx)(`p`,{className:`px-3.5 py-2 text-label text-soft-foreground`,children:f.length?`Nothing scheduled — the GitHub polls above still run.`:`Nothing scheduled.`}):null]})]})}function Si(e,t,n,r=12){let i=[];for(let a of e)if(!(!a.enabled||a.kind!==`schedule`||!a.schedule))for(let e of D(a,t,t+14*864e5,n,r))i.push({automation:a,at:e});return i.sort((e,t)=>e.at-t.at).slice(0,r)}function Ci({open:e,onOpenChange:t,upcoming:n,pollCount:r,timeZone:i,now:a}){let o=L(),s=w(a,i);return(0,J.jsx)(De,{open:e,onOpenChange:t,children:(0,J.jsxs)(Ee,{side:`right`,"data-slot":`next-runs-rail`,"aria-describedby":void 0,className:`w-[360px] gap-0 sm:max-w-[360px]`,children:[(0,J.jsxs)(Ce,{className:`px-4 pt-4 pb-2`,children:[(0,J.jsxs)(Te,{className:`inline-flex items-center gap-2 text-sm`,children:[(0,J.jsx)(ze,{className:`size-4`}),`Next runs`]}),(0,J.jsx)(we,{className:`sr-only`,children:`Upcoming scheduled runs, soonest first.`})]}),(0,J.jsxs)(`div`,{className:`overflow-y-auto`,children:[n.map((e,n)=>{let r=w(e.at,i),c=r!==null&&s!==null&&r.year===s.year&&r.month===s.month&&r.day===s.day,l=r?`${c?``:`${Be(r.weekday)} `}${E(r.hour,r.minute)}`:``;return(0,J.jsxs)(`button`,{type:`button`,"data-slot":`next-run-row`,"data-automation":e.automation.id,onClick:()=>{t(!1),o(`/automations/${encodeURIComponent(e.automation.id)}`)},className:`grid w-full cursor-pointer grid-cols-[76px_1fr_auto] items-center gap-2 px-4 py-2 text-left text-ui hover:bg-muted`,children:[(0,J.jsx)(`span`,{className:`font-mono text-xs font-medium whitespace-nowrap text-muted-foreground tabular-nums`,children:l}),(0,J.jsx)(`span`,{className:`overflow-hidden text-ui font-medium text-ellipsis whitespace-nowrap`,children:e.automation.name}),(0,J.jsx)(`span`,{className:`text-meta whitespace-nowrap text-soft-foreground`,children:Pe(e.at,a)})]},`${e.automation.id}-${n}`)}),n.length===0?(0,J.jsx)(`p`,{className:`px-4 py-2 text-label text-soft-foreground`,children:`No scheduled runs in the next two weeks.`}):null,(0,J.jsxs)(`div`,{"data-slot":`next-runs-footer`,className:`mt-1.5 flex items-center gap-2 border-t border-border px-3.5 pt-2.5 pb-1 text-xs text-muted-foreground`,children:[(0,J.jsx)(I,{tone:`pending`,pulse:!0}),r,` GitHub polls running continuously`]})]})]})})}function wi({stats:e,pollCount:t,upcoming:n,timeZone:r,railOpen:i,onOpenRail:a}){let o=n[0];return(0,J.jsxs)(`div`,{"data-slot":`stats-strip`,className:`flex flex-wrap items-center gap-4 text-label text-muted-foreground`,children:[(0,J.jsx)(`span`,{className:`eyebrow text-soft-foreground`,children:`This week`}),(0,J.jsx)(Ti,{label:`runs`,value:String(e.runs)}),null,(0,J.jsx)(Ti,{label:`failed`,value:String(e.failed),danger:e.failed>0}),(0,J.jsx)(Ti,{label:`agent time`,value:Ge(e.agentSeconds)}),(0,J.jsxs)(`span`,{"data-slot":`stats-polls`,className:`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[(0,J.jsx)(I,{tone:`pending`,pulse:!0}),t,` GitHub polls continuous`]}),(0,J.jsx)(`span`,{className:`flex-1`}),(0,J.jsxs)(`span`,{"data-slot":`stats-next`,className:`inline-flex min-w-0 shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[(0,J.jsx)(sn,{className:`size-[13px] text-soft-foreground`}),`next`,` `,(0,J.jsx)(`b`,{className:`font-mono text-label font-medium text-foreground`,children:o?Re(o.at,r):`—`}),` `,(0,J.jsx)(`span`,{className:`max-w-[180px] overflow-hidden text-ellipsis`,children:o?.automation.name??``})]}),(0,J.jsxs)(M,{variant:`outline`,size:`sm`,"aria-expanded":i,className:`shrink-0`,onClick:a,children:[(0,J.jsx)(ze,{className:`size-3.5`}),`Next runs`,(0,J.jsx)(`span`,{className:`font-mono text-meta font-medium text-muted-foreground`,children:n.length})]})]})}function Ti({label:e,value:t,danger:n=!1}){return(0,J.jsxs)(`span`,{"data-slot":`stat`,"data-label":e,className:`inline-flex shrink-0 items-baseline gap-[5px] whitespace-nowrap`,children:[(0,J.jsx)(`b`,{className:k(`font-mono text-sm font-semibold tabular-nums`,n?`text-danger`:`text-foreground`),children:t}),e]})}var Ei=e=>e instanceof Error?e.message:String(e);function Di({disabled:e}){let[t,n]=(0,q.useState)(!1),r=async()=>{n(!0);try{let e=await a(),t=URL.createObjectURL(new Blob([`${JSON.stringify(e,null,2)}\n`],{type:`application/json`})),n=document.createElement(`a`);n.href=t,n.download=`cezar-automations-${e.exportedAt.slice(0,10)}.json`,document.body.append(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}catch(e){Lt(Ei(e),{tone:`danger`})}finally{n(!1)}};return(0,J.jsxs)(M,{variant:`outline`,className:`shrink-0`,"data-action":`automations-export`,disabled:e||t,onClick:()=>void r(),children:[(0,J.jsx)(rt,{className:`size-[15px]`}),`Export`]})}function Oi(){let[e,t]=(0,q.useState)(!1);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(M,{variant:`outline`,className:`shrink-0`,"data-action":`automations-import`,onClick:()=>t(!0),children:[(0,J.jsx)(ot,{className:`size-[15px]`}),`Import`]}),(0,J.jsx)(Mi,{open:e,onOpenChange:t})]})}function ki(e,t){let n={};for(let r of e){let e=t[r.index];if(e)if(r.collision){if(!e.action)continue;n[String(r.index)]={action:e.action,...e.action!==`skip`&&e.acceptCommands?{acceptCommands:!0}:{}}}else e.acceptCommands&&(n[String(r.index)]={action:`create`,acceptCommands:!0})}return n}var Ai={create:{label:`Create`,className:`border-success/40 text-success`},rename:{label:`Rename`,className:`border-primary/40 text-primary`},replace:{label:`Replace`,className:`border-warning/40 text-warning`},skip:{label:`Skip`,className:`text-muted-foreground`}};function ji(e){let t=e.filter(e=>e.action===`replace`).length,n=e.filter(e=>e.action===`create`||e.action===`rename`).length,r=e=>`${e} automation${e===1?``:`s`}`;return t?n?`Import ${r(n)} and replace ${t} (paused)`:`Replace ${r(t)} (paused)`:`Import ${r(n)} (paused)`}function Mi({open:e,onOpenChange:t}){let n=b(),r=(0,q.useId)(),[i,a]=(0,q.useState)(null),[o,s]=(0,q.useState)({}),[l,u]=(0,q.useState)(null),[d,f]=(0,q.useState)(null),[p,m]=(0,q.useState)(null),[h,g]=(0,q.useState)(!1),[_,ee]=(0,q.useState)(!1),[v,y]=(0,q.useState)(0),x=(0,q.useRef)(0),S=()=>{x.current++,a(null),s({}),u(null),f(null),m(null),g(!1),ee(!1)},ne=l?ki(l.rows,o):{},C=JSON.stringify(ne);(0,q.useEffect)(()=>{if(!i)return;let e=++x.current;g(!0),te({file:i,...C===`{}`?{}:{resolutions:JSON.parse(C)}}).then(t=>{e===x.current&&(u(t),f(null))}).catch(t=>{e===x.current&&(u(null),f(Ei(t)))}).finally(()=>{e===x.current&&g(!1)})},[i,C,v]);let re=async e=>{if(S(),!e)return;let t;try{t=JSON.parse(await e.text())}catch{f(`"${e.name}" is not valid JSON — pick a file cezar exported.`);return}a(t)},w=l?.rows??[],ie=w.some(e=>e.action!==`skip`&&e.issues.length>0),ae=w.filter(e=>e.action!==`skip`).length,oe=async()=>{if(!(!i||!l)){ee(!0),m(null);try{let e=await c({file:i,...Object.keys(ne).length?{resolutions:ne}:{},planDigest:l.planDigest}),r=e.created.length+e.replaced.length;Lt(`Imported ${r} automation${r===1?``:`s`}, paused.`),n.invalidateQueries({queryKey:en()}),S(),t(!1)}catch(e){m(Ei(e))}finally{ee(!1)}}},T=(e,t)=>s(n=>({...n,[e]:{...n[e],...t}}));return(0,J.jsx)(Pt,{open:e,onOpenChange:e=>{e||S(),t(e)},children:(0,J.jsxs)(Mt,{"data-slot":`automations-import`,className:`max-h-[90dvh] overflow-y-auto sm:max-w-3xl`,children:[(0,J.jsxs)(Ft,{children:[(0,J.jsx)(At,{children:`Import automations`}),(0,J.jsx)(jt,{children:`Pick a file exported from cezar. Nothing is written until you confirm, and every imported automation lands paused.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(`label`,{htmlFor:r,className:`text-sm font-medium`,children:`Automations file`}),(0,J.jsx)(`input`,{id:r,type:`file`,accept:`.json,application/json`,"data-slot":`automations-import-file`,onChange:e=>void re(e.target.files?.[0]),className:`block w-full text-sm text-muted-foreground file:mr-3 file:rounded-md file:border file:border-input file:bg-card file:px-3 file:py-1.5 file:text-sm file:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),d?(0,J.jsx)(`p`,{role:`alert`,"data-slot":`automations-import-error`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:d}):null,l?w.length===0?(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This file has no automations.`}):(0,J.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-border`,children:(0,J.jsxs)(`table`,{"data-slot":`automations-import-preview`,"aria-busy":h,className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{className:`bg-muted/50 text-left text-xs text-muted-foreground`,children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Name`}),(0,J.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Kind`}),(0,J.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Action`}),(0,J.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Notes`})]})}),(0,J.jsx)(`tbody`,{children:w.map(e=>(0,J.jsx)(Ni,{row:e,choice:o[e.index]??{},onChoice:t=>T(e.index,t)},e.index))})]})}):h?(0,J.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Reading the file…`}):null,p?(0,J.jsxs)(`div`,{role:`alert`,"data-slot":`automations-import-conflict`,className:`flex flex-wrap items-center gap-3 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1`,children:p}),(0,J.jsx)(M,{size:`sm`,variant:`outline`,onClick:()=>{m(null),y(e=>e+1)},children:`Review again`})]}):null,(0,J.jsxs)(Nt,{children:[(0,J.jsx)(M,{variant:`outline`,onClick:()=>{S(),t(!1)},children:`Cancel`}),(0,J.jsx)(M,{"data-action":`automations-import-confirm`,disabled:!l||h||_||ie||ae===0||p!==null,onClick:()=>void oe(),children:ji(w)})]})]})})}function Ni({row:e,choice:t,onChoice:n}){let r=e.action,i=Ai[r],a=e.newName??`${e.name} (imported)`,o=(0,q.useId)();return(0,J.jsxs)(`tr`,{"data-row":e.index,className:k(`border-t border-border align-top`,e.action===`skip`&&`text-muted-foreground`),children:[(0,J.jsxs)(`td`,{className:`px-3 py-2`,children:[(0,J.jsx)(`div`,{className:`font-medium text-foreground`,children:e.name}),e.runsCommands?(0,J.jsxs)(pn,{variant:`outline`,className:`mt-1 border-warning/40 text-warning`,children:[(0,J.jsx)(vt,{"aria-hidden":!0}),`runs shell commands`]}):null]}),(0,J.jsx)(`td`,{className:`px-3 py-2 capitalize`,children:e.kind}),(0,J.jsx)(`td`,{className:`px-3 py-2`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(pn,{variant:`outline`,"data-action-chip":r,className:i.className,children:i.label}),e.collision?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`label`,{htmlFor:o,className:`sr-only`,children:`Action for ${e.name}`}),(0,J.jsxs)(`select`,{id:o,value:t.action??e.action,onChange:e=>n({action:e.target.value}),className:`block w-full min-w-44 rounded-md border border-input bg-card px-2 py-1 text-sm text-foreground shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:[(0,J.jsx)(`option`,{value:`skip`,children:`Skip`}),(0,J.jsx)(`option`,{value:`rename`,children:`Rename to "${a}"`}),e.collision.id?(0,J.jsx)(`option`,{value:`replace`,children:`Replace`}):null]})]}):null]})}),(0,J.jsxs)(`td`,{className:`px-3 py-2`,children:[(0,J.jsxs)(`ul`,{className:`flex flex-col gap-1 text-xs`,children:[e.collision&&e.action===`skip`?(0,J.jsx)(`li`,{className:`text-muted-foreground`,children:`An automation named "${e.collision.name}" already exists.`}):null,e.action===`replace`&&e.collision?(0,J.jsx)(`li`,{className:`text-warning`,children:`Replaces and pauses "${e.collision.name}".`}):null,e.action===`rename`&&e.collision?(0,J.jsx)(`li`,{children:`Lands as "${a}".`}):null,e.issues.map(e=>(0,J.jsx)(`li`,{className:`text-destructive`,children:e},e)),e.warnings.map(e=>(0,J.jsx)(`li`,{className:`text-warning`,children:e},e))]}),e.runsCommands&&e.action!==`skip`?(0,J.jsxs)(`label`,{className:`mt-1.5 flex items-start gap-2 text-xs text-foreground`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:t.acceptCommands===!0,onChange:e=>n({acceptCommands:e.target.checked}),className:`mt-0.5 accent-primary`}),`I reviewed its shell commands and allow them to run`]}):null]})]})}var Pi=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`];function Fi({data:e}){let t=It(6e4),n=e.timeZone,r=w(t,n),i=r?Array.from({length:8},(e,i)=>fi(t,n,i-(r.weekday-1))):[],a=i[0],o=i[7];if(!r||a==null||o==null)return(0,J.jsx)(`div`,{"data-slot":`week-view`,className:`p-5`,children:(0,J.jsxs)(`p`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:[`Cannot draw the week: unknown time zone “`,n,`”.`]})});let s=r.weekday-1,c=pi(e.automations,a,o,n),l=Pi.map((e,t)=>{let r=i[t];return{label:e,dayOfMonth:r==null?null:w(r,n)?.day??null,isToday:t===s,blocks:mi(c.filter(e=>e.parts.weekday-1===t))}});return(0,J.jsx)(`div`,{"data-slot":`week-view`,className:`p-5`,children:(0,J.jsxs)(P,{flush:!0,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-[48px_repeat(7,minmax(0,1fr))] border-b border-border`,children:[(0,J.jsx)(`div`,{}),l.map(e=>(0,J.jsxs)(`div`,{"data-slot":`week-day-header`,"data-today":e.isToday?`true`:void 0,className:k(`flex items-center gap-2 border-l border-border px-2 py-2.5 eyebrow`,e.isToday?`text-foreground`:`text-soft-foreground`),children:[e.label,(0,J.jsx)(`span`,{className:k(`rounded-full px-[7px] py-px text-ui font-medium tracking-normal normal-case`,e.isToday?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e.dayOfMonth??``})]},e.label))]}),(0,J.jsx)(yi,{automations:e.automations}),(0,J.jsxs)(`div`,{className:`flex max-h-[560px] overflow-y-auto`,children:[(0,J.jsx)(gi,{}),l.map(e=>(0,J.jsxs)(`div`,{"data-slot":`week-column`,"data-today":e.isToday?`true`:void 0,className:k(`relative min-w-0 flex-1 border-l border-border`,e.isToday&&`bg-muted/35`),style:{height:816},children:[(0,J.jsx)(vi,{}),e.isToday?(0,J.jsx)(_i,{minute:di(r)}):null,e.blocks.map(({occurrence:e,stack:t})=>(0,J.jsx)(hi,{automation:e.automation,minute:di(e.parts),stack:t},`${e.automation.id}-${e.at}`))]},e.label))]})]})})}function Ii(e){return[{value:`list`,label:`List`,...e===void 0?{}:{count:e}},{value:`week`,label:`Week`},{value:`day`,label:`Day`}]}function Li({data:e,error:t,actions:n,view:r,onViewChange:i}){let[a,o]=(0,q.useState)(!1),{preferences:s,canSave:c,loadError:l,retry:u,setSort:d,setOrder:f}=ui(),p=Date.now(),m=e?Si(e.automations,p,e.timeZone,12):[],h=e?e.automations.filter(e=>e.kind===`github`&&e.enabled).length:0,g=e?ni(e.automations,s,e.timeZone,p):[],_=g.length<=200;return(0,J.jsxs)(`div`,{"data-route":`automations`,className:`flex min-h-full flex-col`,children:[(0,J.jsxs)(`header`,{className:`sticky top-0 z-10 flex min-h-14 shrink-0 flex-wrap items-center gap-3 border-b border-border bg-background px-5 max-md:py-2 md:h-14 md:flex-nowrap`,children:[(0,J.jsx)(`h1`,{className:`text-base font-semibold`,children:`Automations`}),(0,J.jsx)(un,{slot:`automations-view`,label:`View`,value:r,options:Ii(e?.automations.length),onChange:i}),(0,J.jsx)(`div`,{className:`flex-1`}),e?(0,J.jsxs)(`span`,{"data-slot":`automations-status`,className:`inline-flex min-w-0 items-center gap-2 overflow-hidden text-label text-ellipsis whitespace-nowrap text-muted-foreground max-[1280px]:hidden`,children:[(0,J.jsx)(I,{tone:e.scheduler.state===`scheduled`?`success`:`neutral`}),e.scheduler.state===`scheduled`?`Scheduler running`:`Scheduler idle`,(0,J.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),e.available?`GitHub available`:`GitHub unavailable${e.reason?` · ${e.reason}`:``}`,(0,J.jsx)(`span`,{className:`text-soft-foreground`,children:`·`}),(0,J.jsx)(`span`,{className:`font-mono text-xs`,children:e.timeZone})]}):null,(0,J.jsx)(Lr,{}),(0,J.jsx)(Di,{disabled:!e?.automations.length}),(0,J.jsx)(Oi,{}),(0,J.jsx)(M,{asChild:!0,className:`shrink-0`,children:(0,J.jsxs)(R,{to:`/automations/new`,children:[(0,J.jsx)(mt,{className:`size-[15px]`}),`New automation`]})})]}),t===void 0?e?e.automations.length===0?(0,J.jsx)(`div`,{className:`flex flex-1 flex-col px-5`,children:(0,J.jsx)(Fr,{data:e})}):r===`week`?(0,J.jsx)(Fi,{data:e}):r===`day`?(0,J.jsx)(xi,{data:e}):(0,J.jsxs)(`div`,{"data-slot":`automations-list`,className:`flex flex-col gap-3 p-5`,children:[(0,J.jsx)(wi,{stats:e.stats,pollCount:h,upcoming:m,timeZone:e.timeZone,railOpen:a,onOpenRail:()=>o(!0)}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Sort`}),(0,J.jsx)(`fieldset`,{disabled:!c,"aria-label":`Automation sort`,className:`min-w-0`,children:(0,J.jsx)(un,{slot:`automations-sort`,label:`Sort automations`,value:s.sort,options:[{value:`manual`,label:`Manual`},{value:`name`,label:`Name`},{value:`nextRun`,label:`Next run`}],onChange:d})}),c?s.sort===`manual`?(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_?`Drag a handle or use Move up and down.`:`Manual placement supports up to 200 automations.`}):null:(0,J.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[l?`Saved order unavailable.`:`Loading saved order…`,l?(0,J.jsx)(M,{size:`sm`,variant:`ghost`,onClick:u,children:`Retry`}):null]})]}),(0,J.jsx)(oi,{data:e,automations:g,actions:n,now:p,...s.sort===`manual`?{reorder:{enabled:c&&_,onMove:(e,t)=>f(ri(g.map(e=>e.id),e,t))}}:{}}),(0,J.jsx)(Ci,{open:a,onOpenChange:o,upcoming:m,pollCount:h,timeZone:e.timeZone,now:p})]}):(0,J.jsx)(`div`,{className:`p-5`,children:(0,J.jsx)($,{text:`Loading automations…`})}):(0,J.jsx)(`div`,{className:`p-5`,children:(0,J.jsx)($,{text:t})})]})}function Ri({mode:e=`list`}){let{automationId:t}=le(),n=L(),r=Jt(),i=fn(r.known&&!r.off),a=i.data?{...i.data,automations:i.data.automations.filter(e=>!e.deferredStart)}:void 0,o=Gt(a),[s,c]=ue(),l=zi(s.get(`view`));if(!r.known)return(0,J.jsx)(`div`,{"data-route":`automations`,className:`flex min-h-full flex-col p-3 md:p-5`,children:(0,J.jsx)($,{text:`Loading automations…`})});if(r.off)return(0,J.jsx)(`div`,{"data-route":`automations`,className:`flex min-h-full flex-col p-3 md:p-5`,children:(0,J.jsx)(Ut,{icon:(0,J.jsx)(N,{}),tone:`neutral`,title:`Automations are off`,subtitle:`This cockpit was started with CEZ_AUTOMATIONS=0. Unset it and restart the service to turn automations on.`,heading:`h2`})});let u=()=>n(`/automations`);if(e===`new`)return(0,J.jsx)(Tr,{data:a,initialKind:Bi(s.get(`kind`)),onBack:u,onSaved:u});if(e===`edit`){let e=a?.automations.find(e=>e.id===t);return a&&!e?(0,J.jsx)(`div`,{"data-route":`automations`,className:`p-5`,children:(0,J.jsx)($,{text:`Automation not found.`})}):e?(0,J.jsx)(Tr,{data:a,automation:e,actions:o,onBack:u,onSaved:u,onLog:()=>n(`/automations/${encodeURIComponent(e.id)}/log`)}):(0,J.jsx)(`div`,{"data-route":`automations`,className:`p-5`,children:(0,J.jsx)($,{text:`Loading automation…`})})}if(e===`log`){let e=a?.automations.find(e=>e.id===t);return t?(0,J.jsx)(Ar,{automationId:t,automation:e,timeZone:a?.timeZone,onBack:u}):(0,J.jsx)(`div`,{"data-route":`automations`,className:`p-5`,children:(0,J.jsx)($,{text:`Automation not found.`})})}return(0,J.jsx)(Li,{data:a,error:i.error?String(i.error instanceof Error?i.error.message:i.error):void 0,actions:o,view:l,onViewChange:e=>c(t=>{let n=new URLSearchParams(t);return e===`list`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})})}function zi(e){return e===`week`||e===`day`?e:`list`}function Bi(e){return e===`schedule`||e===`github`||e===`tracker`?e:void 0}function $({text:e}){return(0,J.jsx)(`div`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:e})}export{Ri as AutomationsRoute};
@@ -1 +1 @@
1
- import{N as e}from"./button-BrxohNcK.js";var t=e(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]);export{t};
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]);export{t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{t as i}from"./utils-Df_1kJEk.js";import{r as a}from"./bundle-mjs-rHxsej31.js";var o=e(t(),1),s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),c=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),l=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),u=e=>{let t=l(e);return t.charAt(0).toUpperCase()+t.slice(1)},d={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},f=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},p=(0,o.createContext)({}),m=()=>(0,o.useContext)(p),h=(0,o.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:c,...l},u)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=m()??{},y=r??g?Number(n??h)*24/Number(t??p):n??h;return(0,o.createElement)(`svg`,{ref:u,...d,width:t??p??d.width,height:t??p??d.height,stroke:e??_,strokeWidth:y,className:s(`lucide`,v,i),...!a&&!f(l)&&{"aria-hidden":`true`},...l},[...c.map(([e,t])=>(0,o.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),g=(e,t)=>{let n=(0,o.forwardRef)(({className:n,...r},i)=>(0,o.createElement)(h,{ref:i,iconNode:t,className:s(`lucide-${c(u(e))}`,`lucide-${e}`,n),...r}));return n.displayName=u(e),n},_=e(n(),1),v=r(),y=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,b=a,x=(e,t)=>n=>{if(t?.variants==null)return b(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=y(t)||y(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return b(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function S(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function C(...e){return t=>{let n=!1,r=e.map(e=>{let r=S(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():S(e[t],null)}}}}function w(...e){return o.useCallback(C(...e),e)}function T(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];oe(r)&&typeof O==`function`&&(r=O(r._payload)),o.Children.forEach(r,e=>{if(ie(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;oe(n)&&typeof O==`function`&&(n=O(n._payload)),a=D(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=o.cloneElement(a,void 0,c):!s&&o.Children.count(r)===1&&o.isValidElement(r)&&(a=r);let l=a?re(a):void 0,u=w(n,l);if(!a){if(r||r===0)throw Error(s?le(e):ce(e));return r}let d=ne(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}var ee=T(`Slot`),E=Symbol.for(`radix.slottable`);function te(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=E,t}var D=(e,t)=>{if(`child`in e.props){let t=e.props.child;return o.isValidElement(t)?o.cloneElement(t,void 0,e.props.children(t.props.children)):null}return o.isValidElement(t)?t:null};function ne(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function re(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ie(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===E}var ae=Symbol.for(`react.lazy`);function oe(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ae&&`_payload`in e&&se(e._payload)}function se(e){return typeof e==`object`&&!!e&&`then`in e}var ce=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,le=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,O=o.use,k=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=T(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,v.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ue(e,t){e&&_.flushSync(()=>e.dispatchEvent(t))}function de(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,v.jsx)(c.Provider,{value:l,children:r})};s.displayName=t+`Provider`;function c(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,c]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,fe(i,...t)]}function fe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var j=globalThis?.document?o.useLayoutEffect:()=>{},pe=o.useInsertionEffect||j;function me({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=he({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=ge(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function he({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return pe(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ge(e){return typeof e==`function`}function _e(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var M=e=>{let{present:t,children:n}=e,r=ve(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=be(r.ref,xe(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null};M.displayName=`Presence`;function ve(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=_e(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??N(r.current),s.current=void 0):a.current=`none`},[c]),j(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=N(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),j(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=N(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=N(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=N(t)}else r.current=null;n(e)},[])}}function ye(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function be(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ye(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ye(n[e],null)}}},[])}function N(e){return e?.animationName||`none`}function xe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Se=o.useId||(()=>void 0),Ce=0;function P(e){let[t,n]=o.useState(Se());return j(()=>{e||n(e=>e??String(Ce++))},[e]),e||(t?`radix-${t}`:``)}function F(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}var we=`DismissableLayer`,Te=`dismissableLayer.update`,Ee=`dismissableLayer.pointerDownOutside`,De=`dismissableLayer.focusOutside`,Oe,ke=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ae=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=o.useContext(ke),[f,p]=o.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),g=w(t,p),_=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?_.indexOf(y):-1,x=f?_.indexOf(f):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,T=o.useRef(!1),ee=Fe(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return C&&!t},[d.branches,C])}),E=Ie(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),te=f?x===_.length-1:!1,D=F(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return o.useEffect(()=>{if(te)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,te,D]),o.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Oe=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Le(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Oe))}},[f,m,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Le())},[f,d]),o.useEffect(()=>{let e=()=>h({});return document.addEventListener(Te,e),()=>document.removeEventListener(Te,e)},[]),(0,v.jsx)(k.div,{...u,ref:g,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:A(e.onFocusCapture,E.onFocusCapture),onBlurCapture:A(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,ee.onPointerDownCapture)})});Ae.displayName=we;var je=`DismissableLayerBranch`,Me=o.forwardRef((e,t)=>{let n=o.useContext(ke),r=o.useRef(null),i=w(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,v.jsx)(k.div,{...e,ref:i})});Me.displayName=je;function Ne(){let e=o.useContext(ke),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var Pe=()=>!0;function Fe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=Pe}=t,c=F(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||Re(Ee,c,p,{discrete:!0})};if(!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:()=>l.current=!0}}function Ie(e,t=globalThis?.document){let n=F(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&Re(De,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Le(){let e=new CustomEvent(Te);document.dispatchEvent(e)}function Re(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ue(i,a):i.dispatchEvent(a)}var ze=`focusScope.autoFocusOnMount`,Be=`focusScope.autoFocusOnUnmount`,Ve={bubbles:!1,cancelable:!0},He=`FocusScope`,Ue=o.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[c,l]=o.useState(null),u=F(i),d=F(a),f=o.useRef(null),p=w(t,l),m=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:I(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||I(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&I(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),o.useEffect(()=>{if(c){Xe.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ze,Ve);c.addEventListener(ze,u),c.dispatchEvent(t),t.defaultPrevented||(We($e(Ke(c)),{select:!0}),document.activeElement===e&&I(c))}return()=>{c.removeEventListener(ze,u),setTimeout(()=>{let t=new CustomEvent(Be,Ve);c.addEventListener(Be,d),c.dispatchEvent(t),t.defaultPrevented||I(e??document.body,{select:!0}),c.removeEventListener(Be,d),Xe.remove(m)},0)}}},[c,u,d,m]);let h=o.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ge(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&I(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&I(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,v.jsx)(k.div,{tabIndex:-1,...s,ref:p,onKeyDown:h})});Ue.displayName=He;function We(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(I(r,{select:t}),document.activeElement!==n)return}function Ge(e){let t=Ke(e);return[qe(t,e),qe(t.reverse(),e)]}function Ke(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Je(r,{upTo:t})))return r}function Je(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Ye(e){return e instanceof HTMLInputElement&&`select`in e}function I(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ye(e)&&t&&e.select()}}var Xe=Ze();function Ze(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Qe(e,t),e.unshift(t)},remove(t){e=Qe(e,t),e[0]?.resume()}}}function Qe(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $e(e){return e.filter(e=>e.tagName!==`A`)}var et=`Portal`,tt=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);j(()=>a(!0),[]);let s=n||i&&globalThis?.document?.body;return s?_.createPortal((0,v.jsx)(k.div,{...r,ref:t}),s):null});tt.displayName=et;var L=0,R=null;function nt(){o.useEffect(()=>{R||={start:rt(),end:rt()};let{start:e,end:t}=R;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),L++,()=>{L===1&&(R?.start.remove(),R?.end.remove(),R=null),L=Math.max(0,L-1)}},[])}function rt(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function it(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function at(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var B=`right-scroll-bar-position`,V=`width-before-scroll-bar`,ot=`with-scroll-bars-hidden`,st=`--removed-body-scroll-bar-size`;function ct(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function lt(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ut=typeof window<`u`?o.useLayoutEffect:o.useEffect,dt=new WeakMap;function ft(e,t){var n=lt(t||null,function(t){return e.forEach(function(e){return ct(e,t)})});return ut(function(){var t=dt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ct(e,null)}),i.forEach(function(e){r.has(e)||ct(e,a)})}dt.set(n,e)},[e]),n}function pt(e){return e}function mt(e,t){t===void 0&&(t=pt);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ht(e){e===void 0&&(e={});var t=mt(null);return t.options=z({async:!0,ssr:!1},e),t}var gt=function(e){var t=e.sideCar,n=it(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,z({},n))};gt.isSideCarExport=!0;function _t(e,t){return e.useMedium(t),gt}var vt=ht(),yt=function(){},H=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:yt,onWheelCapture:yt,onTouchMoveCapture:yt}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=it(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ft([n,t]),w=z(z({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:vt,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),z(z({},w),{ref:C})):o.createElement(y,z({},w,{className:l,ref:C}),c))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:V,zeroRight:B};var bt,xt=function(){if(bt)return bt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function St(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=xt();return t&&e.setAttribute(`nonce`,t),e}function Ct(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Tt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=St())&&(Ct(t,n),wt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Et=function(){var e=Tt();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Dt=function(){var e=Et();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ot={left:0,top:0,right:0,gap:0},kt=function(e){return parseInt(e||``,10)||0},At=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[kt(n),kt(r),kt(i)]},jt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ot;var t=At(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Mt=Dt(),U=`data-scroll-locked`,Nt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{t as i}from"./utils-Br_dqwn-.js";import{r as a}from"./bundle-mjs-rHxsej31.js";var o=e(t(),1),s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),c=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),l=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),u=e=>{let t=l(e);return t.charAt(0).toUpperCase()+t.slice(1)},d={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},f=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},p=(0,o.createContext)({}),m=()=>(0,o.useContext)(p),h=(0,o.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:c,...l},u)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=m()??{},y=r??g?Number(n??h)*24/Number(t??p):n??h;return(0,o.createElement)(`svg`,{ref:u,...d,width:t??p??d.width,height:t??p??d.height,stroke:e??_,strokeWidth:y,className:s(`lucide`,v,i),...!a&&!f(l)&&{"aria-hidden":`true`},...l},[...c.map(([e,t])=>(0,o.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),g=(e,t)=>{let n=(0,o.forwardRef)(({className:n,...r},i)=>(0,o.createElement)(h,{ref:i,iconNode:t,className:s(`lucide-${c(u(e))}`,`lucide-${e}`,n),...r}));return n.displayName=u(e),n},_=e(n(),1),v=r(),y=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,b=a,x=(e,t)=>n=>{if(t?.variants==null)return b(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=y(t)||y(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return b(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function S(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function C(...e){return t=>{let n=!1,r=e.map(e=>{let r=S(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():S(e[t],null)}}}}function w(...e){return o.useCallback(C(...e),e)}function T(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];oe(r)&&typeof O==`function`&&(r=O(r._payload)),o.Children.forEach(r,e=>{if(ie(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;oe(n)&&typeof O==`function`&&(n=O(n._payload)),a=D(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=o.cloneElement(a,void 0,c):!s&&o.Children.count(r)===1&&o.isValidElement(r)&&(a=r);let l=a?re(a):void 0,u=w(n,l);if(!a){if(r||r===0)throw Error(s?le(e):ce(e));return r}let d=ne(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}var ee=T(`Slot`),E=Symbol.for(`radix.slottable`);function te(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=E,t}var D=(e,t)=>{if(`child`in e.props){let t=e.props.child;return o.isValidElement(t)?o.cloneElement(t,void 0,e.props.children(t.props.children)):null}return o.isValidElement(t)?t:null};function ne(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function re(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ie(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===E}var ae=Symbol.for(`react.lazy`);function oe(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ae&&`_payload`in e&&se(e._payload)}function se(e){return typeof e==`object`&&!!e&&`then`in e}var ce=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,le=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,O=o.use,k=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=T(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,v.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ue(e,t){e&&_.flushSync(()=>e.dispatchEvent(t))}function de(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,v.jsx)(c.Provider,{value:l,children:r})};s.displayName=t+`Provider`;function c(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,c]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,fe(i,...t)]}function fe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var j=globalThis?.document?o.useLayoutEffect:()=>{},pe=o.useInsertionEffect||j;function me({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=he({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=ge(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function he({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return pe(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ge(e){return typeof e==`function`}function _e(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var M=e=>{let{present:t,children:n}=e,r=ve(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=be(r.ref,xe(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null};M.displayName=`Presence`;function ve(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=_e(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??N(r.current),s.current=void 0):a.current=`none`},[c]),j(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=N(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),j(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=N(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=N(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=N(t)}else r.current=null;n(e)},[])}}function ye(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function be(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ye(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ye(n[e],null)}}},[])}function N(e){return e?.animationName||`none`}function xe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Se=o.useId||(()=>void 0),Ce=0;function P(e){let[t,n]=o.useState(Se());return j(()=>{e||n(e=>e??String(Ce++))},[e]),e||(t?`radix-${t}`:``)}function F(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}var we=`DismissableLayer`,Te=`dismissableLayer.update`,Ee=`dismissableLayer.pointerDownOutside`,De=`dismissableLayer.focusOutside`,Oe,ke=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ae=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=o.useContext(ke),[f,p]=o.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),g=w(t,p),_=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?_.indexOf(y):-1,x=f?_.indexOf(f):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,T=o.useRef(!1),ee=Fe(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return C&&!t},[d.branches,C])}),E=Ie(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),te=f?x===_.length-1:!1,D=F(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return o.useEffect(()=>{if(te)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,te,D]),o.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Oe=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Le(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Oe))}},[f,m,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Le())},[f,d]),o.useEffect(()=>{let e=()=>h({});return document.addEventListener(Te,e),()=>document.removeEventListener(Te,e)},[]),(0,v.jsx)(k.div,{...u,ref:g,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:A(e.onFocusCapture,E.onFocusCapture),onBlurCapture:A(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,ee.onPointerDownCapture)})});Ae.displayName=we;var je=`DismissableLayerBranch`,Me=o.forwardRef((e,t)=>{let n=o.useContext(ke),r=o.useRef(null),i=w(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,v.jsx)(k.div,{...e,ref:i})});Me.displayName=je;function Ne(){let e=o.useContext(ke),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var Pe=()=>!0;function Fe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=Pe}=t,c=F(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||Re(Ee,c,p,{discrete:!0})};if(!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:()=>l.current=!0}}function Ie(e,t=globalThis?.document){let n=F(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&Re(De,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Le(){let e=new CustomEvent(Te);document.dispatchEvent(e)}function Re(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ue(i,a):i.dispatchEvent(a)}var ze=`focusScope.autoFocusOnMount`,Be=`focusScope.autoFocusOnUnmount`,Ve={bubbles:!1,cancelable:!0},He=`FocusScope`,Ue=o.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[c,l]=o.useState(null),u=F(i),d=F(a),f=o.useRef(null),p=w(t,l),m=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:I(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||I(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&I(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),o.useEffect(()=>{if(c){Xe.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ze,Ve);c.addEventListener(ze,u),c.dispatchEvent(t),t.defaultPrevented||(We($e(Ke(c)),{select:!0}),document.activeElement===e&&I(c))}return()=>{c.removeEventListener(ze,u),setTimeout(()=>{let t=new CustomEvent(Be,Ve);c.addEventListener(Be,d),c.dispatchEvent(t),t.defaultPrevented||I(e??document.body,{select:!0}),c.removeEventListener(Be,d),Xe.remove(m)},0)}}},[c,u,d,m]);let h=o.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ge(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&I(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&I(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,v.jsx)(k.div,{tabIndex:-1,...s,ref:p,onKeyDown:h})});Ue.displayName=He;function We(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(I(r,{select:t}),document.activeElement!==n)return}function Ge(e){let t=Ke(e);return[qe(t,e),qe(t.reverse(),e)]}function Ke(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Je(r,{upTo:t})))return r}function Je(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Ye(e){return e instanceof HTMLInputElement&&`select`in e}function I(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ye(e)&&t&&e.select()}}var Xe=Ze();function Ze(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Qe(e,t),e.unshift(t)},remove(t){e=Qe(e,t),e[0]?.resume()}}}function Qe(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $e(e){return e.filter(e=>e.tagName!==`A`)}var et=`Portal`,tt=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);j(()=>a(!0),[]);let s=n||i&&globalThis?.document?.body;return s?_.createPortal((0,v.jsx)(k.div,{...r,ref:t}),s):null});tt.displayName=et;var L=0,R=null;function nt(){o.useEffect(()=>{R||={start:rt(),end:rt()};let{start:e,end:t}=R;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),L++,()=>{L===1&&(R?.start.remove(),R?.end.remove(),R=null),L=Math.max(0,L-1)}},[])}function rt(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function it(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function at(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var B=`right-scroll-bar-position`,V=`width-before-scroll-bar`,ot=`with-scroll-bars-hidden`,st=`--removed-body-scroll-bar-size`;function ct(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function lt(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ut=typeof window<`u`?o.useLayoutEffect:o.useEffect,dt=new WeakMap;function ft(e,t){var n=lt(t||null,function(t){return e.forEach(function(e){return ct(e,t)})});return ut(function(){var t=dt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ct(e,null)}),i.forEach(function(e){r.has(e)||ct(e,a)})}dt.set(n,e)},[e]),n}function pt(e){return e}function mt(e,t){t===void 0&&(t=pt);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ht(e){e===void 0&&(e={});var t=mt(null);return t.options=z({async:!0,ssr:!1},e),t}var gt=function(e){var t=e.sideCar,n=it(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,z({},n))};gt.isSideCarExport=!0;function _t(e,t){return e.useMedium(t),gt}var vt=ht(),yt=function(){},H=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:yt,onWheelCapture:yt,onTouchMoveCapture:yt}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=it(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ft([n,t]),w=z(z({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:vt,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),z(z({},w),{ref:C})):o.createElement(y,z({},w,{className:l,ref:C}),c))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:V,zeroRight:B};var bt,xt=function(){if(bt)return bt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function St(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=xt();return t&&e.setAttribute(`nonce`,t),e}function Ct(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Tt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=St())&&(Ct(t,n),wt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Et=function(){var e=Tt();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Dt=function(){var e=Et();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ot={left:0,top:0,right:0,gap:0},kt=function(e){return parseInt(e||``,10)||0},At=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[kt(n),kt(r),kt(i)]},jt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ot;var t=At(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Mt=Dt(),U=`data-scroll-locked`,Nt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${ot} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-Df_1kJEk.js";var n=e(),r={primary:`border-primary/25 bg-primary/15 text-primary`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function i({icon:e,tone:i=`neutral`,title:a,subtitle:o,children:c,actions:l,backdrop:u=!1,heading:d=`h1`,className:f}){return(0,n.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":i,className:t(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,f),children:[u?(0,n.jsx)(s,{}):null,(0,n.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,n.jsx)(`div`,{"data-slot":`centered-state-tile`,className:t(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,r[i]),children:e}),(0,n.jsx)(d,{className:`text-2xl font-semibold text-balance text-foreground`,children:a}),o?(0,n.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:o}):null,c?(0,n.jsx)(`div`,{className:`w-full pt-2`,children:c}):null,l?(0,n.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:l}):null]})]})}var a=[{top:`6%`,left:`14%`,size:2,tone:`violet`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`violet`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`violet`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`violet`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`violet`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`violet`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`violet`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`violet`,opacity:.22}],o={violet:`bg-violet`,primary:`bg-primary`,pending:`bg-pending`};function s({className:e}){return(0,n.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:t(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,e),children:a.map((e,r)=>(0,n.jsx)(`span`,{className:t(`absolute rounded-[1px] motion-safe:animate-pulse`,e.size===3?`size-[3px]`:`size-0.5`,o[e.tone]),style:{top:e.top,left:e.left,opacity:e.opacity,animationDuration:`3.5s`,animationDelay:`${r%5*700}ms`}},r))})}export{s as n,i as t};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-Br_dqwn-.js";var n=e(),r={primary:`border-primary/25 bg-primary/15 text-primary`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function i({icon:e,tone:i=`neutral`,title:a,subtitle:o,children:c,actions:l,backdrop:u=!1,heading:d=`h1`,className:f}){return(0,n.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":i,className:t(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,f),children:[u?(0,n.jsx)(s,{}):null,(0,n.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,n.jsx)(`div`,{"data-slot":`centered-state-tile`,className:t(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,r[i]),children:e}),(0,n.jsx)(d,{className:`text-2xl font-semibold text-balance text-foreground`,children:a}),o?(0,n.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:o}):null,c?(0,n.jsx)(`div`,{className:`w-full pt-2`,children:c}):null,l?(0,n.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:l}):null]})]})}var a=[{top:`6%`,left:`14%`,size:2,tone:`violet`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`violet`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`violet`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`violet`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`violet`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`violet`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`violet`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`violet`,opacity:.22}],o={violet:`bg-violet`,primary:`bg-primary`,pending:`bg-pending`};function s({className:e}){return(0,n.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:t(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,e),children:a.map((e,r)=>(0,n.jsx)(`span`,{className:t(`absolute rounded-[1px] motion-safe:animate-pulse`,e.size===3?`size-[3px]`:`size-0.5`,o[e.tone]),style:{top:e.top,left:e.left,opacity:e.opacity,animationDuration:`3.5s`,animationDelay:`${r%5*700}ms`}},r))})}export{s as n,i as t};
@@ -0,0 +1 @@
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./preload-helper-Czpn1I53.js";var r=e(t(),1),i=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,a=/^[\\/]{2}/;function o(e,t){return t+e.replace(/\\/g,`/`)}var s=`popstate`;function c(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function l(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return m(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:h(t)}return _(t,n,null,e)}function u(e,t){if(e===!1||e==null)throw Error(t)}function d(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function f(){return Math.random().toString(36).substring(2,10)}function p(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function m(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?g(t):t,state:n,key:t&&t.key||r||f(),mask:i}}function h({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function g(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function _(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=`POP`,u=null,d=f();d??(d=0,o.replaceState({...o.state,idx:d},``));function f(){return(o.state||{idx:null}).idx}function h(){l=`POP`;let e=f(),t=e==null?null:e-d;d=e,u&&u({action:l,location:b.location,delta:t})}function g(e,t){l=`PUSH`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f()+1;let s=p(r,d),h=b.createHref(r.mask||r);try{o.pushState(s,``,h)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(h)}a&&u&&u({action:l,location:b.location,delta:1})}function _(e,t){l=`REPLACE`;let r=c(e)?e:m(b.location,e,t);n&&n(r,e),d=f();let i=p(r,d),s=b.createHref(r.mask||r);o.replaceState(i,``,s),a&&u&&u({action:l,location:b.location,delta:0})}function y(e){return v(i,e)}let b={get action(){return l},get location(){return e(i,o)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(s,h),u=e,()=>{i.removeEventListener(s,h),u=null}},createHref(e){return t(i,e)},createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:_,go(e){return o.go(e)}};return b}function v(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),u(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:h(t);return i=i.replace(/ $/,`%20`),!n&&a.test(i)&&(i=r+i),new URL(i,r)}function y(e,t,n=`/`){return b(e,t,n,!1)}function b(e,t,n,r,i){let a=k((typeof t==`string`?g(t):t).pathname||`/`,n);if(a==null)return null;let o=i??S(e),s=null,c=ue(a);for(let e=0;s==null&&e<o.length;++e)s=se(o[e],c,r);return s}function x(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function S(e){let t=C(e);return T(t),t}function C(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;u(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=j([r,c.relativePath]),d=n.concat(c);e.children&&e.children.length>0&&(u(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),C(e.children,t,d,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ae(l,e.index),routesMeta:d.map((e,t)=>{let[n,r]=le(e.relativePath,e.caseSensitive,t===d.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of w(e.path))a(e,t,!0,n)}),t}function w(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=w(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function T(e){e.sort((e,t)=>e.score===t.score?oe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ee=/^:[\w-]+$/,te=3,ne=2,re=1,E=10,D=-2,ie=e=>e===`*`;function ae(e,t){let n=e.split(`/`),r=n.length;return n.some(ie)&&(r+=D),t&&(r+=ne),n.filter(e=>!ie(e)).reduce((e,t)=>e+(ee.test(t)?te:t===``?re:E),r)}function oe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function se(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ce(u,l,s.matcher,s.compiledParams):O(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=O({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:j([a,d.pathname]),pathnameBase:_e(j([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=j([a,d.pathnameBase]))}return o}function O(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=le(e.path,e.caseSensitive,e.end);return ce(e,t,n,r)}function ce(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function le(e,t=!1,n=!0){d(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ue(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return d(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function k(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function de(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?g(e):e,a;return n?(n=ge(n),a=n.startsWith(`/`)?fe(n.substring(1),`/`):fe(n,t)):a=t,{pathname:a,search:ve(r),hash:ye(i)}}function fe(e,t){let n=M(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function pe(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function me(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function he(e){let t=me(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function A(e,t,n,r=!1){let i;typeof e==`string`?i=g(e):(i={...e},u(!i.pathname||!i.pathname.includes(`?`),pe(`?`,`pathname`,`search`,i)),u(!i.pathname||!i.pathname.includes(`#`),pe(`#`,`pathname`,`hash`,i)),u(!i.search||!i.search.includes(`#`),pe(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=de(i,s),l=o&&o!==`/`&&o.endsWith(`/`),d=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||d)&&(c.pathname+=`/`),c}var ge=e=>e.replace(/[\\/]{2,}/g,`/`),j=e=>ge(e.join(`/`)),M=e=>e.replace(/\/+$/,``),_e=e=>M(e).replace(/^\/*/,`/`),ve=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ye=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,be=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function xe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Se(e){return j(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ce=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function we(e,t){let n=e;if(typeof n!=`string`||!i.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(Ce)try{let e=new URL(window.location.href),r=a.test(n)?new URL(o(n,e.protocol)):new URL(n),i=k(r.pathname,t);r.origin===e.origin&&i!=null?n=i+r.search+r.hash:s=!0}catch{d(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Te=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Te);var Ee=[`GET`,...Te];new Set(Ee);var De=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Oe(e){try{return De.includes(new URL(e).protocol)}catch{return!1}}var N=r.createContext(null);N.displayName=`DataRouter`;var P=r.createContext(null);P.displayName=`DataRouterState`;var ke=r.createContext(!1);function Ae(){return r.useContext(ke)}var je=r.createContext({isTransitioning:!1});je.displayName=`ViewTransition`;var Me=r.createContext(new Map);Me.displayName=`Fetchers`;var Ne=r.createContext(null);Ne.displayName=`Await`;var F=r.createContext(null);F.displayName=`Navigation`;var I=r.createContext(null);I.displayName=`Location`;var L=r.createContext({outlet:null,matches:[],isDataRoute:!1});L.displayName=`Route`;var R=r.createContext(null);R.displayName=`RouteError`;var Pe=`REACT_ROUTER_ERROR`,Fe=`REDIRECT`,Ie=`ROUTE_ERROR_RESPONSE`;function Le(e){if(e.startsWith(`${Pe}:${Fe}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Re(e){if(e.startsWith(`${Pe}:${Ie}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new be(t.status,t.statusText,t.data)}catch{}}function ze(e,{relative:t}={}){u(z(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:i}=r.useContext(F),{hash:a,pathname:o,search:s}=H(e,{relative:t}),c=o;return n!==`/`&&(c=o===`/`?n:j([n,o])),i.createHref({pathname:c,search:s,hash:a})}function z(){return r.useContext(I)!=null}function B(){return u(z(),`useLocation() may be used only in the context of a <Router> component.`),r.useContext(I).location}function Be(){return r.useContext(I).navigationType}var Ve=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function He(e){r.useContext(F).static||r.useLayoutEffect(e)}function V(){let{isDataRoute:e}=r.useContext(L);return e?ct():Ue()}function Ue(){u(z(),`useNavigate() may be used only in the context of a <Router> component.`);let e=r.useContext(N),{basename:t,navigator:n}=r.useContext(F),{matches:i}=r.useContext(L),{pathname:a}=B(),o=JSON.stringify(he(i)),s=r.useRef(!1);return He(()=>{s.current=!0}),r.useCallback((r,i={})=>{if(d(s.current,Ve),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=A(r,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:j([t,c.pathname])),(i.replace?n.replace:n.push)(c,i.state,i)},[t,n,o,a,e])}var We=r.createContext(null);function Ge(e){let t=r.useContext(L).outlet;return r.useMemo(()=>t&&r.createElement(We.Provider,{value:e},t),[t,e])}function Ke(){let{matches:e}=r.useContext(L);return e[e.length-1]?.params??{}}function H(e,{relative:t}={}){let{matches:n}=r.useContext(L),{pathname:i}=B(),a=JSON.stringify(he(n));return r.useMemo(()=>A(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function qe(e,t){return Je(e,t)}function Je(e,t,n){u(z(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=r.useContext(F),{matches:a}=r.useContext(L),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,f=o&&o.route;{let e=f&&f.path||``;ut(c,!f||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let p=B(),m;if(t){let e=typeof t==`string`?g(t):t;u(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),m=e}else m=p;let h=m.pathname||`/`,_=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);_=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let v=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):y(e,{pathname:_});d(f||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),d(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=et(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:j([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:j([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,n);return t&&b?r.createElement(I.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...m},navigationType:`POP`}},b):b}function Ye(){let e=st(),t=xe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=r.createElement(r.Fragment,null,r.createElement(`p`,null,`💿 Hey developer 👋`),r.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,r.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,r.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),r.createElement(r.Fragment,null,r.createElement(`h2`,null,`Unexpected Application Error!`),r.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?r.createElement(`pre`,{style:a},n):null,s)}var Xe=r.createElement(Ye,null),Ze=class extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Re(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:r.createElement(L.Provider,{value:this.props.routeContext},r.createElement(R.Provider,{value:e,children:this.props.component}));return this.context?r.createElement(Qe,{error:e},t):t}};Ze.contextType=ke;var U=new WeakMap;function Qe({children:e,error:t}){let{basename:n}=r.useContext(F);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Le(t.digest);if(e){let i=U.get(t);if(i)throw i;let a=we(e.location,n),o=a.absoluteURL||a.to;if(Oe(o))throw Error(`Invalid redirect location`);if(Ce&&!U.get(t))if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw U.set(t,n),n}return r.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function $e({routeContext:e,match:t,children:n}){let i=r.useContext(N);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),r.createElement(L.Provider,{value:e},n)}function et(e,t=[],n){let i=n?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);u(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=n?.onError,d=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Se(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,n,l)=>{let u,f=!1,p=null,m=null;i&&(u=o&&n.route.id?o[n.route.id]:void 0,p=n.route.errorElement||Xe,s&&(c<0&&l===0?(ut(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=u?p:f?m:n.route.Component?r.createElement(n.route.Component,null):n.route.element?n.route.element:e,r.createElement($e,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?r.createElement(Ze,{location:i.location,revalidation:i.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:d}):g()},null)}function W(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tt(e){let t=r.useContext(N);return u(t,W(e)),t}function nt(e){let t=r.useContext(P);return u(t,W(e)),t}function rt(e){let t=r.useContext(L);return u(t,W(e)),t}function G(e){let t=rt(e),n=t.matches[t.matches.length-1];return u(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function it(){return G(`useRouteId`)}function at(){let e=nt(`useNavigation`);return r.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function ot(){let{matches:e,loaderData:t}=nt(`useMatches`);return r.useMemo(()=>e.map(e=>x(e,t)),[e,t])}function st(){let e=r.useContext(R),t=nt(`useRouteError`),n=G(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ct(){let{router:e}=tt(`useNavigate`),t=G(`useNavigate`),n=r.useRef(!1);return He(()=>{n.current=!0}),r.useCallback(async(r,i={})=>{d(n.current,Ve),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var lt={};function ut(e,t,n){!t&&!lt[e]&&(lt[e]=!0,d(!1,n))}r.memo(dt);function dt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Je(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function ft({to:e,replace:t,state:n,relative:i}){u(z(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=r.useContext(F);d(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=r.useContext(L),{pathname:s}=B(),c=V(),l=A(e,he(o),s,i===`path`),f=JSON.stringify(l);return r.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:i})},[c,f,i,t,n]),null}function pt(e){return Ge(e.context)}function mt(e){u(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function ht({basename:e=`/`,children:t=null,location:n,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){u(!z(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=r.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof n==`string`&&(n=g(n));let{pathname:f=`/`,search:p=``,hash:m=``,state:h=null,key:_=`default`,mask:v}=n,y=r.useMemo(()=>{let e=k(f,c);return e==null?null:{location:{pathname:e,search:p,hash:m,state:h,key:_,mask:v},navigationType:i}},[c,f,p,m,h,_,i,v]);return d(y!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:r.createElement(F.Provider,{value:l},r.createElement(I.Provider,{children:t,value:y}))}function gt({children:e,location:t}){return qe(_t(e),t)}r.Component;function _t(e,t=[]){let n=[];return r.Children.forEach(e,(e,i)=>{if(!r.isValidElement(e))return;let a=[...t,i];if(e.type===r.Fragment){n.push.apply(n,_t(e.props.children,a));return}u(e.type===mt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),u(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let o={id:e.props.id||a.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=_t(e.props.children,a)),n.push(o)}),n}var K=`get`,q=`application/x-www-form-urlencoded`;function J(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function vt(e){return J(e)&&e.tagName.toLowerCase()===`button`}function yt(e){return J(e)&&e.tagName.toLowerCase()===`form`}function bt(e){return J(e)&&e.tagName.toLowerCase()===`input`}function xt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function St(e,t){return e.button===0&&(!t||t===`_self`)&&!xt(e)}function Ct(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function wt(e,t){let n=Ct(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Y=null;function Tt(){if(Y===null)try{new FormData(document.createElement(`form`),0),Y=!1}catch{Y=!0}return Y}var Et=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Dt(e){return e!=null&&!Et.has(e)?(d(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${q}"`),null):e}function Ot(e,t){let n,r,i,a,o;if(yt(e)){let o=e.getAttribute(`action`);r=o?k(o,t):null,n=e.getAttribute(`method`)||K,i=Dt(e.getAttribute(`enctype`))||q,a=new FormData(e)}else if(vt(e)||bt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?k(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||K,i=Dt(e.getAttribute(`formenctype`))||Dt(o.getAttribute(`enctype`))||q,a=new FormData(o,e),!Tt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(J(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=K,r=null,i=q,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var kt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},At=/[&><\u2028\u2029]/g;function jt(e){return e.replace(At,e=>kt[e])}function Mt(e,t){if(e===!1||e==null)throw Error(t)}function Nt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&k(i.pathname,t)===`/`?i.pathname=`${M(t)}/_root.${r}`:i.pathname=`${M(i.pathname)}.${r}`,i}async function Pt(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ft(e){return e!=null&&typeof e.page==`string`}function It(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Lt(e,t,n){return Ht((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Pt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(It).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Rt(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function zt(e,t,{includeHydrateFallback:n}={}){return Bt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Bt(e){return[...new Set(e)]}function Vt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Ht(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ft(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Vt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ut(){let e=r.useContext(N);return Mt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Wt(){let e=r.useContext(P);return Mt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var X=r.createContext(void 0);X.displayName=`FrameworkContext`;function Z(){let e=r.useContext(X);return Mt(e,`You must render this element inside a <HydratedRouter> element`),e}function Gt(e,t){let n=r.useContext(X),[i,a]=r.useState(!1),[o,s]=r.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=r.useRef(null);r.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),r.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return n?e===`intent`?[o,p,{onFocus:Q(c,m),onBlur:Q(l,h),onMouseEnter:Q(u,m),onMouseLeave:Q(d,h),onTouchStart:Q(f,m)}]:[o,p,{}]:[!1,p,{}]}function Q(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Kt({page:e,...t}){let n=Ae(),{nonce:i}=Z(),{router:a}=Ut(),o=r.useMemo(()=>y(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),n?r.createElement(Jt,{page:e,matches:o,...t}):r.createElement(Yt,{page:e,matches:o,...t})):null}function qt(e){let{manifest:t,routeModules:n}=Z(),[i,a]=r.useState([]);return r.useEffect(()=>{let r=!1;return Lt(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),i}function Jt({page:e,matches:t,...n}){let i=B(),{future:a}=Z(),{basename:o}=Ut(),s=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Nt(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,i,t]);return r.createElement(r.Fragment,null,s.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Yt({page:e,matches:t,...n}){let i=B(),{future:a,manifest:o,routeModules:s}=Z(),{basename:c}=Ut(),{loaderData:l,matches:u}=Wt(),d=r.useMemo(()=>Rt(e,t,u,o,i,`data`),[e,t,u,o,i]),f=r.useMemo(()=>Rt(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=Nt(e,c,a.v8_trailingSlashAwareDataRequests,`data`);return r&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.v8_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=r.useMemo(()=>zt(f,o),[f,o]),h=qt(f);return r.createElement(r.Fragment,null,p.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>r.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>r.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Xt(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}r.Component;var Zt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Zt&&(window.__reactRouterVersion=`7.18.1`)}catch{}function Qt({basename:e,children:t,useTransitions:n,window:i}){let a=r.useRef();a.current??=l({window:i,v5Compat:!0});let o=a.current,[s,c]=r.useState({action:o.action,location:o.location}),u=r.useCallback(e=>{n===!1?c(e):r.startTransition(()=>c(e))},[n]);return r.useLayoutEffect(()=>o.listen(u),[o,u]),r.createElement(ht,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,useTransitions:n})}function $t({basename:e,children:t,history:n,useTransitions:i}){let[a,o]=r.useState({action:n.action,location:n.location}),s=r.useCallback(e=>{i===!1?o(e):r.startTransition(()=>o(e))},[i]);return r.useLayoutEffect(()=>n.listen(s),[n,s]),r.createElement(ht,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:n,useTransitions:i})}$t.displayName=`unstable_HistoryRouter`;var en=r.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:a,reloadDocument:o,replace:s,mask:c,state:l,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=r.useContext(F),b=typeof d==`string`&&i.test(d),x=we(d,_);d=x.to;let S=ze(d,{relative:a}),C=B(),w=null;if(c){let e=A(c,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:j([_,e.pathname])),w=v.createHref(e)}let[T,ee,te]=Gt(n,h),ne=cn(d,{replace:s,mask:c,state:l,target:u,preventScrollReset:f,relative:a,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function re(t){e&&e(t),t.defaultPrevented||ne(t)}let E=!(x.isExternal||o),D=r.createElement(`a`,{...h,...te,href:(E?w:void 0)||x.absoluteURL||S,onClick:E?re:e,ref:Xt(g,ee),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?r.createElement(r.Fragment,null,D,r.createElement(Kt,{page:S})):D});en.displayName=`Link`;var tn=r.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=H(o,{relative:l.relative}),f=B(),p=r.useContext(P),{navigator:m,basename:h}=r.useContext(F),g=p!=null&&vn(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=k(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof a==`function`?a(C):a;return r.createElement(en,{...l,"aria-current":w,className:T,ref:u,style:ee,to:o,viewTransition:s},typeof c==`function`?c(C):c)});tn.displayName=`NavLink`;var nn=r.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:a,replace:o,state:s,method:c=K,action:l,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=r.useContext(F),v=fn(),y=pn(l,{relative:d}),b=c.toLowerCase()===`get`?`get`:`post`,x=typeof l==`string`&&i.test(l);return r.createElement(`form`,{ref:g,method:b,action:y,onSubmit:a?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,a=i?.getAttribute(`formmethod`)||c,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:a,navigate:n,replace:o,state:s,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?r.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});nn.displayName=`Form`;function rn({getKey:e,storageKey:t,...n}){let i=r.useContext(X),{basename:a}=r.useContext(F),o=B(),s=ot();gn({getKey:e,storageKey:t});let c=r.useMemo(()=>{if(!i||!e)return null;let t=hn(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&i?.nonce&&(n.nonce=i.nonce),r.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${jt(JSON.stringify(t||mn))}, ${jt(JSON.stringify(c))})`}})}rn.displayName=`ScrollRestoration`;function an(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function on(e){let t=r.useContext(N);return u(t,an(e)),t}function sn(e){let t=r.useContext(P);return u(t,an(e)),t}function cn(e,{target:t,replace:n,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=V(),f=B(),p=H(e,{relative:s});return r.useCallback(m=>{if(St(m,t)){m.preventDefault();let t=n===void 0?h(f)===h(p):n,g=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?r.startTransition(()=>g()):g()}},[f,d,p,n,i,a,t,e,o,s,c,l,u])}function ln(e){d(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=r.useRef(Ct(e)),n=r.useRef(!1),i=B(),a=r.useMemo(()=>wt(i.search,n.current?null:t.current),[i.search]),o=V();return[a,r.useCallback((e,t)=>{let r=Ct(typeof e==`function`?e(new URLSearchParams(a)):e);n.current=!0,o(`?`+r,t)},[o,a])]}var un=0,dn=()=>`__${String(++un)}__`;function fn(){let{router:e}=on(`useSubmit`),{basename:t}=r.useContext(F),n=it(),i=e.fetch,a=e.navigate;return r.useCallback(async(e,r={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ot(e,t);if(r.navigate===!1){let e=r.fetcherKey||dn();await i(e,n,r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,flushSync:r.flushSync})}else await a(r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:n,flushSync:r.flushSync,viewTransition:r.viewTransition})},[i,a,t,n])}function pn(e,{relative:t}={}){let{basename:n}=r.useContext(F),i=r.useContext(L);u(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...H(e||`.`,{relative:t})},s=B();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(o.pathname=o.pathname===`/`?n:j([n,o.pathname])),h(o)}var mn=`react-router-scroll-positions`,$={};function hn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:k(e.pathname,n)||e.pathname},t)),i??=e.key,i}function gn({getKey:e,storageKey:t}={}){let{router:n}=on(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=sn(`useScrollRestoration`),{basename:o}=r.useContext(F),s=B(),c=ot(),l=at();r.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),_n(r.useCallback(()=>{if(l.state===`idle`){let t=hn(s,c,o,e);$[t]=window.scrollY}try{sessionStorage.setItem(t||mn,JSON.stringify($))}catch(e){d(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(r.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||mn);e&&($=JSON.parse(e))}catch{}},[t]),r.useLayoutEffect(()=>{let t=n?.enableScrollRestoration($,()=>window.scrollY,e?(t,n)=>hn(t,n,o,e):void 0);return()=>t&&t()},[n,o,e]),r.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{d(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function _n(e,t){let{capture:n}=t||{};r.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function vn(e,{relative:t}={}){let n=r.useContext(je);u(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=on(`useViewTransitionState`),a=H(e,{relative:t});if(!n.isTransitioning)return!1;let o=k(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=k(n.nextLocation.pathname,i)||n.nextLocation.pathname;return O(a.pathname,s)!=null||O(a.pathname,o)!=null}export{pt as a,O as c,Be as d,Ke as f,ft as i,B as l,en as n,mt as o,ln as p,tn as r,gt as s,Qt as t,V as u};
@@ -1 +1 @@
1
- import{N as e}from"./button-BrxohNcK.js";var t=e(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);export{t};
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{N as e}from"./button-BqkA8Ovk.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};