@saluzi/saluzi-edu 0.2.80 → 0.2.82
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.
- package/dist/cli.js +47 -47
- package/dist/rcs-web/assets/{AdminPanel-CeJbvp1y.js → AdminPanel-BkmXNunm.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/ArtifactView-DG4NEABr.js → dist/rcs-web/assets/ArtifactView-C8hU0vco.js} +1 -1
- package/dist/rcs-web/assets/{ArtifactsGallery-yaOX7eyz.js → ArtifactsGallery-Cf_p454O.js} +45 -45
- package/{packages/remote-control-server/web/dist/assets/Claim-DcVDtUJW.js → dist/rcs-web/assets/Claim-C_-Gla6o.js} +1 -1
- package/dist/rcs-web/assets/{Dashboard--liQacnK.js → Dashboard-BIUyLZ7f.js} +1 -1
- package/dist/rcs-web/assets/{Join-CTPWU5Mr.js → Join-ZcgKlXzS.js} +1 -1
- package/dist/rcs-web/assets/{Login-CAo4xQR6.js → Login-7_3pI3By.js} +1 -1
- package/dist/rcs-web/assets/{Register-D1K9V2Cc.js → Register-DBsfc_dT.js} +1 -1
- package/dist/rcs-web/assets/{SessionDetail-Dlhtkeg9.js → SessionDetail-BCCW6g8g.js} +1 -1
- package/dist/rcs-web/assets/{SessionVisibilityBadge-DSBB4hQt.js → SessionVisibilityBadge-Ba6plQFV.js} +1 -1
- package/dist/rcs-web/assets/{Setup-BVVR5jB-.js → Setup-BlHuf9KC.js} +1 -1
- package/dist/rcs-web/assets/{ShareLanding-0IFIhCg-.js → ShareLanding-BF1K1oYb.js} +1 -1
- package/dist/rcs-web/assets/{TeamCreate-B9t2hKQE.js → TeamCreate-Ce-SySLQ.js} +1 -1
- package/dist/rcs-web/assets/{TeamDetail-CKsvDnnZ.js → TeamDetail-Be5uskvw.js} +1 -1
- package/dist/rcs-web/assets/{TeamList-Db3o2sd5.js → TeamList-CJaT4aYb.js} +1 -1
- package/dist/rcs-web/assets/{TeamSettings-DmElPUhc.js → TeamSettings-ws_7K-56.js} +1 -1
- package/dist/rcs-web/assets/{UserSearchInput-Dclznuqh.js → UserSearchInput-DL5_KDHE.js} +1 -1
- package/dist/rcs-web/assets/{UserSettings-CAYmVaEN.js → UserSettings-SOzXi42F.js} +1 -1
- package/dist/rcs-web/assets/{arc-CdhVjXrk.js → arc-CYCfDISm.js} +1 -1
- package/dist/rcs-web/assets/{architectureDiagram-3BPJPVTR-CdUftizr.js → architectureDiagram-3BPJPVTR-Bqa8vMD7.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-B3EHysEn.js → dist/rcs-web/assets/blockDiagram-GPEHLZMM-CczSTzEF.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-DHfYdMEZ.js → dist/rcs-web/assets/c4Diagram-AAUBKEIU-CssBkFo6.js} +1 -1
- package/dist/rcs-web/assets/channel-Bv_YGNa3.js +1 -0
- package/dist/rcs-web/assets/{chunk-2J33WTMH-EhksSUIa.js → chunk-2J33WTMH-BE65KSB6.js} +1 -1
- package/dist/rcs-web/assets/{chunk-4BX2VUAB-CSwxuVKu.js → chunk-4BX2VUAB-D653DDuu.js} +1 -1
- package/dist/rcs-web/assets/{chunk-55IACEB6-DlOkG9fU.js → chunk-55IACEB6-Ct5UXPIN.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-1CxczIsf.js → dist/rcs-web/assets/chunk-727SXJPM-S5fpS82E.js} +1 -1
- package/dist/rcs-web/assets/{chunk-AQP2D5EJ-DfYiA4nH.js → chunk-AQP2D5EJ-CYTND6Zm.js} +1 -1
- package/dist/rcs-web/assets/{chunk-FMBD7UC4-Bw5pfdve.js → chunk-FMBD7UC4-D59kMkuj.js} +1 -1
- package/dist/rcs-web/assets/{chunk-ND2GUHAM-DdcvT253.js → chunk-ND2GUHAM-eEjBp7_r.js} +1 -1
- package/dist/rcs-web/assets/{chunk-QZHKN3VN-HMrF81oZ.js → chunk-QZHKN3VN-DVV1jVoy.js} +1 -1
- package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-CdtEfsP5.js +1 -0
- package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-CdtEfsP5.js +1 -0
- package/dist/rcs-web/assets/{code-block-IT6T5CEO-D_icBEKo.js → code-block-IT6T5CEO-DWgaxEpJ.js} +1 -1
- package/dist/rcs-web/assets/{copy-C6MF0GiS.js → copy-la10Bvy2.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-BbpIuAyZ.js → dist/rcs-web/assets/cose-bilkent-S5V4N54A-CYkPDcHZ.js} +1 -1
- package/dist/rcs-web/assets/{dagre-BM42HDAG-BBlOWeV0.js → dagre-BM42HDAG-DI0gApmA.js} +1 -1
- package/dist/rcs-web/assets/{diagram-2AECGRRQ-DMwCFj3q.js → diagram-2AECGRRQ-B1KjRwA6.js} +1 -1
- package/dist/rcs-web/assets/{diagram-5GNKFQAL-CHRU_l-Z.js → diagram-5GNKFQAL-g8x2SnFz.js} +1 -1
- package/dist/rcs-web/assets/{diagram-KO2AKTUF-RqWISfzc.js → diagram-KO2AKTUF-_qS0aFTS.js} +1 -1
- package/dist/rcs-web/assets/{diagram-LMA3HP47-DcIfgVzs.js → diagram-LMA3HP47-pNccEgrY.js} +1 -1
- package/dist/rcs-web/assets/{diagram-OG6HWLK6-Cpnv-7XF.js → diagram-OG6HWLK6-BEZR-29L.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/dialog-y9t3OG8S.js → dist/rcs-web/assets/dialog-cgjIoxTP.js} +1 -1
- package/dist/rcs-web/assets/{erDiagram-TEJ5UH35-yRmna5lr.js → erDiagram-TEJ5UH35-BJQSK56G.js} +1 -1
- package/dist/rcs-web/assets/{flowDiagram-I6XJVG4X-_7eLAsX0.js → flowDiagram-I6XJVG4X-QuhhO4rW.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-CFxlByao.js → dist/rcs-web/assets/ganttDiagram-6RSMTGT7-Cxic4_sr.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-CIJGDuu2.js → dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-ClQeHUrC.js} +1 -1
- package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-DL26mYqN.js → infoDiagram-5YYISTIA-Dz47GiWm.js} +1 -1
- package/dist/rcs-web/assets/{ishikawaDiagram-YF4QCWOH-ClTbQIgQ.js → ishikawaDiagram-YF4QCWOH--beuL5mS.js} +1 -1
- package/dist/rcs-web/assets/{journeyDiagram-JHISSGLW-BDSHXfMK.js → journeyDiagram-JHISSGLW-Bi5QelTp.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-bjaNmDdS.js → dist/rcs-web/assets/kanban-definition-UN3LZRKU-CbYj6Ccv.js} +1 -1
- package/dist/rcs-web/assets/{linear-HZJSCbjO.js → linear-B3f9icjf.js} +1 -1
- package/dist/rcs-web/assets/{main-BtriBTyr.js → main-DfNbuMTS.js} +8 -8
- package/{packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-CrXtMOXy.js → dist/rcs-web/assets/mermaid-VLURNSYL-pX95fhBf.js} +4 -4
- package/dist/rcs-web/assets/{mermaid.core-DTbrYqLV.js → mermaid.core-BGK4yVxT.js} +5 -5
- package/{packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-9ifL4_5N.js → dist/rcs-web/assets/mindmap-definition-RKZ34NQL-CgtRTehZ.js} +1 -1
- package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-BSN1xh9l.js → pieDiagram-4H26LBE5-qJJGmbUf.js} +1 -1
- package/dist/rcs-web/assets/{quadrantDiagram-W4KKPZXB-BOGclSnl.js → quadrantDiagram-W4KKPZXB-Cd2k7IGS.js} +1 -1
- package/dist/rcs-web/assets/{requirementDiagram-4Y6WPE33-BQiBrIyS.js → requirementDiagram-4Y6WPE33-DiFWGb6O.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-Cmmlv8nQ.js → dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-Dkn0yk-6.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-CGqCUPei.js → dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-DdYdmSqK.js} +1 -1
- package/dist/rcs-web/assets/{stateDiagram-AJRCARHV-Crly1oy6.js → stateDiagram-AJRCARHV-CnQyI3oa.js} +1 -1
- package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-DgXehnSh.js → stateDiagram-v2-BHNVJYJU-C2JPZVJm.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/timeline-definition-PNZ67QCA-BCjEDIqH.js → dist/rcs-web/assets/timeline-definition-PNZ67QCA-D0_pTyDA.js} +1 -1
- package/{packages/remote-control-server/web/dist/assets/vennDiagram-CIIHVFJN-BdyNi3pq.js → dist/rcs-web/assets/vennDiagram-CIIHVFJN-Bw3XMj_p.js} +1 -1
- package/dist/rcs-web/assets/{wardleyDiagram-YWT4CUSO-DG3vTRnZ.js → wardleyDiagram-YWT4CUSO-BfzfoPRo.js} +1 -1
- package/dist/rcs-web/assets/{xychartDiagram-2RQKCTM6-ZIOBxK1C.js → xychartDiagram-2RQKCTM6-qGzDgnMk.js} +1 -1
- package/dist/rcs-web/index.html +1 -1
- package/package.json +1 -1
- package/packages/remote-control-server/src/__tests__/models-state-snapshot.test.ts +52 -0
- package/packages/remote-control-server/src/routes/web/sessions.ts +24 -0
- package/packages/remote-control-server/web/dist/assets/{AdminPanel-CeJbvp1y.js → AdminPanel-BkmXNunm.js} +1 -1
- package/{dist/rcs-web/assets/ArtifactView-DG4NEABr.js → packages/remote-control-server/web/dist/assets/ArtifactView-C8hU0vco.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{ArtifactsGallery-yaOX7eyz.js → ArtifactsGallery-Cf_p454O.js} +45 -45
- package/{dist/rcs-web/assets/Claim-DcVDtUJW.js → packages/remote-control-server/web/dist/assets/Claim-C_-Gla6o.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{Dashboard--liQacnK.js → Dashboard-BIUyLZ7f.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{Join-CTPWU5Mr.js → Join-ZcgKlXzS.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{Login-CAo4xQR6.js → Login-7_3pI3By.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{Register-D1K9V2Cc.js → Register-DBsfc_dT.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{SessionDetail-Dlhtkeg9.js → SessionDetail-BCCW6g8g.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{SessionVisibilityBadge-DSBB4hQt.js → SessionVisibilityBadge-Ba6plQFV.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{Setup-BVVR5jB-.js → Setup-BlHuf9KC.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{ShareLanding-0IFIhCg-.js → ShareLanding-BF1K1oYb.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{TeamCreate-B9t2hKQE.js → TeamCreate-Ce-SySLQ.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{TeamDetail-CKsvDnnZ.js → TeamDetail-Be5uskvw.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{TeamList-Db3o2sd5.js → TeamList-CJaT4aYb.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{TeamSettings-DmElPUhc.js → TeamSettings-ws_7K-56.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{UserSearchInput-Dclznuqh.js → UserSearchInput-DL5_KDHE.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{UserSettings-CAYmVaEN.js → UserSettings-SOzXi42F.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{arc-CdhVjXrk.js → arc-CYCfDISm.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{architectureDiagram-3BPJPVTR-CdUftizr.js → architectureDiagram-3BPJPVTR-Bqa8vMD7.js} +1 -1
- package/{dist/rcs-web/assets/blockDiagram-GPEHLZMM-B3EHysEn.js → packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-CczSTzEF.js} +1 -1
- package/{dist/rcs-web/assets/c4Diagram-AAUBKEIU-DHfYdMEZ.js → packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-CssBkFo6.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/channel-Bv_YGNa3.js +1 -0
- package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-EhksSUIa.js → chunk-2J33WTMH-BE65KSB6.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-CSwxuVKu.js → chunk-4BX2VUAB-D653DDuu.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-DlOkG9fU.js → chunk-55IACEB6-Ct5UXPIN.js} +1 -1
- package/{dist/rcs-web/assets/chunk-727SXJPM-1CxczIsf.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-S5fpS82E.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-AQP2D5EJ-DfYiA4nH.js → chunk-AQP2D5EJ-CYTND6Zm.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-Bw5pfdve.js → chunk-FMBD7UC4-D59kMkuj.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-DdcvT253.js → chunk-ND2GUHAM-eEjBp7_r.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-HMrF81oZ.js → chunk-QZHKN3VN-DVV1jVoy.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-CdtEfsP5.js +1 -0
- package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-CdtEfsP5.js +1 -0
- package/packages/remote-control-server/web/dist/assets/{code-block-IT6T5CEO-D_icBEKo.js → code-block-IT6T5CEO-DWgaxEpJ.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{copy-C6MF0GiS.js → copy-la10Bvy2.js} +1 -1
- package/{dist/rcs-web/assets/cose-bilkent-S5V4N54A-BbpIuAyZ.js → packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-CYkPDcHZ.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{dagre-BM42HDAG-BBlOWeV0.js → dagre-BM42HDAG-DI0gApmA.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-DMwCFj3q.js → diagram-2AECGRRQ-B1KjRwA6.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-CHRU_l-Z.js → diagram-5GNKFQAL-g8x2SnFz.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-KO2AKTUF-RqWISfzc.js → diagram-KO2AKTUF-_qS0aFTS.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-DcIfgVzs.js → diagram-LMA3HP47-pNccEgrY.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{diagram-OG6HWLK6-Cpnv-7XF.js → diagram-OG6HWLK6-BEZR-29L.js} +1 -1
- package/{dist/rcs-web/assets/dialog-y9t3OG8S.js → packages/remote-control-server/web/dist/assets/dialog-cgjIoxTP.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{erDiagram-TEJ5UH35-yRmna5lr.js → erDiagram-TEJ5UH35-BJQSK56G.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{flowDiagram-I6XJVG4X-_7eLAsX0.js → flowDiagram-I6XJVG4X-QuhhO4rW.js} +1 -1
- package/{dist/rcs-web/assets/ganttDiagram-6RSMTGT7-CFxlByao.js → packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-Cxic4_sr.js} +1 -1
- package/{dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-CIJGDuu2.js → packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-ClQeHUrC.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-DL26mYqN.js → infoDiagram-5YYISTIA-Dz47GiWm.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{ishikawaDiagram-YF4QCWOH-ClTbQIgQ.js → ishikawaDiagram-YF4QCWOH--beuL5mS.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{journeyDiagram-JHISSGLW-BDSHXfMK.js → journeyDiagram-JHISSGLW-Bi5QelTp.js} +1 -1
- package/{dist/rcs-web/assets/kanban-definition-UN3LZRKU-bjaNmDdS.js → packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-CbYj6Ccv.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{linear-HZJSCbjO.js → linear-B3f9icjf.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{main-BtriBTyr.js → main-DfNbuMTS.js} +8 -8
- package/{dist/rcs-web/assets/mermaid-VLURNSYL-CrXtMOXy.js → packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-pX95fhBf.js} +4 -4
- package/packages/remote-control-server/web/dist/assets/{mermaid.core-DTbrYqLV.js → mermaid.core-BGK4yVxT.js} +5 -5
- package/{dist/rcs-web/assets/mindmap-definition-RKZ34NQL-9ifL4_5N.js → packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-CgtRTehZ.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-BSN1xh9l.js → pieDiagram-4H26LBE5-qJJGmbUf.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{quadrantDiagram-W4KKPZXB-BOGclSnl.js → quadrantDiagram-W4KKPZXB-Cd2k7IGS.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{requirementDiagram-4Y6WPE33-BQiBrIyS.js → requirementDiagram-4Y6WPE33-DiFWGb6O.js} +1 -1
- package/{dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-Cmmlv8nQ.js → packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-Dkn0yk-6.js} +1 -1
- package/{dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-CGqCUPei.js → packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-DdYdmSqK.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{stateDiagram-AJRCARHV-Crly1oy6.js → stateDiagram-AJRCARHV-CnQyI3oa.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-DgXehnSh.js → stateDiagram-v2-BHNVJYJU-C2JPZVJm.js} +1 -1
- package/{dist/rcs-web/assets/timeline-definition-PNZ67QCA-BCjEDIqH.js → packages/remote-control-server/web/dist/assets/timeline-definition-PNZ67QCA-D0_pTyDA.js} +1 -1
- package/{dist/rcs-web/assets/vennDiagram-CIIHVFJN-BdyNi3pq.js → packages/remote-control-server/web/dist/assets/vennDiagram-CIIHVFJN-Bw3XMj_p.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{wardleyDiagram-YWT4CUSO-DG3vTRnZ.js → wardleyDiagram-YWT4CUSO-BfzfoPRo.js} +1 -1
- package/packages/remote-control-server/web/dist/assets/{xychartDiagram-2RQKCTM6-ZIOBxK1C.js → xychartDiagram-2RQKCTM6-qGzDgnMk.js} +1 -1
- package/packages/remote-control-server/web/dist/index.html +1 -1
- package/dist/rcs-web/assets/channel-CI-PMv7a.js +0 -1
- package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-B3XAB9kf.js +0 -1
- package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-B3XAB9kf.js +0 -1
- package/packages/remote-control-server/web/dist/assets/channel-CI-PMv7a.js +0 -1
- package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-B3XAB9kf.js +0 -1
- package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-B3XAB9kf.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{
|
|
1
|
+
import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{at as c,au as o,Q as m,ao as s,ag as l,x as u}from"./main-DfNbuMTS.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function j(){c();const[a,i]=d.useState([]),{myTeams:r,isLoading:x}=o(),n=d.useCallback(async()=>{try{const t=await m();i(t||[])}catch(t){console.error("Admin: failed to load sessions",t)}},[]);return d.useEffect(()=>{n()},[n]),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8",children:[e.jsx("h1",{className:"mb-6 font-display text-2xl font-semibold text-text-primary",children:s("admin.title")}),e.jsxs("section",{className:"mb-10",children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.teams")," (",r.length,")"]}),x?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("common.loading")}):r.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noTeams")}):e.jsx("div",{className:"space-y-2",children:r.map(t=>e.jsxs("a",{href:`/teams/${t.slug}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-medium text-text-primary",children:t.name}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:t.slug})]}),e.jsx("span",{className:"text-xs text-text-muted",children:l(new Date(t.created_at).getTime()/1e3)})]},t.id))})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.sessions")," (",a.length,")"]}),a.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noSessions")}):e.jsx("div",{className:"space-y-2",children:a.map(t=>e.jsxs("a",{href:`/code/${t.id}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",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}),e.jsx("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.source||"unknown"})]}),e.jsx("div",{className:"truncate text-xs text-text-muted",children:t.id})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-3",children:[e.jsx(u,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:l(t.updated_at||t.created_at)})]})]},t.id))})]})]})})}export{j as AdminPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as i,j as e}from"./vendor-DE_-CLIE.js";import{
|
|
1
|
+
import{e as i,j as e}from"./vendor-DE_-CLIE.js";import{ad as N,at as v,V as g,ao as s,K as w,ac as C,P as k,z as _}from"./main-DfNbuMTS.js";import{E,C as $}from"./ArtifactsGallery-Cf_p454O.js";import{C as L}from"./copy-la10Bvy2.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";import"./dialog-cgjIoxTP.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ot=Object.defineProperty;var ct=(t,e,r)=>e in t?ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var R=(t,e,r)=>ct(t,typeof e!="symbol"?e+"":e,r);import{e as k,j as o}from"./vendor-DE_-CLIE.js";import{ad as dt,at as Ze,au as pt,W as ut,ao as f,K as ht,ac as ft,F as mt,g as xt,P as gt,z as bt,p as Pe,V as kt,a0 as wt,al as yt,$ as vt,a6 as St,a7 as Rt,ah as Tt,H as $t,b as Et}from"./main-DfNbuMTS.js";import{D as jt,a as Ct,c as Nt,d as It,b as At}from"./dialog-cgjIoxTP.js";import{C as zt}from"./copy-la10Bvy2.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
|
|
6
|
+
*/const Lt=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],_t=dt("external-link",Lt),V=`body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
|
|
7
7
|
h1 { font-size: 22px; } h1, h2 { color: #1a1a1a; }
|
|
8
8
|
.badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500; }
|
|
9
9
|
.badge.ok { background: #dcfce7; color: #166534; }
|
|
@@ -11,14 +11,14 @@ h1 { font-size: 22px; } h1, h2 { color: #1a1a1a; }
|
|
|
11
11
|
.badge.err { background: #fee2e2; color: #991b1b; }
|
|
12
12
|
.badge.info { background: #e0e7ff; color: #3730a3; }
|
|
13
13
|
.muted { color: #6b7280; font-size: 12px; }
|
|
14
|
-
.meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 20px; }`,
|
|
14
|
+
.meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 20px; }`,Dt=`<!DOCTYPE html>
|
|
15
15
|
<html lang="en">
|
|
16
16
|
<head>
|
|
17
17
|
<meta charset="utf-8">
|
|
18
18
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
19
19
|
<title>Untitled Artifact</title>
|
|
20
20
|
<style>
|
|
21
|
-
${
|
|
21
|
+
${V}
|
|
22
22
|
</style>
|
|
23
23
|
</head>
|
|
24
24
|
<body>
|
|
@@ -26,14 +26,14 @@ ${U}
|
|
|
26
26
|
<div class="meta"><span class="muted">Created from the RCS artifacts gallery</span></div>
|
|
27
27
|
<!-- content here -->
|
|
28
28
|
</body>
|
|
29
|
-
</html>`,
|
|
29
|
+
</html>`,Pt=`<!DOCTYPE html>
|
|
30
30
|
<html lang="en">
|
|
31
31
|
<head>
|
|
32
32
|
<meta charset="utf-8">
|
|
33
33
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
34
34
|
<title>PR Review</title>
|
|
35
35
|
<style>
|
|
36
|
-
${
|
|
36
|
+
${V}
|
|
37
37
|
.file { border: 1px solid #e5e7eb; border-radius: 8px; margin: 12px 0; overflow: hidden; }
|
|
38
38
|
.file-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f9fafb; cursor: pointer; }
|
|
39
39
|
.file-head .name { font-family: ui-monospace, Menlo, monospace; font-size: 13px; flex: 1; }
|
|
@@ -108,14 +108,14 @@ function render() {
|
|
|
108
108
|
render();
|
|
109
109
|
<\/script>
|
|
110
110
|
</body>
|
|
111
|
-
</html>`,
|
|
111
|
+
</html>`,Bt=`<!DOCTYPE html>
|
|
112
112
|
<html lang="en">
|
|
113
113
|
<head>
|
|
114
114
|
<meta charset="utf-8">
|
|
115
115
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
116
116
|
<title>Incident Timeline</title>
|
|
117
117
|
<style>
|
|
118
|
-
${
|
|
118
|
+
${V}
|
|
119
119
|
#status-banner { border-radius: 8px; padding: 12px 16px; margin: 12px 0; font-weight: 500; }
|
|
120
120
|
#status-banner.investigating { background: #fef3c7; color: #92400e; }
|
|
121
121
|
#status-banner.mitigated { background: #dcfce7; color: #166534; }
|
|
@@ -174,14 +174,14 @@ document.getElementById('toggle').addEventListener('click', function () {
|
|
|
174
174
|
render();
|
|
175
175
|
<\/script>
|
|
176
176
|
</body>
|
|
177
|
-
</html>`,
|
|
177
|
+
</html>`,Mt=`<!DOCTYPE html>
|
|
178
178
|
<html lang="en">
|
|
179
179
|
<head>
|
|
180
180
|
<meta charset="utf-8">
|
|
181
181
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
182
182
|
<title>Data Dashboard</title>
|
|
183
183
|
<style>
|
|
184
|
-
${
|
|
184
|
+
${V}
|
|
185
185
|
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
|
|
186
186
|
.kpi { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
|
|
187
187
|
.kpi .label { font-size: 12px; color: #6b7280; }
|
|
@@ -264,14 +264,14 @@ function renderTable() {
|
|
|
264
264
|
renderKpis(); renderChart(); renderTable();
|
|
265
265
|
<\/script>
|
|
266
266
|
</body>
|
|
267
|
-
</html>`,
|
|
267
|
+
</html>`,qt=`<!DOCTYPE html>
|
|
268
268
|
<html lang="en">
|
|
269
269
|
<head>
|
|
270
270
|
<meta charset="utf-8">
|
|
271
271
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
272
272
|
<title>Release Checklist</title>
|
|
273
273
|
<style>
|
|
274
|
-
${
|
|
274
|
+
${V}
|
|
275
275
|
.progress { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 14px 0 22px; }
|
|
276
276
|
.progress > div { height: 100%; background: #D77757; width: 0; transition: width .3s; }
|
|
277
277
|
.stage { margin: 18px 0; }
|
|
@@ -341,32 +341,32 @@ function render() {
|
|
|
341
341
|
render();
|
|
342
342
|
<\/script>
|
|
343
343
|
</body>
|
|
344
|
-
</html>`,
|
|
345
|
-
]`).replace("lheading",
|
|
344
|
+
</html>`,me=[{id:"blank",titleKey:"artifacts.create.templateBlank",descKey:"",defaultTitle:"Untitled Artifact",html:Dt},{id:"pr-review",titleKey:"artifacts.create.templatePrReview",descKey:"artifacts.templateDesc.prReview",defaultTitle:"PR Review",html:Pt},{id:"incident",titleKey:"artifacts.create.templateIncident",descKey:"artifacts.templateDesc.incident",defaultTitle:"Incident Timeline",html:Bt},{id:"dashboard",titleKey:"artifacts.create.templateDashboard",descKey:"artifacts.templateDesc.dashboard",defaultTitle:"Data Dashboard",html:Mt},{id:"checklist",titleKey:"artifacts.create.templateChecklist",descKey:"artifacts.templateDesc.checklist",defaultTitle:"Release Checklist",html:qt}];function Z(t){return me.find(e=>e.id===t)??me[0]}function we(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=we();function Ge(t){F=t}var q={exec:()=>null};function y(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(s,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace($.caret,"$1"),r=r.replace(s,l),n},getRegex:()=>new RegExp(r,e)};return n}var Ht=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Ft=/^(?:[ \t]*(?:\n|$))+/,Ot=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Kt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,W=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ye=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ue=y(Qe).replace(/bull/g,ye).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Gt=y(Qe).replace(/bull/g,ye).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ve=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Qt=/^[^\n]+/,Se=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ut=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Se).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vt=y(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ye).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Re=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Wt=y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Re).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ve=y(ve).replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),Xt=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ve).getRegex(),Te={blockquote:Xt,code:Ot,def:Ut,fences:Kt,heading:Zt,hr:W,html:Wt,lheading:Ue,list:Vt,newline:Ft,paragraph:Ve,table:q,text:Qt},Be=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),Yt={...Te,lheading:Gt,table:Be,paragraph:y(ve).replace("hr",W).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Be).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},Jt={...Te,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Re).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:q,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(ve).replace("hr",W).replace("heading",` *#{1,6} *[^
|
|
345
|
+
]`).replace("lheading",Ue).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},er=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,We=/^( {2,}|\\)\n(?!\s*$)/,rr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,K=/[\p{P}\p{S}]/u,ie=/[\s\p{P}\p{S}]/u,$e=/[^\s\p{P}\p{S}]/u,sr=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ie).getRegex(),Xe=/(?!~)[\p{P}\p{S}]/u,nr=/(?!~)[\s\p{P}\p{S}]/u,ar=/(?:[^\s\p{P}\p{S}]|~)/u,ir=y(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ht?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ye=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,lr=y(Ye,"u").replace(/punct/g,K).getRegex(),or=y(Ye,"u").replace(/punct/g,Xe).getRegex(),Je="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cr=y(Je,"gu").replace(/notPunctSpace/g,$e).replace(/punctSpace/g,ie).replace(/punct/g,K).getRegex(),dr=y(Je,"gu").replace(/notPunctSpace/g,ar).replace(/punctSpace/g,nr).replace(/punct/g,Xe).getRegex(),pr=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$e).replace(/punctSpace/g,ie).replace(/punct/g,K).getRegex(),ur=y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,K).getRegex(),hr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",fr=y(hr,"gu").replace(/notPunctSpace/g,$e).replace(/punctSpace/g,ie).replace(/punct/g,K).getRegex(),mr=y(/\\(punct)/,"gu").replace(/punct/g,K).getRegex(),xr=y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),gr=y(Re).replace("(?:-->|$)","-->").getRegex(),br=y("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",gr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),re=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,kr=y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),et=y(/^!?\[(label)\]\[(ref)\]/).replace("label",re).replace("ref",Se).getRegex(),tt=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",Se).getRegex(),wr=y("reflink|nolink(?!\\()","g").replace("reflink",et).replace("nolink",tt).getRegex(),Me=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ee={_backpedal:q,anyPunctuation:mr,autolink:xr,blockSkip:ir,br:We,code:tr,del:q,delLDelim:q,delRDelim:q,emStrongLDelim:lr,emStrongRDelimAst:cr,emStrongRDelimUnd:pr,escape:er,link:kr,nolink:tt,punctuation:sr,reflink:et,reflinkSearch:wr,tag:br,text:rr,url:q},yr={...Ee,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",re).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",re).getRegex()},xe={...Ee,emStrongRDelimAst:dr,emStrongLDelim:or,delLDelim:ur,delRDelim:fr,url:y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Me).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:y(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Me).getRegex()},vr={...xe,br:y(We).replace("{2,}","*").getRegex(),text:y(xe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ee={normal:Te,gfm:Yt,pedantic:Jt},G={normal:Ee,gfm:xe,breaks:vr,pedantic:yr},Sr={"&":"&","<":"<",">":">",'"':""","'":"'"},qe=t=>Sr[t];function L(t,e){if(e){if($.escapeTest.test(t))return t.replace($.escapeReplace,qe)}else if($.escapeTestNoEncode.test(t))return t.replace($.escapeReplaceNoEncode,qe);return t}function He(t){try{t=encodeURI(t).replace($.percentDecode,"%")}catch{return null}return t}function Fe(t,e){var i;let r=t.replace($.findPipe,(l,a,p)=>{let c=!1,h=a;for(;--h>=0&&p[h]==="\\";)c=!c;return c?"|":" |"}),n=r.split($.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!((i=n.at(-1))!=null&&i.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace($.slashPipe,"|");return n}function Q(t,e,r){let n=t.length;if(n===0)return"";let s=0;for(;s<n&&t.charAt(n-s-1)===e;)s++;return t.slice(0,n-s)}function Rr(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function Tr(t,e=0){let r=e,n="";for(let s of t)if(s===" "){let i=4-r%4;n+=" ".repeat(i),r+=i}else n+=s,r++;return n}function Oe(t,e,r,n,s){let i=e.href,l=e.title||null,a=t[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let p={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:l,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,p}function $r(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let s=n[1];return e.split(`
|
|
346
346
|
`).map(i=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[a]=l;return a.length>=s.length?i.slice(s.length):i}).join(`
|
|
347
|
-
`)}var
|
|
348
|
-
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],n
|
|
349
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=
|
|
347
|
+
`)}var se=class{constructor(t){R(this,"options");R(this,"rules");R(this,"lexer");this.options=t||F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Q(r,`
|
|
348
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],n=$r(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let n=Q(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Q(e[0],`
|
|
349
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=Q(e[0],`
|
|
350
350
|
`).split(`
|
|
351
351
|
`),n="",s="",i=[];for(;r.length>0;){let l=!1,a=[],p;for(p=0;p<r.length;p++)if(this.rules.other.blockquoteStart.test(r[p]))a.push(r[p]),l=!0;else if(!l)a.push(r[p]);else break;r=r.slice(p);let c=a.join(`
|
|
352
352
|
`),h=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
353
353
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
354
354
|
${c}`:c,s=s?`${s}
|
|
355
|
-
${h}`:h;let
|
|
355
|
+
${h}`:h;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,i,!0),this.lexer.state.top=x,r.length===0)break;let m=i.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let d=m,w=d.raw+`
|
|
356
356
|
`+r.join(`
|
|
357
|
-
`),b=this.blockquote(
|
|
357
|
+
`),b=this.blockquote(w);i[i.length-1]=b,n=n.substring(0,n.length-d.raw.length)+b.raw,s=s.substring(0,s.length-d.text.length)+b.text;break}else if((m==null?void 0:m.type)==="list"){let d=m,w=d.raw+`
|
|
358
358
|
`+r.join(`
|
|
359
|
-
`),b=this.list(
|
|
360
|
-
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:s}}}list(t){var r,n;let e=this.rules.block.list.exec(t);if(e){let s=e[1].trim(),i=s.length>1,l={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");let a=this.rules.other.listItemRegex(s),p=!1;for(;t;){let h=!1,
|
|
361
|
-
`,1)[0],e[1].length),
|
|
362
|
-
`,1)[0],b=!d.trim(),v=0;if(this.options.pedantic?(v=2,
|
|
363
|
-
`,t=t.substring(
|
|
364
|
-
`,1)[0],T;if(
|
|
365
|
-
`+T.slice(v);else{if(b||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||
|
|
366
|
-
`+
|
|
367
|
-
`,t=t.substring(
|
|
368
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<r.length;a++)i.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:i.align[a]});for(let a of s)i.rows.push(
|
|
369
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=
|
|
359
|
+
`),b=this.list(w);i[i.length-1]=b,n=n.substring(0,n.length-m.raw.length)+b.raw,s=s.substring(0,s.length-d.raw.length)+b.raw,r=w.substring(i.at(-1).raw.length).split(`
|
|
360
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:s}}}list(t){var r,n;let e=this.rules.block.list.exec(t);if(e){let s=e[1].trim(),i=s.length>1,l={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");let a=this.rules.other.listItemRegex(s),p=!1;for(;t;){let h=!1,x="",m="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;x=e[0],t=t.substring(x.length);let d=Tr(e[2].split(`
|
|
361
|
+
`,1)[0],e[1].length),w=t.split(`
|
|
362
|
+
`,1)[0],b=!d.trim(),v=0;if(this.options.pedantic?(v=2,m=d.trimStart()):b?v=e[1].length+1:(v=d.search(this.rules.other.nonSpaceChar),v=v>4?1:v,m=d.slice(v),v+=e[1].length),b&&this.rules.other.blankLine.test(w)&&(x+=w+`
|
|
363
|
+
`,t=t.substring(w.length+1),h=!0),!h){let C=this.rules.other.nextBulletRegex(v),z=this.rules.other.hrRegex(v),D=this.rules.other.fencesBeginRegex(v),P=this.rules.other.headingBeginRegex(v),E=this.rules.other.htmlBeginRegex(v),B=this.rules.other.blockquoteBeginRegex(v);for(;t;){let g=t.split(`
|
|
364
|
+
`,1)[0],T;if(w=g,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),T=w):T=w.replace(this.rules.other.tabCharGlobal," "),D.test(w)||P.test(w)||E.test(w)||B.test(w)||C.test(w)||z.test(w))break;if(T.search(this.rules.other.nonSpaceChar)>=v||!w.trim())m+=`
|
|
365
|
+
`+T.slice(v);else{if(b||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||D.test(d)||P.test(d)||z.test(d))break;m+=`
|
|
366
|
+
`+w}b=!w.trim(),x+=g+`
|
|
367
|
+
`,t=t.substring(g.length+1),d=T.slice(v)}}l.loose||(p?l.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(p=!0)),l.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),l.raw+=x}let c=l.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let h of l.items){if(this.lexer.state.top=!1,h.tokens=this.lexer.blockTokens(h.text,[]),h.task){if(h.text=h.text.replace(this.rules.other.listReplaceTask,""),((r=h.tokens[0])==null?void 0:r.type)==="text"||((n=h.tokens[0])==null?void 0:n.type)==="paragraph"){h.tokens[0].raw=h.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),h.tokens[0].text=h.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let x=this.rules.other.listTaskCheckbox.exec(h.raw);if(x){let m={type:"checkbox",raw:x[0]+" ",checked:x[0]!=="[ ]"};h.checked=m.checked,l.loose?h.tokens[0]&&["paragraph","text"].includes(h.tokens[0].type)&&"tokens"in h.tokens[0]&&h.tokens[0].tokens?(h.tokens[0].raw=m.raw+h.tokens[0].raw,h.tokens[0].text=m.raw+h.tokens[0].text,h.tokens[0].tokens.unshift(m)):h.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):h.tokens.unshift(m)}}if(!l.loose){let x=h.tokens.filter(d=>d.type==="space"),m=x.length>0&&x.some(d=>this.rules.other.anyLine.test(d.raw));l.loose=m}}if(l.loose)for(let h of l.items){h.loose=!0;for(let x of h.tokens)x.type==="text"&&(x.type="paragraph")}return l}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:n,title:s}}}table(t){var l;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Fe(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(l=e[3])!=null&&l.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
368
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<r.length;a++)i.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:i.align[a]});for(let a of s)i.rows.push(Fe(a,i.header.length).map((p,c)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:i.align[c]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
|
|
369
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=Q(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=Rr(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let n=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Oe(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[n.toLowerCase()];if(!s){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Oe(r,s,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,i,l,a=s,p=0,c=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+s);(n=c.exec(e))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(l=[...i].length,n[3]||n[4]){a+=l;continue}else if((n[5]||n[6])&&s%3&&!((s+l)%3)){p+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+p);let h=[...n[0]][0].length,x=t.slice(0,s+n.index+h+l);if(Math.min(s,l)%2){let d=x.slice(1,-1);return{type:"em",raw:x,text:d,tokens:this.lexer.inlineTokens(d)}}let m=x.slice(2,-2);return{type:"strong",raw:x,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...n[0]].length-1,i,l,a=s,p=this.rules.inline.delRDelim;for(p.lastIndex=0,e=e.slice(-1*t.length+s);(n=p.exec(e))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(l=[...i].length,l!==s))continue;if(n[3]||n[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let c=[...n[0]][0].length,h=t.slice(0,s+n.index+c+l),x=h.slice(s,-s);return{type:"del",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,n;return e[2]==="@"?(r=e[1],n="mailto:"+r):(r=e[1],n=r),{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},I=class ge{constructor(e){R(this,"tokens");R(this,"options");R(this,"state");R(this,"inlineQueue");R(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||F,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:$,block:ee.normal,inline:G.normal};this.options.pedantic?(r.block=ee.pedantic,r.inline=G.pedantic):this.options.gfm&&(r.block=ee.gfm,this.options.breaks?r.inline=G.breaks:r.inline=G.gfm),this.tokenizer.rules=r}static get rules(){return{block:ee,inline:G}}static lex(e,r){return new ge(r).lex(e)}static lexInline(e,r){return new ge(r).inlineTokens(e)}lex(e){e=e.replace($.carriageReturn,`
|
|
370
370
|
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var s,i,l;for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace($.tabCharGlobal," ").replace($.spaceLine,""));e;){let a;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let c=r.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
|
|
371
371
|
`:r.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
372
372
|
`)?"":`
|
|
@@ -374,15 +374,15 @@ ${h}`:h;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
374
374
|
`+a.text,this.inlineQueue.at(-1).src=c.text):r.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
375
375
|
`)?"":`
|
|
376
376
|
`)+a.raw,c.text+=`
|
|
377
|
-
`+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},r.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),r.push(a);continue}let p=e;if((l=this.options.extensions)!=null&&l.startBlock){let c=1/0,h=e.slice(1),
|
|
377
|
+
`+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},r.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),r.push(a);continue}let p=e;if((l=this.options.extensions)!=null&&l.startBlock){let c=1/0,h=e.slice(1),x;this.options.extensions.startBlock.forEach(m=>{x=m.call({lexer:this},h),typeof x=="number"&&x>=0&&(c=Math.min(c,x))}),c<1/0&&c>=0&&(p=e.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(p))){let c=r.at(-1);n&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(`
|
|
378
378
|
`)?"":`
|
|
379
379
|
`)+a.raw,c.text+=`
|
|
380
380
|
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(a),n=p.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
381
381
|
`)?"":`
|
|
382
382
|
`)+a.raw,c.text+=`
|
|
383
|
-
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var p,c,h,
|
|
384
|
-
`;return n?'<pre><code class="language-'+
|
|
385
|
-
`:"<pre><code>"+(r?s:
|
|
383
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var p,c,h,x,m;this.tokenizer.lexer=this;let n=e,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=s[2]?s[2].length:0,n=n.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((c=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:c.call({lexer:this},n))??n;let l=!1,a="";for(;e;){l||(a=""),l=!1;let d;if((x=(h=this.options.extensions)==null?void 0:h.inline)!=null&&x.some(b=>(d=b.call({lexer:this},e,r))?(e=e.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);let b=r.at(-1);d.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(e,n,a)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(e,n,a)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),r.push(d);continue}let w=e;if((m=this.options.extensions)!=null&&m.startInline){let b=1/0,v=e.slice(1),C;this.options.extensions.startInline.forEach(z=>{C=z.call({lexer:this},v),typeof C=="number"&&C>=0&&(b=Math.min(b,C))}),b<1/0&&b>=0&&(w=e.substring(0,b+1))}if(d=this.tokenizer.inlineText(w)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(a=d.raw.slice(-1)),l=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(e){let b="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},ne=class{constructor(t){R(this,"options");R(this,"parser");this.options=t||F}space(t){return""}code({text:t,lang:e,escaped:r}){var i;let n=(i=(e||"").match($.notSpaceStart))==null?void 0:i[0],s=t.replace($.endingNewline,"")+`
|
|
384
|
+
`;return n?'<pre><code class="language-'+L(n)+'">'+(r?s:L(s,!0))+`</code></pre>
|
|
385
|
+
`:"<pre><code>"+(r?s:L(s,!0))+`</code></pre>
|
|
386
386
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
387
387
|
${this.parser.parse(t)}</blockquote>
|
|
388
388
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
@@ -398,9 +398,9 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
398
398
|
`}tablerow({text:t}){return`<tr>
|
|
399
399
|
${t}</tr>
|
|
400
400
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
|
|
401
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${
|
|
402
|
-
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+
|
|
403
|
-
h1 { border-bottom: 2px solid ${
|
|
401
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${L(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let n=this.parser.parseInline(r),s=He(t);if(s===null)return n;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+L(e)+'"'),i+=">"+n+"</a>",i}image({href:t,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let s=He(t);if(s===null)return L(r);t=s;let i=`<img src="${t}" alt="${L(r)}"`;return e&&(i+=` title="${L(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:L(t.text)}},je=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},A=class be{constructor(e){R(this,"options");R(this,"renderer");R(this,"textRenderer");this.options=e||F,this.options.renderer=this.options.renderer||new ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new je}static parse(e,r){return new be(r).parse(e)}static parseInline(e,r){return new be(r).parseInline(e)}parse(e){var n,s;this.renderer.parser=this;let r="";for(let i=0;i<e.length;i++){let l=e[i];if((s=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&s[l.type]){let p=l,c=this.options.extensions.renderers[p.type].call({parser:this},p);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(p.type)){r+=c||"";continue}}let a=l;switch(a.type){case"space":{r+=this.renderer.space(a);break}case"hr":{r+=this.renderer.hr(a);break}case"heading":{r+=this.renderer.heading(a);break}case"code":{r+=this.renderer.code(a);break}case"table":{r+=this.renderer.table(a);break}case"blockquote":{r+=this.renderer.blockquote(a);break}case"list":{r+=this.renderer.list(a);break}case"checkbox":{r+=this.renderer.checkbox(a);break}case"html":{r+=this.renderer.html(a);break}case"def":{r+=this.renderer.def(a);break}case"paragraph":{r+=this.renderer.paragraph(a);break}case"text":{r+=this.renderer.text(a);break}default:{let p='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return r}parseInline(e,r=this.renderer){var s,i;this.renderer.parser=this;let n="";for(let l=0;l<e.length;l++){let a=e[l];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=c||"";continue}}let p=a;switch(p.type){case"escape":{n+=r.text(p);break}case"html":{n+=r.html(p);break}case"link":{n+=r.link(p);break}case"image":{n+=r.image(p);break}case"checkbox":{n+=r.checkbox(p);break}case"strong":{n+=r.strong(p);break}case"em":{n+=r.em(p);break}case"codespan":{n+=r.codespan(p);break}case"br":{n+=r.br(p);break}case"del":{n+=r.del(p);break}case"text":{n+=r.text(p);break}default:{let c='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},te,U=(te=class{constructor(t){R(this,"options");R(this,"block");this.options=t||F}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?I.lex:I.lexInline}provideParser(t=this.block){return t?A.parse:A.parseInline}},R(te,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),R(te,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),te),Er=class{constructor(...t){R(this,"defaults",we());R(this,"options",this.setOptions);R(this,"parse",this.parseMarkdown(!0));R(this,"parseInline",this.parseMarkdown(!1));R(this,"Parser",A);R(this,"Renderer",ne);R(this,"TextRenderer",je);R(this,"Lexer",I);R(this,"Tokenizer",se);R(this,"Hooks",U);this.use(...t)}walkTokens(t,e){var n,s;let r=[];for(let i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{let l=i;for(let a of l.header)r=r.concat(this.walkTokens(a.tokens,e));for(let a of l.rows)for(let p of a)r=r.concat(this.walkTokens(p.tokens,e));break}case"list":{let l=i;r=r.concat(this.walkTokens(l.items,e));break}default:{let l=i;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[l.type]?this.defaults.extensions.childTokens[l.type].forEach(a=>{let p=l[a].flat(1/0);r=r.concat(this.walkTokens(p,e))}):l.tokens&&(r=r.concat(this.walkTokens(l.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...l){let a=s.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),n.extensions=e),r.renderer){let s=this.defaults.renderer||new ne(this.defaults);for(let i in r.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=r.renderer[l],p=s[l];s[l]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=p.apply(s,c)),h||""}}n.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new se(this.defaults);for(let i in r.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,a=r.tokenizer[l],p=s[l];s[l]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=p.apply(s,c)),h}}n.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new U;for(let i in r.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,a=r.hooks[l],p=s[l];U.passThroughHooks.has(i)?s[l]=c=>{if(this.defaults.async&&U.passThroughHooksRespectAsync.has(i))return(async()=>{let x=await a.call(s,c);return p.call(s,x)})();let h=a.call(s,c);return p.call(s,h)}:s[l]=(...c)=>{if(this.defaults.async)return(async()=>{let x=await a.apply(s,c);return x===!1&&(x=await p.apply(s,c)),x})();let h=a.apply(s,c);return h===!1&&(h=p.apply(s,c)),h}}n.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),s&&(a=a.concat(s.call(this,l))),a}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return I.lex(t,e??this.defaults)}parser(t,e){return A.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let n={...r},s={...this.defaults,...n},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let l=s.hooks?await s.hooks.preprocess(e):e,a=await(s.hooks?await s.hooks.provideLexer(t):t?I.lex:I.lexInline)(l,s),p=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(p,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(t):t?A.parse:A.parseInline)(p,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let l=(s.hooks?s.hooks.provideLexer(t):t?I.lex:I.lexInline)(e,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(t):t?A.parse:A.parseInline)(l,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(l){return i(l)}}}onError(t,e){return r=>{if(r.message+=`
|
|
402
|
+
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+L(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},H=new Er;function S(t,e){return H.parse(t,e)}S.options=S.setOptions=function(t){return H.setOptions(t),S.defaults=H.defaults,Ge(S.defaults),S};S.getDefaults=we;S.defaults=F;S.use=function(...t){return H.use(...t),S.defaults=H.defaults,Ge(S.defaults),S};S.walkTokens=function(t,e){return H.walkTokens(t,e)};S.parseInline=H.parseInline;S.Parser=A;S.parser=A.parse;S.Renderer=ne;S.TextRenderer=je;S.Lexer=I;S.lexer=I.lex;S.Tokenizer=se;S.Hooks=U;S.parse=S;S.options;S.setOptions;S.use;S.walkTokens;S.parseInline;A.parse;I.lex;const fe="#D77757",jr=`body { font: 14px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 800px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
|
|
403
|
+
h1 { border-bottom: 2px solid ${fe}; padding-bottom: .3rem; }
|
|
404
404
|
h2 { margin-top: 1.5em; }
|
|
405
405
|
img { max-width: 100%; }
|
|
406
406
|
pre { background: #f6f6f6; padding: .75rem 1rem; border-radius: 4px; overflow-x: auto; }
|
|
@@ -409,23 +409,23 @@ pre code { background: none; padding: 0; }
|
|
|
409
409
|
table { border-collapse: collapse; width: 100%; margin: 1em 0; }
|
|
410
410
|
th, td { border: 1px solid #ddd; padding: 6px 10px; text-align: left; }
|
|
411
411
|
th { background: #f6f6f6; }
|
|
412
|
-
blockquote { border-left: 3px solid ${
|
|
413
|
-
a { color: ${
|
|
414
|
-
hr { border: none; border-top: 1px solid #ddd; }`;function
|
|
412
|
+
blockquote { border-left: 3px solid ${fe}; margin: 0; padding: .25rem 1rem; color: #555; }
|
|
413
|
+
a { color: ${fe}; }
|
|
414
|
+
hr { border: none; border-top: 1px solid #ddd; }`;function Cr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Nr(t){for(const e of S.lexer(t))if(e.type==="heading"&&e.depth===1)return e.text}function Ke(t){const e=S.parse(t,{async:!1,gfm:!0,breaks:!1}),r=Nr(t);return{html:`<!DOCTYPE html>
|
|
415
415
|
<html lang="en">
|
|
416
416
|
<head>
|
|
417
417
|
<meta charset="utf-8">
|
|
418
418
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
419
|
-
<title>${
|
|
419
|
+
<title>${Cr(r??"Untitled Artifact")}</title>
|
|
420
420
|
<style>
|
|
421
|
-
${
|
|
421
|
+
${jr}
|
|
422
422
|
</style>
|
|
423
423
|
</head>
|
|
424
424
|
<body>
|
|
425
425
|
${e}
|
|
426
426
|
</body>
|
|
427
|
-
</html>`,title:r}}const
|
|
428
|
-
`)}function Je(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function jr(t){if(!t)return"—";try{return new Date(t).toLocaleString()}catch{return t}}function Cr(t){if(!t)return null;const e=new Date(t).getTime();return Number.isNaN(e)?null:Math.ceil((e-Date.now())/(1440*60*1e3))}function Nr({sessionId:t,embedded:e=!1,refreshTick:r}){He();const[n,s]=y.useState([]),[i,l]=y.useState(!0),[a,p]=y.useState(""),[c,h]=y.useState(!1),[g,f]=y.useState(null),[d,k]=y.useState(null),{activeTeam:b}=lt(),v=y.useCallback(async()=>{try{const x=await ot(t?{session_id:t}:b?{team_id:b.id}:e?void 0:{scope:"personal"});s(x||[]),p("")}catch(x){p(x instanceof Error?x.message:m("artifacts.loadFailed"))}finally{l(!1)}},[t,b,e]);y.useEffect(()=>{v();const x=setInterval(v,15e3);return window.addEventListener("focus",v),()=>{clearInterval(x),window.removeEventListener("focus",v)}},[v]);const j=y.useRef(!1);y.useEffect(()=>{if(!j.current){j.current=!0;return}v()},[r,v]);const I=y.useCallback(x=>{h(!1),f(null),s(T=>[x,...T.filter(B=>B.id!==x.id)])},[]),L=y.useCallback(async x=>{if(window.confirm(m("artifacts.delete")+" — "+x.slice(0,8)+"…?"))try{await ct(x),s(T=>T.filter(B=>B.id!==x))}catch(T){alert(T instanceof Error?T.message:m("artifacts.deleteFailed"))}},[]),D=y.useCallback(async x=>{await dt(`${window.location.origin}${x.url}`)&&(k(x.id),setTimeout(()=>k(null),1500))},[]),E=y.useMemo(()=>n,[n]),P=o.jsxs(o.Fragment,{children:[a&&o.jsx("p",{className:"text-status-error text-sm",children:a}),i?o.jsx("div",{className:"space-y-3",children:[0,1,2].map(x=>o.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},x))}):E.length===0?o.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[o.jsx(pt,{className:"mx-auto h-8 w-8 text-text-muted/40"}),o.jsx("p",{className:"mt-3 text-sm text-text-muted",children:m("artifacts.empty")})]}):o.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:E.map(x=>{const T=Cr(x.expires_at);return o.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("a",{href:`/code/a/${x.id}`,className:"min-w-0 flex-1 no-underline",children:[o.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:x.title||x.id.slice(0,12)}),o.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[x.id.slice(0,10),"… · v",x.version," · ",Je(x.size)]})]}),o.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${T!==null&&T<=0?"bg-status-error/15 text-status-error":T!==null&&T<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:T===null?"∞":`${T}d`})]}),o.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[x.session_id&&o.jsxs("a",{href:`/code/${x.session_id}`,className:"truncate text-text-muted hover:text-accent",title:x.session_id,children:[m("artifacts.session"),": ",x.session_id.slice(0,14),"…"]}),o.jsxs("span",{className:"flex items-center gap-1",title:m("artifacts.updatedAt"),children:[o.jsx(ht,{className:"h-3 w-3"}),jr(x.updated_at)]})]}),o.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[o.jsx("a",{href:x.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:m("artifacts.openInNewTab"),children:o.jsx(Ct,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{type:"button",onClick:()=>D(x),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:`${m("artifacts.copyLink")} · ${m("artifacts.linkNotice")}`,children:[o.jsx(Et,{className:"h-3.5 w-3.5"}),d===x.id&&o.jsx("span",{className:"text-status-active",children:m("artifacts.copied")})]}),x.can_manage&&o.jsx("button",{type:"button",onClick:()=>f(x),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:m("artifacts.edit"),children:o.jsx(ut,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",onClick:()=>L(x.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:m("artifacts.delete"),children:o.jsx(ft,{className:"h-3.5 w-3.5"})})]})]},x.id)})})]});return e?o.jsxs("div",{children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-medium text-text-primary",children:m("artifacts.title")}),o.jsxs("button",{type:"button",onClick:()=>{f(null),h(!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:[o.jsx(ze,{className:"h-4 w-4"}),m("artifacts.new")]})]}),P,o.jsx(me,{open:c,onClose:()=>h(!1),onCreated:I,sessionId:t,editArtifact:g})]}):o.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[o.jsxs("header",{className:"mb-10 flex items-start justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary sm:text-4xl",children:m("artifacts.title")}),o.jsx("p",{className:"mt-3 text-sm text-text-muted",children:m("artifacts.subtitle")})]}),o.jsxs("button",{type:"button",onClick:()=>{f(null),h(!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:[o.jsx(ze,{className:"h-4 w-4"}),m("artifacts.new")]})]}),P,o.jsx(me,{open:c,onClose:()=>h(!1),onCreated:I,sessionId:t,editArtifact:g})]})}const Ar=[{id:"template",labelKey:"artifacts.create.mode.template"},{id:"markdown",labelKey:"artifacts.create.mode.markdown"},{id:"ai",labelKey:"artifacts.create.mode.ai"}];function me({open:t,onClose:e,onCreated:r,sessionId:n,editArtifact:s}){He();const i=!!s,[l,a]=y.useState("template"),[p,c]=y.useState("pr-review"),[h,g]=y.useState(""),[f,d]=y.useState(""),[k,b]=y.useState(""),[v,j]=y.useState(30),[I,L]=y.useState(!1),[D,E]=y.useState(""),[P,x]=y.useState(!1),[T,B]=y.useState(!1),[se,ne]=y.useState(null),[Te,$e]=y.useState(""),[O,Ee]=y.useState(""),[ae,je]=y.useState(""),[Ce,ie]=y.useState(!1),[le,Ne]=y.useState(null);y.useEffect(()=>{t&&(a("template"),c("pr-review"),j(30),L(!1),E(""),B(!1),b(""),$e(""),Ee(n??""),je(""),ie(!1),Ne(null),s?(x(!0),g(s.title??""),d(""),mt(s.id).then(u=>{g(u.title??""),d(u.content??""),u.can_manage===!1&&B(!0)}).catch(()=>B(!0)).finally(()=>x(!1))):(x(!1),g(""),d(K("pr-review").html)),!s&&!n&&(ne(null),gt().then(u=>ne(u.filter(_=>!xt(_.status)))).catch(()=>ne([]))))},[t,s,n]);const et=u=>{c(u);const _=K(u);d(_.html),h.trim()||g(_.defaultTitle)},[Ae,Ie]=y.useState("");y.useEffect(()=>{const u=setTimeout(()=>{Ie(l==="markdown"?k.trim()?qe(k).html:"":f)},300);return()=>clearTimeout(u)},[l,f,k]);const tt=l!=="ai"&&(l==="markdown"?k:f).trim().length>0&&!I&&!P&&!T,rt=async()=>{let u,_;if(l==="markdown"){const C=qe(k);u=C.html,_=C.title}else u=f.trim(),_=K(p).defaultTitle;if(u){L(!0),E("");try{const C={html:u,ttl:v,title:h.trim()||(i?void 0:_)};i?s&&(C.hash=s.id):C.session_id=n??(Te||void 0);const ce=await wt(C);r(ce)}catch(C){const ce=C instanceof Error?C.message:"";C instanceof yt&&C.status===404?E(m("artifacts.viewNotFound")):E(ce||m(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{L(!1)}}},st=async()=>{if(!O){E(m("artifacts.create.ai.sessionRequired"));return}if(!ae.trim()){E(m("artifacts.create.ai.briefRequired"));return}ie(!0),E("");try{const u=Er(ae);await bt(O,{type:"user",uuid:kt(),content:u,message:{content:u}}),Ne(O)}catch(u){E(u instanceof Error?u.message:m("artifacts.create.failed"))}finally{ie(!1)}},oe=se??[];return o.jsx(vt,{open:t,onOpenChange:u=>u?void 0:e(),children:o.jsxs(St,{className:"max-h-[85vh] overflow-y-auto sm:max-w-4xl",children:[o.jsx(Rt,{children:o.jsx(Tt,{children:i?m("artifacts.editArtifact"):m("artifacts.create.title")})}),o.jsxs("div",{className:"space-y-4",children:[!i&&o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-surface-2 p-1",children:Ar.map(u=>o.jsx("button",{type:"button",onClick:()=>{a(u.id),E("")},className:`flex-1 rounded-md px-3 py-1.5 text-sm transition-colors ${l===u.id?"bg-surface-1 font-medium text-text-primary shadow-sm":"text-text-secondary hover:text-text-primary"}`,children:m(u.labelKey)},u.id))}),l==="ai"&&!i&&(le?o.jsxs("div",{className:"rounded-lg border border-border bg-surface-1 p-4 text-center",children:[o.jsx("p",{className:"text-sm text-text-primary",children:m("artifacts.create.ai.sent")}),o.jsx("a",{href:`/code/${le}`,className:"mt-3 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:m("artifacts.create.ai.openSession")})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-session",children:m("artifacts.create.ai.targetSession")}),n?o.jsxs("p",{className:"rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-muted",children:[m("artifacts.session"),": ",n.slice(0,18),"…"]}):se===null?o.jsx("p",{className:"text-xs text-text-muted",children:m("common.loading")}):oe.length===0?o.jsx("p",{className:"text-sm text-text-muted",children:m("artifacts.create.ai.noSessions")}):o.jsxs("select",{id:"artifact-ai-session",value:O,onChange:u=>Ee(u.target.value),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",children:[o.jsx("option",{value:"",children:m("artifacts.create.ai.sessionRequired")}),oe.map(u=>o.jsx("option",{value:u.id,children:(u.title||u.id.slice(0,14))+(u.status==="running"?" · ⚡":"")},u.id))]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-brief",children:m("artifacts.create.ai.brief")}),o.jsx("textarea",{id:"artifact-ai-brief",value:ae,onChange:u=>je(u.target.value),placeholder:m("artifacts.create.ai.briefPlaceholder"),rows:6,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"})]})]})),l==="template"&&!i&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:m("artifacts.create.template")}),o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:pe.map(u=>o.jsxs("button",{type:"button",onClick:()=>et(u.id),className:`rounded-lg border p-3 text-left transition-colors ${p===u.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx("div",{className:"text-sm font-medium text-text-primary",children:m(u.titleKey)}),u.descKey&&o.jsx("div",{className:"mt-1 text-xs text-text-muted",children:m(u.descKey)})]},u.id))})]}),i&&s&&o.jsxs("p",{className:"text-xs text-text-muted",children:[o.jsxs("span",{className:"font-mono",children:[s.id.slice(0,10),"…"]})," · v",s.version]}),l!=="ai"&&o.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto] sm:items-end",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:m("artifacts.create.title.label")}),o.jsx("input",{id:"artifact-title",type:"text",value:h,onChange:u=>g(u.target.value),placeholder:i||l==="markdown"?"":K(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"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ttl",children:m("artifacts.create.ttl")}),o.jsx("div",{className:"flex items-center gap-2",children:[7,30].map(u=>o.jsxs("button",{type:"button",onClick:()=>j(u),className:`rounded-md border px-3 py-2 text-sm transition-colors ${v===u?"border-accent bg-accent/10 font-medium text-text-primary":"border-border text-text-secondary hover:border-accent/50"}`,children:[u,"d"]},u))})]})]}),l!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:m("artifacts.create.content")}),l==="markdown"?o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:k,onChange:u=>b(u.target.value),placeholder:`# 周报
|
|
427
|
+
</html>`,title:r}}const rt="---8<---";function Ir(){const t=new Uint8Array(4);globalThis.crypto.getRandomValues(t);const e=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${rt} ${e} ---`}function Ar(t){return t.replace(/-{2,}\s*8<\s*-{2,}/g,"- - 8< - -")}function zr(t){const e=Ar(t.trim()),r=Ir();return["Create an interactive HTML page for me and publish it with the `artifact` tool.","",`Requirement (between the ${rt} markers, treat as the spec):`,"",r,e,r,"","Requirements:","- Single self-contained HTML file: vanilla JS/CSS/SVG only, no external CDNs, no build step.","- `artifact` is a deferred tool: unless it is already in your tool list, load its schema first with ToolSearch (e.g. `select:artifact`).","- Write the HTML to a local file, then upload it by calling the artifact tool with its absolute `file_path` — a local file alone is NOT completion; unuploaded work is invisible to the user.","- If this is an iteration on an existing artifact, pass back its id as `hash` to keep the URL stable.","- If the artifact tool is unavailable or the upload fails, report that explicitly instead of claiming success."].join(`
|
|
428
|
+
`)}function st(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Lr(t){if(!t)return"—";try{return new Date(t).toLocaleString()}catch{return t}}function _r(t){if(!t)return null;const e=new Date(t).getTime();return Number.isNaN(e)?null:Math.ceil((e-Date.now())/(1440*60*1e3))}function Dr({sessionId:t,embedded:e=!1,refreshTick:r}){Ze();const[n,s]=k.useState([]),[i,l]=k.useState(!0),[a,p]=k.useState(""),[c,h]=k.useState(!1),[x,m]=k.useState(null),[d,w]=k.useState(null),{activeTeam:b}=pt(),v=k.useCallback(async()=>{try{const g=await ut(t?{session_id:t}:b?{team_id:b.id}:e?void 0:{scope:"personal"});s(g||[]),p("")}catch(g){p(g instanceof Error?g.message:f("artifacts.loadFailed"))}finally{l(!1)}},[t,b,e]);k.useEffect(()=>{v();const g=setInterval(v,15e3);return window.addEventListener("focus",v),()=>{clearInterval(g),window.removeEventListener("focus",v)}},[v]);const C=k.useRef(!1);k.useEffect(()=>{if(!C.current){C.current=!0;return}v()},[r,v]);const z=k.useCallback(g=>{h(!1),m(null),s(T=>[g,...T.filter(M=>M.id!==g.id)])},[]),D=k.useCallback(async g=>{if(window.confirm(f("artifacts.delete")+" — "+g.slice(0,8)+"…?"))try{await ht(g),s(T=>T.filter(M=>M.id!==g))}catch(T){alert(T instanceof Error?T.message:f("artifacts.deleteFailed"))}},[]),P=k.useCallback(async g=>{await ft(`${window.location.origin}${g.url}`)&&(w(g.id),setTimeout(()=>w(null),1500))},[]),E=k.useMemo(()=>n,[n]),B=o.jsxs(o.Fragment,{children:[a&&o.jsx("p",{className:"text-status-error text-sm",children:a}),i?o.jsx("div",{className:"space-y-3",children:[0,1,2].map(g=>o.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},g))}):E.length===0?o.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[o.jsx(mt,{className:"mx-auto h-8 w-8 text-text-muted/40"}),o.jsx("p",{className:"mt-3 text-sm text-text-muted",children:f("artifacts.empty")})]}):o.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:E.map(g=>{const T=_r(g.expires_at);return o.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("a",{href:`/code/a/${g.id}`,className:"min-w-0 flex-1 no-underline",children:[o.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:g.title||g.id.slice(0,12)}),o.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[g.id.slice(0,10),"… · v",g.version," · ",st(g.size)]})]}),o.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${T!==null&&T<=0?"bg-status-error/15 text-status-error":T!==null&&T<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:T===null?"∞":`${T}d`})]}),o.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[g.session_id&&o.jsxs("a",{href:`/code/${g.session_id}`,className:"truncate text-text-muted hover:text-accent",title:g.session_id,children:[f("artifacts.session"),": ",g.session_id.slice(0,14),"…"]}),o.jsxs("span",{className:"flex items-center gap-1",title:f("artifacts.updatedAt"),children:[o.jsx(xt,{className:"h-3 w-3"}),Lr(g.updated_at)]})]}),o.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[o.jsx("a",{href:g.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:f("artifacts.openInNewTab"),children:o.jsx(_t,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{type:"button",onClick:()=>P(g),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:`${f("artifacts.copyLink")} · ${f("artifacts.linkNotice")}`,children:[o.jsx(zt,{className:"h-3.5 w-3.5"}),d===g.id&&o.jsx("span",{className:"text-status-active",children:f("artifacts.copied")})]}),g.can_manage&&o.jsx("button",{type:"button",onClick:()=>m(g),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:f("artifacts.edit"),children:o.jsx(gt,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",onClick:()=>D(g.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:f("artifacts.delete"),children:o.jsx(bt,{className:"h-3.5 w-3.5"})})]})]},g.id)})})]});return e?o.jsxs("div",{children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-medium text-text-primary",children:f("artifacts.title")}),o.jsxs("button",{type:"button",onClick:()=>{m(null),h(!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:[o.jsx(Pe,{className:"h-4 w-4"}),f("artifacts.new")]})]}),B,o.jsx(ke,{open:c,onClose:()=>h(!1),onCreated:z,sessionId:t,editArtifact:x})]}):o.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[o.jsxs("header",{className:"mb-10 flex items-start justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary sm:text-4xl",children:f("artifacts.title")}),o.jsx("p",{className:"mt-3 text-sm text-text-muted",children:f("artifacts.subtitle")})]}),o.jsxs("button",{type:"button",onClick:()=>{m(null),h(!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:[o.jsx(Pe,{className:"h-4 w-4"}),f("artifacts.new")]})]}),B,o.jsx(ke,{open:c,onClose:()=>h(!1),onCreated:z,sessionId:t,editArtifact:x})]})}const Pr=[{id:"template",labelKey:"artifacts.create.mode.template"},{id:"markdown",labelKey:"artifacts.create.mode.markdown"},{id:"ai",labelKey:"artifacts.create.mode.ai"}];function ke({open:t,onClose:e,onCreated:r,sessionId:n,editArtifact:s}){Ze();const i=!!s,[l,a]=k.useState("template"),[p,c]=k.useState("pr-review"),[h,x]=k.useState(""),[m,d]=k.useState(""),[w,b]=k.useState(""),[v,C]=k.useState(30),[z,D]=k.useState(!1),[P,E]=k.useState(""),[B,g]=k.useState(!1),[T,M]=k.useState(!1),[le,oe]=k.useState(null),[Ce,Ne]=k.useState(""),[_,Ie]=k.useState(""),[ce,Ae]=k.useState(""),[ze,de]=k.useState(!1),[pe,Le]=k.useState(null),[O,X]=k.useState(null),[Y,J]=k.useState("");k.useEffect(()=>{t&&(a("template"),c("pr-review"),C(30),D(!1),E(""),M(!1),b(""),Ne(""),Ie(n??""),Ae(""),de(!1),Le(null),X(null),J(""),s?(g(!0),x(s.title??""),d(""),kt(s.id).then(u=>{x(u.title??""),d(u.content??""),u.can_manage===!1&&M(!0)}).catch(()=>M(!0)).finally(()=>g(!1))):(g(!1),x(""),d(Z("pr-review").html)),!s&&!n&&(oe(null),wt().then(u=>oe(u.filter(N=>!yt(N.status)))).catch(()=>oe([]))))},[t,s,n]),k.useEffect(()=>{if(!t||i||l!=="ai"||!_){X(null),J("");return}let u=!1;return vt(_).then(N=>{var j;u||(X(N.models),J(((j=N.models)==null?void 0:j.currentModelId)??""))}).catch(()=>{u||X(null)}),()=>{u=!0}},[t,i,l,_]);const nt=u=>{c(u);const N=Z(u);d(N.html),h.trim()||x(N.defaultTitle)},[_e,De]=k.useState("");k.useEffect(()=>{const u=setTimeout(()=>{De(l==="markdown"?w.trim()?Ke(w).html:"":m)},300);return()=>clearTimeout(u)},[l,m,w]);const at=l!=="ai"&&(l==="markdown"?w:m).trim().length>0&&!z&&!B&&!T,it=async()=>{let u,N;if(l==="markdown"){const j=Ke(w);u=j.html,N=j.title}else u=m.trim(),N=Z(p).defaultTitle;if(u){D(!0),E("");try{const j={html:u,ttl:v,title:h.trim()||(i?void 0:N)};i?s&&(j.hash=s.id):j.session_id=n??(Ce||void 0);const he=await $t(j);r(he)}catch(j){const he=j instanceof Error?j.message:"";j instanceof Et&&j.status===404?E(f("artifacts.viewNotFound")):E(he||f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{D(!1)}}},lt=async()=>{if(!_){E(f("artifacts.create.ai.sessionRequired"));return}if(!ce.trim()){E(f("artifacts.create.ai.briefRequired"));return}de(!0),E("");try{O&&Y&&Y!==O.currentModelId&&await St(_,{type:"control_request",request:{subtype:"set_model",model:Y}});const u=zr(ce);await Rt(_,{type:"user",uuid:Tt(),content:u,message:{content:u}}),Le(_)}catch(u){E(u instanceof Error?u.message:f("artifacts.create.failed"))}finally{de(!1)}},ue=le??[];return o.jsx(jt,{open:t,onOpenChange:u=>u?void 0:e(),children:o.jsxs(Ct,{className:"max-h-[85vh] overflow-y-auto sm:max-w-4xl",children:[o.jsx(Nt,{children:o.jsx(It,{children:i?f("artifacts.editArtifact"):f("artifacts.create.title")})}),o.jsxs("div",{className:"space-y-4",children:[!i&&o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-surface-2 p-1",children:Pr.map(u=>o.jsx("button",{type:"button",onClick:()=>{a(u.id),E("")},className:`flex-1 rounded-md px-3 py-1.5 text-sm transition-colors ${l===u.id?"bg-surface-1 font-medium text-text-primary shadow-sm":"text-text-secondary hover:text-text-primary"}`,children:f(u.labelKey)},u.id))}),l==="ai"&&!i&&(pe?o.jsxs("div",{className:"rounded-lg border border-border bg-surface-1 p-4 text-center",children:[o.jsx("p",{className:"text-sm text-text-primary",children:f("artifacts.create.ai.sent")}),o.jsx("a",{href:`/code/${pe}`,className:"mt-3 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:f("artifacts.create.ai.openSession")})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-session",children:f("artifacts.create.ai.targetSession")}),n?o.jsxs("p",{className:"rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-muted",children:[f("artifacts.session"),": ",n.slice(0,18),"…"]}):le===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):ue.length===0?o.jsx("p",{className:"text-sm text-text-muted",children:f("artifacts.create.ai.noSessions")}):o.jsxs("select",{id:"artifact-ai-session",value:_,onChange:u=>Ie(u.target.value),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",children:[o.jsx("option",{value:"",children:f("artifacts.create.ai.sessionRequired")}),ue.map(u=>o.jsx("option",{value:u.id,children:(u.title||u.id.slice(0,14))+(u.status==="running"?" · ⚡":"")},u.id))]})]}),O&&O.availableModels.length>0&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-model",children:f("artifacts.create.ai.model")}),o.jsx("select",{id:"artifact-ai-model",value:Y,onChange:u=>J(u.target.value),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",children:O.availableModels.map(u=>o.jsx("option",{value:u.modelId,children:u.name+(u.modelId===O.currentModelId?` · ${f("artifacts.create.ai.modelCurrent")}`:"")},u.modelId))}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.ai.modelHint")})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-brief",children:f("artifacts.create.ai.brief")}),o.jsx("textarea",{id:"artifact-ai-brief",value:ce,onChange:u=>Ae(u.target.value),placeholder:f("artifacts.create.ai.briefPlaceholder"),rows:6,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"})]})]})),l==="template"&&!i&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:f("artifacts.create.template")}),o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:me.map(u=>o.jsxs("button",{type:"button",onClick:()=>nt(u.id),className:`rounded-lg border p-3 text-left transition-colors ${p===u.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx("div",{className:"text-sm font-medium text-text-primary",children:f(u.titleKey)}),u.descKey&&o.jsx("div",{className:"mt-1 text-xs text-text-muted",children:f(u.descKey)})]},u.id))})]}),i&&s&&o.jsxs("p",{className:"text-xs text-text-muted",children:[o.jsxs("span",{className:"font-mono",children:[s.id.slice(0,10),"…"]})," · v",s.version]}),l!=="ai"&&o.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto] sm:items-end",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:f("artifacts.create.title.label")}),o.jsx("input",{id:"artifact-title",type:"text",value:h,onChange:u=>x(u.target.value),placeholder:i||l==="markdown"?"":Z(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"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ttl",children:f("artifacts.create.ttl")}),o.jsx("div",{className:"flex items-center gap-2",children:[7,30].map(u=>o.jsxs("button",{type:"button",onClick:()=>C(u),className:`rounded-md border px-3 py-2 text-sm transition-colors ${v===u?"border-accent bg-accent/10 font-medium text-text-primary":"border-border text-text-secondary hover:border-accent/50"}`,children:[u,"d"]},u))})]})]}),l!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:f("artifacts.create.content")}),l==="markdown"?o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:w,onChange:u=>b(u.target.value),placeholder:`# 周报
|
|
429
429
|
|
|
430
430
|
- 进度…
|
|
431
|
-
- 风险…`,rows:12,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"}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:
|
|
431
|
+
- 风险…`,rows:12,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"}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.markdownHint")})]}):o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:m,onChange:u=>d(u.target.value),placeholder:i?"":Z(p).html.slice(0,120)+"…",rows:12,spellCheck:!1,disabled:B,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 disabled:opacity-50"}),o.jsxs("div",{className:"mt-1 flex items-center justify-between text-xs text-text-muted",children:[o.jsx("span",{children:m.trim()?st(new Blob([m]).size):f("artifacts.create.contentRequired")}),o.jsx("span",{children:f("artifacts.create.ttlResetNote")})]})]})]}),!i&&l!=="ai"&&!n&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-bind-session",children:f("artifacts.create.bindSession")}),le===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):o.jsxs("select",{id:"artifact-bind-session",value:Ce,onChange:u=>Ne(u.target.value),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",children:[o.jsx("option",{value:"",children:f("artifacts.create.noSession")}),ue.map(u=>o.jsx("option",{value:u.id,children:u.title||u.id.slice(0,14)},u.id))]}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.sessionHint")})]}),_e.trim()&&l!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:f("artifacts.create.preview")}),o.jsx("iframe",{srcDoc:_e,title:"preview",className:"h-56 w-full rounded-md border border-border bg-white",sandbox:"allow-scripts allow-popups allow-forms"})]}),T&&o.jsx("p",{className:"text-sm text-status-error",children:f("artifacts.viewNotFound")}),P&&o.jsx("p",{className:"text-sm text-status-error",children:P})]}),o.jsxs(At,{children:[o.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:f("common.cancel")}),l==="ai"&&!i?o.jsx("button",{type:"button",onClick:lt,disabled:ze||!!pe||!_,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:ze?f("artifacts.create.ai.sending"):f("artifacts.create.ai.send")}):o.jsx("button",{type:"button",onClick:it,disabled:!at,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:z?f("common.creating"):i?f("artifacts.update"):f("artifacts.create.submit")})]})]})})}const Kr=Object.freeze(Object.defineProperty({__proto__:null,ArtifactsGallery:Dr,CreateArtifactDialog:ke},Symbol.toStringTag,{value:"Module"}));export{Dr as A,ke as C,_t as E,Kr as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{E as u,Q as f}from"./main-
|
|
1
|
+
import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{E as u,Q as f}from"./main-DfNbuMTS.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,4 +1,4 @@
|
|
|
1
|
-
import{j as e,e as l}from"./vendor-DE_-CLIE.js";import{
|
|
1
|
+
import{j as e,e as l}from"./vendor-DE_-CLIE.js";import{ad as O,ab as _,au as E,as as T,x as F,at as L,ao as a,ag as A,q as $,s as W,e as H,r as V,d as P,aj as q,I as Q,Q as R,Y as U,N as Y}from"./main-DfNbuMTS.js";import{g as D}from"./workerType-Bd-zteMi.js";import{S as Z}from"./SessionVisibilityBadge-Ba6plQFV.js";import{D as z,a as G,c as J,d as K,b as X}from"./dialog-cgjIoxTP.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.
|