@agent-relay/dashboard-server 2.0.82 → 2.0.84

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 (393) hide show
  1. package/dist/index.d.ts +3 -21
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +3 -23
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/attachment-storage.d.ts +10 -0
  6. package/dist/lib/attachment-storage.d.ts.map +1 -0
  7. package/dist/lib/attachment-storage.js +53 -0
  8. package/dist/lib/attachment-storage.js.map +1 -0
  9. package/dist/lib/broadcast.d.ts +18 -0
  10. package/dist/lib/broadcast.d.ts.map +1 -0
  11. package/dist/lib/broadcast.js +118 -0
  12. package/dist/lib/broadcast.js.map +1 -0
  13. package/dist/lib/channel-state.d.ts +32 -0
  14. package/dist/lib/channel-state.d.ts.map +1 -0
  15. package/dist/lib/channel-state.js +146 -0
  16. package/dist/lib/channel-state.js.map +1 -0
  17. package/dist/lib/cli-auth.d.ts +40 -0
  18. package/dist/lib/cli-auth.d.ts.map +1 -0
  19. package/dist/lib/cli-auth.js +144 -0
  20. package/dist/lib/cli-auth.js.map +1 -0
  21. package/dist/lib/cloud-persistence.d.ts +6 -0
  22. package/dist/lib/cloud-persistence.d.ts.map +1 -0
  23. package/dist/lib/cloud-persistence.js +130 -0
  24. package/dist/lib/cloud-persistence.js.map +1 -0
  25. package/dist/lib/data-assembly.d.ts +136 -0
  26. package/dist/lib/data-assembly.d.ts.map +1 -0
  27. package/dist/lib/data-assembly.js +550 -0
  28. package/dist/lib/data-assembly.js.map +1 -0
  29. package/dist/lib/file-search.d.ts +8 -0
  30. package/dist/lib/file-search.d.ts.map +1 -0
  31. package/dist/lib/file-search.js +90 -0
  32. package/dist/lib/file-search.js.map +1 -0
  33. package/dist/lib/identity.d.ts +54 -0
  34. package/dist/lib/identity.d.ts.map +1 -0
  35. package/dist/lib/identity.js +124 -0
  36. package/dist/lib/identity.js.map +1 -0
  37. package/dist/lib/log-line-cleaner.d.ts +20 -0
  38. package/dist/lib/log-line-cleaner.d.ts.map +1 -0
  39. package/dist/lib/log-line-cleaner.js +117 -0
  40. package/dist/lib/log-line-cleaner.js.map +1 -0
  41. package/dist/lib/log-reader.d.ts +14 -0
  42. package/dist/lib/log-reader.d.ts.map +1 -0
  43. package/dist/lib/log-reader.js +80 -0
  44. package/dist/lib/log-reader.js.map +1 -0
  45. package/dist/lib/message-id.d.ts +30 -0
  46. package/dist/lib/message-id.d.ts.map +1 -0
  47. package/dist/lib/message-id.js +50 -0
  48. package/dist/lib/message-id.js.map +1 -0
  49. package/dist/lib/process-metrics.d.ts +11 -0
  50. package/dist/lib/process-metrics.d.ts.map +1 -0
  51. package/dist/lib/process-metrics.js +252 -0
  52. package/dist/lib/process-metrics.js.map +1 -0
  53. package/dist/lib/proxy-route-table.d.ts +16 -0
  54. package/dist/lib/proxy-route-table.d.ts.map +1 -0
  55. package/dist/lib/proxy-route-table.js +73 -0
  56. package/dist/lib/proxy-route-table.js.map +1 -0
  57. package/dist/lib/send-strategy.d.ts +61 -0
  58. package/dist/lib/send-strategy.d.ts.map +1 -0
  59. package/dist/lib/send-strategy.js +134 -0
  60. package/dist/lib/send-strategy.js.map +1 -0
  61. package/dist/lib/server-state.d.ts +115 -0
  62. package/dist/lib/server-state.d.ts.map +1 -0
  63. package/dist/lib/server-state.js +138 -0
  64. package/dist/lib/server-state.js.map +1 -0
  65. package/dist/lib/spawned-agents.d.ts +35 -0
  66. package/dist/lib/spawned-agents.d.ts.map +1 -0
  67. package/dist/lib/spawned-agents.js +323 -0
  68. package/dist/lib/spawned-agents.js.map +1 -0
  69. package/dist/lib/types.d.ts +117 -0
  70. package/dist/lib/types.d.ts.map +1 -0
  71. package/dist/lib/types.js +12 -0
  72. package/dist/lib/types.js.map +1 -0
  73. package/dist/lib/utils.d.ts +71 -0
  74. package/dist/lib/utils.d.ts.map +1 -0
  75. package/dist/lib/utils.js +332 -0
  76. package/dist/lib/utils.js.map +1 -0
  77. package/dist/lib/websocket-runtime.d.ts +17 -0
  78. package/dist/lib/websocket-runtime.d.ts.map +1 -0
  79. package/dist/lib/websocket-runtime.js +76 -0
  80. package/dist/lib/websocket-runtime.js.map +1 -0
  81. package/dist/mocks/fixtures.d.ts +2 -2
  82. package/dist/mocks/fixtures.js +1 -1
  83. package/dist/mocks/routes.d.ts.map +1 -1
  84. package/dist/mocks/routes.js +30 -3
  85. package/dist/mocks/routes.js.map +1 -1
  86. package/dist/mocks/types.d.ts +1 -1
  87. package/dist/mocks/types.js +1 -1
  88. package/dist/proxy-server.d.ts +7 -33
  89. package/dist/proxy-server.d.ts.map +1 -1
  90. package/dist/proxy-server.js +292 -200
  91. package/dist/proxy-server.js.map +1 -1
  92. package/dist/relaycast-provider-helpers.d.ts +40 -0
  93. package/dist/relaycast-provider-helpers.d.ts.map +1 -0
  94. package/dist/relaycast-provider-helpers.js +284 -0
  95. package/dist/relaycast-provider-helpers.js.map +1 -0
  96. package/dist/relaycast-provider-types.d.ts +116 -0
  97. package/dist/relaycast-provider-types.d.ts.map +1 -0
  98. package/dist/relaycast-provider-types.js +6 -0
  99. package/dist/relaycast-provider-types.js.map +1 -0
  100. package/dist/relaycast-provider.d.ts +42 -0
  101. package/dist/relaycast-provider.d.ts.map +1 -0
  102. package/dist/relaycast-provider.js +277 -0
  103. package/dist/relaycast-provider.js.map +1 -0
  104. package/dist/routes/agents.d.ts +7 -0
  105. package/dist/routes/agents.d.ts.map +1 -0
  106. package/dist/routes/agents.js +180 -0
  107. package/dist/routes/agents.js.map +1 -0
  108. package/dist/routes/auth.d.ts +45 -0
  109. package/dist/routes/auth.d.ts.map +1 -0
  110. package/dist/routes/auth.js +261 -0
  111. package/dist/routes/auth.js.map +1 -0
  112. package/dist/routes/broker-proxy.d.ts +7 -0
  113. package/dist/routes/broker-proxy.d.ts.map +1 -0
  114. package/dist/routes/broker-proxy.js +114 -0
  115. package/dist/routes/broker-proxy.js.map +1 -0
  116. package/dist/routes/channels-integrated.d.ts +84 -0
  117. package/dist/routes/channels-integrated.d.ts.map +1 -0
  118. package/dist/routes/channels-integrated.js +644 -0
  119. package/dist/routes/channels-integrated.js.map +1 -0
  120. package/dist/routes/channels.d.ts +7 -0
  121. package/dist/routes/channels.d.ts.map +1 -0
  122. package/dist/routes/channels.js +453 -0
  123. package/dist/routes/channels.js.map +1 -0
  124. package/dist/routes/data.d.ts +7 -0
  125. package/dist/routes/data.d.ts.map +1 -0
  126. package/dist/routes/data.js +108 -0
  127. package/dist/routes/data.js.map +1 -0
  128. package/dist/routes/decisions.d.ts +31 -0
  129. package/dist/routes/decisions.d.ts.map +1 -0
  130. package/dist/routes/decisions.js +109 -0
  131. package/dist/routes/decisions.js.map +1 -0
  132. package/dist/routes/fleet.d.ts +24 -0
  133. package/dist/routes/fleet.d.ts.map +1 -0
  134. package/dist/routes/fleet.js +131 -0
  135. package/dist/routes/fleet.js.map +1 -0
  136. package/dist/routes/health.d.ts +7 -0
  137. package/dist/routes/health.d.ts.map +1 -0
  138. package/dist/routes/health.js +55 -0
  139. package/dist/routes/health.js.map +1 -0
  140. package/dist/routes/history-relaycast.d.ts +8 -0
  141. package/dist/routes/history-relaycast.d.ts.map +1 -0
  142. package/dist/routes/history-relaycast.js +165 -0
  143. package/dist/routes/history-relaycast.js.map +1 -0
  144. package/dist/routes/history.d.ts +13 -0
  145. package/dist/routes/history.d.ts.map +1 -0
  146. package/dist/routes/history.js +205 -0
  147. package/dist/routes/history.js.map +1 -0
  148. package/dist/routes/messaging.d.ts +31 -0
  149. package/dist/routes/messaging.d.ts.map +1 -0
  150. package/dist/routes/messaging.js +182 -0
  151. package/dist/routes/messaging.js.map +1 -0
  152. package/dist/routes/metrics.d.ts +26 -0
  153. package/dist/routes/metrics.d.ts.map +1 -0
  154. package/dist/routes/metrics.js +276 -0
  155. package/dist/routes/metrics.js.map +1 -0
  156. package/dist/routes/reactions.d.ts +9 -0
  157. package/dist/routes/reactions.d.ts.map +1 -0
  158. package/dist/routes/reactions.js +76 -0
  159. package/dist/routes/reactions.js.map +1 -0
  160. package/dist/routes/relay-config.d.ts +4 -0
  161. package/dist/routes/relay-config.d.ts.map +1 -0
  162. package/dist/routes/relay-config.js +50 -0
  163. package/dist/routes/relay-config.js.map +1 -0
  164. package/dist/routes/settings.d.ts +6 -0
  165. package/dist/routes/settings.d.ts.map +1 -0
  166. package/dist/routes/settings.js +119 -0
  167. package/dist/routes/settings.js.map +1 -0
  168. package/dist/routes/spawn.d.ts +74 -0
  169. package/dist/routes/spawn.d.ts.map +1 -0
  170. package/dist/routes/spawn.js +520 -0
  171. package/dist/routes/spawn.js.map +1 -0
  172. package/dist/routes/system.d.ts +21 -0
  173. package/dist/routes/system.d.ts.map +1 -0
  174. package/dist/routes/system.js +186 -0
  175. package/dist/routes/system.js.map +1 -0
  176. package/dist/routes/tasks.d.ts +27 -0
  177. package/dist/routes/tasks.d.ts.map +1 -0
  178. package/dist/routes/tasks.js +103 -0
  179. package/dist/routes/tasks.js.map +1 -0
  180. package/dist/routes/ui.d.ts +6 -0
  181. package/dist/routes/ui.d.ts.map +1 -0
  182. package/dist/routes/ui.js +114 -0
  183. package/dist/routes/ui.js.map +1 -0
  184. package/dist/server.d.ts.map +1 -1
  185. package/dist/server.js +337 -6072
  186. package/dist/server.js.map +1 -1
  187. package/dist/services/broker-spawn-reader.d.ts +40 -0
  188. package/dist/services/broker-spawn-reader.d.ts.map +1 -0
  189. package/dist/services/broker-spawn-reader.js +155 -0
  190. package/dist/services/broker-spawn-reader.js.map +1 -0
  191. package/dist/services/health-worker-manager.d.ts +9 -60
  192. package/dist/services/health-worker-manager.d.ts.map +1 -1
  193. package/dist/services/health-worker-manager.js +18 -148
  194. package/dist/services/health-worker-manager.js.map +1 -1
  195. package/dist/services/index.d.ts +3 -3
  196. package/dist/services/index.d.ts.map +1 -1
  197. package/dist/services/index.js +3 -3
  198. package/dist/services/index.js.map +1 -1
  199. package/dist/services/metrics.d.ts +11 -104
  200. package/dist/services/metrics.d.ts.map +1 -1
  201. package/dist/services/metrics.js +21 -190
  202. package/dist/services/metrics.js.map +1 -1
  203. package/dist/services/needs-attention.d.ts +21 -22
  204. package/dist/services/needs-attention.d.ts.map +1 -1
  205. package/dist/services/needs-attention.js +46 -71
  206. package/dist/services/needs-attention.js.map +1 -1
  207. package/dist/services/user-bridge.d.ts +0 -3
  208. package/dist/services/user-bridge.d.ts.map +1 -1
  209. package/dist/services/user-bridge.js +0 -5
  210. package/dist/services/user-bridge.js.map +1 -1
  211. package/dist/start.d.ts +4 -4
  212. package/dist/start.js +96 -89
  213. package/dist/start.js.map +1 -1
  214. package/dist/types/index.d.ts +13 -16
  215. package/dist/types/index.d.ts.map +1 -1
  216. package/dist/websocket/bridge.d.ts +12 -0
  217. package/dist/websocket/bridge.d.ts.map +1 -0
  218. package/dist/websocket/bridge.js +33 -0
  219. package/dist/websocket/bridge.js.map +1 -0
  220. package/dist/websocket/logs.d.ts +30 -0
  221. package/dist/websocket/logs.d.ts.map +1 -0
  222. package/dist/websocket/logs.js +577 -0
  223. package/dist/websocket/logs.js.map +1 -0
  224. package/dist/websocket/main.d.ts +15 -0
  225. package/dist/websocket/main.d.ts.map +1 -0
  226. package/dist/websocket/main.js +84 -0
  227. package/dist/websocket/main.js.map +1 -0
  228. package/dist/websocket/mock.d.ts +6 -0
  229. package/dist/websocket/mock.d.ts.map +1 -0
  230. package/dist/websocket/mock.js +49 -0
  231. package/dist/websocket/mock.js.map +1 -0
  232. package/dist/websocket/presence.d.ts +74 -0
  233. package/dist/websocket/presence.d.ts.map +1 -0
  234. package/dist/websocket/presence.js +330 -0
  235. package/dist/websocket/presence.js.map +1 -0
  236. package/dist/websocket/proxy.d.ts +6 -0
  237. package/dist/websocket/proxy.d.ts.map +1 -0
  238. package/dist/websocket/proxy.js +39 -0
  239. package/dist/websocket/proxy.js.map +1 -0
  240. package/dist/websocket/standalone.d.ts +17 -0
  241. package/dist/websocket/standalone.d.ts.map +1 -0
  242. package/dist/websocket/standalone.js +268 -0
  243. package/dist/websocket/standalone.js.map +1 -0
  244. package/out/404.html +1 -1
  245. package/out/_next/static/chunks/1028-da5d75e35d1420f1.js +1 -0
  246. package/out/_next/static/chunks/1528-78b17000a7e10bc6.js +2 -0
  247. package/out/_next/static/chunks/1695-4a5d33ba715e09b4.js +1 -0
  248. package/out/_next/static/chunks/1705-36c2180d00a4a569.js +1 -0
  249. package/out/_next/static/chunks/1dd3208c-e1f87c7b3dc1a820.js +1 -0
  250. package/out/_next/static/chunks/3663-47290254b8f6f5dd.js +1 -0
  251. package/out/_next/static/chunks/3677-4b225baf4801d9b9.js +73 -0
  252. package/out/_next/static/chunks/5118-7e8ada2df38eef07.js +1 -0
  253. package/out/_next/static/chunks/5888-15cbe97c90ed5fae.js +1 -0
  254. package/out/_next/static/chunks/6773-a45343a98df3abb5.js +1 -0
  255. package/out/_next/static/chunks/6940-b824612b605e79b3.js +9 -0
  256. package/out/_next/static/chunks/7894-f4a15249082a680d.js +1 -0
  257. package/out/_next/static/chunks/9175-b3617c1e5cbfed0e.js +1 -0
  258. package/out/_next/static/chunks/9372-1a804b8d08c7a236.js +1 -0
  259. package/out/_next/static/chunks/{ab6c8a12-0a58072fbb505134.js → ab6c8a12-91438a812d94ecf0.js} +1 -1
  260. package/out/_next/static/chunks/app/_not-found/page-8e8842f82d204726.js +1 -0
  261. package/out/_next/static/chunks/app/about/page-b78577a7da8fa459.js +1 -0
  262. package/out/_next/static/chunks/app/app/[[...slug]]/page-3dffd65b6344f53e.js +1 -0
  263. package/out/_next/static/chunks/app/app/onboarding/page-b89be9aa6264a5e1.js +1 -0
  264. package/out/_next/static/chunks/app/blog/go-to-bed-wake-up-to-a-finished-product/page-fbd00893ef69e499.js +1 -0
  265. package/out/_next/static/chunks/app/blog/let-them-cook-multi-agent-orchestration/page-de2ea13649d0b6d3.js +1 -0
  266. package/out/_next/static/chunks/app/blog/page-a08e263c57a156fa.js +1 -0
  267. package/out/_next/static/chunks/app/careers/page-02228e1d6969b232.js +1 -0
  268. package/out/_next/static/chunks/app/changelog/page-1b5c1d79efc6e53a.js +1 -0
  269. package/out/_next/static/chunks/app/cloud/link/page-99654edffffb3af2.js +1 -0
  270. package/out/_next/static/chunks/app/complete-profile/page-59d146e5ddeafc5c.js +1 -0
  271. package/out/_next/static/chunks/app/connect-repos/page-995e16a976a6632c.js +1 -0
  272. package/out/_next/static/chunks/app/contact/page-273396a5ad57bcee.js +1 -0
  273. package/out/_next/static/chunks/app/dev/cli-tools/page-a71b80dcb2d5fc8d.js +1 -0
  274. package/out/_next/static/chunks/app/dev/log-viewer/page-46a6151ae1be0796.js +1 -0
  275. package/out/_next/static/chunks/app/docs/page-7c7cb603b24b7c40.js +1 -0
  276. package/out/_next/static/chunks/app/history/page-0c5cab1dab4e8886.js +1 -0
  277. package/out/_next/static/chunks/app/layout-96d72ba8ef8a43a0.js +1 -0
  278. package/out/_next/static/chunks/app/login/page-0ccbab34213df842.js +1 -0
  279. package/out/_next/static/chunks/app/metrics/page-8616272aeab9c8b0.js +1 -0
  280. package/out/_next/static/chunks/app/page-09ce10603ad9a251.js +1 -0
  281. package/out/_next/static/chunks/app/pricing/page-91c975079120c941.js +1 -0
  282. package/out/_next/static/chunks/app/privacy/{page-c21d51ac2dee3a88.js → page-a49ab271cc686644.js} +1 -1
  283. package/out/_next/static/chunks/app/providers/{page-59114505f4353512.js → page-d775d6eb5bc29e96.js} +1 -1
  284. package/out/_next/static/chunks/app/providers/setup/[provider]/page-ec4ef3cd80de807e.js +1 -0
  285. package/out/_next/static/chunks/app/security/page-d9da9bd9191e8f95.js +1 -0
  286. package/out/_next/static/chunks/app/signup/page-930eca0bf5fd299d.js +1 -0
  287. package/out/_next/static/chunks/app/terms/page-3e4827620b98613c.js +1 -0
  288. package/out/_next/static/chunks/framework-648e1ae7da590300.js +1 -0
  289. package/out/_next/static/chunks/{main-acb1b24265295d6a.js → main-2b1990080c292d92.js} +1 -1
  290. package/out/_next/static/chunks/main-app-9f6b7ff9e754a8f5.js +1 -0
  291. package/out/_next/static/chunks/pages/_app-a077b72e02273ab1.js +1 -0
  292. package/out/_next/static/chunks/pages/_error-84001666436a04e4.js +1 -0
  293. package/out/_next/static/chunks/{webpack-dd93b81e2659669c.js → webpack-7586035f1585f2db.js} +1 -1
  294. package/out/_next/static/css/eb9fc69d1e3d2bed.css +1 -0
  295. package/out/_next/static/{IxfA6RZu4trcsEMYlkQra → g3G0LMdB7lxcrU5mdM54m}/_buildManifest.js +1 -1
  296. package/out/about.html +2 -2
  297. package/out/about.txt +2 -2
  298. package/out/app/onboarding.html +1 -1
  299. package/out/app/onboarding.txt +2 -2
  300. package/out/app.html +1 -1
  301. package/out/app.txt +2 -2
  302. package/out/blog/go-to-bed-wake-up-to-a-finished-product.html +3 -3
  303. package/out/blog/go-to-bed-wake-up-to-a-finished-product.txt +1 -1
  304. package/out/blog/let-them-cook-multi-agent-orchestration.html +2 -2
  305. package/out/blog/let-them-cook-multi-agent-orchestration.txt +2 -2
  306. package/out/blog.html +2 -2
  307. package/out/blog.txt +1 -1
  308. package/out/careers.html +2 -2
  309. package/out/careers.txt +2 -2
  310. package/out/changelog.html +2 -2
  311. package/out/changelog.txt +2 -2
  312. package/out/cloud/link.html +1 -1
  313. package/out/cloud/link.txt +2 -2
  314. package/out/complete-profile.html +2 -2
  315. package/out/complete-profile.txt +2 -2
  316. package/out/connect-repos.html +1 -1
  317. package/out/connect-repos.txt +2 -2
  318. package/out/contact.html +2 -2
  319. package/out/contact.txt +2 -2
  320. package/out/dev/cli-tools.html +1 -0
  321. package/out/dev/cli-tools.txt +7 -0
  322. package/out/dev/log-viewer.html +23 -0
  323. package/out/dev/log-viewer.txt +7 -0
  324. package/out/docs.html +2 -2
  325. package/out/docs.txt +2 -2
  326. package/out/history.html +1 -1
  327. package/out/history.txt +2 -2
  328. package/out/index.html +1 -1
  329. package/out/index.txt +2 -2
  330. package/out/login.html +2 -2
  331. package/out/login.txt +2 -2
  332. package/out/metrics.html +1 -1
  333. package/out/metrics.txt +2 -2
  334. package/out/pricing.html +2 -2
  335. package/out/pricing.txt +2 -2
  336. package/out/privacy.html +2 -2
  337. package/out/privacy.txt +2 -2
  338. package/out/providers/setup/claude.html +1 -1
  339. package/out/providers/setup/claude.txt +2 -2
  340. package/out/providers/setup/codex.html +1 -1
  341. package/out/providers/setup/codex.txt +2 -2
  342. package/out/providers/setup/cursor.html +1 -1
  343. package/out/providers/setup/cursor.txt +2 -2
  344. package/out/providers.html +1 -1
  345. package/out/providers.txt +2 -2
  346. package/out/security.html +2 -2
  347. package/out/security.txt +2 -2
  348. package/out/signup.html +2 -2
  349. package/out/signup.txt +2 -2
  350. package/out/terms.html +2 -2
  351. package/out/terms.txt +2 -2
  352. package/package.json +10 -11
  353. package/out/_next/static/chunks/11-9a2993a37266dcb3.js +0 -9
  354. package/out/_next/static/chunks/118-ae2b650136a5a5fc.js +0 -1
  355. package/out/_next/static/chunks/1dd3208c-40ab0fc0f60392b8.js +0 -1
  356. package/out/_next/static/chunks/202-fc0763dd7488e58f.js +0 -1
  357. package/out/_next/static/chunks/259-83b77fa1b91ba5aa.js +0 -1
  358. package/out/_next/static/chunks/407-0c82986cf79c8ecb.js +0 -1
  359. package/out/_next/static/chunks/528-f5f676996d613c25.js +0 -2
  360. package/out/_next/static/chunks/663-ddb04081febc3678.js +0 -1
  361. package/out/_next/static/chunks/687-88b6b139a6bb0e2e.js +0 -1
  362. package/out/_next/static/chunks/695-51d25b1988644374.js +0 -1
  363. package/out/_next/static/chunks/773-54a2641043c81e55.js +0 -1
  364. package/out/_next/static/chunks/app/_not-found/page-6da9b72091e5b511.js +0 -1
  365. package/out/_next/static/chunks/app/about/page-fff7c6457683f243.js +0 -1
  366. package/out/_next/static/chunks/app/app/[[...slug]]/page-f7eca1b66fb4249b.js +0 -1
  367. package/out/_next/static/chunks/app/app/onboarding/page-129abc5da2e67971.js +0 -1
  368. package/out/_next/static/chunks/app/blog/go-to-bed-wake-up-to-a-finished-product/page-5d5f28fd126b692f.js +0 -1
  369. package/out/_next/static/chunks/app/blog/let-them-cook-multi-agent-orchestration/page-b194f207fbd91862.js +0 -1
  370. package/out/_next/static/chunks/app/blog/page-b9bd9d8703fca76a.js +0 -1
  371. package/out/_next/static/chunks/app/careers/page-a4bd8d5f4de8f4eb.js +0 -1
  372. package/out/_next/static/chunks/app/changelog/page-9a1f6ad1743d63c5.js +0 -1
  373. package/out/_next/static/chunks/app/cloud/link/page-0844c5699b027c3b.js +0 -1
  374. package/out/_next/static/chunks/app/complete-profile/page-39ed5a67916beb87.js +0 -1
  375. package/out/_next/static/chunks/app/connect-repos/page-297eddee0c39f2a3.js +0 -1
  376. package/out/_next/static/chunks/app/contact/page-3c1dd8690217fade.js +0 -1
  377. package/out/_next/static/chunks/app/docs/page-1875e981f2c3fd13.js +0 -1
  378. package/out/_next/static/chunks/app/history/page-2d5c5695c9e8b40c.js +0 -1
  379. package/out/_next/static/chunks/app/layout-0a4b99656da25511.js +0 -1
  380. package/out/_next/static/chunks/app/login/page-f69c076f5a6fc520.js +0 -1
  381. package/out/_next/static/chunks/app/metrics/page-bebbee055669a17e.js +0 -1
  382. package/out/_next/static/chunks/app/page-0ee604f7070d14c0.js +0 -1
  383. package/out/_next/static/chunks/app/pricing/page-eeae7d594af333b6.js +0 -1
  384. package/out/_next/static/chunks/app/providers/setup/[provider]/page-daf9b3e05e77ae19.js +0 -1
  385. package/out/_next/static/chunks/app/security/page-cd562730fe84a0a2.js +0 -1
  386. package/out/_next/static/chunks/app/signup/page-c242ca08101a84ff.js +0 -1
  387. package/out/_next/static/chunks/app/terms/page-c7001720e7941dc6.js +0 -1
  388. package/out/_next/static/chunks/framework-3664cab31236a9fa.js +0 -1
  389. package/out/_next/static/chunks/main-app-7f73a939a312a228.js +0 -1
  390. package/out/_next/static/chunks/pages/_app-10a93ab5b7c32eb3.js +0 -1
  391. package/out/_next/static/chunks/pages/_error-2d792b2a41857be4.js +0 -1
  392. package/out/_next/static/css/8968d98ed4c4d33f.css +0 -1
  393. /package/out/_next/static/{IxfA6RZu4trcsEMYlkQra → g3G0LMdB7lxcrU5mdM54m}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5118],{5118:function(e,r,t){t.d(r,{$3:function(){return l},J$:function(){return d},XP:function(){return m},_V:function(){return i},api:function(){return h},hc:function(){return u},kG:function(){return w}});let s=(0,t(2446).bR)(),a="agentrelay_workspace_id",o=null,c="agentrelay_csrf_token",n=null;function i(){return n}function u(e){o=e,e?localStorage.setItem(a,e):localStorage.removeItem(a)}function d(){return o}function l(){if(o)return o;{let e=localStorage.getItem(a);if(e)return o=e,e}return null}function w(e){let r=e.startsWith("/")?e:"/".concat(e);return"".concat(s).concat(r)}async function y(e){var r;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=(null===(r=t.method)||void 0===r?void 0:r.toUpperCase())||"GET",a={...t.headers};"GET"!==s&&"HEAD"!==s&&"OPTIONS"!==s&&(n&&(a["X-CSRF-Token"]=n),t.body&&!a["Content-Type"]&&(a["Content-Type"]="application/json"));let o=await fetch(e,{...t,headers:a,credentials:"include"});return!function(e){let r=e.headers.get("X-CSRF-Token");r&&(n=r,window.sessionStorage&&(r?sessionStorage.setItem(c,r):sessionStorage.removeItem(c)))}(o),o}window.sessionStorage&&(n=sessionStorage.getItem(c));let h={async get(e){let r=await y(w(e),{method:"GET"});if(!r.ok)throw Error("HTTP ".concat(r.status,": ").concat(r.statusText));return await r.json()},async post(e,r){let t=await y(w(e),{method:"POST",body:r?JSON.stringify(r):void 0});if(!t.ok)throw Error("HTTP ".concat(t.status,": ").concat(t.statusText));return await t.json()},async patch(e,r){let t=await y(w(e),{method:"PATCH",body:r?JSON.stringify(r):void 0});if(!t.ok)throw Error("HTTP ".concat(t.status,": ").concat(t.statusText));return await t.json()},async delete(e){let r=await y(w(e),{method:"DELETE"});if(!r.ok)throw Error("HTTP ".concat(r.status,": ").concat(r.statusText));return await r.json()},async sendMessage(e){try{let r=await y(w("/api/send"),{method:"POST",body:JSON.stringify(e)}),t=await r.json();if(r.ok&&t.success)return{success:!0,data:{messageId:t.messageId}};return{success:!1,error:t.error||"Failed to send message"}}catch(e){return{success:!1,error:"Network error"}}},async uploadAttachment(e){try{let r,t,s;e instanceof File?(r=e.name,t=e.type,s=await new Promise((r,t)=>{let s=new FileReader;s.onload=()=>r(s.result),s.onerror=t,s.readAsDataURL(e)})):(r=e.filename,t=e.mimeType,s=e.data);let a=await y(w("/api/upload"),{method:"POST",body:JSON.stringify({filename:r,mimeType:t,data:s})}),o=await a.json();if(a.ok&&o.success&&o.attachment)return{success:!0,data:{attachment:o.attachment}};return{success:!1,error:o.error||"Failed to upload attachment"}}catch(e){return{success:!1,error:"Network error"}}},async spawnAgent(e){try{let r=await y(w("/api/spawn"),{method:"POST",body:JSON.stringify(e)});return await r.json()}catch(r){return{success:!1,name:e.name,error:"Network error"}}},async getSpawnedAgents(){try{let e=await y(w("/api/spawned")),r=await e.json();if(e.ok&&r.success)return{success:!0,data:{agents:r.agents||[]}};return{success:!1,error:r.error}}catch(e){return{success:!1,error:"Network error"}}},async releaseAgent(e){try{let r=await y(w("/api/spawned/".concat(encodeURIComponent(e))),{method:"DELETE"}),t=await r.json();if(r.ok&&t.success)return{success:!0};return{success:!1,error:t.error}}catch(e){return{success:!1,error:"Network error"}}},async interruptAgent(e){try{let r=await y(w("/api/agents/by-name/".concat(encodeURIComponent(e),"/interrupt")),{method:"POST"}),t=await r.json();if(r.ok&&t.success)return{success:!0};return{success:!1,error:t.error||"Failed to interrupt agent"}}catch(e){return{success:!1,error:"Network error"}}},async getData(e){try{let r=e||o,t=r?w("/api/data?workspaceId=".concat(encodeURIComponent(r))):w("/api/data"),s=await y(t),a=await s.json();if(s.ok)return{success:!0,data:a};return{success:!1,error:"Failed to fetch data"}}catch(e){return{success:!1,error:"Network error"}}},async getBridgeData(e){try{let r=e||o,t=r?"".concat(s,"/api/bridge?workspaceId=").concat(encodeURIComponent(r)):"".concat(s,"/api/bridge"),a=await y(t),c=await a.json();if(a.ok)return{success:!0,data:c};return{success:!1,error:"Failed to fetch bridge data"}}catch(e){return{success:!1,error:"Network error"}}},async getMetrics(){try{let e=await y(w("/api/metrics")),r=await e.json();if(e.ok)return{success:!0,data:r};return{success:!1,error:"Failed to fetch metrics"}}catch(e){return{success:!1,error:"Network error"}}},async getHistorySessions(e){try{let r=new URLSearchParams;(null==e?void 0:e.agent)&&r.set("agent",e.agent),(null==e?void 0:e.since)&&r.set("since",String(e.since)),(null==e?void 0:e.limit)&&r.set("limit",String(e.limit));let t=await y(w("/api/history/sessions?".concat(r))),s=await t.json();if(t.ok)return{success:!0,data:s};return{success:!1,error:"Failed to fetch sessions"}}catch(e){return{success:!1,error:"Network error"}}},async getHistoryMessages(e){try{let r=new URLSearchParams;(null==e?void 0:e.from)&&r.set("from",e.from),(null==e?void 0:e.to)&&r.set("to",e.to),(null==e?void 0:e.thread)&&r.set("thread",e.thread),(null==e?void 0:e.since)&&r.set("since",String(e.since)),(null==e?void 0:e.limit)&&r.set("limit",String(e.limit)),(null==e?void 0:e.order)&&r.set("order",e.order),(null==e?void 0:e.search)&&r.set("search",e.search);let t=await y(w("/api/history/messages?".concat(r))),s=await t.json();if(t.ok)return{success:!0,data:s};return{success:!1,error:"Failed to fetch messages"}}catch(e){return{success:!1,error:"Network error"}}},async getHistoryConversations(){try{let e=await y(w("/api/history/conversations")),r=await e.json();if(e.ok)return{success:!0,data:r};return{success:!1,error:"Failed to fetch conversations"}}catch(e){return{success:!1,error:"Network error"}}},async getHistoryMessage(e){try{let r=await y(w("/api/history/message/".concat(encodeURIComponent(e)))),t=await r.json();if(r.ok)return{success:!0,data:t};return{success:!1,error:t.error||"Failed to fetch message"}}catch(e){return{success:!1,error:"Network error"}}},async getHistoryStats(){try{let e=await y(w("/api/history/stats")),r=await e.json();if(e.ok)return{success:!0,data:r};return{success:!1,error:"Failed to fetch stats"}}catch(e){return{success:!1,error:"Network error"}}},async searchFiles(e){try{let r=new URLSearchParams;(null==e?void 0:e.query)&&r.set("q",e.query),(null==e?void 0:e.limit)&&r.set("limit",String(e.limit));let t=await y(w("/api/files?".concat(r))),s=await t.json();if(t.ok)return{success:!0,data:s};return{success:!1,error:"Failed to search files"}}catch(e){return{success:!1,error:"Network error"}}},async getDecisions(){try{let e=await y(w("/api/decisions")),r=await e.json();if(e.ok&&r.success)return{success:!0,data:{decisions:r.decisions||[]}};return{success:!1,error:r.error||"Failed to fetch decisions"}}catch(e){return{success:!1,error:"Network error"}}},async approveDecision(e,r,t){try{let s=await y(w("/api/decisions/".concat(encodeURIComponent(e),"/approve")),{method:"POST",body:JSON.stringify({optionId:r,response:t})}),a=await s.json();if(s.ok&&a.success)return{success:!0};return{success:!1,error:a.error||"Failed to approve decision"}}catch(e){return{success:!1,error:"Network error"}}},async rejectDecision(e,r){try{let t=await y(w("/api/decisions/".concat(encodeURIComponent(e),"/reject")),{method:"POST",body:JSON.stringify({reason:r})}),s=await t.json();if(t.ok&&s.success)return{success:!0};return{success:!1,error:s.error||"Failed to reject decision"}}catch(e){return{success:!1,error:"Network error"}}},async dismissDecision(e){try{let r=await y(w("/api/decisions/".concat(encodeURIComponent(e))),{method:"DELETE"}),t=await r.json();if(r.ok&&t.success)return{success:!0};return{success:!1,error:t.error||"Failed to dismiss decision"}}catch(e){return{success:!1,error:"Network error"}}},async getFleetServers(){try{let e=await y(w("/api/fleet/servers")),r=await e.json();if(e.ok&&r.success)return{success:!0,data:{servers:r.servers||[]}};return{success:!1,error:r.error||"Failed to fetch fleet servers"}}catch(e){return{success:!1,error:"Network error"}}},async getFleetStats(){try{let e=await y(w("/api/fleet/stats")),r=await e.json();if(e.ok&&r.success)return{success:!0,data:{stats:r.stats}};return{success:!1,error:r.error||"Failed to fetch fleet stats"}}catch(e){return{success:!1,error:"Network error"}}},async getTasks(e){try{let r=new URLSearchParams;(null==e?void 0:e.status)&&r.set("status",e.status),(null==e?void 0:e.agent)&&r.set("agent",e.agent);let t=await y(w("/api/tasks?".concat(r))),s=await t.json();if(t.ok&&s.success)return{success:!0,data:{tasks:s.tasks||[]}};return{success:!1,error:s.error||"Failed to fetch tasks"}}catch(e){return{success:!1,error:"Network error"}}},async createTask(e){try{let r=await y(w("/api/tasks"),{method:"POST",body:JSON.stringify(e)}),t=await r.json();if(r.ok&&t.success)return{success:!0,data:{task:t.task}};return{success:!1,error:t.error||"Failed to create task"}}catch(e){return{success:!1,error:"Network error"}}},async updateTask(e,r){try{let t=await y(w("/api/tasks/".concat(encodeURIComponent(e))),{method:"PATCH",body:JSON.stringify(r)}),s=await t.json();if(t.ok&&s.success)return{success:!0,data:{task:s.task}};return{success:!1,error:s.error||"Failed to update task"}}catch(e){return{success:!1,error:"Network error"}}},async cancelTask(e){try{let r=await y(w("/api/tasks/".concat(encodeURIComponent(e))),{method:"DELETE"}),t=await r.json();if(r.ok&&t.success)return{success:!0};return{success:!1,error:t.error||"Failed to cancel task"}}catch(e){return{success:!1,error:"Network error"}}},async createBead(e){try{let r=await y(w("/api/beads"),{method:"POST",body:JSON.stringify(e)}),t=await r.json();if(r.ok&&t.success)return{success:!0,data:{bead:t.bead}};return{success:!1,error:t.error||"Failed to create bead"}}catch(e){return{success:!1,error:"Network error"}}},async sendRelayMessage(e){try{let r=await y(w("/api/relay/send"),{method:"POST",body:JSON.stringify(e)}),t=await r.json();if(r.ok&&t.success)return{success:!0,data:{messageId:t.messageId}};return{success:!1,error:t.error||"Failed to send message"}}catch(e){return{success:!1,error:"Network error"}}},async addReaction(e,r){try{let t=await y(w("/api/messages/".concat(encodeURIComponent(e),"/reactions")),{method:"POST",body:JSON.stringify({emoji:r})});if(t.ok)return{success:!0,data:void 0};let s=await t.json();return{success:!1,error:s.error||"Failed to add reaction"}}catch(e){return{success:!1,error:"Network error"}}},async removeReaction(e,r){try{let t=await y(w("/api/messages/".concat(encodeURIComponent(e),"/reactions/").concat(encodeURIComponent(r))),{method:"DELETE"});if(t.ok)return{success:!0,data:void 0};let s=await t.json();return{success:!1,error:s.error||"Failed to remove reaction"}}catch(e){return{success:!1,error:"Network error"}}},async getReactions(e){try{var r;let t=await y(w("/api/messages/".concat(encodeURIComponent(e),"/reactions"))),s=await t.json();if(t.ok)return{success:!0,data:{reactions:null!==(r=s.data)&&void 0!==r?r:[]}};return{success:!1,error:s.error||"Failed to get reactions"}}catch(e){return{success:!1,error:"Network error"}}},async getThread(e,r){try{let s=new URLSearchParams;(null==r?void 0:r.cursor)&&s.set("before",r.cursor),(null==r?void 0:r.limit)&&s.set("limit",String(r.limit));let a=s.toString(),o=await y(w("/api/messages/".concat(encodeURIComponent(e),"/replies").concat(a?"?".concat(a):""))),c=await o.json();if(o.ok&&!1!==c.ok){var t;return{success:!0,data:null!==(t=c.data)&&void 0!==t?t:c}}return{success:!1,error:c.error||"Failed to get thread"}}catch(e){return{success:!1,error:"Network error"}}},async postReply(e,r){try{var t;let s=await y(w("/api/messages/".concat(encodeURIComponent(e),"/replies")),{method:"POST",body:JSON.stringify({text:r})}),a=await s.json();if(s.ok)return{success:!0,data:null!==(t=a.data)&&void 0!==t?t:a};return{success:!1,error:a.error||"Failed to post reply"}}catch(e){return{success:!1,error:"Network error"}}}};function m(e){return{id:e.id,agentName:e.agentName,timestamp:e.createdAt,type:e.category,title:e.title,description:e.description,options:e.options,priority:e.urgency,context:e.context,expiresAt:e.expiresAt}}},2446:function(e,r,t){t.d(r,{HE:function(){return a},bR:function(){return o}});var s=t(4859);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/ws",r=s.env.NEXT_PUBLIC_WS_URL;if(r)return r.endsWith("/")?"".concat(r.slice(0,-1)).concat(e):"".concat(r).concat(e);window.location.hostname;let t="https:"===window.location.protocol?"wss:":"ws:";return"".concat(t,"//").concat(window.location.host).concat(e)}function o(){return s.env.NEXT_PUBLIC_API_URL||""}s.env.NEXT_PUBLIC_DEV_SERVER_PORT}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5888],{5888:function(e,t,i){i.d(t,{ZP:function(){return h}});let s="[nango]";class n{baseURL;debug;swClient;errorHandler;modal;isProcessingMessage=!1;constructor({baseUrl:e,debug:t,webSocketUrl:i,successHandler:s,errorHandler:n}){this.baseURL=e,this.debug=t,this.swClient=new WebSocket(i),this.errorHandler=n,this.swClient.onmessage=e=>{this.isProcessingMessage=!0,this.handleMessage(e,s),this.isProcessingMessage=!1}}setModal(e){this.modal=e}handleMessage(e,t){let i=JSON.parse(e.data);switch(i.message_type){case"connection_ack":this.debug&&console.log(s,"Connection ack received. Opening modal..."),this.baseURL.searchParams.set("ws_client_id",i.ws_client_id),this.open();break;case"error":this.debug&&console.log(s,"Error received. Rejecting authorization..."),this.errorHandler(i.error_type,i.error_desc),this.swClient.close();break;case"success":this.debug&&console.log(s,"Success received. Resolving authorization..."),t({providerConfigKey:i.provider_config_key,connectionId:i.connection_id,isPending:i.is_pending}),this.swClient.close();break;default:this.debug&&console.log(s,"Unknown message type received from Nango server. Ignoring...");return}}open(){if(this.modal&&(this.debug&&console.log(s,"opening",this.baseURL.href),this.modal.location=this.baseURL.href,!this.modal||this.modal.closed||void 0===this.modal.closed)){this.errorHandler("blocked_by_browser","Modal blocked by browser");return}}close(){this.modal&&!this.modal.closed&&(this.modal.close(),delete this.modal),this.swClient.close(),delete this.swClient}}class r{iframe=null;isReady=!1;listener=null;sessionToken;baseURL;apiURL;onEvent;detectClosedAuthWindow;lang;themeOverride;constructor({sessionToken:e,baseURL:t="https://connect.nango.dev",apiURL:i="https://api.nango.dev",detectClosedAuthWindow:s,onEvent:n,lang:r,themeOverride:o}){this.sessionToken=e,this.baseURL=t,this.apiURL=i,this.onEvent=n,this.detectClosedAuthWindow=s,this.lang=r,this.themeOverride=o}open(){this.iframe=this.createIframe(),document.body.append(this.iframe),document.body.style.overflow="hidden",this.setupEventListeners()}createIframe(){let e=new URL(this.baseURL);this.apiURL&&e.searchParams.append("apiURL",this.apiURL),this.detectClosedAuthWindow&&e.searchParams.append("detectClosedAuthWindow",String(this.detectClosedAuthWindow)),this.lang&&e.searchParams.append("lang",this.lang),this.themeOverride&&e.searchParams.append("theme",this.themeOverride);let t=document.createElement("iframe");return t.src=e.href,t.id="connect-ui",t.style.position="fixed",t.style.zIndex="9999",t.style.top="0",t.style.left="0",t.style.right="0",t.style.bottom="0",t.style.width="100vw",t.style.height="100vh",t.style.backgroundColor="transparent",t}setupEventListeners(){this.listener=e=>{if(e.origin!==new URL(this.baseURL).origin||"object"!=typeof e.data||!e.data||!e.data.type)return;let t=e.data;switch(t.type){case"ready":this.isReady=!0,this.sendSessionToken();break;case"close":this.close()}this.onEvent&&this.onEvent(t)},window.addEventListener("message",this.listener,!1)}setSessionToken(e){this.sessionToken=e,this.isReady&&this.sendSessionToken()}close(){this.listener&&window.removeEventListener("message",this.listener),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null,document.body.style.overflow="")}sendSessionToken(){if(!this.sessionToken)return;let e={type:"session_token",sessionToken:this.sessionToken};this.iframe?.contentWindow?.postMessage(e,"*")}}let o="NANGO DEBUG LOG: ";class a extends Error{type;constructor(e,t){super(e),this.type=t}}class h{hostBaseUrl;websocketsBaseUrl;publicKey;connectSessionToken;debug=!1;width=500;height=600;tm=null;win=null;constructor(e={}){e.host=e.host||"https://api.nango.dev",e.websocketsPath=e.websocketsPath||"/",this.debug=e.debug||!1,this.debug&&(console.log(o,"Debug mode is enabled."),console.log(o,`Using host: ${e.host}.`)),e.width&&(this.width=e.width),e.height&&(this.height=e.height),this.hostBaseUrl=e.host.replace(/\/+$/,""),this.publicKey=e.publicKey,this.connectSessionToken=e.connectSessionToken;try{let t=new URL(this.hostBaseUrl),i=new URL(e.websocketsPath,t);this.websocketsBaseUrl=i.toString().replace("https://","wss://").replace("http://","ws://")}catch{throw new a("Invalid URL provided for the Nango host.","invalid_host_url")}}async create(e,t,i){this.ensureCredentials();let s=null,n=i;"string"==typeof t?s=t:n=t;let r=this.hostBaseUrl+`/auth/unauthenticated/${e}${this.toQueryString(s,n)}`;return await this.triggerAuth({authUrl:r})}auth(e,t,i){this.ensureCredentials();let s=null,r=i;if("string"==typeof t?s=t:r={...r,...t},r&&("installation"in r&&"outbound"===r.installation||"credentials"in r&&("token_id"in r.credentials&&"token_secret"in r.credentials||!("oauth_client_id_override"in r.credentials)||!("oauth_client_secret_override"in r.credentials))&&Object.keys(r.credentials).length>0)){let t=r.credentials;if(!t)throw new a("Credentials are required for custom auth","missing_credentials");let{credentials:i,...n}=r;return this.customAuth(e,s,this.convertCredentialsToConfig(t),n,r.installation)}let o=window.open("","_blank",function(e){let t={...e,scrollbars:"yes",resizable:"yes",status:"no",toolbar:"no",location:"no",copyhistory:"no",menubar:"no",directories:"no"},i=[];for(let e in t)i.push(`${e}=${t[e]}`);return i.join(",")}(function({expectedWidth:e,expectedHeight:t}){let i=window.screen.width,s=window.screen.height;return{left:Math.max(i/2-e/2,0),top:Math.max(s/2-t/2,0),width:Math.min(e,i),height:Math.min(t,s)}}({expectedWidth:this.width,expectedHeight:this.height})));return new Promise((t,i)=>{let h;let l=(e,t)=>{i(new a(t,e))};if(this.win&&this.clear(),!o||o.closed||void 0===o.closed){l("blocked_by_browser","Modal blocked by browser");return}try{h=new URL(`${this.hostBaseUrl}/oauth/connect/${e}${this.toQueryString(s,r)}`)}catch{l("invalid_host_url","Invalid URL provided for the Nango host.");return}this.win=new n({baseUrl:h,debug:this.debug,webSocketUrl:this.websocketsBaseUrl,successHandler:e=>{t(e)},errorHandler:l}),this.win.setModal(o),this.tm=setInterval(()=>{this.win&&this.win.modal&&this.win.modal.closed&&!this.win.isProcessingMessage&&r?.detectClosedAuthWindow&&(clearInterval(this.tm),this.win.close(),this.win=null,i(new a("The authorization window was closed before the authorization flow was completed","window_closed")))},500)}).finally(()=>{this.clear()})}reconnect(e,t){if(!this.connectSessionToken)throw new a("Reconnect requires a session token","missing_connect_session_token");return this.auth(e,t)}clear(){if(this.tm&&clearInterval(this.tm),this.win){let e=this.win;this.win=null,setTimeout(()=>{try{e.close()}catch{}},500)}}openConnectUI(e){let t=new r({sessionToken:this.connectSessionToken,...e});return t.open(),t}convertCredentialsToConfig(e){let t={};if("type"in e&&"username"in e&&"password"in e&&"SIGNATURE"===e.type)return{params:{type:e.type,username:e.username,password:e.password}};if("username"in e&&(t.username=e.username||""),"password"in e&&(t.password=e.password||""),"apiKey"in e&&(t.apiKey=e.apiKey||""),"privateKey"in e||"type"in e&&"JWT"===e.type){let{privateKey:t,...i}=e,s={...i};return t&&"object"==typeof t&&"id"in t&&"secret"in t&&(s.privateKey=t),{params:e}}if("privateKeyId"in e&&"issuerId"in e&&"privateKey"in e){let t={params:{privateKeyId:e.privateKeyId,issuerId:e.issuerId,privateKey:e.privateKey}};return"scope"in e&&("string"==typeof e.scope||Array.isArray(e.scope))&&(t.params.scope=e.scope),t}if("client_id"in e&&("client_secret"in e||"client_private_key"in e))return{params:{client_id:e.client_id,client_secret:e.client_secret,client_certificate:e.client_certificate,client_private_key:e.client_private_key}};if("token_id"in e&&"token_secret"in e){let t={token_id:e.token_id,token_secret:e.token_secret};return"oauth_client_id_override"in e&&(t.oauth_client_id_override=e.oauth_client_id_override),"oauth_client_secret_override"in e&&(t.oauth_client_secret_override=e.oauth_client_secret_override),{params:t}}return"username"in e&&"password"in e&&"organization_id"in e&&"dev_key"in e?{params:{username:e.username,password:e.password,organization_id:e.organization_id,dev_key:e.dev_key}}:"type"in e&&"TWO_STEP"===e.type?{params:{...e}}:{params:t}}async triggerAuth({authUrl:e,credentials:t,assertionOption:i}){let s={};t&&Object.assign(s,t),i&&Object.keys(i).length>0&&(s.assertionOption=i);let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},...Object.keys(s).length>0?{body:JSON.stringify(s)}:{}});if(!n.ok){let e=await n.json();throw new a(e.error.message,e.error.code)}return n.json()}async customAuth(e,t,i,s,n){let{params:r}=i;if(!r)throw new a("You must specify credentials.","missing_credentials");if("type"in r&&"TWO_STEP"===r.type){let i=s?.assertionOption;return await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/two-step/${e}${this.toQueryString(t,s)}`,credentials:r,...i?{assertionOption:i}:{}})}return"type"in r&&"SIGNATURE"===r.type&&"username"in r&&"password"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/signature/${e}${this.toQueryString(t,s)}`,credentials:r}):"username"in r&&"password"in r&&"organization_id"in r&&"dev_key"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/bill/${e}${this.toQueryString(t,s)}`,credentials:r}):"apiKey"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/api-auth/api-key/${e}${this.toQueryString(t,s)}`,credentials:r}):"username"in r||"password"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/api-auth/basic/${e}${this.toQueryString(t,s)}`,credentials:r}):"privateKey"in r||"type"in r&&"JWT"===r.type?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/jwt/${e}${this.toQueryString(t,s)}`,credentials:r}):"privateKeyId"in r&&"issuerId"in r&&"privateKey"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/app-store-auth/${e}${this.toQueryString(t,s)}`,credentials:r}):"token_id"in r&&"token_secret"in r?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/tba/${e}${this.toQueryString(t,s)}`,credentials:r}):"client_id"in r&&("client_secret"in r||"client_private_key"in r)?await this.triggerAuth({authUrl:this.hostBaseUrl+`/oauth2/auth/${e}${this.toQueryString(t,s)}`,credentials:r}):"outbound"===n?await this.triggerAuth({authUrl:this.hostBaseUrl+`/auth/oauth-outbound/${e}${this.toQueryString(t,s)}`}):Promise.reject(Error("Something went wrong with the authorization"))}toQueryString(e,t){let i=[];if(e&&i.push(`connection_id=${e}`),this.publicKey&&i.push(`public_key=${this.publicKey}`),this.connectSessionToken&&i.push(`connect_session_token=${this.connectSessionToken}`),t){for(let e in t.params){let s=t.params[e];"string"==typeof s&&i.push(`params[${encodeURIComponent(e)}]=${encodeURIComponent(s)}`)}if(t.hmac&&i.push(`hmac=${t.hmac}`),t.user_scope&&i.push(`user_scope=${t.user_scope.join(",")}`),t.credentials){let e=t.credentials;"oauth_client_id_override"in e&&i.push(`credentials[oauth_client_id_override]=${encodeURIComponent(e.oauth_client_id_override)}`),"oauth_client_secret_override"in e&&i.push(`credentials[oauth_client_secret_override]=${encodeURIComponent(e.oauth_client_secret_override)}`),"oauth_refresh_token_override"in e&&i.push(`credentials[oauth_refresh_token_override]=${encodeURIComponent(e.oauth_refresh_token_override)}`),"token_id"in e&&i.push(`token_id=${encodeURIComponent(e.token_id)}`),"token_secret"in e&&i.push(`token_secret=${encodeURIComponent(e.token_secret)}`)}for(let e in t.authorization_params){let s=t.authorization_params[e];"string"==typeof s?i.push(`authorization_params[${e}]=${s}`):void 0===s&&i.push(`authorization_params[${e}]=undefined`)}}return 0===i.length?"":"?"+i.join("&")}ensureCredentials(){if(!this.publicKey&&!this.connectSessionToken)throw new a("You must specify a public key OR a connect session token (cf. documentation).","missing_auth_token")}}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6773],{1695:function(e,t,n){"use strict";var r=n(1219);n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},4859:function(e,t,n){"use strict";var r,i;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(i=n.g.process)?void 0:i.env)?n.g.process:n(9566)},2356:function(){},9566:function(e){!function(){var t={229:function(e){var t,n,r,i=e.exports={};function s(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function u(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var c=[],l=!1,a=-1;function h(){l&&r&&(l=!1,r.length?c=r.concat(c):a=-1,c.length&&d())}function d(){if(!l){var e=u(h);l=!0;for(var t=c.length;t;){for(r=c,c=[];++a<t;)r&&r[a].run();a=-1,t=c.length}r=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new f(e,t)),1!==c.length||l||u(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var s=n[e]={exports:{}},o=!0;try{t[e](s,s.exports,r),o=!1}finally{o&&delete n[e]}return s.exports}r.ab="//";var i=r(229);e.exports=i}()},7224:function(e,t,n){"use strict";var r=n(4859);n(2356);var i=n(7653),s=i&&"object"==typeof i&&"default"in i?i:{default:i},o=void 0!==r&&r.env&&!0,u=function(e){return"[object String]"===Object.prototype.toString.call(e)},c=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,i=t.optimizeForSpeed,s=void 0===i?o:i;l(u(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",l("boolean"==typeof s,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=s,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var c="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=c?c.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){l("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),l(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(l(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(o||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},t.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},t.insertRule=function(e,t){if(l(u(e),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return o||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},t.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var n="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){o||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];l(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},t.deleteRule=function(e){if("undefined"==typeof window){this._serverSheet.deleteRule(e);return}if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];l(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},t.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},t.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},t.makeStyleTag=function(e,t,n){t&&l(u(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return n?i.insertBefore(r,n):i.appendChild(r),r},function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,[{key:"length",get:function(){return this._rulesCount}}]),e}();function l(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var a=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},h={};function d(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return h[r]||(h[r]="jsx-"+a(e+"-"+n)),h[r]}function f(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return h[n]||(h[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),h[n]}var p=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,i=t.optimizeForSpeed,s=void 0!==i&&i;this._sheet=r||new c({name:"styled-jsx",optimizeForSpeed:s}),this._sheet.inject(),r&&"boolean"==typeof s&&(this._sheet.setOptimizeForSpeed(s),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,i=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var s=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=s,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return s.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var i=d(r,n);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return f(i,e)}):[f(i,t)]}}return{styleId:d(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=i.createContext(null);m.displayName="StyleSheetContext";var _=s.default.useInsertionEffect||s.default.useLayoutEffect,v="undefined"!=typeof window?new p:void 0;function y(e){var t=v||i.useContext(m);return t&&("undefined"==typeof window?t.add(e):_(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}y.dynamic=function(e){return e.map(function(e){return d(e[0],e[1])}).join(" ")},t.style=y},3146:function(e,t,n){"use strict";e.exports=n(7224).style}}]);
@@ -0,0 +1,9 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6940],{4859:function(e,t,i){"use strict";var s,r;e.exports=(null==(s=i.g.process)?void 0:s.env)&&"object"==typeof(null==(r=i.g.process)?void 0:r.env)?i.g.process:i(9566)},9566:function(e){!function(){var t={229:function(e){var t,i,s,r=e.exports={};function n(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===n||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(i){try{return t.call(null,e,0)}catch(i){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:n}catch(e){t=n}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var l=[],h=!1,c=-1;function u(){h&&s&&(h=!1,s.length?l=s.concat(l):c=-1,l.length&&d())}function d(){if(!h){var e=a(u);h=!0;for(var t=l.length;t;){for(s=l,l=[];++c<t;)s&&s[c].run();c=-1,t=l.length}s=null,h=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function _(){}r.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];l.push(new f(e,t)),1!==l.length||h||a(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=_,r.addListener=_,r.once=_,r.off=_,r.removeListener=_,r.removeAllListeners=_,r.emit=_,r.prependListener=_,r.prependOnceListener=_,r.listeners=function(e){return[]},r.binding=function(e){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw Error("process.chdir is not supported")},r.umask=function(){return 0}}},i={};function s(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={exports:{}},o=!0;try{t[e](n,n.exports,s),o=!1}finally{o&&delete i[e]}return n.exports}s.ab="//";var r=s(229);e.exports=r}()},8514:function(e,t,i){"use strict";i.d(t,{X:function(){return s}});var s=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let t=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=o.top+o.bottom;return{cols:Math.max(2,Math.floor((r-(o.right+o.left)-t)/e.css.cell.width)),rows:Math.max(1,Math.floor((s-a)/e.css.cell.height))}}}},8345:function(e,t,i){"use strict";i.d(t,{Z:function(){return ea}});var s,r,n,o=i(4859),a=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?u.isErrorNoTelemetry(e)?new u(e.message+`
2
+
3
+ `+e.stack):Error(e.message+`
4
+
5
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function l(e){e instanceof c||e instanceof Error&&e.name===h&&e.message===h||a.onUnexpectedError(e)}var h="Canceled",c=class extends Error{constructor(){super(h),this.name=this.message}},u=class e extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(t){if(t instanceof e)return t;let i=new e;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}};(x=k||={}).isLessThan=function(e){return e<0},x.isLessThanOrEqual=function(e){return e<=0},x.isGreaterThan=function(e){return e>0},x.isNeitherLessOrGreaterThan=function(e){return 0===e},x.greaterThan=1,x.lessThan=-1,x.neitherLessOrGreaterThan=0;var d=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(i=>!t(i)||e(i)))}map(t){return new e(e=>this.iterate(i=>e(t(i))))}some(e){let t=!1;return this.iterate(i=>!(t=e(i))),t}findFirst(e){let t;return this.iterate(i=>!e(i)||(t=i,!1)),t}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(s=>((i||k.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}};d.empty=new d(e=>{});function f(e){return e}function _(e){}function p(e,t){}function m(e){if(R.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function g(...e){return v(()=>m(e))}function v(e){let t={dispose:function(e,t){let i=this,s=!1,r;return function(){if(s)return r;if(s=!0,t)try{r=e.apply(i,arguments)}finally{t()}else r=e.apply(i,arguments);return r}}(()=>{e()})};return t}(e=>{function t(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;let i=Object.freeze([]);function*s(e){yield e}async function r(e){let t=[];for await(let i of e)t.push(i);return Promise.resolve(t)}e.empty=function(){return i},e.single=s,e.wrap=function(e){return t(e)?e:s(e)},e.from=function(e){return e||i},e.reverse=function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){let i=0;for(let s of e)if(t(s,i++))return!0;return!1},e.find=function(e,t){for(let i of e)if(t(i))return i},e.filter=function*(e,t){for(let i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(let s of e)yield t(s,i++)},e.flatMap=function*(e,t){let i=0;for(let s of e)yield*t(s,i++)},e.concat=function*(...e){for(let t of e)yield*t},e.reduce=function(e,t,i){let s=i;for(let i of e)s=t(s,i);return s},e.slice=function*(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t<i;t++)yield e[t]},e.consume=function(t,i=Number.POSITIVE_INFINITY){let s=[];if(0===i)return[s,t];let r=t[Symbol.iterator]();for(let t=0;t<i;t++){let t=r.next();if(t.done)return[s,e.empty()];s.push(t.value)}return[s,{[Symbol.iterator]:()=>r}]},e.asyncToArray=r})(R||={});var w=class e{constructor(){var e;this._toDispose=new Set,this._isDisposed=!1,e=this}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{m(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error("Cannot register a disposable on itself!");return this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}};w.DISABLE_DISPOSED_WARNING=!1;var y=class{constructor(){var e;this._store=new w,e=this,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw Error("Cannot register a disposable on itself!");return this._store.add(e)}};y.None=Object.freeze({dispose(){}});var C=class{constructor(){var e;this._isDisposed=!1,e=this}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},b=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};b.Undefined=new b(void 0);var S=globalThis.performance&&"function"==typeof globalThis.performance.now,L=class e{static create(t){return new e(t)}constructor(e){this._now=S&&!1===e?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return -1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}};(e=>{function t(e){return(t,i=null,s)=>{let r=!1,n;return n=e(e=>{if(!r)return n?n.dispose():r=!0,t.call(i,e)},null,s),r&&n.dispose(),n}}function i(e,t,i){return r((i,s=null,r)=>e(e=>i.call(s,t(e)),null,r),i)}function s(e,t,i){return r((i,s=null,r)=>e(e=>t(e)&&i.call(s,e),null,r),i)}function r(e,t){let i,s=new z({onWillAddFirstListener(){i=e(s.fire,s)},onDidRemoveLastListener(){i?.dispose()}});return t?.add(s),s.event}function n(e,t,i=100,s=!1,r=!1,n,o){let a,l,h,c=0,u,d=new z({leakWarningThreshold:n,onWillAddFirstListener(){a=e(e=>{c++,l=t(l,e),s&&!h&&(d.fire(l),l=void 0),u=()=>{let e=l;l=void 0,h=void 0,(!s||c>1)&&d.fire(e),c=0},"number"==typeof i?(clearTimeout(h),h=setTimeout(u,i)):void 0===h&&(h=0,queueMicrotask(u))})},onWillRemoveListener(){r&&c>0&&u?.()},onDidRemoveLastListener(){u=void 0,a.dispose()}});return o?.add(d),d.event}e.None=()=>y.None,e.defer=function(e,t){return n(e,()=>{},0,void 0,!0,void 0,t)},e.once=t,e.map=i,e.forEach=function(e,t,i){return r((i,s=null,r)=>e(e=>{t(e),i.call(s,e)},null,r),i)},e.filter=s,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,s)=>{var r;return r=g(...e.map(e=>e(e=>t.call(i,e)))),s instanceof Array?s.push(r):s&&s.add(r),r}},e.reduce=function(e,t,s,r){let n=s;return i(e,e=>n=t(n,e),r)},e.debounce=n,e.accumulate=function(t,i=0,s){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],i,void 0,!0,void 0,s)},e.latch=function(e,t=(e,t)=>e===t,i){let r=!0,n;return s(e,e=>{let i=r||!t(e,n);return r=!1,n=e,i},i)},e.split=function(t,i,s){return[e.filter(t,i,s),e.filter(t,e=>!i(e),s)]},e.buffer=function(e,t=!1,i=[],s){let r=i.slice(),n=e(e=>{r?r.push(e):a.fire(e)});s&&s.add(n);let o=()=>{r?.forEach(e=>a.fire(e)),r=null},a=new z({onWillAddFirstListener(){n||(n=e(e=>a.fire(e)),s&&s.add(n))},onDidAddFirstListener(){r&&(t?setTimeout(o):o())},onDidRemoveLastListener(){n&&n.dispose(),n=null}});return s&&s.add(a),a.event},e.chain=function(e,t){return(i,s,r)=>{let n=t(new a);return e(function(e){let t=n.evaluate(e);t!==o&&i.call(s,t)},void 0,r)}};let o=Symbol("HaltChainable");class a{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:o),this}reduce(e,t){let i=t;return this.steps.push(t=>i=e(i,t)),this}latch(e=(e,t)=>e===t){let t=!0,i;return this.steps.push(s=>{let r=t||!e(s,i);return t=!1,i=s,r?s:o}),this}evaluate(e){for(let t of this.steps)if((e=t(e))===o)break;return e}}e.fromNodeEventEmitter=function(e,t,i=e=>e){let s=(...e)=>r.fire(i(...e)),r=new z({onWillAddFirstListener:()=>e.on(t,s),onDidRemoveLastListener:()=>e.removeListener(t,s)});return r.event},e.fromDOMEventEmitter=function(e,t,i=e=>e){let s=(...e)=>r.fire(i(...e)),r=new z({onWillAddFirstListener:()=>e.addEventListener(t,s),onDidRemoveLastListener:()=>e.removeEventListener(t,s)});return r.event},e.toPromise=function(e){return new Promise(i=>t(e)(i))},e.fromPromise=function(e){let t=new z;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event},e.forward=function(e,t){return e(e=>t.fire(e))},e.runAndSubscribe=function(e,t,i){return t(i),e(e=>t(e))};class l{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;this.emitter=new z({onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}}),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,t){return new l(e,t).emitter.event},e.fromObservableLight=function(e){return(t,i,s)=>{let r=0,n=!1,o={beginUpdate(){r++},endUpdate(){0==--r&&(e.reportChanges(),n&&(n=!1,t.call(i)))},handlePossibleChange(){},handleChange(){n=!0}};e.addObserver(o),e.reportChanges();let a={dispose(){e.removeObserver(o)}};return s instanceof w?s.add(a):Array.isArray(s)&&s.push(a),a}}})(E||={});var T=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new L,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};T.all=new Set,T._idPool=0;var D=class e{constructor(t,i,s=(e._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=.5*i;let[e,s]=this.getMostFrequentStack(),r=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${s}):`;console.warn(r),console.warn(e);let n=new I(r,e);this._errorHandler(n)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[i,s]of this._stacks)(!e||t<s)&&(e=[i,s],t=s);return e}};D._idPool=1;var x,k,R,E,O,M,A=class e{constructor(e){this.value=e}static create(){return new e(Error().stack??"")}print(){console.warn(this.value.split(`
6
+ `).slice(2).join(`
7
+ `))}},I=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},P=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},N=0,W=class{constructor(e){this.value=e,this.id=N++}},z=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new D(e?.onListenerError??l,this._options?.leakWarningThreshold??-1):void 0,this._perfMon=this._options?._profName?new T(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],i=new P(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||l)(i),y.None}if(this._disposed)return y.None;t&&(e=e.bind(t));let s=new W(e),r;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(s.stack=A.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof W?(this._deliveryQueue??=new F,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=v(()=>{O?.unregister(n),r?.(),this._removeListener(s)});if(i instanceof w?i.add(n):Array.isArray(i)&&i.push(n),O){let e=Error().stack.split(`
8
+ `).slice(2,3).join(`
9
+ `).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);O.register(n,t?.[2]??e,n)}return n},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(-1===i)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(2*this._size<=t.length){let e=0;for(let i=0;i<t.length;i++)t[i]?t[e++]=t[i]:s&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||l;if(!i){e.value(t);return}try{e.value(t)}catch(e){i(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof W)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},F=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},j=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(q=M||={}).isCancellationToken=function(e){return e===q.None||e===q.Cancelled||e instanceof U||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},q.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:E.None}),q.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:j});var q,H,U=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?j:(this._emitter||(this._emitter=new z),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Q=!1,V="en",$=globalThis;"u">typeof $.vscode&&"u">typeof $.vscode.process?$.vscode.process:"u">typeof o&&o?.versions?.node;var B="string"==typeof o?.versions?.electron&&o?.type==="renderer";if("object"==typeof o){o.platform,o.platform,"linux"===o.platform&&o.env.SNAP&&o.env.SNAP_REVISION,o.env.CI||o.env.BUILD_ARTIFACTSTAGINGDIRECTORY,V="en";let e=o.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,V=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}}else"object"!=typeof navigator||B?console.error("Unable to resolve platform."):((H=navigator.userAgent).indexOf("Windows"),H.indexOf("Macintosh"),(H.indexOf("Macintosh")>=0||H.indexOf("iPad")>=0||H.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,H.indexOf("Linux"),H?.indexOf("Mobi"),Q=!0,V=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());Q&&"function"==typeof $.importScripts&&$.origin;var Y,G=H,J=V;(s=Y||={}).value=function(){return J},s.isDefaultVariant=function(){return 2===J.length?"en"===J:J.length>=3&&"e"===J[0]&&"n"===J[1]&&"-"===J[2]},s.isDefault=function(){return"en"===J};var K="function"==typeof $.postMessage&&!$.importScripts,X=(()=>{if(K){let e=[];$.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),$.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),Z=!!(G&&G.indexOf("Chrome")>=0);function ee(e,t=0,i){let s=setTimeout(()=>{e(),i&&r.dispose()},t),r=v(()=>{clearTimeout(s),i?.deleteAndLeak(r)});return i?.add(r),r}G&&G.indexOf("Firefox"),!Z&&G&&G.indexOf("Safari"),G&&G.indexOf("Edg/"),G&&G.indexOf("Android"),Symbol("MicrotaskDelay"),r="function"!=typeof globalThis.requestIdleCallback||"function"!=typeof globalThis.cancelIdleCallback?(e,t)=>{X(()=>{if(i)return;let e=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,e-Date.now())}))});let i=!1;return{dispose(){i||(i=!0)}}}:(e,t,i)=>{let s=e.requestIdleCallback(t,"number"==typeof i?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},(e=>{async function t(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i}e.settled=t,e.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})}})(n||={});var et=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new z,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await E.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let s of t)e.emitOne(i(s))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let s of t)i(s)&&e.emitOne(s)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};et.EMPTY=et.fromArray([]);var ei=class extends y{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new C),this._linesCacheDisposables=this._register(new C),this._register(v(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=g(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=ee(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){return this._linesCache?.[e]}setLineInCache(e,t){this._linesCache&&(this._linesCache[e]=t)}translateBufferLineToStringWithWrap(e,t){let i=[],s=[0],r=this._terminal.buffer.active.getLine(e);for(;r;){let n=this._terminal.buffer.active.getLine(e+1),o=!!n&&n.isWrapped,a=r.translateToString(!o&&t);if(o&&n){let e=r.getCell(r.length-1);e&&0===e.getCode()&&1===e.getWidth()&&n.getCell(0)?.getWidth()===2&&(a=a.slice(0,-1))}if(i.push(a),o)s.push(s[s.length-1]+a.length);else break;e++,r=n}return[i.join(""),s]}},es=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return!this._lastSearchOptions||!!e&&(this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord)}shouldUpdateHighlighting(e,t){return!!t?.decorations&&(void 0===this._cachedSearchTerm||e!==this._cachedSearchTerm||this.didOptionsChange(t))}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},er=class{constructor(e,t){this._terminal=e,this._lineCache=t}find(e,t,i,s){if(!e||0===e.length){this._terminal.clearSelection();return}if(i>this._terminal.cols)throw Error(`Invalid col: ${i} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let r={startRow:t,startCol:i},n=this._findInLine(e,r,s);if(!n)for(let i=t+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(r.startRow=i,r.startCol=0,!(n=this._findInLine(e,r,s)));i++);return n}findNextWithSelection(e,t,i){if(!e||0===e.length){this._terminal.clearSelection();return}let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=0,n=0;s&&(i===e?(r=s.end.x,n=s.end.y):(r=s.start.x,n=s.start.y)),this._lineCache.initLinesCache();let o={startRow:n,startCol:r},a=this._findInLine(e,o,t);if(!a)for(let i=n+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);if(!a&&0!==n)for(let i=0;i<n&&(o.startRow=i,o.startCol=0,!(a=this._findInLine(e,o,t)));i++);return!a&&s&&(o.startRow=s.start.y,o.startCol=0,a=this._findInLine(e,o,t)),a}findPreviousWithSelection(e,t,i){if(!e||0===e.length){this._terminal.clearSelection();return}let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=this._terminal.buffer.active.baseY+this._terminal.rows-1,n=this._terminal.cols;this._lineCache.initLinesCache();let o={startRow:r,startCol:n},a;if(s&&(o.startRow=r=s.start.y,o.startCol=n=s.start.x,i!==e&&((a=this._findInLine(e,o,t,!1))||(o.startRow=r=s.end.y,o.startCol=n=s.end.x))),a||(a=this._findInLine(e,o,t,!0)),!a){o.startCol=Math.max(o.startCol,this._terminal.cols);for(let i=r-1;i>=0&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);}if(!a&&r!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let i=this._terminal.buffer.active.baseY+this._terminal.rows-1;i>=r&&(o.startRow=i,!(a=this._findInLine(e,o,t,!0)));i--);return a}_isWholeWord(e,t,i){return(0===e||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e-1]))&&(e+i.length===t.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e+i.length]))}_findInLine(e,t,i={},s=!1){let r=t.startRow,n=t.startCol;if(this._terminal.buffer.active.getLine(r)?.isWrapped){if(s){t.startCol+=this._terminal.cols;return}return t.startRow--,t.startCol+=this._terminal.cols,this._findInLine(e,t,i)}let o=this._lineCache.getLineFromCache(r);o||(o=this._lineCache.translateBufferLineToStringWithWrap(r,!0),this._lineCache.setLineInCache(r,o));let[a,l]=o,h=this._bufferColsToStringOffset(r,n),c=e,u=a;i.regex||(c=i.caseSensitive?e:e.toLowerCase(),u=i.caseSensitive?a:a.toLowerCase());let d=-1;if(i.regex){let t=RegExp(c,i.caseSensitive?"g":"gi"),r;if(s)for(;r=t.exec(u.slice(0,h));)d=t.lastIndex-r[0].length,e=r[0],t.lastIndex-=e.length-1;else(r=t.exec(u.slice(h)))&&r[0].length>0&&(d=h+(t.lastIndex-r[0].length),e=r[0])}else s?h-c.length>=0&&(d=u.lastIndexOf(c,h-c.length)):d=u.indexOf(c,h);if(d>=0){if(i.wholeWord&&!this._isWholeWord(d,u,e))return;let t=0;for(;t<l.length-1&&d>=l[t+1];)t++;let s=t;for(;s<l.length-1&&d+e.length>=l[s+1];)s++;let n=d-l[t],o=d+e.length-l[s],a=this._stringLengthToBufferSize(r+t,n),h=this._stringLengthToBufferSize(r+s,o)-a+this._terminal.cols*(s-t);return{term:e,col:a,row:r+t,size:h}}}_stringLengthToBufferSize(e,t){let i=this._terminal.buffer.active.getLine(e);if(!i)return 0;for(let e=0;e<t;e++){let s=i.getCell(e);if(!s)break;let r=s.getChars();r.length>1&&(t-=r.length-1);let n=i.getCell(e+1);n&&0===n.getWidth()&&t++}return t}_bufferColsToStringOffset(e,t){let i=e,s=0,r=this._terminal.buffer.active.getLine(i);for(;t>0&&r;){for(let e=0;e<t&&e<this._terminal.cols;e++){let t=r.getCell(e);if(!t)break;t.getWidth()&&(s+=0===t.getCode()?1:t.getChars().length)}if(i++,(r=this._terminal.buffer.active.getLine(i))&&!r.isWrapped)break;t-=this._terminal.cols}return s}},en=class extends y{constructor(e){super(),this._terminal=e,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(v(()=>this.clearHighlightDecorations()))}createHighlightDecorations(e,t){for(let i of(this.clearHighlightDecorations(),e)){let e=this._createResultDecorations(i,t,!1);if(e)for(let t of e)this._storeDecoration(t,i)}}createActiveDecoration(e,t){let i=this._createResultDecorations(e,t,!0);if(i)return{decorations:i,match:e,dispose(){m(i)}}}clearHighlightDecorations(){m(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(e,t){this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:t,dispose(){e.dispose()}})}_applyStyles(e,t,i){e.classList.contains("xterm-find-result-decoration")||(e.classList.add("xterm-find-result-decoration"),t&&(e.style.outline=`1px solid ${t}`)),i&&e.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(e,t,i){let s=[],r=e.col,n=e.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+e.row;for(;n>0;){let e=Math.min(this._terminal.cols-r,n);s.push([o,r,e]),r=0,n-=e,o++}let a=[];for(let e of s){let s=this._terminal.registerMarker(e[0]),r=this._terminal.registerDecoration({marker:s,x:e[1],width:e[2],backgroundColor:i?t.activeMatchBackground:t.matchBackground,overviewRulerOptions:this._highlightedLines.has(s.line)?void 0:{color:i?t.activeMatchColorOverviewRuler:t.matchOverviewRuler,position:"center"}});if(r){let e=[];e.push(s),e.push(r.onRender(e=>this._applyStyles(e,i?t.activeMatchBorder:t.matchBorder,!1))),e.push(r.onDispose(()=>m(e))),a.push(r)}}return 0===a.length?void 0:a}},eo=class extends y{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new z)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(e){this._selectedDecoration=e}updateResults(e,t){this._searchResults=e.slice(0,t)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(e){for(let t=0;t<this._searchResults.length;t++){let i=this._searchResults[t];if(i.row===e.row&&i.col===e.col&&i.size===e.size)return t}return -1}fireResultsChanged(e){if(!e)return;let t=-1;this._selectedDecoration&&(t=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:t,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},ea=class extends y{constructor(e){super(),this._highlightTimeout=this._register(new C),this._lineCache=this._register(new C),this._state=new es,this._resultTracker=this._register(new eo),this._highlightLimit=e?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(e){this._terminal=e,this._lineCache.value=new ei(e),this._engine=new er(e,this._lineCache.value),this._decorationManager=new en(e),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(v(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=ee(()=>{let e=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(e,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let s=this._findNextAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,s}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(e)){this.clearDecorations();return}this.clearDecorations(!0);let i=[],s,r=this._engine.find(e,0,0,t);for(;r&&(s?.row!==r.row||s?.col!==r.col)&&!(i.length>=this._highlightLimit);)s=r,i.push(s),r=this._engine.find(e,s.col+s.term.length>=this._terminal.cols?s.row+1:s.row,s.col+s.term.length>=this._terminal.cols?0:s.col+1,t);this._resultTracker.updateResults(i,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(i,t.decorations)}_findNextAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(s,t?.decorations,i?.noScroll)}findPrevious(e,t,i){if(!this._terminal||!this._engine)throw Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let s=this._findPreviousAndSelect(e,t,i);return this._fireResults(t),this._state.cachedSearchTerm=e,s}_fireResults(e){this._resultTracker.fireResultsChanged(!!e?.decorations)}_findPreviousAndSelect(e,t,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(s,t?.decorations,i?.noScroll)}_selectResult(e,t,i){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let i=this._decorationManager.createActiveDecoration(e,t);i&&(this._resultTracker.selectedDecoration=i)}if(!i&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.row<this._terminal.buffer.active.viewportY)){let t=e.row-this._terminal.buffer.active.viewportY;t-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(t)}return!0}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7894],{5634:function(e,t,r){r.d(t,{K7:function(){return s}});var n=r(7573);function s(e){let{size:t=24,className:r="",withGlow:s=!1}=e;return(0,n.jsxs)("svg",{width:t,height:t,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"\n transition-all duration-300\n ".concat(s?"drop-shadow-[0_0_8px_rgba(0,217,255,0.3)]":"","\n ").concat(r,"\n "),"aria-label":"Agent Relay Logo",role:"img",children:[(0,n.jsx)("path",{d:"M30 80 L 50 20 L 70 80",stroke:"#00d9ff",strokeWidth:"5",strokeLinejoin:"round",strokeLinecap:"round",fill:"none"}),(0,n.jsx)("line",{x1:"40",y1:"50",x2:"60",y2:"50",stroke:"#00d9ff",strokeWidth:"5",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M50 20 L 50 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.7"}),(0,n.jsx)("path",{d:"M50 20 C 80 20 80 50 50 50 L 80 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:"0.7"})]})}r(7653)},4722:function(e,t,r){r.d(t,{j:function(){return c}});var n=r(7573),s=r(7653);async function o(){let e=await fetch("/api/onboarding/next-step",{credentials:"include"});if(!e.ok)throw Error("Failed to fetch onboarding next step");return await e.json()}let a={codex:"openai"};function c(e){let{provider:t,workspaceId:r,mode:c,csrfToken:i,showManualDone:l,onSuccess:d,onCancel:u,onError:x}=e,[p,h]=(0,s.useState)("idle"),[m,b]=(0,s.useState)(null),[f,g]=(0,s.useState)(null),[y,j]=(0,s.useState)(!1),[w,v]=(0,s.useState)(r||null),k=(0,s.useRef)(!1),N=(0,s.useRef)(!1),C=null!=c?c:r?"workspace":"onboarding",S=null!=l?l:"onboarding"===C,E=t.id,A=(0,s.useMemo)(()=>Array.from(new Set([a[E]||E,E])),[E]),R=(0,s.useCallback)(()=>{N.current||(N.current=!0,h("success"),setTimeout(()=>d(),1200))},[d]),T=(0,s.useCallback)(e=>!!(e&&Array.isArray(e))&&A.some(t=>e.some(e=>e.name===t&&"connected"===e.status)),[A]),L=(0,s.useCallback)(e=>{if(e.nextStep&&"connect_ai_provider"!==e.nextStep)return!0;let t=Array.isArray(e.connectedProviders)?e.connectedProviders:[];return A.some(e=>t.includes(e))},[A]),W=(0,s.useCallback)(async e=>{if(e)try{let t=await fetch("/api/auth/ssh/status/".concat(e),{credentials:"include"});if(t.ok){let e=await t.json();if(T(e.providers))return!0}}catch(e){}if("onboarding"!==C)return!1;try{let e=await o();return L(e)}catch(e){return!1}},[C,L,T]),F=(0,s.useCallback)(async e=>{if(k.current)return;k.current=!0;let t=0;for(;k.current&&t<120;){if(await W(e||void 0)){k.current=!1,R();return}t+=1,await new Promise(e=>setTimeout(e,5e3))}k.current=!1,b("Authentication timed out. Please try again."),h("error"),x("Authentication timed out")},[W,R,x]),M=(0,s.useCallback)(async()=>{h("starting"),b(null),N.current=!1;try{let e={"Content-Type":"application/json"};i&&(e["X-CSRF-Token"]=i);let t={provider:E};r&&(t.workspaceId=r),"onboarding"===C&&(t.mode="onboarding");let n=await fetch("/api/auth/ssh/init",{method:"POST",credentials:"include",headers:e,body:JSON.stringify(t)}),s=await n.json();if(!n.ok)throw Error(s.error||"Failed to start authentication");let o=s.commandWithUrl||s.command,a=o&&!o.trim().startsWith("npx ")?"npx ".concat(o):o;if(!a)throw Error("Auth command missing in response");g(a),h("waiting");let c=s.workspaceId||r||null;v(c),F(c)}catch(t){let e=t instanceof Error?t.message:"Failed to start authentication";b(e),h("error"),x(e)}},[E,r,C,i,x,F]),P=(0,s.useCallback)(async()=>{if(await W(w||void 0)){R();return}let e="Authentication is still in progress. Finish the CLI flow and try again.";b(e),x(e)},[W,w,R,x]),_=(0,s.useCallback)(()=>{k.current=!1,h("idle"),g(null),b(null),j(!1),u()},[u]),B=(0,s.useCallback)(()=>{f&&(navigator.clipboard.writeText(f),j(!0),setTimeout(()=>j(!1),2e3))},[f]);return(0,s.useEffect)(()=>{"idle"===p&&M()},[M,p]),(0,s.useEffect)(()=>()=>{k.current=!1},[]),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold",style:{backgroundColor:t.color},children:t.displayName[0]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"font-medium text-white",children:t.displayName}),(0,n.jsxs)("p",{className:"text-sm text-text-muted",children:["starting"===p&&"Starting authentication...","waiting"===p&&"Complete authentication below","success"===p&&"Connected!","error"===p&&(m||"Authentication failed")]})]})]}),"starting"===p&&(0,n.jsxs)("div",{className:"flex items-center justify-center gap-3 py-4",children:[(0,n.jsxs)("svg",{className:"w-5 h-5 text-accent-cyan animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{className:"text-text-muted",children:"Preparing authentication..."})]}),"waiting"===p&&f&&(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"p-3 bg-accent-cyan/10 border border-accent-cyan/30 rounded-lg",children:[(0,n.jsxs)("p",{className:"text-sm text-accent-cyan mb-2",children:[(0,n.jsx)("strong",{children:"Step 1:"})," Copy and run this command in your terminal"]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-deep rounded-lg text-xs font-mono text-white overflow-x-auto",children:f}),(0,n.jsx)("button",{onClick:B,className:"px-3 py-2 bg-bg-tertiary border border-border-subtle rounded-lg text-text-muted hover:text-white hover:border-accent-cyan/50 transition-colors text-xs whitespace-nowrap",children:y?"Copied!":"Copy"})]})]}),(0,n.jsxs)("div",{className:"p-3 bg-bg-tertiary border border-border-subtle rounded-lg",children:[(0,n.jsxs)("p",{className:"text-sm text-white mb-1",children:[(0,n.jsx)("strong",{children:"Step 2:"})," Accept any SSH host key warnings"]}),(0,n.jsxs)("p",{className:"text-xs text-text-muted",children:['If prompted with "Are you sure you want to continue connecting?", type ',(0,n.jsx)("code",{className:"px-1 py-0.5 bg-bg-deep rounded text-accent-cyan",children:"yes"})," and press Enter."]})]}),(0,n.jsxs)("div",{className:"p-3 bg-bg-tertiary border border-border-subtle rounded-lg",children:[(0,n.jsxs)("p",{className:"text-sm text-white mb-1",children:[(0,n.jsx)("strong",{children:"Step 3:"})," Complete the sign-in"]}),(0,n.jsxs)("p",{className:"text-xs text-text-muted",children:["A browser window will open for ",t.displayName," authentication. Sign in with your account and authorize access."]})]}),(0,n.jsxs)("div",{className:"p-3 bg-amber-500/10 border border-amber-500/30 rounded-lg",children:[(0,n.jsxs)("p",{className:"text-sm text-amber-400 mb-1",children:[(0,n.jsx)("strong",{children:"Step 4:"})," Wait for the ",t.displayName," input prompt, then type ",(0,n.jsx)("code",{className:"px-1 py-0.5 bg-bg-deep rounded",children:"exit"})]}),(0,n.jsxs)("p",{className:"text-xs text-amber-400/80",children:["Do not close the terminal early. After sign-in completes, wait until you see the input screen prompt, then type ",(0,n.jsx)("code",{className:"px-1 py-0.5 bg-bg-deep rounded",children:"exit"})," and press Enter."]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-success/10 border border-success/30 rounded-lg text-sm text-success",children:[(0,n.jsxs)("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,n.jsx)("span",{children:"Waiting for authentication to complete..."})]}),S&&(0,n.jsx)("button",{onClick:P,className:"w-full py-2 px-4 bg-accent-cyan text-bg-deep font-semibold rounded-lg hover:bg-accent-cyan/90 transition-colors",children:"Done"}),(0,n.jsx)("button",{onClick:_,className:"w-full py-2 text-text-muted hover:text-white transition-colors text-sm",children:"Cancel"})]}),"success"===p&&(0,n.jsxs)("div",{className:"flex items-center justify-center gap-3 py-4",children:[(0,n.jsx)("div",{className:"w-10 h-10 bg-success/20 rounded-full flex items-center justify-center",children:(0,n.jsx)("svg",{className:"w-6 h-6 text-success",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),(0,n.jsxs)("span",{className:"text-white font-medium",children:[t.displayName," connected!"]})]}),"error"===p&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("div",{className:"p-4 bg-error/10 border border-error/30 rounded-lg text-error text-sm",children:m||"Authentication failed. Please try again."}),(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)("button",{onClick:M,className:"flex-1 py-2 px-4 bg-bg-tertiary border border-border-subtle text-white rounded-lg hover:border-accent-cyan/50 transition-colors",children:"Try Again"}),(0,n.jsx)("button",{onClick:_,className:"py-2 px-4 text-text-muted hover:text-white transition-colors",children:"Cancel"})]})]})]})}},1994:function(e,t,r){r.d(t,{$:function(){return i}});var n=r(7573),s=r(7653),o=r(2547),a=r(8514);let c={background:"#0d0f14",foreground:"#c9d1d9",cursor:"#58a6ff",cursorAccent:"#0d0f14",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#484f58",red:"#f85149",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ff7b72",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#ffffff"};function i(e){let{provider:t,workspaceId:r,csrfToken:i,maxHeight:x="400px",onSuccess:p,onError:h,onCancel:m,onConnectAnother:b,showHeader:f=!0,className:g=""}=e,y=(0,s.useRef)(null),j=(0,s.useRef)(null),w=(0,s.useRef)(null),v=(0,s.useRef)(null),k=(0,s.useRef)(null),N=(0,s.useRef)(!1),C=(0,s.useRef)(null),[S,E]=(0,s.useState)(!1),[A,R]=(0,s.useState)(!1),[T,L]=(0,s.useState)(!1),[W,F]=(0,s.useState)(null),[M,P]=(0,s.useState)(null),[_,B]=(0,s.useState)(!1),[O,I]=(0,s.useState)(i),D=(0,s.useCallback)(()=>{let e=Date.now().toString(36),r=Math.random().toString(36).substring(2,6);return"__setup__".concat(t.id,"-").concat(e).concat(r)},[t.id]);(0,s.useEffect)(()=>{O||fetch("/api/auth/session",{credentials:"include"}).then(e=>{let t=e.headers.get("X-CSRF-Token");t&&I(t)}).catch(()=>{})},[O]);let X=(0,s.useCallback)(async()=>{if(r&&M)try{let e={};O&&(e["X-CSRF-Token"]=O),await fetch("/api/workspaces/".concat(r,"/agents/").concat(encodeURIComponent(M)),{method:"DELETE",credentials:"include",headers:e})}catch(e){}},[r,M,O]),z=(0,s.useCallback)(async()=>{if(!r||!O)return;E(!0),F(null);let e=D();try{let n={"Content-Type":"application/json"};O&&(n["X-CSRF-Token"]=O);let s=await fetch("/api/workspaces/".concat(r,"/agents"),{method:"POST",credentials:"include",headers:n,body:JSON.stringify({name:e,provider:"anthropic"===t.id?"claude":t.id,interactive:!0})});if(!s.ok){let e=await s.json();throw Error(e.error||"Failed to spawn agent")}P(e)}catch(t){let e=t instanceof Error?t.message:"Failed to spawn agent";F(e),null==h||h(e)}finally{E(!1)}},[r,O,t.id,D,h]);(0,s.useEffect)(()=>{if(!y.current)return;let e=new o.o({theme:c,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',fontSize:12,lineHeight:1.4,convertEol:!0,scrollback:1e4,cursorBlink:!0,cursorStyle:"block",disableStdin:!1,allowProposedApi:!0}),t=new a.X;e.loadAddon(t),e.open(y.current),t.fit(),j.current=e,w.current=t;let r=new ResizeObserver(()=>{t.fit()});return r.observe(y.current),()=>{r.disconnect(),e.dispose(),j.current=null,w.current=null}},[]),(0,s.useEffect)(()=>{if(!M||!r)return;N.current=!1;let e=()=>{var t;if((null===(t=v.current)||void 0===t?void 0:t.readyState)===WebSocket.OPEN)return;let n="https:"===window.location.protocol?"wss:":"ws:",s="".concat(n,"//").concat(window.location.host,"/ws/logs/").concat(encodeURIComponent(r),"/").concat(encodeURIComponent(M));L(!0);let o=new WebSocket(s);v.current=o,o.onopen=()=>{if(R(!0),L(!1),!N.current){var e,t;N.current=!0,null===(e=j.current)||void 0===e||e.writeln("\x1b[90m[Connected - Interactive Mode]\x1b[0m"),null===(t=j.current)||void 0===t||t.writeln("\x1b[90m[Type directly to respond to prompts]\x1b[0m\n")}},o.onclose=()=>{R(!1),L(!1),k.current=setTimeout(e,2e3)},o.onmessage=e=>{var t,r;try{let r=JSON.parse(e.data);if("history"===r.type&&Array.isArray(r.lines))r.lines.forEach(e=>{var t;null===(t=j.current)||void 0===t||t.writeln(e)});else if("log"===r.type||"output"===r.type){let e=r.content||r.data||r.message||"";e&&(null===(t=j.current)||void 0===t||t.write(e))}}catch(t){"string"==typeof e.data&&(null===(r=j.current)||void 0===r||r.write(e.data))}},C.current&&(C.current.dispose(),C.current=null),j.current&&(C.current=j.current.onData(e=>{var t;let r=null===(t=j.current)||void 0===t?void 0:t.getSelection();r&&r.length>0||o.readyState!==WebSocket.OPEN||o.send(JSON.stringify({type:"input",agent:M,data:e}))}))};return e(),()=>{var e;k.current&&(clearTimeout(k.current),k.current=null),C.current&&(C.current.dispose(),C.current=null),null===(e=v.current)||void 0===e||e.close(),v.current=null}},[M,r]),(0,s.useEffect)(()=>{!O||M||S||z()},[O,M,S,z]),(0,s.useEffect)(()=>()=>{X()},[X]);let J=(0,s.useCallback)(async()=>{let e=t.name||t.id;try{let t={"Content-Type":"application/json"};O&&(t["X-CSRF-Token"]=O);let n=await fetch("/api/onboarding/mark-connected/".concat(e),{method:"POST",credentials:"include",headers:t,body:JSON.stringify({workspaceId:r})});n.ok||console.error("Failed to mark provider as connected:",await n.text())}catch(e){console.error("Error marking provider as connected:",e)}await X(),B(!0)},[X,t.id,t.name,O,r]),U=(0,s.useCallback)(()=>{null==p||p()},[p]),H=(0,s.useCallback)(()=>{null==b||b()},[b]),V=(0,s.useCallback)(async()=>{await X(),null==m||m()},[X,m]);return(0,n.jsxs)("div",{className:"flex flex-col rounded-xl overflow-hidden border border-border-subtle ".concat(g),children:[f&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-subtle bg-bg-tertiary",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center text-white font-bold text-sm",style:{backgroundColor:t.color},children:t.displayName[0]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("h4",{className:"text-sm font-semibold text-text-primary",children:[t.displayName," Setup"]}),(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Interactive terminal"})]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[A&&(0,n.jsxs)("span",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-success/15 text-xs text-success",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-success animate-pulse"}),"Connected"]}),m&&(0,n.jsx)("button",{onClick:V,className:"p-1.5 rounded-lg hover:bg-bg-hover text-text-muted hover:text-text-primary transition-colors",children:(0,n.jsx)(l,{})})]})]}),_?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-6",children:[(0,n.jsx)("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:"".concat(t.color,"20")},children:(0,n.jsx)(u,{className:"w-8 h-8",style:{color:t.color}})}),(0,n.jsxs)("h3",{className:"text-lg font-semibold text-text-primary mb-2",children:[t.displayName," Connected!"]}),(0,n.jsxs)("p",{className:"text-sm text-text-muted mb-6 text-center",children:["Your ",t.displayName," account has been successfully connected."]}),(0,n.jsxs)("div",{className:"flex gap-3",children:[b&&(0,n.jsx)("button",{onClick:H,className:"px-4 py-2 bg-bg-hover text-text-primary text-sm font-medium rounded-lg hover:bg-bg-tertiary transition-colors border border-border-subtle",children:"Connect Another Provider"}),(0,n.jsx)("button",{onClick:U,className:"px-4 py-2 bg-accent-cyan text-bg-deep text-sm font-semibold rounded-lg hover:bg-accent-cyan/90 transition-colors",children:"Continue to Dashboard"})]})]}):(0,n.jsxs)(n.Fragment,{children:[W&&(0,n.jsxs)("div",{className:"px-4 py-3 bg-error/10 border-b border-error/30 text-sm text-error flex items-center gap-2",children:[(0,n.jsx)(d,{}),(0,n.jsx)("span",{children:W}),(0,n.jsx)("button",{onClick:z,className:"ml-auto text-xs px-2 py-1 rounded bg-error/20 hover:bg-error/30 transition-colors",children:"Retry"})]}),S&&(0,n.jsxs)("div",{className:"px-4 py-3 bg-accent-cyan/10 border-b border-accent-cyan/30 text-sm text-accent-cyan flex items-center gap-2",children:[(0,n.jsx)("div",{className:"w-4 h-4 border-2 border-accent-cyan/30 border-t-accent-cyan rounded-full animate-spin"}),(0,n.jsxs)("span",{children:["Starting ",t.displayName,"..."]})]}),(0,n.jsx)("div",{ref:y,className:"flex-1 bg-[#0d0f14]",style:{minHeight:"300px",maxHeight:x},onClick:()=>{var e;return null===(e=j.current)||void 0===e?void 0:e.focus()}}),(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-border-subtle bg-bg-tertiary",children:[(0,n.jsx)("p",{className:"text-xs text-text-muted",children:"Respond to prompts above to complete setup"}),(0,n.jsx)("button",{onClick:J,className:"px-4 py-2 bg-accent-cyan text-bg-deep text-sm font-semibold rounded-lg hover:bg-accent-cyan/90 transition-colors",children:"Done - Continue"})]})]})]})}function l(){return(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,n.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,n.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function d(){return(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,n.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}function u(e){let{className:t,style:r}=e;return(0,n.jsx)("svg",{className:t,style:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"20 6 9 17 4 12"})})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9175],{9175:function(e,t,r){r.d(t,{c:function(){return i}});var o=r(7573),n=r(7653),s=r(1994),l=r(4722);let a={anthropic:{authMethod:"oauth",requiresUrlCopy:!0},codex:{authMethod:"oauth",requiresUrlCopy:!0},openai:{authMethod:"oauth",requiresUrlCopy:!0},google:{authMethod:"terminal"},opencode:{authMethod:"terminal"},droid:{authMethod:"terminal"},cursor:{authMethod:"oauth",requiresUrlCopy:!0}};function i(e){let{providers:t,connectedProviders:r,workspaceId:i,csrfToken:d,onProviderConnected:c,onConnectAnother:u,onContinue:m,showDetailedInfo:h=!0}=e,[x,b]=(0,n.useState)(null),[p,g]=(0,n.useState)("select"),[j,N]=(0,n.useState)(null),f=e=>{let t=a[e.id];(null==t?void 0:t.authMethod)==="terminal"?(b(e.id),g("terminal")):(null==t?void 0:t.authMethod)==="oauth"?(b(e.id),g("oauth")):(b(e.id),g("terminal")),N(null)},y=e=>{c(e),b(null),g("select")},v=()=>{b(null),g("select")},w=e=>{N(e),b(null),g("select")},k=e=>"codex"===e?r.includes("codex")||r.includes("openai"):r.includes(e);if(x&&"select"!==p){let e=t.find(e=>e.id===x);if(!e)return null;let r=a[e.id];return(0,o.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,o.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,o.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold",style:{backgroundColor:e.color},children:e.displayName[0]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)("h3",{className:"text-lg font-semibold text-white",children:[e.displayName," Setup"]}),(0,o.jsx)("p",{className:"text-sm text-text-muted",children:"terminal"===p?"Interactive terminal":"OAuth authentication"})]}),(0,o.jsx)("button",{onClick:v,className:"ml-auto p-2 text-text-muted hover:text-white transition-colors","aria-label":"Close",children:(0,o.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),j&&(0,o.jsx)("div",{className:"mb-4 p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,o.jsx)("p",{className:"text-error text-sm",children:j})}),"terminal"===p&&(0,o.jsx)(s.$,{provider:{id:e.cliCommand||e.id,name:e.id,displayName:e.displayName,color:e.color},workspaceId:i,csrfToken:d,maxHeight:"400px",showHeader:!1,onSuccess:()=>y(e.id),onCancel:v,onConnectAnother:()=>{y(e.id),null==u||u()},onError:w}),"oauth"===p&&r&&(0,o.jsx)(l.j,{provider:{id:e.id,name:e.cliCommand||e.id,displayName:e.displayName,color:e.color,requiresUrlCopy:r.requiresUrlCopy},workspaceId:i,csrfToken:d,onSuccess:()=>y(e.id),onCancel:v,onError:w}),(0,o.jsx)("button",{onClick:v,className:"mt-4 text-sm text-text-muted hover:text-white transition-colors",children:"← Back to provider list"})]})}return(0,o.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,o.jsx)("h2",{className:"text-lg font-semibold text-white mb-4",children:"Choose an AI Provider"}),j&&(0,o.jsx)("div",{className:"mb-4 p-3 bg-error/10 border border-error/20 rounded-lg",children:(0,o.jsx)("p",{className:"text-error text-sm",children:j})}),(0,o.jsx)("div",{className:"space-y-3",children:t.map(e=>{let t=k(e.id),r=a[e.id],n=(null==r?void 0:r.authMethod)==="terminal";return(null==r||r.authMethod,h&&("anthropic"===e.id||"codex"===e.id||"cursor"===e.id))?(0,o.jsxs)("div",{className:"p-4 bg-bg-tertiary rounded-xl border space-y-4 ".concat(t?"border-green-500/50":"border-border-subtle"),children:[(0,o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,o.jsxs)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold flex-shrink-0 relative",style:{backgroundColor:e.color},children:[e.displayName[0],t&&(0,o.jsx)("div",{className:"absolute -top-1 -right-1 w-5 h-5 bg-green-500 rounded-full flex items-center justify-center",children:(0,o.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})})]}),(0,o.jsxs)("div",{className:"flex-1",children:[(0,o.jsx)("p",{className:"text-white font-medium",children:e.displayName}),(0,o.jsx)("p",{className:"text-text-muted text-sm",children:e.name})]}),t&&(0,o.jsx)("span",{className:"text-green-400 text-sm font-medium",children:"Connected"})]}),!t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"p-3 bg-accent-cyan/10 border border-accent-cyan/30 rounded-lg",children:[(0,o.jsx)("p",{className:"text-sm text-accent-cyan font-medium mb-1",children:n?"Interactive terminal setup":"CLI-assisted authentication"}),(0,o.jsx)("p",{className:"text-xs text-accent-cyan/80",children:n?"Connect ".concat(e.displayName," using an interactive terminal. You'll see the CLI start up and can complete the OAuth login directly in the terminal."):"".concat(e.displayName," auth uses a CLI command to capture the OAuth callback locally. Click the button below and we'll show you a command with a unique session token to run in your terminal.")})]}),(0,o.jsxs)("button",{onClick:()=>f(e),className:"w-full flex items-center justify-center gap-2 p-3 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all",children:[(0,o.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Connect with ",e.displayName]})]})]},e.id):(0,o.jsxs)("button",{onClick:()=>!t&&!e.comingSoon&&f(e),disabled:t||e.comingSoon,className:"w-full flex items-center gap-3 p-4 bg-bg-tertiary rounded-xl border transition-colors text-left ".concat(e.comingSoon?"border-border-subtle opacity-60 cursor-not-allowed":t?"border-green-500/50 cursor-default":"border-border-subtle hover:border-accent-cyan/50"),children:[(0,o.jsxs)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold flex-shrink-0 relative ".concat(e.comingSoon?"grayscale":""),style:{backgroundColor:e.color},children:[e.displayName[0],t&&(0,o.jsx)("div",{className:"absolute -top-1 -right-1 w-5 h-5 bg-green-500 rounded-full flex items-center justify-center",children:(0,o.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})})]}),(0,o.jsxs)("div",{className:"flex-1",children:[(0,o.jsxs)("p",{className:"text-white font-medium flex items-center gap-2",children:[e.displayName,e.comingSoon&&(0,o.jsx)("span",{className:"px-2 py-0.5 bg-amber-400/20 text-amber-400 text-xs font-medium rounded-full",children:"Coming Soon"})]}),(0,o.jsx)("p",{className:"text-text-muted text-sm",children:e.description||e.name})]}),e.comingSoon?(0,o.jsx)("span",{className:"text-text-muted text-sm",children:"Not available yet"}):t?(0,o.jsx)("span",{className:"text-green-400 text-sm font-medium",children:"Connected"}):(0,o.jsx)("svg",{className:"w-5 h-5 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]},e.id)})}),(u||m)&&r.length>0&&(0,o.jsxs)("div",{className:"mt-6 pt-4 border-t border-border-subtle space-y-3",children:[u&&(0,o.jsx)("button",{onClick:u,className:"w-full py-3 px-4 bg-bg-tertiary border border-border-subtle text-white rounded-xl text-center hover:border-accent-cyan/50 transition-colors",children:"Connect Another Provider"}),m&&(0,o.jsx)("button",{onClick:m,className:"w-full py-3 px-4 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl text-center hover:shadow-glow-cyan transition-all",children:"Continue to Dashboard"})]}),0===r.length&&m&&(0,o.jsx)("div",{className:"mt-6 text-center",children:(0,o.jsx)("button",{onClick:m,className:"text-text-muted hover:text-white transition-colors text-sm",children:"Skip for now - I'll connect later"})})]})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9372],{9372:function(n,e,a){a.d(e,{n:function(){return o}});var t=a(7573),r=a(7653);let i=[{id:"creating",name:"Initialize",description:"Creating workspace container",estimatedSeconds:5,icon:"◈"},{id:"networking",name:"Network",description:"Configuring DNS & IP allocation",estimatedSeconds:8,icon:"◇"},{id:"secrets",name:"Secure",description:"Encrypting credentials",estimatedSeconds:3,icon:"◆"},{id:"machine",name:"Deploy",description:"Launching cloud instance",estimatedSeconds:25,icon:"▣"},{id:"booting",name:"Boot",description:"Starting relay services",estimatedSeconds:20,icon:"▢"},{id:"health",name:"Verify",description:"Running health checks",estimatedSeconds:15,icon:"◉"}],s=["> Establishing secure connection...","> Allocating compute resources...","> Configuring agent protocols...","> Initializing relay broker...","> Syncing workspace state...","> Warming up inference engine...","> Connecting to neural mesh...","> Deploying agent swarm..."];function o(n){let{currentStage:e,isProvisioning:a,workspaceName:o,error:d,onCancel:p}=n,[g,m]=(0,r.useState)(0),[x,b]=(0,r.useState)([]),[h,f]=(0,r.useState)(!0);(0,r.useEffect)(()=>{if(!a){m(0);return}let n=setInterval(()=>{m(n=>n+1)},1e3);return()=>clearInterval(n)},[a]),(0,r.useEffect)(()=>{let n=setInterval(()=>{f(n=>!n)},530);return()=>clearInterval(n)},[]),(0,r.useEffect)(()=>{if(!a){b([]);return}let n=()=>{let n=s[Math.floor(Math.random()*s.length)];b(e=>[...e.slice(-4),n])};n();let e=setInterval(n,3500);return()=>clearInterval(e)},[a]);let u=(0,r.useMemo)(()=>{if(e){let n=i.findIndex(n=>n.id===e);return n>=0?n:0}let n=0;for(let e=0;e<i.length;e++)if(g<(n+=i[e].estimatedSeconds))return e;return i.length-1},[e,g]),v=(0,r.useMemo)(()=>i.reduce((n,e)=>n+e.estimatedSeconds,0),[]),y=(0,r.useMemo)(()=>Math.min(95,Math.round(g/v*100)),[g,v]);return d?(0,t.jsxs)("div",{className:"prov-container prov-error",children:[(0,t.jsx)("div",{className:"error-glitch",children:(0,t.jsx)("span",{className:"error-icon",children:"✕"})}),(0,t.jsx)("h3",{className:"error-title",children:"PROVISIONING FAILED"}),(0,t.jsx)("p",{className:"error-message",children:d}),p&&(0,t.jsx)("button",{onClick:p,className:"retry-btn",children:(0,t.jsx)("span",{children:"RETRY"})}),(0,t.jsx)("style",{children:c})]}):(0,t.jsxs)("div",{className:"prov-container",children:[(0,t.jsx)("div",{className:"ambient-glow"}),(0,t.jsx)("div",{className:"scan-line"}),(0,t.jsxs)("header",{className:"prov-header",children:[(0,t.jsx)("div",{className:"header-badge",children:"PROVISIONING"}),(0,t.jsx)("h1",{className:"header-title",children:o||"Workspace"}),(0,t.jsxs)("div",{className:"header-meta",children:[(0,t.jsx)("span",{className:"meta-time",children:(n=>{let e=Math.floor(n/60),a=n%60;return e>0?"".concat(e,":").concat(a.toString().padStart(2,"0")):"0:".concat(a.toString().padStart(2,"0"))})(g)}),(0,t.jsx)("span",{className:"meta-sep",children:"•"}),(0,t.jsxs)("span",{className:"meta-percent",children:[y,"%"]})]})]}),(0,t.jsxs)("div",{className:"progress-track",children:[(0,t.jsx)("div",{className:"progress-fill",style:{width:"".concat(y,"%")}}),(0,t.jsx)("div",{className:"progress-glow",style:{left:"".concat(y,"%")}})]}),(0,t.jsx)("div",{className:"stages-timeline",children:i.map((n,e)=>{let a=e<u,r=e===u,i=e>u;return(0,t.jsxs)("div",{className:"stage-row ".concat(a?"completed":""," ").concat(r?"current":""," ").concat(i?"pending":""),children:[e>0&&(0,t.jsxs)("div",{className:"stage-connector ".concat(a?"active":""),children:[(0,t.jsx)("div",{className:"connector-line"}),a&&(0,t.jsx)("div",{className:"connector-pulse"})]}),(0,t.jsxs)("div",{className:"stage-node",children:[(0,t.jsx)("span",{className:"node-icon",children:n.icon}),r&&(0,t.jsx)("div",{className:"node-ring"})]}),(0,t.jsxs)("div",{className:"stage-content",children:[(0,t.jsx)("span",{className:"stage-name",children:n.name}),r&&(0,t.jsx)("span",{className:"stage-desc",children:n.description})]}),(0,t.jsxs)("div",{className:"stage-status",children:[a&&(0,t.jsx)("span",{className:"status-done",children:"DONE"}),r&&(0,t.jsx)("span",{className:"status-active",children:"ACTIVE"}),i&&(0,t.jsxs)("span",{className:"status-wait",children:["~",n.estimatedSeconds,"s"]})]})]},n.id)})}),(0,t.jsxs)("div",{className:"terminal-window",children:[(0,t.jsxs)("div",{className:"terminal-header",children:[(0,t.jsx)("span",{className:"terminal-dot red"}),(0,t.jsx)("span",{className:"terminal-dot yellow"}),(0,t.jsx)("span",{className:"terminal-dot green"}),(0,t.jsx)("span",{className:"terminal-title",children:"agent-relay"})]}),(0,t.jsxs)("div",{className:"terminal-body",children:[x.map((n,e)=>(0,t.jsx)("div",{className:"terminal-line",style:{animationDelay:"".concat(.1*e,"s")},children:n},e)),(0,t.jsxs)("div",{className:"terminal-cursor",children:[(0,t.jsx)("span",{className:"cursor-prompt",children:"$"}),(0,t.jsx)("span",{className:"cursor-block ".concat(h?"visible":""),children:"_"})]})]})]}),p&&(0,t.jsx)("button",{onClick:p,className:"cancel-btn",children:"Cancel"}),(0,t.jsx)("style",{children:l})]})}let l="\n .prov-container {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 24px;\n padding: 40px 32px;\n background: linear-gradient(145deg, rgba(10, 15, 25, 0.95) 0%, rgba(5, 10, 18, 0.98) 100%);\n border: 1px solid rgba(6, 182, 212, 0.15);\n border-radius: 16px;\n overflow: hidden;\n font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;\n }\n\n /* Ambient effects */\n .ambient-glow {\n position: absolute;\n top: -100px;\n left: 50%;\n transform: translateX(-50%);\n width: 300px;\n height: 200px;\n background: radial-gradient(ellipse, rgba(6, 182, 212, 0.12) 0%, transparent 70%);\n pointer-events: none;\n }\n\n .scan-line {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 2px;\n background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.4), transparent);\n animation: scanMove 3s ease-in-out infinite;\n pointer-events: none;\n }\n\n @keyframes scanMove {\n 0%, 100% { top: 0; opacity: 0.5; }\n 50% { top: 100%; opacity: 0.2; }\n }\n\n /* Header */\n .prov-header {\n text-align: center;\n position: relative;\n z-index: 1;\n }\n\n .header-badge {\n display: inline-block;\n padding: 4px 12px;\n background: rgba(6, 182, 212, 0.1);\n border: 1px solid rgba(6, 182, 212, 0.3);\n border-radius: 4px;\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 2px;\n color: #06b6d4;\n margin-bottom: 12px;\n }\n\n .header-title {\n font-size: 22px;\n font-weight: 600;\n color: #f1f5f9;\n margin: 0 0 8px 0;\n letter-spacing: -0.5px;\n }\n\n .header-meta {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n font-size: 13px;\n color: #64748b;\n }\n\n .meta-time {\n font-variant-numeric: tabular-nums;\n }\n\n .meta-percent {\n color: #06b6d4;\n font-weight: 500;\n }\n\n .meta-sep {\n opacity: 0.3;\n }\n\n /* Progress bar */\n .progress-track {\n position: relative;\n height: 4px;\n background: rgba(100, 116, 139, 0.2);\n border-radius: 2px;\n overflow: visible;\n }\n\n .progress-fill {\n height: 100%;\n background: linear-gradient(90deg, #0891b2, #06b6d4, #22d3ee);\n border-radius: 2px;\n transition: width 0.5s ease;\n }\n\n .progress-glow {\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 8px;\n height: 8px;\n background: #22d3ee;\n border-radius: 50%;\n box-shadow: 0 0 16px rgba(34, 211, 238, 0.6);\n transition: left 0.5s ease;\n }\n\n /* Stages */\n .stages-timeline {\n display: flex;\n flex-direction: column;\n gap: 0;\n padding: 16px 0;\n }\n\n .stage-row {\n display: grid;\n grid-template-columns: 40px 1fr auto;\n align-items: center;\n gap: 12px;\n padding: 10px 0;\n position: relative;\n }\n\n .stage-connector {\n position: absolute;\n left: 19px;\n top: -10px;\n width: 2px;\n height: 20px;\n }\n\n .connector-line {\n width: 100%;\n height: 100%;\n background: rgba(100, 116, 139, 0.3);\n transition: background 0.3s ease;\n }\n\n .stage-connector.active .connector-line {\n background: linear-gradient(180deg, #06b6d4, rgba(6, 182, 212, 0.3));\n }\n\n .connector-pulse {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(180deg, rgba(34, 211, 238, 0.8), transparent);\n animation: pulseLine 1.5s ease-out infinite;\n }\n\n @keyframes pulseLine {\n 0% { opacity: 1; transform: translateY(-100%); }\n 100% { opacity: 0; transform: translateY(100%); }\n }\n\n .stage-node {\n width: 40px;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n }\n\n .node-icon {\n font-size: 18px;\n color: #475569;\n transition: all 0.3s ease;\n }\n\n .stage-row.completed .node-icon {\n color: #06b6d4;\n }\n\n .stage-row.current .node-icon {\n color: #22d3ee;\n text-shadow: 0 0 12px rgba(34, 211, 238, 0.5);\n }\n\n .node-ring {\n position: absolute;\n inset: 4px;\n border: 2px solid rgba(34, 211, 238, 0.4);\n border-radius: 50%;\n animation: ringPulse 2s ease-in-out infinite;\n }\n\n @keyframes ringPulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.2); opacity: 0.5; }\n }\n\n .stage-content {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n }\n\n .stage-name {\n font-size: 13px;\n font-weight: 500;\n color: #64748b;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n transition: color 0.3s ease;\n }\n\n .stage-row.completed .stage-name {\n color: #475569;\n }\n\n .stage-row.current .stage-name {\n color: #f1f5f9;\n }\n\n .stage-desc {\n font-size: 11px;\n color: #64748b;\n animation: fadeSlideIn 0.3s ease;\n }\n\n @keyframes fadeSlideIn {\n from { opacity: 0; transform: translateX(-8px); }\n to { opacity: 1; transform: translateX(0); }\n }\n\n .stage-status {\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 1px;\n }\n\n .status-done {\n color: #06b6d4;\n }\n\n .status-active {\n color: #22d3ee;\n animation: blink 1s ease-in-out infinite;\n }\n\n @keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.5; }\n }\n\n .status-wait {\n color: #475569;\n font-variant-numeric: tabular-nums;\n }\n\n /* Terminal */\n .terminal-window {\n background: rgba(0, 0, 0, 0.4);\n border: 1px solid rgba(100, 116, 139, 0.2);\n border-radius: 8px;\n overflow: hidden;\n }\n\n .terminal-header {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 12px;\n background: rgba(30, 41, 59, 0.5);\n border-bottom: 1px solid rgba(100, 116, 139, 0.15);\n }\n\n .terminal-dot {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n }\n\n .terminal-dot.red { background: #ef4444; }\n .terminal-dot.yellow { background: #eab308; }\n .terminal-dot.green { background: #22c55e; }\n\n .terminal-title {\n margin-left: auto;\n font-size: 11px;\n color: #64748b;\n }\n\n .terminal-body {\n padding: 12px;\n min-height: 100px;\n }\n\n .terminal-line {\n font-size: 12px;\n color: #94a3b8;\n padding: 2px 0;\n animation: typeIn 0.3s ease;\n }\n\n @keyframes typeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n .terminal-cursor {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-top: 8px;\n }\n\n .cursor-prompt {\n color: #06b6d4;\n font-weight: 600;\n }\n\n .cursor-block {\n color: #22d3ee;\n opacity: 0;\n transition: opacity 0.1s;\n }\n\n .cursor-block.visible {\n opacity: 1;\n }\n\n /* Cancel button */\n .cancel-btn {\n align-self: center;\n padding: 8px 20px;\n background: transparent;\n border: 1px solid rgba(100, 116, 139, 0.3);\n border-radius: 6px;\n color: #64748b;\n font-family: inherit;\n font-size: 12px;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .cancel-btn:hover {\n border-color: rgba(239, 68, 68, 0.5);\n color: #ef4444;\n }\n",c="\n .prov-container.prov-error {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n padding: 48px 32px;\n background: linear-gradient(145deg, rgba(25, 10, 10, 0.95) 0%, rgba(15, 5, 8, 0.98) 100%);\n border: 1px solid rgba(239, 68, 68, 0.2);\n border-radius: 16px;\n text-align: center;\n font-family: 'SF Mono', 'JetBrains Mono', monospace;\n }\n\n .error-glitch {\n position: relative;\n width: 64px;\n height: 64px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(239, 68, 68, 0.1);\n border: 1px solid rgba(239, 68, 68, 0.3);\n border-radius: 12px;\n }\n\n .error-icon {\n font-size: 28px;\n color: #ef4444;\n animation: glitch 0.3s ease infinite;\n }\n\n @keyframes glitch {\n 0%, 100% { transform: translate(0); }\n 25% { transform: translate(-2px, 1px); }\n 50% { transform: translate(2px, -1px); }\n 75% { transform: translate(-1px, -1px); }\n }\n\n .error-title {\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 2px;\n color: #ef4444;\n margin: 0;\n }\n\n .error-message {\n font-size: 13px;\n color: #94a3b8;\n max-width: 350px;\n margin: 0;\n line-height: 1.5;\n }\n\n .retry-btn {\n margin-top: 8px;\n padding: 10px 28px;\n background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);\n border: 1px solid rgba(239, 68, 68, 0.4);\n border-radius: 6px;\n color: #ef4444;\n font-family: inherit;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 1px;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .retry-btn:hover {\n background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);\n border-color: rgba(239, 68, 68, 0.6);\n transform: translateY(-1px);\n }\n"}}]);
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[440],{2547:function(e,i,s){let r,n,o,h,a,l,c,d,_,u,f,g,p;s.d(i,{o:function(){return rZ}});var v=s(4859),m=Object.defineProperty,S=Object.getOwnPropertyDescriptor,w=(e,i,s,r)=>{for(var n,o=r>1?void 0:r?S(i,s):i,h=e.length-1;h>=0;h--)(n=e[h])&&(o=(r?n(i,s,o):n(o))||o);return r&&o&&m(i,s,o),o},b=(e,i)=>(s,r)=>i(s,r,e),y="Terminal input",C=()=>y,k=e=>y=e,x="Too much output to announce, navigate to rows manually to read",E={get:()=>x,set:e=>x=e};function B(e,i,s,r){var n;n=e=e.replace(/\r?\n/g,"\r"),e=s.decPrivateModes.bracketedPasteMode&&!0!==r.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+n+"\x1b[201~":n,s.triggerDataEvent(e,!0),i.value=""}function D(e,i,s){let r=s.getBoundingClientRect(),n=e.clientX-r.left-10,o=e.clientY-r.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${n}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function R(e,i,s,r,n){D(e,i,s),n&&r.rightClickSelect(e),i.value=r.selectionText,i.select()}function M(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function L(e,i=0,s=e.length){let r="";for(let n=i;n<s;++n){let i=e[n];i>65535?(i-=65536,r+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):r+=String.fromCharCode(i)}return r}var P=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n=0;if(this._interim){let s=e.charCodeAt(n++);56320<=s&&s<=57343?i[r++]=(this._interim-55296)*1024+s-56320+65536:(i[r++]=this._interim,i[r++]=s),this._interim=0}for(let o=n;o<s;++o){let n=e.charCodeAt(o);if(55296<=n&&n<=56319){if(++o>=s)return this._interim=n,r;let h=e.charCodeAt(o);56320<=h&&h<=57343?i[r++]=(n-55296)*1024+h-56320+65536:(i[r++]=n,i[r++]=h);continue}65279!==n&&(i[r++]=n)}return r}},T=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n,o,h,a,l=0,c=0;if(this.interim[0]){let n=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let h=0,a;for(;(a=63&this.interim[++h])&&h<4;)o<<=6,o|=a;let l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,d=l-h;for(;c<d;){if(c>=s)return 0;if((192&(a=e[c++]))!=128){c--,n=!0;break}this.interim[h++]=a,o<<=6,o|=63&a}n||(2===l?o<128?c--:i[r++]=o:3===l?o<2048||o>=55296&&o<=57343||65279===o||(i[r++]=o):o<65536||o>1114111||(i[r++]=o)),this.interim.fill(0)}let d=s-4,_=c;for(;_<s;){for(;_<d&&!(128&(n=e[_]))&&!(128&(o=e[_+1]))&&!(128&(h=e[_+2]))&&!(128&(a=e[_+3]));)i[r++]=n,i[r++]=o,i[r++]=h,i[r++]=a,_+=4;if((n=e[_++])<128)i[r++]=n;else if((224&n)==192){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128||(l=(31&n)<<6|63&o)<128){_--;continue}i[r++]=l}else if((240&n)==224){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if((l=(15&n)<<12|(63&o)<<6|63&h)<2048||l>=55296&&l<=57343||65279===l)continue;i[r++]=l}else if((248&n)==240){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=h,r;if((192&(a=e[_++]))!=128){_--;continue}if((l=(7&n)<<18|(63&o)<<12|(63&h)<<6|63&a)<65536||l>1114111)continue;i[r++]=l}}return r}},A=class e{constructor(){this.fg=0,this.bg=0,this.extended=new O}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return -1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return -1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},O=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},I=class e extends A{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new O,this.combinedData=""}static fromCharData(i){let s=new e;return s.setFromCharData(i),s}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?M(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},N="di$target",H="di$dependencies",W=new Map;function z(e){if(W.has(e))return W.get(e);let i=function(e,s,r){if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");e[N]===e?e[H].push({id:i,index:r}):(e[H]=[{id:i,index:r}],e[N]=e)};return i._id=e,W.set(e,i),i}var F=z("BufferService"),$=z("CoreMouseService"),K=z("CoreService"),U=z("CharsetService"),q=z("InstantiationService"),V=z("LogService"),Y=z("OptionsService"),X=z("OscLinkService"),j=z("UnicodeService"),G=z("DecorationService"),J=class{constructor(e,i,s){this._bufferService=e,this._optionsService=i,this._oscLinkService=s}provideLinks(e,i){let s=this._bufferService.buffer.lines.get(e-1);if(!s){i(void 0);return}let r=[],n=this._optionsService.rawOptions.linkHandler,o=new I,h=s.getTrimmedLength(),a=-1,l=-1,c=!1;for(let i=0;i<h;i++)if(!(-1===l&&!s.hasContent(i))){if(s.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId){if(-1===l){l=i,a=o.extended.urlId;continue}c=o.extended.urlId!==a}else -1!==l&&(c=!0);if(c||-1!==l&&i===h-1){let s=this._oscLinkService.getLinkData(a)?.uri;if(s){let o={start:{x:l+1,y:e},end:{x:i+(c||i!==h-1?0:1),y:e}},a=!1;if(!n?.allowNonHttpProtocols)try{let e=new URL(s);["http:","https:"].includes(e.protocol)||(a=!0)}catch{a=!0}a||r.push({text:s,range:o,activate:(e,i)=>n?n.activate(e,i,o):function(e,i){if(confirm(`Do you want to navigate to ${i}?
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3440],{2547:function(e,i,s){let r,n,o,h,a,l,c,d,_,u,f,g,p;s.d(i,{o:function(){return rZ}});var v=s(4859),m=Object.defineProperty,S=Object.getOwnPropertyDescriptor,w=(e,i,s,r)=>{for(var n,o=r>1?void 0:r?S(i,s):i,h=e.length-1;h>=0;h--)(n=e[h])&&(o=(r?n(i,s,o):n(o))||o);return r&&o&&m(i,s,o),o},b=(e,i)=>(s,r)=>i(s,r,e),y="Terminal input",C=()=>y,k=e=>y=e,x="Too much output to announce, navigate to rows manually to read",E={get:()=>x,set:e=>x=e};function B(e,i,s,r){var n;n=e=e.replace(/\r?\n/g,"\r"),e=s.decPrivateModes.bracketedPasteMode&&!0!==r.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+n+"\x1b[201~":n,s.triggerDataEvent(e,!0),i.value=""}function D(e,i,s){let r=s.getBoundingClientRect(),n=e.clientX-r.left-10,o=e.clientY-r.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${n}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function R(e,i,s,r,n){D(e,i,s),n&&r.rightClickSelect(e),i.value=r.selectionText,i.select()}function M(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function L(e,i=0,s=e.length){let r="";for(let n=i;n<s;++n){let i=e[n];i>65535?(i-=65536,r+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):r+=String.fromCharCode(i)}return r}var P=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n=0;if(this._interim){let s=e.charCodeAt(n++);56320<=s&&s<=57343?i[r++]=(this._interim-55296)*1024+s-56320+65536:(i[r++]=this._interim,i[r++]=s),this._interim=0}for(let o=n;o<s;++o){let n=e.charCodeAt(o);if(55296<=n&&n<=56319){if(++o>=s)return this._interim=n,r;let h=e.charCodeAt(o);56320<=h&&h<=57343?i[r++]=(n-55296)*1024+h-56320+65536:(i[r++]=n,i[r++]=h);continue}65279!==n&&(i[r++]=n)}return r}},T=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n,o,h,a,l=0,c=0;if(this.interim[0]){let n=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let h=0,a;for(;(a=63&this.interim[++h])&&h<4;)o<<=6,o|=a;let l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,d=l-h;for(;c<d;){if(c>=s)return 0;if((192&(a=e[c++]))!=128){c--,n=!0;break}this.interim[h++]=a,o<<=6,o|=63&a}n||(2===l?o<128?c--:i[r++]=o:3===l?o<2048||o>=55296&&o<=57343||65279===o||(i[r++]=o):o<65536||o>1114111||(i[r++]=o)),this.interim.fill(0)}let d=s-4,_=c;for(;_<s;){for(;_<d&&!(128&(n=e[_]))&&!(128&(o=e[_+1]))&&!(128&(h=e[_+2]))&&!(128&(a=e[_+3]));)i[r++]=n,i[r++]=o,i[r++]=h,i[r++]=a,_+=4;if((n=e[_++])<128)i[r++]=n;else if((224&n)==192){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128||(l=(31&n)<<6|63&o)<128){_--;continue}i[r++]=l}else if((240&n)==224){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if((l=(15&n)<<12|(63&o)<<6|63&h)<2048||l>=55296&&l<=57343||65279===l)continue;i[r++]=l}else if((248&n)==240){if(_>=s)return this.interim[0]=n,r;if((192&(o=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,r;if((192&(h=e[_++]))!=128){_--;continue}if(_>=s)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=h,r;if((192&(a=e[_++]))!=128){_--;continue}if((l=(7&n)<<18|(63&o)<<12|(63&h)<<6|63&a)<65536||l>1114111)continue;i[r++]=l}}return r}},A=class e{constructor(){this.fg=0,this.bg=0,this.extended=new O}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return -1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return -1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},O=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},I=class e extends A{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new O,this.combinedData=""}static fromCharData(i){let s=new e;return s.setFromCharData(i),s}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?M(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},N="di$target",H="di$dependencies",W=new Map;function z(e){if(W.has(e))return W.get(e);let i=function(e,s,r){if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");e[N]===e?e[H].push({id:i,index:r}):(e[H]=[{id:i,index:r}],e[N]=e)};return i._id=e,W.set(e,i),i}var F=z("BufferService"),$=z("CoreMouseService"),K=z("CoreService"),U=z("CharsetService"),q=z("InstantiationService"),V=z("LogService"),Y=z("OptionsService"),X=z("OscLinkService"),j=z("UnicodeService"),G=z("DecorationService"),J=class{constructor(e,i,s){this._bufferService=e,this._optionsService=i,this._oscLinkService=s}provideLinks(e,i){let s=this._bufferService.buffer.lines.get(e-1);if(!s){i(void 0);return}let r=[],n=this._optionsService.rawOptions.linkHandler,o=new I,h=s.getTrimmedLength(),a=-1,l=-1,c=!1;for(let i=0;i<h;i++)if(!(-1===l&&!s.hasContent(i))){if(s.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId){if(-1===l){l=i,a=o.extended.urlId;continue}c=o.extended.urlId!==a}else -1!==l&&(c=!0);if(c||-1!==l&&i===h-1){let s=this._oscLinkService.getLinkData(a)?.uri;if(s){let o={start:{x:l+1,y:e},end:{x:i+(c||i!==h-1?0:1),y:e}},a=!1;if(!n?.allowNonHttpProtocols)try{let e=new URL(s);["http:","https:"].includes(e.protocol)||(a=!0)}catch{a=!0}a||r.push({text:s,range:o,activate:(e,i)=>n?n.activate(e,i,o):function(e,i){if(confirm(`Do you want to navigate to ${i}?
2
2
 
3
3
  WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}(0,i),hover:(e,i)=>n?.hover?.(e,i,o),leave:(e,i)=>n?.leave?.(e,i,o)})}c=!1,o.hasExtendedAttrs()&&o.extended.urlId?(l=i,a=o.extended.urlId):(l=-1,a=-1)}}i(r)}};J=w([b(0,F),b(1,Y),b(2,X)],J);var Z=z("CharSizeService"),Q=z("CoreBrowserService"),ee=z("MouseService"),et=z("RenderService"),ei=z("SelectionService"),es=z("CharacterJoinerService"),er=z("ThemeService"),en=z("LinkProviderService"),eo=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ec.isErrorNoTelemetry(e)?new ec(e.message+`
4
4
 
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7409],{2247:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return n(9114)}])},9114:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}}),n(1887);let i=n(7573);n(7653);let o={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},l={display:"inline-block"},r={display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},d={fontSize:14,fontWeight:400,lineHeight:"49px",margin:0};function s(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("title",{children:"404: This page could not be found."}),(0,i.jsx)("div",{style:o,children:(0,i.jsxs)("div",{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,i.jsx)("h1",{className:"next-error-h1",style:r,children:"404"}),(0,i.jsx)("div",{style:l,children:(0,i.jsx)("h2",{style:d,children:"This page could not be found."})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},function(e){e.O(0,[1293,1528,1744],function(){return e(e.s=2247)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7301],{6754:function(n,t,u){Promise.resolve().then(u.bind(u,2132))},2132:function(n,t,u){"use strict";u.r(t),u.d(t,{default:function(){return c}});var e=u(7573),r=u(717);function c(){return(0,e.jsx)(r.tP,{})}}},function(n){n.O(0,[3694,1695,1293,1528,1744],function(){return n(n.s=6754)}),_N_E=n.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2614],{9316:function(e,t,r){Promise.resolve().then(r.bind(r,387))},387:function(e,t,r){"use strict";r.d(t,{default:function(){return h}});var s=r(7573),a=r(7653),o=r(1028),n=r(5634),i=r(5118),l=r(9372),c=r(9175),d=r(2907),x=r(4859);let u=[{id:"anthropic",name:"Anthropic",displayName:"Claude",color:"#D97757",cliCommand:"claude",requiresUrlCopy:!0},{id:"codex",name:"OpenAI",displayName:"Codex",color:"#10A37F",cliCommand:"codex login",requiresUrlCopy:!0},{id:"google",name:"Google",displayName:"Gemini",color:"#4285F4",cliCommand:"gemini"},{id:"opencode",name:"OpenCode",displayName:"OpenCode",color:"#00D4AA",cliCommand:"opencode"},{id:"droid",name:"Factory",displayName:"Droid",color:"#6366F1",cliCommand:"droid"},{id:"cursor",name:"Cursor",displayName:"Cursor",color:"#7C3AED",cliCommand:"agent",requiresUrlCopy:!0}],m="true"===x.env.NEXT_PUBLIC_FORCE_CLOUD_MODE;function p(){{let e=window.__RELAY_CLOUD_CONFIG__;if(e)return e}return{isCloud:!1}}function h(){let[e,t]=(0,a.useState)("loading"),[r,x]=(0,a.useState)([]),[h,f]=(0,a.useState)([]),[b,g]=(0,a.useState)(null),[w,v]=(0,a.useState)(void 0),[j,k]=(0,a.useState)(null),[N,y]=(0,a.useState)(()=>m||p().isCloud),[C,S]=(0,a.useState)(null),[L,E]=(0,a.useState)(null),[A,M]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/auth/session",{credentials:"include"});if(404===e.status){if(m)throw Error("Cloud mode enforced but session endpoint returned 404. Is the cloud server running?");try{let e=await fetch("/api/health");if(e.ok){let t=await e.json();t.projectName&&localStorage.setItem("relay_username",t.projectName)}}catch(e){}y(!1),t("local");return}let r=e.headers.get("X-CSRF-Token");r&&(S(r),(0,d.ks)(r));let s=await e.json();if(!s.authenticated){window.location.href="/login";return}y(!0);let a={openai:"codex"};if(s.connectedProviders){let e=[];s.connectedProviders.forEach(t=>{e.push(t.provider);let r=a[t.provider];r&&e.push(r)}),M(e)}let[o,n]=await Promise.all([fetch("/api/workspaces/accessible",{credentials:"include"}),fetch("/api/github-app/repos",{credentials:"include"})]);if(!o.ok){if(401===o.status){window.location.href="/login";return}throw Error("Failed to fetch workspaces")}let i=await o.json(),l=n.ok?await n.json():{repositories:[]};x(i.workspaces||[]),f(l.repositories||[]);let c=(i.workspaces||[]).filter(e=>"running"===e.status&&e.publicUrl),u=new URLSearchParams(window.location.search);if((null==u?void 0:u.get("select"))==="true"){window.history.replaceState({},"","/app"),t("select-workspace");return}let p=localStorage.getItem("agentrelay_workspace_id"),h=p&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(p)?p:null;if(h){let e=c.find(e=>e.id===h);if(e){P(e);return}}if(1===c.length)P(c[0]);else if(c.length>1)t("select-workspace");else if((l.repositories||[]).length>0){window.location.href="/app/onboarding";return}else window.location.href="/connect-repos"}catch(e){if(e instanceof TypeError&&e.message.includes("Failed to fetch")){if(m){console.error("Cloud mode enforced but network request failed:",e),k("Cloud mode enforced but failed to connect to server. Is the cloud server running?"),t("error");return}y(!1),t("local");return}console.error("Init error:",e),k(e instanceof Error?e.message:"Failed to initialize"),t("error")}})()},[]);let P=(0,a.useCallback)(e=>{if(!e.publicUrl){k("Workspace has no public URL"),t("error");return}g(e),t("connecting"),(0,i.hc)(e.id);let r=new URL(e.publicUrl),s="https:"===r.protocol?"wss:":"ws:";v("".concat(s,"//").concat(r.host,"/ws")),t("connected")},[]),F=(0,a.useCallback)(async e=>{k(null);try{let r={"Content-Type":"application/json"};C&&(r["X-CSRF-Token"]=C);let s=await fetch("/api/workspaces/quick",{method:"POST",credentials:"include",headers:r,body:JSON.stringify({repositoryFullName:e})}),a=await s.json();if(!s.ok)throw Error(a.error||"Failed to create workspace");let o=Date.now();E({workspaceId:a.workspaceId,workspaceName:e.split("/")[1]||e,stage:null,startedAt:o}),t("provisioning");let n=async e=>{let r=0;for(;r<150;){var s;let a=await fetch("/api/workspaces/".concat(e,"/status"),{credentials:"include"}),o=await a.json();if((null===(s=o.provisioning)||void 0===s?void 0:s.stage)&&E(e=>e?{...e,stage:o.provisioning.stage}:null),"running"===o.status){let r=await fetch("/api/workspaces/".concat(e),{credentials:"include"}),s=await r.json();if(s.publicUrl){E(null),g(s),t("connect-provider");return}}else if("error"===o.status){let e=o.errorMessage||"Workspace provisioning failed";throw Error(e)}await new Promise(e=>setTimeout(e,2e3)),++r%15==0&&console.log("[workspace] Still provisioning... (".concat(Math.floor(2e3*r/1e3),"s elapsed)"))}throw Error("Workspace provisioning timed out after 5 minutes. Please try again or contact support.")};await n(a.workspaceId)}catch(e){console.error("Create workspace error:",e),E(null),k(e instanceof Error?e.message:"Failed to create workspace"),t("no-workspaces")}},[P,C]),z=(0,a.useCallback)(e=>{M(t=>[...new Set([...t,e])])},[]),_=(0,a.useCallback)(()=>{b&&P(b)},[b,P]),I=(0,a.useCallback)(async e=>{t("loading"),k(null);try{let t={};C&&(t["X-CSRF-Token"]=C);let r=await fetch("/api/workspaces/".concat(e.id,"/restart"),{method:"POST",credentials:"include",headers:t});if(!r.ok){let e=await r.json();throw Error(e.error||"Failed to start workspace")}let s=0;for(;s<60;){let t=await fetch("/api/workspaces/".concat(e.id,"/status"),{credentials:"include"}),r=await t.json();if("running"===r.status){let t=await fetch("/api/workspaces/".concat(e.id),{credentials:"include"}),r=await t.json();if(r.publicUrl){P({...e,...r});return}}await new Promise(e=>setTimeout(e,2e3)),s++}throw Error("Workspace start timed out")}catch(e){console.error("Start workspace error:",e),k(e instanceof Error?e.message:"Failed to start workspace"),t("select-workspace")}},[P,C]),U=(0,a.useMemo)(()=>{var e,t,r,s;if(!N)return null;let a=p();return{features:{workspaces:!0,auth:!0,billing:null===(r=null===(e=a.features)||void 0===e?void 0:e.billing)||void 0===r||r,teams:null===(s=null===(t=a.features)||void 0===t?void 0:t.teams)||void 0===s||s},api:(0,d.mb)(),auth:(0,d.gX)(),isCloudMode:!0}},[N]),W=e=>{let t=(0,s.jsx)(o.gV,{wsUrl:null==e?void 0:e.wsUrl,enableReactions:!0});return U?(0,s.jsx)(d.n$,{config:U,children:t}):t};if("loading"===e)return(0,s.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,s.jsx)("p",{className:"mt-4 text-text-muted",children:"Loading..."})]})});if("local"===e)return W();if("connected"===e&&w)return W({wsUrl:w});if("connecting"===e)return(0,s.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,s.jsxs)("p",{className:"mt-4 text-white font-medium",children:["Connecting to ",null==b?void 0:b.name,"..."]}),(0,s.jsx)("p",{className:"mt-2 text-text-muted text-sm",children:null==b?void 0:b.publicUrl})]})});if("provisioning"===e&&L)return(0,s.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-full max-w-xl",children:(0,s.jsx)(l.n,{isProvisioning:!0,currentStage:L.stage,workspaceName:L.workspaceName,error:j,onCancel:()=>{E(null),t("no-workspaces")}})})});if("error"===e)return(0,s.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8 max-w-md w-full text-center",children:[(0,s.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 bg-error/20 rounded-full flex items-center justify-center",children:(0,s.jsx)("svg",{className:"w-8 h-8 text-error",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,s.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Something went wrong"}),(0,s.jsx)("p",{className:"text-text-muted mb-6",children:j}),(0,s.jsx)("button",{onClick:()=>window.location.reload(),className:"w-full py-3 px-4 bg-bg-tertiary border border-border-subtle rounded-xl text-white font-medium hover:bg-bg-hover transition-colors",children:"Try Again"})]})});if("connect-provider"===e&&b)return(0,s.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"fixed inset-0 opacity-10 pointer-events-none",children:(0,s.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,s.jsxs)("div",{className:"relative z-10 w-full max-w-xl",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,s.jsx)(n.K7,{size:48,withGlow:!0}),(0,s.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Connect AI Provider"}),(0,s.jsxs)("p",{className:"mt-2 text-text-muted text-center",children:["Your workspace ",(0,s.jsx)("span",{className:"text-white",children:b.name})," is ready!",(0,s.jsx)("br",{}),"Connect an AI provider to start using agents."]})]}),(0,s.jsx)(c.c,{providers:u,connectedProviders:A,workspaceId:b.id,csrfToken:C||void 0,onProviderConnected:z,onContinue:_,showDetailedInfo:!0})]})]});if("create-workspace"===e){let e=new Set(r.flatMap(e=>{let t=[];e.repositories&&e.repositories.length>0&&e.repositories.forEach(e=>t.push(e.toLowerCase()));let r=e.name.match(/(?:Workspace for\s+)?(.+\/.+)/i);return r&&t.push(r[1].toLowerCase()),t})),a=h.filter(t=>!e.has(t.fullName.toLowerCase()));return(0,s.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"fixed inset-0 opacity-10 pointer-events-none",children:(0,s.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,s.jsxs)("div",{className:"relative z-10 w-full max-w-2xl",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,s.jsx)(n.K7,{size:48,withGlow:!0}),(0,s.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Create Workspace"}),(0,s.jsx)("p",{className:"mt-2 text-text-muted",children:"Select a repository to create a workspace"})]}),j&&(0,s.jsx)("div",{className:"mb-4 p-4 bg-error/10 border border-error/20 rounded-xl",children:(0,s.jsx)("p",{className:"text-error",children:j})}),(0,s.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,s.jsxs)("button",{onClick:()=>t("select-workspace"),className:"mb-4 flex items-center gap-2 text-text-muted hover:text-white transition-colors text-sm",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),"Back to workspaces"]}),(0,s.jsx)("h2",{className:"text-lg font-semibold text-white mb-4",children:"Available Repositories"}),(0,s.jsx)("p",{className:"text-text-muted mb-6 text-sm",children:"These are repositories the GitHub App has access to that don't have a workspace yet."}),a.length>0?(0,s.jsx)("div",{className:"space-y-3",children:a.map(e=>(0,s.jsxs)("button",{onClick:()=>F(e.fullName),className:"w-full flex items-center gap-3 p-4 bg-bg-tertiary rounded-xl border border-border-subtle hover:border-accent-cyan/50 transition-colors text-left",children:[(0,s.jsx)("svg",{className:"w-5 h-5 text-text-muted flex-shrink-0",fill:"currentColor",viewBox:"0 0 16 16",children:(0,s.jsx)("path",{d:"M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8z"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-white font-medium truncate",children:e.fullName}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:e.isPrivate?"Private":"Public"})]}),(0,s.jsx)("svg",{className:"w-5 h-5 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]},e.id))}):(0,s.jsxs)("div",{className:"text-center py-8",children:[(0,s.jsx)("p",{className:"text-text-muted mb-4",children:"All connected repositories already have workspaces."}),(0,s.jsxs)("a",{href:"/connect-repos",className:"inline-flex items-center gap-2 py-3 px-6 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all",children:[(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})}),"Connect More Repositories"]})]})]})]})]})}return(0,s.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"fixed inset-0 opacity-10 pointer-events-none",children:(0,s.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,s.jsxs)("div",{className:"relative z-10 w-full max-w-2xl",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,s.jsx)(n.K7,{size:48,withGlow:!0}),(0,s.jsx)("h1",{className:"mt-4 text-2xl font-bold text-white",children:"Agent Relay"}),(0,s.jsx)("p",{className:"mt-2 text-text-muted",children:"no-workspaces"===e?"Create a workspace to get started":"Select a workspace"})]}),j&&(0,s.jsx)("div",{className:"mb-4 p-4 bg-error/10 border border-error/20 rounded-xl",children:(0,s.jsx)("p",{className:"text-error",children:j})}),"select-workspace"===e&&r.length>0&&(0,s.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-white mb-4",children:"Your Workspaces"}),(0,s.jsx)("div",{className:"space-y-3",children:r.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 bg-bg-tertiary rounded-xl border border-border-subtle hover:border-accent-cyan/50 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-3 h-3 rounded-full ".concat("running"===e.status?"bg-success":"provisioning"===e.status?"bg-warning animate-pulse":"error"===e.status?"bg-error":"bg-gray-500")}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-medium text-white",children:e.name}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"running"===e.status?"Running":"provisioning"===e.status?"Starting...":"stopped"===e.status?"Stopped":"Error"})]})]}),(0,s.jsx)("div",{children:"running"===e.status&&e.publicUrl?(0,s.jsx)("button",{onClick:()=>P(e),className:"py-2 px-4 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-lg hover:shadow-glow-cyan transition-all",children:"Connect"}):"stopped"===e.status?(0,s.jsx)("button",{onClick:()=>I(e),className:"py-2 px-4 bg-bg-card border border-border-subtle rounded-lg text-white hover:border-accent-cyan/50 transition-colors",children:"Start"}):"provisioning"===e.status?(0,s.jsx)("span",{className:"text-text-muted text-sm",children:"Starting..."}):"error"===e.status?(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>I(e),className:"py-2 px-4 bg-accent-cyan/10 border border-accent-cyan/30 rounded-lg text-accent-cyan text-sm font-medium hover:bg-accent-cyan/20 transition-colors",children:"Restart"}),(0,s.jsx)("a",{href:"/app/settings/workspace",className:"py-2 px-3 text-text-muted text-sm hover:text-white transition-colors",title:"Workspace settings",children:(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,s.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})})]}):(0,s.jsx)("span",{className:"text-error text-sm",children:"Failed"})})]},e.id))}),(()=>{let e=new Set(r.flatMap(e=>{let t=[];e.repositories&&e.repositories.length>0&&e.repositories.forEach(e=>t.push(e.toLowerCase()));let r=e.name.match(/(?:Workspace for\s+)?(.+\/.+)/i);return r&&t.push(r[1].toLowerCase()),t}));return 0===h.filter(t=>!e.has(t.fullName.toLowerCase())).length?null:(0,s.jsxs)("div",{className:"mt-6 pt-6 border-t border-border-subtle",children:[(0,s.jsx)("p",{className:"text-text-muted text-sm mb-3",children:"Or create a new workspace:"}),(0,s.jsxs)("button",{onClick:()=>t("create-workspace"),className:"py-2 px-4 bg-bg-card border border-border-subtle rounded-lg text-sm text-white hover:border-accent-cyan/50 transition-colors flex items-center gap-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Create"]})]})})()]}),"no-workspaces"===e&&(0,s.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-white mb-4",children:"Create Your First Workspace"}),(0,s.jsx)("p",{className:"text-text-muted mb-6",children:"Select a repository to create a workspace where agents can work on your code."}),h.length>0?(0,s.jsx)("div",{className:"space-y-3",children:h.map(e=>(0,s.jsxs)("button",{onClick:()=>F(e.fullName),className:"w-full flex items-center gap-3 p-4 bg-bg-tertiary rounded-xl border border-border-subtle hover:border-accent-cyan/50 transition-colors text-left",children:[(0,s.jsx)("svg",{className:"w-5 h-5 text-text-muted flex-shrink-0",fill:"currentColor",viewBox:"0 0 16 16",children:(0,s.jsx)("path",{d:"M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8z"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-white font-medium truncate",children:e.fullName}),(0,s.jsx)("p",{className:"text-text-muted text-sm",children:e.isPrivate?"Private":"Public"})]}),(0,s.jsx)("svg",{className:"w-5 h-5 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]},e.id))}):(0,s.jsxs)("div",{className:"text-center py-8",children:[(0,s.jsx)("p",{className:"text-text-muted mb-4",children:"No repositories connected yet."}),(0,s.jsxs)("a",{href:"/connect-repos",className:"inline-flex items-center gap-2 py-3 px-6 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all",children:[(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})}),"Connect GitHub"]})]})]}),(0,s.jsxs)("div",{className:"mt-6 flex justify-center gap-4 text-sm",children:[(0,s.jsx)("a",{href:"/connect-repos",className:"text-text-muted hover:text-white transition-colors",children:"Manage Repositories"}),(0,s.jsx)("span",{className:"text-text-muted",children:"\xb7"}),(0,s.jsx)("button",{onClick:async()=>{let e={};C&&(e["X-CSRF-Token"]=C),await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:e}),window.location.href="/login"},className:"text-text-muted hover:text-white transition-colors",children:"Sign Out"})]})]})]})}}},function(e){e.O(0,[3440,6940,3677,5118,1705,7894,1028,9372,9175,1293,1528,1744],function(){return e(e.s=9316)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1615],{5077:function(e,t,r){Promise.resolve().then(r.bind(r,7657))},1695:function(e,t,r){"use strict";var a=r(1219);r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}}),r.o(a,"useSearchParams")&&r.d(t,{useSearchParams:function(){return a.useSearchParams}})},7657:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return m}});var a=r(7573),n=r(7653),s=r(1695),o=r(5634),c=r(9372);async function i(){let e=await fetch("/api/onboarding/next-step",{credentials:"include"});if(!e.ok)throw Error("Failed to fetch onboarding next step");return await e.json()}let l=[{id:"anthropic",label:"Anthropic",description:"Claude models via Anthropic",color:"#D97757"},{id:"openai",label:"OpenAI",description:"Codex and GPT models",color:"#10A37F"},{id:"cursor",label:"Cursor",description:"Cursor AI editor",color:"#7C3AED"},{id:"google",label:"Google",description:"Gemini models via Google AI",color:"#4285F4"},{id:"opencode",label:"OpenCode",description:"Coming soon",color:"#6B7280"},{id:"droid",label:"Droid",description:"Coming soon",color:"#6B7280"}],d={anthropic:["anthropic"],openai:["openai","codex"],cursor:["cursor"],google:["google"],opencode:["opencode"],droid:["droid"]};function u(e){return new Promise(t=>setTimeout(t,e))}function p(){let e=(0,s.useSearchParams)().get("reason")||"new",[t,r]=(0,n.useState)([]),[p,m]=(0,n.useState)(new Set),[h,b]=(0,n.useState)(null),[f,g]=(0,n.useState)("anthropic"),[y,w]=(0,n.useState)("api_key"),[v,j]=(0,n.useState)(""),[k,N]=(0,n.useState)(null),[C,S]=(0,n.useState)(new Set),[_,P]=(0,n.useState)(!0),[A,I]=(0,n.useState)(!1),[L,E]=(0,n.useState)(!1),[W,z]=(0,n.useState)(!1),[R,F]=(0,n.useState)("idle"),[T,O]=(0,n.useState)(null),[M,B]=(0,n.useState)(null),[D,G]=(0,n.useState)(null),[K,V]=(0,n.useState)(null),[J,H]=(0,n.useState)(null),[Y,U]=(0,n.useState)(!1),X=(0,n.useRef)(!1),q=(0,n.useRef)(!1),{trackEvent:Q}={trackEvent:(0,n.useCallback)((e,t)=>{try{fetch("/api/analytics/track",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({event:e,properties:t,timestamp:Date.now()})}).catch(()=>{})}catch(e){}},[])},Z=(0,n.useMemo)(()=>l.find(e=>e.id===f)||l[0],[f]),$=(0,n.useCallback)(function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=e?{"Content-Type":"application/json"}:{};return K&&(t["X-CSRF-Token"]=K),t},[K]),ee=(0,n.useCallback)((e,t)=>{var r;let a=(null==t?void 0:t.selectedRepo)||(null==t?void 0:t.repositoryFullName)||(null==t?void 0:null===(r=t.repository)||void 0===r?void 0:r.fullName)||"";return a&&e.some(e=>e.fullName===a)?new Set([a]):e.length>0?new Set([e[0].fullName]):new Set},[]),et=(0,n.useCallback)(async()=>{try{let e=await i();return"string"==typeof e.nextStep&&b(e.nextStep),e}catch(e){return null}},[]),er=(0,n.useCallback)(async e=>{if(e)try{let t=await fetch("/api/auth/ssh/status/".concat(e),{credentials:"include"});if(t.ok){let e=await t.json();if(d[f].some(t=>{var r;return null===(r=e.providers)||void 0===r?void 0:r.some(e=>e.name===t&&"connected"===e.status)}))return!0}}catch(e){}let t=await et();if(!t)return!1;if(t.nextStep&&"connect_ai_provider"!==t.nextStep)return!0;let r=Array.isArray(t.connectedProviders)?t.connectedProviders:[];return d[f].some(e=>r.includes(e))},[et,f]),ea=(0,n.useCallback)(async e=>{q.current=!0;try{let r=0,a=0;for(;q.current&&r<150;){try{var t;let n=await fetch("/api/workspaces/".concat(e,"/status"),{credentials:"include"});if(!n.ok){if(a++,console.warn("[onboarding] Status poll returned ".concat(n.status," (attempt ").concat(a,")")),a>=5)throw Error("Workspace status check failed (HTTP ".concat(n.status,")"));await u(2e3),r+=1;continue}a=0;let s=await n.json();if((null===(t=s.provisioning)||void 0===t?void 0:t.stage)&&B(s.provisioning.stage),"running"===s.status){F("running");return}if("error"===s.status||"stopped"===s.status)throw Error(s.errorMessage||"Workspace ".concat("stopped"===s.status?"stopped unexpectedly":"provisioning failed"))}catch(e){if(e instanceof Error&&(e.message.includes("provisioning failed")||e.message.includes("stopped unexpectedly")||e.message.includes("status check failed")))throw e;if(a++,console.warn("[onboarding] Status poll network error (attempt ".concat(a,"):"),e),a>=5)throw Error("Unable to reach workspace status endpoint")}await u(2e3),r+=1}throw Error("Workspace provisioning timed out after 5 minutes.")}finally{q.current=!1}},[]),en=(0,n.useCallback)(async e=>{let t=e&&e.length>0?e:Array.from(p);if(0!==t.length&&!W&&"provisioning"!==R&&"running"!==R){G(null),F("provisioning"),B(null),z(!0),Q("onboarding_repo_selected",{repositories:t});try{let e=await fetch("/api/workspaces/quick",{method:"POST",credentials:"include",headers:$(),body:JSON.stringify({repositories:t})}),r=await e.json();if(!e.ok)throw Error(r.error||"Failed to create workspace");if(!r.workspaceId||"string"!=typeof r.workspaceId)throw Error("Workspace created but no workspace ID was returned");O(r.workspaceId),await ea(r.workspaceId),Q("onboarding_workspace_created",{workspaceId:r.workspaceId,repositories:t})}catch(e){F("error"),G(e instanceof Error?e.message:"Failed to create workspace")}finally{z(!1)}}},[p,W,R,Q,$,ea]),es=(0,n.useCallback)(async e=>{X.current=!0,E(!0);try{let t=0;for(;X.current&&t<120;){if(await er(e))return H({type:"success",text:"".concat(Z.label," connected successfully.")}),b("create_workspace"),!0;await u(5e3),t+=1}return!1}finally{X.current=!1,E(!1)}},[Z.label,er]);(0,n.useEffect)(()=>((async()=>{try{let t=await fetch("/api/auth/session",{credentials:"include"});if(404===t.status){window.location.href="/app";return}let a=t.headers.get("X-CSRF-Token");if(a&&V(a),!(await t.json()).authenticated){window.location.href="/login";return}let n=await fetch("/api/github-app/repos",{credentials:"include"}),s=[];if(n.ok){let e=await n.json();s.push(...e.repositories||[])}r(s);let o=null;try{o=await i()}catch(e){o=null}let c=(null==o?void 0:o.nextStep)||(s.length>0?"connect_ai_provider":"connect_repos");if(b(c),m(ee(s,o)),Array.isArray(null==o?void 0:o.connectedProviders)){let e={anthropic:"anthropic",openai:"openai",google:"google",cursor:"cursor"},t=new Set;for(let r of o.connectedProviders){let a=e[r];a&&t.add(a)}S(t)}Q("onboarding_page_view",{reason:e,nextStep:c}),P(!1)}catch(e){G(e instanceof Error?e.message:"Failed to initialize"),P(!1)}})(),()=>{X.current=!1,q.current=!1}),[e,ee,Q]),(0,n.useEffect)(()=>{_||!(t.length>0)||!(p.size>0)||null===h||"connect_ai_provider"===h||"provider_connected"===h||T||"idle"!==R||W||en(Array.from(p))},[_,t.length,p,h,T,R,W,en]);let eo=(0,n.useCallback)(()=>{Q("onboarding_connect_repos_clicked",{reason:e}),window.location.href="/connect-repos"},[e,Q]),ec=(0,n.useCallback)(async()=>{if(!v.trim()){H({type:"error",text:"Please enter an API key."});return}if(0===p.size){H({type:"error",text:"Select at least one repository before connecting a provider."});return}I(!0),H(null),G(null);try{let e="openai"===f?["openai","codex"]:[f],t="Failed to connect provider",r=!1;for(let a of e){let e=await fetch("/api/providers/".concat(a,"/api-key"),{method:"POST",credentials:"include",headers:$(),body:JSON.stringify({apiKey:v.trim()})});if(e.ok){r=!0;break}let n=await e.json().catch(()=>({}));t=n.error||n.message||"Failed to connect ".concat(Z.label)}if(!r)throw Error(t);j(""),w("api_key"),S(e=>new Set([...e,f])),H({type:"success",text:"".concat(Z.label," connected! Add another provider or continue to create your workspace.")}),b("provider_connected")}catch(e){H({type:"error",text:e instanceof Error?e.message:"Failed to connect provider"})}finally{I(!1)}},[v,p,f,Z.label,$]),ei=(0,n.useCallback)(async()=>{if(0===p.size){H({type:"error",text:"Select at least one repository before starting provider auth."});return}I(!0),H(null),N(null),G(null);try{let e=$(),t="openai"===f?["openai","codex"]:[f],r=null,a="Failed to start CLI authentication";for(let n of t){let t=await fetch("/api/auth/ssh/init",{method:"POST",credentials:"include",headers:e,body:JSON.stringify({provider:n,mode:"onboarding"})});if(t.ok){r=await t.json();break}let s=await t.json().catch(()=>({}));a=s.error||s.message||"Failed to start CLI authentication"}if(!r)throw Error(a);let n=r.commandWithUrl||r.command;if(!n)throw Error("Auth broker did not return a command");let s=n.trim().startsWith("npx ")?n:"npx ".concat(n);N(s),H({type:"info",text:"Run the command below in your terminal. This page will update automatically when auth completes."}),await es(r.workspaceId)?(w("api_key"),S(e=>new Set([...e,f])),N(null),b("provider_connected")):H({type:"error",text:'Still waiting for authentication. Complete the CLI flow, then click "Done".'})}catch(e){H({type:"error",text:e instanceof Error?e.message:"Failed to start CLI authentication"})}finally{I(!1)}},[$,f,p,es]),el=(0,n.useCallback)(()=>{w("cli"),k||A||!(p.size>0)||ei()},[k,A,p,ei]),ed=(0,n.useCallback)(async()=>{I(!0);try{if(!await er()){H({type:"error",text:"Provider is not connected yet. Complete the CLI authentication first."});return}w("api_key"),S(e=>new Set([...e,f])),N(null),H({type:"success",text:"".concat(Z.label," connected! Add another provider or continue to create your workspace.")}),b("provider_connected")}finally{I(!1)}},[Z.label,f,er]),eu=(0,n.useCallback)(async()=>{k&&(await navigator.clipboard.writeText(k),U(!0),setTimeout(()=>U(!1),2e3))},[k]);if(_)return(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("p",{className:"mt-4 text-text-muted",children:"Loading onboarding..."})]})});if("provisioning"===R||W)return(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center p-4",children:(0,a.jsx)("div",{className:"w-full max-w-2xl",children:(0,a.jsx)(c.n,{currentStage:M,isProvisioning:!0,workspaceName:Array.from(p).join(", "),error:D})})});if("running"===R&&T)return(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center p-4",children:(0,a.jsxs)("div",{className:"w-full max-w-xl bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8 text-center",children:[(0,a.jsx)("div",{className:"w-16 h-16 rounded-full bg-success/20 flex items-center justify-center mx-auto mb-4",children:(0,a.jsx)("svg",{className:"w-8 h-8 text-success",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})})}),(0,a.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Workspace Ready"}),(0,a.jsx)("p",{className:"mt-2 text-text-muted",children:"Your workspace is running and ready for your first agent."}),(0,a.jsx)("a",{href:"/app?workspace=".concat(T,"&spawn=true"),className:"mt-6 inline-flex items-center gap-2 py-3 px-6 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all",children:"Spawn your first agent"})]})});let ep="deleted"===e,ex=t.length>0&&("connect_ai_provider"===h||"provider_connected"===h);return(0,a.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4",children:[(0,a.jsx)("div",{className:"fixed inset-0 opacity-10 pointer-events-none",children:(0,a.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),\n linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}})}),(0,a.jsxs)("div",{className:"relative z-10 w-full max-w-2xl",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,a.jsx)(o.K7,{size:56,withGlow:!0}),(0,a.jsx)("h1",{className:"mt-6 text-3xl font-bold text-white",children:ep?"Workspace Deleted":"Welcome to Agent Relay"}),(0,a.jsx)("p",{className:"mt-3 text-text-muted text-center max-w-md",children:ep?"Your workspace was deleted. Reconnect and provision a new environment to continue.":"Connect an AI provider, then we will automatically provision your first workspace."})]}),D&&(0,a.jsx)("div",{className:"mb-6 p-4 bg-error/10 border border-error/20 rounded-xl",children:(0,a.jsx)("p",{className:"text-error text-center",children:D})}),(0,a.jsxs)("div",{className:"bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-8",children:[t.length>0&&(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3 mb-8",children:[(0,a.jsx)(x,{label:"Repository",active:p.size>0,done:p.size>0}),(0,a.jsx)("div",{className:"w-12 h-px bg-border-subtle"}),(0,a.jsx)(x,{label:"Provider",active:ex,done:"connect_ai_provider"!==h}),(0,a.jsx)("div",{className:"w-12 h-px bg-border-subtle"}),(0,a.jsx)(x,{label:"Provision",active:!1,done:!1})]}),0===t.length?(0,a.jsxs)("div",{className:"text-center py-8 bg-bg-tertiary rounded-xl border border-border-subtle",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-white mb-2",children:"No Repositories Connected"}),(0,a.jsx)("p",{className:"text-text-muted mb-6 max-w-sm mx-auto",children:"Connect your GitHub repositories to continue onboarding."}),(0,a.jsx)("button",{onClick:eo,className:"inline-flex items-center gap-2 py-3 px-6 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all",children:"Connect GitHub"})]}):ex?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm text-text-muted mb-2",children:"Repositories"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto space-y-2 p-3 bg-bg-tertiary border border-border-subtle rounded-xl",children:t.map(e=>(0,a.jsxs)("label",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-bg-card cursor-pointer transition-colors",children:[(0,a.jsx)("input",{type:"checkbox",checked:p.has(e.fullName),onChange:()=>{m(t=>{let r=new Set(t);return r.has(e.fullName)?r.delete(e.fullName):r.add(e.fullName),r})},className:"w-4 h-4 rounded border-border-subtle text-accent-cyan focus:ring-accent-cyan/50 bg-bg-deep"}),(0,a.jsx)("span",{className:"text-white text-sm",children:e.fullName}),e.isPrivate&&(0,a.jsx)("span",{className:"text-xs text-text-muted bg-bg-deep px-1.5 py-0.5 rounded",children:"private"})]},e.id))}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:[p.size," selected"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-muted mb-3",children:"Select AI provider"}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:l.map(e=>{let t=C.has(e.id);return(0,a.jsxs)("button",{type:"button",onClick:()=>{g(e.id),N(null),j(""),H(null),"api_key"!==y&&w("api_key")},className:"p-3 rounded-xl border text-left transition-colors relative ".concat(t?"border-success/50 bg-success/10":f===e.id?"border-accent-cyan bg-accent-cyan/10":"border-border-subtle bg-bg-tertiary hover:border-accent-cyan/40"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("p",{className:"text-white font-medium",children:e.label}),t&&(0,a.jsxs)("span",{className:"flex items-center gap-1 text-xs text-success font-medium",children:[(0,a.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})}),"Connected"]})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-1",children:e.description})]},e.id)})})]}),C.size>0&&"provider_connected"===h&&(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 bg-success/10 border border-success/30 rounded-xl",children:[(0,a.jsxs)("p",{className:"text-sm text-success",children:[C.size," provider",C.size>1?"s":""," connected."," ","Add more or continue to create your workspace."]}),(0,a.jsx)("button",{type:"button",onClick:()=>en(),className:"px-5 py-2.5 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all text-sm",children:"Create Workspace"})]}),!C.has(f)&&(0,a.jsxs)("div",{className:"flex gap-2 p-1 bg-bg-tertiary rounded-xl border border-border-subtle",children:[(0,a.jsx)("button",{type:"button",onClick:()=>w("api_key"),className:"flex-1 py-2.5 px-4 text-sm rounded-lg transition-colors ".concat("api_key"===y?"bg-accent-cyan text-bg-deep font-semibold":"text-text-muted hover:text-white"),children:"API Key Input"}),(0,a.jsx)("button",{type:"button",onClick:el,className:"flex-1 py-2.5 px-4 text-sm rounded-lg transition-colors ".concat("cli"===y?"bg-accent-cyan text-bg-deep font-semibold":"text-text-muted hover:text-white"),children:"Authenticate via CLI"})]}),C.has(f)?null:"api_key"===y?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("label",{className:"block text-sm text-text-muted",children:[Z.label," API Key"]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("input",{type:"password",value:v,onChange:e=>j(e.target.value),placeholder:"Paste API key",className:"flex-1 px-4 py-3 bg-bg-tertiary border border-border-subtle rounded-xl text-white placeholder:text-text-muted focus:outline-none focus:border-accent-cyan/50"}),(0,a.jsx)("button",{type:"button",onClick:ec,disabled:A||!v.trim(),className:"px-5 py-3 bg-accent-cyan text-bg-deep font-semibold rounded-xl hover:bg-accent-cyan/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:A?"Connecting...":"Connect"})]})]}):(0,a.jsxs)("div",{className:"space-y-3",children:[k?(0,a.jsxs)("div",{className:"p-4 bg-bg-tertiary border border-border-subtle rounded-xl space-y-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Run this command in your terminal:"}),(0,a.jsx)("code",{className:"block px-3 py-2 bg-bg-deep rounded-lg text-sm text-white overflow-x-auto",children:k}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:eu,className:"px-3 py-2 border rounded-lg text-xs transition-colors ".concat(Y?"bg-success/20 border-success/50 text-success":"bg-bg-card border-border-subtle text-text-muted hover:text-white hover:border-accent-cyan/50"),children:Y?"Copied!":"Copy command"}),(0,a.jsx)("button",{type:"button",onClick:ed,disabled:A,className:"px-3 py-2 bg-accent-cyan text-bg-deep rounded-lg text-xs font-semibold hover:bg-accent-cyan/90 disabled:opacity-50 transition-colors",children:"Done"})]})]}):(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-bg-tertiary border border-border-subtle rounded-xl",children:[(0,a.jsxs)("svg",{className:"w-5 h-5 text-accent-cyan animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Fetching CLI command..."})]}),L&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success p-3 bg-success/10 border border-success/30 rounded-lg",children:[(0,a.jsxs)("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("span",{children:"Waiting for authentication to complete..."})]})]}),J&&(0,a.jsx)("div",{className:"p-3 rounded-lg text-sm ".concat("success"===J.type?"bg-success/10 border border-success/30 text-success":"error"===J.type?"bg-error/10 border border-error/30 text-error":"bg-accent-cyan/10 border border-accent-cyan/30 text-accent-cyan"),children:J.text})]}):(0,a.jsxs)("div",{className:"text-center py-8",children:[(0,a.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("p",{className:"mt-4 text-white font-medium",children:"Preparing workspace provisioning..."}),(0,a.jsx)("p",{className:"mt-2 text-text-muted text-sm",children:"You will be redirected automatically when ready."})]})]}),(0,a.jsxs)("div",{className:"mt-8 flex justify-center gap-6 text-sm",children:[t.length>0&&(0,a.jsx)("button",{onClick:eo,className:"text-text-muted hover:text-white transition-colors",children:"Connect More Repositories"}),(0,a.jsx)("a",{href:"/app",className:"text-text-muted hover:text-white transition-colors",children:"Back to Dashboard"}),(0,a.jsx)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:$(!1)}),window.location.href="/login"},className:"text-text-muted hover:text-white transition-colors",children:"Sign Out"})]})]})]})}function x(e){let{label:t,active:r,done:n}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-xs font-semibold ".concat(n?"bg-success text-bg-deep":r?"bg-accent-cyan text-bg-deep":"bg-bg-tertiary border border-border-subtle text-text-muted"),children:n?"✓":t[0]}),(0,a.jsx)("span",{className:"".concat(r||n?"text-white":"text-text-muted"," text-sm"),children:t})]})}function m(){return(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsxs)("svg",{className:"w-8 h-8 text-accent-cyan animate-spin mx-auto",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),(0,a.jsx)("p",{className:"mt-4 text-text-muted",children:"Loading..."})]})}),children:(0,a.jsx)(p,{})})}},5634:function(e,t,r){"use strict";r.d(t,{K7:function(){return n}});var a=r(7573);function n(e){let{size:t=24,className:r="",withGlow:n=!1}=e;return(0,a.jsxs)("svg",{width:t,height:t,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"\n transition-all duration-300\n ".concat(n?"drop-shadow-[0_0_8px_rgba(0,217,255,0.3)]":"","\n ").concat(r,"\n "),"aria-label":"Agent Relay Logo",role:"img",children:[(0,a.jsx)("path",{d:"M30 80 L 50 20 L 70 80",stroke:"#00d9ff",strokeWidth:"5",strokeLinejoin:"round",strokeLinecap:"round",fill:"none"}),(0,a.jsx)("line",{x1:"40",y1:"50",x2:"60",y2:"50",stroke:"#00d9ff",strokeWidth:"5",strokeLinecap:"round"}),(0,a.jsx)("path",{d:"M50 20 L 50 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.7"}),(0,a.jsx)("path",{d:"M50 20 C 80 20 80 50 50 50 L 80 80",stroke:"#00ffc8",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:"0.7"})]})}r(7653)}},function(e){e.O(0,[9372,1293,1528,1744],function(){return e(e.s=5077)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8287,9404],{9765:function(n,e,u){Promise.resolve().then(u.t.bind(u,8601,23))},8601:function(){}},function(n){n.O(0,[3694,1293,1528,1744],function(){return n(n.s=9765)}),_N_E=n.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7294],{7466:function(e,t,n){Promise.resolve().then(n.t.bind(n,2147,23)),Promise.resolve().then(n.t.bind(n,8601,23))},8337:function(e,t){"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DOMAttributeNames:function(){return r},default:function(){return o},isEqualNode:function(){return i}});let r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function l(e){let{type:t,props:n}=e,l=document.createElement(t);for(let e in n){if(!n.hasOwnProperty(e)||"children"===e||"dangerouslySetInnerHTML"===e||void 0===n[e])continue;let i=r[e]||e.toLowerCase();"script"===t&&("async"===i||"defer"===i||"noModule"===i)?l[i]=!!n[e]:l.setAttribute(i,n[e])}let{children:i,dangerouslySetInnerHTML:o}=n;return o?l.innerHTML=o.__html||"":i&&(l.textContent="string"==typeof i?i:Array.isArray(i)?i.join(""):""),l}function i(e,t){if(e instanceof HTMLElement&&t instanceof HTMLElement){let n=t.getAttribute("nonce");if(n&&!e.getAttribute("nonce")){let r=t.cloneNode(!0);return r.setAttribute("nonce",""),r.nonce=n,n===e.nonce&&e.isEqualNode(r)}}return e.isEqualNode(t)}function o(){return{mountedInstances:new Set,updateHead:e=>{let t={};e.forEach(e=>{if("link"===e.type&&e.props["data-optimized-fonts"]){if(document.querySelector('style[data-href="'+e.props["data-href"]+'"]'))return;e.props.href=e.props["data-href"],e.props["data-href"]=void 0}let n=t[e.type]||[];n.push(e),t[e.type]=n});let r=t.title?t.title[0]:null,l="";if(r){let{children:e}=r.props;l="string"==typeof e?e:Array.isArray(e)?e.join(""):""}l!==document.title&&(document.title=l),["meta","base","link","style","script"].forEach(e=>{n(e,t[e]||[])})}}}n=(e,t)=>{let n=document.getElementsByTagName("head")[0],r=n.querySelector("meta[name=next-head-count]"),o=Number(r.content),a=[];for(let t=0,n=r.previousElementSibling;t<o;t++,n=(null==n?void 0:n.previousElementSibling)||null){var u;(null==n?void 0:null==(u=n.tagName)?void 0:u.toLowerCase())===e&&a.push(n)}let s=t.map(l).filter(e=>{for(let t=0,n=a.length;t<n;t++)if(i(a[t],e))return a.splice(t,1),!1;return!0});a.forEach(e=>{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),s.forEach(e=>n.insertBefore(e,r)),r.content=(o-a.length+s.length).toString()},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6588:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{cancelIdleCallback:function(){return r},requestIdleCallback:function(){return n}});let n="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},r="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2147:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return g},handleClientScriptLoad:function(){return b},initScriptLoader:function(){return m}});let r=n(1887),l=n(9766),i=n(7573),o=r._(n(3458)),a=l._(n(7653)),u=n(2764),s=n(8337),c=n(6588),d=new Map,f=new Set,p=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"],y=e=>{if(o.default.preinit){e.forEach(e=>{o.default.preinit(e,{as:"style"})});return}if("undefined"!=typeof window){let t=document.head;e.forEach(e=>{let n=document.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e,t.appendChild(n)})}},h=e=>{let{src:t,id:n,onLoad:r=()=>{},onReady:l=null,dangerouslySetInnerHTML:i,children:o="",strategy:a="afterInteractive",onError:u,stylesheets:c}=e,h=n||t;if(h&&f.has(h))return;if(d.has(t)){f.add(h),d.get(t).then(r,u);return}let b=()=>{l&&l(),f.add(h)},m=document.createElement("script"),_=new Promise((e,t)=>{m.addEventListener("load",function(t){e(),r&&r.call(this,t),b()}),m.addEventListener("error",function(e){t(e)})}).catch(function(e){u&&u(e)});for(let[n,r]of(i?(m.innerHTML=i.__html||"",b()):o?(m.textContent="string"==typeof o?o:Array.isArray(o)?o.join(""):"",b()):t&&(m.src=t,d.set(t,_)),Object.entries(e))){if(void 0===r||p.includes(n))continue;let e=s.DOMAttributeNames[n]||n.toLowerCase();m.setAttribute(e,r)}"worker"===a&&m.setAttribute("type","text/partytown"),m.setAttribute("data-nscript",a),c&&y(c),document.body.appendChild(m)};function b(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,c.requestIdleCallback)(()=>h(e))}):h(e)}function m(e){e.forEach(b),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");f.add(t)})}function _(e){let{id:t,src:n="",onLoad:r=()=>{},onReady:l=null,strategy:s="afterInteractive",onError:d,stylesheets:p,...y}=e,{updateScripts:b,scripts:m,getIsSsr:_,appDir:g,nonce:v}=(0,a.useContext)(u.HeadManagerContext),E=(0,a.useRef)(!1);(0,a.useEffect)(()=>{let e=t||n;E.current||(l&&e&&f.has(e)&&l(),E.current=!0)},[l,t,n]);let O=(0,a.useRef)(!1);if((0,a.useEffect)(()=>{!O.current&&("afterInteractive"===s?h(e):"lazyOnload"===s&&("complete"===document.readyState?(0,c.requestIdleCallback)(()=>h(e)):window.addEventListener("load",()=>{(0,c.requestIdleCallback)(()=>h(e))})),O.current=!0)},[e,s]),("beforeInteractive"===s||"worker"===s)&&(b?(m[s]=(m[s]||[]).concat([{id:t,src:n,onLoad:r,onReady:l,onError:d,...y}]),b(m)):_&&_()?f.add(t||n):_&&!_()&&h(e)),g){if(p&&p.forEach(e=>{o.default.preinit(e,{as:"style"})}),"beforeInteractive"===s)return n?(o.default.preload(n,y.integrity?{as:"script",integrity:y.integrity,nonce:v,crossOrigin:y.crossOrigin}:{as:"script",nonce:v,crossOrigin:y.crossOrigin}),(0,i.jsx)("script",{nonce:v,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([n,{...y,id:t}])+")"}})):(y.dangerouslySetInnerHTML&&(y.children=y.dangerouslySetInnerHTML.__html,delete y.dangerouslySetInnerHTML),(0,i.jsx)("script",{nonce:v,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...y,id:t}])+")"}}));"afterInteractive"===s&&n&&o.default.preload(n,y.integrity?{as:"script",integrity:y.integrity,nonce:v,crossOrigin:y.crossOrigin}:{as:"script",nonce:v,crossOrigin:y.crossOrigin})}return null}Object.defineProperty(_,"__nextScript",{value:!0});let g=_;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8601:function(){}},function(e){e.O(0,[3694,1293,1528,1744],function(){return e(e.s=7466)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9404,8287],{9765:function(n,e,u){Promise.resolve().then(u.t.bind(u,8601,23))},8601:function(){}},function(n){n.O(0,[3694,1293,1528,1744],function(){return n(n.s=9765)}),_N_E=n.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6995],{354:function(n,u,e){Promise.resolve().then(e.bind(e,3178))},3178:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return c}});var t=e(7573),r=e(717);function c(){return(0,t.jsx)(r.az,{})}}},function(n){n.O(0,[3694,1695,1293,1528,1744],function(){return n(n.s=354)}),_N_E=n.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5141],{108:function(n,u,e){Promise.resolve().then(e.bind(e,3507))},3507:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return c}});var t=e(7573),r=e(717);function c(){return(0,t.jsx)(r.pE,{})}}},function(n){n.O(0,[3694,1695,1293,1528,1744],function(){return n(n.s=108)}),_N_E=n.O()}]);