@saluzi/saluzi-edu 0.2.66 → 0.2.68

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 (169) hide show
  1. package/dist/cli.js +534 -349
  2. package/dist/guide/guide-data.json +32 -1
  3. package/dist/rcs-schema.sql +23 -0
  4. package/dist/rcs-web/assets/{AdminPanel-CqP_94xa.js → AdminPanel-94uchXH7.js} +1 -1
  5. package/dist/rcs-web/assets/ArtifactView-CT0Fu4U5.js +6 -0
  6. package/dist/rcs-web/assets/ArtifactsGallery-DgK1CSno.js +339 -0
  7. package/{packages/remote-control-server/web/dist/assets/Claim-BvfARQ6Q.js → dist/rcs-web/assets/Claim-C7V1Q01Y.js} +1 -1
  8. package/dist/rcs-web/assets/{Dashboard-BDGi4XpN.js → Dashboard-NLM7Kgm8.js} +2 -2
  9. package/{packages/remote-control-server/web/dist/assets/Join-PPDYBhsJ.js → dist/rcs-web/assets/Join-BhjsvbAP.js} +1 -1
  10. package/dist/rcs-web/assets/{Login-JprQIEpr.js → Login-DRFE4F-F.js} +1 -1
  11. package/dist/rcs-web/assets/{Register-cuGuAE83.js → Register-FgLOFB4h.js} +1 -1
  12. package/dist/rcs-web/assets/SessionDetail-3P77L-sJ.js +60 -0
  13. package/dist/rcs-web/assets/SessionVisibilityBadge-raEV1sW8.js +11 -0
  14. package/dist/rcs-web/assets/{Setup-Buwa9Y3M.js → Setup-DDJHMu0z.js} +1 -1
  15. package/dist/rcs-web/assets/ShareLanding-DG5JbaWg.js +1 -0
  16. package/dist/rcs-web/assets/{TeamCreate-CaoinTSG.js → TeamCreate-D_AnatYF.js} +1 -1
  17. package/dist/rcs-web/assets/{TeamDetail-D5ahen24.js → TeamDetail-C1FFiAj2.js} +2 -2
  18. package/dist/rcs-web/assets/{TeamList-qCuKKSH3.js → TeamList-tfsnwvZG.js} +1 -1
  19. package/dist/rcs-web/assets/{TeamSettings-BaIwImrp.js → TeamSettings-FeTuY9_I.js} +1 -1
  20. package/dist/rcs-web/assets/{UserSearchInput-BxcYR_HU.js → UserSearchInput-Bu3RXDYh.js} +1 -1
  21. package/dist/rcs-web/assets/{UserSettings-zfGfcuWs.js → UserSettings-BrjmELAZ.js} +1 -1
  22. package/dist/rcs-web/assets/{arc-DwAbF6eM.js → arc-Di9w8tGK.js} +1 -1
  23. package/dist/rcs-web/assets/{architectureDiagram-3BPJPVTR-uMOwOwiN.js → architectureDiagram-3BPJPVTR-FT-IsfVA.js} +1 -1
  24. package/{packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-B5BqFTkP.js → dist/rcs-web/assets/blockDiagram-GPEHLZMM-DryBvbP3.js} +1 -1
  25. package/dist/rcs-web/assets/{c4Diagram-AAUBKEIU-D6eienz2.js → c4Diagram-AAUBKEIU-HWAmxH56.js} +1 -1
  26. package/dist/rcs-web/assets/channel-N4W03sy5.js +1 -0
  27. package/dist/rcs-web/assets/{chunk-2J33WTMH-DqVxv8yW.js → chunk-2J33WTMH-AdjHpC7B.js} +1 -1
  28. package/dist/rcs-web/assets/{chunk-4BX2VUAB-X5o4x8om.js → chunk-4BX2VUAB-CpZ-59LR.js} +1 -1
  29. package/dist/rcs-web/assets/{chunk-55IACEB6-D7G25_Y5.js → chunk-55IACEB6-BBSmURaz.js} +1 -1
  30. package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-CoXI1FIy.js → dist/rcs-web/assets/chunk-727SXJPM-1k6tgn8s.js} +1 -1
  31. package/dist/rcs-web/assets/{chunk-AQP2D5EJ-C73Crhqe.js → chunk-AQP2D5EJ-im0ij4Kj.js} +1 -1
  32. package/dist/rcs-web/assets/{chunk-FMBD7UC4-DVzxIsSE.js → chunk-FMBD7UC4-Cs3z8_hw.js} +1 -1
  33. package/dist/rcs-web/assets/{chunk-ND2GUHAM-C6_oEhLf.js → chunk-ND2GUHAM-BA9iE2wc.js} +1 -1
  34. package/dist/rcs-web/assets/{chunk-QZHKN3VN-COvH7k5r.js → chunk-QZHKN3VN-DbvzoKsw.js} +1 -1
  35. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-CcBgewcu.js +1 -0
  36. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-CcBgewcu.js +1 -0
  37. package/dist/rcs-web/assets/{code-block-IT6T5CEO-CE-2f_-K.js → code-block-IT6T5CEO-wgmiR0vF.js} +1 -1
  38. package/dist/rcs-web/assets/{copy-9pzb1Po6.js → copy-BD6qrRfd.js} +1 -1
  39. package/dist/rcs-web/assets/{cose-bilkent-S5V4N54A-B9sMDFRe.js → cose-bilkent-S5V4N54A-DT4C5Yz2.js} +1 -1
  40. package/dist/rcs-web/assets/{dagre-BM42HDAG-DB1jXylM.js → dagre-BM42HDAG-CRf1H6Hv.js} +1 -1
  41. package/dist/rcs-web/assets/{diagram-2AECGRRQ-MNuqSRmg.js → diagram-2AECGRRQ-BChRpS-u.js} +1 -1
  42. package/dist/rcs-web/assets/{diagram-5GNKFQAL-BZwhvaEY.js → diagram-5GNKFQAL-BicbIYus.js} +1 -1
  43. package/dist/rcs-web/assets/{diagram-KO2AKTUF-3Wp2PnI2.js → diagram-KO2AKTUF-DCfQNjGq.js} +1 -1
  44. package/dist/rcs-web/assets/{diagram-LMA3HP47-CTcV1SBj.js → diagram-LMA3HP47-mMyd4aUd.js} +1 -1
  45. package/dist/rcs-web/assets/{diagram-OG6HWLK6-DzXhSQDC.js → diagram-OG6HWLK6-DUWhyWTm.js} +1 -1
  46. package/dist/rcs-web/assets/dialog-DympH6_o.js +1 -0
  47. package/dist/rcs-web/assets/{erDiagram-TEJ5UH35-CwSihkB8.js → erDiagram-TEJ5UH35-DnBH3GMK.js} +1 -1
  48. package/dist/rcs-web/assets/external-link-J-x6ty1h.js +6 -0
  49. package/dist/rcs-web/assets/{flowDiagram-I6XJVG4X-BSuXctT4.js → flowDiagram-I6XJVG4X-Ba7lo6ds.js} +1 -1
  50. package/{packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-B87oxjmY.js → dist/rcs-web/assets/ganttDiagram-6RSMTGT7-CKkj67eu.js} +1 -1
  51. package/dist/rcs-web/assets/{gitGraphDiagram-PVQCEYII-BRrwOi3C.js → gitGraphDiagram-PVQCEYII-205YdSRe.js} +1 -1
  52. package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-B-8QXS0n.js → infoDiagram-5YYISTIA-CpPvGigJ.js} +1 -1
  53. package/dist/rcs-web/assets/{ishikawaDiagram-YF4QCWOH-Bau9MU6C.js → ishikawaDiagram-YF4QCWOH-D0ZEWQy7.js} +1 -1
  54. package/dist/rcs-web/assets/{journeyDiagram-JHISSGLW-D_tAp--R.js → journeyDiagram-JHISSGLW-DVl0M9a7.js} +1 -1
  55. package/dist/rcs-web/assets/{kanban-definition-UN3LZRKU---UIvjMZ.js → kanban-definition-UN3LZRKU-Dkr8uJC-.js} +1 -1
  56. package/dist/rcs-web/assets/{linear-CIDLjd5h.js → linear-CIdvseqY.js} +1 -1
  57. package/dist/rcs-web/assets/main-B8hkVvfg.js +265 -0
  58. package/dist/rcs-web/assets/main-C2O-g177.css +1 -0
  59. package/dist/rcs-web/assets/{mermaid-VLURNSYL-Cu5A5sMk.js → mermaid-VLURNSYL-DdTSeoZS.js} +4 -4
  60. package/dist/rcs-web/assets/{mermaid.core-CEJOtCGw.js → mermaid.core-CtvzCSq2.js} +5 -5
  61. package/{packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-ldyccyCP.js → dist/rcs-web/assets/mindmap-definition-RKZ34NQL-CMlDCaV_.js} +1 -1
  62. package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-CmghofeF.js → pieDiagram-4H26LBE5-C6xMizTL.js} +1 -1
  63. package/{packages/remote-control-server/web/dist/assets/quadrantDiagram-W4KKPZXB-B-2N2UHr.js → dist/rcs-web/assets/quadrantDiagram-W4KKPZXB-D6epraE1.js} +1 -1
  64. package/dist/rcs-web/assets/{requirementDiagram-4Y6WPE33-39jlO9Y8.js → requirementDiagram-4Y6WPE33-BHmML6bk.js} +1 -1
  65. package/{packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-DdY7KNFB.js → dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-CIKij54Y.js} +1 -1
  66. package/dist/rcs-web/assets/{sequenceDiagram-3UESZ5HK-D2k5rX6x.js → sequenceDiagram-3UESZ5HK-CY0y5zdR.js} +1 -1
  67. package/dist/rcs-web/assets/{stateDiagram-AJRCARHV-CP9N457o.js → stateDiagram-AJRCARHV-FBhNz1Lc.js} +1 -1
  68. package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-CPhZYlL0.js → stateDiagram-v2-BHNVJYJU-m7ruBTu5.js} +1 -1
  69. package/{packages/remote-control-server/web/dist/assets/timeline-definition-PNZ67QCA-DSEPBO8O.js → dist/rcs-web/assets/timeline-definition-PNZ67QCA-CJopHs1x.js} +1 -1
  70. package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-CkNMwCJ3.js → vennDiagram-CIIHVFJN-DF_uHOP7.js} +1 -1
  71. package/dist/rcs-web/assets/{wardleyDiagram-YWT4CUSO-Cxd-F60s.js → wardleyDiagram-YWT4CUSO-DQmjIZJA.js} +1 -1
  72. package/{packages/remote-control-server/web/dist/assets/xychartDiagram-2RQKCTM6-BLL105NN.js → dist/rcs-web/assets/xychartDiagram-2RQKCTM6-v8zL-j4G.js} +1 -1
  73. package/dist/rcs-web/index.html +2 -2
  74. package/package.json +1 -1
  75. package/packages/remote-control-server/src/__tests__/artifacts.test.ts +370 -0
  76. package/packages/remote-control-server/src/__tests__/helpers/mock-config.ts +1 -0
  77. package/packages/remote-control-server/src/config.ts +6 -0
  78. package/packages/remote-control-server/src/db/rcs-schema.sql +23 -0
  79. package/packages/remote-control-server/src/index.ts +9 -0
  80. package/packages/remote-control-server/src/registerRoutes.ts +8 -0
  81. package/packages/remote-control-server/src/routes/v1/artifacts.ts +179 -0
  82. package/packages/remote-control-server/src/routes/web/artifacts.ts +247 -0
  83. package/packages/remote-control-server/src/services/artifacts.ts +378 -0
  84. package/packages/remote-control-server/web/dist/assets/{AdminPanel-CqP_94xa.js → AdminPanel-94uchXH7.js} +1 -1
  85. package/packages/remote-control-server/web/dist/assets/ArtifactView-CT0Fu4U5.js +6 -0
  86. package/packages/remote-control-server/web/dist/assets/ArtifactsGallery-DgK1CSno.js +339 -0
  87. package/{dist/rcs-web/assets/Claim-BvfARQ6Q.js → packages/remote-control-server/web/dist/assets/Claim-C7V1Q01Y.js} +1 -1
  88. package/packages/remote-control-server/web/dist/assets/{Dashboard-BDGi4XpN.js → Dashboard-NLM7Kgm8.js} +2 -2
  89. package/{dist/rcs-web/assets/Join-PPDYBhsJ.js → packages/remote-control-server/web/dist/assets/Join-BhjsvbAP.js} +1 -1
  90. package/packages/remote-control-server/web/dist/assets/{Login-JprQIEpr.js → Login-DRFE4F-F.js} +1 -1
  91. package/packages/remote-control-server/web/dist/assets/{Register-cuGuAE83.js → Register-FgLOFB4h.js} +1 -1
  92. package/packages/remote-control-server/web/dist/assets/SessionDetail-3P77L-sJ.js +60 -0
  93. package/packages/remote-control-server/web/dist/assets/SessionVisibilityBadge-raEV1sW8.js +11 -0
  94. package/packages/remote-control-server/web/dist/assets/{Setup-Buwa9Y3M.js → Setup-DDJHMu0z.js} +1 -1
  95. package/packages/remote-control-server/web/dist/assets/ShareLanding-DG5JbaWg.js +1 -0
  96. package/packages/remote-control-server/web/dist/assets/{TeamCreate-CaoinTSG.js → TeamCreate-D_AnatYF.js} +1 -1
  97. package/packages/remote-control-server/web/dist/assets/{TeamDetail-D5ahen24.js → TeamDetail-C1FFiAj2.js} +2 -2
  98. package/packages/remote-control-server/web/dist/assets/{TeamList-qCuKKSH3.js → TeamList-tfsnwvZG.js} +1 -1
  99. package/packages/remote-control-server/web/dist/assets/{TeamSettings-BaIwImrp.js → TeamSettings-FeTuY9_I.js} +1 -1
  100. package/packages/remote-control-server/web/dist/assets/{UserSearchInput-BxcYR_HU.js → UserSearchInput-Bu3RXDYh.js} +1 -1
  101. package/packages/remote-control-server/web/dist/assets/{UserSettings-zfGfcuWs.js → UserSettings-BrjmELAZ.js} +1 -1
  102. package/packages/remote-control-server/web/dist/assets/{arc-DwAbF6eM.js → arc-Di9w8tGK.js} +1 -1
  103. package/packages/remote-control-server/web/dist/assets/{architectureDiagram-3BPJPVTR-uMOwOwiN.js → architectureDiagram-3BPJPVTR-FT-IsfVA.js} +1 -1
  104. package/{dist/rcs-web/assets/blockDiagram-GPEHLZMM-B5BqFTkP.js → packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-DryBvbP3.js} +1 -1
  105. package/packages/remote-control-server/web/dist/assets/{c4Diagram-AAUBKEIU-D6eienz2.js → c4Diagram-AAUBKEIU-HWAmxH56.js} +1 -1
  106. package/packages/remote-control-server/web/dist/assets/channel-N4W03sy5.js +1 -0
  107. package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-DqVxv8yW.js → chunk-2J33WTMH-AdjHpC7B.js} +1 -1
  108. package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-X5o4x8om.js → chunk-4BX2VUAB-CpZ-59LR.js} +1 -1
  109. package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-D7G25_Y5.js → chunk-55IACEB6-BBSmURaz.js} +1 -1
  110. package/{dist/rcs-web/assets/chunk-727SXJPM-CoXI1FIy.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-1k6tgn8s.js} +1 -1
  111. package/packages/remote-control-server/web/dist/assets/{chunk-AQP2D5EJ-C73Crhqe.js → chunk-AQP2D5EJ-im0ij4Kj.js} +1 -1
  112. package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-DVzxIsSE.js → chunk-FMBD7UC4-Cs3z8_hw.js} +1 -1
  113. package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-C6_oEhLf.js → chunk-ND2GUHAM-BA9iE2wc.js} +1 -1
  114. package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-COvH7k5r.js → chunk-QZHKN3VN-DbvzoKsw.js} +1 -1
  115. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-CcBgewcu.js +1 -0
  116. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-CcBgewcu.js +1 -0
  117. package/packages/remote-control-server/web/dist/assets/{code-block-IT6T5CEO-CE-2f_-K.js → code-block-IT6T5CEO-wgmiR0vF.js} +1 -1
  118. package/packages/remote-control-server/web/dist/assets/{copy-9pzb1Po6.js → copy-BD6qrRfd.js} +1 -1
  119. package/packages/remote-control-server/web/dist/assets/{cose-bilkent-S5V4N54A-B9sMDFRe.js → cose-bilkent-S5V4N54A-DT4C5Yz2.js} +1 -1
  120. package/packages/remote-control-server/web/dist/assets/{dagre-BM42HDAG-DB1jXylM.js → dagre-BM42HDAG-CRf1H6Hv.js} +1 -1
  121. package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-MNuqSRmg.js → diagram-2AECGRRQ-BChRpS-u.js} +1 -1
  122. package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-BZwhvaEY.js → diagram-5GNKFQAL-BicbIYus.js} +1 -1
  123. package/packages/remote-control-server/web/dist/assets/{diagram-KO2AKTUF-3Wp2PnI2.js → diagram-KO2AKTUF-DCfQNjGq.js} +1 -1
  124. package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-CTcV1SBj.js → diagram-LMA3HP47-mMyd4aUd.js} +1 -1
  125. package/packages/remote-control-server/web/dist/assets/{diagram-OG6HWLK6-DzXhSQDC.js → diagram-OG6HWLK6-DUWhyWTm.js} +1 -1
  126. package/packages/remote-control-server/web/dist/assets/dialog-DympH6_o.js +1 -0
  127. package/packages/remote-control-server/web/dist/assets/{erDiagram-TEJ5UH35-CwSihkB8.js → erDiagram-TEJ5UH35-DnBH3GMK.js} +1 -1
  128. package/packages/remote-control-server/web/dist/assets/external-link-J-x6ty1h.js +6 -0
  129. package/packages/remote-control-server/web/dist/assets/{flowDiagram-I6XJVG4X-BSuXctT4.js → flowDiagram-I6XJVG4X-Ba7lo6ds.js} +1 -1
  130. package/{dist/rcs-web/assets/ganttDiagram-6RSMTGT7-B87oxjmY.js → packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-CKkj67eu.js} +1 -1
  131. package/packages/remote-control-server/web/dist/assets/{gitGraphDiagram-PVQCEYII-BRrwOi3C.js → gitGraphDiagram-PVQCEYII-205YdSRe.js} +1 -1
  132. package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-B-8QXS0n.js → infoDiagram-5YYISTIA-CpPvGigJ.js} +1 -1
  133. package/packages/remote-control-server/web/dist/assets/{ishikawaDiagram-YF4QCWOH-Bau9MU6C.js → ishikawaDiagram-YF4QCWOH-D0ZEWQy7.js} +1 -1
  134. package/packages/remote-control-server/web/dist/assets/{journeyDiagram-JHISSGLW-D_tAp--R.js → journeyDiagram-JHISSGLW-DVl0M9a7.js} +1 -1
  135. package/packages/remote-control-server/web/dist/assets/{kanban-definition-UN3LZRKU---UIvjMZ.js → kanban-definition-UN3LZRKU-Dkr8uJC-.js} +1 -1
  136. package/packages/remote-control-server/web/dist/assets/{linear-CIDLjd5h.js → linear-CIdvseqY.js} +1 -1
  137. package/packages/remote-control-server/web/dist/assets/main-B8hkVvfg.js +265 -0
  138. package/packages/remote-control-server/web/dist/assets/main-C2O-g177.css +1 -0
  139. package/packages/remote-control-server/web/dist/assets/{mermaid-VLURNSYL-Cu5A5sMk.js → mermaid-VLURNSYL-DdTSeoZS.js} +4 -4
  140. package/packages/remote-control-server/web/dist/assets/{mermaid.core-CEJOtCGw.js → mermaid.core-CtvzCSq2.js} +5 -5
  141. package/{dist/rcs-web/assets/mindmap-definition-RKZ34NQL-ldyccyCP.js → packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-CMlDCaV_.js} +1 -1
  142. package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-CmghofeF.js → pieDiagram-4H26LBE5-C6xMizTL.js} +1 -1
  143. package/{dist/rcs-web/assets/quadrantDiagram-W4KKPZXB-B-2N2UHr.js → packages/remote-control-server/web/dist/assets/quadrantDiagram-W4KKPZXB-D6epraE1.js} +1 -1
  144. package/packages/remote-control-server/web/dist/assets/{requirementDiagram-4Y6WPE33-39jlO9Y8.js → requirementDiagram-4Y6WPE33-BHmML6bk.js} +1 -1
  145. package/{dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-DdY7KNFB.js → packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-CIKij54Y.js} +1 -1
  146. package/packages/remote-control-server/web/dist/assets/{sequenceDiagram-3UESZ5HK-D2k5rX6x.js → sequenceDiagram-3UESZ5HK-CY0y5zdR.js} +1 -1
  147. package/packages/remote-control-server/web/dist/assets/{stateDiagram-AJRCARHV-CP9N457o.js → stateDiagram-AJRCARHV-FBhNz1Lc.js} +1 -1
  148. package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-CPhZYlL0.js → stateDiagram-v2-BHNVJYJU-m7ruBTu5.js} +1 -1
  149. package/{dist/rcs-web/assets/timeline-definition-PNZ67QCA-DSEPBO8O.js → packages/remote-control-server/web/dist/assets/timeline-definition-PNZ67QCA-CJopHs1x.js} +1 -1
  150. package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-CkNMwCJ3.js → vennDiagram-CIIHVFJN-DF_uHOP7.js} +1 -1
  151. package/packages/remote-control-server/web/dist/assets/{wardleyDiagram-YWT4CUSO-Cxd-F60s.js → wardleyDiagram-YWT4CUSO-DQmjIZJA.js} +1 -1
  152. package/{dist/rcs-web/assets/xychartDiagram-2RQKCTM6-BLL105NN.js → packages/remote-control-server/web/dist/assets/xychartDiagram-2RQKCTM6-v8zL-j4G.js} +1 -1
  153. package/packages/remote-control-server/web/dist/index.html +2 -2
  154. package/dist/rcs-web/assets/SessionDetail-D-xhkyLo.js +0 -65
  155. package/dist/rcs-web/assets/SessionVisibilityBadge-91WyR9K6.js +0 -11
  156. package/dist/rcs-web/assets/ShareLanding-DhwgJb6V.js +0 -1
  157. package/dist/rcs-web/assets/channel-CCfqpGSl.js +0 -1
  158. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-DzNdVs3v.js +0 -1
  159. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-DzNdVs3v.js +0 -1
  160. package/dist/rcs-web/assets/main-DhbquBXW.css +0 -1
  161. package/dist/rcs-web/assets/main-N3GYCdLF.js +0 -260
  162. package/packages/remote-control-server/web/dist/assets/SessionDetail-D-xhkyLo.js +0 -65
  163. package/packages/remote-control-server/web/dist/assets/SessionVisibilityBadge-91WyR9K6.js +0 -11
  164. package/packages/remote-control-server/web/dist/assets/ShareLanding-DhwgJb6V.js +0 -1
  165. package/packages/remote-control-server/web/dist/assets/channel-CCfqpGSl.js +0 -1
  166. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-DzNdVs3v.js +0 -1
  167. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-DzNdVs3v.js +0 -1
  168. package/packages/remote-control-server/web/dist/assets/main-DhbquBXW.css +0 -1
  169. package/packages/remote-control-server/web/dist/assets/main-N3GYCdLF.js +0 -260
