@omnitron-dev/omnitron 0.3.3 → 0.4.6

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 (358) hide show
  1. package/README.md +296 -6
  2. package/bin/{pnpmfile-sdk.mjs → pnpmfile-sdk.js} +19 -1
  3. package/bin/sdk.d.ts +19 -0
  4. package/bin/sdk.js +932 -0
  5. package/dist/BUILD.json +2 -2
  6. package/dist/cli/omnitron.js +68 -20
  7. package/dist/cli/omnitron.js.map +1 -1
  8. package/dist/commands/infra.d.ts +8 -2
  9. package/dist/commands/infra.d.ts.map +1 -1
  10. package/dist/commands/infra.js +52 -59
  11. package/dist/commands/infra.js.map +1 -1
  12. package/dist/commands/node.d.ts.map +1 -1
  13. package/dist/commands/node.js +8 -1
  14. package/dist/commands/node.js.map +1 -1
  15. package/dist/commands/release-store.d.ts.map +1 -1
  16. package/dist/commands/release-store.js +6 -9
  17. package/dist/commands/release-store.js.map +1 -1
  18. package/dist/commands/release.d.ts +4 -1
  19. package/dist/commands/release.d.ts.map +1 -1
  20. package/dist/commands/release.js +125 -5
  21. package/dist/commands/release.js.map +1 -1
  22. package/dist/commands/stack.d.ts +3 -6
  23. package/dist/commands/stack.d.ts.map +1 -1
  24. package/dist/commands/stack.js +51 -9
  25. package/dist/commands/stack.js.map +1 -1
  26. package/dist/commands/status.d.ts.map +1 -1
  27. package/dist/commands/status.js +1 -0
  28. package/dist/commands/status.js.map +1 -1
  29. package/dist/config/saved.d.ts +3 -0
  30. package/dist/config/saved.d.ts.map +1 -1
  31. package/dist/config/saved.js +1 -0
  32. package/dist/config/saved.js.map +1 -1
  33. package/dist/config/types.d.ts +4 -0
  34. package/dist/config/types.d.ts.map +1 -1
  35. package/dist/daemon/daemon-client.d.ts +3 -15
  36. package/dist/daemon/daemon-client.d.ts.map +1 -1
  37. package/dist/daemon/daemon-client.js +4 -0
  38. package/dist/daemon/daemon-client.js.map +1 -1
  39. package/dist/daemon/daemon.d.ts +5 -11
  40. package/dist/daemon/daemon.d.ts.map +1 -1
  41. package/dist/daemon/daemon.js +58 -48
  42. package/dist/daemon/daemon.js.map +1 -1
  43. package/dist/daemon/daemon.rpc-service.d.ts +3 -41
  44. package/dist/daemon/daemon.rpc-service.d.ts.map +1 -1
  45. package/dist/daemon/daemon.rpc-service.js +50 -117
  46. package/dist/daemon/daemon.rpc-service.js.map +1 -1
  47. package/dist/daemon/darwin-owner-evidence.js +1 -1
  48. package/dist/daemon/darwin-owner-evidence.js.map +1 -1
  49. package/dist/daemon/execution-capabilities.d.ts +1 -1
  50. package/dist/daemon/execution-capabilities.d.ts.map +1 -1
  51. package/dist/daemon/execution-capabilities.js +3 -3
  52. package/dist/daemon/execution-capabilities.js.map +1 -1
  53. package/dist/daemon/execution-client.d.ts +5 -1
  54. package/dist/daemon/execution-client.d.ts.map +1 -1
  55. package/dist/daemon/execution-client.js +45 -19
  56. package/dist/daemon/execution-client.js.map +1 -1
  57. package/dist/daemon/execution-host.d.ts +4 -11
  58. package/dist/daemon/execution-host.d.ts.map +1 -1
  59. package/dist/daemon/execution-host.js +3 -9
  60. package/dist/daemon/execution-host.js.map +1 -1
  61. package/dist/daemon/execution-owner.d.ts.map +1 -1
  62. package/dist/daemon/execution-owner.js +2 -16
  63. package/dist/daemon/execution-owner.js.map +1 -1
  64. package/dist/daemon/execution-shutdown.d.ts +1 -1
  65. package/dist/daemon/execution-shutdown.d.ts.map +1 -1
  66. package/dist/daemon/managed-owner-build.d.ts +4 -0
  67. package/dist/daemon/managed-owner-build.d.ts.map +1 -1
  68. package/dist/daemon/managed-owner-build.js +14 -2
  69. package/dist/daemon/managed-owner-build.js.map +1 -1
  70. package/dist/daemon/managed-runtime.js +1 -1
  71. package/dist/daemon/managed-runtime.js.map +1 -1
  72. package/dist/daemon/owner-reconciliation.d.ts.map +1 -1
  73. package/dist/daemon/owner-reconciliation.js +1 -2
  74. package/dist/daemon/owner-reconciliation.js.map +1 -1
  75. package/dist/daemon/startup-config.d.ts +1 -0
  76. package/dist/daemon/startup-config.d.ts.map +1 -1
  77. package/dist/daemon/system-guardian-cgroup.js +1 -1
  78. package/dist/daemon/system-guardian-cgroup.js.map +1 -1
  79. package/dist/infrastructure/container-runtime.d.ts +8 -0
  80. package/dist/infrastructure/container-runtime.d.ts.map +1 -1
  81. package/dist/infrastructure/container-runtime.js +5 -0
  82. package/dist/infrastructure/container-runtime.js.map +1 -1
  83. package/dist/infrastructure/existing-containers.d.ts +25 -0
  84. package/dist/infrastructure/existing-containers.d.ts.map +1 -0
  85. package/dist/infrastructure/existing-containers.js +183 -0
  86. package/dist/infrastructure/existing-containers.js.map +1 -0
  87. package/dist/infrastructure/infrastructure.service.d.ts +19 -1
  88. package/dist/infrastructure/infrastructure.service.d.ts.map +1 -1
  89. package/dist/infrastructure/infrastructure.service.js +136 -17
  90. package/dist/infrastructure/infrastructure.service.js.map +1 -1
  91. package/dist/infrastructure/presets/postgres.js +1 -1
  92. package/dist/infrastructure/presets/postgres.js.map +1 -1
  93. package/dist/infrastructure/presets/registry.d.ts.map +1 -1
  94. package/dist/infrastructure/presets/registry.js +11 -19
  95. package/dist/infrastructure/presets/registry.js.map +1 -1
  96. package/dist/infrastructure/stack-infra-manager.d.ts +11 -1
  97. package/dist/infrastructure/stack-infra-manager.d.ts.map +1 -1
  98. package/dist/infrastructure/stack-infra-manager.js +79 -8
  99. package/dist/infrastructure/stack-infra-manager.js.map +1 -1
  100. package/dist/mcp/tool-groups/infra.tools.d.ts.map +1 -1
  101. package/dist/mcp/tool-groups/infra.tools.js +4 -1
  102. package/dist/mcp/tool-groups/infra.tools.js.map +1 -1
  103. package/dist/monitoring/log-journal.d.ts.map +1 -1
  104. package/dist/monitoring/log-journal.js +1 -2
  105. package/dist/monitoring/log-journal.js.map +1 -1
  106. package/dist/operations.d.ts +1 -0
  107. package/dist/operations.d.ts.map +1 -1
  108. package/dist/operations.js +1 -0
  109. package/dist/operations.js.map +1 -1
  110. package/dist/orchestrator/app-name.d.ts +33 -0
  111. package/dist/orchestrator/app-name.d.ts.map +1 -0
  112. package/dist/orchestrator/app-name.js +68 -0
  113. package/dist/orchestrator/app-name.js.map +1 -0
  114. package/dist/orchestrator/bootstrap-loader.d.ts +2 -0
  115. package/dist/orchestrator/bootstrap-loader.d.ts.map +1 -1
  116. package/dist/orchestrator/bootstrap-loader.js +2 -1
  117. package/dist/orchestrator/bootstrap-loader.js.map +1 -1
  118. package/dist/orchestrator/classic-launcher.d.ts.map +1 -1
  119. package/dist/orchestrator/classic-launcher.js +2 -1
  120. package/dist/orchestrator/classic-launcher.js.map +1 -1
  121. package/dist/orchestrator/execution-contract.d.ts +2 -3
  122. package/dist/orchestrator/execution-contract.d.ts.map +1 -1
  123. package/dist/orchestrator/file-watcher.d.ts +11 -23
  124. package/dist/orchestrator/file-watcher.d.ts.map +1 -1
  125. package/dist/orchestrator/file-watcher.js +57 -42
  126. package/dist/orchestrator/file-watcher.js.map +1 -1
  127. package/dist/orchestrator/orchestrator.service.d.ts +11 -31
  128. package/dist/orchestrator/orchestrator.service.d.ts.map +1 -1
  129. package/dist/orchestrator/orchestrator.service.js +127 -109
  130. package/dist/orchestrator/orchestrator.service.js.map +1 -1
  131. package/dist/project/bootstrap-metadata.d.ts +1 -1
  132. package/dist/project/bootstrap-metadata.d.ts.map +1 -1
  133. package/dist/project/bootstrap-metadata.js +3 -2
  134. package/dist/project/bootstrap-metadata.js.map +1 -1
  135. package/dist/project/node-stack-stop.d.ts +2 -1
  136. package/dist/project/node-stack-stop.d.ts.map +1 -1
  137. package/dist/project/node-stack-stop.js +5 -1
  138. package/dist/project/node-stack-stop.js.map +1 -1
  139. package/dist/project/stack-diagnosis.d.ts.map +1 -1
  140. package/dist/project/stack-diagnosis.js +2 -3
  141. package/dist/project/stack-diagnosis.js.map +1 -1
  142. package/dist/release/artifact-store.d.ts +42 -7
  143. package/dist/release/artifact-store.d.ts.map +1 -1
  144. package/dist/release/artifact-store.js +176 -62
  145. package/dist/release/artifact-store.js.map +1 -1
  146. package/dist/release/closure-library-path.d.ts +8 -2
  147. package/dist/release/closure-library-path.d.ts.map +1 -1
  148. package/dist/release/closure-library-path.js +72 -28
  149. package/dist/release/closure-library-path.js.map +1 -1
  150. package/dist/release/configured-store.d.ts +6 -0
  151. package/dist/release/configured-store.d.ts.map +1 -0
  152. package/dist/release/configured-store.js +54 -0
  153. package/dist/release/configured-store.js.map +1 -0
  154. package/dist/release/load.d.ts +3 -0
  155. package/dist/release/load.d.ts.map +1 -1
  156. package/dist/release/load.js +8 -2
  157. package/dist/release/load.js.map +1 -1
  158. package/dist/release/local-installation.d.ts +2 -0
  159. package/dist/release/local-installation.d.ts.map +1 -1
  160. package/dist/release/local-installation.js +1 -1
  161. package/dist/release/local-installation.js.map +1 -1
  162. package/dist/release/portable-archive.d.ts +3 -0
  163. package/dist/release/portable-archive.d.ts.map +1 -1
  164. package/dist/release/portable-archive.js +13 -7
  165. package/dist/release/portable-archive.js.map +1 -1
  166. package/dist/release/registry-framework.d.ts +25 -0
  167. package/dist/release/registry-framework.d.ts.map +1 -1
  168. package/dist/release/registry-framework.js +51 -3
  169. package/dist/release/registry-framework.js.map +1 -1
  170. package/dist/release/target-runtime.d.ts +4 -0
  171. package/dist/release/target-runtime.d.ts.map +1 -1
  172. package/dist/release/target-runtime.js +9 -0
  173. package/dist/release/target-runtime.js.map +1 -1
  174. package/dist/services/host-upgrade.d.ts +2 -0
  175. package/dist/services/host-upgrade.d.ts.map +1 -1
  176. package/dist/services/host-upgrade.js +6 -2
  177. package/dist/services/host-upgrade.js.map +1 -1
  178. package/dist/services/infrastructure.rpc-service.d.ts +14 -2
  179. package/dist/services/infrastructure.rpc-service.d.ts.map +1 -1
  180. package/dist/services/infrastructure.rpc-service.js +128 -17
  181. package/dist/services/infrastructure.rpc-service.js.map +1 -1
  182. package/dist/services/kernel-rollout.service.d.ts.map +1 -1
  183. package/dist/services/kernel-rollout.service.js +1 -2
  184. package/dist/services/kernel-rollout.service.js.map +1 -1
  185. package/dist/services/migration-process.d.ts +1 -0
  186. package/dist/services/migration-process.d.ts.map +1 -1
  187. package/dist/services/migration-process.js +4 -2
  188. package/dist/services/migration-process.js.map +1 -1
  189. package/dist/services/node-deploy-lease.d.ts +4 -1
  190. package/dist/services/node-deploy-lease.d.ts.map +1 -1
  191. package/dist/services/node-deploy-lease.js +29 -4
  192. package/dist/services/node-deploy-lease.js.map +1 -1
  193. package/dist/services/node-manager.service.d.ts +5 -25
  194. package/dist/services/node-manager.service.d.ts.map +1 -1
  195. package/dist/services/node-manager.service.js +150 -139
  196. package/dist/services/node-manager.service.js.map +1 -1
  197. package/dist/services/pipeline-definition.d.ts.map +1 -1
  198. package/dist/services/pipeline-definition.js +32 -6
  199. package/dist/services/pipeline-definition.js.map +1 -1
  200. package/dist/services/pipeline.service.d.ts +7 -1
  201. package/dist/services/pipeline.service.d.ts.map +1 -1
  202. package/dist/services/pipeline.service.js +106 -13
  203. package/dist/services/pipeline.service.js.map +1 -1
  204. package/dist/services/project.rpc-service.d.ts +6 -5
  205. package/dist/services/project.rpc-service.d.ts.map +1 -1
  206. package/dist/services/project.rpc-service.js +13 -0
  207. package/dist/services/project.rpc-service.js.map +1 -1
  208. package/dist/services/project.service.d.ts +30 -6
  209. package/dist/services/project.service.d.ts.map +1 -1
  210. package/dist/services/project.service.js +414 -66
  211. package/dist/services/project.service.js.map +1 -1
  212. package/dist/services/release.rpc-service.d.ts +2 -1
  213. package/dist/services/release.rpc-service.d.ts.map +1 -1
  214. package/dist/services/release.rpc-service.js +19 -3
  215. package/dist/services/release.rpc-service.js.map +1 -1
  216. package/dist/services/release.service.d.ts +24 -11
  217. package/dist/services/release.service.d.ts.map +1 -1
  218. package/dist/services/release.service.js +162 -39
  219. package/dist/services/release.service.js.map +1 -1
  220. package/dist/services/remote-deployer.service.d.ts +1 -1
  221. package/dist/services/remote-deployer.service.d.ts.map +1 -1
  222. package/dist/services/remote-deployer.service.js +3 -0
  223. package/dist/services/remote-deployer.service.js.map +1 -1
  224. package/dist/services/secrets.service.d.ts +6 -0
  225. package/dist/services/secrets.service.d.ts.map +1 -1
  226. package/dist/services/secrets.service.js +95 -51
  227. package/dist/services/secrets.service.js.map +1 -1
  228. package/dist/shared/dto/backend.d.ts +3 -0
  229. package/dist/shared/dto/backend.d.ts.map +1 -1
  230. package/dist/shared/dto/backend.js.map +1 -1
  231. package/dist/shared/dto/nodes.d.ts +2 -0
  232. package/dist/shared/dto/nodes.d.ts.map +1 -1
  233. package/dist/shared/dto/pipelines.d.ts +54 -5
  234. package/dist/shared/dto/pipelines.d.ts.map +1 -1
  235. package/dist/shared/dto/pipelines.js +0 -7
  236. package/dist/shared/dto/pipelines.js.map +1 -1
  237. package/dist/shared/dto/project.d.ts +61 -1
  238. package/dist/shared/dto/project.d.ts.map +1 -1
  239. package/dist/shared/dto/releases.d.ts +8 -1
  240. package/dist/shared/dto/releases.d.ts.map +1 -1
  241. package/dist/shared/dto/services.d.ts +44 -18
  242. package/dist/shared/dto/services.d.ts.map +1 -1
  243. package/dist/shared/dto/services.js.map +1 -1
  244. package/dist/shared/release-reading.d.ts +6 -0
  245. package/dist/shared/release-reading.d.ts.map +1 -1
  246. package/dist/shared/release-reading.js +42 -0
  247. package/dist/shared/release-reading.js.map +1 -1
  248. package/dist/workers/system-worker-manager.d.ts +1 -2
  249. package/dist/workers/system-worker-manager.d.ts.map +1 -1
  250. package/dist/workers/system-worker-manager.js +5 -3
  251. package/dist/workers/system-worker-manager.js.map +1 -1
  252. package/package.json +20 -19
  253. package/webapp/dist/BUILD.json +2 -2
  254. package/webapp/dist/assets/{access-jWkHxGc7.js → access-B2gXuoMG.js} +1 -1
  255. package/webapp/dist/assets/{access-48hkC2-P.js → access-I0f72P9m.js} +1 -1
  256. package/webapp/dist/assets/{admin-data-table-BKSDI8sU.js → admin-data-table-CAEL2f-m.js} +1 -1
  257. package/webapp/dist/assets/{alert-uBG6r9NW.js → alert-BdJ2uaY0.js} +1 -1
  258. package/webapp/dist/assets/{alerts-CuPQ9YQJ.js → alerts-DeVkMXWo.js} +1 -1
  259. package/webapp/dist/assets/{apps-Drio028B.js → apps-9SuDvyGQ.js} +1 -1
  260. package/webapp/dist/assets/{audit-npSFJECe.js → audit-DT8cY7Ys.js} +1 -1
  261. package/webapp/dist/assets/backend-status.store-BbBE9cn8.js +4 -0
  262. package/webapp/dist/assets/{card-DkH32gMY.js → card-DaUEmUI5.js} +1 -1
  263. package/webapp/dist/assets/{chart-BpGXlCJc.js → chart-BKXP2ter.js} +1 -1
  264. package/webapp/dist/assets/{client-DFnuv2z3.js → client-CgyTwq9g.js} +1 -1
  265. package/webapp/dist/assets/{code-editor-DK6Tmmxv.js → code-editor-JVuQ4m-z.js} +1 -1
  266. package/webapp/dist/assets/{comparison-bars-BtC0dHjF.js → comparison-bars-Ds5Dt1oj.js} +1 -1
  267. package/webapp/dist/assets/{confirm-dialog-BbGsAz7_.js → confirm-dialog-BayExVbF.js} +1 -1
  268. package/webapp/dist/assets/{console-keyboard-D3YCA0yU.js → console-keyboard-uSLt92dB.js} +1 -1
  269. package/webapp/dist/assets/{containers-Bl8gAyZX.js → containers-DkXTgcrY.js} +1 -1
  270. package/webapp/dist/assets/{controls-C5W8gHU4.js → controls-CqeGPnaF.js} +1 -1
  271. package/webapp/dist/assets/{dashboard-UHlet3H9.js → dashboard-By5yPuOf.js} +1 -1
  272. package/webapp/dist/assets/{dashboard-builder-67PZFqhE.js → dashboard-builder-C0hvBwkd.js} +1 -1
  273. package/webapp/dist/assets/deploy-progress-B39cvvCE.js +1 -0
  274. package/webapp/dist/assets/deploy-release-dialog-CnzaO_xL.js +1 -0
  275. package/webapp/dist/assets/deployments-BXP943hA.js +1 -0
  276. package/webapp/dist/assets/{detail-B4TiBfxU.js → detail-B84RgiOb.js} +1 -1
  277. package/webapp/dist/assets/{detail-CYS81K6Y.js → detail-CVXDks9-.js} +1 -1
  278. package/webapp/dist/assets/detail-D9DixtaK.js +2 -0
  279. package/webapp/dist/assets/{empty-content-7jOFhG4C.js → empty-content-eyDOuOVp.js} +1 -1
  280. package/webapp/dist/assets/{error-boundary-CLLI8PWw.js → error-boundary-CQmDr_HS.js} +1 -1
  281. package/webapp/dist/assets/{event-fields-CiyqrRO8.js → event-fields-C7p2a2HY.js} +1 -1
  282. package/webapp/dist/assets/{files-DigwXndm.js → files-BsfGT3t6.js} +2 -2
  283. package/webapp/dist/assets/{icons-OboZgWSt.js → icons-B9Ct8PJ9.js} +1 -1
  284. package/webapp/dist/assets/index-BEfv96EF.js +1 -0
  285. package/webapp/dist/assets/{label-B1SF0RTL.js → label-avMhe08g.js} +1 -1
  286. package/webapp/dist/assets/{log-level-filter-Bcn31D1F.js → log-level-filter-oaUGdbpk.js} +1 -1
  287. package/webapp/dist/assets/{logs-BqHOufk8.js → logs-iC1OEDv3.js} +1 -1
  288. package/webapp/dist/assets/{metric-chart-M-kI-XOt.js → metric-chart-CSa_qv4F.js} +1 -1
  289. package/webapp/dist/assets/{metrics-QIQaF7iS.js → metrics-CKCmcGKw.js} +1 -1
  290. package/webapp/dist/assets/{mui-Cd711nOk.js → mui-B3fJdIMc.js} +1 -1
  291. package/webapp/dist/assets/{mui-CdB_p2lt.js → mui-Bdr6Ks5j.js} +1 -1
  292. package/webapp/dist/assets/{mui-BIz4LSVs.js → mui-CADnFGCx.js} +1 -1
  293. package/webapp/dist/assets/{mui-AnEgAVjz.js → mui-CMWGTMXv.js} +1 -1
  294. package/webapp/dist/assets/{mui-DyT2n1lx.js → mui-CN3dT7bb.js} +1 -1
  295. package/webapp/dist/assets/{mui-BwsIrivo.js → mui-CPEkFAPo.js} +1 -1
  296. package/webapp/dist/assets/{mui-B1jrje6Z.js → mui-D3qAWvfZ.js} +1 -1
  297. package/webapp/dist/assets/{mui-C_hromOc.js → mui-D7tBU80e.js} +1 -1
  298. package/webapp/dist/assets/{mui-y44PQOfG.js → mui-DaJavAoc.js} +1 -1
  299. package/webapp/dist/assets/{mui-BXSXx9c9.js → mui-SNRRJ_vi.js} +1 -1
  300. package/webapp/dist/assets/{nodes-BJPk02vv.js → nodes-DtLyXH0V.js} +1 -1
  301. package/webapp/dist/assets/{operation-status-Bm1x1wTz.js → operation-status-DHyYOT7G.js} +1 -1
  302. package/webapp/dist/assets/{page-breadcrumbs-fR7Jmpp4.js → page-breadcrumbs-3R8RZ3nA.js} +1 -1
  303. package/webapp/dist/assets/pipelines-Do2NAAqK.js +3 -0
  304. package/webapp/dist/assets/project.store-D5IR3fo9.js +1 -0
  305. package/webapp/dist/assets/{projects-YoBzcQ24.js → projects-BqlGbzeG.js} +1 -1
  306. package/webapp/dist/assets/{realtime.store-CBDO4Abj.js → realtime.store-C8D235-B.js} +1 -1
  307. package/webapp/dist/assets/release-bits-IehuBssK.js +1 -0
  308. package/webapp/dist/assets/release-build-panel-C48hP_9w.js +1 -0
  309. package/webapp/dist/assets/release-deployment-state-BfmxZP4Y.js +1 -0
  310. package/webapp/dist/assets/releases-Cm0RV5Xu.js +2 -0
  311. package/webapp/dist/assets/{search-input-C0MHI8vO.js → search-input-SWD1dXxD.js} +1 -1
  312. package/webapp/dist/assets/settings-DwuEPQGg.js +1 -0
  313. package/webapp/dist/assets/sign-in-CQ-WeS5A.js +1 -0
  314. package/webapp/dist/assets/{skeleton-BmWDJWF9.js → skeleton-BnVxAoeX.js} +1 -1
  315. package/webapp/dist/assets/{snackbar-DSPmjMyi.js → snackbar-CRX6eqRT.js} +1 -1
  316. package/webapp/dist/assets/{stack-health-status-BIv2C10x.js → stack-health-status-DfErRNb1.js} +1 -1
  317. package/webapp/dist/assets/{stack-start-notice-BVnMOwRQ.js → stack-start-notice-NkYDjR-f.js} +1 -1
  318. package/webapp/dist/assets/{stacks-IZ1mfizi.js → stacks-BOGCfW90.js} +1 -1
  319. package/webapp/dist/assets/{store-bqUBn2A4.js → store-DtTtbc9H.js} +1 -1
  320. package/webapp/dist/assets/{system-info-BFKNM-hf.js → system-info-Cw-xywgI.js} +1 -1
  321. package/webapp/dist/assets/{table-BOWT6Y9d.js → table-D-so_B1p.js} +1 -1
  322. package/webapp/dist/assets/{table-viewport-Bp4pq-c_.js → table-viewport-DdZ1yAKm.js} +1 -1
  323. package/webapp/dist/assets/{tabs-k5NPGLnJ.js → tabs-DGqBkXh_.js} +1 -1
  324. package/webapp/dist/assets/{terminal-QWBau-Us.js → terminal-Bbl0XNeB.js} +1 -1
  325. package/webapp/dist/assets/{topology-CPey5dP6.js → topology-DmrRy7nN.js} +1 -1
  326. package/webapp/dist/assets/{topology-metadata-dialog-BivuU2y6.js → topology-metadata-dialog-Dpfp4YF1.js} +1 -1
  327. package/webapp/dist/assets/{traces-By0rdfDC.js → traces-CKHsOabJ.js} +1 -1
  328. package/webapp/dist/assets/{use-stack-context-UkBsF-l7.js → use-stack-context-BuraYaeY.js} +1 -1
  329. package/webapp/dist/assets/webapp-D8h_eabt.js +35 -0
  330. package/webapp/dist/console-version.json +1 -1
  331. package/webapp/dist/index.html +34 -34
  332. package/webapp/dist/logo.svg +1 -80
  333. package/bin/sdk.d.mts +0 -8
  334. package/bin/sdk.mjs +0 -576
  335. package/dist/monitoring/process-lifetime.d.ts +0 -11
  336. package/dist/monitoring/process-lifetime.d.ts.map +0 -1
  337. package/dist/monitoring/process-lifetime.js +0 -45
  338. package/dist/monitoring/process-lifetime.js.map +0 -1
  339. package/dist/shared/host-boot-identity.d.ts +0 -12
  340. package/dist/shared/host-boot-identity.d.ts.map +0 -1
  341. package/dist/shared/host-boot-identity.js +0 -89
  342. package/dist/shared/host-boot-identity.js.map +0 -1
  343. package/webapp/dist/assets/deploy-release-dialog-BOXcD5Wo.js +0 -1
  344. package/webapp/dist/assets/deployments-qV20Ak0P.js +0 -1
  345. package/webapp/dist/assets/detail-B85-Wees.js +0 -2
  346. package/webapp/dist/assets/index-uq8Dkk4c.js +0 -1
  347. package/webapp/dist/assets/omnitron-logo-koMCbsCv.js +0 -1
  348. package/webapp/dist/assets/pipelines-T6Ch9LTw.js +0 -3
  349. package/webapp/dist/assets/project.store--G5pIF-J.js +0 -1
  350. package/webapp/dist/assets/release-bits-B2a_wbft.js +0 -1
  351. package/webapp/dist/assets/release-build-panel-BQmIdKW9.js +0 -1
  352. package/webapp/dist/assets/release-deployment-state-DRrEI2pP.js +0 -1
  353. package/webapp/dist/assets/release-wire-f2VuBoBF.js +0 -1
  354. package/webapp/dist/assets/releases-Bp3CDgmo.js +0 -2
  355. package/webapp/dist/assets/settings-B3egRvbI.js +0 -1
  356. package/webapp/dist/assets/sign-in-9q-Nfy83.js +0 -1
  357. package/webapp/dist/assets/webapp-D-UhjFhS.js +0 -35
  358. package/webapp/dist/favicon.png +0 -0
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{B as r,V as i,g as a,h as o,x as ee,z as s}from"./client-CgyTwq9g.js";import{F as c,H as l,I as te,Q as u,V as d,X as f,Y as ne,Z as p,at as m,c as h,ct as g,d as re,f as _,g as v,h as ie,m as y,ot as b,p as ae,s as oe,st as x}from"./mui-SNRRJ_vi.js";import{B as S,a as se,o as C,z as w}from"./mui-B3fJdIMc.js";import{l as T,u as E}from"./mui-CMWGTMXv.js";import{_ as D,v as O}from"./mui-CPEkFAPo.js";import{h as ce,i as k,m as A,t as j}from"./project.store-D5IR3fo9.js";import{G as M,m as le}from"./icons-B9Ct8PJ9.js";import{i as ue,n as N,r as P,t as de}from"./deploy-progress-B39cvvCE.js";import{l as fe,o as pe,r as me,u as F}from"./release-bits-IehuBssK.js";function I({open:e,onClose:t,project:n,release:o,stack:s}){let l=i(),te=r(),u=e=>{let r=k.getState();r.activeProject!==n&&r.selectProject(n,te.pathname),t(),l(`/stacks/${encodeURIComponent(e)}`)},f=k(e=>e.stacksByProject),h=k(e=>e.fetchStacks),g=k(e=>e.startStack),_=f[n]??[],v=k(e=>e.stackReadErrors[n]),[y,b]=(0,L.useState)(!1),[S,C]=(0,L.useState)([]),[E,O]=(0,L.useState)(``),[A,j]=(0,L.useState)(s??``),[M,N]=(0,L.useState)(null),[P,F]=(0,L.useState)(!1),[I,z]=(0,L.useState)(!1),B=(0,L.useRef)(0),[V,H]=(0,L.useState)(!1),[U,W]=(0,L.useState)({records:[],available:!0}),[G,K]=(0,L.useState)(!1),[q,J]=(0,L.useState)(null);(0,L.useEffect)(()=>{e&&_.length===0&&h(n)},[e,n,_.length,h]),(0,L.useEffect)(()=>{if(!e||o)return;let t=!0;return b(!0),C([]),O(``),ue.list().then(({releases:e})=>{if(!t)return;let r=e.filter(e=>e.project===n&&e.complete);C(r)}).catch(e=>{t&&J(`The release store could not be read: ${e.message}`)}).finally(()=>{t&&b(!1)}),()=>{t=!1}},[e,o,n]);let Y=o??S.find(e=>e.id===E)??null,X=o?.id??E.trim(),Z=JSON.stringify([n,A,X]),Q=M?.key===Z?M:null;(0,L.useEffect)(()=>{e&&(j(s??``),N(null),J(null))},[e,s,o?.id]),(0,L.useEffect)(()=>{let t=++B.current;if(N(null),z(!1),H(!1),W({records:[],available:!0}),K(!1),J(null),F(!1),!e||!X||!A)return;let r=!0;F(!0);let i=window.setTimeout(()=>{a(`checkRelease`,{project:n,stack:A,release:X}).then(e=>{r&&N({...e,key:Z})}).catch(e=>{r&&N({key:Z,ok:!1,because:`The daemon could not answer: ${e.message}`})}).finally(()=>{r&&F(!1)})},250);return()=>{r=!1,B.current=t+1,window.clearTimeout(i)}},[e,n,A,X,Z]);let he=async()=>{let e=B.current;z(!0),J(null);try{let t=await a(`checkRelease`,{project:n,stack:A,release:X,prepare:!0});e===B.current&&N({...t,key:Z})}catch(t){e===B.current&&J(t.message)}finally{e===B.current&&z(!1)}},ge=async()=>{if(!X||!A||!Q?.ok)return;H(!0),J(null);let e=B.current;try{let t=await ce({project:n,stack:A,release:X},()=>g(n,A,{release:X}),()=>ee.getDeployProgress({project:n,stack:A}),(t,n,r)=>{B.current===e&&W({records:t,available:r})});if(B.current!==e)return;if(t.state!==`confirmed`){J(t.message),K(t.state!==`failed`);return}u(A)}catch(t){B.current===e&&J(t.message)}finally{B.current===e&&H(!1)}},_e=_.find(e=>e.name===A),$=Q?.state===`unprepared`||Q?.state===`missing`,ve=_e?.config?.release?.mode===`required`;return(0,R.jsxs)(ie,{open:e,onClose:V?void 0:t,maxWidth:`sm`,fullWidth:!0,children:[(0,R.jsx)(oe,{children:`Deploy a release`}),(0,R.jsx)(re,{children:(0,R.jsxs)(D,{spacing:2.5,sx:{mt:1},children:[!o&&(0,R.jsx)(ne,{freeSolo:!0,size:`small`,disabled:V||I,loading:y,options:S.map(e=>e.id),value:E||null,inputValue:E,onChange:(e,t)=>O(t??``),onInputChange:(e,t)=>O(t),renderInput:e=>(0,R.jsx)(se,{...e,label:`Release ID`,placeholder:`Select or enter a release ID`})}),Y&&(0,R.jsxs)(d,{children:[(0,R.jsx)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontWeight:600},children:Y.id}),(0,R.jsxs)(D,{direction:`row`,spacing:1.5,sx:{alignItems:`center`,mt:.75},children:[(0,R.jsx)(me,{projectCommit:Y.projectCommit,omniCommit:Y.omniCommit,onRemote:Y.onRemote,project:Y.project}),(0,R.jsx)(p,{size:`small`,variant:`outlined`,label:`${Y.artifacts.count} app${Y.artifacts.count===1?``:`s`}`,sx:{height:20,fontSize:11}}),Y.statics&&(0,R.jsx)(p,{size:`small`,variant:`outlined`,label:`statics: ${Y.statics.stack}`,sx:{height:20,fontSize:11}})]})]}),(0,R.jsxs)(se,{select:!0,label:`Stack`,value:A,onChange:e=>j(e.target.value),size:`small`,fullWidth:!0,disabled:V||I,helperText:_e?.type===`local`?`Local stacks keep the selected release across restarts. Stop their applications before changing it.`:void 0,children:[_.length===0&&(0,R.jsx)(T,{disabled:!0,value:``,children:v?`Stack inventory unavailable`:f[n]?`This project has no stacks`:`Reading stack inventory…`}),_.map(e=>(0,R.jsx)(T,{value:e.name,disabled:!!e.config?.managedOrigin,children:(0,R.jsxs)(D,{direction:`row`,spacing:1,sx:{alignItems:`center`,width:`100%`},children:[(0,R.jsx)(w,{variant:`body2`,children:e.name}),(0,R.jsx)(p,{label:e.type,size:`small`,variant:`outlined`,sx:{height:18,fontSize:10}}),e.config?.release?.mode===`required`&&(0,R.jsx)(p,{label:`releases only`,size:`small`,color:`info`,variant:`outlined`,sx:{height:18,fontSize:10}}),(0,R.jsx)(d,{sx:{flex:1}}),(0,R.jsx)(w,{variant:`caption`,sx:{color:`text.secondary`},children:e.status})]})},e.name))]}),Y&&Y.gates.total>0&&(0,R.jsxs)(d,{children:[(0,R.jsx)(w,{variant:`caption`,sx:{color:`text.secondary`},children:fe(Y.gateList)}),(0,R.jsx)(d,{sx:{mt:.5},children:(0,R.jsx)(pe,{gates:Y.gateList})})]}),(P||I)&&(0,R.jsxs)(D,{direction:`row`,spacing:1,role:`status`,sx:{alignItems:`center`},children:[(0,R.jsx)(x,{size:16}),(0,R.jsx)(w,{variant:`body2`,sx:{color:`text.secondary`},children:I?`Preparing and verifying release files…`:`Checking this release against the stack…`})]}),Q&&!I&&(0,R.jsx)(m,{severity:Q.ok?`success`:Q.state?`info`:`error`,children:(0,R.jsx)(w,{variant:`body2`,sx:{whiteSpace:`pre-wrap`},children:Q.because})}),v&&(0,R.jsxs)(m,{severity:`warning`,children:[`Stack inventory unavailable · `,v]}),V&&!U.records.length&&(0,R.jsx)(w,{variant:`body2`,role:`status`,color:`text.secondary`,children:U.available?`Start submitted. Waiting for target observations…`:`Transfer observations unavailable. Waiting for the stack reply…`}),(0,R.jsx)(de,{records:U.records,unavailable:!U.available}),ve&&(0,R.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`},children:[A,` requires an immutable release.`]}),q&&(0,R.jsx)(m,{severity:G?`warning`:`error`,children:(0,R.jsx)(w,{variant:`body2`,sx:{whiteSpace:`pre-wrap`},children:q})})]})}),(0,R.jsxs)(ae,{children:[(0,R.jsx)(c,{onClick:V?()=>u(A):t,size:`small`,children:V?`Open stack`:I?`Close`:`Cancel`}),(0,R.jsx)(c,{variant:`contained`,size:`small`,startIcon:V?(0,R.jsx)(x,{size:14,color:`inherit`}):(0,R.jsx)(le,{}),disabled:!X||!A||V||I||P||!G&&!$&&Q?.ok!==!0,onClick:G?()=>u(A):$?he:ge,children:V?`Deploying…`:I?`Preparing…`:G?`Inspect stack`:Q?.state===`missing`?`Fetch and verify`:$?`Prepare release`:`Deploy`})]})]})}var L,R;function z(){return(z=e((()=>{L=t(),s(),b(),l(),f(),te(),u(),g(),v(),y(),_(),h(),E(),O(),C(),S(),A(),o(),P(),j(),M(),F(),N(),R=n()})))()}export{z as n,I as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{P as r,h as i,u as a,x as o,z as s}from"./client-CgyTwq9g.js";import{F as c,I as l,Q as u,St as d,Z as f,xt as ee}from"./mui-SNRRJ_vi.js";import{B as p,z as m}from"./mui-B3fJdIMc.js";import{C as h,it as g,rt as _,w as v}from"./mui-CMWGTMXv.js";import{_ as y,v as b}from"./mui-CPEkFAPo.js";import{r as x,t as S}from"./alert-BdJ2uaY0.js";import{c as C,s as w}from"./access-I0f72P9m.js";import{n as T,t as E}from"./use-polled-resource-B22hhr5L.js";import{g as D,i as O,m as k,t as A}from"./project.store-D5IR3fo9.js";import{G as j,M}from"./icons-B9Ct8PJ9.js";import{n as N,t as P}from"./page-breadcrumbs-3R8RZ3nA.js";import{n as F,t as I}from"./admin-data-table-CAEL2f-m.js";import{r as L,t as R}from"./formatters-RnRy4bXm.js";import{n as z,t as B}from"./use-stack-context-BuraYaeY.js";import{n as te,r as V}from"./tabs-DGqBkXh_.js";import{i as ne,n as H,r as U,t as W}from"./deploy-progress-B39cvvCE.js";function G(){let{activeProject:e,activeStack:t}=z();return(0,J.jsx)(K,{},JSON.stringify([e,t]))}function K(){let{activeProject:e,activeStack:t,matchesNamespace:n,extractStack:i}=z(),s=O(t=>t.projects.find(t=>t.name===e)),{can:l}=C(),u=l(`OmnitronRelease.deployments`),d=l(`OmnitronDeploy.getHistory`),p=l(`OmnitronProject.getDeployProgress`),[g,v]=(0,q.useState)(`stacks`),b=u&&(g===`stacks`||!d)?`stacks`:d?`legacy`:null,[x,w]=(0,q.useState)(!1),[E,k]=(0,q.useState)(!1),[A,j]=(0,q.useState)(0),[N,F]=(0,q.useState)(25),B=T(async()=>{if(!l(`OmnitronAudit.available`))throw Error(`Checking recorded stack starts requires access to audit availability.`);let e=await ne.deployments();if(!e.known)throw Error(e.why);return e},{intervalMs:15e3,enabled:b===`stacks`}),V=T(()=>a.getHistory({limit:Y}),{intervalMs:15e3,enabled:b===`legacy`}),H=T(()=>o.getDeployProgress(e?{project:e,...t&&{stack:t}}:void 0),{intervalMs:3e3,enabled:p,resourceKey:JSON.stringify([e,t,p])}),U=(B.data?.known?B.data.deployments:[]).filter(e=>n(`${e.project}/${e.stack}/_`)).sort((e,t)=>t.at.localeCompare(e.at)),G=(V.data??[]).filter(e=>n(e.app)),K=p?H.data??[]:[],{transfers:X,unscoped:Z}=e?D(K,s??{name:e},t):{transfers:K,unscoped:[]},re=b===`stacks`?U.length:G.length,Q=Math.min(A,Math.max(0,Math.ceil(re/N)-1)),ie=B.error,ae=async()=>{k(!0);try{await Promise.all([b===`stacks`&&B.refresh(),b===`legacy`&&V.refresh(),p&&H.refresh()])}finally{k(!1)}},$=e=>{F(e),j(0)};return(0,J.jsxs)(y,{spacing:2,sx:{minWidth:0},children:[(0,J.jsx)(P,{links:[{name:`Deployments`}],action:(0,J.jsxs)(y,{direction:`row`,spacing:1,useFlexGap:!0,sx:{flexWrap:`wrap`,alignItems:`center`},children:[(0,J.jsx)(_,{"data-console-command":`refresh`,"aria-label":`Refresh deployments`,size:`small`,onClick:ae,disabled:E,"aria-busy":E,children:(0,J.jsx)(M,{})}),l(`OmnitronProject.listStacks`)&&(0,J.jsx)(c,{component:r,to:`/stacks`,size:`small`,children:`Stacks`}),l(`OmnitronRelease.list`)&&(0,J.jsx)(c,{component:r,to:`/releases`,size:`small`,variant:`outlined`,children:l(`OmnitronProject.startStack`)?`Deploy a release`:`Releases`})]})}),p&&H.error&&(0,J.jsxs)(S,{severity:`warning`,variant:`outlined`,children:[`Transfer observations unavailable: `,H.error,`. Retained observations may be stale.`]}),p&&H.loading&&(0,J.jsx)(m,{role:`status`,variant:`caption`,children:`Reading transfer observations…`}),p&&!H.loading&&!H.error&&X.length===0&&(0,J.jsx)(m,{role:`status`,variant:`caption`,color:`text.secondary`,children:`No attributed transfer observations for this workspace.`}),(0,J.jsx)(W,{records:X,unavailable:!!H.error}),Z.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(c,{size:`small`,onClick:()=>w(e=>!e),"aria-expanded":x,"aria-controls":`unscoped-transfers`,sx:{alignSelf:`flex-start`},children:[x?`Hide`:`Show`,` unscoped observations · `,Z.length]}),(0,J.jsxs)(ee,{id:`unscoped-transfers`,in:x,unmountOnExit:!0,children:[(0,J.jsx)(m,{variant:`caption`,color:`text.secondary`,children:`These controller reports have no recorded project or stack.`}),(0,J.jsx)(W,{records:Z,unavailable:!!H.error})]})]}),u&&d&&(0,J.jsx)(te,{value:b??`stacks`,onChange:e=>{v(e),j(0)},"aria-label":`Deployment records`,tabs:[{value:`stacks`,label:B.data&&!B.error?`Stack starts · ${U.length}`:`Stack starts`},{value:`legacy`,label:V.data&&!V.error?`App history · ${G.length}`:`App history`}]}),b===`stacks`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(m,{variant:`caption`,color:`text.secondary`,children:[`Latest recorded start per stack namespace. `,l(`OmnitronAudit.list`)&&(0,J.jsxs)(J.Fragment,{children:[`Full event history is in `,(0,J.jsx)(h,{component:r,to:`/audit`,children:`Audit`}),`.`]})]}),(0,J.jsx)(I,{minWidth:600,scrollLabel:`Recorded stack starts`,columns:[{key:`stack`,header:`Stack`,render:t=>{let n=i(`${t.project}/${t.stack}/_`)??t.stack;return e&&l(`OmnitronProject.getStack`)?(0,J.jsxs)(y,{children:[(0,J.jsx)(h,{component:r,to:`/stacks/${encodeURIComponent(n)}`,children:n}),(t.project!==e||t.stack!==n)&&(0,J.jsxs)(m,{variant:`caption`,color:`text.secondary`,children:[t.project,`/`,t.stack]})]}):(0,J.jsxs)(m,{variant:`body2`,children:[t.project,`/`,t.stack]})}},{key:`release`,header:`Recorded source`,render:e=>e.release?l(`OmnitronRelease.get`)?(0,J.jsx)(h,{component:r,to:`/releases/${encodeURIComponent(e.release)}`,sx:{overflowWrap:`anywhere`},children:e.release}):e.release:(0,J.jsx)(m,{variant:`body2`,children:e.releaseUnnamed?`Release identity missing from record`:`Working tree / source not recorded`})},{key:`at`,header:`Recorded at`,render:e=>R(e.at)},{key:`source`,header:`Trigger`,render:e=>e.source??`Not recorded`},{key:`actorId`,header:`Actor`,render:e=>(0,J.jsx)(m,{variant:`caption`,sx:{overflowWrap:`anywhere`},children:e.actorId??`Not recorded`})}],data:U.slice(Q*N,(Q+1)*N),total:U.length,loading:B.loading,loadError:ie,emptyMessage:`No stack start recorded for this workspace`,rowKey:e=>`${e.project}/${e.stack}`,page:Q,pageSize:N,onPageChange:j,onPageSizeChange:$,dense:!0})]}):b===`legacy`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(m,{variant:`caption`,color:`text.secondary`,children:[`Retained records from the retired per-app path. Its version labels and success statuses do not prove an artifact was installed. The latest `,Y,` controller records are filtered to this workspace.`]}),(0,J.jsx)(I,{minWidth:680,scrollLabel:`Legacy application operation records`,columns:[{key:`app`,header:`Application`,render:e=>(0,J.jsx)(m,{variant:`body2`,sx:{overflowWrap:`anywhere`},children:e.app})},{key:`version`,header:`Requested label`,render:e=>(0,J.jsx)(m,{variant:`caption`,sx:{fontFamily:`monospace`,overflowWrap:`anywhere`},children:e.version})},{key:`strategy`,header:`Requested strategy`,render:e=>e.strategy},{key:`status`,header:`Recorded outcome`,render:e=>(0,J.jsx)(f,{size:`small`,variant:`outlined`,label:e.status})},{key:`startedAt`,header:`Started`,render:e=>R(e.startedAt)},{key:`duration`,header:`Duration`,render:e=>{let t=e.completedAt?Date.parse(e.completedAt)-Date.parse(e.startedAt):NaN;return Number.isFinite(t)&&t>=0?L(t):`Not recorded`}},{key:`deployedBy`,header:`Recorded actor`,render:e=>e.deployedBy??`Not recorded`}],data:G.slice(Q*N,(Q+1)*N),total:G.length,loading:V.loading,loadError:V.error,emptyMessage:`No legacy app operation in this history window`,rowKey:e=>e.id,page:Q,pageSize:N,onPageChange:j,onPageSizeChange:$,dense:!0})]})]})}var q,J,Y;function X(){return(X=e((()=>{q=t(),s(),v(),p(),b(),u(),l(),g(),d(),j(),F(),x(),V(),N(),i(),U(),H(),E(),B(),w(),A(),k(),J=n(),Y=200})))()}X();export{G as default};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{H as r,P as i,_ as a,c as o,h as s,v as c,z as l}from"./client-DFnuv2z3.js";import{a as u,o as d}from"./mui-agG5dued.js";import{Vt as f,Yt as p}from"./mui-BTN91yBK.js";import{_n as m,gn as h}from"./mui-CdB_p2lt.js";import{D as g,E as _,F as v,H as y,I as b,M as x,O as S,Q as C,St as w,T,V as E,Z as D,j as O,xt as ee}from"./mui-BXSXx9c9.js";import{B as te,F as ne,I as re,M as ie,a as ae,c as oe,j as k,o as se,s as ce,z as A}from"./mui-Cd711nOk.js";import{A as le,E as ue,T as de,it as fe,k as pe,rt as me}from"./mui-AnEgAVjz.js";import{_ as j,v as he}from"./mui-BwsIrivo.js";import{r as M,t as N}from"./alert-uBG6r9NW.js";import{n as ge,t as P}from"./chart-BpGXlCJc.js";import{n as F,s as _e}from"./access-48hkC2-P.js";import{n as ve,r as I,t as L}from"./use-polled-resource-B22hhr5L.js";import{a as ye,c as be,l as xe,n as Se,s as Ce,t as we}from"./app-address-BCXfN59F.js";import{F as Te,G as Ee,M as R,P as De,c as Oe,k as z,z as B}from"./icons-OboZgWSt.js";import{n as V,r as ke,t as Ae}from"./constants-CyhngVXh.js";import{n as je,t as Me}from"./table-BOWT6Y9d.js";import{n as Ne,t as Pe}from"./page-breadcrumbs-fR7Jmpp4.js";import{n as Fe,t as H}from"./skeleton-BmWDJWF9.js";import{i as U,s as Ie}from"./formatters-RnRy4bXm.js";import{c as Le,n as Re,s as ze,t as Be}from"./log-level-filter-Bcn31D1F.js";import{n as Ve,t as He}from"./use-stack-context-UkBsF-l7.js";function Ue({appName:e,refreshToken:t,onLogs:n}){let{data:r,error:i,loading:a,refresh:s}=ve(async()=>{let t=await o.getHealth({name:e}),n=t.apps[e];if(!n)throw Error(`The daemon returned no health answer for this application.`);return{...n,timestamp:t.timestamp}},{intervalMs:5e3,resourceKey:e});(0,We.useEffect)(()=>{t>0&&s()},[t,s]);let c=r!==null&&(!Number.isFinite(r.timestamp)||Date.now()-r.timestamp>=3e4||r.timestamp>Date.now()+5e3),l=r!==null&&!i&&!c,u=l?r.status:`unverified`,d=u===`healthy`?`success`:u===`unhealthy`?`error`:`warning`,f=r?[...r.checks].sort((e,t)=>({fail:0,warn:1,pass:2})[e.status]-{fail:0,warn:1,pass:2}[t.status]):[];return(0,W.jsx)(O,{variant:`outlined`,component:`section`,"aria-label":`Application readiness`,sx:{minWidth:0},children:(0,W.jsxs)(g,{sx:{p:2,"&:last-child":{pb:2}},children:[(0,W.jsxs)(j,{direction:`row`,useFlexGap:!0,spacing:1,sx:{alignItems:`center`,flexWrap:`wrap`,mb:1.5},children:[(0,W.jsx)(A,{variant:`subtitle2`,children:`Readiness`}),(0,W.jsx)(D,{size:`small`,variant:`outlined`,color:d,label:a&&!r?`Checking`:u}),r&&Number.isFinite(r.timestamp)&&(0,W.jsxs)(A,{variant:`caption`,color:`text.secondary`,children:[l?`Checked`:`Last observation`,` `,new Date(r.timestamp).toLocaleTimeString()]}),(0,W.jsx)(v,{size:`small`,onClick:n,sx:{ml:`auto`},children:`View logs`})]}),(i||c)&&(0,W.jsxs)(N,{severity:`warning`,variant:`outlined`,sx:{mb:1.5},children:[i??`Health observation is stale. Waiting for a fresh answer.`,r?` The checks below are the last observation, not a current health verdict.`:``]}),!r&&!i&&(0,W.jsx)(A,{variant:`body2`,color:`text.secondary`,children:`Waiting for the application health probe.`}),r&&f.length===0&&(0,W.jsxs)(A,{variant:`body2`,color:`text.secondary`,children:[`The application reported `,r.status,` without individual checks. Add named readiness checks to its bootstrap.`]}),(0,W.jsx)(j,{spacing:1.5,children:f.map((t,n)=>(0,W.jsxs)(E,{sx:{display:`grid`,gridTemplateColumns:`auto minmax(0, 1fr)`,gap:1,alignItems:`start`},children:[(0,W.jsx)(D,{size:`small`,variant:`outlined`,label:t.status,color:t.status===`pass`?`success`:t.status===`fail`?`error`:`warning`}),(0,W.jsxs)(E,{sx:{minWidth:0,overflowWrap:`anywhere`},children:[(0,W.jsx)(A,{variant:`body2`,sx:{fontWeight:600},children:t.name.startsWith(`${e}/`)?t.name.slice(e.length+1):t.name}),(0,W.jsx)(A,{variant:`body2`,color:`text.secondary`,children:t.message??`No diagnostic message was supplied by the application.`})]})]},`${t.name}-${n}`))})]})})}var We,W;function Ge(){return(Ge=e((()=>{We=t(),y(),x(),S(),he(),C(),b(),te(),M(),s(),L(),W=n()})))()}function G({children:e,value:t,index:n}){let[r,i]=(0,Y.useState)(t===n);return(0,Y.useEffect)(()=>{t===n&&i(!0)},[t,n]),r?(0,X.jsx)(E,{sx:{pt:2,display:t===n?`block`:`none`},children:e}):null}function K({label:e,value:t,sub:n,color:r}){return(0,X.jsx)(O,{variant:`outlined`,sx:{flex:1,minWidth:140,bgcolor:r?f(r,.04):void 0,borderColor:r?f(r,.2):void 0},children:(0,X.jsxs)(g,{sx:{py:1.5,px:2,"&:last-child":{pb:1.5}},children:[(0,X.jsx)(A,{variant:`caption`,sx:{color:`text.secondary`,textTransform:`uppercase`,letterSpacing:.5,fontSize:10},children:e}),(0,X.jsx)(A,{variant:`h5`,sx:{fontWeight:700,color:r??`text.primary`,mt:.25},children:t}),n&&(0,X.jsx)(A,{variant:`caption`,sx:{color:`text.disabled`,fontSize:11},children:n})]})})}function Ke({app:e,diagnostics:t,diagLoading:n}){let r=m(),i=t&&t.memory.heapTotal>0?Math.round(t.memory.heapUsed/t.memory.heapTotal*100):0,a=t!=null&&t.memory.heapTotal>0,o=be(e,t),s=o?` of ${o.name}`:``;return(0,X.jsxs)(j,{spacing:3,children:[(0,X.jsxs)(j,{direction:`row`,spacing:2,sx:{flexWrap:`wrap`},children:[(0,X.jsx)(K,{label:`CPU`,value:e.cpu>0?`${e.cpu.toFixed(1)}%`:`—`,color:e.cpu>80?r.palette.error.main:void 0}),(0,X.jsx)(K,{label:`Memory`,value:U(e.memory),sub:t?a?`Heap${s}: ${U(t.memory.heapUsed)} / ${U(t.memory.heapTotal)}`:`RSS${s}: ${U(t.memory.rss)}`:void 0}),(0,X.jsx)(K,{label:`Uptime`,value:Ie(e.uptime)}),(0,X.jsx)(K,{label:`Restarts`,value:e.restarts,color:e.restarts>0?r.palette.warning.main:void 0}),(0,X.jsx)(K,{label:`Instances`,value:e.instances})]}),t&&(0,X.jsx)(O,{variant:`outlined`,children:(0,X.jsx)(g,{sx:{py:1.5,"&:last-child":{pb:1.5}},children:a?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(j,{direction:`row`,sx:{justifyContent:`space-between`,alignItems:`center`,mb:.5},children:[(0,X.jsxs)(A,{variant:`caption`,sx:{color:`text.secondary`},children:[`Heap Usage`,s]}),(0,X.jsxs)(A,{variant:`caption`,sx:{fontWeight:600},children:[i,`%`]})]}),(0,X.jsx)(de,{variant:`determinate`,value:i,sx:{height:6,borderRadius:3,bgcolor:f(r.palette.primary.main,.08),"& .MuiLinearProgress-bar":{borderRadius:3,bgcolor:i>85?r.palette.error.main:r.palette.primary.main}}}),(0,X.jsxs)(j,{direction:`row`,sx:{justifyContent:`space-between`,mt:.5},children:[(0,X.jsxs)(A,{variant:`caption`,sx:{color:`text.disabled`},children:[`RSS`,s,`: `,U(t.memory.rss)]}),(0,X.jsxs)(A,{variant:`caption`,sx:{color:`text.disabled`},children:[`External: `,U(t.memory.external)]})]})]}):(0,X.jsxs)(j,{spacing:.5,children:[(0,X.jsxs)(A,{variant:`caption`,sx:{color:`text.secondary`},children:[`Memory (RSS)`,s]}),(0,X.jsx)(A,{variant:`h6`,sx:{fontWeight:600},children:U(t.memory.rss)})]})})}),e.processes&&e.processes.length>0&&(0,X.jsx)(O,{variant:`outlined`,children:(0,X.jsxs)(g,{sx:{p:0,"&:last-child":{pb:0}},children:[(0,X.jsx)(A,{variant:`subtitle2`,sx:{fontWeight:600,px:2,pt:1.5,pb:1},children:`Process Topology`}),(0,X.jsx)(Me,{columns:[{id:`name`,label:`Process`,render:e=>(0,X.jsxs)(j,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[(0,X.jsx)(Oe,{sx:{fontSize:8,color:e.status===`online`?r.palette.success.main:e.status===`stopped`?r.palette.text.disabled:r.palette.error.main}}),(0,X.jsx)(A,{variant:`body2`,sx:{fontWeight:600},children:e.name})]})},{id:`type`,label:`Type`,render:e=>(0,X.jsx)(D,{label:e.type,size:`small`,variant:`outlined`,sx:{fontSize:11,height:22}})},{id:`status`,label:`Status`,render:e=>(0,X.jsx)(D,{label:e.status,size:`small`,color:V[e.status]||`default`,variant:`outlined`,sx:{fontSize:11,height:22}})},{id:`pid`,label:`PID`,align:`right`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:12},children:e.pid??`—`})},{id:`uptime`,label:`Uptime`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:12},children:Ie(e.uptime)})},{id:`cpu`,label:`CPU`,align:`right`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:12},children:e.cpu>0?`${e.cpu.toFixed(1)}%`:`—`})},{id:`memory`,label:`Memory`,align:`right`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:12},children:U(e.memory)})},{id:`restarts`,label:`Restarts`,align:`right`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:12,color:e.restarts!==null&&e.restarts>0?r.palette.warning.main:void 0},children:e.restarts??`—`})}],data:e.processes,rowKey:e=>e.name,dense:!0,containerSx:{border:`none`,borderRadius:0}})]})}),t&&t.services.length>0&&(()=>{let e=[...new Set(t.services)];return(0,X.jsx)(O,{variant:`outlined`,children:(0,X.jsxs)(g,{sx:{py:1.5,"&:last-child":{pb:1.5}},children:[(0,X.jsx)(A,{variant:`subtitle2`,sx:{fontWeight:600,mb:1},children:`Exposed Services`}),(0,X.jsx)(j,{direction:`row`,spacing:.75,useFlexGap:!0,sx:{flexWrap:`wrap`},children:e.map(e=>(0,X.jsx)(D,{label:e,size:`small`,variant:`outlined`,sx:{fontSize:11,height:24}},e))})]})})})(),(0,X.jsx)(O,{variant:`outlined`,children:(0,X.jsxs)(g,{sx:{py:1.5,"&:last-child":{pb:1.5}},children:[(0,X.jsx)(A,{variant:`subtitle2`,sx:{fontWeight:600,mb:1},children:`Details`}),(0,X.jsxs)(j,{spacing:.75,children:[(0,X.jsx)(q,{label:`Mode`,value:e.mode}),(0,X.jsx)(q,{label:`PID`,value:e.pid??`—`,mono:!0}),(0,X.jsx)(q,{label:`Port`,value:e.port??`—`,mono:!0}),(0,X.jsx)(q,{label:`Critical`,value:e.critical?`Yes`:`No`})]})]})})]})}function q({label:e,value:t,mono:n}){return(0,X.jsxs)(j,{direction:`row`,sx:{justifyContent:`space-between`,alignItems:`center`},children:[(0,X.jsx)(A,{variant:`body2`,sx:{color:`text.secondary`,fontSize:13},children:e}),(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:13,...n&&{fontFamily:`monospace`}},children:t})]})}function qe(e){let t=typeof e==`string`?new Date(e):e;return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}function Je(e){let t=typeof e==`string`?new Date(e):e;return`${t.toLocaleString(`en-US`,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}.${String(t.getMilliseconds()).padStart(3,`0`)}`}function Ye({log:e,isNew:t}){let[n,r]=(0,Y.useState)(!1),i=Object.hasOwn(Ae,e.level)?Ae[e.level]:`#6b7280`,a=Object.hasOwn(Z,e.level)?Z[e.level]:`transparent`,o=e.labels||e.traceId||e.spanId||e.metadata;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(E,{onClick:()=>o&&r(e=>!e),sx:{display:`grid`,gridTemplateColumns:`90px 36px 1fr`,gap:1,alignItems:`baseline`,px:1.5,py:`3px`,bgcolor:n?`rgba(255,255,255,0.04)`:a,borderLeft:`2px solid ${n?i:`transparent`}`,cursor:o?`pointer`:`default`,transition:`background-color 0.15s ease`,animation:t?`${tt} 0.3s ease-out`:void 0,"&:hover":{bgcolor:`rgba(255,255,255,0.04)`}},children:[(0,X.jsx)(ne,{title:Je(e.timestamp),placement:`top-start`,arrow:!0,enterDelay:400,children:(0,X.jsx)(A,{component:`span`,sx:{fontFamily:Q,fontSize:11,color:`#7c8493`,lineHeight:`20px`,whiteSpace:`nowrap`,letterSpacing:`-0.02em`},children:qe(e.timestamp)})}),(0,X.jsx)(A,{component:`span`,sx:{fontFamily:Q,fontSize:10,fontWeight:700,color:i,lineHeight:`20px`,textTransform:`uppercase`,letterSpacing:`0.04em`},children:Le(e.level)}),(0,X.jsx)(A,{component:`span`,sx:{fontFamily:Q,fontSize:11.5,lineHeight:`20px`,overflow:`hidden`,color:e.level===`error`||e.level===`fatal`?`#fca5a5`:`#c9d1d9`,textOverflow:`ellipsis`,whiteSpace:n?`pre-wrap`:`nowrap`,wordBreak:n?`break-all`:void 0},children:e.message})]}),(0,X.jsx)(ee,{in:n,unmountOnExit:!0,children:(0,X.jsx)(E,{sx:{ml:`14px`,mr:1.5,mb:.5,p:1.5,bgcolor:`rgba(255,255,255,0.025)`,borderRadius:1,borderLeft:`2px solid ${f(i,.3)}`},children:(0,X.jsxs)(E,{component:`pre`,sx:{fontFamily:Q,fontSize:11,color:`#8b949e`,m:0,whiteSpace:`pre-wrap`,wordBreak:`break-all`,lineHeight:1.7},children:[e.traceId&&(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{style:{color:`#7c8493`},children:`traceId: `}),(0,X.jsx)(`span`,{style:{color:`#d2a8ff`},children:e.traceId}),`
1
+ import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{H as r,P as i,_ as a,c as o,h as s,v as c,z as l}from"./client-CgyTwq9g.js";import{a as u,o as d}from"./mui-agG5dued.js";import{Vt as f,Yt as p}from"./mui-BTN91yBK.js";import{_n as m,gn as h}from"./mui-Bdr6Ks5j.js";import{D as g,E as _,F as v,H as y,I as b,M as x,O as S,Q as C,St as w,T,V as E,Z as D,j as O,xt as ee}from"./mui-SNRRJ_vi.js";import{B as te,F as ne,I as re,M as ie,a as ae,c as oe,j as k,o as se,s as ce,z as A}from"./mui-B3fJdIMc.js";import{A as le,E as ue,T as de,it as fe,k as pe,rt as me}from"./mui-CMWGTMXv.js";import{_ as j,v as he}from"./mui-CPEkFAPo.js";import{r as M,t as N}from"./alert-BdJ2uaY0.js";import{n as ge,t as P}from"./chart-BKXP2ter.js";import{n as F,s as _e}from"./access-I0f72P9m.js";import{n as ve,r as I,t as L}from"./use-polled-resource-B22hhr5L.js";import{a as ye,c as be,l as xe,n as Se,s as Ce,t as we}from"./app-address-BCXfN59F.js";import{F as Te,G as Ee,M as R,P as De,c as Oe,k as z,z as B}from"./icons-B9Ct8PJ9.js";import{n as V,r as ke,t as Ae}from"./constants-CyhngVXh.js";import{n as je,t as Me}from"./table-D-so_B1p.js";import{n as Ne,t as Pe}from"./page-breadcrumbs-3R8RZ3nA.js";import{n as Fe,t as H}from"./skeleton-BnVxAoeX.js";import{i as U,s as Ie}from"./formatters-RnRy4bXm.js";import{c as Le,n as Re,s as ze,t as Be}from"./log-level-filter-oaUGdbpk.js";import{n as Ve,t as He}from"./use-stack-context-BuraYaeY.js";function Ue({appName:e,refreshToken:t,onLogs:n}){let{data:r,error:i,loading:a,refresh:s}=ve(async()=>{let t=await o.getHealth({name:e}),n=t.apps[e];if(!n)throw Error(`The daemon returned no health answer for this application.`);return{...n,timestamp:t.timestamp}},{intervalMs:5e3,resourceKey:e});(0,We.useEffect)(()=>{t>0&&s()},[t,s]);let c=r!==null&&(!Number.isFinite(r.timestamp)||Date.now()-r.timestamp>=3e4||r.timestamp>Date.now()+5e3),l=r!==null&&!i&&!c,u=l?r.status:`unverified`,d=u===`healthy`?`success`:u===`unhealthy`?`error`:`warning`,f=r?[...r.checks].sort((e,t)=>({fail:0,warn:1,pass:2})[e.status]-{fail:0,warn:1,pass:2}[t.status]):[];return(0,W.jsx)(O,{variant:`outlined`,component:`section`,"aria-label":`Application readiness`,sx:{minWidth:0},children:(0,W.jsxs)(g,{sx:{p:2,"&:last-child":{pb:2}},children:[(0,W.jsxs)(j,{direction:`row`,useFlexGap:!0,spacing:1,sx:{alignItems:`center`,flexWrap:`wrap`,mb:1.5},children:[(0,W.jsx)(A,{variant:`subtitle2`,children:`Readiness`}),(0,W.jsx)(D,{size:`small`,variant:`outlined`,color:d,label:a&&!r?`Checking`:u}),r&&Number.isFinite(r.timestamp)&&(0,W.jsxs)(A,{variant:`caption`,color:`text.secondary`,children:[l?`Checked`:`Last observation`,` `,new Date(r.timestamp).toLocaleTimeString()]}),(0,W.jsx)(v,{size:`small`,onClick:n,sx:{ml:`auto`},children:`View logs`})]}),(i||c)&&(0,W.jsxs)(N,{severity:`warning`,variant:`outlined`,sx:{mb:1.5},children:[i??`Health observation is stale. Waiting for a fresh answer.`,r?` The checks below are the last observation, not a current health verdict.`:``]}),!r&&!i&&(0,W.jsx)(A,{variant:`body2`,color:`text.secondary`,children:`Waiting for the application health probe.`}),r&&f.length===0&&(0,W.jsxs)(A,{variant:`body2`,color:`text.secondary`,children:[`The application reported `,r.status,` without individual checks. Add named readiness checks to its bootstrap.`]}),(0,W.jsx)(j,{spacing:1.5,children:f.map((t,n)=>(0,W.jsxs)(E,{sx:{display:`grid`,gridTemplateColumns:`auto minmax(0, 1fr)`,gap:1,alignItems:`start`},children:[(0,W.jsx)(D,{size:`small`,variant:`outlined`,label:t.status,color:t.status===`pass`?`success`:t.status===`fail`?`error`:`warning`}),(0,W.jsxs)(E,{sx:{minWidth:0,overflowWrap:`anywhere`},children:[(0,W.jsx)(A,{variant:`body2`,sx:{fontWeight:600},children:t.name.startsWith(`${e}/`)?t.name.slice(e.length+1):t.name}),(0,W.jsx)(A,{variant:`body2`,color:`text.secondary`,children:t.message??`No diagnostic message was supplied by the application.`})]})]},`${t.name}-${n}`))})]})})}var We,W;function Ge(){return(Ge=e((()=>{We=t(),y(),x(),S(),he(),C(),b(),te(),M(),s(),L(),W=n()})))()}function G({children:e,value:t,index:n}){let[r,i]=(0,Y.useState)(t===n);return(0,Y.useEffect)(()=>{t===n&&i(!0)},[t,n]),r?(0,X.jsx)(E,{sx:{pt:2,display:t===n?`block`:`none`},children:e}):null}function K({label:e,value:t,sub:n,color:r}){return(0,X.jsx)(O,{variant:`outlined`,sx:{flex:1,minWidth:140,bgcolor:r?f(r,.04):void 0,borderColor:r?f(r,.2):void 0},children:(0,X.jsxs)(g,{sx:{py:1.5,px:2,"&:last-child":{pb:1.5}},children:[(0,X.jsx)(A,{variant:`caption`,sx:{color:`text.secondary`,textTransform:`uppercase`,letterSpacing:.5,fontSize:10},children:e}),(0,X.jsx)(A,{variant:`h5`,sx:{fontWeight:700,color:r??`text.primary`,mt:.25},children:t}),n&&(0,X.jsx)(A,{variant:`caption`,sx:{color:`text.disabled`,fontSize:11},children:n})]})})}function Ke({app:e,diagnostics:t,diagLoading:n}){let r=m(),i=t&&t.memory.heapTotal>0?Math.round(t.memory.heapUsed/t.memory.heapTotal*100):0,a=t!=null&&t.memory.heapTotal>0,o=be(e,t),s=o?` of ${o.name}`:``;return(0,X.jsxs)(j,{spacing:3,children:[(0,X.jsxs)(j,{direction:`row`,spacing:2,sx:{flexWrap:`wrap`},children:[(0,X.jsx)(K,{label:`CPU`,value:e.cpu>0?`${e.cpu.toFixed(1)}%`:`—`,color:e.cpu>80?r.palette.error.main:void 0}),(0,X.jsx)(K,{label:`Memory`,value:U(e.memory),sub:t?a?`Heap${s}: ${U(t.memory.heapUsed)} / ${U(t.memory.heapTotal)}`:`RSS${s}: ${U(t.memory.rss)}`:void 0}),(0,X.jsx)(K,{label:`Uptime`,value:Ie(e.uptime)}),(0,X.jsx)(K,{label:`Restarts`,value:e.restarts,color:e.restarts>0?r.palette.warning.main:void 0}),(0,X.jsx)(K,{label:`Instances`,value:e.instances})]}),t&&(0,X.jsx)(O,{variant:`outlined`,children:(0,X.jsx)(g,{sx:{py:1.5,"&:last-child":{pb:1.5}},children:a?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(j,{direction:`row`,sx:{justifyContent:`space-between`,alignItems:`center`,mb:.5},children:[(0,X.jsxs)(A,{variant:`caption`,sx:{color:`text.secondary`},children:[`Heap Usage`,s]}),(0,X.jsxs)(A,{variant:`caption`,sx:{fontWeight:600},children:[i,`%`]})]}),(0,X.jsx)(de,{variant:`determinate`,value:i,sx:{height:6,borderRadius:3,bgcolor:f(r.palette.primary.main,.08),"& .MuiLinearProgress-bar":{borderRadius:3,bgcolor:i>85?r.palette.error.main:r.palette.primary.main}}}),(0,X.jsxs)(j,{direction:`row`,sx:{justifyContent:`space-between`,mt:.5},children:[(0,X.jsxs)(A,{variant:`caption`,sx:{color:`text.disabled`},children:[`RSS`,s,`: `,U(t.memory.rss)]}),(0,X.jsxs)(A,{variant:`caption`,sx:{color:`text.disabled`},children:[`External: `,U(t.memory.external)]})]})]}):(0,X.jsxs)(j,{spacing:.5,children:[(0,X.jsxs)(A,{variant:`caption`,sx:{color:`text.secondary`},children:[`Memory (RSS)`,s]}),(0,X.jsx)(A,{variant:`h6`,sx:{fontWeight:600},children:U(t.memory.rss)})]})})}),e.processes&&e.processes.length>0&&(0,X.jsx)(O,{variant:`outlined`,children:(0,X.jsxs)(g,{sx:{p:0,"&:last-child":{pb:0}},children:[(0,X.jsx)(A,{variant:`subtitle2`,sx:{fontWeight:600,px:2,pt:1.5,pb:1},children:`Process Topology`}),(0,X.jsx)(Me,{columns:[{id:`name`,label:`Process`,render:e=>(0,X.jsxs)(j,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[(0,X.jsx)(Oe,{sx:{fontSize:8,color:e.status===`online`?r.palette.success.main:e.status===`stopped`?r.palette.text.disabled:r.palette.error.main}}),(0,X.jsx)(A,{variant:`body2`,sx:{fontWeight:600},children:e.name})]})},{id:`type`,label:`Type`,render:e=>(0,X.jsx)(D,{label:e.type,size:`small`,variant:`outlined`,sx:{fontSize:11,height:22}})},{id:`status`,label:`Status`,render:e=>(0,X.jsx)(D,{label:e.status,size:`small`,color:V[e.status]||`default`,variant:`outlined`,sx:{fontSize:11,height:22}})},{id:`pid`,label:`PID`,align:`right`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:12},children:e.pid??`—`})},{id:`uptime`,label:`Uptime`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:12},children:Ie(e.uptime)})},{id:`cpu`,label:`CPU`,align:`right`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:12},children:e.cpu>0?`${e.cpu.toFixed(1)}%`:`—`})},{id:`memory`,label:`Memory`,align:`right`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:12},children:U(e.memory)})},{id:`restarts`,label:`Restarts`,align:`right`,render:e=>(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:12,color:e.restarts!==null&&e.restarts>0?r.palette.warning.main:void 0},children:e.restarts??`—`})}],data:e.processes,rowKey:e=>e.name,dense:!0,containerSx:{border:`none`,borderRadius:0}})]})}),t&&t.services.length>0&&(()=>{let e=[...new Set(t.services)];return(0,X.jsx)(O,{variant:`outlined`,children:(0,X.jsxs)(g,{sx:{py:1.5,"&:last-child":{pb:1.5}},children:[(0,X.jsx)(A,{variant:`subtitle2`,sx:{fontWeight:600,mb:1},children:`Exposed Services`}),(0,X.jsx)(j,{direction:`row`,spacing:.75,useFlexGap:!0,sx:{flexWrap:`wrap`},children:e.map(e=>(0,X.jsx)(D,{label:e,size:`small`,variant:`outlined`,sx:{fontSize:11,height:24}},e))})]})})})(),(0,X.jsx)(O,{variant:`outlined`,children:(0,X.jsxs)(g,{sx:{py:1.5,"&:last-child":{pb:1.5}},children:[(0,X.jsx)(A,{variant:`subtitle2`,sx:{fontWeight:600,mb:1},children:`Details`}),(0,X.jsxs)(j,{spacing:.75,children:[(0,X.jsx)(q,{label:`Mode`,value:e.mode}),(0,X.jsx)(q,{label:`PID`,value:e.pid??`—`,mono:!0}),(0,X.jsx)(q,{label:`Port`,value:e.port??`—`,mono:!0}),(0,X.jsx)(q,{label:`Critical`,value:e.critical?`Yes`:`No`})]})]})})]})}function q({label:e,value:t,mono:n}){return(0,X.jsxs)(j,{direction:`row`,sx:{justifyContent:`space-between`,alignItems:`center`},children:[(0,X.jsx)(A,{variant:`body2`,sx:{color:`text.secondary`,fontSize:13},children:e}),(0,X.jsx)(A,{variant:`body2`,sx:{fontSize:13,...n&&{fontFamily:`monospace`}},children:t})]})}function qe(e){let t=typeof e==`string`?new Date(e):e;return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}function Je(e){let t=typeof e==`string`?new Date(e):e;return`${t.toLocaleString(`en-US`,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}.${String(t.getMilliseconds()).padStart(3,`0`)}`}function Ye({log:e,isNew:t}){let[n,r]=(0,Y.useState)(!1),i=Object.hasOwn(Ae,e.level)?Ae[e.level]:`#6b7280`,a=Object.hasOwn(Z,e.level)?Z[e.level]:`transparent`,o=e.labels||e.traceId||e.spanId||e.metadata;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(E,{onClick:()=>o&&r(e=>!e),sx:{display:`grid`,gridTemplateColumns:`90px 36px 1fr`,gap:1,alignItems:`baseline`,px:1.5,py:`3px`,bgcolor:n?`rgba(255,255,255,0.04)`:a,borderLeft:`2px solid ${n?i:`transparent`}`,cursor:o?`pointer`:`default`,transition:`background-color 0.15s ease`,animation:t?`${tt} 0.3s ease-out`:void 0,"&:hover":{bgcolor:`rgba(255,255,255,0.04)`}},children:[(0,X.jsx)(ne,{title:Je(e.timestamp),placement:`top-start`,arrow:!0,enterDelay:400,children:(0,X.jsx)(A,{component:`span`,sx:{fontFamily:Q,fontSize:11,color:`#7c8493`,lineHeight:`20px`,whiteSpace:`nowrap`,letterSpacing:`-0.02em`},children:qe(e.timestamp)})}),(0,X.jsx)(A,{component:`span`,sx:{fontFamily:Q,fontSize:10,fontWeight:700,color:i,lineHeight:`20px`,textTransform:`uppercase`,letterSpacing:`0.04em`},children:Le(e.level)}),(0,X.jsx)(A,{component:`span`,sx:{fontFamily:Q,fontSize:11.5,lineHeight:`20px`,overflow:`hidden`,color:e.level===`error`||e.level===`fatal`?`#fca5a5`:`#c9d1d9`,textOverflow:`ellipsis`,whiteSpace:n?`pre-wrap`:`nowrap`,wordBreak:n?`break-all`:void 0},children:e.message})]}),(0,X.jsx)(ee,{in:n,unmountOnExit:!0,children:(0,X.jsx)(E,{sx:{ml:`14px`,mr:1.5,mb:.5,p:1.5,bgcolor:`rgba(255,255,255,0.025)`,borderRadius:1,borderLeft:`2px solid ${f(i,.3)}`},children:(0,X.jsxs)(E,{component:`pre`,sx:{fontFamily:Q,fontSize:11,color:`#8b949e`,m:0,whiteSpace:`pre-wrap`,wordBreak:`break-all`,lineHeight:1.7},children:[e.traceId&&(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{style:{color:`#7c8493`},children:`traceId: `}),(0,X.jsx)(`span`,{style:{color:`#d2a8ff`},children:e.traceId}),`
2
2
  `]}),e.spanId&&(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{style:{color:`#7c8493`},children:`spanId: `}),(0,X.jsx)(`span`,{style:{color:`#d2a8ff`},children:e.spanId}),`
3
3
  `]}),e.labels&&(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{style:{color:`#7c8493`},children:`labels: `}),(0,X.jsx)(`span`,{style:{color:`#7ee787`},children:JSON.stringify(e.labels,null,2)}),`
4
4
  `]}),e.metadata&&(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{style:{color:`#7c8493`},children:`metadata:`}),`
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{H as r,P as i,V as a,z as o}from"./client-DFnuv2z3.js";import{D as s,F as c,H as l,I as u,M as d,O as ee,Q as f,V as p,Z as m,c as te,ct as h,d as ne,f as g,g as _,h as re,j as v,l as ie,m as y,p as b,s as x,st as ae,u as S}from"./mui-BXSXx9c9.js";import{B as C,z as w}from"./mui-Cd711nOk.js";import{E as T,T as oe,it as E,rt as D}from"./mui-AnEgAVjz.js";import{_ as O,v as k}from"./mui-BwsIrivo.js";import{n as se,r as A,t as j}from"./alert-uBG6r9NW.js";import{n as M,s as N}from"./access-48hkC2-P.js";import{r as ce,t as le}from"./use-polled-resource-B22hhr5L.js";import{i as P,n as ue,r as de,t as F}from"./project.store--G5pIF-J.js";import{B as fe,G as I,M as pe,k as me,m as L,p as he,z as ge}from"./icons-OboZgWSt.js";import{n as R,t as _e}from"./operation-status-Bm1x1wTz.js";import{n as z,t as B}from"./table-BOWT6Y9d.js";import{n as V,t as ve}from"./page-breadcrumbs-fR7Jmpp4.js";import{s as ye}from"./formatters-RnRy4bXm.js";import{n as be,r as xe,t as Se}from"./stack-health-status-BIv2C10x.js";import{a as H,c as Ce,r as U,s as W}from"./sync-reading-CN0jPKAg.js";import{n as G,t as we}from"./deploy-release-dialog-BOXcD5Wo.js";import{n as Te,t as K}from"./release-deployment-state-DRrEI2pP.js";import{a as Ee,c as De,i as Oe,l as ke,n as Ae,o as je,r as Me,s as Ne,t as Pe,u as Fe}from"./stack-start-notice-BVnMOwRQ.js";function Ie({operation:e}){if(!e||e.supersededAt)return null;let t=e.phase===`failed`,n=e.phase===`stopped`,r=e.nodes.filter(e=>e.outcome===`stopped`).length;if(n&&!e.nodes.length)return null;let i=e.nodes.map(e=>(0,q.jsxs)(p,{sx:{display:`flex`,flexWrap:`wrap`,columnGap:1.5,mt:.75},children:[(0,q.jsx)(w,{variant:`body2`,sx:{fontFamily:`monospace`,overflowWrap:`anywhere`},children:e.node}),(0,q.jsx)(w,{variant:`body2`,children:e.outcome===`unknown`?`Awaiting confirmation`:e.outcome}),e.authority&&(0,q.jsxs)(w,{variant:`caption`,sx:{overflowWrap:`anywhere`},children:[e.authority.clusterId,` · epoch `,e.authority.epoch,` · `,e.authority.nodeId]}),e.reason&&(0,q.jsx)(w,{variant:`caption`,sx:{width:`100%`,overflowWrap:`anywhere`},children:e.reason})]},e.node));return n?(0,q.jsxs)(p,{component:`details`,sx:{mb:2,minWidth:0,typography:`body2`,"& summary":{cursor:`pointer`}},children:[(0,q.jsxs)(`summary`,{children:[`Stop confirmed · `,r,`/`,e.nodes.length,` nodes`]}),i]}):(0,q.jsx)(j,{severity:t?`error`:`info`,sx:{mb:2,minWidth:0},children:(0,q.jsxs)(p,{role:`status`,"aria-live":`polite`,sx:{minWidth:0},children:[(0,q.jsxs)(w,{variant:`subtitle2`,children:[t?e.intentCommitted?`Stop not confirmed`:`Stop declined before execution`:e.phase===`preparing`?`Checking stop ownership`:`Stopping stack`,e.nodes.length>0&&` · ${r}/${e.nodes.length} nodes confirmed`]}),!t&&(0,q.jsx)(oe,{"aria-label":`Stack stop in progress`,sx:{mt:1,mb:1.5}}),e.error&&(0,q.jsx)(w,{variant:`body2`,sx:{overflowWrap:`anywhere`},children:e.error}),i]})})}var q;function Le(){return(Le=e((()=>{l(),C(),T(),A(),q=n()})))()}function Re({children:e,gap:t=Be,fill:n,sx:r,ref:i,...a}){return(0,ze.jsx)(O,{ref:i,spacing:t,sx:{...n&&{flex:1},...r},...a,children:e})}var ze,Be;function Ve(){return(Ve=e((()=>{t(),k(),ze=n(),Be=3})))()}function He({project:e,stack:t,requiresRelease:n,managed:r,selected:i,onDeploy:a,onWorkingTree:o}){return(0,J.jsxs)(p,{sx:{mb:2,minWidth:0},children:[!r&&(0,J.jsxs)(O,{direction:`row`,useFlexGap:!0,spacing:1,sx:{alignItems:`center`,flexWrap:`wrap`,mb:1},children:[i&&(0,J.jsx)(m,{label:`Selected: `+i,size:`small`,variant:`outlined`}),n&&(0,J.jsx)(m,{label:`Release required`,size:`small`,variant:`outlined`}),(0,J.jsx)(p,{sx:{flex:1}}),o&&(0,J.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,J.jsx)(c,{size:`small`,onClick:o,children:`Use working tree…`})}),(0,J.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,J.jsx)(c,{size:`small`,startIcon:(0,J.jsx)(L,{}),onClick:a,children:`Deploy release…`})})]}),(0,J.jsx)(K,{project:e,stack:t},`${e}/${t}`)]})}var J;function Ue(){return(Ue=e((()=>{l(),u(),f(),k(),N(),I(),Te(),J=n()})))()}function We(){let{name:e}=r(),t=a(),n=ue(),o=de(),l=P(e=>!!(n&&e.stacksByProject[n])),u=P(e=>n?e.stackReadErrors[n]:null),d=P(e=>e.fetchStacks),ee=P(e=>e.resumeInstalledStack),f=P(e=>e.startStack),te=P(e=>e.stopStack),h=P(e=>e.deleteStack),g=`${n}/${e}`,_=P(e=>e.stackNotices[g]),y=P(e=>e.clearStackNotice),S=P(e=>e.pendingOps),[C,T]=(0,Z.useState)(!1),[oe,E]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(!1),[A,N]=(0,Z.useState)(!1),[le,F]=(0,Z.useState)(!1),I=o.find(t=>t.name===e),R=n&&e?S[`${n}/${e}`]??null:null,z=Object.keys(S).length>0;ce(()=>void(n&&d(n)),{intervalMs:z?3e3:1e4,enabled:!!n,resourceKey:n});let V=(0,Z.useCallback)(async()=>{n&&e&&await f(n,e)},[n,e,f]),xe=(0,Z.useCallback)(async()=>{if(n&&e){try{await h(n,e),t(`/stacks`)}catch{}T(!1)}},[n,e,h,t]);if(!I&&n&&u)return(0,Q.jsxs)(j,{severity:`error`,children:[`Stack inventory unavailable · `,u,` `,(0,Q.jsx)(c,{onClick:()=>void d(n),children:`Retry`})]});if(!I&&n&&!l)return(0,Q.jsx)(_e,{active:!0,label:`Reading stack inventory`});if(!I)return(0,Q.jsx)(Re,{children:(0,Q.jsxs)(j,{severity:`warning`,children:[`Stack "`,e,`" not found.`,` `,(0,Q.jsx)(c,{size:`small`,onClick:()=>t(`/stacks`),children:`Back to Stacks`})]})});let H=[{id:`name`,label:`App`,render:e=>(0,Q.jsx)(p,{sx:{fontWeight:600},children:e.name})},{id:`status`,label:`Process`,render:e=>(0,Q.jsx)(m,{label:e.status,size:`small`,color:e.status===`online`?`success`:e.status===`crashed`||e.status===`errored`?`error`:`default`,sx:{height:18,fontSize:`0.6rem`}})},{id:`health`,label:`Health`,render:e=>(0,Q.jsx)(Se,{status:e.health})},{id:`pid`,label:`PID`,render:e=>(0,Q.jsx)(p,{sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:e.pid??`—`})},{id:`instances`,label:`Instances`,render:e=>e.instances},{id:`uptime`,label:`Uptime`,render:e=>(0,Q.jsx)(p,{sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:e.uptime>0?ye(e.uptime):`—`})}],Ce=[{id:`host`,label:`Host`,render:e=>(0,Q.jsxs)(p,{sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:[e.host,`:`,e.port,e.label&&(0,Q.jsxs)(w,{component:`span`,variant:`caption`,sx:{ml:1,color:`text.secondary`},children:[`(`,e.label,`)`]})]})},{id:`role`,label:`Role`,render:e=>(0,Q.jsx)(m,{label:e.role,size:`small`,sx:{height:18,fontSize:`0.6rem`}})},{id:`daemonRole`,label:`Daemon`,render:e=>(0,Q.jsx)(m,{label:e.daemonRole,size:`small`,color:e.daemonRole===`master`?`primary`:`default`,sx:{height:18,fontSize:`0.6rem`}})},{id:`connected`,label:`Status`,render:e=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(p,{component:`span`,sx:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,bgcolor:e.connected?`success.main`:`warning.main`,mr:.5}}),e.connected?`Inventory observed`:`Inventory unavailable`]})},{id:`lastSeen`,label:`Last Seen`,render:e=>(0,Q.jsx)(p,{sx:{fontFamily:`monospace`,fontSize:`0.75rem`},children:e.lastSeen?new Date(e.lastSeen).toLocaleTimeString():`—`})}],U=I.config?.release?.mode===`required`,W=[`running`,`degraded`,`error`,`unknown`,`stopping`].includes(I.status),G=I.status===`stopped`,Te=I.status===`starting`||I.status===`stopping`||!!R,K=!!R;return(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(ve,{linkComponent:i,links:[{name:`Stacks`,href:`/stacks`},{name:I.name}],action:(0,Q.jsxs)(p,{sx:{display:`flex`,gap:1,alignItems:`center`,flexWrap:`wrap`},children:[G&&!K&&(0,Q.jsx)(M,{permission:`OmnitronProject.deleteStack`,children:(0,Q.jsx)(D,{size:`small`,color:`error`,onClick:()=>T(!0),title:`Delete stack`,"aria-label":`Delete stack ${I.name}`,sx:{marginInlineEnd:1},children:(0,Q.jsx)(he,{})})}),(0,Q.jsx)(m,{label:I.status.charAt(0).toUpperCase()+I.status.slice(1),size:`small`,sx:{bgcolor:$[I.status]??$.stopped,color:`white`,fontWeight:600}}),(0,Q.jsx)(M,{permission:`OmnitronProject.diagnoseStack`,children:(0,Q.jsx)(c,{size:`small`,onClick:()=>k(!0),children:`Diagnose`})}),(0,Q.jsx)(D,{size:`small`,"aria-label":`Refresh stack`,title:`Refresh stack`,onClick:()=>n&&d(n),children:(0,Q.jsx)(pe,{})}),Te?(0,Q.jsx)(c,{variant:`outlined`,size:`small`,disabled:!0,startIcon:(0,Q.jsx)(ae,{size:14}),children:R===`resuming`?`Resuming installed apps…`:R===`starting`||I.status===`starting`?`Starting…`:`Stopping…`}):n&&e&&ke(I)?(0,Q.jsx)(Ne,{stack:I,onResume:()=>void ee(n,e),onReviewStop:()=>E(!0)}):G?U&&!I.selectedRelease?(0,Q.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(c,{startIcon:(0,Q.jsx)(L,{}),color:`success`,variant:`contained`,size:`small`,onClick:()=>N(!0),children:`Deploy release…`})}):(0,Q.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(c,{startIcon:(0,Q.jsx)(me,{}),color:`success`,variant:`contained`,size:`small`,onClick:V,children:`Start`})}):W?(0,Q.jsx)(M,{permission:`OmnitronProject.reviewStackStop`,children:(0,Q.jsx)(c,{startIcon:(0,Q.jsx)(ge,{}),color:`error`,variant:`outlined`,size:`small`,onClick:()=>E(!0),children:I.stopOperation?.phase===`failed`&&!I.stopOperation.supersededAt?`Review retry…`:`Review stop…`})}):null]})}),oe&&n&&e&&(0,Q.jsx)(Ee,{project:n,stack:e,onClose:()=>E(!1),onConfirm:(t,r)=>{E(!1),te(n,e,t,r)}},`${n}/${e}`),O&&n&&e&&(0,Q.jsx)(Me,{project:n,stack:e,onClose:()=>k(!1)},`${n}/${e}`),(0,Q.jsx)(Ie,{operation:I.stopOperation}),(0,Q.jsx)(De,{stack:I}),(0,Q.jsx)(Pe,{stack:I}),(0,Q.jsx)(be,{stack:I}),u&&(0,Q.jsxs)(j,{severity:`warning`,children:[`Showing the last stack inventory · `,u]}),_&&_!==u&&(0,Q.jsx)(se,{sx:{mb:2},onClose:()=>y(g),children:_}),n&&e&&(0,Q.jsx)(He,{project:n,stack:e,requiresRelease:!!U,managed:!!I.config.managedOrigin,selected:I.selectedRelease?.id,onWorkingTree:I.selectedRelease&&G&&!K&&!U?()=>F(!0):void 0,onDeploy:()=>N(!0)}),I.type!==`local`&&W&&(0,Q.jsx)(v,{variant:`outlined`,sx:{mb:2,p:2},children:(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,gap:2},children:[(0,Q.jsx)(L,{sx:{fontSize:20,color:`primary.main`}}),(0,Q.jsxs)(p,{sx:{flex:1},children:[(0,Q.jsxs)(w,{variant:`body2`,sx:{fontWeight:600},children:[I.nodes.filter(e=>e.connected).length,`/`,I.nodes.length,` node inventories observed`]}),(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`},children:[I.type===`remote`?`SSH`:`Cluster`,` deployment — `,Ge(I.nodes)]})]}),I.nodes.some(e=>!e.connected)&&(0,Q.jsx)(m,{label:`${I.nodes.filter(e=>!e.connected).length} unobserved`,size:`small`,color:`warning`,sx:{height:22,fontSize:`0.65rem`}})]})}),(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`,mb:1,display:`block`},children:[`Applications (`,I.apps.length,`)`]}),(0,Q.jsx)(B,{scrollLabel:`Stack applications`,sx:{minWidth:640},columns:H,data:I.apps,rowKey:e=>e.handleKey,dense:!0,containerSx:{border:`none`,borderRadius:0},emptyContent:(0,Q.jsx)(w,{variant:`caption`,sx:{color:`text.disabled`},children:`No apps configured`})})]})}),(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`Overview`}),(0,Q.jsx)(Y,{label:`Type`,value:I.type===`local`?`Local`:I.type===`remote`?`Remote (SSH)`:`Cluster`}),(0,Q.jsx)(Y,{label:`Apps`,value:`${I.apps.filter(e=>e.status===`online`).length} / ${I.apps.length}`}),(0,Q.jsx)(Y,{label:`Nodes`,value:`${I.nodes.filter(e=>e.connected).length} / ${I.nodes.length}`}),I.uptime>0&&(0,Q.jsx)(Y,{label:`Uptime`,value:ye(I.uptime)}),I.portRange&&(0,Q.jsx)(Y,{label:`Port Range`,value:`${I.portRange.start}–${I.portRange.end}`,mono:!0}),I.type===`local`?I.startedAt&&(0,Q.jsx)(Y,{label:`Started`,value:new Date(I.startedAt).toLocaleString()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{label:`Started`,value:I.startedAt?`${new Date(I.startedAt).toLocaleString()}, as its nodes report`:`unknown — no node reported an app of it running`}),I.attachedAt&&(0,Q.jsx)(Y,{label:`Attached`,value:`${new Date(I.attachedAt).toLocaleString()} — by this master`})]})]})}),(0,Q.jsx)(qe,{stack:I}),I.type!==`local`&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,gap:.5,mb:1},children:[(0,Q.jsx)(fe,{sx:{fontSize:16}}),(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`Sync Status`})]}),I.nodes.map(e=>(0,Q.jsx)(Ke,{node:e},e.host)),I.nodes.length===0&&(0,Q.jsx)(w,{variant:`caption`,sx:{color:`text.disabled`},children:`No nodes configured`})]})}),I.nodes.length>0&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`,mb:1,display:`block`},children:[`Nodes (`,I.nodes.length,`)`]}),(0,Q.jsx)(B,{scrollLabel:`Stack nodes`,sx:{minWidth:560},columns:Ce,data:I.nodes,rowKey:e=>e.host,dense:!0,containerSx:{border:`none`,borderRadius:0}})]})}),(0,Q.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(we,{open:A,onClose:()=>N(!1),project:n??``,release:null,...e?{stack:e}:{}})}),(0,Q.jsxs)(re,{open:le,onClose:()=>F(!1),children:[(0,Q.jsx)(x,{children:`Start from the working tree?`}),(0,Q.jsx)(ne,{children:(0,Q.jsxs)(ie,{children:[I.name,` will start from its registered project directory. Future restarts will use that directory until you select a release.`]})}),(0,Q.jsxs)(b,{children:[(0,Q.jsx)(c,{onClick:()=>F(!1),children:`Cancel`}),(0,Q.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(c,{variant:`contained`,disabled:!G||K||U,onClick:()=>{F(!1),n&&e&&f(n,e,{workingTree:!0})},children:`Start from working tree`})})]})]}),(0,Q.jsxs)(re,{open:C,onClose:()=>T(!1),children:[(0,Q.jsx)(x,{children:`Delete Stack`}),(0,Q.jsx)(ne,{children:(0,Q.jsxs)(ie,{children:[`Are you sure you want to delete stack `,(0,Q.jsx)(`strong`,{children:I.name}),`? This action cannot be undone. All infrastructure configuration for this stack will be removed.`]})}),(0,Q.jsxs)(b,{children:[(0,Q.jsx)(c,{onClick:()=>T(!1),children:`Cancel`}),(0,Q.jsx)(M,{permission:`OmnitronProject.deleteStack`,children:(0,Q.jsx)(c,{onClick:xe,color:`error`,variant:`contained`,children:`Delete`})})]})]})]})}function Y({label:e,value:t,mono:n}){return(0,Q.jsxs)(p,{sx:{display:`flex`,justifyContent:`space-between`,py:.5},children:[(0,Q.jsx)(w,{variant:`body2`,sx:{color:`text.secondary`},children:e}),(0,Q.jsx)(w,{variant:`body2`,sx:{fontWeight:600,...n&&{fontFamily:`monospace`,fontSize:`0.8rem`}},children:t})]})}function Ge(e){let t=e.map(e=>e.syncStatus?H(e.syncStatus):null),n=t.filter(e=>e?.state===`behind`).length,r=t.filter(e=>e?.state===`catching-up`).length,i=t.filter(e=>e?.state===`unknown`).length,a=t.filter(e=>e===null).length;return n+r+i+a===0?`replication in sync`:[n>0&&`${n} of ${e.length} behind`,r>0&&`${r} catching up`,i>0&&`${i} queue age unavailable`,a>0&&`${a} not reporting`].filter(Boolean).join(`, `)}function Ke({node:e}){let t=e.syncStatus,n=t?H(t):null;return(0,Q.jsxs)(p,{sx:{py:.75},children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,Q.jsx)(p,{sx:{width:8,height:8,borderRadius:`50%`,bgcolor:e.connected?`success.main`:`warning.main`}}),(0,Q.jsxs)(p,{children:[(0,Q.jsxs)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.8rem`,fontWeight:600},children:[e.host,`:`,e.port]}),(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`,fontSize:`0.6rem`},children:[e.daemonRole,e.label?` — ${e.label}`:``]})]})]}),t&&n?(0,Q.jsxs)(p,{sx:{textAlign:`right`},children:[(0,Q.jsx)(m,{label:Ce(n),size:`small`,color:W(n),variant:`outlined`,sx:{height:20,fontSize:`0.6rem`,fontWeight:600}}),t.lastSyncAt&&(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.disabled`,display:`block`,fontSize:`0.5rem`,mt:.25},children:[`last sync `,new Date(t.lastSyncAt).toLocaleTimeString()]})]}):(0,Q.jsx)(m,{label:e.connected?`Inventory observed`:`Inventory unavailable`,size:`small`,color:e.connected?`success`:`warning`,variant:`outlined`,sx:{height:20,fontSize:`0.6rem`}})]}),t?.lastError&&(0,Q.jsx)(w,{variant:`caption`,sx:{color:`error.main`,fontSize:`0.55rem`,mt:.25,display:`block`,ml:2.5},children:t.lastError})]})}function qe({stack:e}){let t=e.config?.infrastructure,n=e.infrastructure?.services??{},r=t&&Object.keys(t).length>0,i=Object.keys(n).length>0;if(!r&&!i)return null;let a=t?.postgres,o=t?.redis,c=t?.minio;return(0,Q.jsxs)(Q.Fragment,{children:[a&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,mb:1},children:[(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`PostgreSQL`}),(0,Q.jsx)(X,{name:`postgres`,runtime:n})]}),(0,Q.jsx)(Y,{label:`Port`,value:String(a.port??5432),mono:!0}),a.databases&&Object.keys(a.databases).length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`,mt:1,display:`block`},children:[`Databases (`,Object.keys(a.databases).length,`)`]}),Object.entries(a.databases).map(([e,t])=>(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,py:.25,pl:1},children:[(0,Q.jsx)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:e}),t?.migrate&&(0,Q.jsx)(m,{label:`migrate`,size:`small`,sx:{height:16,fontSize:`0.55rem`}})]},e))]})]})}),o&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,mb:1},children:[(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`Redis`}),(0,Q.jsx)(X,{name:`redis`,runtime:n})]}),(0,Q.jsx)(Y,{label:`Port`,value:String(o.port??6379),mono:!0}),o.databases&&Object.keys(o.databases).length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`,mt:1,display:`block`},children:[`DB Allocations (`,Object.keys(o.databases).length,`)`]}),Object.entries(o.databases).map(([e,t])=>{let n=e.includes(`:`);return(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,py:.25,pl:1},children:[(0,Q.jsx)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:n?e.split(`:`)[1]:e}),(0,Q.jsxs)(p,{sx:{display:`flex`,gap:.5,alignItems:`center`},children:[n&&(0,Q.jsx)(m,{label:e.split(`:`)[0],size:`small`,variant:`outlined`,sx:{height:16,fontSize:`0.5rem`}}),(0,Q.jsxs)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.75rem`,color:`text.secondary`,minWidth:28,textAlign:`right`},children:[`DB `,t]})]})]},e)})]})]})}),c&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,mb:1},children:[(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`MinIO / S3`}),(0,Q.jsx)(X,{name:`minio`,runtime:n})]}),c.ports&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{label:`API Port`,value:String(c.ports.api??9e3),mono:!0}),(0,Q.jsx)(Y,{label:`Console Port`,value:String(c.ports.console??9001),mono:!0})]}),c.buckets&&c.buckets.length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`,mt:1,display:`block`},children:[`Buckets (`,c.buckets.length,`)`]}),c.buckets.map(e=>(0,Q.jsx)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.8rem`,pl:1,py:.25},children:e},e))]})]})})]})}function X({name:e,runtime:t}){let n=t[e];return n?(0,Q.jsxs)(O,{spacing:.5,sx:{alignItems:`flex-end`,minWidth:0,maxWidth:320},children:[(0,Q.jsx)(m,{label:n.provisioning===`pending`?`Setup pending`:n.status,size:`small`,color:n.status===`error`?`error`:n.provisioning===`pending`?`warning`:n.status===`running`?`success`:`default`}),n.error&&(0,Q.jsx)(w,{variant:`caption`,color:`error.main`,sx:{overflowWrap:`anywhere`},children:n.error})]}):(0,Q.jsx)(m,{label:`Stopped`,size:`small`,sx:{height:18,fontSize:`0.6rem`}})}var Z,Q,$;function Je(){return(Je=e((()=>{xe(),Fe(),je(),Oe(),Le(),Ae(),N(),Z=t(),o(),l(),k(),d(),ee(),C(),f(),u(),h(),E(),_(),te(),g(),S(),y(),A(),V(),Ve(),z(),I(),F(),G(),R(),Ue(),le(),U(),Q=n(),$={running:`#22c55e`,starting:`#eab308`,stopping:`#eab308`,degraded:`#f97316`,error:`#ef4444`,stopped:`#6b7280`}})))()}Je();export{We as default};
1
+ import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{H as r,P as i,V as a,z as o}from"./client-CgyTwq9g.js";import{D as s,F as c,H as l,I as u,M as d,O as ee,Q as f,V as p,Z as m,c as te,ct as h,d as ne,f as g,g as _,h as re,j as v,l as ie,m as y,p as b,s as x,st as ae,u as S}from"./mui-SNRRJ_vi.js";import{B as C,z as w}from"./mui-B3fJdIMc.js";import{E as T,T as oe,it as E,rt as D}from"./mui-CMWGTMXv.js";import{_ as O,v as k}from"./mui-CPEkFAPo.js";import{n as se,r as A,t as j}from"./alert-BdJ2uaY0.js";import{n as M,s as N}from"./access-I0f72P9m.js";import{r as ce,t as le}from"./use-polled-resource-B22hhr5L.js";import{i as P,n as ue,r as de,t as F}from"./project.store-D5IR3fo9.js";import{B as fe,G as I,M as pe,k as me,m as L,p as he,z as ge}from"./icons-B9Ct8PJ9.js";import{n as R,t as _e}from"./operation-status-DHyYOT7G.js";import{n as z,t as B}from"./table-D-so_B1p.js";import{n as V,t as ve}from"./page-breadcrumbs-3R8RZ3nA.js";import{s as ye}from"./formatters-RnRy4bXm.js";import{n as be,r as xe,t as Se}from"./stack-health-status-DfErRNb1.js";import{a as H,c as Ce,r as U,s as W}from"./sync-reading-CN0jPKAg.js";import{n as G,t as we}from"./deploy-release-dialog-CnzaO_xL.js";import{n as Te,t as K}from"./release-deployment-state-BfmxZP4Y.js";import{a as Ee,c as De,i as Oe,l as ke,n as Ae,o as je,r as Me,s as Ne,t as Pe,u as Fe}from"./stack-start-notice-NkYDjR-f.js";function Ie({operation:e}){if(!e||e.supersededAt)return null;let t=e.phase===`failed`,n=e.phase===`stopped`,r=e.nodes.filter(e=>e.outcome===`stopped`).length;if(n&&!e.nodes.length)return null;let i=e.nodes.map(e=>(0,q.jsxs)(p,{sx:{display:`flex`,flexWrap:`wrap`,columnGap:1.5,mt:.75},children:[(0,q.jsx)(w,{variant:`body2`,sx:{fontFamily:`monospace`,overflowWrap:`anywhere`},children:e.node}),(0,q.jsx)(w,{variant:`body2`,children:e.outcome===`unknown`?`Awaiting confirmation`:e.outcome}),e.authority&&(0,q.jsxs)(w,{variant:`caption`,sx:{overflowWrap:`anywhere`},children:[e.authority.clusterId,` · epoch `,e.authority.epoch,` · `,e.authority.nodeId]}),e.reason&&(0,q.jsx)(w,{variant:`caption`,sx:{width:`100%`,overflowWrap:`anywhere`},children:e.reason})]},e.node));return n?(0,q.jsxs)(p,{component:`details`,sx:{mb:2,minWidth:0,typography:`body2`,"& summary":{cursor:`pointer`}},children:[(0,q.jsxs)(`summary`,{children:[`Stop confirmed · `,r,`/`,e.nodes.length,` nodes`]}),i]}):(0,q.jsx)(j,{severity:t?`error`:`info`,sx:{mb:2,minWidth:0},children:(0,q.jsxs)(p,{role:`status`,"aria-live":`polite`,sx:{minWidth:0},children:[(0,q.jsxs)(w,{variant:`subtitle2`,children:[t?e.intentCommitted?`Stop not confirmed`:`Stop declined before execution`:e.phase===`preparing`?`Checking stop ownership`:`Stopping stack`,e.nodes.length>0&&` · ${r}/${e.nodes.length} nodes confirmed`]}),!t&&(0,q.jsx)(oe,{"aria-label":`Stack stop in progress`,sx:{mt:1,mb:1.5}}),e.error&&(0,q.jsx)(w,{variant:`body2`,sx:{overflowWrap:`anywhere`},children:e.error}),i]})})}var q;function Le(){return(Le=e((()=>{l(),C(),T(),A(),q=n()})))()}function Re({children:e,gap:t=Be,fill:n,sx:r,ref:i,...a}){return(0,ze.jsx)(O,{ref:i,spacing:t,sx:{...n&&{flex:1},...r},...a,children:e})}var ze,Be;function Ve(){return(Ve=e((()=>{t(),k(),ze=n(),Be=3})))()}function He({project:e,stack:t,requiresRelease:n,managed:r,selected:i,onDeploy:a,onWorkingTree:o}){return(0,J.jsxs)(p,{sx:{mb:2,minWidth:0},children:[!r&&(0,J.jsxs)(O,{direction:`row`,useFlexGap:!0,spacing:1,sx:{alignItems:`center`,flexWrap:`wrap`,mb:1},children:[i&&(0,J.jsx)(m,{label:`Selected: `+i,size:`small`,variant:`outlined`}),n&&(0,J.jsx)(m,{label:`Release required`,size:`small`,variant:`outlined`}),(0,J.jsx)(p,{sx:{flex:1}}),o&&(0,J.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,J.jsx)(c,{size:`small`,onClick:o,children:`Use working tree…`})}),(0,J.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,J.jsx)(c,{size:`small`,startIcon:(0,J.jsx)(L,{}),onClick:a,children:`Deploy release…`})})]}),(0,J.jsx)(K,{project:e,stack:t},`${e}/${t}`)]})}var J;function Ue(){return(Ue=e((()=>{l(),u(),f(),k(),N(),I(),Te(),J=n()})))()}function We(){let{name:e}=r(),t=a(),n=ue(),o=de(),l=P(e=>!!(n&&e.stacksByProject[n])),u=P(e=>n?e.stackReadErrors[n]:null),d=P(e=>e.fetchStacks),ee=P(e=>e.resumeInstalledStack),f=P(e=>e.startStack),te=P(e=>e.stopStack),h=P(e=>e.deleteStack),g=`${n}/${e}`,_=P(e=>e.stackNotices[g]),y=P(e=>e.clearStackNotice),S=P(e=>e.pendingOps),[C,T]=(0,Z.useState)(!1),[oe,E]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(!1),[A,N]=(0,Z.useState)(!1),[le,F]=(0,Z.useState)(!1),I=o.find(t=>t.name===e),R=n&&e?S[`${n}/${e}`]??null:null,z=Object.keys(S).length>0;ce(()=>void(n&&d(n)),{intervalMs:z?3e3:1e4,enabled:!!n,resourceKey:n});let V=(0,Z.useCallback)(async()=>{n&&e&&await f(n,e)},[n,e,f]),xe=(0,Z.useCallback)(async()=>{if(n&&e){try{await h(n,e),t(`/stacks`)}catch{}T(!1)}},[n,e,h,t]);if(!I&&n&&u)return(0,Q.jsxs)(j,{severity:`error`,children:[`Stack inventory unavailable · `,u,` `,(0,Q.jsx)(c,{onClick:()=>void d(n),children:`Retry`})]});if(!I&&n&&!l)return(0,Q.jsx)(_e,{active:!0,label:`Reading stack inventory`});if(!I)return(0,Q.jsx)(Re,{children:(0,Q.jsxs)(j,{severity:`warning`,children:[`Stack "`,e,`" not found.`,` `,(0,Q.jsx)(c,{size:`small`,onClick:()=>t(`/stacks`),children:`Back to Stacks`})]})});let H=[{id:`name`,label:`App`,render:e=>(0,Q.jsx)(p,{sx:{fontWeight:600},children:e.name})},{id:`status`,label:`Process`,render:e=>(0,Q.jsx)(m,{label:e.status,size:`small`,color:e.status===`online`?`success`:e.status===`crashed`||e.status===`errored`?`error`:`default`,sx:{height:18,fontSize:`0.6rem`}})},{id:`health`,label:`Health`,render:e=>(0,Q.jsx)(Se,{status:e.health})},{id:`pid`,label:`PID`,render:e=>(0,Q.jsx)(p,{sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:e.pid??`—`})},{id:`instances`,label:`Instances`,render:e=>e.instances},{id:`uptime`,label:`Uptime`,render:e=>(0,Q.jsx)(p,{sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:e.uptime>0?ye(e.uptime):`—`})}],Ce=[{id:`host`,label:`Host`,render:e=>(0,Q.jsxs)(p,{sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:[e.host,`:`,e.port,e.label&&(0,Q.jsxs)(w,{component:`span`,variant:`caption`,sx:{ml:1,color:`text.secondary`},children:[`(`,e.label,`)`]})]})},{id:`role`,label:`Role`,render:e=>(0,Q.jsx)(m,{label:e.role,size:`small`,sx:{height:18,fontSize:`0.6rem`}})},{id:`daemonRole`,label:`Daemon`,render:e=>(0,Q.jsx)(m,{label:e.daemonRole,size:`small`,color:e.daemonRole===`master`?`primary`:`default`,sx:{height:18,fontSize:`0.6rem`}})},{id:`connected`,label:`Status`,render:e=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(p,{component:`span`,sx:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,bgcolor:e.connected?`success.main`:`warning.main`,mr:.5}}),e.connected?`Inventory observed`:`Inventory unavailable`]})},{id:`lastSeen`,label:`Last Seen`,render:e=>(0,Q.jsx)(p,{sx:{fontFamily:`monospace`,fontSize:`0.75rem`},children:e.lastSeen?new Date(e.lastSeen).toLocaleTimeString():`—`})}],U=I.config?.release?.mode===`required`,W=[`running`,`degraded`,`error`,`unknown`,`stopping`].includes(I.status),G=I.status===`stopped`,Te=I.status===`starting`||I.status===`stopping`||!!R,K=!!R;return(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(ve,{linkComponent:i,links:[{name:`Stacks`,href:`/stacks`},{name:I.name}],action:(0,Q.jsxs)(p,{sx:{display:`flex`,gap:1,alignItems:`center`,flexWrap:`wrap`},children:[G&&!K&&(0,Q.jsx)(M,{permission:`OmnitronProject.deleteStack`,children:(0,Q.jsx)(D,{size:`small`,color:`error`,onClick:()=>T(!0),title:`Delete stack`,"aria-label":`Delete stack ${I.name}`,sx:{marginInlineEnd:1},children:(0,Q.jsx)(he,{})})}),(0,Q.jsx)(m,{label:I.status.charAt(0).toUpperCase()+I.status.slice(1),size:`small`,sx:{bgcolor:$[I.status]??$.stopped,color:`white`,fontWeight:600}}),(0,Q.jsx)(M,{permission:`OmnitronProject.diagnoseStack`,children:(0,Q.jsx)(c,{size:`small`,onClick:()=>k(!0),children:`Diagnose`})}),(0,Q.jsx)(D,{size:`small`,"aria-label":`Refresh stack`,title:`Refresh stack`,onClick:()=>n&&d(n),children:(0,Q.jsx)(pe,{})}),Te?(0,Q.jsx)(c,{variant:`outlined`,size:`small`,disabled:!0,startIcon:(0,Q.jsx)(ae,{size:14}),children:R===`resuming`?`Resuming installed apps…`:R===`starting`||I.status===`starting`?`Starting…`:`Stopping…`}):n&&e&&ke(I)?(0,Q.jsx)(Ne,{stack:I,onResume:()=>void ee(n,e),onReviewStop:()=>E(!0)}):G?U&&!I.selectedRelease?(0,Q.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(c,{startIcon:(0,Q.jsx)(L,{}),color:`success`,variant:`contained`,size:`small`,onClick:()=>N(!0),children:`Deploy release…`})}):(0,Q.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(c,{startIcon:(0,Q.jsx)(me,{}),color:`success`,variant:`contained`,size:`small`,onClick:V,children:`Start`})}):W?(0,Q.jsx)(M,{permission:`OmnitronProject.reviewStackStop`,children:(0,Q.jsx)(c,{startIcon:(0,Q.jsx)(ge,{}),color:`error`,variant:`outlined`,size:`small`,onClick:()=>E(!0),children:I.stopOperation?.phase===`failed`&&!I.stopOperation.supersededAt?`Review retry…`:`Review stop…`})}):null]})}),oe&&n&&e&&(0,Q.jsx)(Ee,{project:n,stack:e,onClose:()=>E(!1),onConfirm:(t,r)=>{E(!1),te(n,e,t,r)}},`${n}/${e}`),O&&n&&e&&(0,Q.jsx)(Me,{project:n,stack:e,onClose:()=>k(!1)},`${n}/${e}`),(0,Q.jsx)(Ie,{operation:I.stopOperation}),(0,Q.jsx)(De,{stack:I}),(0,Q.jsx)(Pe,{stack:I}),(0,Q.jsx)(be,{stack:I}),u&&(0,Q.jsxs)(j,{severity:`warning`,children:[`Showing the last stack inventory · `,u]}),_&&_!==u&&(0,Q.jsx)(se,{sx:{mb:2},onClose:()=>y(g),children:_}),n&&e&&(0,Q.jsx)(He,{project:n,stack:e,requiresRelease:!!U,managed:!!I.config.managedOrigin,selected:I.selectedRelease?.id,onWorkingTree:I.selectedRelease&&G&&!K&&!U?()=>F(!0):void 0,onDeploy:()=>N(!0)}),I.type!==`local`&&W&&(0,Q.jsx)(v,{variant:`outlined`,sx:{mb:2,p:2},children:(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,gap:2},children:[(0,Q.jsx)(L,{sx:{fontSize:20,color:`primary.main`}}),(0,Q.jsxs)(p,{sx:{flex:1},children:[(0,Q.jsxs)(w,{variant:`body2`,sx:{fontWeight:600},children:[I.nodes.filter(e=>e.connected).length,`/`,I.nodes.length,` node inventories observed`]}),(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`},children:[I.type===`remote`?`SSH`:`Cluster`,` deployment — `,Ge(I.nodes)]})]}),I.nodes.some(e=>!e.connected)&&(0,Q.jsx)(m,{label:`${I.nodes.filter(e=>!e.connected).length} unobserved`,size:`small`,color:`warning`,sx:{height:22,fontSize:`0.65rem`}})]})}),(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`,mb:1,display:`block`},children:[`Applications (`,I.apps.length,`)`]}),(0,Q.jsx)(B,{scrollLabel:`Stack applications`,sx:{minWidth:640},columns:H,data:I.apps,rowKey:e=>e.handleKey,dense:!0,containerSx:{border:`none`,borderRadius:0},emptyContent:(0,Q.jsx)(w,{variant:`caption`,sx:{color:`text.disabled`},children:`No apps configured`})})]})}),(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`Overview`}),(0,Q.jsx)(Y,{label:`Type`,value:I.type===`local`?`Local`:I.type===`remote`?`Remote (SSH)`:`Cluster`}),(0,Q.jsx)(Y,{label:`Apps`,value:`${I.apps.filter(e=>e.status===`online`).length} / ${I.apps.length}`}),(0,Q.jsx)(Y,{label:`Nodes`,value:`${I.nodes.filter(e=>e.connected).length} / ${I.nodes.length}`}),I.uptime>0&&(0,Q.jsx)(Y,{label:`Uptime`,value:ye(I.uptime)}),I.portRange&&(0,Q.jsx)(Y,{label:`Port Range`,value:`${I.portRange.start}–${I.portRange.end}`,mono:!0}),I.type===`local`?I.startedAt&&(0,Q.jsx)(Y,{label:`Started`,value:new Date(I.startedAt).toLocaleString()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{label:`Started`,value:I.startedAt?`${new Date(I.startedAt).toLocaleString()}, as its nodes report`:`unknown — no node reported an app of it running`}),I.attachedAt&&(0,Q.jsx)(Y,{label:`Attached`,value:`${new Date(I.attachedAt).toLocaleString()} — by this master`})]})]})}),(0,Q.jsx)(qe,{stack:I}),I.type!==`local`&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,gap:.5,mb:1},children:[(0,Q.jsx)(fe,{sx:{fontSize:16}}),(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`Sync Status`})]}),I.nodes.map(e=>(0,Q.jsx)(Ke,{node:e},e.host)),I.nodes.length===0&&(0,Q.jsx)(w,{variant:`caption`,sx:{color:`text.disabled`},children:`No nodes configured`})]})}),I.nodes.length>0&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`,mb:1,display:`block`},children:[`Nodes (`,I.nodes.length,`)`]}),(0,Q.jsx)(B,{scrollLabel:`Stack nodes`,sx:{minWidth:560},columns:Ce,data:I.nodes,rowKey:e=>e.host,dense:!0,containerSx:{border:`none`,borderRadius:0}})]})}),(0,Q.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(we,{open:A,onClose:()=>N(!1),project:n??``,release:null,...e?{stack:e}:{}})}),(0,Q.jsxs)(re,{open:le,onClose:()=>F(!1),children:[(0,Q.jsx)(x,{children:`Start from the working tree?`}),(0,Q.jsx)(ne,{children:(0,Q.jsxs)(ie,{children:[I.name,` will start from its registered project directory. Future restarts will use that directory until you select a release.`]})}),(0,Q.jsxs)(b,{children:[(0,Q.jsx)(c,{onClick:()=>F(!1),children:`Cancel`}),(0,Q.jsx)(M,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(c,{variant:`contained`,disabled:!G||K||U,onClick:()=>{F(!1),n&&e&&f(n,e,{workingTree:!0})},children:`Start from working tree`})})]})]}),(0,Q.jsxs)(re,{open:C,onClose:()=>T(!1),children:[(0,Q.jsx)(x,{children:`Delete Stack`}),(0,Q.jsx)(ne,{children:(0,Q.jsxs)(ie,{children:[`Are you sure you want to delete stack `,(0,Q.jsx)(`strong`,{children:I.name}),`? This action cannot be undone. All infrastructure configuration for this stack will be removed.`]})}),(0,Q.jsxs)(b,{children:[(0,Q.jsx)(c,{onClick:()=>T(!1),children:`Cancel`}),(0,Q.jsx)(M,{permission:`OmnitronProject.deleteStack`,children:(0,Q.jsx)(c,{onClick:xe,color:`error`,variant:`contained`,children:`Delete`})})]})]})]})}function Y({label:e,value:t,mono:n}){return(0,Q.jsxs)(p,{sx:{display:`flex`,justifyContent:`space-between`,py:.5},children:[(0,Q.jsx)(w,{variant:`body2`,sx:{color:`text.secondary`},children:e}),(0,Q.jsx)(w,{variant:`body2`,sx:{fontWeight:600,...n&&{fontFamily:`monospace`,fontSize:`0.8rem`}},children:t})]})}function Ge(e){let t=e.map(e=>e.syncStatus?H(e.syncStatus):null),n=t.filter(e=>e?.state===`behind`).length,r=t.filter(e=>e?.state===`catching-up`).length,i=t.filter(e=>e?.state===`unknown`).length,a=t.filter(e=>e===null).length;return n+r+i+a===0?`replication in sync`:[n>0&&`${n} of ${e.length} behind`,r>0&&`${r} catching up`,i>0&&`${i} queue age unavailable`,a>0&&`${a} not reporting`].filter(Boolean).join(`, `)}function Ke({node:e}){let t=e.syncStatus,n=t?H(t):null;return(0,Q.jsxs)(p,{sx:{py:.75},children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,Q.jsx)(p,{sx:{width:8,height:8,borderRadius:`50%`,bgcolor:e.connected?`success.main`:`warning.main`}}),(0,Q.jsxs)(p,{children:[(0,Q.jsxs)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.8rem`,fontWeight:600},children:[e.host,`:`,e.port]}),(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`,fontSize:`0.6rem`},children:[e.daemonRole,e.label?` — ${e.label}`:``]})]})]}),t&&n?(0,Q.jsxs)(p,{sx:{textAlign:`right`},children:[(0,Q.jsx)(m,{label:Ce(n),size:`small`,color:W(n),variant:`outlined`,sx:{height:20,fontSize:`0.6rem`,fontWeight:600}}),t.lastSyncAt&&(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.disabled`,display:`block`,fontSize:`0.5rem`,mt:.25},children:[`last sync `,new Date(t.lastSyncAt).toLocaleTimeString()]})]}):(0,Q.jsx)(m,{label:e.connected?`Inventory observed`:`Inventory unavailable`,size:`small`,color:e.connected?`success`:`warning`,variant:`outlined`,sx:{height:20,fontSize:`0.6rem`}})]}),t?.lastError&&(0,Q.jsx)(w,{variant:`caption`,sx:{color:`error.main`,fontSize:`0.55rem`,mt:.25,display:`block`,ml:2.5},children:t.lastError})]})}function qe({stack:e}){let t=e.config?.infrastructure,n=e.infrastructure?.services??{},r=t&&Object.keys(t).length>0,i=Object.keys(n).length>0;if(!r&&!i)return null;let a=t?.postgres,o=t?.redis,c=t?.minio;return(0,Q.jsxs)(Q.Fragment,{children:[a&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,mb:1},children:[(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`PostgreSQL`}),(0,Q.jsx)(X,{name:`postgres`,runtime:n})]}),(0,Q.jsx)(Y,{label:`Port`,value:String(a.port??5432),mono:!0}),a.databases&&Object.keys(a.databases).length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`,mt:1,display:`block`},children:[`Databases (`,Object.keys(a.databases).length,`)`]}),Object.entries(a.databases).map(([e,t])=>(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,py:.25,pl:1},children:[(0,Q.jsx)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:e}),t?.migrate&&(0,Q.jsx)(m,{label:`migrate`,size:`small`,sx:{height:16,fontSize:`0.55rem`}})]},e))]})]})}),o&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,mb:1},children:[(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`Redis`}),(0,Q.jsx)(X,{name:`redis`,runtime:n})]}),(0,Q.jsx)(Y,{label:`Port`,value:String(o.port??6379),mono:!0}),o.databases&&Object.keys(o.databases).length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`,mt:1,display:`block`},children:[`DB Allocations (`,Object.keys(o.databases).length,`)`]}),Object.entries(o.databases).map(([e,t])=>{let n=e.includes(`:`);return(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,py:.25,pl:1},children:[(0,Q.jsx)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.8rem`},children:n?e.split(`:`)[1]:e}),(0,Q.jsxs)(p,{sx:{display:`flex`,gap:.5,alignItems:`center`},children:[n&&(0,Q.jsx)(m,{label:e.split(`:`)[0],size:`small`,variant:`outlined`,sx:{height:16,fontSize:`0.5rem`}}),(0,Q.jsxs)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.75rem`,color:`text.secondary`,minWidth:28,textAlign:`right`},children:[`DB `,t]})]})]},e)})]})]})}),c&&(0,Q.jsx)(v,{variant:`outlined`,children:(0,Q.jsxs)(s,{children:[(0,Q.jsxs)(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,mb:1},children:[(0,Q.jsx)(w,{variant:`overline`,sx:{color:`text.secondary`,fontSize:`0.65rem`},children:`MinIO / S3`}),(0,Q.jsx)(X,{name:`minio`,runtime:n})]}),c.ports&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{label:`API Port`,value:String(c.ports.api??9e3),mono:!0}),(0,Q.jsx)(Y,{label:`Console Port`,value:String(c.ports.console??9001),mono:!0})]}),c.buckets&&c.buckets.length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(w,{variant:`caption`,sx:{color:`text.secondary`,mt:1,display:`block`},children:[`Buckets (`,c.buckets.length,`)`]}),c.buckets.map(e=>(0,Q.jsx)(w,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:`0.8rem`,pl:1,py:.25},children:e},e))]})]})})]})}function X({name:e,runtime:t}){let n=t[e];return n?(0,Q.jsxs)(O,{spacing:.5,sx:{alignItems:`flex-end`,minWidth:0,maxWidth:320},children:[(0,Q.jsx)(m,{label:n.provisioning===`pending`?`Setup pending`:n.status,size:`small`,color:n.status===`error`?`error`:n.provisioning===`pending`?`warning`:n.status===`running`?`success`:`default`}),n.error&&(0,Q.jsx)(w,{variant:`caption`,color:`error.main`,sx:{overflowWrap:`anywhere`},children:n.error})]}):(0,Q.jsx)(m,{label:`Stopped`,size:`small`,sx:{height:18,fontSize:`0.6rem`}})}var Z,Q,$;function Je(){return(Je=e((()=>{xe(),Fe(),je(),Oe(),Le(),Ae(),N(),Z=t(),o(),l(),k(),d(),ee(),C(),f(),u(),h(),E(),_(),te(),g(),S(),y(),A(),V(),Ve(),z(),I(),F(),G(),R(),Ue(),le(),U(),Q=n(),$={running:`#22c55e`,starting:`#eab308`,stopping:`#eab308`,degraded:`#f97316`,error:`#ef4444`,stopped:`#6b7280`}})))()}Je();export{We as default};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{H as r,O as i,S as a,h as o,l as s,z as c}from"./client-CgyTwq9g.js";import{Vt as l,Yt as u}from"./mui-BTN91yBK.js";import{D as d,F as f,H as p,I as m,M as h,O as g,Q as _,V as v,Z as y,at as b,ct as x,i as S,j as C,ot as w,r as T,st as E}from"./mui-SNRRJ_vi.js";import{A as D,B as O,C as k,D as A,F as j,I as M,O as ee,S as te,a as ne,b as re,d as N,f as ie,k as ae,o as oe,w as se,x as ce,y as le,z as P}from"./mui-B3fJdIMc.js";import{B as ue,it as de,l as fe,rt as pe,u as me,z as F}from"./mui-CMWGTMXv.js";import{_ as I,v as L}from"./mui-CPEkFAPo.js";import{r as he,t as R}from"./alert-BdJ2uaY0.js";import{c as z,l as ge,n as B,s as V,u as _e}from"./access-I0f72P9m.js";import{n as ve,t as ye}from"./use-polled-resource-B22hhr5L.js";import{b as H,i as U,m as W,p as be,t as xe,x as Se}from"./project.store-D5IR3fo9.js";import{G as Ce,M as we,m as Te}from"./icons-B9Ct8PJ9.js";import{n as Ee,t as De}from"./operation-status-DHyYOT7G.js";import{n as Oe,t as ke}from"./page-breadcrumbs-3R8RZ3nA.js";import{i as Ae,r as je}from"./deploy-progress-B39cvvCE.js";import{c as Me,d as Ne,f as Pe,i as G,o as Fe,p as Ie,s as K,u as Le}from"./release-bits-IehuBssK.js";import{n as Re,t as ze}from"./deploy-release-dialog-CnzaO_xL.js";import{n as Be,t as Ve}from"./release-build-panel-C48hP_9w.js";import{n as He,t as Ue}from"./release-deployment-state-BfmxZP4Y.js";function We(e,t){return s.invoke(`daemon`,`OmnitronRelease`,`attestOnNode`,[{release:e,stack:t}],{timeout:6e5})}function Ge({output:e}){let[t,n]=(0,q.useState)(!1);return(0,J.jsxs)(v,{sx:{pl:2,mb:.5},children:[(0,J.jsx)(f,{size:`small`,onClick:()=>n(e=>!e),sx:{minWidth:0,p:0,fontSize:11,textTransform:`none`},children:t?`hide what it printed`:`what it printed`}),t&&(0,J.jsx)(v,{component:`pre`,sx:{m:0,mt:.5,p:1,maxHeight:240,overflow:`auto`,borderRadius:1,bgcolor:`action.hover`,fontFamily:`monospace`,fontSize:11,whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:e})]})}function Ke({attestation:e}){let t=e.cleanup;if(!t&&!e.legalTextsUnread)return null;let n=Object.entries(t?.removed??{}).filter(([,e])=>e>0).map(([e,t])=>`${t} ${e}`),r=Object.entries(t?.retired??{}).filter(([,e])=>e>0).map(([e,t])=>`${t} ${e}`);return(0,J.jsxs)(v,{sx:{mt:.75,pl:1},"data-testid":`cleanup-${e.stack}`,children:[t&&(0,J.jsx)(P,{variant:`caption`,sx:{display:`block`,color:t.failed||t.run===null?`warning.main`:`text.secondary`},children:t.run===null?`cleanup not run — ${t.notRun??`the run had no name to remove by`}`:`cleanup: run ${t.run} removed ${n.length?n.join(`, `):`nothing — it had made nothing to remove`}`+(t.failed?` — FAILED: ${t.failed}`:``)}),r.length>0&&(0,J.jsxs)(P,{variant:`caption`,sx:{display:`block`,color:`text.secondary`},children:[`retired: `,r.join(`, `),` — blocked in place, their real-chain addresses still watched`]}),(t?.leftBehind??[]).map(e=>(0,J.jsxs)(P,{variant:`caption`,sx:{display:`block`,color:`warning.main`},children:[`left behind: `,e.what,` — `,e.why.join(`; `)||`no reason given`]},e.what)),e.legalTextsUnread&&(0,J.jsxs)(P,{variant:`caption`,sx:{display:`block`,color:`warning.main`},children:[`legal texts could not be read — `,e.legalTextsUnread]})]})}function qe({releaseId:e,project:t,attestations:n,onChanged:r}){let{can:a}=z(),o=a(`OmnitronRelease.attestOnNode`),s=a(`OmnitronProject.listStacks`),c=U(e=>e.stacksByProject),l=U(e=>e.fetchStacks),u=(0,q.useMemo)(()=>(c[t]??[]).filter(e=>e.type!==`local`),[c,t]),[p,m]=(0,q.useState)(``),[h,g]=(0,q.useState)(!1),[_,x]=(0,q.useState)(null),[S,w]=(0,q.useState)(null),[T,D]=(0,q.useState)(null),[O,k]=(0,q.useState)(!1);(0,q.useEffect)(()=>{o&&s&&!c[t]&&l(t)},[o,s,t,c,l]),(0,q.useEffect)(()=>{!p&&u.length>0&&m(u[0].name)},[u,p]);let A=!!(T&&n.some(e=>e.stack===T.stack&&e.storedAt!==T.previous));(0,q.useEffect)(()=>{if(!T)return;if(A){D(null);return}let e=setInterval(r,5e3),t=setTimeout(()=>{k(!0),D(null)},6e5);return()=>{clearInterval(e),clearTimeout(t)}},[T,A,r]);let M=(0,q.useCallback)(async()=>{if(!p)return;let t=n.find(e=>e.stack===p)?.storedAt;k(!1),g(!0),w(null),x(null);try{x(await We(e,p)),r()}catch(e){let n=e.message;i(e)?D({stack:p,previous:t}):w(n)}finally{g(!1)}},[e,p,n,r]);return(0,J.jsx)(C,{variant:`outlined`,children:(0,J.jsxs)(d,{children:[(0,J.jsxs)(I,{direction:`row`,spacing:1.5,sx:{alignItems:`center`,mb:1.5},children:[(0,J.jsx)(P,{variant:`subtitle2`,children:`Verified on stacks`}),(0,J.jsx)(P,{variant:`caption`,sx:{color:`text.secondary`},children:`probes a running stack measured against this release`}),(0,J.jsx)(v,{sx:{flex:1}}),o&&s&&u.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ne,{select:!0,size:`small`,value:p,onChange:e=>m(e.target.value),disabled:h||T!==null,sx:{minWidth:120},children:u.map(e=>(0,J.jsx)(fe,{value:e.name,children:e.name},e.name))}),(0,J.jsx)(j,{title:`Uploads this release's own scripts to the stack's node and runs the probes there, under the node's deploy lease. The stack should be carrying this release — an attestation older than the last deployment is refused.`,arrow:!0,children:(0,J.jsx)(`span`,{children:(0,J.jsx)(f,{size:`small`,variant:`outlined`,onClick:()=>void M(),disabled:h||T!==null||!p,startIcon:h||T!==null?(0,J.jsx)(E,{size:14}):void 0,children:h?`Running on the node…`:T===null?`Run the probes`:`Awaiting result…`})})})]})]}),T!==null&&(0,J.jsxs)(b,{severity:`info`,sx:{mb:1.5},children:[`The gateway did not return a result. Checking for a new attestation on `,T.stack,` before another run.`]}),O&&(0,J.jsx)(b,{severity:`warning`,sx:{mb:1.5},children:`No new attestation was recorded within ten minutes. Inspect the node logs before retrying.`}),_&&(0,J.jsxs)(b,{severity:_.passed===_.gates?`success`:`warning`,sx:{mb:1.5},children:[_.passed,` of `,_.gates,` probes passed on `,_.node,` — probes from`,` `,_.scriptsFrom===`release`?`the release itself`:`the release's commit`,typeof _.sourceFiles==`number`&&(_.sourceFiles>0?`, with ${_.sourceFiles} application source files from that commit`:`, with no application sources — probes that read code said NOT RUN`),`.`,_.accounts?Je[_.accounts]:``]}),S&&(0,J.jsx)(b,{severity:`error`,sx:{mb:1.5},children:(0,J.jsx)(P,{variant:`body2`,sx:{whiteSpace:`pre-wrap`},children:S})}),n.length===0?(0,J.jsxs)(P,{variant:`body2`,sx:{color:`text.secondary`},children:[`No stack has attested this release. A stack whose policy declares `,(0,J.jsx)(`code`,{children:`verifiedOn`}),` refuses it until one does.`]}):(0,J.jsx)(I,{spacing:2,children:n.map(e=>{let t=e.gates.filter(e=>e.status===`passed`).length;return(0,J.jsxs)(v,{children:[(0,J.jsxs)(I,{direction:`row`,spacing:1,sx:{alignItems:`center`,flexWrap:`wrap`},children:[(0,J.jsx)(y,{label:e.stack,size:`small`,variant:`outlined`,sx:{height:20,fontSize:11}}),(0,J.jsxs)(P,{variant:`body2`,sx:{fontWeight:600,fontFamily:`monospace`,color:t===e.gates.length?`success.main`:`error.main`},children:[t,`/`,e.gates.length]}),(0,J.jsx)(Fe,{gates:e.gates,size:9}),(0,J.jsx)(v,{sx:{flex:1}}),(0,J.jsxs)(P,{variant:`caption`,sx:{color:`text.secondary`},children:[`measured `,Ie(e.at),e.onNode.hosts.length>0?` on ${e.onNode.hosts.join(`, `)}`:``]}),e.onNode.claimed&&(0,J.jsx)(j,{title:e.onNode.matched===!0?`The producer confirmed it ran on one of the stack's nodes.`:`The producer could not confirm the machine it ran on.`,arrow:!0,children:(0,J.jsx)(y,{label:e.onNode.matched===!0?`on the node`:`node unconfirmed`,size:`small`,color:e.onNode.matched===!0?`success`:`warning`,variant:`outlined`,sx:{height:18,fontSize:10}})})]}),e.gates.some(e=>e.status!==`passed`)&&(0,J.jsx)(v,{sx:{mt:.75,pl:1},children:e.gates.filter(e=>e.status!==`passed`).map(e=>(0,J.jsxs)(v,{children:[(0,J.jsxs)(P,{variant:`caption`,sx:{display:`block`,color:`text.secondary`},children:[(0,J.jsx)(v,{component:`span`,sx:{color:G[e.status].color,fontWeight:600},children:G[e.status].label}),` `,(0,J.jsx)(v,{component:`span`,sx:{fontFamily:`monospace`},children:e.name}),e.detail?` — ${e.detail}`:``]}),e.output&&(0,J.jsx)(Ge,{output:e.output})]},e.name))}),(0,J.jsx)(Ke,{attestation:e})]},e.stack)})})]})})}var q,J,Je;function Y(){return(Y=e((()=>{V(),q=t(),w(),p(),m(),h(),g(),_(),x(),me(),L(),oe(),M(),O(),o(),xe(),Le(),J=n(),Je={provisioned:` Accounts were created by the run and removed at its end.`,"not-declared":` No accounts were provisioned — the stack does not declare release.attest.provision, so probes that sign in said NOT RUN.`,"producer-cannot":` No accounts were provisioned — the stack allows it, but this release's producer predates --provision.`}})))()}function Ye({source:e}){return!e||e.state===`invalid`?(0,X.jsx)(P,{variant:`caption`,color:`warning.main`,sx:{overflowWrap:`anywhere`},children:e?.reason??`Per-application provenance unavailable from this daemon`}):(0,X.jsxs)(v,{component:`details`,sx:{minWidth:0,overflowWrap:`anywhere`,"& > summary":{cursor:`pointer`,fontSize:12,color:`text.secondary`,borderRadius:.5,"&:focus-visible":{outline:`2px solid`,outlineColor:`primary.main`,outlineOffset:2}}},children:[(0,X.jsx)(v,{component:`summary`,children:e.via.length?`Imported · ${e.producerApp}`:`Built in this release`}),(0,X.jsxs)(I,{spacing:.75,sx:{mt:1},children:[(0,X.jsx)(P,{variant:`caption`,children:e.releaseId}),(0,X.jsxs)(P,{variant:`caption`,children:[`Project · `,e.project.repo,(0,X.jsx)(`br`,{}),e.project.commit]}),e.packageDirectory&&(0,X.jsxs)(P,{variant:`caption`,children:[`Package · `,e.packageDirectory]}),(0,X.jsxs)(P,{variant:`caption`,children:[`SDK · `,e.framework.repo,(0,X.jsx)(`br`,{}),e.framework.commit]}),(0,X.jsx)(P,{variant:`caption`,children:Se(e.target)}),e.via.map((e,t)=>(0,X.jsxs)(P,{variant:`caption`,children:[`Via `,e.release,`/`,e.app,(0,X.jsx)(`br`,{}),`Manifest · `,e.manifestSha256]},`${t}:${e.manifestSha256}:${e.app}`)),(0,X.jsx)(P,{variant:`caption`,color:`text.secondary`,children:`Recorded build inputs; current execution is shown in Deployment state.`})]})]})}var X;function Xe(){return(Xe=e((()=>{p(),L(),O(),W(),X=n()})))()}function Ze(){let{id:e=``}=r();return(0,Q.jsx)(Qe,{id:e},e)}function Qe({id:e}){let{can:t}=z(),n=t(`OmnitronRelease.builds`),r=t(`OmnitronRelease.getLog`),i=(0,Z.useRef)(0),[o,s]=(0,Z.useState)(null),[c,u]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(null),{data:_,loading:b,error:x,refresh:S}=ve(async()=>{let[t,r]=await Promise.all([Ae.get(e),n?Ae.builds().then(e=>({records:e,error:null})).catch(e=>({records:[],error:e.message})):{records:[],error:null}]);return{detail:t,builds:r}},{intervalMs:15e3,enabled:!!e,resourceKey:JSON.stringify([e,n])}),w=(0,Z.useCallback)(async t=>{let n=++i.current;s(t),m(null),g(null);try{let r=await a.getLog({id:e,name:t,lines:400});n===i.current&&m({name:r.name,tail:r.tail})}catch(e){n===i.current&&g(e.message)}finally{n===i.current&&s(null)}},[e]);if(b&&!_)return(0,Q.jsx)(ge,{});if(x&&!_)return(0,Q.jsxs)(I,{spacing:3,children:[(0,Q.jsx)(ke,{links:[{name:`Releases`,href:`/releases`},{name:e}]}),(0,Q.jsx)(R,{severity:`error`,variant:`outlined`,children:x})]});let E=_.detail,D=E.manifest,O=_.builds.records.find(t=>t.releaseId===e)??null;return(0,Q.jsxs)(I,{spacing:3,children:[(0,Q.jsx)(ke,{links:[{name:`Releases`,href:`/releases`},{name:e}],action:(0,Q.jsxs)(I,{direction:`row`,spacing:1,children:[(0,Q.jsx)(pe,{"data-console-command":`refresh`,size:`small`,onClick:()=>void S(),title:`Refresh`,children:(0,Q.jsx)(we,{})}),(0,Q.jsx)(B,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(f,{variant:`contained`,size:`small`,startIcon:(0,Q.jsx)(Te,{}),disabled:!E.complete,onClick:()=>u(!0),children:`Deploy…`})})]})}),x&&(0,Q.jsxs)(R,{severity:`warning`,children:[`Last confirmed manifest · `,x]}),_?.builds.error&&(0,Q.jsxs)(R,{severity:`warning`,children:[`Build activity unavailable · `,_.builds.error]}),!E.complete&&(0,Q.jsx)(R,{severity:E.manifestError?`error`:`warning`,variant:`outlined`,children:E.manifestError??`This directory holds no manifest: the build did not finish, and what is here is its logs. Nothing can be deployed from it.`}),O&&(0,Q.jsx)(Ve,{record:O,compact:O.state!==`running`}),(0,Q.jsx)(Ue,{project:E.project},E.project),(0,Q.jsxs)(F,{container:!0,spacing:2,children:[(0,Q.jsx)(F,{size:{xs:12,md:6},children:(0,Q.jsx)(C,{variant:`outlined`,sx:{height:`100%`},children:(0,Q.jsxs)(d,{children:[(0,Q.jsx)(P,{variant:`subtitle2`,sx:{mb:1.5},children:`Built from`}),(0,Q.jsx)(I,{spacing:1.5,children:[[`project`,E.projectCommit,E.projectRepo,E.onRemote.project],[`omni`,E.omniCommit,E.omniRepo,E.onRemote.omni]].map(([e,t,n,r])=>(0,Q.jsxs)(v,{children:[(0,Q.jsxs)(I,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[(0,Q.jsx)(P,{variant:`body2`,sx:{fontWeight:600,minWidth:56},children:e===`project`?E.project:`omni`}),(0,Q.jsx)(P,{variant:`body2`,sx:{fontFamily:`monospace`},children:t?.slice(0,12)??`—`}),r===!1&&(0,Q.jsx)(j,{title:H({project:r,omni:!0},e===`project`?E.project:`omni`).detail,children:(0,Q.jsx)(y,{label:`Git: unpublished source`,size:`small`,color:`warning`,variant:`outlined`})}),r===null&&(0,Q.jsx)(j,{title:H({project:r,omni:!0},e===`project`?E.project:`omni`).detail,children:(0,Q.jsx)(y,{label:`Git: unverified`,size:`small`,variant:`outlined`})})]}),(0,Q.jsx)(P,{variant:`caption`,sx:{color:`text.secondary`},children:n??`—`}),E.manifest?.[e]?.ref&&(0,Q.jsxs)(P,{component:`div`,variant:`caption`,sx:{color:`text.secondary`,overflowWrap:`anywhere`},children:[`Required ref: `,E.manifest[e].ref]})]},e))})]})})}),(0,Q.jsx)(F,{size:{xs:12,md:6},children:(0,Q.jsx)(C,{variant:`outlined`,sx:{height:`100%`},children:(0,Q.jsxs)(d,{children:[(0,Q.jsx)(P,{variant:`subtitle2`,sx:{mb:1.5},children:`Built with`}),(0,Q.jsxs)(I,{spacing:.75,children:[E.manifestSha256&&(0,Q.jsxs)(v,{component:`details`,sx:{overflowWrap:`anywhere`},children:[(0,Q.jsx)(P,{component:`summary`,variant:`caption`,sx:{cursor:`pointer`,color:`text.secondary`},children:`Manifest SHA-256`}),(0,Q.jsx)(P,{component:`code`,variant:`caption`,sx:{userSelect:`all`},children:E.manifestSha256})]}),(0,Q.jsxs)(P,{variant:`body2`,children:[Ie(E.builtAt),` · `,E.builtBy??`—`]}),(0,Q.jsxs)(P,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:13},children:[`omnitron `,E.builtWith??`—`]}),(0,Q.jsx)(P,{variant:`caption`,sx:{color:`text.secondary`},children:Se(D?.builtWith?.target)}),(0,Q.jsxs)(P,{variant:`caption`,sx:{color:`text.secondary`},children:[D&&(0,Q.jsxs)(Q.Fragment,{children:[be(D),` · `]}),K(E.bytes),` on disk at `,E.root]}),E.statics&&(0,Q.jsxs)(P,{variant:`caption`,sx:{color:`text.secondary`},children:[`statics for `,(0,Q.jsx)(`strong`,{children:E.statics.stack}),` — `,E.statics.files,` files,`,` `,K(E.statics.bytes),` from `,D?.statics?.dir]}),E.machine&&(0,Q.jsxs)(P,{variant:`caption`,sx:{color:Pe(E.machine)?`warning.main`:`text.secondary`},children:[`machine while the gates ran: `,Ne(E.machine),Pe(E.machine)?` — load exceeded core count; inspect the gate logs for failure causes`:``]})]})]})})})]}),(0,Q.jsx)(C,{variant:`outlined`,children:(0,Q.jsxs)(d,{children:[(0,Q.jsxs)(I,{direction:`row`,spacing:1.5,sx:{alignItems:`center`,mb:1.5},children:[(0,Q.jsx)(P,{variant:`subtitle2`,children:`Gates`}),(0,Q.jsx)(P,{variant:`caption`,sx:{color:`text.secondary`},children:E.gates.total===0?`none recorded — a stack that requires any refuses this release`:`${E.gates.passed} of ${E.gates.total} passed`}),(0,Q.jsx)(v,{sx:{flex:1}}),(0,Q.jsx)(Fe,{gates:E.gateList})]}),E.gateList.length>0&&(0,Q.jsx)(ce,{children:(0,Q.jsxs)(ae,{size:`small`,children:[(0,Q.jsx)(le,{children:(0,Q.jsxs)(N,{children:[(0,Q.jsx)(k,{children:`Gate`}),(0,Q.jsx)(k,{children:`Outcome`}),(0,Q.jsx)(k,{align:`right`,children:`Took`}),(0,Q.jsx)(k,{children:`Detail`})]})}),(0,Q.jsx)(A,{children:E.gateList.map((e,t)=>(0,Q.jsxs)(N,{children:[(0,Q.jsxs)(k,{sx:{fontFamily:`monospace`,fontSize:13},children:[e.name,e.checks!=null&&(0,Q.jsxs)(P,{component:`span`,variant:`caption`,sx:{color:`text.secondary`,ml:1},children:[e.checks,` checks`]})]}),(0,Q.jsx)(k,{children:(0,Q.jsx)(P,{variant:`caption`,sx:{color:G[e.status].color,fontWeight:600},children:G[e.status].label})}),(0,Q.jsx)(k,{align:`right`,children:(0,Q.jsx)(P,{variant:`caption`,sx:{color:`text.secondary`,fontFamily:`monospace`},children:e.durationMs?Me(e.durationMs):`—`})}),(0,Q.jsx)(k,{children:(0,Q.jsx)(P,{variant:`caption`,sx:{color:`text.secondary`,whiteSpace:`pre-wrap`},children:e.detail??``})})]},`${e.name}-${t}`))})]})})]})}),E.complete&&(0,Q.jsx)(qe,{releaseId:E.id,project:E.project,attestations:E.attestations,onChanged:S}),(0,Q.jsx)(C,{variant:`outlined`,children:(0,Q.jsxs)(d,{children:[(0,Q.jsx)(P,{variant:`subtitle2`,sx:{mb:1.5},children:`Artifacts`}),(D?.artifacts??[]).length===0?(0,Q.jsx)(P,{variant:`body2`,sx:{color:`text.secondary`},children:`None.`}):(0,Q.jsx)(ce,{children:(0,Q.jsxs)(ae,{size:`small`,sx:{minWidth:540},children:[(0,Q.jsx)(le,{children:(0,Q.jsxs)(N,{children:[(0,Q.jsx)(k,{children:`App`}),(0,Q.jsx)(k,{children:`Source`}),(0,Q.jsx)(k,{align:`right`,children:`Size`}),(0,Q.jsx)(k,{children:`sha256`})]})}),(0,Q.jsx)(A,{children:(D?.artifacts??[]).map(e=>(0,Q.jsxs)(N,{children:[(0,Q.jsxs)(k,{sx:{verticalAlign:`top`,maxWidth:200,overflowWrap:`anywhere`},children:[(0,Q.jsx)(P,{variant:`body2`,sx:{fontWeight:600},children:e.app}),(0,Q.jsx)(P,{variant:`caption`,color:`text.secondary`,sx:{fontFamily:`monospace`},children:e.version})]}),(0,Q.jsx)(k,{sx:{verticalAlign:`top`,maxWidth:360},children:(0,Q.jsx)(Ye,{source:E.artifactSources?.find(t=>t.app===e.app)})}),(0,Q.jsx)(k,{align:`right`,sx:{fontFamily:`monospace`,fontSize:13},children:K(e.bytes)}),(0,Q.jsx)(k,{children:(0,Q.jsx)(j,{title:e.sha256||`none recorded`,arrow:!0,children:(0,Q.jsx)(P,{variant:`caption`,sx:{fontFamily:`monospace`,color:`text.secondary`},children:e.sha256?`${e.sha256.slice(0,16)}…`:`—`})})})]},`${e.app}-${e.version}`))})]})}),(D?.artifactFailures??[]).map(e=>(0,Q.jsx)(R,{severity:`error`,variant:`outlined`,sx:{mt:1},children:(0,Q.jsxs)(P,{variant:`body2`,sx:{whiteSpace:`pre-wrap`},children:[(0,Q.jsx)(`strong`,{children:e.app}),` did not build — `,e.error.split(`
2
+ `)[0]]})},e.app))]})}),(0,Q.jsx)(C,{variant:`outlined`,children:(0,Q.jsxs)(d,{children:[(0,Q.jsx)(P,{variant:`subtitle2`,sx:{mb:1.5},children:`Build logs`}),E.logs.length===0?(0,Q.jsx)(P,{variant:`body2`,sx:{color:`text.secondary`},children:`This build wrote no logs.`}):(0,Q.jsx)(I,{direction:`row`,spacing:1,sx:{flexWrap:`wrap`},children:E.logs.map(e=>(0,Q.jsx)(y,{label:`${e.name} · ${K(e.bytes)}`,size:`small`,variant:p?.name===e.name?`filled`:`outlined`,disabled:!r,onClick:()=>void w(e.name),sx:{fontFamily:`monospace`,fontSize:11}},e.name))}),(0,Q.jsx)(De,{active:r&&!!o,label:`Reading ${o??``}`}),r&&h&&(0,Q.jsx)(R,{severity:`warning`,variant:`outlined`,sx:{mt:1.5},children:h}),r&&p&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(T,{sx:{my:1.5}}),(0,Q.jsx)(v,{sx:{maxHeight:420,overflow:`auto`,p:1.5,borderRadius:1,bgcolor:e=>l(e.palette.text.primary,.04)},children:(0,Q.jsx)(P,{variant:`caption`,sx:{fontFamily:`monospace`,whiteSpace:`pre`,display:`block`},children:p.tail})})]})]})}),(0,Q.jsx)(B,{permission:`OmnitronProject.startStack`,children:(0,Q.jsx)(ze,{open:c,onClose:()=>u(!1),project:E.project,release:E})})]})}var Z,Q;function $(){return($=e((()=>{Z=t(),c(),p(),m(),h(),g(),_(),S(),ue(),de(),L(),D(),ee(),se(),te(),re(),ie(),M(),O(),u(),he(),Oe(),_e(),Ce(),Re(),Y(),Be(),He(),Xe(),W(),Le(),ye(),V(),Ee(),o(),je(),Q=n()})))()}$();export{Ze as default};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{t}from"./react-BN8qLIAi.js";import{Vt as n,Yt as r}from"./mui-BTN91yBK.js";import{H as i,V as a}from"./mui-BXSXx9c9.js";import{B as o,z as s}from"./mui-Cd711nOk.js";import{_ as c,v as l}from"./mui-BwsIrivo.js";function u({icon:e,color:t=`primary.main`,size:r=64}){return(0,f.jsx)(a,{sx:{width:r,height:r,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:e=>{let r=t.split(`.`),i=e.palette;for(let e of r)i=i?.[e];return n(typeof i==`string`?i:e.palette.primary.main,.08)}},children:e})}function d({illustration:e,icon:t,iconColor:n=`primary.main`,iconSize:r=64,title:i=`No data`,description:o,action:l,actions:d,maxWidth:p=400,filled:m=!1,sx:h,illustrationSx:g,slotProps:_,compact:v=!1}){let y=t?(0,f.jsx)(u,{icon:t,color:n,size:r}):e?(0,f.jsx)(a,{sx:g,children:e}):null,b=[...d??[],...l?[l]:[]];return(0,f.jsx)(c,{sx:{alignItems:`center`,justifyContent:`center`,textAlign:`center`,py:v?4:8,px:2,...!v&&{flex:1,alignSelf:`stretch`,minHeight:`calc(100vh - 240px)`},...m&&{height:`100%`},...h},children:(0,f.jsxs)(a,{sx:{maxWidth:p,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:v?1.5:2.5},children:[y,(0,f.jsxs)(c,{spacing:.5,sx:{alignItems:`center`},children:[i&&(0,f.jsx)(s,{variant:v?`subtitle1`:`h6`,sx:{color:`text.secondary`,fontWeight:600,..._?.title},children:i}),o&&(0,f.jsx)(s,{variant:`body2`,sx:{color:`text.disabled`,lineHeight:1.6,..._?.description},children:o})]}),b.length>0&&(0,f.jsx)(c,{direction:`row`,spacing:1,sx:{mt:v?.5:1,flexWrap:`wrap`,justifyContent:`center`,..._?.actions},children:b.map((e,t)=>(0,f.jsx)(a,{children:e},t))})]})})}var f;function p(){return(p=e((()=>{i(),l(),o(),r(),f=t()})))()}export{p as n,d as t};
1
+ import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{t}from"./react-BN8qLIAi.js";import{Vt as n,Yt as r}from"./mui-BTN91yBK.js";import{H as i,V as a}from"./mui-SNRRJ_vi.js";import{B as o,z as s}from"./mui-B3fJdIMc.js";import{_ as c,v as l}from"./mui-CPEkFAPo.js";function u({icon:e,color:t=`primary.main`,size:r=64}){return(0,f.jsx)(a,{sx:{width:r,height:r,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,bgcolor:e=>{let r=t.split(`.`),i=e.palette;for(let e of r)i=i?.[e];return n(typeof i==`string`?i:e.palette.primary.main,.08)}},children:e})}function d({illustration:e,icon:t,iconColor:n=`primary.main`,iconSize:r=64,title:i=`No data`,description:o,action:l,actions:d,maxWidth:p=400,filled:m=!1,sx:h,illustrationSx:g,slotProps:_,compact:v=!1}){let y=t?(0,f.jsx)(u,{icon:t,color:n,size:r}):e?(0,f.jsx)(a,{sx:g,children:e}):null,b=[...d??[],...l?[l]:[]];return(0,f.jsx)(c,{sx:{alignItems:`center`,justifyContent:`center`,textAlign:`center`,py:v?4:8,px:2,...!v&&{flex:1,alignSelf:`stretch`,minHeight:`calc(100vh - 240px)`},...m&&{height:`100%`},...h},children:(0,f.jsxs)(a,{sx:{maxWidth:p,display:`flex`,flexDirection:`column`,alignItems:`center`,gap:v?1.5:2.5},children:[y,(0,f.jsxs)(c,{spacing:.5,sx:{alignItems:`center`},children:[i&&(0,f.jsx)(s,{variant:v?`subtitle1`:`h6`,sx:{color:`text.secondary`,fontWeight:600,..._?.title},children:i}),o&&(0,f.jsx)(s,{variant:`body2`,sx:{color:`text.disabled`,lineHeight:1.6,..._?.description},children:o})]}),b.length>0&&(0,f.jsx)(c,{direction:`row`,spacing:1,sx:{mt:v?.5:1,flexWrap:`wrap`,justifyContent:`center`,..._?.actions},children:b.map((e,t)=>(0,f.jsx)(a,{children:e},t))})]})})}var f;function p(){return(p=e((()=>{i(),l(),o(),r(),f=t()})))()}export{p as n,d as t};
@@ -1,3 +1,3 @@
1
- import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{F as r,H as i,I as a,St as o,V as s,xt as c}from"./mui-BXSXx9c9.js";import{B as l,z as u}from"./mui-Cd711nOk.js";import{it as d,rt as f}from"./mui-AnEgAVjz.js";import{d as p,j as m,s as h}from"./controls-C5W8gHU4.js";function g(e){for(let t of[/at\s+(?:async\s+)?([^\s(]+)\s+\((.+?):(\d+):(\d+)\)/,/at\s+(.+?):(\d+):(\d+)/]){let n=e.match(t);if(n){let[,e,t,r,i]=n,a=i!==void 0,o=a?e:null,s=a?t:e,c=parseInt(a?r:t,10),l=parseInt(a?i:r,10),u=!s.includes(`node_modules`)&&s.includes(`src/`);return{functionName:o||null,filePath:_(s),lineNumber:isNaN(c)?null:c,columnNumber:isNaN(l)?null:l,isAppCode:u}}}return null}function _(e){let t=e.replace(/\?.*$/,``),n=t.indexOf(`/src/`);if(n!==-1)return t.slice(n+1);let r=t.split(`/`);return r.length>3?r.slice(-3).join(`/`):t}function v(e){if(!e)return{primary:null,frames:[],raw:``};let t=e.split(`
1
+ import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{F as r,H as i,I as a,St as o,V as s,xt as c}from"./mui-SNRRJ_vi.js";import{B as l,z as u}from"./mui-B3fJdIMc.js";import{it as d,rt as f}from"./mui-CMWGTMXv.js";import{d as p,j as m,s as h}from"./controls-CqeGPnaF.js";function g(e){for(let t of[/at\s+(?:async\s+)?([^\s(]+)\s+\((.+?):(\d+):(\d+)\)/,/at\s+(.+?):(\d+):(\d+)/]){let n=e.match(t);if(n){let[,e,t,r,i]=n,a=i!==void 0,o=a?e:null,s=a?t:e,c=parseInt(a?r:t,10),l=parseInt(a?i:r,10),u=!s.includes(`node_modules`)&&s.includes(`src/`);return{functionName:o||null,filePath:_(s),lineNumber:isNaN(c)?null:c,columnNumber:isNaN(l)?null:l,isAppCode:u}}}return null}function _(e){let t=e.replace(/\?.*$/,``),n=t.indexOf(`/src/`);if(n!==-1)return t.slice(n+1);let r=t.split(`/`);return r.length>3?r.slice(-3).join(`/`):t}function v(e){if(!e)return{primary:null,frames:[],raw:``};let t=e.split(`
2
2
  `),n=[];for(let e of t){let t=g(e.trim());t&&n.push(t)}return{primary:n.find(e=>e.isAppCode)??n[0]??null,frames:n,raw:e}}function y(e){let{primary:t}=v(e.stack);if(!t)return`Unknown location`;let n=[];if(t.functionName&&n.push(`in ${t.functionName}`),t.filePath){let e=t.lineNumber?`${t.filePath}:${t.lineNumber}`:t.filePath;n.push(`(${e})`)}return n.join(` `)||`Unknown location`}function b({error:e,parsedStack:t,resetErrorBoundary:n,sx:i,showDetails:a}){let[o,l]=(0,x.useState)(!1),[d,m]=(0,x.useState)(!1),g=a??(typeof process<`u`&&!1),_=async()=>{try{let n=[`Error: ${e.message}`,`Location: ${y(e)}`,``,`Stack Trace:`,t.raw].join(`
3
3
  `);await navigator.clipboard.writeText(n),m(!0),setTimeout(()=>m(!1),2e3)}catch{}};return(0,S.jsxs)(s,{sx:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,minHeight:200,p:3,textAlign:`center`,...i},children:[(0,S.jsx)(u,{variant:`h6`,color:`error`,gutterBottom:!0,children:`Something went wrong`}),(0,S.jsx)(u,{variant:`body2`,sx:{color:`text.secondary`,mb:1,maxWidth:400},children:e.message||`An unexpected error occurred`}),g&&t.primary&&(0,S.jsxs)(u,{variant:`caption`,sx:{color:`text.secondary`,mb:2,fontFamily:`monospace`},children:[t.primary.filePath,t.primary.lineNumber&&`:${t.primary.lineNumber}`,t.primary.functionName&&` (${t.primary.functionName})`]}),(0,S.jsxs)(s,{sx:{display:`flex`,gap:1,mb:2},children:[(0,S.jsx)(r,{variant:`outlined`,onClick:n,children:`Try Again`}),g&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(f,{size:`small`,onClick:()=>l(!o),"aria-label":o?`Hide stack trace`:`Show stack trace`,"aria-expanded":o,sx:{transform:o?`rotate(180deg)`:`rotate(0deg)`,transition:`transform 0.2s`},children:(0,S.jsx)(h,{})}),(0,S.jsx)(f,{size:`small`,onClick:_,title:`Copy error details`,children:(0,S.jsx)(p,{fontSize:`small`})}),d&&(0,S.jsx)(u,{variant:`caption`,sx:{color:`success.main`,alignSelf:`center`},children:`Copied!`})]})]}),g&&(0,S.jsx)(c,{in:o,children:(0,S.jsx)(s,{sx:{mt:1,p:2,bgcolor:`action.hover`,borderRadius:1,maxWidth:600,maxHeight:300,overflow:`auto`,textAlign:`left`},children:(0,S.jsx)(u,{variant:`caption`,component:`pre`,sx:{fontFamily:`monospace`,m:0},children:t.frames.map((e,t)=>(0,S.jsxs)(s,{component:`span`,sx:{display:`block`,color:e.isAppCode?`error.main`:`text.secondary`,fontWeight:e.isAppCode?600:400},children:[e.functionName||`(anonymous)`,` at `,e.filePath||`unknown`,e.lineNumber&&`:${e.lineNumber}`]},t))})})})]})}var x,S,C;function w(){return(w=e((()=>{x=t(),i(),a(),l(),o(),d(),m(),S=n(),C=class extends x.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){let n=v(e.stack);this.setState({errorInfo:t}),this.props.onError?.(e,t,n)}componentDidUpdate(e){let{resetKeys:t}=this.props,{hasError:n}=this.state;if(n&&t){let n=e.resetKeys;(n===void 0||n.length!==t.length||t.some((e,t)=>e!==n[t]))&&this.resetErrorBoundary()}}resetErrorBoundary=()=>{this.props.onReset?.(),this.setState({hasError:!1,error:null,errorInfo:null})};render(){let{hasError:e,error:t,errorInfo:n}=this.state,{children:r,fallback:i,sx:a,showDetails:o}=this.props;if(e&&t){let e={error:t,errorInfo:n,parsedStack:v(t.stack),resetErrorBoundary:this.resetErrorBoundary};return typeof i==`function`?i(e):i||(0,S.jsx)(b,{...e,sx:a,showDetails:o})}return r}}})))()}export{w as n,C as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{H as r,V as i}from"./mui-BXSXx9c9.js";import{B as a,z as o}from"./mui-Cd711nOk.js";function s({values:e}){return(0,l.jsx)(i,{component:`dl`,sx:{m:0,display:`grid`,gridTemplateColumns:{xs:`minmax(0, 1fr)`,sm:`120px minmax(0, 1fr)`},columnGap:2,rowGap:.5},children:e.map(([e,t])=>(0,l.jsxs)(c.Fragment,{children:[(0,l.jsx)(o,{component:`dt`,sx:{fontFamily:u,fontSize:11,color:`text.secondary`,overflowWrap:`anywhere`,pt:{xs:.5,sm:0}},children:e}),(0,l.jsx)(i,{component:`dd`,sx:{m:0,minWidth:0,fontFamily:u,fontSize:11.5,lineHeight:1.65,color:`text.primary`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:typeof t==`string`?t:JSON.stringify(t,null,2)})]},e))})}var c,l,u;function d(){return(d=e((()=>{c=t(),r(),a(),l=n(),u=`'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace`})))()}export{d as n,s as t};
1
+ import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{H as r,V as i}from"./mui-SNRRJ_vi.js";import{B as a,z as o}from"./mui-B3fJdIMc.js";function s({values:e}){return(0,l.jsx)(i,{component:`dl`,sx:{m:0,display:`grid`,gridTemplateColumns:{xs:`minmax(0, 1fr)`,sm:`120px minmax(0, 1fr)`},columnGap:2,rowGap:.5},children:e.map(([e,t])=>(0,l.jsxs)(c.Fragment,{children:[(0,l.jsx)(o,{component:`dt`,sx:{fontFamily:u,fontSize:11,color:`text.secondary`,overflowWrap:`anywhere`,pt:{xs:.5,sm:0}},children:e}),(0,l.jsx)(i,{component:`dd`,sx:{m:0,minWidth:0,fontFamily:u,fontSize:11.5,lineHeight:1.65,color:`text.primary`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:typeof t==`string`?t:JSON.stringify(t,null,2)})]},e))})}var c,l,u;function d(){return(d=e((()=>{c=t(),r(),a(),l=n(),u=`'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace`})))()}export{d as n,s as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-editor-DK6Tmmxv.js","assets/rolldown-runtime-CNOWq4Kh.js","assets/react-BN8qLIAi.js","assets/mui-BTN91yBK.js","assets/mui-agG5dued.js","assets/services-BddvcFi8.js","assets/mui-CdB_p2lt.js","assets/client-DFnuv2z3.js","assets/mui-BXSXx9c9.js","assets/mui-Cd711nOk.js","assets/mui-AnEgAVjz.js","assets/mui-BwsIrivo.js","assets/popper-m_9b0JRf.js","assets/context-FIuwpd9_.js","assets/model-ZEXEHm0l.js","assets/preload-helper-DzCYNvzR.js","assets/dist-BUDn8hLh.js","assets/dist-De9Fty7a.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{d as r,h as i,y as a}from"./client-DFnuv2z3.js";import{n as o}from"./services-BddvcFi8.js";import{_n as s,a as c,gn as l,o as u}from"./mui-CdB_p2lt.js";import{B as d,C as f,F as p,H as m,I as h,Q as g,V as _,Z as ee,at as v,c as y,d as te,f as b,g as ne,h as re,m as ie,n as ae,ot as x,p as oe,s as se,t as ce,w as S,z as le}from"./mui-BXSXx9c9.js";import{A as C,B as w,C as T,D as ue,F as E,I as de,O as D,a as fe,b as pe,d as me,f as O,i as k,k as he,l as ge,n as _e,o as A,r as ve,t as ye,u as be,w as xe,y as Se,z as j}from"./mui-Cd711nOk.js";import{C as Ce,E as we,Q as Te,T as Ee,Z as De,ct as Oe,d as ke,f as Ae,it as M,l as je,m as N,p as Me,rt as P,st as Ne,u as Pe,w as F}from"./mui-AnEgAVjz.js";import{_ as I,v as L}from"./mui-BwsIrivo.js";import{b as R,i as z,j as Fe,r as Ie,t as Le,u as Re}from"./controls-C5W8gHU4.js";import{a as B,c as V,d as ze,f as Be,i as Ve,l as He,n as Ue,o as We,p as Ge,r as H,s as U,t as Ke,u as qe}from"./model-ZEXEHm0l.js";import{n as Je,t as Ye}from"./use-polled-resource-B22hhr5L.js";import{n as Xe,r as Ze}from"./console-keyboard-D3YCA0yU.js";import{$ as Qe,G as $e,J as et,M as tt,X as W,Y as nt,_ as rt,h as it,q as G}from"./icons-OboZgWSt.js";import{n as at,t as K}from"./preload-helper-DzCYNvzR.js";import{n as q,t as ot}from"./operation-status-Bm1x1wTz.js";import{n as st,t as ct}from"./table-viewport-Bp4pq-c_.js";import{n as lt,t as ut}from"./page-breadcrumbs-fR7Jmpp4.js";import{n as dt,t as ft}from"./confirm-dialog-BbGsAz7_.js";import{n as pt,r as J}from"./tabs-k5NPGLnJ.js";var mt;function ht(){return(ht=e((()=>{mt=[`tar`,`tar.gz`,`tar.bz2`,`tar.xz`,`tar.zst`,`zip`,`7z`]})))()}function gt(e,t,n,i){let a=JSON.stringify([e,t.nodeId,n]),o=JSON.stringify([a,t.rootId,t.path,i]),[s,c]=(0,_t.useState)(null),[l,u]=(0,_t.useState)(null),[d,f]=(0,_t.useState)(null),p=(0,_t.useRef)(null),m=(0,_t.useRef)(0),h=s?.key===a?s:null,g=h?.roots.find(e=>e.id===t.rootId),_=g&&l?.key===o?l:null;return(0,_t.useEffect)(()=>{let e=!0;return c(null),r.roots({nodeId:t.nodeId}).then(t=>{if(t.protocol!==1)throw Error(`Node requires a compatible file protocol`);e&&c({key:a,roots:t.roots})}).catch(t=>{e&&c({key:a,roots:[],error:Ke(t)})}),()=>{e=!1}},[a,t.nodeId]),(0,_t.useEffect)(()=>{let e=++m.current;return u(null),p.current=null,f(null),g&&r.list(t).then(t=>{e===m.current&&u({key:o,entries:t.entries,revision:t.revision,next:t.next})}).catch(t=>{e===m.current&&u({key:o,entries:[],revision:``,next:null,error:Ke(t)})}),()=>{m.current=e+1}},[o,t,g]),{policy:h,root:g,entries:_?.entries??vt,next:_?.next,more:async()=>{if(!_?.next||_.error||p.current===o)return;let e=m.current;p.current=o,f(o);try{let n=await r.list({...t,after:_.next,revision:_.revision});e===m.current&&u({..._,entries:[..._.entries,...n.entries],next:n.next})}catch(t){e===m.current&&u({..._,error:Ke(t)})}finally{e===m.current&&(p.current=null,f(null))}},ready:!(!_||_.error),loading:!h||!(!g||_&&d!==o),error:h?.error||_?.error}}var _t,vt;function yt(){return(yt=e((()=>{_t=t(),i(),B(),vt=[]})))()}function bt(e){return{id:crypto.randomUUID(),nodeId:e,rootId:``,path:``,history:[``],cursor:0}}function xt({side:e,hosts:t,discovery:n,retryDiscovery:r,active:i,hidden:a,refreshKey:o,onFocus:s,onSelection:c,onOpen:l,onAction:u,onSwitchPanel:d,visible:m=!0}){let[h,g]=(0,Y.useState)(()=>[bt(`local`)]),[y,te]=(0,Y.useState)(h[0].id),b=h.find(e=>e.id===y)??h[0],[ne,re]=(0,Y.useState)(null),ie=(0,Y.useRef)(null),[ae,x]=(0,Y.useState)(``),[oe,se]=(0,Y.useState)(0),[ce,S]=(0,Y.useState)(null),[C,w]=(0,Y.useState)(!1),de=(0,Y.useRef)(!1),D=(0,Y.useRef)(null),[pe,O]=(0,Y.useState)([]),[k,_e]=(0,Y.useState)(``),[A,ve]=(0,Y.useState)(!1),[ye,be]=(0,Y.useState)(`name`),[xe,we]=(0,Y.useState)(!1),[Te,Oe]=(0,Y.useState)(null),[Ae,M]=(0,Y.useState)(!1),[N,Pe]=(0,Y.useState)(``),F=(0,Y.useRef)(null),L=(0,Y.useRef)(null),Fe=(0,Y.useMemo)(()=>({nodeId:b.nodeId,rootId:b.rootId,path:b.path}),[b.nodeId,b.rootId,b.path]),{policy:Re,root:B,entries:Be,next:Ve,more:Ue,ready:We,loading:U,error:qe}=gt(b.id,Fe,oe,o),Je=qe||ae,Ye=Re?.roots.length===1?Re.roots[0]:void 0;(0,Y.useEffect)(()=>{!b.rootId&&Ye&&g(e=>e.map(e=>e.id===b.id&&!e.rootId?{...e,rootId:Ye.id,rootLabel:Ye.label}:e))},[Ye,b.id,b.rootId]);let Xe=e=>{te(e),O([]),S(null),F.current=null,_e(``),M(!1),x(``)},Qe=e=>t.find(t=>t.id===e)?.name??e,$e=e=>[Qe(e.nodeId),e.path.split(`/`).at(-1)||(e.rootLabel===`Filesystem`?``:e.rootLabel)].filter(Boolean).join(` · `),et=(0,Y.useRef)(c);et.current=c;let W=(0,Y.useMemo)(()=>ze(Be,k,A,ye,xe),[Be,k,A,ye,xe]),G=We&&b.path?[{name:`..`,path:V(b.path),kind:`parent`},...W]:W,at=G.some(e=>e.path===ce)?ce:G[0]?.path??null,K=(0,Y.useMemo)(()=>W.filter(e=>pe.includes(e.path)),[W,pe]),q=(0,Y.useMemo)(()=>K.length?K:W.filter(e=>e.path===at),[W,K,at]),ot=(e,t=!1)=>{let n=G[Math.max(0,Math.min(G.length-1,e))];if(!n)return;if(t){F.current??=at;let e=G.findIndex(e=>e.path===F.current),t=G.indexOf(n);O(G.slice(Math.min(Math.max(0,e),t),Math.max(e,t)+1).filter(e=>e.kind!==`parent`).map(e=>e.path))}else F.current=n.path;S(n.path);let r=D.current?.querySelectorAll(`tbody > tr`)[G.indexOf(n)];r?.focus({preventScroll:!0}),r?.scrollIntoView?.({block:`nearest`})},st=e=>g(t=>t.map(t=>t.id===b.id?{...t,...e}:t)),lt=e=>{B&&(x(``),st({path:e,history:[...b.history.slice(0,b.cursor+1),e].slice(-100),cursor:Math.min(b.cursor+1,99)}),O([]),S(null),_e(``),M(!1),requestAnimationFrame(()=>D.current?.focus({preventScroll:!0})))},ut=e=>{if(!B)return;let t=b.cursor+e;t>=0&&t<b.history.length&&(x(``),st({cursor:t,path:b.history[t]}),O([]),S(null),_e(``))};(0,Y.useEffect)(()=>{let e=()=>{de.current=!1};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,Y.useLayoutEffect)(()=>{et.current(B&&We&&!Je?{location:Fe,root:B,entries:q}:null)},[Fe,B,We,Je,q]);let dt=(e,t)=>{if(S(e.path),t&&F.current){let t=W.findIndex(e=>e.path===F.current),n=W.indexOf(e);if(t>=0){O(W.slice(Math.min(t,n),Math.max(t,n)+1).map(e=>e.path));return}}F.current=e.path,O(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path])},ft=e=>{B&&We&&(e.kind===`directory`||e.kind===`parent`?lt(e.path):e.kind===`file`?l(e,{...Fe,path:e.path},!!B?.readOnly):x(e.kind===`symlink`?`Symbolic links are visible but cannot be followed`:`Special files cannot be opened`))},J=q.some(e=>Ge(e.path,B?.protectedPaths)),mt=[[`create`,`New file`,!B||!!B.readOnly],[`mkdir`,`New folder`,!B||!!B.readOnly],[`upload`,`Upload from this computer`,!B||!!B.readOnly],[`copy`,`Copy to other panel · F5`,!q.length],[`download`,`Download to this computer`,q.length!==1||q[0]?.kind!==`file`],[`rename`,`Rename · F2`,q.length!==1||!!B?.readOnly||J],[`trash`,`Move to trash · Delete`,!q.length||!!B?.readOnly||J],[`trashList`,`Restore from trash`,!B]];return Ze([{id:`files-rename`,title:`Rename file`,group:`Files`,key:`F2`,shortcut:[`F2`],disabled:q.length!==1||!!B?.readOnly||J||U,onSelect:()=>u(`rename`)},{id:`files-edit`,title:`Open selected file`,group:`Files`,key:`F4`,shortcut:[`F4`],disabled:q.length!==1||U,onSelect:()=>ft(q[0])},{id:`files-copy`,title:`Copy to other panel`,group:`Files`,key:`F5`,shortcut:[`F5`],disabled:!q.length||U,onSelect:()=>u(`copy`)},{id:`files-trash`,title:`Move selection to trash…`,group:`Files`,key:`Delete`,shortcut:[`Delete`],disabled:!q.length||!!B?.readOnly||J||U,onSelect:()=>u(`trash`)}],m&&i&&!a,L),(0,X.jsxs)(Ne,{component:`section`,variant:`outlined`,"aria-label":`${e} file panel`,ref:L,"data-file-side":e,"data-keyboard-region":`Files ${e===`left`?`A`:`B`}`,"aria-description":`Tab switches panels. Escape switches between the list and tools. F6 moves to another Console region.`,onFocusCapture:e=>{e.currentTarget.contains(e.target)&&m&&!a&&(s(),e.currentTarget.contains(e.relatedTarget)||de.current||C||e.target===D.current||e.target.closest(`tbody`)||(D.current??L.current?.querySelector(`[data-file-start]`))?.focus({preventScroll:!0}),(e.target===D.current||e.target.closest(`tbody`))&&w(!1))},onBlurCapture:e=>{let t=e.relatedTarget;!e.currentTarget.contains(t)&&!t?.closest(`[role="dialog"],[role="menu"],[role="listbox"]`)&&w(!1)},onPointerDownCapture:e=>{if(!e.currentTarget.contains(e.target))return;de.current=!0;let t=!!e.target.closest(`[data-file-list]`);w(!t),s(),e.target.closest(`input,button,a,[role="combobox"],tbody tr`)||D.current?.focus({preventScroll:!0})},onKeyDown:e=>{if(e.defaultPrevented||e.nativeEvent.isComposing||!m||a)return;let t=e.target;if(t.closest(`[role="dialog"],[role="alertdialog"],[role="menu"]`))return;let n=!!t.closest(`[data-file-list]`);if(n&&!C&&e.key===`Tab`&&!e.ctrlKey&&!e.metaKey&&!e.altKey)e.preventDefault(),e.stopPropagation(),d();else if(e.key===`Escape`&&!Ae)e.preventDefault(),e.stopPropagation(),O([]),n&&!C?(w(!0),(L.current?.querySelector(`[data-file-add]:not(:disabled)`)??L.current?.querySelector(`[data-file-tools] button:not(:disabled)`))?.focus()):(w(!1),D.current?.focus({preventScroll:!0}));else if(!t.closest(`input:not([type="checkbox"]),textarea,select,[contenteditable="true"]`)){if(n&&(e.ctrlKey||e.metaKey)&&!e.altKey&&e.key.toLowerCase()===`a`)e.preventDefault(),O(W.map(e=>e.path));else{if(n&&!t.closest(`input,button,a`)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let t=G.findIndex(e=>e.path===at),n=Math.max(1,Math.floor((D.current?.parentElement?.clientHeight||400)/40)),r={ArrowDown:t+1,ArrowUp:t-1,Home:0,End:G.length-1,PageDown:t+n,PageUp:t-n};if(e.key in r){e.preventDefault(),ot(r[e.key],e.shiftKey);return}let i=G[t];if(e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault(),e.key===`ArrowLeft`&&b.path&&lt(V(b.path)),e.key===`ArrowRight`&&i?.kind===`directory`&&ft(i);return}if(i&&(e.key===`Enter`||e.key===` `)){e.preventDefault(),e.key===`Enter`?ft(i):i.kind!==`parent`&&dt(i,e.shiftKey);return}}B&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`l`?(e.preventDefault(),Pe(`/`+b.path),M(!0)):e.altKey&&e.key===`ArrowLeft`?(e.preventDefault(),ut(-1)):e.altKey&&e.key===`ArrowRight`?(e.preventDefault(),ut(1)):e.altKey&&e.key===`ArrowUp`&&(e.preventDefault(),lt(V(b.path)))}}},sx:{display:a?`none`:`flex`,flex:1,flexDirection:`column`,minWidth:0,minHeight:0,overflow:`hidden`,borderColor:`divider`,"&:focus-within":{borderColor:`primary.main`},transition:`border-color 120ms`,borderRadius:1.5},children:[(0,X.jsx)(pt,{value:b.id,onChange:Xe,variant:`scrollable`,scrollButtons:`auto`,"aria-label":`${e} panel locations`,tabs:h.map(t=>({value:t.id,label:$e(t),closable:h.length>1,closeLabel:`Close ${e} location ${$e(t)}`})),onClose:e=>{let t=h.filter(t=>t.id!==e);t.length&&(g(t),y===e&&Xe(t[Math.min(h.findIndex(t=>t.id===e),t.length-1)].id))},action:(0,X.jsx)(E,{title:h.length>=8?`Close a tab to open another (8 per panel)`:`Open a node in a new tab`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(P,{"aria-label":`New ${e} location tab`,size:`small`,disabled:h.length>=8,"data-file-add":!0,"aria-haspopup":`menu`,"aria-expanded":!!ne,"aria-controls":ne?`choose-${e}-file-node`:void 0,onClick:e=>re(e.currentTarget),children:(0,X.jsx)(Le,{})})})}),sx:{px:1,minHeight:40,"& .MuiTab-root":{minHeight:40,minWidth:72,maxWidth:180,fontSize:12}}}),(0,X.jsxs)(ke,{id:`choose-${e}-file-node`,anchorEl:ne,open:!!ne,onClose:()=>re(null),slotProps:{list:{"aria-label":`Choose a node`},paper:{sx:{minWidth:208,maxWidth:`min(360px, 92vw)`}}},children:[(0,X.jsx)(De,{children:`Choose a node`}),t.map(e=>(0,X.jsx)(je,{ref:e.isLocal?ie:void 0,onClick:()=>{let t=bt(e.id);g(e=>[...e,t]),Xe(t.id),re(null)},children:(0,X.jsx)(Me,{primary:e.name,secondary:e.isLocal?`This daemon`:e.host,sx:{overflowWrap:`anywhere`}})},e.id)),n.pending&&(0,X.jsx)(je,{disabled:!0,children:`Loading registered nodes…`}),n.error&&(0,X.jsx)(je,{onClick:()=>{ie.current?.focus({preventScroll:!0}),r()},children:(0,X.jsx)(Me,{primary:`Retry loading remote nodes`,secondary:n.error,sx:{overflowWrap:`anywhere`}})})]}),(0,X.jsxs)(I,{"data-file-tools":!0,direction:`row`,spacing:.25,sx:{px:1,alignItems:`center`,minHeight:36,minWidth:0},children:[(0,X.jsx)(E,{title:`Back · Alt+←`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(P,{size:`small`,"aria-label":`Back in ${e} panel`,disabled:!B||b.cursor===0,onClick:()=>ut(-1),children:(0,X.jsx)(Ie,{fontSize:`small`})})})}),(0,X.jsx)(E,{title:`Forward · Alt+→`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(P,{size:`small`,"aria-label":`Forward in ${e} panel`,disabled:!B||b.cursor>=b.history.length-1,onClick:()=>ut(1),children:(0,X.jsx)(z,{fontSize:`small`})})})}),(0,X.jsx)(E,{title:`Parent folder · Alt+↑`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(P,{size:`small`,"aria-label":`Parent of ${e} panel`,disabled:!B||!b.path,onClick:()=>lt(V(b.path)),children:(0,X.jsx)(nt,{fontSize:`small`})})})}),(0,X.jsx)(_,{sx:{flex:1,minWidth:0,px:.5,overflow:`hidden`},children:Ae?(0,X.jsx)(fe,{autoFocus:!0,fullWidth:!0,size:`small`,label:`Path within root`,value:N,onChange:e=>Pe(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),M(!1),requestAnimationFrame(()=>D.current?.focus({preventScroll:!0}))),e.key===`Enter`)try{lt(He(N))}catch(e){x(Ke(e))}}}):B?(0,X.jsxs)(le,{"aria-label":`${e} path`,maxItems:3,sx:{"& .MuiBreadcrumbs-ol":{flexWrap:`nowrap`},"& .MuiBreadcrumbs-li":{minWidth:0},"& button":{maxWidth:170,textOverflow:`ellipsis`,overflow:`hidden`,whiteSpace:`nowrap`,fontFamily:`monospace`,fontSize:12}},children:[(0,X.jsx)(Ce,{component:`button`,underline:`hover`,onClick:()=>lt(``),children:B.id===`system`&&B.label===`Filesystem`?`/`:B.label}),b.path.split(`/`).filter(Boolean).map((e,t)=>(0,X.jsx)(Ce,{component:`button`,underline:`hover`,onClick:()=>lt(b.path.split(`/`).slice(0,t+1).join(`/`)),children:e},t))]}):null}),B&&(0,X.jsx)(E,{title:`Edit path · Ctrl/⌘+L`,children:(0,X.jsx)(P,{size:`small`,"aria-label":`Edit ${e} path`,onClick:()=>{Pe(`/`+b.path),M(!0)},children:(0,X.jsx)(it,{sx:{fontSize:18}})})}),(0,X.jsx)(E,{title:`Refresh`,children:(0,X.jsx)(P,{"data-file-retry":!0,size:`small`,"aria-label":`Refresh ${e} panel`,onClick:()=>{x(``),se(e=>e+1)},children:(0,X.jsx)(tt,{sx:{fontSize:18}})})}),(0,X.jsx)(E,{title:`Panel actions`,children:(0,X.jsx)(P,{size:`small`,"aria-label":`${e} panel actions`,onClick:e=>Oe(e.currentTarget),children:(0,X.jsx)(R,{fontSize:`small`})})})]}),B&&(0,X.jsx)(fe,{size:`small`,placeholder:`Filter loaded entries…`,"data-console-command":`search`,value:k,onChange:e=>{_e(e.target.value),O([])},slotProps:{htmlInput:{"aria-label":`Filter ${e} files`}},sx:{mx:1,my:.75}}),(0,X.jsx)(_,{sx:{height:2,flexShrink:0},children:U&&(0,X.jsx)(Ee,{"aria-label":`Loading ${e} files`})}),Je&&(0,X.jsx)(v,{severity:`error`,sx:{m:1,overflowWrap:`anywhere`},children:Je}),!B&&(0,X.jsx)(_,{sx:{flex:1,minHeight:0,overflowY:`auto`},children:Re&&!Re.error&&(b.rootId?(0,X.jsx)(v,{severity:`warning`,sx:{m:1},children:`This file area is no longer available. Refresh or open a new tab.`}):Re.roots.length?Re.roots.length>1?(0,X.jsxs)(I,{role:`group`,"aria-label":`Choose a file area`,spacing:.5,sx:{p:1.5},children:[(0,X.jsx)(j,{variant:`subtitle2`,children:`Choose a file area`}),Re.roots.map((e,t)=>(0,X.jsxs)(p,{"data-file-start":t===0||void 0,variant:`text`,"aria-label":`Open ${e.label}`,onClick:()=>st({rootId:e.id,rootLabel:e.label}),sx:{justifyContent:`flex-start`,gap:1},children:[(0,X.jsx)(rt,{fontSize:`small`}),` `,e.label,e.readOnly&&(0,X.jsx)(j,{variant:`caption`,color:`text.secondary`,children:`Read only`})]},e.id))]}):null:(0,X.jsx)(v,{severity:`info`,sx:{m:1},children:`No file areas are available on this node. Check its file access policy.`}))}),B&&(0,X.jsxs)(ct,{keyboardNavigation:!1,tabIndex:-1,label:`${e} directory entries`,sx:{flex:1,minHeight:100},children:[(0,X.jsxs)(he,{ref:D,tabIndex:i&&!C?0:-1,"data-keyboard-focus":!0,"data-file-list":!0,size:`small`,stickyHeader:!0,"aria-label":`${e} files`,sx:{tableLayout:`fixed`,"& td, & th":{px:1,py:.6},"& td:first-of-type, & th:first-of-type":{px:0},"& .MuiCheckbox-root":{p:.75},'& .MuiTableRow-root[data-cursor="true"]':{bgcolor:`action.hover`},"&:focus-visible":{outline:at===null?`2px solid`:`none`,outlineColor:`primary.main`,outlineOffset:-2},'& .MuiTableRow-root:focus-visible, &:focus-visible .MuiTableRow-root[data-cursor="true"]':{outline:`2px solid`,outlineColor:`primary.main`,outlineOffset:-2}},children:[(0,X.jsx)(Se,{children:(0,X.jsxs)(me,{children:[(0,X.jsx)(T,{padding:`checkbox`,sx:{width:40},children:(0,X.jsx)(f,{size:`small`,slotProps:{input:{"aria-label":`Select loaded ${e} entries`}},checked:W.length>0&&K.length===W.length,indeterminate:K.length>0&&K.length<W.length,onChange:(e,t)=>O(t?W.map(e=>e.path):[])})}),[`name`,`size`,`modifiedAt`].map(e=>(0,X.jsx)(T,{sx:e===`name`?{}:e===`size`?{width:80}:{width:110,display:{xs:`none`,lg:`table-cell`}},children:(0,X.jsx)(ge,{active:ye===e,direction:xe?`desc`:`asc`,onClick:()=>{ye===e?we(e=>!e):(be(e),we(!1))},children:e===`modifiedAt`?`Modified`:e===`name`?`Name`:`Size`})},e))]})}),(0,X.jsxs)(ue,{children:[We&&b.path&&(0,X.jsxs)(me,{tabIndex:-1,"data-cursor":i&&at===V(b.path)||void 0,"aria-label":`Parent directory`,onFocus:()=>S(V(b.path)),onClick:e=>{S(V(b.path)),e.currentTarget.focus()},onDoubleClick:()=>lt(V(b.path)),children:[(0,X.jsx)(T,{}),(0,X.jsx)(T,{children:(0,X.jsx)(p,{color:`inherit`,size:`small`,tabIndex:-1,"aria-label":`Open parent directory`,onClick:e=>{e.stopPropagation(),lt(V(b.path))},startIcon:(0,X.jsx)(nt,{fontSize:`small`}),sx:{minWidth:0,p:0,fontFamily:`monospace`},children:`..`})}),(0,X.jsx)(T,{}),(0,X.jsx)(T,{sx:{display:{xs:`none`,lg:`table-cell`}}})]}),W.map(e=>(0,X.jsxs)(me,{hover:!0,selected:pe.includes(e.path),tabIndex:-1,"data-cursor":i&&e.path===at||void 0,onFocus:()=>S(e.path),"aria-current":i&&e.path===at?`true`:void 0,"aria-label":`${e.kind} ${e.name}`,onClick:t=>{dt(e,t.shiftKey),t.currentTarget.focus({preventScroll:!0})},onDoubleClick:()=>ft(e),children:[(0,X.jsx)(T,{children:(0,X.jsx)(f,{size:`small`,checked:pe.includes(e.path),slotProps:{input:{"aria-label":`Select ${e.name}`,tabIndex:-1}},onClick:e=>e.stopPropagation(),onChange:()=>dt(e,!1)})}),(0,X.jsx)(T,{children:(0,X.jsxs)(I,{direction:`row`,spacing:.75,sx:{alignItems:`center`,minWidth:0},children:[e.kind===`directory`?(0,X.jsx)(rt,{sx:{fontSize:18,color:`primary.main`,flexShrink:0}}):(0,X.jsx)(j,{component:`span`,"aria-hidden":!0,sx:{fontFamily:`monospace`,fontSize:11,color:`text.disabled`,flexShrink:0},children:e.kind===`file`?`┄`:`↗`}),(0,X.jsx)(E,{title:e.name,children:(0,X.jsx)(p,{size:`small`,color:`inherit`,tabIndex:-1,onClick:t=>{t.stopPropagation(),t.currentTarget.closest(`tr`)?.focus({preventScroll:!0}),ft(e)},sx:{minWidth:0,justifyContent:`flex-start`,textTransform:`none`,fontWeight:e.kind===`directory`?600:400,overflow:`hidden`,p:0,fontSize:13},children:(0,X.jsx)(_,{component:`span`,sx:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name})})})]})}),(0,X.jsx)(T,{sx:{color:`text.secondary`,fontFamily:`monospace`,fontSize:11,whiteSpace:`nowrap`},children:e.kind===`file`?H(e.size):e.kind===`directory`?`—`:e.kind}),(0,X.jsx)(T,{sx:{display:{xs:`none`,lg:`table-cell`},color:`text.secondary`,fontSize:11},children:(0,X.jsx)(E,{title:new Date(e.modifiedAt).toLocaleString(),children:(0,X.jsx)(`span`,{children:new Date(e.modifiedAt).toLocaleDateString(void 0,{month:`short`,day:`numeric`})})})})]},e.path))]})]}),We&&!U&&!W.length&&!Je&&(0,X.jsx)(j,{variant:`body2`,color:`text.secondary`,sx:{p:3,textAlign:`center`},children:k?`No matches in loaded entries`:`Empty folder`}),Ve&&(0,X.jsx)(p,{fullWidth:!0,onClick:()=>void Ue(),disabled:U,children:`Load next 200 entries`})]}),(0,X.jsxs)(I,{direction:`row`,spacing:1,sx:{px:1.5,py:.75,alignItems:`center`,borderTop:1,borderColor:`divider`,minWidth:0},children:[(0,X.jsx)(j,{variant:`caption`,color:`text.secondary`,"aria-live":`polite`,sx:{flex:1},children:K.length?`${K.length} selected${K.every(e=>e.kind===`file`)?` · ${H(K.reduce((e,t)=>e+t.size,0))}`:``}`:We?`${W.length}${Ve?`+`:``} ${W.length===1&&!Ve?`entry`:`entries`}`:`—`}),B?.readOnly&&(0,X.jsx)(ee,{size:`small`,variant:`outlined`,label:`Read only`}),J&&(0,X.jsx)(E,{title:`This structural entry cannot be renamed or moved to trash; its ordinary children remain usable`,children:(0,X.jsx)(ee,{size:`small`,variant:`outlined`,label:`Protected`})}),(0,X.jsx)(j,{variant:`caption`,color:i?`primary.main`:`text.disabled`,sx:{textTransform:`uppercase`,letterSpacing:1.5},children:e===`left`?`A`:`B`})]}),(0,X.jsxs)(ke,{anchorEl:Te,open:!!Te,onClose:()=>Oe(null),children:[mt.map(([e,t,n])=>(0,X.jsx)(je,{disabled:n||!We||U,onClick:()=>{Oe(null),u(e)},children:t},e)),(0,X.jsxs)(je,{onClick:()=>{ve(e=>!e),O([]),Oe(null)},children:[A?`Hide`:`Show`,` hidden entries`]})]})]})}var Y,X;function St(){return(St=e((()=>{Y=t(),x(),m(),d(),h(),S(),g(),M(),we(),F(),N(),Te(),Ae(),Pe(),Oe(),L(),C(),D(),xe(),pe(),O(),be(),A(),de(),w(),J(),st(),Fe(),$e(),yt(),Xe(),o(),B(),X=n()})))()}function Ct({sourceNodeId:e,destinationNodeId:t,directoryName:n,disabled:i=!1,onChange:a}){let[o,s]=(0,wt.useState)(`files`),[c,l]=(0,wt.useState)(null),u=JSON.stringify([e,t]),d=c?.nodes===u?c.value:null,[f,m]=(0,wt.useState)(!1),[h,g]=(0,wt.useState)(!1),[_,ee]=(0,wt.useState)(0),[y,te]=(0,wt.useState)(null),[b,ne]=(0,wt.useState)(null),re=(0,wt.useRef)(a);re.current=a;let ie=o!==`files`,ae=d?.formats.filter(e=>e.outputs.includes(o===`directory`?`directory`:`archive`))??[],x=ae.find(e=>e.format===y)??ae[0],oe=b??`${n}${o===`archive`?x?.extension??``:``}`,se=Be(oe)??(o===`archive`&&x&&!oe.toLocaleLowerCase().endsWith(x.extension.toLocaleLowerCase())?`Use a filename ending in ${x.extension}`:null),ce=o===`files`||!(f||h||!x||se);return(0,wt.useEffect)(()=>{if(!ie)return;let n=!0;return l(null),m(!0),g(!1),r.archiveFormats({nodeId:e,destinationNodeId:t}).then(e=>{if(n){if(!e||!Array.isArray(e.formats)||e.formats.some(e=>!e||!mt.includes(e.format)||typeof e.label!=`string`||!Array.isArray(e.outputs)||e.outputs.some(e=>![`archive`,`directory`].includes(e))||typeof e.extension!=`string`||!/^\.[a-z0-9.]+$/i.test(e.extension))||!Array.isArray(e.limitations)||e.limitations.some(e=>typeof e!=`string`)||!Number.isFinite(Date.parse(e.observedAt)))throw Error(`Incompatible archive capabilities`);l({nodes:u,value:e})}}).catch(()=>{n&&g(!0)}).finally(()=>{n&&m(!1)}),()=>{n=!1}},[ie,e,t,u,_]),(0,wt.useEffect)(()=>{re.current({archive:o!==`files`&&x&&ce?{format:x.format,name:oe,output:o}:void 0,ready:ce})},[o,x,oe,ce]),(0,Z.jsxs)(I,{spacing:1,sx:{minWidth:0},children:[(0,Z.jsxs)(ye,{exclusive:!0,size:`small`,value:o,disabled:i,"aria-label":`Copy mode`,onChange:(e,t)=>{t&&(t===`files`&&l(null),s(t),ne(null))},sx:{flexWrap:`wrap`,"& .MuiToggleButton-root":{flex:`1 1 auto`,whiteSpace:`nowrap`}},children:[(0,Z.jsx)(ve,{value:`files`,"aria-label":`Copy files individually`,children:`Files`}),(0,Z.jsx)(ve,{value:`archive`,"aria-label":`Save archive file`,children:`Archive`}),(0,Z.jsx)(ve,{value:`directory`,"aria-label":`Transfer archive and restore folder`,children:`Pack & restore`})]}),ie&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ot,{active:f,label:`Checking archive formats on the selected nodes…`,detail:`Only verified encoders and compatible destination decoders are offered.`}),h&&(0,Z.jsx)(v,{severity:`warning`,action:(0,Z.jsx)(p,{size:`small`,disabled:i||f,onClick:()=>ee(e=>e+1),children:`Retry`}),children:`Archive capabilities are unavailable. Check node connectivity and backend support; ordinary file copy is still available.`}),d&&!ae.length&&(0,Z.jsx)(v,{severity:`info`,children:o===`directory`&&d.formats.length?`Folder restoration could not be verified for these nodes. Check destination connectivity, backend support and archive tools, or choose Archive to transfer without extraction.`:`No supported archive encoders were found on the source node.`}),ae.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(I,{direction:{xs:`column`,sm:`row`},spacing:1,children:[(0,Z.jsx)(fe,{select:!0,size:`small`,label:`Archive format`,value:x?.format??``,disabled:i||f,sx:{minWidth:150,flex:1},onChange:e=>{let t=ae.find(t=>t.format===e.target.value);t&&(te(t.format),o===`archive`&&b&&x&&b.toLocaleLowerCase().endsWith(x.extension.toLocaleLowerCase())&&ne(b.slice(0,-x.extension.length)+t.extension))},children:ae.map(e=>(0,Z.jsx)(je,{value:e.format,children:e.label},e.format))}),(0,Z.jsx)(fe,{size:`small`,label:o===`archive`?`Archive filename`:`Destination folder name`,value:oe,disabled:i||f,onChange:e=>ne(e.target.value),error:!!se,helperText:se??`One new entry in the destination folder`,sx:{flex:2,minWidth:0}})]}),(0,Z.jsx)(j,{variant:`caption`,color:`text.secondary`,children:o===`archive`?`The destination receives an archive file; it is not extracted.`:`The source is packed, transferred and restored into a new destination folder after verification.`})]}),d&&(0,Z.jsxs)(j,{variant:`caption`,color:`text.secondary`,children:[`Capabilities checked `,new Date(d.observedAt).toLocaleString()]}),d?.limitations.length?(0,Z.jsxs)(j,{component:`details`,variant:`caption`,color:`text.secondary`,children:[(0,Z.jsx)(`summary`,{children:`Limits and guarantees`}),d.limitations.map(e=>(0,Z.jsx)(j,{component:`div`,variant:`caption`,children:e},e))]}):null]})]})}var wt,Z;function Tt(){return(Tt=e((()=>{wt=t(),x(),h(),Pe(),L(),A(),k(),_e(),w(),ht(),o(),i(),q(),Z=n()})))()}function Et(e){let t=e.phase??(e.state===`planning`?`planning`:`transferring`),n={planning:`Planning`,snapshotting:`Capturing source snapshot`,archiving:`Creating archive`,transferring:`Transferring bytes`,restoring:`Restoring destination folder`,publishing:`Verifying and publishing`}[t]??`Processing transfer`,r=e.state===`planning`||e.state===`running`,i=t===`snapshotting`,a=t===`restoring`,o=i?e.preparedBytes??0:a?e.restoredBytes??0:e.bytes,s=i||a?e.sourceBytes??0:e.totalBytes,c=(i||a&&e.restoredBytes!==void 0||t===`transferring`)&&s>0;return{label:n,indeterminate:r&&!c,value:e.state===`completed`?100:c?Math.min(100,o/s*100):0,detail:i?s>0?`Snapshot ${H(o)} / ${H(s)}`:`${H(o)} captured`:a&&e.restoredBytes!==void 0?`${H(o)} / ${H(s)} restored`:e.archive&&!e.totalBytes&&e.state!==`completed`?`Transfer size is available after the archive is prepared`:`${H(e.bytes)} / ${H(e.totalBytes)} transferred · ${e.completedFiles} / ${e.totalFiles} files`}}function Dt({job:e}){let t=Et(e);return(0,Ot.jsxs)(Ot.Fragment,{children:[e.archive&&(0,Ot.jsxs)(j,{variant:`caption`,component:`div`,color:`text.secondary`,sx:{overflowWrap:`anywhere`},children:[e.archive.format,` · `,e.archive.output===`directory`?`Restore folder`:`Archive file`,` ·`,` `,e.archive.name]}),(0,Ot.jsx)(Ee,{sx:{my:1},"aria-label":e.state===`completed`?`Completed transfer`:t.label,variant:t.indeterminate?`indeterminate`:`determinate`,value:t.value}),e.publication===`partial`&&e.state!==`completed`&&(0,Ot.jsx)(j,{variant:`caption`,component:`div`,color:`warning.main`,children:e.state===`running`?`Destination folder is being published; it is not ready yet.`:`Destination folder publication is incomplete. Resume this transfer to finish before using the folder.`}),(0,Ot.jsxs)(j,{variant:`caption`,component:`div`,children:[e.state===`completed`?`Completed`:t.label,` · `,t.detail]})]})}var Ot;function kt(){return(kt=e((()=>{we(),w(),B(),Ot=n()})))()}function At({visible:e=!0}){let t=s(),n=u(t.breakpoints.down(`md`)),[i,o]=(0,Q.useState)([jt]),[c,l]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(null),m=d!==null,[h,g]=(0,Q.useState)({pending:!0}),[y,b]=(0,Q.useState)(`left`),[ne,ie]=(0,Q.useState)(50),[ae,x]=(0,Q.useState)(0),[S,le]=(0,Q.useState)({left:null,right:null}),[C,w]=(0,Q.useState)(null),[T,ue]=(0,Q.useState)(``),[de,D]=(0,Q.useState)(),[pe,me]=(0,Q.useState)(!0),[O,k]=(0,Q.useState)([]),[he,ge]=(0,Q.useState)(``),[_e,A]=(0,Q.useState)(!1),[be,xe]=(0,Q.useState)(null),[Se,Ce]=(0,Q.useState)(null),[we,Te]=(0,Q.useState)(!1),[De,Oe]=(0,Q.useState)({line:1,column:1,selected:0}),[ke,Ae]=(0,Q.useState)(!1),[M,je]=(0,Q.useState)(null),[N,Me]=(0,Q.useState)(null),Ne=(0,Q.useRef)(null),Pe=(0,Q.useRef)(null),F=(0,Q.useRef)(!1),L=(0,Q.useRef)(null),R=(0,Q.useRef)(O);R.current=O;let z=Je(()=>r.transfers(),{intervalMs:2e3,enabled:e}),Fe=(z.data??[]).filter(e=>[`running`,`planning`].includes(e.state)),Ie=(z.data??[]).filter(e=>e.cleanupPending||![`completed`,`cancelled`].includes(e.state)),Le=S[y],B=S[y===`left`?`right`:`left`],V=O.find(e=>e.id===he),ze=(z.data??[]).filter(e=>e.state===`completed`).map(e=>e.id).join(`,`),He=(0,Q.useRef)(!0),Ye=(0,Q.useRef)(!1),Xe=(0,Q.useCallback)(async()=>{g({pending:!0});try{let e=await a.listNodes();He.current&&(o([jt,...e.filter(e=>!e.isLocal&&e.id!==jt.id).map(e=>({id:e.id,name:e.name,host:e.host,isLocal:!1}))]),g({pending:!1}))}catch(e){He.current&&g({pending:!1,error:Ke(e)})}},[]);(0,Q.useEffect)(()=>(He.current=!0,Xe(),()=>{He.current=!1,F.current=!0}),[Xe]),(0,Q.useEffect)(()=>{x(e=>e+1)},[ze]),(0,Q.useEffect)(()=>{let e=e=>{(R.current.some(e=>e.text!==e.document.content)||N)&&(e.preventDefault(),e.returnValue=``)};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[N]);let Ze=async(e,t)=>{if(!Ye.current){Ye.current=!0,f(e),l(``);try{await t()}catch(e){l(Ke(e))}finally{Ye.current=!1,He.current&&f(null)}}},$e=()=>x(e=>e+1),tt=e=>{b(e),requestAnimationFrame(()=>{let t=L.current?.querySelector(`[data-file-side="${e}"]`);(t?.querySelector(`tr[data-cursor="true"]`)??t?.querySelector(`[data-keyboard-focus], [data-file-start]`)??t?.querySelector(`[data-file-add]:not(:disabled), [data-file-retry]`))?.focus({preventScroll:!0})})},nt=e=>i.find(t=>t.id===e)?.name??e,rt=e=>`${nt(e.nodeId)} / ${e.rootId} / ${e.path}`,it=async(e,t,n)=>Ze(`Opening ${t.path}`,async()=>{let e=JSON.stringify(t);if(!R.current.find(t=>t.id===e)){if(R.current.length>=8)throw Error(`Close a document before opening another (8 buffers per workspace)`);let i=await r.readText(t);k(r=>[...r,{id:e,location:t,document:i,text:i.content,readOnly:n,revision:0}])}ge(e),A(!0)}),at=e=>Ze(`Saving ${e.location.path}`,async()=>{if(e.readOnly||U(e.text)===`mixed`)throw Error(`This buffer is read only`);let t=await r.saveText({...e.location,content:e.text,version:e.document.version,bom:e.document.bom});k(n=>n.map(n=>n.id===e.id?{...n,document:t}:n)),$e()}),K=(e,t=!1)=>{let n=R.current.find(t=>t.id===e);if(!t&&n&&n.text!==n.document.content){xe(e);return}let r=R.current.filter(t=>t.id!==e);k(r),e===he&&ge(r[0]?.id??``),r.length||A(!1),xe(null)},q=(e,t)=>{let n=S[e];if(!n)return;if((t===`rename`||t===`trash`)&&n.entries.some(e=>Ge(e.path,n.root.protectedPaths))){l(`This structural path is protected from rename and removal`);return}let i=S[e===`left`?`right`:`left`];b(e),t===`upload`?(Pe.current=n,Ne.current?.click()):t===`download`?lt(n):t===`trashList`?Ze(`Loading trash`,async()=>je({pane:n,items:await r.trashList(n.location)})):(ue(t===`rename`?n.entries[0]?.name??``:``),D(void 0),me(!0),w({action:t,pane:n,...i?{destination:i}:{}}))},st=()=>Ze(C?.action===`copy`?`Preparing file transfer`:C?.action===`trash`?`Moving files to trash`:`Saving file changes`,async()=>{if(!C)return;let{pane:e}=C;if(C.action===`copy`){if(!pe)throw Error(`Wait for compatible archive capabilities and enter a valid destination name`);if(!C.destination||C.destination.root.readOnly)throw Error(`Select a writable destination in the other panel`);await r.copy({sources:e.entries.map(t=>({...e.location,path:t.path,version:t.version})),destination:C.destination.location,...de&&{archive:de}}),Ae(!0),await z.refresh()}else if(C.action===`trash`)for(let t of e.entries)await r.trash({...e.location,path:t.path,version:t.version});else{let t=We(e.location.path,Ve(T));if(C.action===`mkdir`&&await r.mkdir({...e.location,path:t}),C.action===`rename`){let n=e.entries[0],i={...e.location,path:n.path,version:n.version},a=R.current.map(e=>qe(e,i,{path:t,version:n.version}));if(new Set(a.map(e=>e.id)).size!==a.length)throw Error(`Close the open destination document before renaming`);let o=await r.rename({...i,destination:t}),s=R.current.find(e=>e.id===he);s&&ge(qe(s,i,o).id),k(e=>e.map(e=>qe(e,i,o)))}(C.action===`create`||C.action===`saveCopy`)&&await r.saveText({...e.location,path:t,content:C.buffer?.text??``,version:null,bom:C.buffer?.document.bom??!1})}w(null),$e()}),ct=async e=>{let t=Pe.current;if(!t||N)return;let n,i=!1;F.current=!1,l(``),Me({label:`Upload ${e.name}`,bytes:0,total:e.size,committing:!1});try{n=crypto.randomUUID(),n=(await r.beginUpload({id:n,...t.location,path:We(t.location.path,Ve(e.name)),size:e.size})).id;for(let i=0;i<e.size;){if(F.current)throw Error(`Upload cancelled`);let a=new Uint8Array(await e.slice(i,i+262144).arrayBuffer());i=(await r.uploadChunk({nodeId:t.location.nodeId,id:n,offset:i,...await Ue(a)})).offset,Me({label:`Upload ${e.name}`,bytes:i,total:e.size,committing:!1})}if(F.current)throw Error(`Upload cancelled`);i=!0,Me({label:`Publishing ${e.name}`,bytes:e.size,total:e.size,committing:!0}),await r.finishUpload({nodeId:t.location.nodeId,id:n}),await r.acknowledgeUpload({nodeId:t.location.nodeId,id:n}).catch(()=>void 0),$e()}catch(e){if(n&&!i)try{await r.abortUpload({nodeId:t.location.nodeId,id:n})}catch{l(`Upload interrupted; staging receipt ${n} requires reconciliation`);return}l(`${Ke(e)}${n&&i?` · Publication outcome unknown; receipt ${n}. Do not upload a replacement until checked.`:``}`)}finally{Me(null)}},lt=async e=>{let t=e.entries[0];if(t&&!N){if(t.size>33554432)l(`Browser downloads are limited to 32 MiB. Use server-to-server copy or the CLI for larger files.`);else{F.current=!1,l(``),Me({label:`Download ${t.name}`,bytes:0,total:t.size,committing:!1});try{let n=[],i=0;for(;i<t.size;){if(F.current)throw Error(`Download cancelled`);let a=await r.readChunk({...e.location,path:t.path,version:t.version,offset:i}),o=Uint8Array.from(atob(a.data),e=>e.charCodeAt(0));if(!o.length||a.offset!==i||(await Ue(o)).sha256!==a.sha256)throw Error(`Download checksum or sequence mismatch`);n.push(o.buffer),i+=o.length,Me({label:`Download ${t.name}`,bytes:i,total:t.size,committing:!1})}let a=URL.createObjectURL(new Blob(n,{type:`application/octet-stream`})),o=document.createElement(`a`);o.href=a,o.download=t.name,o.click(),setTimeout(()=>URL.revokeObjectURL(a),3e4)}catch(e){l(Ke(e))}finally{Me(null)}}}},dt=(0,Q.useRef)(C);C&&(dt.current=C);let J=C??dt.current,mt=C&&[`mkdir`,`rename`,`create`,`saveCopy`].includes(C.action),ht=mt?Be(T):null;return(0,$.jsxs)(_,{sx:{display:`flex`,flexDirection:`column`,flex:1,minHeight:0,minWidth:0,gap:1,"@media (max-height: 600px)":{overflowY:`auto`}},children:[(0,$.jsx)(ut,{heading:`Files`,active:e,links:[{name:`Files`}],action:(0,$.jsxs)(I,{direction:`row`,spacing:.5,useFlexGap:!0,role:`toolbar`,"aria-label":`File actions`,sx:{alignItems:`center`},children:[n&&(0,$.jsxs)(ye,{exclusive:!0,size:`small`,value:y,"aria-label":`Visible file panel`,onChange:(e,t)=>{t&&tt(t)},children:[(0,$.jsx)(ve,{value:`left`,children:`A`}),(0,$.jsx)(ve,{value:`right`,children:`B`})]}),(0,$.jsx)(E,{title:`Copy ${y===`left`?`A → B`:`B → A`} · ${B?rt(B.location):`Choose a destination`} · F5`,children:(0,$.jsx)(`span`,{children:(0,$.jsx)(p,{size:`small`,variant:`outlined`,startIcon:(0,$.jsx)(G,{fontSize:`small`}),"aria-label":y===`left`?`Copy A to B`:`Copy B to A`,disabled:!Le?.entries.length||!B||B.root.readOnly||m,onClick:()=>q(y,`copy`),sx:{minWidth:72,fontFamily:`monospace`},children:y===`left`?`A → B`:`B → A`})})}),(0,$.jsx)(E,{title:`New folder in panel ${y===`left`?`A`:`B`}`,children:(0,$.jsx)(`span`,{children:(0,$.jsx)(P,{size:`small`,"aria-label":`New folder`,disabled:!Le||Le.root.readOnly||m,onClick:()=>q(y,`mkdir`),children:(0,$.jsx)(et,{fontSize:`small`})})})}),(0,$.jsx)(E,{title:`Upload from this computer to panel ${y===`left`?`A`:`B`}`,children:(0,$.jsx)(`span`,{children:(0,$.jsx)(P,{size:`small`,"aria-label":`Upload from this computer`,disabled:!Le||Le.root.readOnly||!!N,onClick:()=>q(y,`upload`),children:(0,$.jsx)(Qe,{fontSize:`small`})})})}),!n&&(0,$.jsx)(E,{title:`Focus panel ${y===`left`?`B`:`A`} · Tab inside a file list`,children:(0,$.jsx)(P,{size:`small`,"aria-label":`Focus panel ${y===`left`?`B`:`A`}`,onClick:()=>tt(y===`left`?`right`:`left`),children:(0,$.jsx)(W,{fontSize:`small`})})}),O.length>0&&(0,$.jsxs)(p,{size:`small`,onClick:()=>A(!0),children:[`Editor · `,O.length,O.some(e=>e.text!==e.document.content)?` •`:``]}),(0,$.jsxs)(p,{size:`small`,variant:Ie.length?`outlined`:`text`,onClick:()=>Ae(!0),children:[`Transfers`,Ie.length?` · ${Ie.length}`:``]})]})}),c&&(0,$.jsx)(v,{severity:`error`,onClose:()=>l(``),sx:{overflowWrap:`anywhere`},children:c}),(0,$.jsx)(ot,{active:m&&!C&&!_e&&!M&&!ke,label:d??``}),z.error&&(0,$.jsxs)(v,{severity:`warning`,children:[`Transfer status unavailable: `,z.error]}),N&&(0,$.jsxs)(_,{role:`status`,children:[(0,$.jsxs)(I,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[(0,$.jsxs)(j,{variant:`caption`,sx:{flex:1},children:[N.label,` · `,H(N.bytes),` / `,H(N.total),N.committing?` · confirming publication`:``]}),(0,$.jsx)(p,{size:`small`,disabled:N.committing,onClick:()=>{F.current=!0},children:`Cancel`})]}),(0,$.jsx)(Ee,{variant:N.committing?`indeterminate`:`determinate`,value:N.total?N.bytes/N.total*100:0})]}),(0,$.jsxs)(_,{ref:L,sx:{display:`flex`,flex:1,minWidth:0,minHeight:240,overflow:`hidden`},children:[(0,$.jsx)(_,{sx:{display:n&&y!==`left`?`none`:`flex`,flex:n?1:`0 0 ${ne}%`,minWidth:0,minHeight:0},children:(0,$.jsx)(xt,{side:`left`,visible:e,hosts:i,discovery:h,retryDiscovery:Xe,active:y===`left`,hidden:!1,refreshKey:ae,onFocus:()=>b(`left`),onSwitchPanel:()=>tt(`right`),onSelection:e=>le(t=>({...t,left:e})),onOpen:(...e)=>void it(...e),onAction:e=>q(`left`,e)})}),!n&&(0,$.jsx)(_,{role:`separator`,"aria-label":`Panel width`,"aria-orientation":`vertical`,"aria-valuemin":30,"aria-valuemax":70,"aria-valuenow":ne,tabIndex:0,onKeyDown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),ie(t=>Math.max(30,Math.min(70,t+(e.key===`ArrowLeft`?-2:2)))))},onPointerDown:e=>e.currentTarget.setPointerCapture(e.pointerId),onPointerMove:e=>{if(!e.currentTarget.hasPointerCapture(e.pointerId))return;let t=L.current.getBoundingClientRect();ie(Math.max(30,Math.min(70,(e.clientX-t.left)/t.width*100)))},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},sx:{width:8,flexShrink:0,cursor:`col-resize`,touchAction:`none`,"&:hover, &:focus-visible":{bgcolor:`action.hover`,outlineColor:`primary.main`}}}),(0,$.jsx)(xt,{side:`right`,visible:e,hosts:i,discovery:h,retryDiscovery:Xe,active:y===`right`,hidden:n&&y!==`right`,refreshKey:ae,onFocus:()=>b(`right`),onSwitchPanel:()=>tt(`left`),onSelection:e=>le(t=>({...t,right:e})),onOpen:(...e)=>void it(...e),onAction:e=>q(`right`,e)})]}),Fe.length>0&&(0,$.jsxs)(p,{size:`small`,onClick:()=>Ae(!0),sx:{justifyContent:`flex-start`},children:[(0,$.jsx)(_,{sx:{width:80,mr:1},children:(0,$.jsx)(Ee,{})}),Fe.length,` active transfer`,Fe.length===1?``:`s`]}),(0,$.jsx)(`input`,{ref:Ne,type:`file`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&ct(t),e.target.value=``}}),(0,$.jsxs)(re,{open:!!mt,onClose:()=>{m||w(null)},fullWidth:!0,maxWidth:`xs`,children:[(0,$.jsx)(se,{children:J?.action===`mkdir`?`New folder`:J?.action===`rename`?`Rename`:J?.action===`saveCopy`?`Save a copy`:`New file`}),(0,$.jsxs)(te,{children:[(0,$.jsx)(ot,{active:m,label:d??``}),(0,$.jsx)(j,{variant:`caption`,sx:{display:`block`,mb:2,overflowWrap:`anywhere`},children:C&&rt(C.pane.location)}),c&&(0,$.jsx)(v,{severity:`error`,sx:{mb:1},children:c}),(0,$.jsx)(fe,{autoFocus:!0,fullWidth:!0,label:`Name`,value:T,onChange:e=>ue(e.target.value),error:!!(T&&ht),helperText:T&&ht?ht:`One name in the current folder`,onFocus:e=>e.target.select(),onKeyDown:e=>{e.key===`Enter`&&!ht&&!m&&st()}})]}),(0,$.jsxs)(oe,{children:[(0,$.jsx)(p,{onClick:()=>w(null),disabled:m,children:`Cancel`}),(0,$.jsx)(p,{variant:`contained`,loading:m,disabled:!!ht||m,onClick:()=>void st(),children:`Apply`})]})]}),(0,$.jsx)(ft,{open:!(!C||mt),onClose:()=>{m||w(null)},loading:m,title:J?.action===`copy`?`Copy to destination`:`Move to trash`,confirmLabel:J?.action===`copy`?`Start copy`:`Move to trash`,confirmColor:J?.action===`copy`?`primary`:`warning`,disabled:C?.action===`copy`&&(!C.destination||C.destination.root.readOnly||!pe),onConfirm:st,content:(0,$.jsxs)(I,{spacing:1,children:[(0,$.jsx)(ot,{active:m,label:d??``}),(0,$.jsx)(j,{variant:`body2`,sx:{overflowWrap:`anywhere`},children:J&&rt(J.pane.location)}),(0,$.jsx)(_,{sx:{maxHeight:160,overflow:`auto`},children:J?.pane.entries.map(e=>(0,$.jsx)(j,{variant:`body2`,sx:{fontFamily:`monospace`,overflowWrap:`anywhere`},children:e.name},e.path))}),J?.action===`copy`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(j,{variant:`body2`,sx:{overflowWrap:`anywhere`,fontWeight:600},children:[`→`,` `,J.destination?rt(J.destination.location):`Select the other panel destination`]}),J.destination&&J.pane.entries.length===1&&J.pane.entries[0]?.kind===`directory`&&(0,$.jsx)(Ct,{sourceNodeId:J.pane.location.nodeId,destinationNodeId:J.destination.location.nodeId,directoryName:J.pane.entries[0].name,disabled:m,onChange:e=>{D(e.archive),me(e.ready)}},`${JSON.stringify(J.pane.location)}:${J.pane.entries[0].path}:${JSON.stringify(J.destination.location)}`),(0,$.jsx)(j,{variant:`caption`,color:`text.secondary`,children:de?`Verifies the snapshot before publication and reserves a new destination entry without replacing existing files or folders.`:`Existing files are never overwritten. Completed files remain if a later file fails or the transfer is cancelled.`})]}):(0,$.jsx)(j,{variant:`body2`,children:`Items can be restored from this panel’s trash menu. Space is retained on the source node.`}),c&&(0,$.jsx)(v,{severity:`error`,children:c})]})}),(0,$.jsxs)(ce,{anchor:`right`,open:ke&&e,onClose:()=>Ae(!1),slotProps:{paper:{sx:{width:{xs:`100%`,sm:440},maxWidth:`100%`}}},children:[(0,$.jsxs)(I,{direction:`row`,sx:{p:2,alignItems:`center`},children:[(0,$.jsx)(j,{sx:{flex:1,fontWeight:600},children:`Transfers`}),(0,$.jsx)(P,{"aria-label":`Close transfers`,onClick:()=>Ae(!1),children:(0,$.jsx)(Re,{})})]}),(0,$.jsx)(j,{variant:`caption`,color:`text.secondary`,sx:{px:2,pb:2},children:`Node transfers run in daemon. Interrupted jobs resume only on your command.`}),(0,$.jsx)(_,{sx:{px:2},children:(0,$.jsx)(ot,{active:m,label:d??``})}),z.error&&(0,$.jsx)(v,{severity:`error`,children:z.error}),c&&(0,$.jsx)(v,{severity:`error`,children:c}),z.loading&&!z.data&&(0,$.jsx)(_,{sx:{px:2},children:(0,$.jsx)(ot,{active:!0,label:`Loading transfers`})}),z.data?.length===0&&(0,$.jsx)(j,{color:`text.secondary`,sx:{p:2},children:`No transfers yet`}),(z.data??[]).map(e=>(0,$.jsxs)(_,{sx:{p:2,borderTop:1,borderColor:`divider`,overflowWrap:`anywhere`},children:[(0,$.jsxs)(I,{direction:`row`,spacing:1,sx:{alignItems:`center`,mb:1},children:[(0,$.jsx)(j,{variant:`body2`,sx:{flex:1},children:e.source.map(e=>e.path.split(`/`).at(-1)).join(`, `)}),(0,$.jsx)(ee,{size:`small`,variant:`outlined`,color:e.cleanupPending||e.state===`failed`||e.state===`interrupted`?`warning`:e.state===`completed`?`success`:`default`,label:e.state})]}),(0,$.jsxs)(j,{variant:`caption`,color:`text.secondary`,children:[e.source.map(e=>nt(e.nodeId)).filter((e,t,n)=>n.indexOf(e)===t).join(`, `),` `,`→ `,rt(e.destination)]}),(0,$.jsx)(Dt,{job:e}),e.currentPath&&(0,$.jsx)(j,{variant:`caption`,sx:{display:`block`},color:`text.secondary`,children:e.currentPath}),e.error&&(0,$.jsx)(v,{severity:`warning`,sx:{mt:1},children:e.error}),(0,$.jsxs)(I,{direction:`row`,spacing:1,children:[[`running`,`planning`].includes(e.state)&&(0,$.jsx)(p,{size:`small`,disabled:m,onClick:()=>void Ze(`Pausing transfer`,async()=>{await r.controlTransfer({id:e.id,action:`pause`}),await z.refresh()}),children:`Pause`}),(e.cleanupPending||[`paused`,`failed`,`interrupted`].includes(e.state))&&(0,$.jsx)(p,{size:`small`,disabled:m,onClick:()=>void Ze(e.cleanupPending?`Cleaning up transfer data`:`Resuming transfer`,async()=>{await r.controlTransfer({id:e.id,action:`resume`}),await z.refresh()}),children:e.cleanupPending?`Retry cleanup`:`Resume`}),![`completed`,`cancelled`].includes(e.state)&&(0,$.jsx)(p,{size:`small`,disabled:m,onClick:()=>void Ze(`Cancelling transfer`,async()=>{await r.controlTransfer({id:e.id,action:`cancel`}),await z.refresh(),$e()}),children:`Cancel`})]})]},e.id))]}),(0,$.jsxs)(re,{open:!!M&&e,onClose:()=>je(null),fullWidth:!0,maxWidth:`sm`,children:[(0,$.jsx)(se,{children:`Restore from trash`}),(0,$.jsxs)(te,{children:[(0,$.jsx)(ot,{active:m,label:d??``}),c&&(0,$.jsx)(v,{severity:`error`,children:c}),!M?.items.length&&(0,$.jsx)(j,{color:`text.secondary`,children:`Trash is empty`}),M?.items.map(e=>(0,$.jsxs)(I,{direction:`row`,spacing:1,sx:{alignItems:`center`,py:1},children:[(0,$.jsxs)(_,{sx:{flex:1,minWidth:0},children:[(0,$.jsx)(j,{variant:`body2`,sx:{overflowWrap:`anywhere`},children:e.path}),(0,$.jsx)(j,{variant:`caption`,color:`text.secondary`,children:new Date(e.removedAt).toLocaleString()})]}),(0,$.jsx)(p,{disabled:m,onClick:()=>void Ze(`Restoring file`,async()=>{await r.restore({nodeId:M.pane.location.nodeId,id:e.id}),je({...M,items:await r.trashList(M.pane.location)}),$e()}),children:`Restore`})]},e.id))]}),(0,$.jsx)(oe,{children:(0,$.jsx)(p,{onClick:()=>je(null),children:`Close`})})]}),(0,$.jsxs)(re,{open:_e&&e&&!!V,"aria-label":`File editor`,onClose:()=>A(!1),fullScreen:n,maxWidth:`xl`,fullWidth:!0,keepMounted:!0,slotProps:{paper:{sx:{height:n?`100%`:`86dvh`,minHeight:0,overflow:`hidden`}}},children:[(0,$.jsxs)(I,{"data-keyboard-region":`Editor tabs`,direction:`row`,spacing:1,sx:{px:1,alignItems:`center`,borderBottom:1,borderColor:`divider`,minWidth:0},children:[(0,$.jsx)(_,{sx:{flex:1,minWidth:0},children:(0,$.jsx)(pt,{value:he,onChange:ge,onClose:e=>K(e),variant:`scrollable`,scrollButtons:`auto`,"aria-label":`Open files`,tabs:O.map(e=>({value:e.id,label:`${e.location.path.split(`/`).at(-1)}${e.text===e.document.content?``:` •`}`,closable:!0,closeDisabled:m,closeLabel:`Close file ${e.location.path}`}))})}),(0,$.jsx)(E,{title:`Minimize editor; buffers stay open`,children:(0,$.jsx)(P,{"aria-label":`Minimize editor`,onClick:()=>A(!1),children:(0,$.jsx)(Re,{})})})]}),V&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(I,{"data-keyboard-region":`Editor tools`,direction:`row`,spacing:1,sx:{p:1,alignItems:`center`,flexWrap:`wrap`,gap:.5},children:[(0,$.jsx)(j,{variant:`caption`,sx:{flex:1,minWidth:160,overflowWrap:`anywhere`,fontFamily:`monospace`},children:rt(V.location)}),(0,$.jsx)(ee,{size:`small`,variant:`outlined`,label:V.readOnly?`Read only`:V.text===V.document.content?`Saved`:`Unsaved`}),(0,$.jsx)(p,{size:`small`,disabled:m||V.readOnly||U(V.text)===`mixed`,onClick:()=>{A(!1),ue(V.location.path.split(`/`).at(-1)+`.copy`),w({action:`saveCopy`,pane:{location:{...V.location,path:V.location.path.split(`/`).slice(0,-1).join(`/`)},root:{id:V.location.rootId,label:V.location.rootId,readOnly:!1},entries:[]},buffer:V})},children:`Save copy`}),(0,$.jsx)(p,{size:`small`,disabled:m,onClick:()=>Ce(V.id),children:`Reload`}),(0,$.jsx)(ve,{size:`small`,value:`wrap`,selected:we,onChange:()=>Te(e=>!e),"aria-label":`Wrap long lines`,children:`Wrap`}),(0,$.jsx)(p,{size:`small`,variant:`contained`,loading:d?.startsWith(`Saving `)??!1,disabled:m||V.readOnly||V.text===V.document.content||U(V.text)===`mixed`,onClick:()=>void at(V),children:`Save`})]}),(0,$.jsx)(_,{sx:{px:1},children:(0,$.jsx)(ot,{active:m,label:d??``})}),c&&(0,$.jsx)(v,{severity:`error`,onClose:()=>l(``),children:c}),U(V.text)===`mixed`&&(0,$.jsx)(v,{severity:`info`,children:`Mixed line endings: preview is read only to preserve the original bytes.`})]}),(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Ee,{}),children:O.map(t=>(0,$.jsx)(_,{sx:{display:t.id===he?`flex`:`none`,flex:1,minHeight:0,minWidth:0},children:(0,$.jsx)(Mt,{initial:t.text,name:t.location.path,readOnly:t.readOnly,active:_e&&e&&t.id===he,wrap:we,onPosition:e=>{t.id===he&&Oe(e)},onChange:e=>k(n=>n.map(n=>n.id===t.id?{...n,text:e}:n)),onSave:()=>{let e=R.current.find(e=>e.id===t.id);e&&!m&&e.text!==e.document.content&&at(e)}},`${t.id}:${t.revision}`)},t.id))}),(0,$.jsxs)(j,{variant:`caption`,color:`text.secondary`,sx:{px:2,py:.5,borderTop:1,borderColor:`divider`},children:[`Ln `,De.line,`, Col `,De.column,De.selected?` · ${De.selected} selected`:``,` · UTF-8`,V?.document.bom?` BOM`:``,` · `,V?H(new TextEncoder().encode(V.text).length):``,` `,`· Ctrl/⌘+S save · Ctrl/⌘+F find · changes checked against the file version`]})]}),(0,$.jsx)(ft,{open:!!Se,title:`Reload the saved file?`,content:`This replaces the editor buffer with the current file on the node. Unsaved text will be discarded.`,confirmLabel:`Reload`,loading:m,onClose:()=>Ce(null),onConfirm:()=>Ze(`Reloading saved file`,async()=>{let e=R.current.find(e=>e.id===Se);if(!e)return;let t=await r.readText(e.location);k(n=>n.map(n=>n.id===e.id?{...n,document:t,text:t.content,revision:n.revision+1}:n)),Ce(null)})}),(0,$.jsx)(ft,{open:!!be,title:`Discard unsaved changes?`,content:`The saved file will remain unchanged. This editor buffer will be closed.`,confirmLabel:`Discard`,confirmColor:`warning`,onClose:()=>xe(null),onConfirm:()=>{be&&K(be,!0)}})]})}var Q,$,jt,Mt;function Nt(){return(Nt=e((()=>{q(),Q=t(),x(),m(),h(),g(),ne(),ie(),b(),y(),ae(),M(),we(),L(),A(),k(),_e(),de(),w(),c(),l(),J(),dt(),Fe(),$e(),o(),lt(),St(),Tt(),kt(),B(),i(),Ye(),$=n(),at(),jt={id:`local`,name:`Local`,host:`daemon`,isLocal:!0},Mt=(0,Q.lazy)(()=>K(()=>import(`./code-editor-DK6Tmmxv.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])))})))()}Nt();export{At as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-editor-JVuQ4m-z.js","assets/rolldown-runtime-CNOWq4Kh.js","assets/react-BN8qLIAi.js","assets/mui-BTN91yBK.js","assets/mui-agG5dued.js","assets/services-BddvcFi8.js","assets/mui-Bdr6Ks5j.js","assets/client-CgyTwq9g.js","assets/mui-SNRRJ_vi.js","assets/mui-B3fJdIMc.js","assets/mui-CMWGTMXv.js","assets/mui-CPEkFAPo.js","assets/popper-m_9b0JRf.js","assets/context-FIuwpd9_.js","assets/model-ZEXEHm0l.js","assets/preload-helper-DzCYNvzR.js","assets/dist-BUDn8hLh.js","assets/dist-De9Fty7a.js"])))=>i.map(i=>d[i]);
2
+ import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{d as r,h as i,y as a}from"./client-CgyTwq9g.js";import{n as o}from"./services-BddvcFi8.js";import{_n as s,a as c,gn as l,o as u}from"./mui-Bdr6Ks5j.js";import{B as d,C as f,F as p,H as m,I as h,Q as g,V as _,Z as ee,at as v,c as y,d as te,f as b,g as ne,h as re,m as ie,n as ae,ot as x,p as oe,s as se,t as ce,w as S,z as le}from"./mui-SNRRJ_vi.js";import{A as C,B as w,C as T,D as ue,F as E,I as de,O as D,a as fe,b as pe,d as me,f as O,i as k,k as he,l as ge,n as _e,o as A,r as ve,t as ye,u as be,w as xe,y as Se,z as j}from"./mui-B3fJdIMc.js";import{C as Ce,E as we,Q as Te,T as Ee,Z as De,ct as Oe,d as ke,f as Ae,it as M,l as je,m as N,p as Me,rt as P,st as Ne,u as Pe,w as F}from"./mui-CMWGTMXv.js";import{_ as I,v as L}from"./mui-CPEkFAPo.js";import{b as R,i as z,j as Fe,r as Ie,t as Le,u as Re}from"./controls-CqeGPnaF.js";import{a as B,c as V,d as ze,f as Be,i as Ve,l as He,n as Ue,o as We,p as Ge,r as H,s as U,t as Ke,u as qe}from"./model-ZEXEHm0l.js";import{n as Je,t as Ye}from"./use-polled-resource-B22hhr5L.js";import{n as Xe,r as Ze}from"./console-keyboard-uSLt92dB.js";import{$ as Qe,G as $e,J as et,M as tt,X as W,Y as nt,_ as rt,h as it,q as G}from"./icons-B9Ct8PJ9.js";import{n as at,t as K}from"./preload-helper-DzCYNvzR.js";import{n as q,t as ot}from"./operation-status-DHyYOT7G.js";import{n as st,t as ct}from"./table-viewport-DdZ1yAKm.js";import{n as lt,t as ut}from"./page-breadcrumbs-3R8RZ3nA.js";import{n as dt,t as ft}from"./confirm-dialog-BayExVbF.js";import{n as pt,r as J}from"./tabs-DGqBkXh_.js";var mt;function ht(){return(ht=e((()=>{mt=[`tar`,`tar.gz`,`tar.bz2`,`tar.xz`,`tar.zst`,`zip`,`7z`]})))()}function gt(e,t,n,i){let a=JSON.stringify([e,t.nodeId,n]),o=JSON.stringify([a,t.rootId,t.path,i]),[s,c]=(0,_t.useState)(null),[l,u]=(0,_t.useState)(null),[d,f]=(0,_t.useState)(null),p=(0,_t.useRef)(null),m=(0,_t.useRef)(0),h=s?.key===a?s:null,g=h?.roots.find(e=>e.id===t.rootId),_=g&&l?.key===o?l:null;return(0,_t.useEffect)(()=>{let e=!0;return c(null),r.roots({nodeId:t.nodeId}).then(t=>{if(t.protocol!==1)throw Error(`Node requires a compatible file protocol`);e&&c({key:a,roots:t.roots})}).catch(t=>{e&&c({key:a,roots:[],error:Ke(t)})}),()=>{e=!1}},[a,t.nodeId]),(0,_t.useEffect)(()=>{let e=++m.current;return u(null),p.current=null,f(null),g&&r.list(t).then(t=>{e===m.current&&u({key:o,entries:t.entries,revision:t.revision,next:t.next})}).catch(t=>{e===m.current&&u({key:o,entries:[],revision:``,next:null,error:Ke(t)})}),()=>{m.current=e+1}},[o,t,g]),{policy:h,root:g,entries:_?.entries??vt,next:_?.next,more:async()=>{if(!_?.next||_.error||p.current===o)return;let e=m.current;p.current=o,f(o);try{let n=await r.list({...t,after:_.next,revision:_.revision});e===m.current&&u({..._,entries:[..._.entries,...n.entries],next:n.next})}catch(t){e===m.current&&u({..._,error:Ke(t)})}finally{e===m.current&&(p.current=null,f(null))}},ready:!(!_||_.error),loading:!h||!(!g||_&&d!==o),error:h?.error||_?.error}}var _t,vt;function yt(){return(yt=e((()=>{_t=t(),i(),B(),vt=[]})))()}function bt(e){return{id:crypto.randomUUID(),nodeId:e,rootId:``,path:``,history:[``],cursor:0}}function xt({side:e,hosts:t,discovery:n,retryDiscovery:r,active:i,hidden:a,refreshKey:o,onFocus:s,onSelection:c,onOpen:l,onAction:u,onSwitchPanel:d,visible:m=!0}){let[h,g]=(0,Y.useState)(()=>[bt(`local`)]),[y,te]=(0,Y.useState)(h[0].id),b=h.find(e=>e.id===y)??h[0],[ne,re]=(0,Y.useState)(null),ie=(0,Y.useRef)(null),[ae,x]=(0,Y.useState)(``),[oe,se]=(0,Y.useState)(0),[ce,S]=(0,Y.useState)(null),[C,w]=(0,Y.useState)(!1),de=(0,Y.useRef)(!1),D=(0,Y.useRef)(null),[pe,O]=(0,Y.useState)([]),[k,_e]=(0,Y.useState)(``),[A,ve]=(0,Y.useState)(!1),[ye,be]=(0,Y.useState)(`name`),[xe,we]=(0,Y.useState)(!1),[Te,Oe]=(0,Y.useState)(null),[Ae,M]=(0,Y.useState)(!1),[N,Pe]=(0,Y.useState)(``),F=(0,Y.useRef)(null),L=(0,Y.useRef)(null),Fe=(0,Y.useMemo)(()=>({nodeId:b.nodeId,rootId:b.rootId,path:b.path}),[b.nodeId,b.rootId,b.path]),{policy:Re,root:B,entries:Be,next:Ve,more:Ue,ready:We,loading:U,error:qe}=gt(b.id,Fe,oe,o),Je=qe||ae,Ye=Re?.roots.length===1?Re.roots[0]:void 0;(0,Y.useEffect)(()=>{!b.rootId&&Ye&&g(e=>e.map(e=>e.id===b.id&&!e.rootId?{...e,rootId:Ye.id,rootLabel:Ye.label}:e))},[Ye,b.id,b.rootId]);let Xe=e=>{te(e),O([]),S(null),F.current=null,_e(``),M(!1),x(``)},Qe=e=>t.find(t=>t.id===e)?.name??e,$e=e=>[Qe(e.nodeId),e.path.split(`/`).at(-1)||(e.rootLabel===`Filesystem`?``:e.rootLabel)].filter(Boolean).join(` · `),et=(0,Y.useRef)(c);et.current=c;let W=(0,Y.useMemo)(()=>ze(Be,k,A,ye,xe),[Be,k,A,ye,xe]),G=We&&b.path?[{name:`..`,path:V(b.path),kind:`parent`},...W]:W,at=G.some(e=>e.path===ce)?ce:G[0]?.path??null,K=(0,Y.useMemo)(()=>W.filter(e=>pe.includes(e.path)),[W,pe]),q=(0,Y.useMemo)(()=>K.length?K:W.filter(e=>e.path===at),[W,K,at]),ot=(e,t=!1)=>{let n=G[Math.max(0,Math.min(G.length-1,e))];if(!n)return;if(t){F.current??=at;let e=G.findIndex(e=>e.path===F.current),t=G.indexOf(n);O(G.slice(Math.min(Math.max(0,e),t),Math.max(e,t)+1).filter(e=>e.kind!==`parent`).map(e=>e.path))}else F.current=n.path;S(n.path);let r=D.current?.querySelectorAll(`tbody > tr`)[G.indexOf(n)];r?.focus({preventScroll:!0}),r?.scrollIntoView?.({block:`nearest`})},st=e=>g(t=>t.map(t=>t.id===b.id?{...t,...e}:t)),lt=e=>{B&&(x(``),st({path:e,history:[...b.history.slice(0,b.cursor+1),e].slice(-100),cursor:Math.min(b.cursor+1,99)}),O([]),S(null),_e(``),M(!1),requestAnimationFrame(()=>D.current?.focus({preventScroll:!0})))},ut=e=>{if(!B)return;let t=b.cursor+e;t>=0&&t<b.history.length&&(x(``),st({cursor:t,path:b.history[t]}),O([]),S(null),_e(``))};(0,Y.useEffect)(()=>{let e=()=>{de.current=!1};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,Y.useLayoutEffect)(()=>{et.current(B&&We&&!Je?{location:Fe,root:B,entries:q}:null)},[Fe,B,We,Je,q]);let dt=(e,t)=>{if(S(e.path),t&&F.current){let t=W.findIndex(e=>e.path===F.current),n=W.indexOf(e);if(t>=0){O(W.slice(Math.min(t,n),Math.max(t,n)+1).map(e=>e.path));return}}F.current=e.path,O(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path])},ft=e=>{B&&We&&(e.kind===`directory`||e.kind===`parent`?lt(e.path):e.kind===`file`?l(e,{...Fe,path:e.path},!!B?.readOnly):x(e.kind===`symlink`?`Symbolic links are visible but cannot be followed`:`Special files cannot be opened`))},J=q.some(e=>Ge(e.path,B?.protectedPaths)),mt=[[`create`,`New file`,!B||!!B.readOnly],[`mkdir`,`New folder`,!B||!!B.readOnly],[`upload`,`Upload from this computer`,!B||!!B.readOnly],[`copy`,`Copy to other panel · F5`,!q.length],[`download`,`Download to this computer`,q.length!==1||q[0]?.kind!==`file`],[`rename`,`Rename · F2`,q.length!==1||!!B?.readOnly||J],[`trash`,`Move to trash · Delete`,!q.length||!!B?.readOnly||J],[`trashList`,`Restore from trash`,!B]];return Ze([{id:`files-rename`,title:`Rename file`,group:`Files`,key:`F2`,shortcut:[`F2`],disabled:q.length!==1||!!B?.readOnly||J||U,onSelect:()=>u(`rename`)},{id:`files-edit`,title:`Open selected file`,group:`Files`,key:`F4`,shortcut:[`F4`],disabled:q.length!==1||U,onSelect:()=>ft(q[0])},{id:`files-copy`,title:`Copy to other panel`,group:`Files`,key:`F5`,shortcut:[`F5`],disabled:!q.length||U,onSelect:()=>u(`copy`)},{id:`files-trash`,title:`Move selection to trash…`,group:`Files`,key:`Delete`,shortcut:[`Delete`],disabled:!q.length||!!B?.readOnly||J||U,onSelect:()=>u(`trash`)}],m&&i&&!a,L),(0,X.jsxs)(Ne,{component:`section`,variant:`outlined`,"aria-label":`${e} file panel`,ref:L,"data-file-side":e,"data-keyboard-region":`Files ${e===`left`?`A`:`B`}`,"aria-description":`Tab switches panels. Escape switches between the list and tools. F6 moves to another Console region.`,onFocusCapture:e=>{e.currentTarget.contains(e.target)&&m&&!a&&(s(),e.currentTarget.contains(e.relatedTarget)||de.current||C||e.target===D.current||e.target.closest(`tbody`)||(D.current??L.current?.querySelector(`[data-file-start]`))?.focus({preventScroll:!0}),(e.target===D.current||e.target.closest(`tbody`))&&w(!1))},onBlurCapture:e=>{let t=e.relatedTarget;!e.currentTarget.contains(t)&&!t?.closest(`[role="dialog"],[role="menu"],[role="listbox"]`)&&w(!1)},onPointerDownCapture:e=>{if(!e.currentTarget.contains(e.target))return;de.current=!0;let t=!!e.target.closest(`[data-file-list]`);w(!t),s(),e.target.closest(`input,button,a,[role="combobox"],tbody tr`)||D.current?.focus({preventScroll:!0})},onKeyDown:e=>{if(e.defaultPrevented||e.nativeEvent.isComposing||!m||a)return;let t=e.target;if(t.closest(`[role="dialog"],[role="alertdialog"],[role="menu"]`))return;let n=!!t.closest(`[data-file-list]`);if(n&&!C&&e.key===`Tab`&&!e.ctrlKey&&!e.metaKey&&!e.altKey)e.preventDefault(),e.stopPropagation(),d();else if(e.key===`Escape`&&!Ae)e.preventDefault(),e.stopPropagation(),O([]),n&&!C?(w(!0),(L.current?.querySelector(`[data-file-add]:not(:disabled)`)??L.current?.querySelector(`[data-file-tools] button:not(:disabled)`))?.focus()):(w(!1),D.current?.focus({preventScroll:!0}));else if(!t.closest(`input:not([type="checkbox"]),textarea,select,[contenteditable="true"]`)){if(n&&(e.ctrlKey||e.metaKey)&&!e.altKey&&e.key.toLowerCase()===`a`)e.preventDefault(),O(W.map(e=>e.path));else{if(n&&!t.closest(`input,button,a`)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let t=G.findIndex(e=>e.path===at),n=Math.max(1,Math.floor((D.current?.parentElement?.clientHeight||400)/40)),r={ArrowDown:t+1,ArrowUp:t-1,Home:0,End:G.length-1,PageDown:t+n,PageUp:t-n};if(e.key in r){e.preventDefault(),ot(r[e.key],e.shiftKey);return}let i=G[t];if(e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault(),e.key===`ArrowLeft`&&b.path&&lt(V(b.path)),e.key===`ArrowRight`&&i?.kind===`directory`&&ft(i);return}if(i&&(e.key===`Enter`||e.key===` `)){e.preventDefault(),e.key===`Enter`?ft(i):i.kind!==`parent`&&dt(i,e.shiftKey);return}}B&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`l`?(e.preventDefault(),Pe(`/`+b.path),M(!0)):e.altKey&&e.key===`ArrowLeft`?(e.preventDefault(),ut(-1)):e.altKey&&e.key===`ArrowRight`?(e.preventDefault(),ut(1)):e.altKey&&e.key===`ArrowUp`&&(e.preventDefault(),lt(V(b.path)))}}},sx:{display:a?`none`:`flex`,flex:1,flexDirection:`column`,minWidth:0,minHeight:0,overflow:`hidden`,borderColor:`divider`,"&:focus-within":{borderColor:`primary.main`},transition:`border-color 120ms`,borderRadius:1.5},children:[(0,X.jsx)(pt,{value:b.id,onChange:Xe,variant:`scrollable`,scrollButtons:`auto`,"aria-label":`${e} panel locations`,tabs:h.map(t=>({value:t.id,label:$e(t),closable:h.length>1,closeLabel:`Close ${e} location ${$e(t)}`})),onClose:e=>{let t=h.filter(t=>t.id!==e);t.length&&(g(t),y===e&&Xe(t[Math.min(h.findIndex(t=>t.id===e),t.length-1)].id))},action:(0,X.jsx)(E,{title:h.length>=8?`Close a tab to open another (8 per panel)`:`Open a node in a new tab`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(P,{"aria-label":`New ${e} location tab`,size:`small`,disabled:h.length>=8,"data-file-add":!0,"aria-haspopup":`menu`,"aria-expanded":!!ne,"aria-controls":ne?`choose-${e}-file-node`:void 0,onClick:e=>re(e.currentTarget),children:(0,X.jsx)(Le,{})})})}),sx:{px:1,minHeight:40,"& .MuiTab-root":{minHeight:40,minWidth:72,maxWidth:180,fontSize:12}}}),(0,X.jsxs)(ke,{id:`choose-${e}-file-node`,anchorEl:ne,open:!!ne,onClose:()=>re(null),slotProps:{list:{"aria-label":`Choose a node`},paper:{sx:{minWidth:208,maxWidth:`min(360px, 92vw)`}}},children:[(0,X.jsx)(De,{children:`Choose a node`}),t.map(e=>(0,X.jsx)(je,{ref:e.isLocal?ie:void 0,onClick:()=>{let t=bt(e.id);g(e=>[...e,t]),Xe(t.id),re(null)},children:(0,X.jsx)(Me,{primary:e.name,secondary:e.isLocal?`This daemon`:e.host,sx:{overflowWrap:`anywhere`}})},e.id)),n.pending&&(0,X.jsx)(je,{disabled:!0,children:`Loading registered nodes…`}),n.error&&(0,X.jsx)(je,{onClick:()=>{ie.current?.focus({preventScroll:!0}),r()},children:(0,X.jsx)(Me,{primary:`Retry loading remote nodes`,secondary:n.error,sx:{overflowWrap:`anywhere`}})})]}),(0,X.jsxs)(I,{"data-file-tools":!0,direction:`row`,spacing:.25,sx:{px:1,alignItems:`center`,minHeight:36,minWidth:0},children:[(0,X.jsx)(E,{title:`Back · Alt+←`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(P,{size:`small`,"aria-label":`Back in ${e} panel`,disabled:!B||b.cursor===0,onClick:()=>ut(-1),children:(0,X.jsx)(Ie,{fontSize:`small`})})})}),(0,X.jsx)(E,{title:`Forward · Alt+→`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(P,{size:`small`,"aria-label":`Forward in ${e} panel`,disabled:!B||b.cursor>=b.history.length-1,onClick:()=>ut(1),children:(0,X.jsx)(z,{fontSize:`small`})})})}),(0,X.jsx)(E,{title:`Parent folder · Alt+↑`,children:(0,X.jsx)(`span`,{children:(0,X.jsx)(P,{size:`small`,"aria-label":`Parent of ${e} panel`,disabled:!B||!b.path,onClick:()=>lt(V(b.path)),children:(0,X.jsx)(nt,{fontSize:`small`})})})}),(0,X.jsx)(_,{sx:{flex:1,minWidth:0,px:.5,overflow:`hidden`},children:Ae?(0,X.jsx)(fe,{autoFocus:!0,fullWidth:!0,size:`small`,label:`Path within root`,value:N,onChange:e=>Pe(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),M(!1),requestAnimationFrame(()=>D.current?.focus({preventScroll:!0}))),e.key===`Enter`)try{lt(He(N))}catch(e){x(Ke(e))}}}):B?(0,X.jsxs)(le,{"aria-label":`${e} path`,maxItems:3,sx:{"& .MuiBreadcrumbs-ol":{flexWrap:`nowrap`},"& .MuiBreadcrumbs-li":{minWidth:0},"& button":{maxWidth:170,textOverflow:`ellipsis`,overflow:`hidden`,whiteSpace:`nowrap`,fontFamily:`monospace`,fontSize:12}},children:[(0,X.jsx)(Ce,{component:`button`,underline:`hover`,onClick:()=>lt(``),children:B.id===`system`&&B.label===`Filesystem`?`/`:B.label}),b.path.split(`/`).filter(Boolean).map((e,t)=>(0,X.jsx)(Ce,{component:`button`,underline:`hover`,onClick:()=>lt(b.path.split(`/`).slice(0,t+1).join(`/`)),children:e},t))]}):null}),B&&(0,X.jsx)(E,{title:`Edit path · Ctrl/⌘+L`,children:(0,X.jsx)(P,{size:`small`,"aria-label":`Edit ${e} path`,onClick:()=>{Pe(`/`+b.path),M(!0)},children:(0,X.jsx)(it,{sx:{fontSize:18}})})}),(0,X.jsx)(E,{title:`Refresh`,children:(0,X.jsx)(P,{"data-file-retry":!0,size:`small`,"aria-label":`Refresh ${e} panel`,onClick:()=>{x(``),se(e=>e+1)},children:(0,X.jsx)(tt,{sx:{fontSize:18}})})}),(0,X.jsx)(E,{title:`Panel actions`,children:(0,X.jsx)(P,{size:`small`,"aria-label":`${e} panel actions`,onClick:e=>Oe(e.currentTarget),children:(0,X.jsx)(R,{fontSize:`small`})})})]}),B&&(0,X.jsx)(fe,{size:`small`,placeholder:`Filter loaded entries…`,"data-console-command":`search`,value:k,onChange:e=>{_e(e.target.value),O([])},slotProps:{htmlInput:{"aria-label":`Filter ${e} files`}},sx:{mx:1,my:.75}}),(0,X.jsx)(_,{sx:{height:2,flexShrink:0},children:U&&(0,X.jsx)(Ee,{"aria-label":`Loading ${e} files`})}),Je&&(0,X.jsx)(v,{severity:`error`,sx:{m:1,overflowWrap:`anywhere`},children:Je}),!B&&(0,X.jsx)(_,{sx:{flex:1,minHeight:0,overflowY:`auto`},children:Re&&!Re.error&&(b.rootId?(0,X.jsx)(v,{severity:`warning`,sx:{m:1},children:`This file area is no longer available. Refresh or open a new tab.`}):Re.roots.length?Re.roots.length>1?(0,X.jsxs)(I,{role:`group`,"aria-label":`Choose a file area`,spacing:.5,sx:{p:1.5},children:[(0,X.jsx)(j,{variant:`subtitle2`,children:`Choose a file area`}),Re.roots.map((e,t)=>(0,X.jsxs)(p,{"data-file-start":t===0||void 0,variant:`text`,"aria-label":`Open ${e.label}`,onClick:()=>st({rootId:e.id,rootLabel:e.label}),sx:{justifyContent:`flex-start`,gap:1},children:[(0,X.jsx)(rt,{fontSize:`small`}),` `,e.label,e.readOnly&&(0,X.jsx)(j,{variant:`caption`,color:`text.secondary`,children:`Read only`})]},e.id))]}):null:(0,X.jsx)(v,{severity:`info`,sx:{m:1},children:`No file areas are available on this node. Check its file access policy.`}))}),B&&(0,X.jsxs)(ct,{keyboardNavigation:!1,tabIndex:-1,label:`${e} directory entries`,sx:{flex:1,minHeight:100},children:[(0,X.jsxs)(he,{ref:D,tabIndex:i&&!C?0:-1,"data-keyboard-focus":!0,"data-file-list":!0,size:`small`,stickyHeader:!0,"aria-label":`${e} files`,sx:{tableLayout:`fixed`,"& td, & th":{px:1,py:.6},"& td:first-of-type, & th:first-of-type":{px:0},"& .MuiCheckbox-root":{p:.75},'& .MuiTableRow-root[data-cursor="true"]':{bgcolor:`action.hover`},"&:focus-visible":{outline:at===null?`2px solid`:`none`,outlineColor:`primary.main`,outlineOffset:-2},'& .MuiTableRow-root:focus-visible, &:focus-visible .MuiTableRow-root[data-cursor="true"]':{outline:`2px solid`,outlineColor:`primary.main`,outlineOffset:-2}},children:[(0,X.jsx)(Se,{children:(0,X.jsxs)(me,{children:[(0,X.jsx)(T,{padding:`checkbox`,sx:{width:40},children:(0,X.jsx)(f,{size:`small`,slotProps:{input:{"aria-label":`Select loaded ${e} entries`}},checked:W.length>0&&K.length===W.length,indeterminate:K.length>0&&K.length<W.length,onChange:(e,t)=>O(t?W.map(e=>e.path):[])})}),[`name`,`size`,`modifiedAt`].map(e=>(0,X.jsx)(T,{sx:e===`name`?{}:e===`size`?{width:80}:{width:110,display:{xs:`none`,lg:`table-cell`}},children:(0,X.jsx)(ge,{active:ye===e,direction:xe?`desc`:`asc`,onClick:()=>{ye===e?we(e=>!e):(be(e),we(!1))},children:e===`modifiedAt`?`Modified`:e===`name`?`Name`:`Size`})},e))]})}),(0,X.jsxs)(ue,{children:[We&&b.path&&(0,X.jsxs)(me,{tabIndex:-1,"data-cursor":i&&at===V(b.path)||void 0,"aria-label":`Parent directory`,onFocus:()=>S(V(b.path)),onClick:e=>{S(V(b.path)),e.currentTarget.focus()},onDoubleClick:()=>lt(V(b.path)),children:[(0,X.jsx)(T,{}),(0,X.jsx)(T,{children:(0,X.jsx)(p,{color:`inherit`,size:`small`,tabIndex:-1,"aria-label":`Open parent directory`,onClick:e=>{e.stopPropagation(),lt(V(b.path))},startIcon:(0,X.jsx)(nt,{fontSize:`small`}),sx:{minWidth:0,p:0,fontFamily:`monospace`},children:`..`})}),(0,X.jsx)(T,{}),(0,X.jsx)(T,{sx:{display:{xs:`none`,lg:`table-cell`}}})]}),W.map(e=>(0,X.jsxs)(me,{hover:!0,selected:pe.includes(e.path),tabIndex:-1,"data-cursor":i&&e.path===at||void 0,onFocus:()=>S(e.path),"aria-current":i&&e.path===at?`true`:void 0,"aria-label":`${e.kind} ${e.name}`,onClick:t=>{dt(e,t.shiftKey),t.currentTarget.focus({preventScroll:!0})},onDoubleClick:()=>ft(e),children:[(0,X.jsx)(T,{children:(0,X.jsx)(f,{size:`small`,checked:pe.includes(e.path),slotProps:{input:{"aria-label":`Select ${e.name}`,tabIndex:-1}},onClick:e=>e.stopPropagation(),onChange:()=>dt(e,!1)})}),(0,X.jsx)(T,{children:(0,X.jsxs)(I,{direction:`row`,spacing:.75,sx:{alignItems:`center`,minWidth:0},children:[e.kind===`directory`?(0,X.jsx)(rt,{sx:{fontSize:18,color:`primary.main`,flexShrink:0}}):(0,X.jsx)(j,{component:`span`,"aria-hidden":!0,sx:{fontFamily:`monospace`,fontSize:11,color:`text.disabled`,flexShrink:0},children:e.kind===`file`?`┄`:`↗`}),(0,X.jsx)(E,{title:e.name,children:(0,X.jsx)(p,{size:`small`,color:`inherit`,tabIndex:-1,onClick:t=>{t.stopPropagation(),t.currentTarget.closest(`tr`)?.focus({preventScroll:!0}),ft(e)},sx:{minWidth:0,justifyContent:`flex-start`,textTransform:`none`,fontWeight:e.kind===`directory`?600:400,overflow:`hidden`,p:0,fontSize:13},children:(0,X.jsx)(_,{component:`span`,sx:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name})})})]})}),(0,X.jsx)(T,{sx:{color:`text.secondary`,fontFamily:`monospace`,fontSize:11,whiteSpace:`nowrap`},children:e.kind===`file`?H(e.size):e.kind===`directory`?`—`:e.kind}),(0,X.jsx)(T,{sx:{display:{xs:`none`,lg:`table-cell`},color:`text.secondary`,fontSize:11},children:(0,X.jsx)(E,{title:new Date(e.modifiedAt).toLocaleString(),children:(0,X.jsx)(`span`,{children:new Date(e.modifiedAt).toLocaleDateString(void 0,{month:`short`,day:`numeric`})})})})]},e.path))]})]}),We&&!U&&!W.length&&!Je&&(0,X.jsx)(j,{variant:`body2`,color:`text.secondary`,sx:{p:3,textAlign:`center`},children:k?`No matches in loaded entries`:`Empty folder`}),Ve&&(0,X.jsx)(p,{fullWidth:!0,onClick:()=>void Ue(),disabled:U,children:`Load next 200 entries`})]}),(0,X.jsxs)(I,{direction:`row`,spacing:1,sx:{px:1.5,py:.75,alignItems:`center`,borderTop:1,borderColor:`divider`,minWidth:0},children:[(0,X.jsx)(j,{variant:`caption`,color:`text.secondary`,"aria-live":`polite`,sx:{flex:1},children:K.length?`${K.length} selected${K.every(e=>e.kind===`file`)?` · ${H(K.reduce((e,t)=>e+t.size,0))}`:``}`:We?`${W.length}${Ve?`+`:``} ${W.length===1&&!Ve?`entry`:`entries`}`:`—`}),B?.readOnly&&(0,X.jsx)(ee,{size:`small`,variant:`outlined`,label:`Read only`}),J&&(0,X.jsx)(E,{title:`This structural entry cannot be renamed or moved to trash; its ordinary children remain usable`,children:(0,X.jsx)(ee,{size:`small`,variant:`outlined`,label:`Protected`})}),(0,X.jsx)(j,{variant:`caption`,color:i?`primary.main`:`text.disabled`,sx:{textTransform:`uppercase`,letterSpacing:1.5},children:e===`left`?`A`:`B`})]}),(0,X.jsxs)(ke,{anchorEl:Te,open:!!Te,onClose:()=>Oe(null),children:[mt.map(([e,t,n])=>(0,X.jsx)(je,{disabled:n||!We||U,onClick:()=>{Oe(null),u(e)},children:t},e)),(0,X.jsxs)(je,{onClick:()=>{ve(e=>!e),O([]),Oe(null)},children:[A?`Hide`:`Show`,` hidden entries`]})]})]})}var Y,X;function St(){return(St=e((()=>{Y=t(),x(),m(),d(),h(),S(),g(),M(),we(),F(),N(),Te(),Ae(),Pe(),Oe(),L(),C(),D(),xe(),pe(),O(),be(),A(),de(),w(),J(),st(),Fe(),$e(),yt(),Xe(),o(),B(),X=n()})))()}function Ct({sourceNodeId:e,destinationNodeId:t,directoryName:n,disabled:i=!1,onChange:a}){let[o,s]=(0,wt.useState)(`files`),[c,l]=(0,wt.useState)(null),u=JSON.stringify([e,t]),d=c?.nodes===u?c.value:null,[f,m]=(0,wt.useState)(!1),[h,g]=(0,wt.useState)(!1),[_,ee]=(0,wt.useState)(0),[y,te]=(0,wt.useState)(null),[b,ne]=(0,wt.useState)(null),re=(0,wt.useRef)(a);re.current=a;let ie=o!==`files`,ae=d?.formats.filter(e=>e.outputs.includes(o===`directory`?`directory`:`archive`))??[],x=ae.find(e=>e.format===y)??ae[0],oe=b??`${n}${o===`archive`?x?.extension??``:``}`,se=Be(oe)??(o===`archive`&&x&&!oe.toLocaleLowerCase().endsWith(x.extension.toLocaleLowerCase())?`Use a filename ending in ${x.extension}`:null),ce=o===`files`||!(f||h||!x||se);return(0,wt.useEffect)(()=>{if(!ie)return;let n=!0;return l(null),m(!0),g(!1),r.archiveFormats({nodeId:e,destinationNodeId:t}).then(e=>{if(n){if(!e||!Array.isArray(e.formats)||e.formats.some(e=>!e||!mt.includes(e.format)||typeof e.label!=`string`||!Array.isArray(e.outputs)||e.outputs.some(e=>![`archive`,`directory`].includes(e))||typeof e.extension!=`string`||!/^\.[a-z0-9.]+$/i.test(e.extension))||!Array.isArray(e.limitations)||e.limitations.some(e=>typeof e!=`string`)||!Number.isFinite(Date.parse(e.observedAt)))throw Error(`Incompatible archive capabilities`);l({nodes:u,value:e})}}).catch(()=>{n&&g(!0)}).finally(()=>{n&&m(!1)}),()=>{n=!1}},[ie,e,t,u,_]),(0,wt.useEffect)(()=>{re.current({archive:o!==`files`&&x&&ce?{format:x.format,name:oe,output:o}:void 0,ready:ce})},[o,x,oe,ce]),(0,Z.jsxs)(I,{spacing:1,sx:{minWidth:0},children:[(0,Z.jsxs)(ye,{exclusive:!0,size:`small`,value:o,disabled:i,"aria-label":`Copy mode`,onChange:(e,t)=>{t&&(t===`files`&&l(null),s(t),ne(null))},sx:{flexWrap:`wrap`,"& .MuiToggleButton-root":{flex:`1 1 auto`,whiteSpace:`nowrap`}},children:[(0,Z.jsx)(ve,{value:`files`,"aria-label":`Copy files individually`,children:`Files`}),(0,Z.jsx)(ve,{value:`archive`,"aria-label":`Save archive file`,children:`Archive`}),(0,Z.jsx)(ve,{value:`directory`,"aria-label":`Transfer archive and restore folder`,children:`Pack & restore`})]}),ie&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ot,{active:f,label:`Checking archive formats on the selected nodes…`,detail:`Only verified encoders and compatible destination decoders are offered.`}),h&&(0,Z.jsx)(v,{severity:`warning`,action:(0,Z.jsx)(p,{size:`small`,disabled:i||f,onClick:()=>ee(e=>e+1),children:`Retry`}),children:`Archive capabilities are unavailable. Check node connectivity and backend support; ordinary file copy is still available.`}),d&&!ae.length&&(0,Z.jsx)(v,{severity:`info`,children:o===`directory`&&d.formats.length?`Folder restoration could not be verified for these nodes. Check destination connectivity, backend support and archive tools, or choose Archive to transfer without extraction.`:`No supported archive encoders were found on the source node.`}),ae.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(I,{direction:{xs:`column`,sm:`row`},spacing:1,children:[(0,Z.jsx)(fe,{select:!0,size:`small`,label:`Archive format`,value:x?.format??``,disabled:i||f,sx:{minWidth:150,flex:1},onChange:e=>{let t=ae.find(t=>t.format===e.target.value);t&&(te(t.format),o===`archive`&&b&&x&&b.toLocaleLowerCase().endsWith(x.extension.toLocaleLowerCase())&&ne(b.slice(0,-x.extension.length)+t.extension))},children:ae.map(e=>(0,Z.jsx)(je,{value:e.format,children:e.label},e.format))}),(0,Z.jsx)(fe,{size:`small`,label:o===`archive`?`Archive filename`:`Destination folder name`,value:oe,disabled:i||f,onChange:e=>ne(e.target.value),error:!!se,helperText:se??`One new entry in the destination folder`,sx:{flex:2,minWidth:0}})]}),(0,Z.jsx)(j,{variant:`caption`,color:`text.secondary`,children:o===`archive`?`The destination receives an archive file; it is not extracted.`:`The source is packed, transferred and restored into a new destination folder after verification.`})]}),d&&(0,Z.jsxs)(j,{variant:`caption`,color:`text.secondary`,children:[`Capabilities checked `,new Date(d.observedAt).toLocaleString()]}),d?.limitations.length?(0,Z.jsxs)(j,{component:`details`,variant:`caption`,color:`text.secondary`,children:[(0,Z.jsx)(`summary`,{children:`Limits and guarantees`}),d.limitations.map(e=>(0,Z.jsx)(j,{component:`div`,variant:`caption`,children:e},e))]}):null]})]})}var wt,Z;function Tt(){return(Tt=e((()=>{wt=t(),x(),h(),Pe(),L(),A(),k(),_e(),w(),ht(),o(),i(),q(),Z=n()})))()}function Et(e){let t=e.phase??(e.state===`planning`?`planning`:`transferring`),n={planning:`Planning`,snapshotting:`Capturing source snapshot`,archiving:`Creating archive`,transferring:`Transferring bytes`,restoring:`Restoring destination folder`,publishing:`Verifying and publishing`}[t]??`Processing transfer`,r=e.state===`planning`||e.state===`running`,i=t===`snapshotting`,a=t===`restoring`,o=i?e.preparedBytes??0:a?e.restoredBytes??0:e.bytes,s=i||a?e.sourceBytes??0:e.totalBytes,c=(i||a&&e.restoredBytes!==void 0||t===`transferring`)&&s>0;return{label:n,indeterminate:r&&!c,value:e.state===`completed`?100:c?Math.min(100,o/s*100):0,detail:i?s>0?`Snapshot ${H(o)} / ${H(s)}`:`${H(o)} captured`:a&&e.restoredBytes!==void 0?`${H(o)} / ${H(s)} restored`:e.archive&&!e.totalBytes&&e.state!==`completed`?`Transfer size is available after the archive is prepared`:`${H(e.bytes)} / ${H(e.totalBytes)} transferred · ${e.completedFiles} / ${e.totalFiles} files`}}function Dt({job:e}){let t=Et(e);return(0,Ot.jsxs)(Ot.Fragment,{children:[e.archive&&(0,Ot.jsxs)(j,{variant:`caption`,component:`div`,color:`text.secondary`,sx:{overflowWrap:`anywhere`},children:[e.archive.format,` · `,e.archive.output===`directory`?`Restore folder`:`Archive file`,` ·`,` `,e.archive.name]}),(0,Ot.jsx)(Ee,{sx:{my:1},"aria-label":e.state===`completed`?`Completed transfer`:t.label,variant:t.indeterminate?`indeterminate`:`determinate`,value:t.value}),e.publication===`partial`&&e.state!==`completed`&&(0,Ot.jsx)(j,{variant:`caption`,component:`div`,color:`warning.main`,children:e.state===`running`?`Destination folder is being published; it is not ready yet.`:`Destination folder publication is incomplete. Resume this transfer to finish before using the folder.`}),(0,Ot.jsxs)(j,{variant:`caption`,component:`div`,children:[e.state===`completed`?`Completed`:t.label,` · `,t.detail]})]})}var Ot;function kt(){return(kt=e((()=>{we(),w(),B(),Ot=n()})))()}function At({visible:e=!0}){let t=s(),n=u(t.breakpoints.down(`md`)),[i,o]=(0,Q.useState)([jt]),[c,l]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(null),m=d!==null,[h,g]=(0,Q.useState)({pending:!0}),[y,b]=(0,Q.useState)(`left`),[ne,ie]=(0,Q.useState)(50),[ae,x]=(0,Q.useState)(0),[S,le]=(0,Q.useState)({left:null,right:null}),[C,w]=(0,Q.useState)(null),[T,ue]=(0,Q.useState)(``),[de,D]=(0,Q.useState)(),[pe,me]=(0,Q.useState)(!0),[O,k]=(0,Q.useState)([]),[he,ge]=(0,Q.useState)(``),[_e,A]=(0,Q.useState)(!1),[be,xe]=(0,Q.useState)(null),[Se,Ce]=(0,Q.useState)(null),[we,Te]=(0,Q.useState)(!1),[De,Oe]=(0,Q.useState)({line:1,column:1,selected:0}),[ke,Ae]=(0,Q.useState)(!1),[M,je]=(0,Q.useState)(null),[N,Me]=(0,Q.useState)(null),Ne=(0,Q.useRef)(null),Pe=(0,Q.useRef)(null),F=(0,Q.useRef)(!1),L=(0,Q.useRef)(null),R=(0,Q.useRef)(O);R.current=O;let z=Je(()=>r.transfers(),{intervalMs:2e3,enabled:e}),Fe=(z.data??[]).filter(e=>[`running`,`planning`].includes(e.state)),Ie=(z.data??[]).filter(e=>e.cleanupPending||![`completed`,`cancelled`].includes(e.state)),Le=S[y],B=S[y===`left`?`right`:`left`],V=O.find(e=>e.id===he),ze=(z.data??[]).filter(e=>e.state===`completed`).map(e=>e.id).join(`,`),He=(0,Q.useRef)(!0),Ye=(0,Q.useRef)(!1),Xe=(0,Q.useCallback)(async()=>{g({pending:!0});try{let e=await a.listNodes();He.current&&(o([jt,...e.filter(e=>!e.isLocal&&e.id!==jt.id).map(e=>({id:e.id,name:e.name,host:e.host,isLocal:!1}))]),g({pending:!1}))}catch(e){He.current&&g({pending:!1,error:Ke(e)})}},[]);(0,Q.useEffect)(()=>(He.current=!0,Xe(),()=>{He.current=!1,F.current=!0}),[Xe]),(0,Q.useEffect)(()=>{x(e=>e+1)},[ze]),(0,Q.useEffect)(()=>{let e=e=>{(R.current.some(e=>e.text!==e.document.content)||N)&&(e.preventDefault(),e.returnValue=``)};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[N]);let Ze=async(e,t)=>{if(!Ye.current){Ye.current=!0,f(e),l(``);try{await t()}catch(e){l(Ke(e))}finally{Ye.current=!1,He.current&&f(null)}}},$e=()=>x(e=>e+1),tt=e=>{b(e),requestAnimationFrame(()=>{let t=L.current?.querySelector(`[data-file-side="${e}"]`);(t?.querySelector(`tr[data-cursor="true"]`)??t?.querySelector(`[data-keyboard-focus], [data-file-start]`)??t?.querySelector(`[data-file-add]:not(:disabled), [data-file-retry]`))?.focus({preventScroll:!0})})},nt=e=>i.find(t=>t.id===e)?.name??e,rt=e=>`${nt(e.nodeId)} / ${e.rootId} / ${e.path}`,it=async(e,t,n)=>Ze(`Opening ${t.path}`,async()=>{let e=JSON.stringify(t);if(!R.current.find(t=>t.id===e)){if(R.current.length>=8)throw Error(`Close a document before opening another (8 buffers per workspace)`);let i=await r.readText(t);k(r=>[...r,{id:e,location:t,document:i,text:i.content,readOnly:n,revision:0}])}ge(e),A(!0)}),at=e=>Ze(`Saving ${e.location.path}`,async()=>{if(e.readOnly||U(e.text)===`mixed`)throw Error(`This buffer is read only`);let t=await r.saveText({...e.location,content:e.text,version:e.document.version,bom:e.document.bom});k(n=>n.map(n=>n.id===e.id?{...n,document:t}:n)),$e()}),K=(e,t=!1)=>{let n=R.current.find(t=>t.id===e);if(!t&&n&&n.text!==n.document.content){xe(e);return}let r=R.current.filter(t=>t.id!==e);k(r),e===he&&ge(r[0]?.id??``),r.length||A(!1),xe(null)},q=(e,t)=>{let n=S[e];if(!n)return;if((t===`rename`||t===`trash`)&&n.entries.some(e=>Ge(e.path,n.root.protectedPaths))){l(`This structural path is protected from rename and removal`);return}let i=S[e===`left`?`right`:`left`];b(e),t===`upload`?(Pe.current=n,Ne.current?.click()):t===`download`?lt(n):t===`trashList`?Ze(`Loading trash`,async()=>je({pane:n,items:await r.trashList(n.location)})):(ue(t===`rename`?n.entries[0]?.name??``:``),D(void 0),me(!0),w({action:t,pane:n,...i?{destination:i}:{}}))},st=()=>Ze(C?.action===`copy`?`Preparing file transfer`:C?.action===`trash`?`Moving files to trash`:`Saving file changes`,async()=>{if(!C)return;let{pane:e}=C;if(C.action===`copy`){if(!pe)throw Error(`Wait for compatible archive capabilities and enter a valid destination name`);if(!C.destination||C.destination.root.readOnly)throw Error(`Select a writable destination in the other panel`);await r.copy({sources:e.entries.map(t=>({...e.location,path:t.path,version:t.version})),destination:C.destination.location,...de&&{archive:de}}),Ae(!0),await z.refresh()}else if(C.action===`trash`)for(let t of e.entries)await r.trash({...e.location,path:t.path,version:t.version});else{let t=We(e.location.path,Ve(T));if(C.action===`mkdir`&&await r.mkdir({...e.location,path:t}),C.action===`rename`){let n=e.entries[0],i={...e.location,path:n.path,version:n.version},a=R.current.map(e=>qe(e,i,{path:t,version:n.version}));if(new Set(a.map(e=>e.id)).size!==a.length)throw Error(`Close the open destination document before renaming`);let o=await r.rename({...i,destination:t}),s=R.current.find(e=>e.id===he);s&&ge(qe(s,i,o).id),k(e=>e.map(e=>qe(e,i,o)))}(C.action===`create`||C.action===`saveCopy`)&&await r.saveText({...e.location,path:t,content:C.buffer?.text??``,version:null,bom:C.buffer?.document.bom??!1})}w(null),$e()}),ct=async e=>{let t=Pe.current;if(!t||N)return;let n,i=!1;F.current=!1,l(``),Me({label:`Upload ${e.name}`,bytes:0,total:e.size,committing:!1});try{n=crypto.randomUUID(),n=(await r.beginUpload({id:n,...t.location,path:We(t.location.path,Ve(e.name)),size:e.size})).id;for(let i=0;i<e.size;){if(F.current)throw Error(`Upload cancelled`);let a=new Uint8Array(await e.slice(i,i+262144).arrayBuffer());i=(await r.uploadChunk({nodeId:t.location.nodeId,id:n,offset:i,...await Ue(a)})).offset,Me({label:`Upload ${e.name}`,bytes:i,total:e.size,committing:!1})}if(F.current)throw Error(`Upload cancelled`);i=!0,Me({label:`Publishing ${e.name}`,bytes:e.size,total:e.size,committing:!0}),await r.finishUpload({nodeId:t.location.nodeId,id:n}),await r.acknowledgeUpload({nodeId:t.location.nodeId,id:n}).catch(()=>void 0),$e()}catch(e){if(n&&!i)try{await r.abortUpload({nodeId:t.location.nodeId,id:n})}catch{l(`Upload interrupted; staging receipt ${n} requires reconciliation`);return}l(`${Ke(e)}${n&&i?` · Publication outcome unknown; receipt ${n}. Do not upload a replacement until checked.`:``}`)}finally{Me(null)}},lt=async e=>{let t=e.entries[0];if(t&&!N){if(t.size>33554432)l(`Browser downloads are limited to 32 MiB. Use server-to-server copy or the CLI for larger files.`);else{F.current=!1,l(``),Me({label:`Download ${t.name}`,bytes:0,total:t.size,committing:!1});try{let n=[],i=0;for(;i<t.size;){if(F.current)throw Error(`Download cancelled`);let a=await r.readChunk({...e.location,path:t.path,version:t.version,offset:i}),o=Uint8Array.from(atob(a.data),e=>e.charCodeAt(0));if(!o.length||a.offset!==i||(await Ue(o)).sha256!==a.sha256)throw Error(`Download checksum or sequence mismatch`);n.push(o.buffer),i+=o.length,Me({label:`Download ${t.name}`,bytes:i,total:t.size,committing:!1})}let a=URL.createObjectURL(new Blob(n,{type:`application/octet-stream`})),o=document.createElement(`a`);o.href=a,o.download=t.name,o.click(),setTimeout(()=>URL.revokeObjectURL(a),3e4)}catch(e){l(Ke(e))}finally{Me(null)}}}},dt=(0,Q.useRef)(C);C&&(dt.current=C);let J=C??dt.current,mt=C&&[`mkdir`,`rename`,`create`,`saveCopy`].includes(C.action),ht=mt?Be(T):null;return(0,$.jsxs)(_,{sx:{display:`flex`,flexDirection:`column`,flex:1,minHeight:0,minWidth:0,gap:1,"@media (max-height: 600px)":{overflowY:`auto`}},children:[(0,$.jsx)(ut,{heading:`Files`,active:e,links:[{name:`Files`}],action:(0,$.jsxs)(I,{direction:`row`,spacing:.5,useFlexGap:!0,role:`toolbar`,"aria-label":`File actions`,sx:{alignItems:`center`},children:[n&&(0,$.jsxs)(ye,{exclusive:!0,size:`small`,value:y,"aria-label":`Visible file panel`,onChange:(e,t)=>{t&&tt(t)},children:[(0,$.jsx)(ve,{value:`left`,children:`A`}),(0,$.jsx)(ve,{value:`right`,children:`B`})]}),(0,$.jsx)(E,{title:`Copy ${y===`left`?`A → B`:`B → A`} · ${B?rt(B.location):`Choose a destination`} · F5`,children:(0,$.jsx)(`span`,{children:(0,$.jsx)(p,{size:`small`,variant:`outlined`,startIcon:(0,$.jsx)(G,{fontSize:`small`}),"aria-label":y===`left`?`Copy A to B`:`Copy B to A`,disabled:!Le?.entries.length||!B||B.root.readOnly||m,onClick:()=>q(y,`copy`),sx:{minWidth:72,fontFamily:`monospace`},children:y===`left`?`A → B`:`B → A`})})}),(0,$.jsx)(E,{title:`New folder in panel ${y===`left`?`A`:`B`}`,children:(0,$.jsx)(`span`,{children:(0,$.jsx)(P,{size:`small`,"aria-label":`New folder`,disabled:!Le||Le.root.readOnly||m,onClick:()=>q(y,`mkdir`),children:(0,$.jsx)(et,{fontSize:`small`})})})}),(0,$.jsx)(E,{title:`Upload from this computer to panel ${y===`left`?`A`:`B`}`,children:(0,$.jsx)(`span`,{children:(0,$.jsx)(P,{size:`small`,"aria-label":`Upload from this computer`,disabled:!Le||Le.root.readOnly||!!N,onClick:()=>q(y,`upload`),children:(0,$.jsx)(Qe,{fontSize:`small`})})})}),!n&&(0,$.jsx)(E,{title:`Focus panel ${y===`left`?`B`:`A`} · Tab inside a file list`,children:(0,$.jsx)(P,{size:`small`,"aria-label":`Focus panel ${y===`left`?`B`:`A`}`,onClick:()=>tt(y===`left`?`right`:`left`),children:(0,$.jsx)(W,{fontSize:`small`})})}),O.length>0&&(0,$.jsxs)(p,{size:`small`,onClick:()=>A(!0),children:[`Editor · `,O.length,O.some(e=>e.text!==e.document.content)?` •`:``]}),(0,$.jsxs)(p,{size:`small`,variant:Ie.length?`outlined`:`text`,onClick:()=>Ae(!0),children:[`Transfers`,Ie.length?` · ${Ie.length}`:``]})]})}),c&&(0,$.jsx)(v,{severity:`error`,onClose:()=>l(``),sx:{overflowWrap:`anywhere`},children:c}),(0,$.jsx)(ot,{active:m&&!C&&!_e&&!M&&!ke,label:d??``}),z.error&&(0,$.jsxs)(v,{severity:`warning`,children:[`Transfer status unavailable: `,z.error]}),N&&(0,$.jsxs)(_,{role:`status`,children:[(0,$.jsxs)(I,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[(0,$.jsxs)(j,{variant:`caption`,sx:{flex:1},children:[N.label,` · `,H(N.bytes),` / `,H(N.total),N.committing?` · confirming publication`:``]}),(0,$.jsx)(p,{size:`small`,disabled:N.committing,onClick:()=>{F.current=!0},children:`Cancel`})]}),(0,$.jsx)(Ee,{variant:N.committing?`indeterminate`:`determinate`,value:N.total?N.bytes/N.total*100:0})]}),(0,$.jsxs)(_,{ref:L,sx:{display:`flex`,flex:1,minWidth:0,minHeight:240,overflow:`hidden`},children:[(0,$.jsx)(_,{sx:{display:n&&y!==`left`?`none`:`flex`,flex:n?1:`0 0 ${ne}%`,minWidth:0,minHeight:0},children:(0,$.jsx)(xt,{side:`left`,visible:e,hosts:i,discovery:h,retryDiscovery:Xe,active:y===`left`,hidden:!1,refreshKey:ae,onFocus:()=>b(`left`),onSwitchPanel:()=>tt(`right`),onSelection:e=>le(t=>({...t,left:e})),onOpen:(...e)=>void it(...e),onAction:e=>q(`left`,e)})}),!n&&(0,$.jsx)(_,{role:`separator`,"aria-label":`Panel width`,"aria-orientation":`vertical`,"aria-valuemin":30,"aria-valuemax":70,"aria-valuenow":ne,tabIndex:0,onKeyDown:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),ie(t=>Math.max(30,Math.min(70,t+(e.key===`ArrowLeft`?-2:2)))))},onPointerDown:e=>e.currentTarget.setPointerCapture(e.pointerId),onPointerMove:e=>{if(!e.currentTarget.hasPointerCapture(e.pointerId))return;let t=L.current.getBoundingClientRect();ie(Math.max(30,Math.min(70,(e.clientX-t.left)/t.width*100)))},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},sx:{width:8,flexShrink:0,cursor:`col-resize`,touchAction:`none`,"&:hover, &:focus-visible":{bgcolor:`action.hover`,outlineColor:`primary.main`}}}),(0,$.jsx)(xt,{side:`right`,visible:e,hosts:i,discovery:h,retryDiscovery:Xe,active:y===`right`,hidden:n&&y!==`right`,refreshKey:ae,onFocus:()=>b(`right`),onSwitchPanel:()=>tt(`left`),onSelection:e=>le(t=>({...t,right:e})),onOpen:(...e)=>void it(...e),onAction:e=>q(`right`,e)})]}),Fe.length>0&&(0,$.jsxs)(p,{size:`small`,onClick:()=>Ae(!0),sx:{justifyContent:`flex-start`},children:[(0,$.jsx)(_,{sx:{width:80,mr:1},children:(0,$.jsx)(Ee,{})}),Fe.length,` active transfer`,Fe.length===1?``:`s`]}),(0,$.jsx)(`input`,{ref:Ne,type:`file`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&ct(t),e.target.value=``}}),(0,$.jsxs)(re,{open:!!mt,onClose:()=>{m||w(null)},fullWidth:!0,maxWidth:`xs`,children:[(0,$.jsx)(se,{children:J?.action===`mkdir`?`New folder`:J?.action===`rename`?`Rename`:J?.action===`saveCopy`?`Save a copy`:`New file`}),(0,$.jsxs)(te,{children:[(0,$.jsx)(ot,{active:m,label:d??``}),(0,$.jsx)(j,{variant:`caption`,sx:{display:`block`,mb:2,overflowWrap:`anywhere`},children:C&&rt(C.pane.location)}),c&&(0,$.jsx)(v,{severity:`error`,sx:{mb:1},children:c}),(0,$.jsx)(fe,{autoFocus:!0,fullWidth:!0,label:`Name`,value:T,onChange:e=>ue(e.target.value),error:!!(T&&ht),helperText:T&&ht?ht:`One name in the current folder`,onFocus:e=>e.target.select(),onKeyDown:e=>{e.key===`Enter`&&!ht&&!m&&st()}})]}),(0,$.jsxs)(oe,{children:[(0,$.jsx)(p,{onClick:()=>w(null),disabled:m,children:`Cancel`}),(0,$.jsx)(p,{variant:`contained`,loading:m,disabled:!!ht||m,onClick:()=>void st(),children:`Apply`})]})]}),(0,$.jsx)(ft,{open:!(!C||mt),onClose:()=>{m||w(null)},loading:m,title:J?.action===`copy`?`Copy to destination`:`Move to trash`,confirmLabel:J?.action===`copy`?`Start copy`:`Move to trash`,confirmColor:J?.action===`copy`?`primary`:`warning`,disabled:C?.action===`copy`&&(!C.destination||C.destination.root.readOnly||!pe),onConfirm:st,content:(0,$.jsxs)(I,{spacing:1,children:[(0,$.jsx)(ot,{active:m,label:d??``}),(0,$.jsx)(j,{variant:`body2`,sx:{overflowWrap:`anywhere`},children:J&&rt(J.pane.location)}),(0,$.jsx)(_,{sx:{maxHeight:160,overflow:`auto`},children:J?.pane.entries.map(e=>(0,$.jsx)(j,{variant:`body2`,sx:{fontFamily:`monospace`,overflowWrap:`anywhere`},children:e.name},e.path))}),J?.action===`copy`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(j,{variant:`body2`,sx:{overflowWrap:`anywhere`,fontWeight:600},children:[`→`,` `,J.destination?rt(J.destination.location):`Select the other panel destination`]}),J.destination&&J.pane.entries.length===1&&J.pane.entries[0]?.kind===`directory`&&(0,$.jsx)(Ct,{sourceNodeId:J.pane.location.nodeId,destinationNodeId:J.destination.location.nodeId,directoryName:J.pane.entries[0].name,disabled:m,onChange:e=>{D(e.archive),me(e.ready)}},`${JSON.stringify(J.pane.location)}:${J.pane.entries[0].path}:${JSON.stringify(J.destination.location)}`),(0,$.jsx)(j,{variant:`caption`,color:`text.secondary`,children:de?`Verifies the snapshot before publication and reserves a new destination entry without replacing existing files or folders.`:`Existing files are never overwritten. Completed files remain if a later file fails or the transfer is cancelled.`})]}):(0,$.jsx)(j,{variant:`body2`,children:`Items can be restored from this panel’s trash menu. Space is retained on the source node.`}),c&&(0,$.jsx)(v,{severity:`error`,children:c})]})}),(0,$.jsxs)(ce,{anchor:`right`,open:ke&&e,onClose:()=>Ae(!1),slotProps:{paper:{sx:{width:{xs:`100%`,sm:440},maxWidth:`100%`}}},children:[(0,$.jsxs)(I,{direction:`row`,sx:{p:2,alignItems:`center`},children:[(0,$.jsx)(j,{sx:{flex:1,fontWeight:600},children:`Transfers`}),(0,$.jsx)(P,{"aria-label":`Close transfers`,onClick:()=>Ae(!1),children:(0,$.jsx)(Re,{})})]}),(0,$.jsx)(j,{variant:`caption`,color:`text.secondary`,sx:{px:2,pb:2},children:`Node transfers run in daemon. Interrupted jobs resume only on your command.`}),(0,$.jsx)(_,{sx:{px:2},children:(0,$.jsx)(ot,{active:m,label:d??``})}),z.error&&(0,$.jsx)(v,{severity:`error`,children:z.error}),c&&(0,$.jsx)(v,{severity:`error`,children:c}),z.loading&&!z.data&&(0,$.jsx)(_,{sx:{px:2},children:(0,$.jsx)(ot,{active:!0,label:`Loading transfers`})}),z.data?.length===0&&(0,$.jsx)(j,{color:`text.secondary`,sx:{p:2},children:`No transfers yet`}),(z.data??[]).map(e=>(0,$.jsxs)(_,{sx:{p:2,borderTop:1,borderColor:`divider`,overflowWrap:`anywhere`},children:[(0,$.jsxs)(I,{direction:`row`,spacing:1,sx:{alignItems:`center`,mb:1},children:[(0,$.jsx)(j,{variant:`body2`,sx:{flex:1},children:e.source.map(e=>e.path.split(`/`).at(-1)).join(`, `)}),(0,$.jsx)(ee,{size:`small`,variant:`outlined`,color:e.cleanupPending||e.state===`failed`||e.state===`interrupted`?`warning`:e.state===`completed`?`success`:`default`,label:e.state})]}),(0,$.jsxs)(j,{variant:`caption`,color:`text.secondary`,children:[e.source.map(e=>nt(e.nodeId)).filter((e,t,n)=>n.indexOf(e)===t).join(`, `),` `,`→ `,rt(e.destination)]}),(0,$.jsx)(Dt,{job:e}),e.currentPath&&(0,$.jsx)(j,{variant:`caption`,sx:{display:`block`},color:`text.secondary`,children:e.currentPath}),e.error&&(0,$.jsx)(v,{severity:`warning`,sx:{mt:1},children:e.error}),(0,$.jsxs)(I,{direction:`row`,spacing:1,children:[[`running`,`planning`].includes(e.state)&&(0,$.jsx)(p,{size:`small`,disabled:m,onClick:()=>void Ze(`Pausing transfer`,async()=>{await r.controlTransfer({id:e.id,action:`pause`}),await z.refresh()}),children:`Pause`}),(e.cleanupPending||[`paused`,`failed`,`interrupted`].includes(e.state))&&(0,$.jsx)(p,{size:`small`,disabled:m,onClick:()=>void Ze(e.cleanupPending?`Cleaning up transfer data`:`Resuming transfer`,async()=>{await r.controlTransfer({id:e.id,action:`resume`}),await z.refresh()}),children:e.cleanupPending?`Retry cleanup`:`Resume`}),![`completed`,`cancelled`].includes(e.state)&&(0,$.jsx)(p,{size:`small`,disabled:m,onClick:()=>void Ze(`Cancelling transfer`,async()=>{await r.controlTransfer({id:e.id,action:`cancel`}),await z.refresh(),$e()}),children:`Cancel`})]})]},e.id))]}),(0,$.jsxs)(re,{open:!!M&&e,onClose:()=>je(null),fullWidth:!0,maxWidth:`sm`,children:[(0,$.jsx)(se,{children:`Restore from trash`}),(0,$.jsxs)(te,{children:[(0,$.jsx)(ot,{active:m,label:d??``}),c&&(0,$.jsx)(v,{severity:`error`,children:c}),!M?.items.length&&(0,$.jsx)(j,{color:`text.secondary`,children:`Trash is empty`}),M?.items.map(e=>(0,$.jsxs)(I,{direction:`row`,spacing:1,sx:{alignItems:`center`,py:1},children:[(0,$.jsxs)(_,{sx:{flex:1,minWidth:0},children:[(0,$.jsx)(j,{variant:`body2`,sx:{overflowWrap:`anywhere`},children:e.path}),(0,$.jsx)(j,{variant:`caption`,color:`text.secondary`,children:new Date(e.removedAt).toLocaleString()})]}),(0,$.jsx)(p,{disabled:m,onClick:()=>void Ze(`Restoring file`,async()=>{await r.restore({nodeId:M.pane.location.nodeId,id:e.id}),je({...M,items:await r.trashList(M.pane.location)}),$e()}),children:`Restore`})]},e.id))]}),(0,$.jsx)(oe,{children:(0,$.jsx)(p,{onClick:()=>je(null),children:`Close`})})]}),(0,$.jsxs)(re,{open:_e&&e&&!!V,"aria-label":`File editor`,onClose:()=>A(!1),fullScreen:n,maxWidth:`xl`,fullWidth:!0,keepMounted:!0,slotProps:{paper:{sx:{height:n?`100%`:`86dvh`,minHeight:0,overflow:`hidden`}}},children:[(0,$.jsxs)(I,{"data-keyboard-region":`Editor tabs`,direction:`row`,spacing:1,sx:{px:1,alignItems:`center`,borderBottom:1,borderColor:`divider`,minWidth:0},children:[(0,$.jsx)(_,{sx:{flex:1,minWidth:0},children:(0,$.jsx)(pt,{value:he,onChange:ge,onClose:e=>K(e),variant:`scrollable`,scrollButtons:`auto`,"aria-label":`Open files`,tabs:O.map(e=>({value:e.id,label:`${e.location.path.split(`/`).at(-1)}${e.text===e.document.content?``:` •`}`,closable:!0,closeDisabled:m,closeLabel:`Close file ${e.location.path}`}))})}),(0,$.jsx)(E,{title:`Minimize editor; buffers stay open`,children:(0,$.jsx)(P,{"aria-label":`Minimize editor`,onClick:()=>A(!1),children:(0,$.jsx)(Re,{})})})]}),V&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(I,{"data-keyboard-region":`Editor tools`,direction:`row`,spacing:1,sx:{p:1,alignItems:`center`,flexWrap:`wrap`,gap:.5},children:[(0,$.jsx)(j,{variant:`caption`,sx:{flex:1,minWidth:160,overflowWrap:`anywhere`,fontFamily:`monospace`},children:rt(V.location)}),(0,$.jsx)(ee,{size:`small`,variant:`outlined`,label:V.readOnly?`Read only`:V.text===V.document.content?`Saved`:`Unsaved`}),(0,$.jsx)(p,{size:`small`,disabled:m||V.readOnly||U(V.text)===`mixed`,onClick:()=>{A(!1),ue(V.location.path.split(`/`).at(-1)+`.copy`),w({action:`saveCopy`,pane:{location:{...V.location,path:V.location.path.split(`/`).slice(0,-1).join(`/`)},root:{id:V.location.rootId,label:V.location.rootId,readOnly:!1},entries:[]},buffer:V})},children:`Save copy`}),(0,$.jsx)(p,{size:`small`,disabled:m,onClick:()=>Ce(V.id),children:`Reload`}),(0,$.jsx)(ve,{size:`small`,value:`wrap`,selected:we,onChange:()=>Te(e=>!e),"aria-label":`Wrap long lines`,children:`Wrap`}),(0,$.jsx)(p,{size:`small`,variant:`contained`,loading:d?.startsWith(`Saving `)??!1,disabled:m||V.readOnly||V.text===V.document.content||U(V.text)===`mixed`,onClick:()=>void at(V),children:`Save`})]}),(0,$.jsx)(_,{sx:{px:1},children:(0,$.jsx)(ot,{active:m,label:d??``})}),c&&(0,$.jsx)(v,{severity:`error`,onClose:()=>l(``),children:c}),U(V.text)===`mixed`&&(0,$.jsx)(v,{severity:`info`,children:`Mixed line endings: preview is read only to preserve the original bytes.`})]}),(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Ee,{}),children:O.map(t=>(0,$.jsx)(_,{sx:{display:t.id===he?`flex`:`none`,flex:1,minHeight:0,minWidth:0},children:(0,$.jsx)(Mt,{initial:t.text,name:t.location.path,readOnly:t.readOnly,active:_e&&e&&t.id===he,wrap:we,onPosition:e=>{t.id===he&&Oe(e)},onChange:e=>k(n=>n.map(n=>n.id===t.id?{...n,text:e}:n)),onSave:()=>{let e=R.current.find(e=>e.id===t.id);e&&!m&&e.text!==e.document.content&&at(e)}},`${t.id}:${t.revision}`)},t.id))}),(0,$.jsxs)(j,{variant:`caption`,color:`text.secondary`,sx:{px:2,py:.5,borderTop:1,borderColor:`divider`},children:[`Ln `,De.line,`, Col `,De.column,De.selected?` · ${De.selected} selected`:``,` · UTF-8`,V?.document.bom?` BOM`:``,` · `,V?H(new TextEncoder().encode(V.text).length):``,` `,`· Ctrl/⌘+S save · Ctrl/⌘+F find · changes checked against the file version`]})]}),(0,$.jsx)(ft,{open:!!Se,title:`Reload the saved file?`,content:`This replaces the editor buffer with the current file on the node. Unsaved text will be discarded.`,confirmLabel:`Reload`,loading:m,onClose:()=>Ce(null),onConfirm:()=>Ze(`Reloading saved file`,async()=>{let e=R.current.find(e=>e.id===Se);if(!e)return;let t=await r.readText(e.location);k(n=>n.map(n=>n.id===e.id?{...n,document:t,text:t.content,revision:n.revision+1}:n)),Ce(null)})}),(0,$.jsx)(ft,{open:!!be,title:`Discard unsaved changes?`,content:`The saved file will remain unchanged. This editor buffer will be closed.`,confirmLabel:`Discard`,confirmColor:`warning`,onClose:()=>xe(null),onConfirm:()=>{be&&K(be,!0)}})]})}var Q,$,jt,Mt;function Nt(){return(Nt=e((()=>{q(),Q=t(),x(),m(),h(),g(),ne(),ie(),b(),y(),ae(),M(),we(),L(),A(),k(),_e(),de(),w(),c(),l(),J(),dt(),Fe(),$e(),o(),lt(),St(),Tt(),kt(),B(),i(),Ye(),$=n(),at(),jt={id:`local`,name:`Local`,host:`daemon`,isLocal:!0},Mt=(0,Q.lazy)(()=>K(()=>import(`./code-editor-JVuQ4m-z.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])))})))()}Nt();export{At as default};