@@ -0,0 +1,339 @@
1
+ import{e as i,j as e}from"./vendor-DE_-CLIE.js";import{aq as D,W as L,al as a,K as R,aa as B,F as M,g as K,z as A,p as S,H as P}from"./main-B8hkVvfg.js";import{D as H,a as F,c as O,d as _,b as z}from"./dialog-DympH6_o.js";import{E as $}from"./external-link-J-x6ty1h.js";import{C as q}from"./copy-BD6qrRfd.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";const v=`body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
2
+ h1 { font-size: 22px; } h1, h2 { color: #1a1a1a; }
3
+ .badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500; }
4
+ .badge.ok { background: #dcfce7; color: #166534; }
5
+ .badge.warn { background: #fef3c7; color: #92400e; }
6
+ .badge.err { background: #fee2e2; color: #991b1b; }
7
+ .badge.info { background: #e0e7ff; color: #3730a3; }
8
+ .muted { color: #6b7280; font-size: 12px; }
9
+ .meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 20px; }`,G=`<!DOCTYPE html>
10
+ <html lang="en">
11
+ <head>
12
+ <meta charset="utf-8">
13
+ <meta name="viewport" content="width=device-width, initial-scale=1">
14
+ <title>Untitled Artifact</title>
15
+ <style>
16
+ ${v}
17
+ </style>
18
+ </head>
19
+ <body>
20
+ <h1>Untitled Artifact</h1>
21
+ <div class="meta"><span class="muted">Created from the RCS artifacts gallery</span></div>
22
+ <!-- content here -->
23
+ </body>
24
+ </html>`,V=`<!DOCTYPE html>
25
+ <html lang="en">
26
+ <head>
27
+ <meta charset="utf-8">
28
+ <meta name="viewport" content="width=device-width, initial-scale=1">
29
+ <title>PR Review</title>
30
+ <style>
31
+ ${v}
32
+ .file { border: 1px solid #e5e7eb; border-radius: 8px; margin: 12px 0; overflow: hidden; }
33
+ .file-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f9fafb; cursor: pointer; }
34
+ .file-head .name { font-family: ui-monospace, Menlo, monospace; font-size: 13px; flex: 1; }
35
+ .file-body { padding: 12px 14px; border-top: 1px solid #e5e7eb; display: none; }
36
+ .file.open .file-body { display: block; }
37
+ .comment { background: #fffbeb; border-left: 3px solid #f59e0b; padding: 8px 12px; margin: 8px 0; border-radius: 4px; font-size: 13px; }
38
+ select { font: inherit; padding: 2px 6px; border-radius: 6px; border: 1px solid #d1d5db; }
39
+ #summary { font-size: 13px; }
40
+ </style>
41
+ </head>
42
+ <body>
43
+ <h1>PR Review — <span id="pr-name">#123</span></h1>
44
+ <div class="meta">
45
+ <span class="badge info" id="overall">REVIEW IN PROGRESS</span>
46
+ <span class="muted" id="stamp"></span>
47
+ </div>
48
+ <div id="summary"></div>
49
+ <div id="files"></div>
50
+ <script>
51
+ var FILES = [
52
+ { path: 'src/index.ts', verdict: 'comment', lines: '+42 −7',
53
+ note: '入口重构 — 建议补充 JSDoc。' },
54
+ { path: 'src/utils/http.ts', verdict: 'request-changes', lines: '+128 −31',
55
+ note: '缺少超时与重试;error path 未释放连接。' },
56
+ { path: 'tests/http.test.ts', verdict: 'approve', lines: '+96 −0',
57
+ note: '覆盖充分,LGTM。' },
58
+ ];
59
+ var VERDICTS = {
60
+ 'approve': ['✓ Approve', 'ok'],
61
+ 'comment': ['💬 Comment', 'info'],
62
+ 'request-changes': ['✕ Request changes', 'err'],
63
+ };
64
+ function render() {
65
+ var box = document.getElementById('files');
66
+ box.innerHTML = '';
67
+ var counts = { 'approve': 0, 'comment': 0, 'request-changes': 0 };
68
+ FILES.forEach(function (f, i) {
69
+ counts[f.verdict]++;
70
+ var div = document.createElement('div');
71
+ div.className = 'file';
72
+ div.innerHTML =
73
+ '<div class="file-head"><span class="name">' + f.path + '</span>' +
74
+ '<span class="muted">' + f.lines + '</span>' +
75
+ '<select data-i="' + i + '">' + Object.keys(VERDICTS).map(function (v) {
76
+ return '<option value="' + v + '"' + (v === f.verdict ? ' selected' : '') + '>' + VERDICTS[v][0] + '</option>';
77
+ }).join('') + '</select></div>' +
78
+ '<div class="file-body"><div class="comment">' + (f.note || '—') + '</div></div>';
79
+ div.querySelector('.file-head').addEventListener('click', function () {
80
+ div.classList.toggle('open');
81
+ });
82
+ div.querySelector('select').addEventListener('click', function (e) { e.stopPropagation(); });
83
+ div.querySelector('select').addEventListener('change', function (e) {
84
+ FILES[i].verdict = e.target.value;
85
+ render();
86
+ });
87
+ box.appendChild(div);
88
+ });
89
+ var overall = document.getElementById('overall');
90
+ var label = 'REVIEW IN PROGRESS';
91
+ var cls = 'info';
92
+ if (counts['request-changes'] > 0) { label = 'CHANGES REQUESTED'; cls = 'err'; }
93
+ else if (counts['approve'] === FILES.length && FILES.length > 0) { label = 'APPROVED'; cls = 'ok'; }
94
+ overall.textContent = label;
95
+ overall.className = 'badge ' + cls;
96
+ document.getElementById('summary').innerHTML =
97
+ '<span class="badge ok">✓ ' + counts['approve'] + '</span> ' +
98
+ '<span class="badge info">💬 ' + counts['comment'] + '</span> ' +
99
+ '<span class="badge err">✕ ' + counts['request-changes'] + '</span> ' +
100
+ '<span class="muted"> — 点击文件行展开评论</span>';
101
+ document.getElementById('stamp').textContent = 'updated ' + new Date().toLocaleString();
102
+ }
103
+ render();
104
+ <\/script>
105
+ </body>
106
+ </html>`,W=`<!DOCTYPE html>
107
+ <html lang="en">
108
+ <head>
109
+ <meta charset="utf-8">
110
+ <meta name="viewport" content="width=device-width, initial-scale=1">
111
+ <title>Incident Timeline</title>
112
+ <style>
113
+ ${v}
114
+ #status-banner { border-radius: 8px; padding: 12px 16px; margin: 12px 0; font-weight: 500; }
115
+ #status-banner.investigating { background: #fef3c7; color: #92400e; }
116
+ #status-banner.mitigated { background: #dcfce7; color: #166534; }
117
+ #status-banner.resolved { background: #e0e7ff; color: #3730a3; }
118
+ .tl { list-style: none; padding: 0; margin: 20px 0; border-left: 2px solid #e5e7eb; }
119
+ .tl li { position: relative; padding: 10px 0 10px 24px; }
120
+ .tl li::before { content: ''; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 999px; background: #9ca3af; }
121
+ .tl li.sev-high::before { background: #ef4444; }
122
+ .tl li.sev-mid::before { background: #f59e0b; }
123
+ .tl li.done::before { background: #22c55e; }
124
+ .tl .ts { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #6b7280; }
125
+ .tl .body { margin-top: 2px; }
126
+ button { font: inherit; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; padding: 2px 10px; cursor: pointer; }
127
+ button:hover { background: #f3f4f6; }
128
+ </style>
129
+ </head>
130
+ <body>
131
+ <h1 id="title">INC-001 — API 5xx 错误率上升</h1>
132
+ <div id="status-banner" class="investigating">🟡 Investigating</div>
133
+ <div class="meta">
134
+ <span class="muted" id="timer"></span>
135
+ <button id="toggle">标记为已缓解</button>
136
+ </div>
137
+ <ul class="tl" id="tl"></ul>
138
+ <script>
139
+ var EVENTS = [
140
+ { ts: '10:02', sev: 'high', text: '告警触发:/api/orders 5xx 比例 &gt; 5%(SLO 燃烧率 8×)' },
141
+ { ts: '10:05', sev: '', text: '值班开始排查,确认影响范围:下单链路全量受影响' },
142
+ { ts: '10:12', sev: 'mid', text: '定位到 09:58 上线的 order-service v2.3.1,连接池配置回归' },
143
+ { ts: '10:18', sev: '', text: '回滚 order-service 至 v2.3.0', done: true },
144
+ { ts: '10:21', sev: '', text: '错误率恢复正常,持续观察中', done: true },
145
+ ];
146
+ var state = 'investigating';
147
+ function render() {
148
+ var tl = document.getElementById('tl');
149
+ tl.innerHTML = '';
150
+ EVENTS.forEach(function (e) {
151
+ var li = document.createElement('li');
152
+ li.className = (e.sev ? 'sev-' + (e.sev === 'high' ? 'high' : 'mid') + ' ' : '') + (e.done ? 'done' : '');
153
+ li.innerHTML = '<span class="ts">' + e.ts + '</span><div class="body">' + e.text + '</div>';
154
+ tl.appendChild(li);
155
+ });
156
+ var banner = document.getElementById('status-banner');
157
+ var texts = { investigating: ['🟡 Investigating', 'mitigated'], mitigated: ['🟢 Mitigated — monitoring', 'resolved'], resolved: ['🔵 Resolved', 'investigating'] };
158
+ banner.textContent = texts[state][0];
159
+ banner.className = state;
160
+ document.getElementById('toggle').textContent =
161
+ state === 'investigating' ? '标记为已缓解' : state === 'mitigated' ? '标记为已解决' : '重新打开';
162
+ document.getElementById('timer').textContent = 'last update ' + new Date().toLocaleTimeString();
163
+ }
164
+ document.getElementById('toggle').addEventListener('click', function () {
165
+ state = document.getElementById('status-banner').className === 'investigating' ? 'mitigated'
166
+ : document.getElementById('status-banner').className === 'mitigated' ? 'resolved' : 'investigating';
167
+ render();
168
+ });
169
+ render();
170
+ <\/script>
171
+ </body>
172
+ </html>`,U=`<!DOCTYPE html>
173
+ <html lang="en">
174
+ <head>
175
+ <meta charset="utf-8">
176
+ <meta name="viewport" content="width=device-width, initial-scale=1">
177
+ <title>Data Dashboard</title>
178
+ <style>
179
+ ${v}
180
+ .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
181
+ .kpi { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
182
+ .kpi .label { font-size: 12px; color: #6b7280; }
183
+ .kpi .value { font-size: 26px; font-weight: 600; margin: 4px 0; }
184
+ .kpi .delta { font-size: 12px; }
185
+ .kpi .delta.up { color: #16a34a; } .kpi .delta.down { color: #dc2626; }
186
+ table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 13px; }
187
+ th, td { border: 1px solid #e5e7eb; padding: 6px 10px; text-align: left; }
188
+ th { background: #f9fafb; cursor: pointer; user-select: none; }
189
+ th.sorted-asc::after { content: ' ↑'; } th.sorted-desc::after { content: ' ↓'; }
190
+ </style>
191
+ </head>
192
+ <body>
193
+ <h1>Weekly Data Dashboard</h1>
194
+ <div class="meta"><span class="muted" id="stamp"></span></div>
195
+ <div class="grid" id="kpis"></div>
196
+ <svg id="chart" width="860" height="180" viewBox="0 0 860 180" role="img" aria-label="trend chart"></svg>
197
+ <table id="tbl"><thead><tr></tr></thead><tbody></tbody></table>
198
+ <script>
199
+ var KPIS = [
200
+ { label: 'Requests', value: '1.24M', delta: '+8.2%', dir: 'up' },
201
+ { label: 'Error rate', value: '0.42%', delta: '-0.11pp', dir: 'up' },
202
+ { label: 'p95 latency', value: '213ms', delta: '-18ms', dir: 'up' },
203
+ { label: 'Active users', value: '18,304', delta: '+3.1%', dir: 'up' },
204
+ ];
205
+ var SERIES = [42, 48, 45, 61, 58, 72, 69, 77, 74, 88, 92, 96];
206
+ var ROWS = [
207
+ { service: 'gateway', rps: 5210, err: '0.31%', p95: '142ms' },
208
+ { service: 'orders', rps: 3140, err: '0.48%', p95: '231ms' },
209
+ { service: 'payments', rps: 1890, err: '0.66%', p95: '305ms' },
210
+ { service: 'search', rps: 1230, err: '0.22%', p95: '98ms' },
211
+ ];
212
+ var sortKey = 'rps', sortDir = -1;
213
+ function renderKpis() {
214
+ document.getElementById('kpis').innerHTML = KPIS.map(function (k) {
215
+ return '<div class="kpi"><div class="label">' + k.label + '</div>' +
216
+ '<div class="value">' + k.value + '</div>' +
217
+ '<div class="delta ' + k.dir + '">' + k.delta + ' vs last week</div></div>';
218
+ }).join('');
219
+ }
220
+ function renderChart() {
221
+ var svg = document.getElementById('chart');
222
+ var w = 860, h = 180, pad = 20, max = Math.max.apply(null, SERIES) * 1.15;
223
+ var pts = SERIES.map(function (v, i) {
224
+ var x = pad + (i * (w - pad * 2)) / (SERIES.length - 1);
225
+ var y = h - pad - (v / max) * (h - pad * 2);
226
+ return x.toFixed(1) + ',' + y.toFixed(1);
227
+ });
228
+ var line = '<polyline fill="none" stroke="#D77757" stroke-width="2.5" points="' + pts.join(' ') + '"/>';
229
+ var area = '<polygon fill="#D7775718" points="' + pad + ',' + (h - pad) + ' ' + pts.join(' ') + ' ' + (w - pad) + ',' + (h - pad) + '"/>';
230
+ var dots = pts.map(function (p) {
231
+ var xy = p.split(',');
232
+ return '<circle cx="' + xy[0] + '" cy="' + xy[1] + '" r="3" fill="#D77757"/>';
233
+ }).join('');
234
+ svg.innerHTML = area + line + dots;
235
+ }
236
+ function renderTable() {
237
+ var cols = Object.keys(ROWS[0]);
238
+ var head = document.querySelector('#tbl thead tr');
239
+ head.innerHTML = cols.map(function (c) {
240
+ var cls = c === sortKey ? (sortDir === 1 ? 'sorted-asc' : 'sorted-desc') : '';
241
+ return '<th data-col="' + c + '" class="' + cls + '">' + c + '</th>';
242
+ }).join('');
243
+ var sorted = ROWS.slice().sort(function (a, b) {
244
+ var va = a[sortKey], vb = b[sortKey];
245
+ return (typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb))) * sortDir;
246
+ });
247
+ document.querySelector('#tbl tbody').innerHTML = sorted.map(function (r) {
248
+ return '<tr>' + cols.map(function (c) { return '<td>' + r[c] + '</td>'; }).join('') + '</tr>';
249
+ }).join('');
250
+ head.querySelectorAll('th').forEach(function (th) {
251
+ th.addEventListener('click', function () {
252
+ var col = th.dataset.col;
253
+ if (col === sortKey) { sortDir = -sortDir; } else { sortKey = col; sortDir = 1; }
254
+ renderTable();
255
+ });
256
+ });
257
+ document.getElementById('stamp').textContent = 'generated ' + new Date().toLocaleString();
258
+ }
259
+ renderKpis(); renderChart(); renderTable();
260
+ <\/script>
261
+ </body>
262
+ </html>`,Y=`<!DOCTYPE html>
263
+ <html lang="en">
264
+ <head>
265
+ <meta charset="utf-8">
266
+ <meta name="viewport" content="width=device-width, initial-scale=1">
267
+ <title>Release Checklist</title>
268
+ <style>
269
+ ${v}
270
+ .progress { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 14px 0 22px; }
271
+ .progress > div { height: 100%; background: #D77757; width: 0; transition: width .3s; }
272
+ .stage { margin: 18px 0; }
273
+ .stage h2 { font-size: 15px; display: flex; gap: 8px; align-items: center; }
274
+ .item { display: flex; gap: 10px; align-items: baseline; padding: 6px 0 6px 4px; border-left: 2px solid transparent; }
275
+ .item.done { color: #6b7280; text-decoration: line-through; border-left-color: #22c55e; }
276
+ .item input { accent-color: #D77757; }
277
+ .item .note { color: #6b7280; font-size: 12px; }
278
+ .blocked { color: #b91c1c; font-weight: 500; }
279
+ </style>
280
+ </head>
281
+ <body>
282
+ <h1>Release Checklist — <span id="rel">v1.4.0</span></h1>
283
+ <div class="meta"><span class="badge info" id="pct">0%</span><span class="muted" id="blocked-count"></span></div>
284
+ <div class="progress"><div id="bar"></div></div>
285
+ <div id="stages"></div>
286
+ <script>
287
+ var STAGES = [
288
+ { name: 'Pre-merge', items: [
289
+ { t: '所有 PR 已合并到 release 分支', note: '' },
290
+ { t: 'CI 全绿(单元 + 集成)', note: '' },
291
+ { t: 'CHANGELOG 更新', note: '由 changeset 生成' },
292
+ ]},
293
+ { name: 'Staging', items: [
294
+ { t: 'staging 部署完成并通过冒烟测试', note: '' },
295
+ { t: '数据库迁移在 staging 演练', note: '含回滚脚本' },
296
+ ]},
297
+ { name: 'Production', items: [
298
+ { t: '灰度 5% 观察 30 分钟', note: '错误率 & p95 正常后放量' },
299
+ { t: '全量发布', note: '' },
300
+ ]},
301
+ { name: 'Post-deploy', items: [
302
+ { t: '核心指标看板确认', note: 'dashboard 链接见备注' },
303
+ { t: '发布公告 / 通知团队', note: '' },
304
+ ]},
305
+ ];
306
+ function render() {
307
+ var box = document.getElementById('stages');
308
+ box.innerHTML = '';
309
+ var total = 0, done = 0, blocked = 0;
310
+ STAGES.forEach(function (s) {
311
+ total += s.items.length;
312
+ var stage = document.createElement('div');
313
+ stage.className = 'stage';
314
+ stage.innerHTML = '<h2>' + s.name + '</h2>';
315
+ s.items.forEach(function (it, i) {
316
+ if (it.done) done++;
317
+ if (it.blocked) blocked++;
318
+ var row = document.createElement('label');
319
+ row.className = 'item' + (it.done ? ' done' : '');
320
+ row.innerHTML = '<input type="checkbox"' + (it.done ? ' checked' : '') + '/>' +
321
+ '<span>' + it.t + (it.blocked ? ' <span class="blocked">⚠ blocked</span>' : '') + '</span>' +
322
+ (it.note ? '<span class="note">— ' + it.note + '</span>' : '');
323
+ row.querySelector('input').addEventListener('change', function () {
324
+ it.done = !it.done;
325
+ render();
326
+ });
327
+ stage.appendChild(row);
328
+ });
329
+ box.appendChild(stage);
330
+ });
331
+ var pct = total ? Math.round((done / total) * 100) : 0;
332
+ document.getElementById('pct').textContent = pct + '%';
333
+ document.getElementById('bar').style.width = pct + '%';
334
+ document.getElementById('blocked-count').textContent = blocked ? blocked + ' 项受阻' : done + '/' + total + ' 完成';
335
+ }
336
+ render();
337
+ <\/script>
338
+ </body>
339
+ </html>`,N=[{id:"blank",titleKey:"artifacts.create.templateBlank",descKey:"",defaultTitle:"Untitled Artifact",html:G},{id:"pr-review",titleKey:"artifacts.create.templatePrReview",descKey:"artifacts.templateDesc.prReview",defaultTitle:"PR Review",html:V},{id:"incident",titleKey:"artifacts.create.templateIncident",descKey:"artifacts.templateDesc.incident",defaultTitle:"Incident Timeline",html:W},{id:"dashboard",titleKey:"artifacts.create.templateDashboard",descKey:"artifacts.templateDesc.dashboard",defaultTitle:"Data Dashboard",html:U},{id:"checklist",titleKey:"artifacts.create.templateChecklist",descKey:"artifacts.templateDesc.checklist",defaultTitle:"Release Checklist",html:Y}];function b(s){return N.find(o=>o.id===s)??N[0]}function I(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function J(s){if(!s)return"—";try{return new Date(s).toLocaleString()}catch{return s}}function Q(s){if(!s)return null;const o=new Date(s).getTime();return Number.isNaN(o)?null:Math.ceil((o-Date.now())/(1440*60*1e3))}function ie({sessionId:s,embedded:o=!1}){D();const[y,u]=i.useState([]),[p,w]=i.useState(!0),[x,f]=i.useState(""),[m,d]=i.useState(!1),[k,h]=i.useState(null),c=i.useCallback(async()=>{try{const t=await L(s?{session_id:s}:void 0);u(t||[]),f("")}catch(t){f(t instanceof Error?t.message:a("artifacts.loadFailed"))}finally{w(!1)}},[s]);i.useEffect(()=>{c();const t=setInterval(c,15e3);return window.addEventListener("focus",c),()=>{clearInterval(t),window.removeEventListener("focus",c)}},[c]);const g=i.useCallback(t=>{d(!1),u(n=>[t,...n.filter(C=>C.id!==t.id)])},[]),E=i.useCallback(async t=>{if(window.confirm(a("artifacts.delete")+" — "+t.slice(0,8)+"…?"))try{await R(t),u(n=>n.filter(C=>C.id!==t))}catch(n){alert(n instanceof Error?n.message:a("artifacts.deleteFailed"))}},[]),j=i.useCallback(async t=>{await B(`${window.location.origin}${t.url}`)&&(h(t.id),setTimeout(()=>h(null),1500))},[]),r=i.useMemo(()=>y,[y]),l=e.jsxs(e.Fragment,{children:[x&&e.jsx("p",{className:"text-status-error text-sm",children:x}),p?e.jsx("div",{className:"space-y-3",children:[0,1,2].map(t=>e.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},t))}):r.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[e.jsx(M,{className:"mx-auto h-8 w-8 text-text-muted/40"}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:a("artifacts.empty")})]}):e.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:r.map(t=>{const n=Q(t.expires_at);return e.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("a",{href:`/code/a/${t.id}`,className:"min-w-0 flex-1 no-underline",children:[e.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:t.title||t.id.slice(0,12)}),e.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[t.id.slice(0,10),"… · v",t.version," · ",I(t.size)]})]}),e.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${n!==null&&n<=0?"bg-status-error/15 text-status-error":n!==null&&n<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:n===null?"∞":`${n}d`})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[t.session_id&&e.jsxs("a",{href:`/code/${t.session_id}`,className:"truncate text-text-muted hover:text-accent",title:t.session_id,children:[a("artifacts.session"),": ",t.session_id.slice(0,14),"…"]}),e.jsxs("span",{className:"flex items-center gap-1",title:a("artifacts.updatedAt"),children:[e.jsx(K,{className:"h-3 w-3"}),J(t.updated_at)]})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[e.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:a("artifacts.openInNewTab"),children:e.jsx($,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{type:"button",onClick:()=>j(t),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:a("artifacts.copyLink"),children:[e.jsx(q,{className:"h-3.5 w-3.5"}),k===t.id&&e.jsx("span",{className:"text-status-active",children:a("artifacts.copied")})]}),e.jsx("button",{type:"button",onClick:()=>E(t.id),className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:a("artifacts.delete"),children:e.jsx(A,{className:"h-3.5 w-3.5"})})]})]},t.id)})})]});return o?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-medium text-text-primary",children:a("artifacts.title")}),e.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex items-center gap-1 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90",children:[e.jsx(S,{className:"h-4 w-4"}),a("artifacts.new")]})]}),l,e.jsx(T,{open:m,onClose:()=>d(!1),onCreated:g,sessionId:s})]}):e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10 flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary sm:text-4xl",children:a("artifacts.title")}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:a("artifacts.subtitle")})]}),e.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-white transition-all hover:bg-accent/90 active:translate-y-px",children:[e.jsx(S,{className:"h-4 w-4"}),a("artifacts.new")]})]}),l,e.jsx(T,{open:m,onClose:()=>d(!1),onCreated:g,sessionId:s})]})}function T({open:s,onClose:o,onCreated:y,sessionId:u}){D();const[p,w]=i.useState("pr-review"),[x,f]=i.useState(""),[m,d]=i.useState(""),[k,h]=i.useState(!1),[c,g]=i.useState("");i.useEffect(()=>{s&&(w("pr-review"),f(""),d(""),h(!1),g(""))},[s]);const E=r=>{w(r);const l=b(r);d(l.html),x.trim()||f(l.defaultTitle)},j=async()=>{const r=m.trim()||b(p).html;if(r){h(!0),g("");try{const l={html:r,title:x.trim()||b(p).defaultTitle,ttl:30};u&&(l.session_id=u);const t=await P(l);y(t)}catch(l){g(l instanceof Error?l.message:a("artifacts.create.failed"))}finally{h(!1)}}};return e.jsx(H,{open:s,onOpenChange:r=>r?void 0:o(),children:e.jsxs(F,{className:"max-h-[85vh] overflow-y-auto sm:max-w-2xl",children:[e.jsx(O,{children:e.jsx(_,{children:a("artifacts.create.title")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:a("artifacts.create.template")}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:N.map(r=>e.jsxs("button",{type:"button",onClick:()=>E(r.id),className:`rounded-lg border p-3 text-left transition-colors ${p===r.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[e.jsx("div",{className:"text-sm font-medium text-text-primary",children:a(r.titleKey)}),r.descKey&&e.jsx("div",{className:"mt-1 text-xs text-text-muted",children:a(r.descKey)})]},r.id))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:a("artifacts.create.title.label")}),e.jsx("input",{id:"artifact-title",type:"text",value:x,onChange:r=>f(r.target.value),placeholder:b(p).defaultTitle,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:a("artifacts.create.content")}),e.jsx("textarea",{id:"artifact-content",value:m,onChange:r=>d(r.target.value),placeholder:b(p).html.slice(0,120)+"…",rows:10,spellCheck:!1,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-primary focus:border-accent focus:outline-none"}),e.jsx("p",{className:"mt-1 text-xs text-text-muted",children:m.trim()?`${I(new Blob([m]).size)}`:a("artifacts.create.content")})]}),c&&e.jsx("p",{className:"text-sm text-status-error",children:c})]}),e.jsxs(z,{children:[e.jsx("button",{type:"button",onClick:o,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:j,disabled:k,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:k?a("common.creating"):a("artifacts.create.submit")})]})]})})}export{ie as ArtifactsGallery};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{E as u,J as f}from"./main-N3GYCdLF.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";const v=2e3,N=3e4;function E(){const c=window.location.pathname.split("/"),i=c[c.length-1]||"",[s,n]=r.useState("idle"),[m,l]=r.useState(null),[a,d]=r.useState(null);return r.useEffect(()=>{if(!i||!i.startsWith("clm_")){l("Invalid claim token"),n("error");return}n("claiming"),u(i).then(t=>{d(t.environment_id),n("waiting")}).catch(t=>{l(t instanceof Error?t.message:"Claim failed"),n("error")})},[i]),r.useEffect(()=>{if(s!=="waiting"||!a)return;let t=!1;const x=Date.now(),o=setInterval(()=>{if(Date.now()-x>N){clearInterval(o),t||n("timeout");return}f().then(h=>{t||(h||[]).some(p=>p.environment_id===a)&&(clearInterval(o),window.location.href="/code/")}).catch(()=>{})},v);return()=>{t=!0,clearInterval(o)}},[s,a]),s==="claiming"?e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})}):s==="error"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsx("p",{className:"text-sm text-destructive",children:m}),e.jsx("a",{href:"/code",className:"mt-4 inline-block text-accent hover:underline",children:"Back to dashboard"})]}):s==="waiting"||s==="timeout"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight text-text-primary",children:"Environment claimed"}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:"You are now the owner of this environment."})]}),e.jsxs("div",{className:"space-y-4",children:[a&&e.jsx("p",{className:"font-mono text-xs text-text-muted",children:a}),s==="waiting"?e.jsxs("p",{className:"text-sm text-text-muted",children:["Waiting for the worker to create a session",e.jsx("span",{className:"animate-pulse",children:"…"})]}):e.jsx("p",{className:"text-sm text-text-muted",children:"The worker has not created a session yet — it may be offline or stopped. The session will appear on the dashboard once the worker connects."}),e.jsx("a",{href:"/code",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 transition-colors",children:"Go to dashboard"})]})]}):e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})})}export{E as Claim};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{E as u,Q as f}from"./main-B8hkVvfg.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";const v=2e3,N=3e4;function E(){const c=window.location.pathname.split("/"),i=c[c.length-1]||"",[s,n]=r.useState("idle"),[m,l]=r.useState(null),[a,d]=r.useState(null);return r.useEffect(()=>{if(!i||!i.startsWith("clm_")){l("Invalid claim token"),n("error");return}n("claiming"),u(i).then(t=>{d(t.environment_id),n("waiting")}).catch(t=>{l(t instanceof Error?t.message:"Claim failed"),n("error")})},[i]),r.useEffect(()=>{if(s!=="waiting"||!a)return;let t=!1;const x=Date.now(),o=setInterval(()=>{if(Date.now()-x>N){clearInterval(o),t||n("timeout");return}f().then(h=>{t||(h||[]).some(p=>p.environment_id===a)&&(clearInterval(o),window.location.href="/code/")}).catch(()=>{})},v);return()=>{t=!0,clearInterval(o)}},[s,a]),s==="claiming"?e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})}):s==="error"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsx("p",{className:"text-sm text-destructive",children:m}),e.jsx("a",{href:"/code",className:"mt-4 inline-block text-accent hover:underline",children:"Back to dashboard"})]}):s==="waiting"||s==="timeout"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight text-text-primary",children:"Environment claimed"}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:"You are now the owner of this environment."})]}),e.jsxs("div",{className:"space-y-4",children:[a&&e.jsx("p",{className:"font-mono text-xs text-text-muted",children:a}),s==="waiting"?e.jsxs("p",{className:"text-sm text-text-muted",children:["Waiting for the worker to create a session",e.jsx("span",{className:"animate-pulse",children:"…"})]}):e.jsx("p",{className:"text-sm text-text-muted",children:"The worker has not created a session yet — it may be offline or stopped. The session will appear on the dashboard once the worker connects."}),e.jsx("a",{href:"/code",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 transition-colors",children:"Go to dashboard"})]})]}):e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})})}export{E as Claim};
@@ -1,6 +1,6 @@
1
- import{j as e,e as o}from"./vendor-DE_-CLIE.js";import{a5 as O,a4 as _,al as E,aj as T,x as F,ak as L,af as a,a8 as A,q as $,s as W,e as H,r as V,d as P,ab as q,G,J,K,I as R}from"./main-N3GYCdLF.js";import{g as D}from"./workerType-Bd-zteMi.js";import{S as U,D as Z,a as z,c as Q,d as X,b as Y}from"./SessionVisibilityBadge-91WyR9K6.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";/**
1
+ import{j as e,e as l}from"./vendor-DE_-CLIE.js";import{ab as O,a9 as _,ar as E,ap as T,x as F,aq as L,al as a,ae as A,q as $,s as W,e as q,r as H,d as P,ah as V,I as Q,Q as R,Y as U,N as Y}from"./main-B8hkVvfg.js";import{g as D}from"./workerType-Bd-zteMi.js";import{S as Z}from"./SessionVisibilityBadge-raEV1sW8.js";import{D as z,a as G,c as J,d as K,b as X}from"./dialog-DympH6_o.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const ee=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],te=O("folder",ee);function se({teamName:n,className:x}){return n?e.jsx("span",{className:_("inline-flex items-center rounded-full border border-border/60 bg-surface-2 px-2 py-0.5 text-xs text-text-muted",x),children:n}):null}function re({environments:n,onSelectEnvironment:x}){const{activeTeam:b}=E(),{user:u}=T(),i=o.useMemo(()=>(u==null?void 0:u.role)==="admin"?n:b?n.filter(r=>r.team_id===b.id):n.filter(r=>!r.team_id),[n,b,u]);return!i||i.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-8 text-center text-text-muted",children:"No active environments"}):e.jsx("div",{className:"space-y-2",children:i.map(r=>{const c=r.worker_type==="acp",p=D(r.worker_type),h=p.fullLabel,g=p.colorClass;return e.jsxs("button",{type:"button",onClick:()=>x==null?void 0:x(r),disabled:c,className:`flex w-full items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 text-left transition-colors ${c?"cursor-default opacity-80":"hover:border-border-light cursor-pointer"}`,children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-text-primary",children:r.machine_name||r.id}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${g}`,children:h}),e.jsx(se,{teamName:r.team_name??null})]}),e.jsx("div",{className:"text-sm text-text-muted",children:r.directory||""})]})}),e.jsxs("div",{className:"text-right",children:[e.jsx(F,{status:r.status}),e.jsx("div",{className:"mt-1 text-xs text-text-muted",children:r.branch||""})]})]},r.id)})})}function ae({sessions:n,environments:x,onSelect:b,onDelete:u}){L();const{activeTeam:i,myTeams:r}=E(),{user:c}=T(),p=o.useMemo(()=>{const t=new Map;for(const m of r)t.set(m.id,m.name);return t},[r]),h=o.useMemo(()=>(c==null?void 0:c.role)==="admin"?n:i?n.filter(t=>t.owner_type==="team"&&t.owner_id===i.id):n.filter(t=>t.owner_type==="user"||t.access_level==="write"||t.access_level==="read"),[n,i,c]),{mySessions:g,sharedSessions:w}=o.useMemo(()=>{const t=[],m=[];for(const d of h)i?t.push(d):d.access_level==="write"||d.access_level==="read"?m.push(d):t.push(d);return{mySessions:t,sharedSessions:m}},[h,i]),y=new Map;for(const t of x??[])t!=null&&t.id&&t.worker_type&&y.set(t.id,t.worker_type);const l=(t,m)=>(m.updated_at||0)-(t.updated_at||0);function f(t){const m=!!u&&t.access_level!=="write"&&t.access_level!=="read";return e.jsxs("div",{className:"group flex w-full items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 text-left transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("button",{type:"button",onClick:()=>b(t.id),className:"min-w-0 flex-1 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id}),t.visibility&&e.jsx(U,{visibility:t.visibility||"private"}),(()=>{var k;let d=t.source==="acp"?"acp":(k=t.environment)==null?void 0:k.worker_type;!d&&t.environment_id&&(d=y.get(t.environment_id));const j=D(d);return e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${j.colorClass}`,children:j.fullLabel})})()]}),e.jsxs("div",{className:"flex items-center gap-2 truncate text-xs text-text-muted",children:[e.jsx("span",{className:"truncate font-mono",children:t.id}),t.owner_type==="team"&&t.owner_id&&e.jsxs("span",{className:"inline-flex items-center gap-2 truncate",children:[e.jsx("span",{className:"text-text-muted/40",children:"|"}),e.jsx("span",{className:"truncate",children:p.get(t.owner_id)||t.owner_id})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(F,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:A(t.created_at||t.updated_at)}),m&&e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),u(t.id)},className:"rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100",title:"Delete session",children:e.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},t.id)}if(h.length===0)return e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-8 text-center text-text-muted",children:"No sessions"});const N=[...g].sort(l),v=[...w].sort(l);return e.jsxs("div",{className:"space-y-4",children:[N.length>0&&e.jsxs("section",{className:"space-y-2",children:[!i&&v.length>0&&e.jsx("h3",{className:"px-1 text-xs font-medium uppercase tracking-wide text-text-muted",children:a("session.mySessions")}),N.map(f)]}),v.length>0&&e.jsxs("section",{className:"space-y-2",children:[e.jsx("h3",{className:"px-1 text-xs font-medium uppercase tracking-wide text-text-muted",children:a("session.sharedWithMe")}),v.map(f)]})]})}function ne({open:n,environments:x,onClose:b,onCreated:u}){L();const{activeTeam:i}=E(),{user:r}=T(),[c,p]=o.useState(""),[h,g]=o.useState(""),[w,y]=o.useState("same-dir"),[l,f]=o.useState(""),[N,v]=o.useState(!1),[t,m]=o.useState(!1),d=o.useMemo(()=>(r==null?void 0:r.role)==="admin"?x:i?x.filter(s=>s.team_id===i.id):x.filter(s=>!s.team_id),[x,i,r]);o.useEffect(()=>{n&&(p(""),g(""),y("same-dir"),f(""),m(!1))},[n]);const j=d.find(s=>s.id===h)||null,k=j?d.findIndex(s=>s.id===j.id)+1:null,B=async()=>{v(!0),f("");try{const s={};c.trim()&&(s.title=c.trim()),h&&(s.environment_id=h),s.spawn_mode=w;const S=q();S&&(s.team_id=S);const C=await G(s);u(C)}catch(s){f(s instanceof Error?s.message:a("dialog.createFailed"))}finally{v(!1)}};return e.jsx(Z,{open:n,onOpenChange:s=>{s||b()},children:e.jsxs(z,{className:"max-w-md rounded-2xl border-border bg-surface-1 p-6 shadow-2xl",children:[e.jsx(Q,{children:e.jsx(X,{className:"font-display text-lg font-semibold text-text-primary",children:a("dialog.newSession")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:a("dialog.titleOptional")}),e.jsx("input",{type:"text",value:c,onChange:s=>p(s.target.value),placeholder:a("dialog.titlePlaceholder"),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:a("dialog.environment")}),e.jsxs($,{open:t,onOpenChange:m,children:[e.jsx(W,{asChild:!0,children:e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary hover:border-border-light focus:border-brand focus:outline-none transition-colors",children:[e.jsx("span",{className:_("flex items-center gap-2 truncate",!j&&"text-text-muted"),children:j?e.jsxs(e.Fragment,{children:[k!==null&&e.jsxs("span",{className:"shrink-0 rounded bg-surface-3 px-1.5 py-0.5 text-[10px] font-mono text-text-muted",children:["#",k]}),e.jsx("span",{className:"truncate",children:j.machine_name||j.id}),e.jsx("span",{className:"shrink-0 text-text-muted",children:"·"}),e.jsx("span",{className:"shrink-0 text-text-muted",children:D(j.worker_type).shortLabel})]}):e.jsx("span",{children:a("dialog.none")})}),e.jsx(H,{className:"h-4 w-4 shrink-0 text-text-muted"})]})}),e.jsxs(V,{align:"start",className:"max-h-80 w-80 overflow-y-auto rounded-lg border-border bg-surface-1 p-1 shadow-xl",children:[e.jsxs("button",{type:"button",onClick:()=>{g(""),m(!1)},className:"flex w-full items-center justify-between rounded-md px-3 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:[e.jsx("span",{children:a("dialog.none")}),!h&&e.jsx(P,{className:"h-3.5 w-3.5 text-brand"})]}),d.length===0?e.jsx("p",{className:"px-3 py-2 text-xs text-text-muted",children:a("dialog.envEmpty")}):e.jsx("div",{className:"space-y-1 pt-1",children:d.map((s,S)=>{const C=D(s.worker_type),M=!!s.team_id,I=s.id===h;return e.jsxs("button",{type:"button",onClick:()=>{g(s.id),m(!1)},className:_("flex w-full flex-col gap-1.5 rounded-md px-3 py-2 text-left transition-colors",I?"bg-brand/10":"hover:bg-surface-2"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"shrink-0 rounded bg-surface-3 px-1.5 py-0.5 text-[10px] font-mono text-text-muted",children:["#",S+1]}),e.jsx("span",{className:"truncate font-medium text-text-primary",children:s.machine_name||s.id}),e.jsx("span",{className:_("shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium",C.colorClass),children:C.shortLabel}),e.jsx("span",{className:_("shrink-0 rounded-full border px-2 py-0.5 text-[10px] font-medium",M?"border-border/60 bg-surface-2 text-text-muted":"border-brand/30 bg-brand/10 text-brand"),children:M?`${a("dialog.envTeam")}: ${s.team_name||s.team_id}`:a("dialog.envPersonal")}),I&&e.jsx(P,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand"})]}),s.directory&&e.jsxs("div",{className:"flex items-center gap-1.5 truncate text-xs text-text-muted",children:[e.jsx(te,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate font-mono",children:s.directory}),s.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-muted/40",children:"·"}),e.jsx("span",{className:"truncate",children:s.branch})]})]})]},s.id)})})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:a("dialog.workspaceMode")}),e.jsxs("select",{value:w,onChange:s=>y(s.target.value),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-brand focus:outline-none",children:[e.jsx("option",{value:"same-dir",children:a("dialog.sameDir")}),e.jsx("option",{value:"worktree",children:a("dialog.worktree")})]})]}),l&&e.jsx("div",{className:"text-sm text-status-error",children:l})]}),e.jsxs(Y,{children:[e.jsx("button",{onClick:b,className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:a("common.cancel")}),e.jsx("button",{onClick:B,disabled:N,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light disabled:opacity-50 transition-colors",children:N?a("common.creating"):a("common.create")})]})]})})}function me({onNavigateSession:n}){L();const[x,b]=o.useState([]),[u,i]=o.useState([]),[r,c]=o.useState(!1),p=o.useCallback(async()=>{try{const[l,f]=await Promise.all([J(),K()]);b(l||[]),i(f||[])}catch(l){console.error("Dashboard render error:",l)}},[]);o.useEffect(()=>{p();const l=setInterval(p,5e3);return window.addEventListener("focus",p),()=>{clearInterval(l),window.removeEventListener("focus",p)}},[p]);const h=l=>{c(!1),n(l.id)},g=o.useCallback(l=>{},[]),w=o.useCallback(l=>{n(l)},[n]),y=o.useCallback(async l=>{if(window.confirm(a("dashboard.confirmDelete").replace("{id}",l)))try{await R(l),b(f=>f.filter(N=>N.id!==l))}catch(f){alert(f instanceof Error?f.message:a("dashboard.deleteFailed"))}},[]);return e.jsx("div",{className:"px-6 py-12 sm:px-10 sm:py-16",children:e.jsxs("div",{children:[e.jsx("h1",{className:"sr-only",children:a("dashboard.title")}),e.jsxs("section",{className:"mb-16",children:[e.jsx("h2",{className:"mb-6 text-sm font-medium text-text-primary",children:a("dashboard.environments")}),e.jsx(re,{environments:u,onSelectEnvironment:g})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-medium text-text-primary",children:a("dashboard.sessions")}),e.jsx("button",{onClick:()=>c(!0),className:"rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90 transition-colors",children:a("dashboard.newSession")})]}),e.jsx(ae,{sessions:x,environments:u,onSelect:w,onDelete:y})]}),e.jsx(ne,{open:r,environments:u,onClose:()=>c(!1),onCreated:h})]})})}export{me as Dashboard};
6
+ */const ee=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],te=O("folder",ee);function se({teamName:n,className:x}){return n?e.jsx("span",{className:_("inline-flex items-center rounded-full border border-border/60 bg-surface-2 px-2 py-0.5 text-xs text-text-muted",x),children:n}):null}function re({environments:n,onSelectEnvironment:x}){const{activeTeam:b}=E(),{user:u}=T(),i=l.useMemo(()=>(u==null?void 0:u.role)==="admin"?n:b?n.filter(r=>r.team_id===b.id):n.filter(r=>!r.team_id),[n,b,u]);return!i||i.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-8 text-center text-text-muted",children:"No active environments"}):e.jsx("div",{className:"space-y-2",children:i.map(r=>{const c=r.worker_type==="acp",p=D(r.worker_type),h=p.fullLabel,g=p.colorClass;return e.jsxs("button",{type:"button",onClick:()=>x==null?void 0:x(r),disabled:c,className:`flex w-full items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 text-left transition-colors ${c?"cursor-default opacity-80":"hover:border-border-light cursor-pointer"}`,children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-text-primary",children:r.machine_name||r.id}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${g}`,children:h}),e.jsx(se,{teamName:r.team_name??null})]}),e.jsx("div",{className:"text-sm text-text-muted",children:r.directory||""})]})}),e.jsxs("div",{className:"text-right",children:[e.jsx(F,{status:r.status}),e.jsx("div",{className:"mt-1 text-xs text-text-muted",children:r.branch||""})]})]},r.id)})})}function ae({sessions:n,environments:x,onSelect:b,onDelete:u}){L();const{activeTeam:i,myTeams:r}=E(),{user:c}=T(),p=l.useMemo(()=>{const t=new Map;for(const m of r)t.set(m.id,m.name);return t},[r]),h=l.useMemo(()=>(c==null?void 0:c.role)==="admin"?n:i?n.filter(t=>t.owner_type==="team"&&t.owner_id===i.id):n.filter(t=>t.owner_type==="user"||t.access_level==="write"||t.access_level==="read"),[n,i,c]),{mySessions:g,sharedSessions:w}=l.useMemo(()=>{const t=[],m=[];for(const d of h)i?t.push(d):d.access_level==="write"||d.access_level==="read"?m.push(d):t.push(d);return{mySessions:t,sharedSessions:m}},[h,i]),y=new Map;for(const t of x??[])t!=null&&t.id&&t.worker_type&&y.set(t.id,t.worker_type);const o=(t,m)=>(m.updated_at||0)-(t.updated_at||0);function f(t){const m=!!u&&t.access_level!=="write"&&t.access_level!=="read";return e.jsxs("div",{className:"group flex w-full items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 text-left transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("button",{type:"button",onClick:()=>b(t.id),className:"min-w-0 flex-1 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id}),t.visibility&&e.jsx(Z,{visibility:t.visibility||"private"}),(()=>{var k;let d=t.source==="acp"?"acp":(k=t.environment)==null?void 0:k.worker_type;!d&&t.environment_id&&(d=y.get(t.environment_id));const j=D(d);return e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${j.colorClass}`,children:j.fullLabel})})()]}),e.jsxs("div",{className:"flex items-center gap-2 truncate text-xs text-text-muted",children:[e.jsx("span",{className:"truncate font-mono",children:t.id}),t.owner_type==="team"&&t.owner_id&&e.jsxs("span",{className:"inline-flex items-center gap-2 truncate",children:[e.jsx("span",{className:"text-text-muted/40",children:"|"}),e.jsx("span",{className:"truncate",children:p.get(t.owner_id)||t.owner_id})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(F,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:A(t.created_at||t.updated_at)}),m&&e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),u(t.id)},className:"rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100",title:"Delete session",children:e.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},t.id)}if(h.length===0)return e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-8 text-center text-text-muted",children:"No sessions"});const N=[...g].sort(o),v=[...w].sort(o);return e.jsxs("div",{className:"space-y-4",children:[N.length>0&&e.jsxs("section",{className:"space-y-2",children:[!i&&v.length>0&&e.jsx("h3",{className:"px-1 text-xs font-medium uppercase tracking-wide text-text-muted",children:a("session.mySessions")}),N.map(f)]}),v.length>0&&e.jsxs("section",{className:"space-y-2",children:[e.jsx("h3",{className:"px-1 text-xs font-medium uppercase tracking-wide text-text-muted",children:a("session.sharedWithMe")}),v.map(f)]})]})}function ne({open:n,environments:x,onClose:b,onCreated:u}){L();const{activeTeam:i}=E(),{user:r}=T(),[c,p]=l.useState(""),[h,g]=l.useState(""),[w,y]=l.useState("same-dir"),[o,f]=l.useState(""),[N,v]=l.useState(!1),[t,m]=l.useState(!1),d=l.useMemo(()=>(r==null?void 0:r.role)==="admin"?x:i?x.filter(s=>s.team_id===i.id):x.filter(s=>!s.team_id),[x,i,r]);l.useEffect(()=>{n&&(p(""),g(""),y("same-dir"),f(""),m(!1))},[n]);const j=d.find(s=>s.id===h)||null,k=j?d.findIndex(s=>s.id===j.id)+1:null,B=async()=>{v(!0),f("");try{const s={};c.trim()&&(s.title=c.trim()),h&&(s.environment_id=h),s.spawn_mode=w;const S=V();S&&(s.team_id=S);const C=await Q(s);u(C)}catch(s){f(s instanceof Error?s.message:a("dialog.createFailed"))}finally{v(!1)}};return e.jsx(z,{open:n,onOpenChange:s=>{s||b()},children:e.jsxs(G,{className:"max-w-md rounded-2xl border-border bg-surface-1 p-6 shadow-2xl",children:[e.jsx(J,{children:e.jsx(K,{className:"font-display text-lg font-semibold text-text-primary",children:a("dialog.newSession")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:a("dialog.titleOptional")}),e.jsx("input",{type:"text",value:c,onChange:s=>p(s.target.value),placeholder:a("dialog.titlePlaceholder"),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:a("dialog.environment")}),e.jsxs($,{open:t,onOpenChange:m,children:[e.jsx(W,{asChild:!0,children:e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary hover:border-border-light focus:border-brand focus:outline-none transition-colors",children:[e.jsx("span",{className:_("flex items-center gap-2 truncate",!j&&"text-text-muted"),children:j?e.jsxs(e.Fragment,{children:[k!==null&&e.jsxs("span",{className:"shrink-0 rounded bg-surface-3 px-1.5 py-0.5 text-[10px] font-mono text-text-muted",children:["#",k]}),e.jsx("span",{className:"truncate",children:j.machine_name||j.id}),e.jsx("span",{className:"shrink-0 text-text-muted",children:"·"}),e.jsx("span",{className:"shrink-0 text-text-muted",children:D(j.worker_type).shortLabel})]}):e.jsx("span",{children:a("dialog.none")})}),e.jsx(q,{className:"h-4 w-4 shrink-0 text-text-muted"})]})}),e.jsxs(H,{align:"start",className:"max-h-80 w-80 overflow-y-auto rounded-lg border-border bg-surface-1 p-1 shadow-xl",children:[e.jsxs("button",{type:"button",onClick:()=>{g(""),m(!1)},className:"flex w-full items-center justify-between rounded-md px-3 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:[e.jsx("span",{children:a("dialog.none")}),!h&&e.jsx(P,{className:"h-3.5 w-3.5 text-brand"})]}),d.length===0?e.jsx("p",{className:"px-3 py-2 text-xs text-text-muted",children:a("dialog.envEmpty")}):e.jsx("div",{className:"space-y-1 pt-1",children:d.map((s,S)=>{const C=D(s.worker_type),M=!!s.team_id,I=s.id===h;return e.jsxs("button",{type:"button",onClick:()=>{g(s.id),m(!1)},className:_("flex w-full flex-col gap-1.5 rounded-md px-3 py-2 text-left transition-colors",I?"bg-brand/10":"hover:bg-surface-2"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"shrink-0 rounded bg-surface-3 px-1.5 py-0.5 text-[10px] font-mono text-text-muted",children:["#",S+1]}),e.jsx("span",{className:"truncate font-medium text-text-primary",children:s.machine_name||s.id}),e.jsx("span",{className:_("shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium",C.colorClass),children:C.shortLabel}),e.jsx("span",{className:_("shrink-0 rounded-full border px-2 py-0.5 text-[10px] font-medium",M?"border-border/60 bg-surface-2 text-text-muted":"border-brand/30 bg-brand/10 text-brand"),children:M?`${a("dialog.envTeam")}: ${s.team_name||s.team_id}`:a("dialog.envPersonal")}),I&&e.jsx(P,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand"})]}),s.directory&&e.jsxs("div",{className:"flex items-center gap-1.5 truncate text-xs text-text-muted",children:[e.jsx(te,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate font-mono",children:s.directory}),s.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-muted/40",children:"·"}),e.jsx("span",{className:"truncate",children:s.branch})]})]})]},s.id)})})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:a("dialog.workspaceMode")}),e.jsxs("select",{value:w,onChange:s=>y(s.target.value),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-brand focus:outline-none",children:[e.jsx("option",{value:"same-dir",children:a("dialog.sameDir")}),e.jsx("option",{value:"worktree",children:a("dialog.worktree")})]})]}),o&&e.jsx("div",{className:"text-sm text-status-error",children:o})]}),e.jsxs(X,{children:[e.jsx("button",{onClick:b,className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:a("common.cancel")}),e.jsx("button",{onClick:B,disabled:N,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light disabled:opacity-50 transition-colors",children:N?a("common.creating"):a("common.create")})]})]})})}function ue({onNavigateSession:n}){L();const[x,b]=l.useState([]),[u,i]=l.useState([]),[r,c]=l.useState(!1),p=l.useCallback(async()=>{try{const[o,f]=await Promise.all([R(),U()]);b(o||[]),i(f||[])}catch(o){console.error("Dashboard render error:",o)}},[]);l.useEffect(()=>{p();const o=setInterval(p,5e3);return window.addEventListener("focus",p),()=>{clearInterval(o),window.removeEventListener("focus",p)}},[p]);const h=o=>{c(!1),n(o.id)},g=l.useCallback(o=>{},[]),w=l.useCallback(o=>{n(o)},[n]),y=l.useCallback(async o=>{if(window.confirm(a("dashboard.confirmDelete").replace("{id}",o)))try{await Y(o),b(f=>f.filter(N=>N.id!==o))}catch(f){alert(f instanceof Error?f.message:a("dashboard.deleteFailed"))}},[]);return e.jsx("div",{className:"px-6 py-12 sm:px-10 sm:py-16",children:e.jsxs("div",{children:[e.jsx("h1",{className:"sr-only",children:a("dashboard.title")}),e.jsxs("section",{className:"mb-16",children:[e.jsx("h2",{className:"mb-6 text-sm font-medium text-text-primary",children:a("dashboard.environments")}),e.jsx(re,{environments:u,onSelectEnvironment:g})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-medium text-text-primary",children:a("dashboard.sessions")}),e.jsx("button",{onClick:()=>c(!0),className:"rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90 transition-colors",children:a("dashboard.newSession")})]}),e.jsx(ae,{sessions:x,environments:u,onSelect:w,onDelete:y})]}),e.jsx(ne,{open:r,environments:u,onClose:()=>c(!1),onCreated:h})]})})}export{ue as Dashboard};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aj as v,af as t}from"./main-N3GYCdLF.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function E({onSuccess:b,onInvalidInvite:l}){const{join:f}=v(),[u,h]=r.useState(""),[d,j]=r.useState(""),[o,w]=r.useState(""),[c,g]=r.useState(""),[m,n]=r.useState(""),[x,p]=r.useState(!1);r.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("invite");a?h(a):l()},[l]);const y=async s=>{if(s.preventDefault(),n(""),o.length<8){n(t("auth.setup.passwordTooShort"));return}if(o!==c){n(t("auth.setup.passwordMismatch"));return}p(!0);try{await f(u,d,o),b()}catch(a){const i=a instanceof Error?a.message:"Join failed";if(i.includes("Invalid invitation")||i.includes("expired")||i.includes("already used")){l();return}n(i)}finally{p(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.join.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.join.welcome")}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t("auth.join.description")})]}),e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.username")}),e.jsx("input",{type:"text",value:d,onChange:s=>j(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>w(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:c,onChange:s=>g(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),m&&e.jsx("p",{className:"text-sm text-status-error",children:m}),e.jsx("button",{type:"submit",disabled:x||!u,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{E as Join};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{ap as v,al as t}from"./main-B8hkVvfg.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function E({onSuccess:b,onInvalidInvite:l}){const{join:h}=v(),[u,f]=r.useState(""),[d,j]=r.useState(""),[o,w]=r.useState(""),[c,g]=r.useState(""),[m,n]=r.useState(""),[x,p]=r.useState(!1);r.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("invite");a?f(a):l()},[l]);const y=async s=>{if(s.preventDefault(),n(""),o.length<8){n(t("auth.setup.passwordTooShort"));return}if(o!==c){n(t("auth.setup.passwordMismatch"));return}p(!0);try{await h(u,d,o),b()}catch(a){const i=a instanceof Error?a.message:"Join failed";if(i.includes("Invalid invitation")||i.includes("expired")||i.includes("already used")){l();return}n(i)}finally{p(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.join.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.join.welcome")}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t("auth.join.description")})]}),e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.username")}),e.jsx("input",{type:"text",value:d,onChange:s=>j(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>w(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:c,onChange:s=>g(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),m&&e.jsx("p",{className:"text-sm text-status-error",children:m}),e.jsx("button",{type:"submit",disabled:x||!u,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{E as Join};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aj as f,af as t}from"./main-N3GYCdLF.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function N({onSuccess:d,onNavigateRegister:c}){const{login:m,registrationAllowed:x}=f(),[a,p]=r.useState(""),[o,b]=r.useState(""),[l,n]=r.useState(""),[i,u]=r.useState(!1),h=async s=>{s.preventDefault(),n(""),u(!0);try{await m(a,o),d()}catch{n(t("auth.login.failed"))}finally{u(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.login.description")})]}),e.jsxs("form",{onSubmit:h,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:a,onChange:s=>p(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>b(s.target.value),required:!0,autoComplete:"current-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),l&&e.jsx("p",{className:"text-sm text-status-error",children:l}),e.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:i?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:c,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{N as Login};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{ap as f,al as t}from"./main-B8hkVvfg.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function N({onSuccess:d,onNavigateRegister:c}){const{login:m,registrationAllowed:x}=f(),[a,p]=r.useState(""),[o,b]=r.useState(""),[l,n]=r.useState(""),[i,u]=r.useState(!1),h=async s=>{s.preventDefault(),n(""),u(!0);try{await m(a,o),d()}catch{n(t("auth.login.failed"))}finally{u(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.login.description")})]}),e.jsxs("form",{onSubmit:h,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:a,onChange:s=>p(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>b(s.target.value),required:!0,autoComplete:"current-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),l&&e.jsx("p",{className:"text-sm text-status-error",children:l}),e.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:i?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:c,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{N as Login};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aj as y,af as t}from"./main-N3GYCdLF.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function S({onSuccess:m,onBack:x}){const{register:p}=y(),[n,b]=r.useState(""),[a,h]=r.useState(""),[l,f]=r.useState(""),[i,o]=r.useState(""),[u,d]=r.useState(!1),g=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==l){o(t("auth.setup.passwordMismatch"));return}d(!0);try{await p(n,a),m()}catch(c){o(c instanceof Error?c.message:t("auth.register.failed"))}finally{d(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.register.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.register.description")})]}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:n,onChange:s=>b(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:a,onChange:s=>h(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:l,onChange:s=>f(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),i&&e.jsx("p",{className:"text-sm text-status-error",children:i}),e.jsx("button",{type:"submit",disabled:u,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:u?t("common.loading"):t("auth.register.submit")})]}),e.jsx("button",{type:"button",onClick:x,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.register.backToLogin")})]})})}export{S as Register};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{ap as y,al as t}from"./main-B8hkVvfg.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function S({onSuccess:m,onBack:x}){const{register:p}=y(),[n,b]=r.useState(""),[a,h]=r.useState(""),[l,f]=r.useState(""),[i,o]=r.useState(""),[u,d]=r.useState(!1),g=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==l){o(t("auth.setup.passwordMismatch"));return}d(!0);try{await p(n,a),m()}catch(c){o(c instanceof Error?c.message:t("auth.register.failed"))}finally{d(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.register.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.register.description")})]}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:n,onChange:s=>b(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:a,onChange:s=>h(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:l,onChange:s=>f(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),i&&e.jsx("p",{className:"text-sm text-status-error",children:i}),e.jsx("button",{type:"submit",disabled:u,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:u?t("common.loading"):t("auth.register.submit")})]}),e.jsx("button",{type:"button",onClick:x,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.register.backToLogin")})]})})}export{S as Register};