@shaykec/bridge 0.4.20 → 0.4.21
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/README.md +2 -2
- package/canvas-dist/assets/{_basePickBy-CWoeT3J7.js → _basePickBy-BovdgFIW.js} +1 -1
- package/canvas-dist/assets/_basePickBy-BtkHe2u_.js +1 -0
- package/canvas-dist/assets/_basePickBy-C0936578.js +1 -0
- package/canvas-dist/assets/_basePickBy-CE2Qvuh7.js +1 -0
- package/canvas-dist/assets/_basePickBy-DV6sX4CG.js +1 -0
- package/canvas-dist/assets/_basePickBy-DZX6ZNMT.js +1 -0
- package/canvas-dist/assets/{_baseUniq-Dtuvtwtn.js → _baseUniq-B7dN28TM.js} +1 -1
- package/canvas-dist/assets/_baseUniq-Cl23fCdR.js +1 -0
- package/canvas-dist/assets/_baseUniq-CojWFw7B.js +1 -0
- package/canvas-dist/assets/_baseUniq-DA640BJl.js +1 -0
- package/canvas-dist/assets/_baseUniq-Ds-62CCj.js +1 -0
- package/canvas-dist/assets/_baseUniq-KG7SRw9H.js +1 -0
- package/canvas-dist/assets/{arc-YYWnrNJU.js → arc-7E9FFKlC.js} +1 -1
- package/canvas-dist/assets/arc-BSMfRZtt.js +1 -0
- package/canvas-dist/assets/arc-C6nT-koR.js +1 -0
- package/canvas-dist/assets/arc-D_fOnjmo.js +1 -0
- package/canvas-dist/assets/arc-Khfvgkr3.js +1 -0
- package/canvas-dist/assets/arc-ieS-i42x.js +1 -0
- package/canvas-dist/assets/{architectureDiagram-VXUJARFQ-CegbV-RR.js → architectureDiagram-VXUJARFQ-DF4t6GQD.js} +1 -1
- package/canvas-dist/assets/architectureDiagram-VXUJARFQ-DXgSlsio.js +36 -0
- package/canvas-dist/assets/architectureDiagram-VXUJARFQ-DiomxPB4.js +36 -0
- package/canvas-dist/assets/architectureDiagram-VXUJARFQ-DnFaxvXD.js +36 -0
- package/canvas-dist/assets/architectureDiagram-VXUJARFQ-Dt38C0LJ.js +36 -0
- package/canvas-dist/assets/architectureDiagram-VXUJARFQ-egbtMwua.js +36 -0
- package/canvas-dist/assets/{blockDiagram-VD42YOAC-C2e_j6ry.js → blockDiagram-VD42YOAC-CUNKQd-b.js} +1 -1
- package/canvas-dist/assets/blockDiagram-VD42YOAC-D-NiLXxd.js +122 -0
- package/canvas-dist/assets/blockDiagram-VD42YOAC-Dx6Dh9gg.js +122 -0
- package/canvas-dist/assets/blockDiagram-VD42YOAC-_r-PmlQy.js +122 -0
- package/canvas-dist/assets/blockDiagram-VD42YOAC-bvYKZLMc.js +122 -0
- package/canvas-dist/assets/blockDiagram-VD42YOAC-l85QT9Ig.js +122 -0
- package/canvas-dist/assets/{c4Diagram-YG6GDRKO-rIpnAud9.js → c4Diagram-YG6GDRKO-BWKCTyQi.js} +1 -1
- package/canvas-dist/assets/c4Diagram-YG6GDRKO-CbXs2xzC.js +10 -0
- package/canvas-dist/assets/c4Diagram-YG6GDRKO-CjiS-GNK.js +10 -0
- package/canvas-dist/assets/c4Diagram-YG6GDRKO-D7SnLlHp.js +10 -0
- package/canvas-dist/assets/c4Diagram-YG6GDRKO-RTTCSVf2.js +10 -0
- package/canvas-dist/assets/c4Diagram-YG6GDRKO-yvqJ_AqX.js +10 -0
- package/canvas-dist/assets/channel-CSXq7GP6.js +1 -0
- package/canvas-dist/assets/channel-CvujjGiJ.js +1 -0
- package/canvas-dist/assets/channel-D959Iony.js +1 -0
- package/canvas-dist/assets/channel-DOSwCnrB.js +1 -0
- package/canvas-dist/assets/channel-sw61LzxF.js +1 -0
- package/canvas-dist/assets/channel-vZVnNhOK.js +1 -0
- package/canvas-dist/assets/{chunk-4BX2VUAB-CpZGetnU.js → chunk-4BX2VUAB-BBjuAwXr.js} +1 -1
- package/canvas-dist/assets/chunk-4BX2VUAB-BXRNyucU.js +1 -0
- package/canvas-dist/assets/chunk-4BX2VUAB-Bgq5Z77T.js +1 -0
- package/canvas-dist/assets/chunk-4BX2VUAB-BuoMCMCr.js +1 -0
- package/canvas-dist/assets/chunk-4BX2VUAB-COD5n7vg.js +1 -0
- package/canvas-dist/assets/chunk-4BX2VUAB-K8DepKJO.js +1 -0
- package/canvas-dist/assets/{chunk-55IACEB6-L0OhcFdd.js → chunk-55IACEB6-Bic_bMrQ.js} +1 -1
- package/canvas-dist/assets/chunk-55IACEB6-DEy2QUDq.js +1 -0
- package/canvas-dist/assets/chunk-55IACEB6-Dcgbmfzg.js +1 -0
- package/canvas-dist/assets/chunk-55IACEB6-DfmuNm_E.js +1 -0
- package/canvas-dist/assets/chunk-55IACEB6-DlQRcczm.js +1 -0
- package/canvas-dist/assets/chunk-55IACEB6-p2qMY-fm.js +1 -0
- package/canvas-dist/assets/{chunk-B4BG7PRW-Cv9vsAzg.js → chunk-B4BG7PRW-BpbyxBP2.js} +1 -1
- package/canvas-dist/assets/chunk-B4BG7PRW-CCPqvPrP.js +165 -0
- package/canvas-dist/assets/chunk-B4BG7PRW-CEeDPAki.js +165 -0
- package/canvas-dist/assets/chunk-B4BG7PRW-D2UFN_2M.js +165 -0
- package/canvas-dist/assets/chunk-B4BG7PRW-DFI5h6HC.js +165 -0
- package/canvas-dist/assets/chunk-B4BG7PRW-DKOiFGMU.js +165 -0
- package/canvas-dist/assets/{chunk-DI55MBZ5-B3p1mU43.js → chunk-DI55MBZ5-BV6nHjNQ.js} +1 -1
- package/canvas-dist/assets/chunk-DI55MBZ5-CEZJmC0E.js +220 -0
- package/canvas-dist/assets/chunk-DI55MBZ5-DOZT99Ek.js +220 -0
- package/canvas-dist/assets/chunk-DI55MBZ5-DmC2LoG2.js +220 -0
- package/canvas-dist/assets/chunk-DI55MBZ5-DpkcJdZP.js +220 -0
- package/canvas-dist/assets/chunk-DI55MBZ5-fVTGx0zh.js +220 -0
- package/canvas-dist/assets/{chunk-FMBD7UC4-JCLAHw5x.js → chunk-FMBD7UC4-BOCyQpI7.js} +1 -1
- package/canvas-dist/assets/chunk-FMBD7UC4-C76FrRL8.js +15 -0
- package/canvas-dist/assets/chunk-FMBD7UC4-CAq-btWc.js +15 -0
- package/canvas-dist/assets/chunk-FMBD7UC4-CidVsej6.js +15 -0
- package/canvas-dist/assets/chunk-FMBD7UC4-DPpfskdX.js +15 -0
- package/canvas-dist/assets/chunk-FMBD7UC4-DnLtclge.js +15 -0
- package/canvas-dist/assets/{chunk-QN33PNHL-C9arKEVq.js → chunk-QN33PNHL-BclpCUi8.js} +1 -1
- package/canvas-dist/assets/chunk-QN33PNHL-DDUw8IU1.js +1 -0
- package/canvas-dist/assets/chunk-QN33PNHL-DdJFAUXw.js +1 -0
- package/canvas-dist/assets/chunk-QN33PNHL-DjV4jUn9.js +1 -0
- package/canvas-dist/assets/chunk-QN33PNHL-N-HTycqU.js +1 -0
- package/canvas-dist/assets/chunk-QN33PNHL-sd8p21DW.js +1 -0
- package/canvas-dist/assets/{chunk-QZHKN3VN-Bs1r3d9U.js → chunk-QZHKN3VN-B6mT-JkP.js} +1 -1
- package/canvas-dist/assets/chunk-QZHKN3VN-BCo8pc7x.js +1 -0
- package/canvas-dist/assets/chunk-QZHKN3VN-C8IIu6es.js +1 -0
- package/canvas-dist/assets/chunk-QZHKN3VN-D9FF492U.js +1 -0
- package/canvas-dist/assets/chunk-QZHKN3VN-DWMbUjXT.js +1 -0
- package/canvas-dist/assets/chunk-QZHKN3VN-l5FBJ77g.js +1 -0
- package/canvas-dist/assets/{chunk-TZMSLE5B-_Ye6r84Y.js → chunk-TZMSLE5B-BASt-UWt.js} +1 -1
- package/canvas-dist/assets/chunk-TZMSLE5B-BCfaZWLT.js +1 -0
- package/canvas-dist/assets/chunk-TZMSLE5B-BKIk_hBR.js +1 -0
- package/canvas-dist/assets/chunk-TZMSLE5B-C4pt-Ir8.js +1 -0
- package/canvas-dist/assets/chunk-TZMSLE5B-DwGlELvo.js +1 -0
- package/canvas-dist/assets/chunk-TZMSLE5B-jJKG-WvJ.js +1 -0
- package/canvas-dist/assets/classDiagram-2ON5EDUG-B7YQfPU4.js +1 -0
- package/canvas-dist/assets/classDiagram-2ON5EDUG-BZ61MaHY.js +1 -0
- package/canvas-dist/assets/classDiagram-2ON5EDUG-CGseYor2.js +1 -0
- package/canvas-dist/assets/classDiagram-2ON5EDUG-CKzOc99J.js +1 -0
- package/canvas-dist/assets/classDiagram-2ON5EDUG-Ce_LPjwW.js +1 -0
- package/canvas-dist/assets/classDiagram-2ON5EDUG-DorPdibv.js +1 -0
- package/canvas-dist/assets/classDiagram-v2-WZHVMYZB-B7YQfPU4.js +1 -0
- package/canvas-dist/assets/classDiagram-v2-WZHVMYZB-BZ61MaHY.js +1 -0
- package/canvas-dist/assets/classDiagram-v2-WZHVMYZB-CGseYor2.js +1 -0
- package/canvas-dist/assets/classDiagram-v2-WZHVMYZB-CKzOc99J.js +1 -0
- package/canvas-dist/assets/classDiagram-v2-WZHVMYZB-Ce_LPjwW.js +1 -0
- package/canvas-dist/assets/classDiagram-v2-WZHVMYZB-DorPdibv.js +1 -0
- package/canvas-dist/assets/clone-74KSto7H.js +1 -0
- package/canvas-dist/assets/clone-CJQgAYVe.js +1 -0
- package/canvas-dist/assets/clone-DLeTuhHE.js +1 -0
- package/canvas-dist/assets/clone-D_IHK_lQ.js +1 -0
- package/canvas-dist/assets/clone-DxMUv1L9.js +1 -0
- package/canvas-dist/assets/clone-UNKf_nED.js +1 -0
- package/canvas-dist/assets/{cose-bilkent-S5V4N54A-2O2oovOj.js → cose-bilkent-S5V4N54A-BTyQiCkr.js} +1 -1
- package/canvas-dist/assets/cose-bilkent-S5V4N54A-BtPAe24N.js +1 -0
- package/canvas-dist/assets/cose-bilkent-S5V4N54A-DIjE7V3m.js +1 -0
- package/canvas-dist/assets/cose-bilkent-S5V4N54A-DKL_BGvE.js +1 -0
- package/canvas-dist/assets/cose-bilkent-S5V4N54A-LZ4OsCLU.js +1 -0
- package/canvas-dist/assets/cose-bilkent-S5V4N54A-XWeJtgga.js +1 -0
- package/canvas-dist/assets/{dagre-6UL2VRFP-gRmGLrEW.js → dagre-6UL2VRFP-BJ2vcFwR.js} +1 -1
- package/canvas-dist/assets/dagre-6UL2VRFP-C1FlE5s8.js +4 -0
- package/canvas-dist/assets/dagre-6UL2VRFP-C3BWFgl6.js +4 -0
- package/canvas-dist/assets/dagre-6UL2VRFP-CUnx73Rf.js +4 -0
- package/canvas-dist/assets/dagre-6UL2VRFP-Do10BY1y.js +4 -0
- package/canvas-dist/assets/dagre-6UL2VRFP-rOZEkrsg.js +4 -0
- package/canvas-dist/assets/{diagram-PSM6KHXK-B7Li-xxw.js → diagram-PSM6KHXK-BGi_qzbq.js} +1 -1
- package/canvas-dist/assets/diagram-PSM6KHXK-C3Nv7h_j.js +24 -0
- package/canvas-dist/assets/diagram-PSM6KHXK-CsMy-r0n.js +24 -0
- package/canvas-dist/assets/diagram-PSM6KHXK-Dj8g7kGt.js +24 -0
- package/canvas-dist/assets/diagram-PSM6KHXK-Dxb1w_7r.js +24 -0
- package/canvas-dist/assets/diagram-PSM6KHXK-kVMBkEyV.js +24 -0
- package/canvas-dist/assets/{diagram-QEK2KX5R-B_NNUAm3.js → diagram-QEK2KX5R-4bsrr1WZ.js} +1 -1
- package/canvas-dist/assets/diagram-QEK2KX5R-Bv7BmKfI.js +43 -0
- package/canvas-dist/assets/diagram-QEK2KX5R-C_FLN6hv.js +43 -0
- package/canvas-dist/assets/diagram-QEK2KX5R-Csuk5L3z.js +43 -0
- package/canvas-dist/assets/diagram-QEK2KX5R-D5Aszgz4.js +43 -0
- package/canvas-dist/assets/diagram-QEK2KX5R-DX58f87l.js +43 -0
- package/canvas-dist/assets/{diagram-S2PKOQOG-NcK-KHaA.js → diagram-S2PKOQOG-1Q7hwiSd.js} +1 -1
- package/canvas-dist/assets/diagram-S2PKOQOG-Bz9Vxi5V.js +24 -0
- package/canvas-dist/assets/diagram-S2PKOQOG-CdWgZIIc.js +24 -0
- package/canvas-dist/assets/diagram-S2PKOQOG-DBicbKFU.js +24 -0
- package/canvas-dist/assets/diagram-S2PKOQOG-DsXKwPtU.js +24 -0
- package/canvas-dist/assets/diagram-S2PKOQOG-L_SMHLXs.js +24 -0
- package/canvas-dist/assets/{erDiagram-Q2GNP2WA-CG7dqzk3.js → erDiagram-Q2GNP2WA-BYu7fh6H.js} +1 -1
- package/canvas-dist/assets/erDiagram-Q2GNP2WA-CvnQ69BF.js +60 -0
- package/canvas-dist/assets/erDiagram-Q2GNP2WA-D3xm-Tdm.js +60 -0
- package/canvas-dist/assets/erDiagram-Q2GNP2WA-DIPpD8sj.js +60 -0
- package/canvas-dist/assets/erDiagram-Q2GNP2WA-DNgu6dMd.js +60 -0
- package/canvas-dist/assets/erDiagram-Q2GNP2WA-Decm8aB4.js +60 -0
- package/canvas-dist/assets/{flowDiagram-NV44I4VS-CBzCj5D6.js → flowDiagram-NV44I4VS-2ymk2kw2.js} +1 -1
- package/canvas-dist/assets/flowDiagram-NV44I4VS-BEPFOt6U.js +162 -0
- package/canvas-dist/assets/flowDiagram-NV44I4VS-BwqXYGfK.js +162 -0
- package/canvas-dist/assets/flowDiagram-NV44I4VS-CS1jax_z.js +162 -0
- package/canvas-dist/assets/flowDiagram-NV44I4VS-DQz5bf7r.js +162 -0
- package/canvas-dist/assets/flowDiagram-NV44I4VS-KW4T1sqF.js +162 -0
- package/canvas-dist/assets/{ganttDiagram-JELNMOA3-CHw-4qJC.js → ganttDiagram-JELNMOA3-B811prZt.js} +1 -1
- package/canvas-dist/assets/ganttDiagram-JELNMOA3-C75pWm7X.js +267 -0
- package/canvas-dist/assets/ganttDiagram-JELNMOA3-CWsbo0fn.js +267 -0
- package/canvas-dist/assets/ganttDiagram-JELNMOA3-CbJozPBN.js +267 -0
- package/canvas-dist/assets/ganttDiagram-JELNMOA3-Co0cFt4c.js +267 -0
- package/canvas-dist/assets/ganttDiagram-JELNMOA3-I4PDqrRh.js +267 -0
- package/canvas-dist/assets/{gitGraphDiagram-V2S2FVAM-Dqrc4wUs.js → gitGraphDiagram-V2S2FVAM-B-z0cLPt.js} +1 -1
- package/canvas-dist/assets/gitGraphDiagram-V2S2FVAM-Be40z-LF.js +65 -0
- package/canvas-dist/assets/gitGraphDiagram-V2S2FVAM-BejNaAVm.js +65 -0
- package/canvas-dist/assets/gitGraphDiagram-V2S2FVAM-BqWDYr0X.js +65 -0
- package/canvas-dist/assets/gitGraphDiagram-V2S2FVAM-DSvWGY-e.js +65 -0
- package/canvas-dist/assets/gitGraphDiagram-V2S2FVAM-HLYbyNJ5.js +65 -0
- package/canvas-dist/assets/{graph-X9Kzu-pf.js → graph-BE8KKsdf.js} +1 -1
- package/canvas-dist/assets/graph-D6DzzszU.js +1 -0
- package/canvas-dist/assets/graph-DFR8Y_8s.js +1 -0
- package/canvas-dist/assets/graph-Da385cDY.js +1 -0
- package/canvas-dist/assets/graph-MU7gZz2B.js +1 -0
- package/canvas-dist/assets/graph-wjSBJwnf.js +1 -0
- package/canvas-dist/assets/index--ztw-8Rw.js +647 -0
- package/canvas-dist/assets/{index-BQFKo-II.js → index-5TpIM6B1.js} +1 -1
- package/canvas-dist/assets/index-6GBZ9nXN.css +32 -0
- package/canvas-dist/assets/index-BSswTuBk.js +11 -0
- package/canvas-dist/assets/index-BVvhMmjs.js +11 -0
- package/canvas-dist/assets/index-BY92Mj5g.js +572 -0
- package/canvas-dist/assets/index-CV7palC3.js +572 -0
- package/canvas-dist/assets/index-D9bmQGsB.js +11 -0
- package/canvas-dist/assets/index-DDIKkGv8.js +592 -0
- package/canvas-dist/assets/index-Dyo0NkPb.js +574 -0
- package/canvas-dist/assets/index-iQWajCow.js +572 -0
- package/canvas-dist/assets/index-m68YlAMU.js +11 -0
- package/canvas-dist/assets/index-mEoP57az.js +11 -0
- package/canvas-dist/assets/{infoDiagram-HS3SLOUP-CflnZPsm.js → infoDiagram-HS3SLOUP--9BirqgJ.js} +1 -1
- package/canvas-dist/assets/infoDiagram-HS3SLOUP-CSJVED2y.js +2 -0
- package/canvas-dist/assets/infoDiagram-HS3SLOUP-D68HIb2t.js +2 -0
- package/canvas-dist/assets/infoDiagram-HS3SLOUP-DK2VLGGz.js +2 -0
- package/canvas-dist/assets/infoDiagram-HS3SLOUP-PaFhn4yD.js +2 -0
- package/canvas-dist/assets/infoDiagram-HS3SLOUP-zLNG47sU.js +2 -0
- package/canvas-dist/assets/{journeyDiagram-XKPGCS4Q-D2gkCipQ.js → journeyDiagram-XKPGCS4Q-Bue2dR2X.js} +1 -1
- package/canvas-dist/assets/journeyDiagram-XKPGCS4Q-CrgZfpdU.js +139 -0
- package/canvas-dist/assets/journeyDiagram-XKPGCS4Q-DUxWmkkC.js +139 -0
- package/canvas-dist/assets/journeyDiagram-XKPGCS4Q-OTFkv4pd.js +139 -0
- package/canvas-dist/assets/journeyDiagram-XKPGCS4Q-eK2_Zuu3.js +139 -0
- package/canvas-dist/assets/journeyDiagram-XKPGCS4Q-uds5Tz8D.js +139 -0
- package/canvas-dist/assets/{kanban-definition-3W4ZIXB7-CtLLz4o8.js → kanban-definition-3W4ZIXB7-BETdiI7I.js} +1 -1
- package/canvas-dist/assets/kanban-definition-3W4ZIXB7-BdVh7KdN.js +89 -0
- package/canvas-dist/assets/kanban-definition-3W4ZIXB7-Cxl8UM9S.js +89 -0
- package/canvas-dist/assets/kanban-definition-3W4ZIXB7-DVPlx3I2.js +89 -0
- package/canvas-dist/assets/kanban-definition-3W4ZIXB7-LtNWeoYB.js +89 -0
- package/canvas-dist/assets/kanban-definition-3W4ZIXB7-uvhEMvyE.js +89 -0
- package/canvas-dist/assets/{layout-CjvV_Dms.js → layout-1OzszN14.js} +1 -1
- package/canvas-dist/assets/layout-CJSupFcF.js +1 -0
- package/canvas-dist/assets/layout-DFRmxN_c.js +1 -0
- package/canvas-dist/assets/layout-DSu-zk7y.js +1 -0
- package/canvas-dist/assets/layout-TGcrvApd.js +1 -0
- package/canvas-dist/assets/layout-eStc8SYK.js +1 -0
- package/canvas-dist/assets/{linear-D3cIYHoS.js → linear-9qlE6xa7.js} +1 -1
- package/canvas-dist/assets/linear-CBfFWnLD.js +1 -0
- package/canvas-dist/assets/linear-Cv4ai8Hq.js +1 -0
- package/canvas-dist/assets/linear-DDzz65E6.js +1 -0
- package/canvas-dist/assets/linear-wbIqhwDf.js +1 -0
- package/canvas-dist/assets/linear-wyNKl76F.js +1 -0
- package/canvas-dist/assets/{mindmap-definition-VGOIOE7T-DSgjVg-P.js → mindmap-definition-VGOIOE7T-3l4YzhEM.js} +1 -1
- package/canvas-dist/assets/mindmap-definition-VGOIOE7T-B-KkpNlw.js +68 -0
- package/canvas-dist/assets/mindmap-definition-VGOIOE7T-DHMHWgmT.js +68 -0
- package/canvas-dist/assets/mindmap-definition-VGOIOE7T-Dqfyg4Z2.js +68 -0
- package/canvas-dist/assets/mindmap-definition-VGOIOE7T-NeRYOzsq.js +68 -0
- package/canvas-dist/assets/mindmap-definition-VGOIOE7T-xyu628P9.js +68 -0
- package/canvas-dist/assets/{pieDiagram-ADFJNKIX-B_lYaGFj.js → pieDiagram-ADFJNKIX-BWNzVAGj.js} +1 -1
- package/canvas-dist/assets/pieDiagram-ADFJNKIX-Bm3PXYs-.js +30 -0
- package/canvas-dist/assets/pieDiagram-ADFJNKIX-BvvN7VvQ.js +30 -0
- package/canvas-dist/assets/pieDiagram-ADFJNKIX-BwU7AN7W.js +30 -0
- package/canvas-dist/assets/pieDiagram-ADFJNKIX-CHgwWCaM.js +30 -0
- package/canvas-dist/assets/pieDiagram-ADFJNKIX-DlZc8YOh.js +30 -0
- package/canvas-dist/assets/{quadrantDiagram-AYHSOK5B-DLZLTJe3.js → quadrantDiagram-AYHSOK5B-B-Zd8OFp.js} +1 -1
- package/canvas-dist/assets/quadrantDiagram-AYHSOK5B-B1CnJyxI.js +7 -0
- package/canvas-dist/assets/quadrantDiagram-AYHSOK5B-C0Qo00b9.js +7 -0
- package/canvas-dist/assets/quadrantDiagram-AYHSOK5B-C9bx3nEJ.js +7 -0
- package/canvas-dist/assets/quadrantDiagram-AYHSOK5B-UHENkiRO.js +7 -0
- package/canvas-dist/assets/quadrantDiagram-AYHSOK5B-jKfurTPU.js +7 -0
- package/canvas-dist/assets/{requirementDiagram-UZGBJVZJ-CZE26rhL.js → requirementDiagram-UZGBJVZJ-BPpNNusD.js} +1 -1
- package/canvas-dist/assets/requirementDiagram-UZGBJVZJ-BwZF1NIK.js +64 -0
- package/canvas-dist/assets/requirementDiagram-UZGBJVZJ-CaT3Frtk.js +64 -0
- package/canvas-dist/assets/requirementDiagram-UZGBJVZJ-Dfoz7R_7.js +64 -0
- package/canvas-dist/assets/requirementDiagram-UZGBJVZJ-DsrX4TT-.js +64 -0
- package/canvas-dist/assets/requirementDiagram-UZGBJVZJ-dmouSXOl.js +64 -0
- package/canvas-dist/assets/{sankeyDiagram-TZEHDZUN-DQMRJAPV.js → sankeyDiagram-TZEHDZUN-BEy-A1Fu.js} +1 -1
- package/canvas-dist/assets/sankeyDiagram-TZEHDZUN-BViMBiAQ.js +10 -0
- package/canvas-dist/assets/sankeyDiagram-TZEHDZUN-BqrM-qWN.js +10 -0
- package/canvas-dist/assets/sankeyDiagram-TZEHDZUN-DRkRC9qB.js +10 -0
- package/canvas-dist/assets/sankeyDiagram-TZEHDZUN-DbuzKCtn.js +10 -0
- package/canvas-dist/assets/sankeyDiagram-TZEHDZUN-_aHMKbpw.js +10 -0
- package/canvas-dist/assets/{sequenceDiagram-WL72ISMW-BY723FEn.js → sequenceDiagram-WL72ISMW-B8FOaL2Q.js} +1 -1
- package/canvas-dist/assets/sequenceDiagram-WL72ISMW-C02NQwOB.js +145 -0
- package/canvas-dist/assets/sequenceDiagram-WL72ISMW-CgyHivPj.js +145 -0
- package/canvas-dist/assets/sequenceDiagram-WL72ISMW-CzW1WaEm.js +145 -0
- package/canvas-dist/assets/sequenceDiagram-WL72ISMW-DJhHI1pe.js +145 -0
- package/canvas-dist/assets/sequenceDiagram-WL72ISMW-VFkpAeoG.js +145 -0
- package/canvas-dist/assets/{stateDiagram-FKZM4ZOC-C_UdOFhy.js → stateDiagram-FKZM4ZOC-BSqFX4PJ.js} +1 -1
- package/canvas-dist/assets/stateDiagram-FKZM4ZOC-BnXhhxkN.js +1 -0
- package/canvas-dist/assets/stateDiagram-FKZM4ZOC-ClARVrvt.js +1 -0
- package/canvas-dist/assets/stateDiagram-FKZM4ZOC-CuC6xesY.js +1 -0
- package/canvas-dist/assets/stateDiagram-FKZM4ZOC-DcAiGjph.js +1 -0
- package/canvas-dist/assets/stateDiagram-FKZM4ZOC-aBg0hjTp.js +1 -0
- package/canvas-dist/assets/stateDiagram-v2-4FDKWEC3-8fib9ftc.js +1 -0
- package/canvas-dist/assets/stateDiagram-v2-4FDKWEC3-B-DO0ZqO.js +1 -0
- package/canvas-dist/assets/stateDiagram-v2-4FDKWEC3-BksbsE4k.js +1 -0
- package/canvas-dist/assets/stateDiagram-v2-4FDKWEC3-C2DJCNPK.js +1 -0
- package/canvas-dist/assets/stateDiagram-v2-4FDKWEC3-CeA5jba6.js +1 -0
- package/canvas-dist/assets/stateDiagram-v2-4FDKWEC3-zsAyq0tK.js +1 -0
- package/canvas-dist/assets/{timeline-definition-IT6M3QCI-DkrJqww0.js → timeline-definition-IT6M3QCI-BaHdYD2h.js} +1 -1
- package/canvas-dist/assets/timeline-definition-IT6M3QCI-Bl2hg8IM.js +61 -0
- package/canvas-dist/assets/timeline-definition-IT6M3QCI-CrVwLiGm.js +61 -0
- package/canvas-dist/assets/timeline-definition-IT6M3QCI-DrXGRjnB.js +61 -0
- package/canvas-dist/assets/timeline-definition-IT6M3QCI-cYAwshf6.js +61 -0
- package/canvas-dist/assets/timeline-definition-IT6M3QCI-flyL0y-3.js +61 -0
- package/canvas-dist/assets/{treemap-GDKQZRPO-B-6bMZqD.js → treemap-GDKQZRPO-C4Hg8kJ_.js} +1 -1
- package/canvas-dist/assets/treemap-GDKQZRPO-DVY2G9qY.js +162 -0
- package/canvas-dist/assets/treemap-GDKQZRPO-DpLWPA1z.js +162 -0
- package/canvas-dist/assets/treemap-GDKQZRPO-Ds86cUVw.js +162 -0
- package/canvas-dist/assets/treemap-GDKQZRPO-DwmoI6tH.js +162 -0
- package/canvas-dist/assets/treemap-GDKQZRPO-SsGFkgVd.js +162 -0
- package/canvas-dist/assets/{xychartDiagram-PRI3JC2R-DkBhUy_D.js → xychartDiagram-PRI3JC2R-B9c1iLBf.js} +1 -1
- package/canvas-dist/assets/xychartDiagram-PRI3JC2R-BpX6MPWa.js +7 -0
- package/canvas-dist/assets/xychartDiagram-PRI3JC2R-CEgW_j0p.js +7 -0
- package/canvas-dist/assets/xychartDiagram-PRI3JC2R-CSEFGEQX.js +7 -0
- package/canvas-dist/assets/xychartDiagram-PRI3JC2R-CnG4XoMc.js +7 -0
- package/canvas-dist/assets/xychartDiagram-PRI3JC2R-Dftj3Bt3.js +7 -0
- package/canvas-dist/index.html +3 -2
- package/package.json +2 -1
- package/src/protocol.js +1 -1
- package/src/protocol.test.js +1 -1
- package/src/pty-manager.js +281 -0
- package/src/pty-manager.test.js +212 -0
- package/src/router.js +31 -1
- package/src/router.test.js +1 -1
- package/src/sdk-e2e.test.js +101 -0
- package/src/server.e2e.test.js +804 -138
- package/src/server.js +1273 -137
- package/src/session-store.js +260 -0
- package/src/session-store.test.js +235 -0
- package/src/templates.js +1 -1
- package/src/templates.test.js +1 -1
- package/src/terminal.js +3 -3
- package/src/terminal.test.js +12 -12
- package/src/visual-interceptor.js +450 -0
- package/src/visual-interceptor.test.js +943 -0
- package/src/workshop-parser.js +251 -0
- package/src/workshop-parser.test.js +179 -0
- package/templates/celebrate.html +1 -1
- package/templates/code-playground.html +1 -1
- package/templates/dashboard.html +7 -8
- package/templates/diagram-architecture.html +1 -1
- package/templates/diagram-flow.html +1 -1
- package/templates/diagram-mermaid.html +1 -1
- package/templates/game-speed-round.html +1 -1
- package/templates/quiz-drag-order.html +1 -1
- package/templates/quiz-fill-blank.html +1 -1
- package/templates/quiz-matching.html +1 -1
- package/templates/quiz-timed-choice.html +1 -1
- package/templates/welcome.html +7 -7
- package/canvas-dist/assets/channel-BzJVlie3.js +0 -1
- package/canvas-dist/assets/classDiagram-2ON5EDUG-BTs-zEmB.js +0 -1
- package/canvas-dist/assets/classDiagram-v2-WZHVMYZB-BTs-zEmB.js +0 -1
- package/canvas-dist/assets/clone-CXEfuXmc.js +0 -1
- package/canvas-dist/assets/index-DJ49c6u-.js +0 -426
- package/canvas-dist/assets/stateDiagram-v2-4FDKWEC3-DXIiFh0L.js +0 -1
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-6UL2VRFP-Do10BY1y.js","assets/graph-Da385cDY.js","assets/_baseUniq-KG7SRw9H.js","assets/layout-eStc8SYK.js","assets/_basePickBy-C0936578.js","assets/clone-UNKf_nED.js","assets/cose-bilkent-S5V4N54A-BTyQiCkr.js","assets/cytoscape.esm-BQaXIfA_.js","assets/c4Diagram-YG6GDRKO-BWKCTyQi.js","assets/chunk-TZMSLE5B-jJKG-WvJ.js","assets/flowDiagram-NV44I4VS-KW4T1sqF.js","assets/chunk-FMBD7UC4-DPpfskdX.js","assets/chunk-55IACEB6-p2qMY-fm.js","assets/chunk-QN33PNHL-DjV4jUn9.js","assets/channel-D959Iony.js","assets/erDiagram-Q2GNP2WA-DNgu6dMd.js","assets/gitGraphDiagram-V2S2FVAM-BejNaAVm.js","assets/chunk-4BX2VUAB-K8DepKJO.js","assets/chunk-QZHKN3VN-D9FF492U.js","assets/treemap-GDKQZRPO-DVY2G9qY.js","assets/ganttDiagram-JELNMOA3-CbJozPBN.js","assets/linear-wbIqhwDf.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-HS3SLOUP-CSJVED2y.js","assets/pieDiagram-ADFJNKIX-BvvN7VvQ.js","assets/arc-BSMfRZtt.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AYHSOK5B-C9bx3nEJ.js","assets/xychartDiagram-PRI3JC2R-BpX6MPWa.js","assets/requirementDiagram-UZGBJVZJ-dmouSXOl.js","assets/sequenceDiagram-WL72ISMW-B8FOaL2Q.js","assets/classDiagram-2ON5EDUG-DorPdibv.js","assets/chunk-B4BG7PRW-CEeDPAki.js","assets/classDiagram-v2-WZHVMYZB-DorPdibv.js","assets/stateDiagram-FKZM4ZOC-aBg0hjTp.js","assets/chunk-DI55MBZ5-fVTGx0zh.js","assets/stateDiagram-v2-4FDKWEC3-CeA5jba6.js","assets/journeyDiagram-XKPGCS4Q-DUxWmkkC.js","assets/timeline-definition-IT6M3QCI-DrXGRjnB.js","assets/mindmap-definition-VGOIOE7T-xyu628P9.js","assets/kanban-definition-3W4ZIXB7-LtNWeoYB.js","assets/sankeyDiagram-TZEHDZUN-DRkRC9qB.js","assets/diagram-S2PKOQOG-CdWgZIIc.js","assets/diagram-QEK2KX5R-D5Aszgz4.js","assets/blockDiagram-VD42YOAC-CUNKQd-b.js","assets/architectureDiagram-VXUJARFQ-egbtMwua.js","assets/diagram-PSM6KHXK-CsMy-r0n.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var iL=Object.defineProperty;var nL=(e,t,r)=>t in e?iL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _t=(e,t,r)=>nL(e,typeof t!="symbol"?t+"":t,r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function r(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=r(n);fetch(n.href,s)}})();function yy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mU(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}),r}var qp={exports:{}},Al={},Up={exports:{}},Je={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var tv;function sL(){if(tv)return Je;tv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;function m(I){return I===null||typeof I!="object"?null:(I=p&&I[p]||I["@@iterator"],typeof I=="function"?I:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,v={};function S(I,Q,te){this.props=I,this.context=Q,this.refs=v,this.updater=te||y}S.prototype.isReactComponent={},S.prototype.setState=function(I,Q){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,Q,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function C(){}C.prototype=S.prototype;function B(I,Q,te){this.props=I,this.context=Q,this.refs=v,this.updater=te||y}var R=B.prototype=new C;R.constructor=B,x(R,S.prototype),R.isPureReactComponent=!0;var E=Array.isArray,L=Object.prototype.hasOwnProperty,k={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function z(I,Q,te){var X,ce={},oe=null,ye=null;if(Q!=null)for(X in Q.ref!==void 0&&(ye=Q.ref),Q.key!==void 0&&(oe=""+Q.key),Q)L.call(Q,X)&&!A.hasOwnProperty(X)&&(ce[X]=Q[X]);var ve=arguments.length-2;if(ve===1)ce.children=te;else if(1<ve){for(var Ce=Array(ve),Ee=0;Ee<ve;Ee++)Ce[Ee]=arguments[Ee+2];ce.children=Ce}if(I&&I.defaultProps)for(X in ve=I.defaultProps,ve)ce[X]===void 0&&(ce[X]=ve[X]);return{$$typeof:e,type:I,key:oe,ref:ye,props:ce,_owner:k.current}}function U(I,Q){return{$$typeof:e,type:I.type,key:Q,ref:I.ref,props:I.props,_owner:I._owner}}function q(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function H(I){var Q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(te){return Q[te]})}var Y=/\/+/g;function F(I,Q){return typeof I=="object"&&I!==null&&I.key!=null?H(""+I.key):Q.toString(36)}function O(I,Q,te,X,ce){var oe=typeof I;(oe==="undefined"||oe==="boolean")&&(I=null);var ye=!1;if(I===null)ye=!0;else switch(oe){case"string":case"number":ye=!0;break;case"object":switch(I.$$typeof){case e:case t:ye=!0}}if(ye)return ye=I,ce=ce(ye),I=X===""?"."+F(ye,0):X,E(ce)?(te="",I!=null&&(te=I.replace(Y,"$&/")+"/"),O(ce,Q,te,"",function(Ee){return Ee})):ce!=null&&(q(ce)&&(ce=U(ce,te+(!ce.key||ye&&ye.key===ce.key?"":(""+ce.key).replace(Y,"$&/")+"/")+I)),Q.push(ce)),1;if(ye=0,X=X===""?".":X+":",E(I))for(var ve=0;ve<I.length;ve++){oe=I[ve];var Ce=X+F(oe,ve);ye+=O(oe,Q,te,Ce,ce)}else if(Ce=m(I),typeof Ce=="function")for(I=Ce.call(I),ve=0;!(oe=I.next()).done;)oe=oe.value,Ce=X+F(oe,ve++),ye+=O(oe,Q,te,Ce,ce);else if(oe==="object")throw Q=String(I),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return ye}function $(I,Q,te){if(I==null)return I;var X=[],ce=0;return O(I,X,"","",function(oe){return Q.call(te,oe,ce++)}),X}function j(I){if(I._status===-1){var Q=I._result;Q=Q(),Q.then(function(te){(I._status===0||I._status===-1)&&(I._status=1,I._result=te)},function(te){(I._status===0||I._status===-1)&&(I._status=2,I._result=te)}),I._status===-1&&(I._status=0,I._result=Q)}if(I._status===1)return I._result.default;throw I._result}var W={current:null},P={transition:null},Z={ReactCurrentDispatcher:W,ReactCurrentBatchConfig:P,ReactCurrentOwner:k};function ee(){throw Error("act(...) is not supported in production builds of React.")}return Je.Children={map:$,forEach:function(I,Q,te){$(I,function(){Q.apply(this,arguments)},te)},count:function(I){var Q=0;return $(I,function(){Q++}),Q},toArray:function(I){return $(I,function(Q){return Q})||[]},only:function(I){if(!q(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Je.Component=S,Je.Fragment=r,Je.Profiler=n,Je.PureComponent=B,Je.StrictMode=i,Je.Suspense=u,Je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,Je.act=ee,Je.cloneElement=function(I,Q,te){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var X=x({},I.props),ce=I.key,oe=I.ref,ye=I._owner;if(Q!=null){if(Q.ref!==void 0&&(oe=Q.ref,ye=k.current),Q.key!==void 0&&(ce=""+Q.key),I.type&&I.type.defaultProps)var ve=I.type.defaultProps;for(Ce in Q)L.call(Q,Ce)&&!A.hasOwnProperty(Ce)&&(X[Ce]=Q[Ce]===void 0&&ve!==void 0?ve[Ce]:Q[Ce])}var Ce=arguments.length-2;if(Ce===1)X.children=te;else if(1<Ce){ve=Array(Ce);for(var Ee=0;Ee<Ce;Ee++)ve[Ee]=arguments[Ee+2];X.children=ve}return{$$typeof:e,type:I.type,key:ce,ref:oe,props:X,_owner:ye}},Je.createContext=function(I){return I={$$typeof:a,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:s,_context:I},I.Consumer=I},Je.createElement=z,Je.createFactory=function(I){var Q=z.bind(null,I);return Q.type=I,Q},Je.createRef=function(){return{current:null}},Je.forwardRef=function(I){return{$$typeof:l,render:I}},Je.isValidElement=q,Je.lazy=function(I){return{$$typeof:d,_payload:{_status:-1,_result:I},_init:j}},Je.memo=function(I,Q){return{$$typeof:h,type:I,compare:Q===void 0?null:Q}},Je.startTransition=function(I){var Q=P.transition;P.transition={};try{I()}finally{P.transition=Q}},Je.unstable_act=ee,Je.useCallback=function(I,Q){return W.current.useCallback(I,Q)},Je.useContext=function(I){return W.current.useContext(I)},Je.useDebugValue=function(){},Je.useDeferredValue=function(I){return W.current.useDeferredValue(I)},Je.useEffect=function(I,Q){return W.current.useEffect(I,Q)},Je.useId=function(){return W.current.useId()},Je.useImperativeHandle=function(I,Q,te){return W.current.useImperativeHandle(I,Q,te)},Je.useInsertionEffect=function(I,Q){return W.current.useInsertionEffect(I,Q)},Je.useLayoutEffect=function(I,Q){return W.current.useLayoutEffect(I,Q)},Je.useMemo=function(I,Q){return W.current.useMemo(I,Q)},Je.useReducer=function(I,Q,te){return W.current.useReducer(I,Q,te)},Je.useRef=function(I){return W.current.useRef(I)},Je.useState=function(I){return W.current.useState(I)},Je.useSyncExternalStore=function(I,Q,te){return W.current.useSyncExternalStore(I,Q,te)},Je.useTransition=function(){return W.current.useTransition()},Je.version="18.3.1",Je}var rv;function _y(){return rv||(rv=1,Up.exports=sL()),Up.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var iv;function oL(){if(iv)return Al;iv=1;var e=_y(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(l,u,h){var d,p={},m=null,y=null;h!==void 0&&(m=""+h),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(y=u.ref);for(d in u)i.call(u,d)&&!s.hasOwnProperty(d)&&(p[d]=u[d]);if(l&&l.defaultProps)for(d in u=l.defaultProps,u)p[d]===void 0&&(p[d]=u[d]);return{$$typeof:t,type:l,key:m,ref:y,props:p,_owner:n.current}}return Al.Fragment=r,Al.jsx=a,Al.jsxs=a,Al}var nv;function aL(){return nv||(nv=1,qp.exports=oL()),qp.exports}var g=aL(),M=_y();const nS=yy(M);var Zh={},Vp={exports:{}},oi={},Gp={exports:{}},Yp={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var sv;function lL(){return sv||(sv=1,(function(e){function t(P,Z){var ee=P.length;P.push(Z);e:for(;0<ee;){var I=ee-1>>>1,Q=P[I];if(0<n(Q,Z))P[I]=Z,P[ee]=Q,ee=I;else break e}}function r(P){return P.length===0?null:P[0]}function i(P){if(P.length===0)return null;var Z=P[0],ee=P.pop();if(ee!==Z){P[0]=ee;e:for(var I=0,Q=P.length,te=Q>>>1;I<te;){var X=2*(I+1)-1,ce=P[X],oe=X+1,ye=P[oe];if(0>n(ce,ee))oe<Q&&0>n(ye,ce)?(P[I]=ye,P[oe]=ee,I=oe):(P[I]=ce,P[X]=ee,I=X);else if(oe<Q&&0>n(ye,ee))P[I]=ye,P[oe]=ee,I=oe;else break e}}return Z}function n(P,Z){var ee=P.sortIndex-Z.sortIndex;return ee!==0?ee:P.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var u=[],h=[],d=1,p=null,m=3,y=!1,x=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(P){for(var Z=r(h);Z!==null;){if(Z.callback===null)i(h);else if(Z.startTime<=P)i(h),Z.sortIndex=Z.expirationTime,t(u,Z);else break;Z=r(h)}}function E(P){if(v=!1,R(P),!x)if(r(u)!==null)x=!0,j(L);else{var Z=r(h);Z!==null&&W(E,Z.startTime-P)}}function L(P,Z){x=!1,v&&(v=!1,C(z),z=-1),y=!0;var ee=m;try{for(R(Z),p=r(u);p!==null&&(!(p.expirationTime>Z)||P&&!H());){var I=p.callback;if(typeof I=="function"){p.callback=null,m=p.priorityLevel;var Q=I(p.expirationTime<=Z);Z=e.unstable_now(),typeof Q=="function"?p.callback=Q:p===r(u)&&i(u),R(Z)}else i(u);p=r(u)}if(p!==null)var te=!0;else{var X=r(h);X!==null&&W(E,X.startTime-Z),te=!1}return te}finally{p=null,m=ee,y=!1}}var k=!1,A=null,z=-1,U=5,q=-1;function H(){return!(e.unstable_now()-q<U)}function Y(){if(A!==null){var P=e.unstable_now();q=P;var Z=!0;try{Z=A(!0,P)}finally{Z?F():(k=!1,A=null)}}else k=!1}var F;if(typeof B=="function")F=function(){B(Y)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,$=O.port2;O.port1.onmessage=Y,F=function(){$.postMessage(null)}}else F=function(){S(Y,0)};function j(P){A=P,k||(k=!0,F())}function W(P,Z){z=S(function(){P(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){x||y||(x=!0,j(L))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(P){switch(m){case 1:case 2:case 3:var Z=3;break;default:Z=m}var ee=m;m=Z;try{return P()}finally{m=ee}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,Z){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var ee=m;m=P;try{return Z()}finally{m=ee}},e.unstable_scheduleCallback=function(P,Z,ee){var I=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?I+ee:I):ee=I,P){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=ee+Q,P={id:d++,callback:Z,priorityLevel:P,startTime:ee,expirationTime:Q,sortIndex:-1},ee>I?(P.sortIndex=ee,t(h,P),r(u)===null&&P===r(h)&&(v?(C(z),z=-1):v=!0,W(E,ee-I))):(P.sortIndex=Q,t(u,P),x||y||(x=!0,j(L))),P},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(P){var Z=m;return function(){var ee=m;m=Z;try{return P.apply(this,arguments)}finally{m=ee}}}})(Yp)),Yp}var ov;function cL(){return ov||(ov=1,Gp.exports=lL()),Gp.exports}/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var av;function hL(){if(av)return oi;av=1;var e=_y(),t=cL();function r(o){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+o,f=1;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,n={};function s(o,c){a(o,c),a(o+"Capture",c)}function a(o,c){for(n[o]=c,o=0;o<c.length;o++)i.add(c[o])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},p={};function m(o){return u.call(p,o)?!0:u.call(d,o)?!1:h.test(o)?p[o]=!0:(d[o]=!0,!1)}function y(o,c,f,_){if(f!==null&&f.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return _?!1:f!==null?!f.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function x(o,c,f,_){if(c===null||typeof c>"u"||y(o,c,f,_))return!0;if(_)return!1;if(f!==null)switch(f.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function v(o,c,f,_,b,w,D){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=_,this.attributeNamespace=b,this.mustUseProperty=f,this.propertyName=o,this.type=c,this.sanitizeURL=w,this.removeEmptyString=D}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){S[o]=new v(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var c=o[0];S[c]=new v(c,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){S[o]=new v(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){S[o]=new v(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){S[o]=new v(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){S[o]=new v(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){S[o]=new v(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){S[o]=new v(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){S[o]=new v(o,5,!1,o.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function B(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var c=o.replace(C,B);S[c]=new v(c,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var c=o.replace(C,B);S[c]=new v(c,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var c=o.replace(C,B);S[c]=new v(c,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){S[o]=new v(o,1,!1,o.toLowerCase(),null,!1,!1)}),S.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){S[o]=new v(o,1,!1,o.toLowerCase(),null,!0,!0)});function R(o,c,f,_){var b=S.hasOwnProperty(c)?S[c]:null;(b!==null?b.type!==0:_||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(x(c,f,b,_)&&(f=null),_||b===null?m(c)&&(f===null?o.removeAttribute(c):o.setAttribute(c,""+f)):b.mustUseProperty?o[b.propertyName]=f===null?b.type===3?!1:"":f:(c=b.attributeName,_=b.attributeNamespace,f===null?o.removeAttribute(c):(b=b.type,f=b===3||b===4&&f===!0?"":""+f,_?o.setAttributeNS(_,c,f):o.setAttribute(c,f))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),k=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),q=Symbol.for("react.provider"),H=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),P=Symbol.iterator;function Z(o){return o===null||typeof o!="object"?null:(o=P&&o[P]||o["@@iterator"],typeof o=="function"?o:null)}var ee=Object.assign,I;function Q(o){if(I===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);I=c&&c[1]||""}return`
|
|
35
|
+
`+I+o}var te=!1;function X(o,c){if(!o||te)return"";te=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ne){var _=ne}Reflect.construct(o,[],c)}else{try{c.call()}catch(ne){_=ne}o.call(c.prototype)}else{try{throw Error()}catch(ne){_=ne}o()}}catch(ne){if(ne&&_&&typeof ne.stack=="string"){for(var b=ne.stack.split(`
|
|
36
|
+
`),w=_.stack.split(`
|
|
37
|
+
`),D=b.length-1,N=w.length-1;1<=D&&0<=N&&b[D]!==w[N];)N--;for(;1<=D&&0<=N;D--,N--)if(b[D]!==w[N]){if(D!==1||N!==1)do if(D--,N--,0>N||b[D]!==w[N]){var V=`
|
|
38
|
+
`+b[D].replace(" at new "," at ");return o.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",o.displayName)),V}while(1<=D&&0<=N);break}}}finally{te=!1,Error.prepareStackTrace=f}return(o=o?o.displayName||o.name:"")?Q(o):""}function ce(o){switch(o.tag){case 5:return Q(o.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return o=X(o.type,!1),o;case 11:return o=X(o.type.render,!1),o;case 1:return o=X(o.type,!0),o;default:return""}}function oe(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case A:return"Fragment";case k:return"Portal";case U:return"Profiler";case z:return"StrictMode";case F:return"Suspense";case O:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case H:return(o.displayName||"Context")+".Consumer";case q:return(o._context.displayName||"Context")+".Provider";case Y:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case $:return c=o.displayName||null,c!==null?c:oe(o.type)||"Memo";case j:c=o._payload,o=o._init;try{return oe(o(c))}catch{}}return null}function ye(o){var c=o.type;switch(o.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=c.render,o=o.displayName||o.name||"",c.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oe(c);case 8:return c===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ve(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ce(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Ee(o){var c=Ce(o)?"checked":"value",f=Object.getOwnPropertyDescriptor(o.constructor.prototype,c),_=""+o[c];if(!o.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,w=f.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return b.call(this)},set:function(D){_=""+D,w.call(this,D)}}),Object.defineProperty(o,c,{enumerable:f.enumerable}),{getValue:function(){return _},setValue:function(D){_=""+D},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function Ke(o){o._valueTracker||(o._valueTracker=Ee(o))}function ct(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var f=c.getValue(),_="";return o&&(_=Ce(o)?o.checked?"true":"false":o.value),o=_,o!==f?(c.setValue(o),!0):!1}function ze(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function pt(o,c){var f=c.checked;return ee({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??o._wrapperState.initialChecked})}function dt(o,c){var f=c.defaultValue==null?"":c.defaultValue,_=c.checked!=null?c.checked:c.defaultChecked;f=ve(c.value!=null?c.value:f),o._wrapperState={initialChecked:_,initialValue:f,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function ae(o,c){c=c.checked,c!=null&&R(o,"checked",c,!1)}function ht(o,c){ae(o,c);var f=ve(c.value),_=c.type;if(f!=null)_==="number"?(f===0&&o.value===""||o.value!=f)&&(o.value=""+f):o.value!==""+f&&(o.value=""+f);else if(_==="submit"||_==="reset"){o.removeAttribute("value");return}c.hasOwnProperty("value")?Vt(o,c.type,f):c.hasOwnProperty("defaultValue")&&Vt(o,c.type,ve(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(o.defaultChecked=!!c.defaultChecked)}function ut(o,c,f){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var _=c.type;if(!(_!=="submit"&&_!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+o._wrapperState.initialValue,f||c===o.value||(o.value=c),o.defaultValue=c}f=o.name,f!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,f!==""&&(o.name=f)}function Vt(o,c,f){(c!=="number"||ze(o.ownerDocument)!==o)&&(f==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+f&&(o.defaultValue=""+f))}var zr=Array.isArray;function kr(o,c,f,_){if(o=o.options,c){c={};for(var b=0;b<f.length;b++)c["$"+f[b]]=!0;for(f=0;f<o.length;f++)b=c.hasOwnProperty("$"+o[f].value),o[f].selected!==b&&(o[f].selected=b),b&&_&&(o[f].defaultSelected=!0)}else{for(f=""+ve(f),c=null,b=0;b<o.length;b++){if(o[b].value===f){o[b].selected=!0,_&&(o[b].defaultSelected=!0);return}c!==null||o[b].disabled||(c=o[b])}c!==null&&(c.selected=!0)}}function ki(o,c){if(c.dangerouslySetInnerHTML!=null)throw Error(r(91));return ee({},c,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function Xs(o,c){var f=c.value;if(f==null){if(f=c.children,c=c.defaultValue,f!=null){if(c!=null)throw Error(r(92));if(zr(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),f=c}o._wrapperState={initialValue:ve(f)}}function Mt(o,c){var f=ve(c.value),_=ve(c.defaultValue);f!=null&&(f=""+f,f!==o.value&&(o.value=f),c.defaultValue==null&&o.defaultValue!==f&&(o.defaultValue=f)),_!=null&&(o.defaultValue=""+_)}function hn(o){var c=o.textContent;c===o._wrapperState.initialValue&&c!==""&&c!==null&&(o.value=c)}function Ui(o){switch(o){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Tr(o,c){return o==null||o==="http://www.w3.org/1999/xhtml"?Ui(c):o==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var bt,Qs=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,f,_,b){MSApp.execUnsafeLocalFunction(function(){return o(c,f,_,b)})}:o})(function(o,c){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=c;else{for(bt=bt||document.createElement("div"),bt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=bt.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;c.firstChild;)o.appendChild(c.firstChild)}});function un(o,c){if(c){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=c;return}}o.textContent=c}var Ti={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Jr=["Webkit","ms","Moz","O"];Object.keys(Ti).forEach(function(o){Jr.forEach(function(c){c=c+o.charAt(0).toUpperCase()+o.substring(1),Ti[c]=Ti[o]})});function In(o,c,f){return c==null||typeof c=="boolean"||c===""?"":f||typeof c!="number"||c===0||Ti.hasOwnProperty(o)&&Ti[o]?(""+c).trim():c+"px"}function $n(o,c){o=o.style;for(var f in c)if(c.hasOwnProperty(f)){var _=f.indexOf("--")===0,b=In(f,c[f],_);f==="float"&&(f="cssFloat"),_?o.setProperty(f,b):o[f]=b}}var _r=ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ei(o,c){if(c){if(_r[o]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,o));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(r(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(r(61))}if(c.style!=null&&typeof c.style!="object")throw Error(r(62))}}function Ei(o,c){if(o.indexOf("-")===-1)return typeof c.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var jn=null;function Zs(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var dn=null,di=null,fn=null;function Vi(o){if(o=yl(o)){if(typeof dn!="function")throw Error(r(280));var c=o.stateNode;c&&(c=fh(c),dn(o.stateNode,o.type,c))}}function Js(o){di?fn?fn.push(o):fn=[o]:di=o}function Vo(){if(di){var o=di,c=fn;if(fn=di=null,Vi(o),c)for(o=0;o<c.length;o++)Vi(c[o])}}function wt(o,c){return o(c)}function fi(){}var os=!1;function as(o,c,f){if(os)return o(c,f);os=!0;try{return wt(o,c,f)}finally{os=!1,(di!==null||fn!==null)&&(fi(),Vo())}}function Bi(o,c){var f=o.stateNode;if(f===null)return null;var _=fh(f);if(_===null)return null;f=_[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(_=!_.disabled)||(o=o.type,_=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!_;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(r(231,c,typeof f));return f}var ls=!1;if(l)try{var pn={};Object.defineProperty(pn,"passive",{get:function(){ls=!0}}),window.addEventListener("test",pn,pn),window.removeEventListener("test",pn,pn)}catch{ls=!1}function Qa(o,c,f,_,b,w,D,N,V){var ne=Array.prototype.slice.call(arguments,3);try{c.apply(f,ne)}catch(fe){this.onError(fe)}}var Jt=!1,Fr=null,Nt=!1,On=null,se={onError:function(o){Jt=!0,Fr=o}};function Me(o,c,f,_,b,w,D,N,V){Jt=!1,Fr=null,Qa.apply(se,arguments)}function rt(o,c,f,_,b,w,D,N,V){if(Me.apply(this,arguments),Jt){if(Jt){var ne=Fr;Jt=!1,Fr=null}else throw Error(r(198));Nt||(Nt=!0,On=ne)}}function mt(o){var c=o,f=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(f=c.return),o=c.return;while(o)}return c.tag===3?f:null}function Gt(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function Er(o){if(mt(o)!==o)throw Error(r(188))}function Mi(o){var c=o.alternate;if(!c){if(c=mt(o),c===null)throw Error(r(188));return c!==o?null:o}for(var f=o,_=c;;){var b=f.return;if(b===null)break;var w=b.alternate;if(w===null){if(_=b.return,_!==null){f=_;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===f)return Er(b),o;if(w===_)return Er(b),c;w=w.sibling}throw Error(r(188))}if(f.return!==_.return)f=b,_=w;else{for(var D=!1,N=b.child;N;){if(N===f){D=!0,f=b,_=w;break}if(N===_){D=!0,_=b,f=w;break}N=N.sibling}if(!D){for(N=w.child;N;){if(N===f){D=!0,f=w,_=b;break}if(N===_){D=!0,_=w,f=b;break}N=N.sibling}if(!D)throw Error(r(189))}}if(f.alternate!==_)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?o:c}function Wt(o){return o=Mi(o),o!==null?Be(o):null}function Be(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var c=Be(o);if(c!==null)return c;o=o.sibling}return null}var G=t.unstable_scheduleCallback,pe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,yt=t.unstable_requestPaint,Ze=t.unstable_now,jt=t.unstable_getCurrentPriorityLevel,cr=t.unstable_ImmediatePriority,Li=t.unstable_UserBlockingPriority,Gi=t.unstable_NormalPriority,Za=t.unstable_LowPriority,Yt=t.unstable_IdlePriority,eo=null,pi=null;function _B(o){if(pi&&typeof pi.onCommitFiberRoot=="function")try{pi.onCommitFiberRoot(eo,o,void 0,(o.current.flags&128)===128)}catch{}}var Yi=Math.clz32?Math.clz32:bB,xB=Math.log,vB=Math.LN2;function bB(o){return o>>>=0,o===0?32:31-(xB(o)/vB|0)|0}var Kc=64,Xc=4194304;function Ja(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Qc(o,c){var f=o.pendingLanes;if(f===0)return 0;var _=0,b=o.suspendedLanes,w=o.pingedLanes,D=f&268435455;if(D!==0){var N=D&~b;N!==0?_=Ja(N):(w&=D,w!==0&&(_=Ja(w)))}else D=f&~b,D!==0?_=Ja(D):w!==0&&(_=Ja(w));if(_===0)return 0;if(c!==0&&c!==_&&(c&b)===0&&(b=_&-_,w=c&-c,b>=w||b===16&&(w&4194240)!==0))return c;if((_&4)!==0&&(_|=f&16),c=o.entangledLanes,c!==0)for(o=o.entanglements,c&=_;0<c;)f=31-Yi(c),b=1<<f,_|=o[f],c&=~b;return _}function SB(o,c){switch(o){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wB(o,c){for(var f=o.suspendedLanes,_=o.pingedLanes,b=o.expirationTimes,w=o.pendingLanes;0<w;){var D=31-Yi(w),N=1<<D,V=b[D];V===-1?((N&f)===0||(N&_)!==0)&&(b[D]=SB(N,c)):V<=c&&(o.expiredLanes|=N),w&=~N}}function uf(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function A0(){var o=Kc;return Kc<<=1,(Kc&4194240)===0&&(Kc=64),o}function df(o){for(var c=[],f=0;31>f;f++)c.push(o);return c}function el(o,c,f){o.pendingLanes|=c,c!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,c=31-Yi(c),o[c]=f}function CB(o,c){var f=o.pendingLanes&~c;o.pendingLanes=c,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=c,o.mutableReadLanes&=c,o.entangledLanes&=c,c=o.entanglements;var _=o.eventTimes;for(o=o.expirationTimes;0<f;){var b=31-Yi(f),w=1<<b;c[b]=0,_[b]=-1,o[b]=-1,f&=~w}}function ff(o,c){var f=o.entangledLanes|=c;for(o=o.entanglements;f;){var _=31-Yi(f),b=1<<_;b&c|o[_]&c&&(o[_]|=c),f&=~b}}var gt=0;function D0(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var P0,pf,I0,$0,j0,gf=!1,Zc=[],cs=null,hs=null,us=null,tl=new Map,rl=new Map,ds=[],kB="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function O0(o,c){switch(o){case"focusin":case"focusout":cs=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":us=null;break;case"pointerover":case"pointerout":tl.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(c.pointerId)}}function il(o,c,f,_,b,w){return o===null||o.nativeEvent!==w?(o={blockedOn:c,domEventName:f,eventSystemFlags:_,nativeEvent:w,targetContainers:[b]},c!==null&&(c=yl(c),c!==null&&pf(c)),o):(o.eventSystemFlags|=_,c=o.targetContainers,b!==null&&c.indexOf(b)===-1&&c.push(b),o)}function TB(o,c,f,_,b){switch(c){case"focusin":return cs=il(cs,o,c,f,_,b),!0;case"dragenter":return hs=il(hs,o,c,f,_,b),!0;case"mouseover":return us=il(us,o,c,f,_,b),!0;case"pointerover":var w=b.pointerId;return tl.set(w,il(tl.get(w)||null,o,c,f,_,b)),!0;case"gotpointercapture":return w=b.pointerId,rl.set(w,il(rl.get(w)||null,o,c,f,_,b)),!0}return!1}function z0(o){var c=to(o.target);if(c!==null){var f=mt(c);if(f!==null){if(c=f.tag,c===13){if(c=Gt(f),c!==null){o.blockedOn=c,j0(o.priority,function(){I0(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Jc(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var f=yf(o.domEventName,o.eventSystemFlags,c[0],o.nativeEvent);if(f===null){f=o.nativeEvent;var _=new f.constructor(f.type,f);jn=_,f.target.dispatchEvent(_),jn=null}else return c=yl(f),c!==null&&pf(c),o.blockedOn=f,!1;c.shift()}return!0}function F0(o,c,f){Jc(o)&&f.delete(c)}function EB(){gf=!1,cs!==null&&Jc(cs)&&(cs=null),hs!==null&&Jc(hs)&&(hs=null),us!==null&&Jc(us)&&(us=null),tl.forEach(F0),rl.forEach(F0)}function nl(o,c){o.blockedOn===c&&(o.blockedOn=null,gf||(gf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,EB)))}function sl(o){function c(b){return nl(b,o)}if(0<Zc.length){nl(Zc[0],o);for(var f=1;f<Zc.length;f++){var _=Zc[f];_.blockedOn===o&&(_.blockedOn=null)}}for(cs!==null&&nl(cs,o),hs!==null&&nl(hs,o),us!==null&&nl(us,o),tl.forEach(c),rl.forEach(c),f=0;f<ds.length;f++)_=ds[f],_.blockedOn===o&&(_.blockedOn=null);for(;0<ds.length&&(f=ds[0],f.blockedOn===null);)z0(f),f.blockedOn===null&&ds.shift()}var Go=E.ReactCurrentBatchConfig,eh=!0;function BB(o,c,f,_){var b=gt,w=Go.transition;Go.transition=null;try{gt=1,mf(o,c,f,_)}finally{gt=b,Go.transition=w}}function MB(o,c,f,_){var b=gt,w=Go.transition;Go.transition=null;try{gt=4,mf(o,c,f,_)}finally{gt=b,Go.transition=w}}function mf(o,c,f,_){if(eh){var b=yf(o,c,f,_);if(b===null)Pf(o,c,_,th,f),O0(o,_);else if(TB(b,o,c,f,_))_.stopPropagation();else if(O0(o,_),c&4&&-1<kB.indexOf(o)){for(;b!==null;){var w=yl(b);if(w!==null&&P0(w),w=yf(o,c,f,_),w===null&&Pf(o,c,_,th,f),w===b)break;b=w}b!==null&&_.stopPropagation()}else Pf(o,c,_,null,f)}}var th=null;function yf(o,c,f,_){if(th=null,o=Zs(_),o=to(o),o!==null)if(c=mt(o),c===null)o=null;else if(f=c.tag,f===13){if(o=Gt(c),o!==null)return o;o=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null);return th=o,null}function N0(o){switch(o){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(jt()){case cr:return 1;case Li:return 4;case Gi:case Za:return 16;case Yt:return 536870912;default:return 16}default:return 16}}var fs=null,_f=null,rh=null;function W0(){if(rh)return rh;var o,c=_f,f=c.length,_,b="value"in fs?fs.value:fs.textContent,w=b.length;for(o=0;o<f&&c[o]===b[o];o++);var D=f-o;for(_=1;_<=D&&c[f-_]===b[w-_];_++);return rh=b.slice(o,1<_?1-_:void 0)}function ih(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function nh(){return!0}function H0(){return!1}function gi(o){function c(f,_,b,w,D){this._reactName=f,this._targetInst=b,this.type=_,this.nativeEvent=w,this.target=D,this.currentTarget=null;for(var N in o)o.hasOwnProperty(N)&&(f=o[N],this[N]=f?f(w):w[N]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?nh:H0,this.isPropagationStopped=H0,this}return ee(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=nh)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=nh)},persist:function(){},isPersistent:nh}),c}var Yo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xf=gi(Yo),ol=ee({},Yo,{view:0,detail:0}),LB=gi(ol),vf,bf,al,sh=ee({},ol,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wf,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==al&&(al&&o.type==="mousemove"?(vf=o.screenX-al.screenX,bf=o.screenY-al.screenY):bf=vf=0,al=o),vf)},movementY:function(o){return"movementY"in o?o.movementY:bf}}),q0=gi(sh),RB=ee({},sh,{dataTransfer:0}),AB=gi(RB),DB=ee({},ol,{relatedTarget:0}),Sf=gi(DB),PB=ee({},Yo,{animationName:0,elapsedTime:0,pseudoElement:0}),IB=gi(PB),$B=ee({},Yo,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),jB=gi($B),OB=ee({},Yo,{data:0}),U0=gi(OB),zB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FB={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},NB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function WB(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=NB[o])?!!c[o]:!1}function wf(){return WB}var HB=ee({},ol,{key:function(o){if(o.key){var c=zB[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=ih(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?FB[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wf,charCode:function(o){return o.type==="keypress"?ih(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?ih(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),qB=gi(HB),UB=ee({},sh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),V0=gi(UB),VB=ee({},ol,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wf}),GB=gi(VB),YB=ee({},Yo,{propertyName:0,elapsedTime:0,pseudoElement:0}),KB=gi(YB),XB=ee({},sh,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),QB=gi(XB),ZB=[9,13,27,32],Cf=l&&"CompositionEvent"in window,ll=null;l&&"documentMode"in document&&(ll=document.documentMode);var JB=l&&"TextEvent"in window&&!ll,G0=l&&(!Cf||ll&&8<ll&&11>=ll),Y0=" ",K0=!1;function X0(o,c){switch(o){case"keyup":return ZB.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Q0(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ko=!1;function eM(o,c){switch(o){case"compositionend":return Q0(c);case"keypress":return c.which!==32?null:(K0=!0,Y0);case"textInput":return o=c.data,o===Y0&&K0?null:o;default:return null}}function tM(o,c){if(Ko)return o==="compositionend"||!Cf&&X0(o,c)?(o=W0(),rh=_f=fs=null,Ko=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return G0&&c.locale!=="ko"?null:c.data;default:return null}}var rM={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Z0(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!rM[o.type]:c==="textarea"}function J0(o,c,f,_){Js(_),c=hh(c,"onChange"),0<c.length&&(f=new xf("onChange","change",null,f,_),o.push({event:f,listeners:c}))}var cl=null,hl=null;function iM(o){y_(o,0)}function oh(o){var c=ea(o);if(ct(c))return o}function nM(o,c){if(o==="change")return c}var e_=!1;if(l){var kf;if(l){var Tf="oninput"in document;if(!Tf){var t_=document.createElement("div");t_.setAttribute("oninput","return;"),Tf=typeof t_.oninput=="function"}kf=Tf}else kf=!1;e_=kf&&(!document.documentMode||9<document.documentMode)}function r_(){cl&&(cl.detachEvent("onpropertychange",i_),hl=cl=null)}function i_(o){if(o.propertyName==="value"&&oh(hl)){var c=[];J0(c,hl,o,Zs(o)),as(iM,c)}}function sM(o,c,f){o==="focusin"?(r_(),cl=c,hl=f,cl.attachEvent("onpropertychange",i_)):o==="focusout"&&r_()}function oM(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return oh(hl)}function aM(o,c){if(o==="click")return oh(c)}function lM(o,c){if(o==="input"||o==="change")return oh(c)}function cM(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var Ki=typeof Object.is=="function"?Object.is:cM;function ul(o,c){if(Ki(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var f=Object.keys(o),_=Object.keys(c);if(f.length!==_.length)return!1;for(_=0;_<f.length;_++){var b=f[_];if(!u.call(c,b)||!Ki(o[b],c[b]))return!1}return!0}function n_(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function s_(o,c){var f=n_(o);o=0;for(var _;f;){if(f.nodeType===3){if(_=o+f.textContent.length,o<=c&&_>=c)return{node:f,offset:c-o};o=_}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=n_(f)}}function o_(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?o_(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function a_(){for(var o=window,c=ze();c instanceof o.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)o=c.contentWindow;else break;c=ze(o.document)}return c}function Ef(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}function hM(o){var c=a_(),f=o.focusedElem,_=o.selectionRange;if(c!==f&&f&&f.ownerDocument&&o_(f.ownerDocument.documentElement,f)){if(_!==null&&Ef(f)){if(c=_.start,o=_.end,o===void 0&&(o=c),"selectionStart"in f)f.selectionStart=c,f.selectionEnd=Math.min(o,f.value.length);else if(o=(c=f.ownerDocument||document)&&c.defaultView||window,o.getSelection){o=o.getSelection();var b=f.textContent.length,w=Math.min(_.start,b);_=_.end===void 0?w:Math.min(_.end,b),!o.extend&&w>_&&(b=_,_=w,w=b),b=s_(f,w);var D=s_(f,_);b&&D&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==D.node||o.focusOffset!==D.offset)&&(c=c.createRange(),c.setStart(b.node,b.offset),o.removeAllRanges(),w>_?(o.addRange(c),o.extend(D.node,D.offset)):(c.setEnd(D.node,D.offset),o.addRange(c)))}}for(c=[],o=f;o=o.parentNode;)o.nodeType===1&&c.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<c.length;f++)o=c[f],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var uM=l&&"documentMode"in document&&11>=document.documentMode,Xo=null,Bf=null,dl=null,Mf=!1;function l_(o,c,f){var _=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Mf||Xo==null||Xo!==ze(_)||(_=Xo,"selectionStart"in _&&Ef(_)?_={start:_.selectionStart,end:_.selectionEnd}:(_=(_.ownerDocument&&_.ownerDocument.defaultView||window).getSelection(),_={anchorNode:_.anchorNode,anchorOffset:_.anchorOffset,focusNode:_.focusNode,focusOffset:_.focusOffset}),dl&&ul(dl,_)||(dl=_,_=hh(Bf,"onSelect"),0<_.length&&(c=new xf("onSelect","select",null,c,f),o.push({event:c,listeners:_}),c.target=Xo)))}function ah(o,c){var f={};return f[o.toLowerCase()]=c.toLowerCase(),f["Webkit"+o]="webkit"+c,f["Moz"+o]="moz"+c,f}var Qo={animationend:ah("Animation","AnimationEnd"),animationiteration:ah("Animation","AnimationIteration"),animationstart:ah("Animation","AnimationStart"),transitionend:ah("Transition","TransitionEnd")},Lf={},c_={};l&&(c_=document.createElement("div").style,"AnimationEvent"in window||(delete Qo.animationend.animation,delete Qo.animationiteration.animation,delete Qo.animationstart.animation),"TransitionEvent"in window||delete Qo.transitionend.transition);function lh(o){if(Lf[o])return Lf[o];if(!Qo[o])return o;var c=Qo[o],f;for(f in c)if(c.hasOwnProperty(f)&&f in c_)return Lf[o]=c[f];return o}var h_=lh("animationend"),u_=lh("animationiteration"),d_=lh("animationstart"),f_=lh("transitionend"),p_=new Map,g_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ps(o,c){p_.set(o,c),s(c,[o])}for(var Rf=0;Rf<g_.length;Rf++){var Af=g_[Rf],dM=Af.toLowerCase(),fM=Af[0].toUpperCase()+Af.slice(1);ps(dM,"on"+fM)}ps(h_,"onAnimationEnd"),ps(u_,"onAnimationIteration"),ps(d_,"onAnimationStart"),ps("dblclick","onDoubleClick"),ps("focusin","onFocus"),ps("focusout","onBlur"),ps(f_,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),pM=new Set("cancel close invalid load scroll toggle".split(" ").concat(fl));function m_(o,c,f){var _=o.type||"unknown-event";o.currentTarget=f,rt(_,c,void 0,o),o.currentTarget=null}function y_(o,c){c=(c&4)!==0;for(var f=0;f<o.length;f++){var _=o[f],b=_.event;_=_.listeners;e:{var w=void 0;if(c)for(var D=_.length-1;0<=D;D--){var N=_[D],V=N.instance,ne=N.currentTarget;if(N=N.listener,V!==w&&b.isPropagationStopped())break e;m_(b,N,ne),w=V}else for(D=0;D<_.length;D++){if(N=_[D],V=N.instance,ne=N.currentTarget,N=N.listener,V!==w&&b.isPropagationStopped())break e;m_(b,N,ne),w=V}}}if(Nt)throw o=On,Nt=!1,On=null,o}function Ct(o,c){var f=c[Ff];f===void 0&&(f=c[Ff]=new Set);var _=o+"__bubble";f.has(_)||(__(c,o,2,!1),f.add(_))}function Df(o,c,f){var _=0;c&&(_|=4),__(f,o,_,c)}var ch="_reactListening"+Math.random().toString(36).slice(2);function pl(o){if(!o[ch]){o[ch]=!0,i.forEach(function(f){f!=="selectionchange"&&(pM.has(f)||Df(f,!1,o),Df(f,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[ch]||(c[ch]=!0,Df("selectionchange",!1,c))}}function __(o,c,f,_){switch(N0(c)){case 1:var b=BB;break;case 4:b=MB;break;default:b=mf}f=b.bind(null,c,f,o),b=void 0,!ls||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(b=!0),_?b!==void 0?o.addEventListener(c,f,{capture:!0,passive:b}):o.addEventListener(c,f,!0):b!==void 0?o.addEventListener(c,f,{passive:b}):o.addEventListener(c,f,!1)}function Pf(o,c,f,_,b){var w=_;if((c&1)===0&&(c&2)===0&&_!==null)e:for(;;){if(_===null)return;var D=_.tag;if(D===3||D===4){var N=_.stateNode.containerInfo;if(N===b||N.nodeType===8&&N.parentNode===b)break;if(D===4)for(D=_.return;D!==null;){var V=D.tag;if((V===3||V===4)&&(V=D.stateNode.containerInfo,V===b||V.nodeType===8&&V.parentNode===b))return;D=D.return}for(;N!==null;){if(D=to(N),D===null)return;if(V=D.tag,V===5||V===6){_=w=D;continue e}N=N.parentNode}}_=_.return}as(function(){var ne=w,fe=Zs(f),ge=[];e:{var de=p_.get(o);if(de!==void 0){var we=xf,Le=o;switch(o){case"keypress":if(ih(f)===0)break e;case"keydown":case"keyup":we=qB;break;case"focusin":Le="focus",we=Sf;break;case"focusout":Le="blur",we=Sf;break;case"beforeblur":case"afterblur":we=Sf;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":we=q0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=AB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=GB;break;case h_:case u_:case d_:we=IB;break;case f_:we=KB;break;case"scroll":we=LB;break;case"wheel":we=QB;break;case"copy":case"cut":case"paste":we=jB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=V0}var Ie=(c&4)!==0,Ht=!Ie&&o==="scroll",re=Ie?de!==null?de+"Capture":null:de;Ie=[];for(var K=ne,ie;K!==null;){ie=K;var me=ie.stateNode;if(ie.tag===5&&me!==null&&(ie=me,re!==null&&(me=Bi(K,re),me!=null&&Ie.push(gl(K,me,ie)))),Ht)break;K=K.return}0<Ie.length&&(de=new we(de,Le,null,f,fe),ge.push({event:de,listeners:Ie}))}}if((c&7)===0){e:{if(de=o==="mouseover"||o==="pointerover",we=o==="mouseout"||o==="pointerout",de&&f!==jn&&(Le=f.relatedTarget||f.fromElement)&&(to(Le)||Le[zn]))break e;if((we||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,we?(Le=f.relatedTarget||f.toElement,we=ne,Le=Le?to(Le):null,Le!==null&&(Ht=mt(Le),Le!==Ht||Le.tag!==5&&Le.tag!==6)&&(Le=null)):(we=null,Le=ne),we!==Le)){if(Ie=q0,me="onMouseLeave",re="onMouseEnter",K="mouse",(o==="pointerout"||o==="pointerover")&&(Ie=V0,me="onPointerLeave",re="onPointerEnter",K="pointer"),Ht=we==null?de:ea(we),ie=Le==null?de:ea(Le),de=new Ie(me,K+"leave",we,f,fe),de.target=Ht,de.relatedTarget=ie,me=null,to(fe)===ne&&(Ie=new Ie(re,K+"enter",Le,f,fe),Ie.target=ie,Ie.relatedTarget=Ht,me=Ie),Ht=me,we&&Le)t:{for(Ie=we,re=Le,K=0,ie=Ie;ie;ie=Zo(ie))K++;for(ie=0,me=re;me;me=Zo(me))ie++;for(;0<K-ie;)Ie=Zo(Ie),K--;for(;0<ie-K;)re=Zo(re),ie--;for(;K--;){if(Ie===re||re!==null&&Ie===re.alternate)break t;Ie=Zo(Ie),re=Zo(re)}Ie=null}else Ie=null;we!==null&&x_(ge,de,we,Ie,!1),Le!==null&&Ht!==null&&x_(ge,Ht,Le,Ie,!0)}}e:{if(de=ne?ea(ne):window,we=de.nodeName&&de.nodeName.toLowerCase(),we==="select"||we==="input"&&de.type==="file")var je=nM;else if(Z0(de))if(e_)je=lM;else{je=oM;var We=sM}else(we=de.nodeName)&&we.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(je=aM);if(je&&(je=je(o,ne))){J0(ge,je,f,fe);break e}We&&We(o,de,ne),o==="focusout"&&(We=de._wrapperState)&&We.controlled&&de.type==="number"&&Vt(de,"number",de.value)}switch(We=ne?ea(ne):window,o){case"focusin":(Z0(We)||We.contentEditable==="true")&&(Xo=We,Bf=ne,dl=null);break;case"focusout":dl=Bf=Xo=null;break;case"mousedown":Mf=!0;break;case"contextmenu":case"mouseup":case"dragend":Mf=!1,l_(ge,f,fe);break;case"selectionchange":if(uM)break;case"keydown":case"keyup":l_(ge,f,fe)}var He;if(Cf)e:{switch(o){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Ko?X0(o,f)&&(Ve="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Ve="onCompositionStart");Ve&&(G0&&f.locale!=="ko"&&(Ko||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ko&&(He=W0()):(fs=fe,_f="value"in fs?fs.value:fs.textContent,Ko=!0)),We=hh(ne,Ve),0<We.length&&(Ve=new U0(Ve,o,null,f,fe),ge.push({event:Ve,listeners:We}),He?Ve.data=He:(He=Q0(f),He!==null&&(Ve.data=He)))),(He=JB?eM(o,f):tM(o,f))&&(ne=hh(ne,"onBeforeInput"),0<ne.length&&(fe=new U0("onBeforeInput","beforeinput",null,f,fe),ge.push({event:fe,listeners:ne}),fe.data=He))}y_(ge,c)})}function gl(o,c,f){return{instance:o,listener:c,currentTarget:f}}function hh(o,c){for(var f=c+"Capture",_=[];o!==null;){var b=o,w=b.stateNode;b.tag===5&&w!==null&&(b=w,w=Bi(o,f),w!=null&&_.unshift(gl(o,w,b)),w=Bi(o,c),w!=null&&_.push(gl(o,w,b))),o=o.return}return _}function Zo(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function x_(o,c,f,_,b){for(var w=c._reactName,D=[];f!==null&&f!==_;){var N=f,V=N.alternate,ne=N.stateNode;if(V!==null&&V===_)break;N.tag===5&&ne!==null&&(N=ne,b?(V=Bi(f,w),V!=null&&D.unshift(gl(f,V,N))):b||(V=Bi(f,w),V!=null&&D.push(gl(f,V,N)))),f=f.return}D.length!==0&&o.push({event:c,listeners:D})}var gM=/\r\n?/g,mM=/\u0000|\uFFFD/g;function v_(o){return(typeof o=="string"?o:""+o).replace(gM,`
|
|
39
|
+
`).replace(mM,"")}function uh(o,c,f){if(c=v_(c),v_(o)!==c&&f)throw Error(r(425))}function dh(){}var If=null,$f=null;function jf(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Of=typeof setTimeout=="function"?setTimeout:void 0,yM=typeof clearTimeout=="function"?clearTimeout:void 0,b_=typeof Promise=="function"?Promise:void 0,_M=typeof queueMicrotask=="function"?queueMicrotask:typeof b_<"u"?function(o){return b_.resolve(null).then(o).catch(xM)}:Of;function xM(o){setTimeout(function(){throw o})}function zf(o,c){var f=c,_=0;do{var b=f.nextSibling;if(o.removeChild(f),b&&b.nodeType===8)if(f=b.data,f==="/$"){if(_===0){o.removeChild(b),sl(c);return}_--}else f!=="$"&&f!=="$?"&&f!=="$!"||_++;f=b}while(f);sl(c)}function gs(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return o}function S_(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return o;c--}else f==="/$"&&c++}o=o.previousSibling}return null}var Jo=Math.random().toString(36).slice(2),gn="__reactFiber$"+Jo,ml="__reactProps$"+Jo,zn="__reactContainer$"+Jo,Ff="__reactEvents$"+Jo,vM="__reactListeners$"+Jo,bM="__reactHandles$"+Jo;function to(o){var c=o[gn];if(c)return c;for(var f=o.parentNode;f;){if(c=f[zn]||f[gn]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(o=S_(o);o!==null;){if(f=o[gn])return f;o=S_(o)}return c}o=f,f=o.parentNode}return null}function yl(o){return o=o[gn]||o[zn],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function ea(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(r(33))}function fh(o){return o[ml]||null}var Nf=[],ta=-1;function ms(o){return{current:o}}function kt(o){0>ta||(o.current=Nf[ta],Nf[ta]=null,ta--)}function St(o,c){ta++,Nf[ta]=o.current,o.current=c}var ys={},Br=ms(ys),ti=ms(!1),ro=ys;function ra(o,c){var f=o.type.contextTypes;if(!f)return ys;var _=o.stateNode;if(_&&_.__reactInternalMemoizedUnmaskedChildContext===c)return _.__reactInternalMemoizedMaskedChildContext;var b={},w;for(w in f)b[w]=c[w];return _&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=c,o.__reactInternalMemoizedMaskedChildContext=b),b}function ri(o){return o=o.childContextTypes,o!=null}function ph(){kt(ti),kt(Br)}function w_(o,c,f){if(Br.current!==ys)throw Error(r(168));St(Br,c),St(ti,f)}function C_(o,c,f){var _=o.stateNode;if(c=c.childContextTypes,typeof _.getChildContext!="function")return f;_=_.getChildContext();for(var b in _)if(!(b in c))throw Error(r(108,ye(o)||"Unknown",b));return ee({},f,_)}function gh(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||ys,ro=Br.current,St(Br,o),St(ti,ti.current),!0}function k_(o,c,f){var _=o.stateNode;if(!_)throw Error(r(169));f?(o=C_(o,c,ro),_.__reactInternalMemoizedMergedChildContext=o,kt(ti),kt(Br),St(Br,o)):kt(ti),St(ti,f)}var Fn=null,mh=!1,Wf=!1;function T_(o){Fn===null?Fn=[o]:Fn.push(o)}function SM(o){mh=!0,T_(o)}function _s(){if(!Wf&&Fn!==null){Wf=!0;var o=0,c=gt;try{var f=Fn;for(gt=1;o<f.length;o++){var _=f[o];do _=_(!0);while(_!==null)}Fn=null,mh=!1}catch(b){throw Fn!==null&&(Fn=Fn.slice(o+1)),G(cr,_s),b}finally{gt=c,Wf=!1}}return null}var ia=[],na=0,yh=null,_h=0,Ri=[],Ai=0,io=null,Nn=1,Wn="";function no(o,c){ia[na++]=_h,ia[na++]=yh,yh=o,_h=c}function E_(o,c,f){Ri[Ai++]=Nn,Ri[Ai++]=Wn,Ri[Ai++]=io,io=o;var _=Nn;o=Wn;var b=32-Yi(_)-1;_&=~(1<<b),f+=1;var w=32-Yi(c)+b;if(30<w){var D=b-b%5;w=(_&(1<<D)-1).toString(32),_>>=D,b-=D,Nn=1<<32-Yi(c)+b|f<<b|_,Wn=w+o}else Nn=1<<w|f<<b|_,Wn=o}function Hf(o){o.return!==null&&(no(o,1),E_(o,1,0))}function qf(o){for(;o===yh;)yh=ia[--na],ia[na]=null,_h=ia[--na],ia[na]=null;for(;o===io;)io=Ri[--Ai],Ri[Ai]=null,Wn=Ri[--Ai],Ri[Ai]=null,Nn=Ri[--Ai],Ri[Ai]=null}var mi=null,yi=null,Lt=!1,Xi=null;function B_(o,c){var f=$i(5,null,null,0);f.elementType="DELETED",f.stateNode=c,f.return=o,c=o.deletions,c===null?(o.deletions=[f],o.flags|=16):c.push(f)}function M_(o,c){switch(o.tag){case 5:var f=o.type;return c=c.nodeType!==1||f.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(o.stateNode=c,mi=o,yi=gs(c.firstChild),!0):!1;case 6:return c=o.pendingProps===""||c.nodeType!==3?null:c,c!==null?(o.stateNode=c,mi=o,yi=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(f=io!==null?{id:Nn,overflow:Wn}:null,o.memoizedState={dehydrated:c,treeContext:f,retryLane:1073741824},f=$i(18,null,null,0),f.stateNode=c,f.return=o,o.child=f,mi=o,yi=null,!0):!1;default:return!1}}function Uf(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Vf(o){if(Lt){var c=yi;if(c){var f=c;if(!M_(o,c)){if(Uf(o))throw Error(r(418));c=gs(f.nextSibling);var _=mi;c&&M_(o,c)?B_(_,f):(o.flags=o.flags&-4097|2,Lt=!1,mi=o)}}else{if(Uf(o))throw Error(r(418));o.flags=o.flags&-4097|2,Lt=!1,mi=o}}}function L_(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;mi=o}function xh(o){if(o!==mi)return!1;if(!Lt)return L_(o),Lt=!0,!1;var c;if((c=o.tag!==3)&&!(c=o.tag!==5)&&(c=o.type,c=c!=="head"&&c!=="body"&&!jf(o.type,o.memoizedProps)),c&&(c=yi)){if(Uf(o))throw R_(),Error(r(418));for(;c;)B_(o,c),c=gs(c.nextSibling)}if(L_(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));e:{for(o=o.nextSibling,c=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"){if(c===0){yi=gs(o.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++}o=o.nextSibling}yi=null}}else yi=mi?gs(o.stateNode.nextSibling):null;return!0}function R_(){for(var o=yi;o;)o=gs(o.nextSibling)}function sa(){yi=mi=null,Lt=!1}function Gf(o){Xi===null?Xi=[o]:Xi.push(o)}var wM=E.ReactCurrentBatchConfig;function _l(o,c,f){if(o=f.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(r(309));var _=f.stateNode}if(!_)throw Error(r(147,o));var b=_,w=""+o;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===w?c.ref:(c=function(D){var N=b.refs;D===null?delete N[w]:N[w]=D},c._stringRef=w,c)}if(typeof o!="string")throw Error(r(284));if(!f._owner)throw Error(r(290,o))}return o}function vh(o,c){throw o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o))}function A_(o){var c=o._init;return c(o._payload)}function D_(o){function c(re,K){if(o){var ie=re.deletions;ie===null?(re.deletions=[K],re.flags|=16):ie.push(K)}}function f(re,K){if(!o)return null;for(;K!==null;)c(re,K),K=K.sibling;return null}function _(re,K){for(re=new Map;K!==null;)K.key!==null?re.set(K.key,K):re.set(K.index,K),K=K.sibling;return re}function b(re,K){return re=Ts(re,K),re.index=0,re.sibling=null,re}function w(re,K,ie){return re.index=ie,o?(ie=re.alternate,ie!==null?(ie=ie.index,ie<K?(re.flags|=2,K):ie):(re.flags|=2,K)):(re.flags|=1048576,K)}function D(re){return o&&re.alternate===null&&(re.flags|=2),re}function N(re,K,ie,me){return K===null||K.tag!==6?(K=Op(ie,re.mode,me),K.return=re,K):(K=b(K,ie),K.return=re,K)}function V(re,K,ie,me){var je=ie.type;return je===A?fe(re,K,ie.props.children,me,ie.key):K!==null&&(K.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===j&&A_(je)===K.type)?(me=b(K,ie.props),me.ref=_l(re,K,ie),me.return=re,me):(me=qh(ie.type,ie.key,ie.props,null,re.mode,me),me.ref=_l(re,K,ie),me.return=re,me)}function ne(re,K,ie,me){return K===null||K.tag!==4||K.stateNode.containerInfo!==ie.containerInfo||K.stateNode.implementation!==ie.implementation?(K=zp(ie,re.mode,me),K.return=re,K):(K=b(K,ie.children||[]),K.return=re,K)}function fe(re,K,ie,me,je){return K===null||K.tag!==7?(K=fo(ie,re.mode,me,je),K.return=re,K):(K=b(K,ie),K.return=re,K)}function ge(re,K,ie){if(typeof K=="string"&&K!==""||typeof K=="number")return K=Op(""+K,re.mode,ie),K.return=re,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case L:return ie=qh(K.type,K.key,K.props,null,re.mode,ie),ie.ref=_l(re,null,K),ie.return=re,ie;case k:return K=zp(K,re.mode,ie),K.return=re,K;case j:var me=K._init;return ge(re,me(K._payload),ie)}if(zr(K)||Z(K))return K=fo(K,re.mode,ie,null),K.return=re,K;vh(re,K)}return null}function de(re,K,ie,me){var je=K!==null?K.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number")return je!==null?null:N(re,K,""+ie,me);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case L:return ie.key===je?V(re,K,ie,me):null;case k:return ie.key===je?ne(re,K,ie,me):null;case j:return je=ie._init,de(re,K,je(ie._payload),me)}if(zr(ie)||Z(ie))return je!==null?null:fe(re,K,ie,me,null);vh(re,ie)}return null}function we(re,K,ie,me,je){if(typeof me=="string"&&me!==""||typeof me=="number")return re=re.get(ie)||null,N(K,re,""+me,je);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case L:return re=re.get(me.key===null?ie:me.key)||null,V(K,re,me,je);case k:return re=re.get(me.key===null?ie:me.key)||null,ne(K,re,me,je);case j:var We=me._init;return we(re,K,ie,We(me._payload),je)}if(zr(me)||Z(me))return re=re.get(ie)||null,fe(K,re,me,je,null);vh(K,me)}return null}function Le(re,K,ie,me){for(var je=null,We=null,He=K,Ve=K=0,dr=null;He!==null&&Ve<ie.length;Ve++){He.index>Ve?(dr=He,He=null):dr=He.sibling;var st=de(re,He,ie[Ve],me);if(st===null){He===null&&(He=dr);break}o&&He&&st.alternate===null&&c(re,He),K=w(st,K,Ve),We===null?je=st:We.sibling=st,We=st,He=dr}if(Ve===ie.length)return f(re,He),Lt&&no(re,Ve),je;if(He===null){for(;Ve<ie.length;Ve++)He=ge(re,ie[Ve],me),He!==null&&(K=w(He,K,Ve),We===null?je=He:We.sibling=He,We=He);return Lt&&no(re,Ve),je}for(He=_(re,He);Ve<ie.length;Ve++)dr=we(He,re,Ve,ie[Ve],me),dr!==null&&(o&&dr.alternate!==null&&He.delete(dr.key===null?Ve:dr.key),K=w(dr,K,Ve),We===null?je=dr:We.sibling=dr,We=dr);return o&&He.forEach(function(Es){return c(re,Es)}),Lt&&no(re,Ve),je}function Ie(re,K,ie,me){var je=Z(ie);if(typeof je!="function")throw Error(r(150));if(ie=je.call(ie),ie==null)throw Error(r(151));for(var We=je=null,He=K,Ve=K=0,dr=null,st=ie.next();He!==null&&!st.done;Ve++,st=ie.next()){He.index>Ve?(dr=He,He=null):dr=He.sibling;var Es=de(re,He,st.value,me);if(Es===null){He===null&&(He=dr);break}o&&He&&Es.alternate===null&&c(re,He),K=w(Es,K,Ve),We===null?je=Es:We.sibling=Es,We=Es,He=dr}if(st.done)return f(re,He),Lt&&no(re,Ve),je;if(He===null){for(;!st.done;Ve++,st=ie.next())st=ge(re,st.value,me),st!==null&&(K=w(st,K,Ve),We===null?je=st:We.sibling=st,We=st);return Lt&&no(re,Ve),je}for(He=_(re,He);!st.done;Ve++,st=ie.next())st=we(He,re,Ve,st.value,me),st!==null&&(o&&st.alternate!==null&&He.delete(st.key===null?Ve:st.key),K=w(st,K,Ve),We===null?je=st:We.sibling=st,We=st);return o&&He.forEach(function(rL){return c(re,rL)}),Lt&&no(re,Ve),je}function Ht(re,K,ie,me){if(typeof ie=="object"&&ie!==null&&ie.type===A&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case L:e:{for(var je=ie.key,We=K;We!==null;){if(We.key===je){if(je=ie.type,je===A){if(We.tag===7){f(re,We.sibling),K=b(We,ie.props.children),K.return=re,re=K;break e}}else if(We.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===j&&A_(je)===We.type){f(re,We.sibling),K=b(We,ie.props),K.ref=_l(re,We,ie),K.return=re,re=K;break e}f(re,We);break}else c(re,We);We=We.sibling}ie.type===A?(K=fo(ie.props.children,re.mode,me,ie.key),K.return=re,re=K):(me=qh(ie.type,ie.key,ie.props,null,re.mode,me),me.ref=_l(re,K,ie),me.return=re,re=me)}return D(re);case k:e:{for(We=ie.key;K!==null;){if(K.key===We)if(K.tag===4&&K.stateNode.containerInfo===ie.containerInfo&&K.stateNode.implementation===ie.implementation){f(re,K.sibling),K=b(K,ie.children||[]),K.return=re,re=K;break e}else{f(re,K);break}else c(re,K);K=K.sibling}K=zp(ie,re.mode,me),K.return=re,re=K}return D(re);case j:return We=ie._init,Ht(re,K,We(ie._payload),me)}if(zr(ie))return Le(re,K,ie,me);if(Z(ie))return Ie(re,K,ie,me);vh(re,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"?(ie=""+ie,K!==null&&K.tag===6?(f(re,K.sibling),K=b(K,ie),K.return=re,re=K):(f(re,K),K=Op(ie,re.mode,me),K.return=re,re=K),D(re)):f(re,K)}return Ht}var oa=D_(!0),P_=D_(!1),bh=ms(null),Sh=null,aa=null,Yf=null;function Kf(){Yf=aa=Sh=null}function Xf(o){var c=bh.current;kt(bh),o._currentValue=c}function Qf(o,c,f){for(;o!==null;){var _=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,_!==null&&(_.childLanes|=c)):_!==null&&(_.childLanes&c)!==c&&(_.childLanes|=c),o===f)break;o=o.return}}function la(o,c){Sh=o,Yf=aa=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&c)!==0&&(ii=!0),o.firstContext=null)}function Di(o){var c=o._currentValue;if(Yf!==o)if(o={context:o,memoizedValue:c,next:null},aa===null){if(Sh===null)throw Error(r(308));aa=o,Sh.dependencies={lanes:0,firstContext:o}}else aa=aa.next=o;return c}var so=null;function Zf(o){so===null?so=[o]:so.push(o)}function I_(o,c,f,_){var b=c.interleaved;return b===null?(f.next=f,Zf(c)):(f.next=b.next,b.next=f),c.interleaved=f,Hn(o,_)}function Hn(o,c){o.lanes|=c;var f=o.alternate;for(f!==null&&(f.lanes|=c),f=o,o=o.return;o!==null;)o.childLanes|=c,f=o.alternate,f!==null&&(f.childLanes|=c),f=o,o=o.return;return f.tag===3?f.stateNode:null}var xs=!1;function Jf(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $_(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function qn(o,c){return{eventTime:o,lane:c,tag:0,payload:null,callback:null,next:null}}function vs(o,c,f){var _=o.updateQueue;if(_===null)return null;if(_=_.shared,(nt&2)!==0){var b=_.pending;return b===null?c.next=c:(c.next=b.next,b.next=c),_.pending=c,Hn(o,f)}return b=_.interleaved,b===null?(c.next=c,Zf(_)):(c.next=b.next,b.next=c),_.interleaved=c,Hn(o,f)}function wh(o,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194240)!==0)){var _=c.lanes;_&=o.pendingLanes,f|=_,c.lanes=f,ff(o,f)}}function j_(o,c){var f=o.updateQueue,_=o.alternate;if(_!==null&&(_=_.updateQueue,f===_)){var b=null,w=null;if(f=f.firstBaseUpdate,f!==null){do{var D={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};w===null?b=w=D:w=w.next=D,f=f.next}while(f!==null);w===null?b=w=c:w=w.next=c}else b=w=c;f={baseState:_.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:_.shared,effects:_.effects},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=c:o.next=c,f.lastBaseUpdate=c}function Ch(o,c,f,_){var b=o.updateQueue;xs=!1;var w=b.firstBaseUpdate,D=b.lastBaseUpdate,N=b.shared.pending;if(N!==null){b.shared.pending=null;var V=N,ne=V.next;V.next=null,D===null?w=ne:D.next=ne,D=V;var fe=o.alternate;fe!==null&&(fe=fe.updateQueue,N=fe.lastBaseUpdate,N!==D&&(N===null?fe.firstBaseUpdate=ne:N.next=ne,fe.lastBaseUpdate=V))}if(w!==null){var ge=b.baseState;D=0,fe=ne=V=null,N=w;do{var de=N.lane,we=N.eventTime;if((_&de)===de){fe!==null&&(fe=fe.next={eventTime:we,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var Le=o,Ie=N;switch(de=c,we=f,Ie.tag){case 1:if(Le=Ie.payload,typeof Le=="function"){ge=Le.call(we,ge,de);break e}ge=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Ie.payload,de=typeof Le=="function"?Le.call(we,ge,de):Le,de==null)break e;ge=ee({},ge,de);break e;case 2:xs=!0}}N.callback!==null&&N.lane!==0&&(o.flags|=64,de=b.effects,de===null?b.effects=[N]:de.push(N))}else we={eventTime:we,lane:de,tag:N.tag,payload:N.payload,callback:N.callback,next:null},fe===null?(ne=fe=we,V=ge):fe=fe.next=we,D|=de;if(N=N.next,N===null){if(N=b.shared.pending,N===null)break;de=N,N=de.next,de.next=null,b.lastBaseUpdate=de,b.shared.pending=null}}while(!0);if(fe===null&&(V=ge),b.baseState=V,b.firstBaseUpdate=ne,b.lastBaseUpdate=fe,c=b.shared.interleaved,c!==null){b=c;do D|=b.lane,b=b.next;while(b!==c)}else w===null&&(b.shared.lanes=0);lo|=D,o.lanes=D,o.memoizedState=ge}}function O_(o,c,f){if(o=c.effects,c.effects=null,o!==null)for(c=0;c<o.length;c++){var _=o[c],b=_.callback;if(b!==null){if(_.callback=null,_=f,typeof b!="function")throw Error(r(191,b));b.call(_)}}}var xl={},mn=ms(xl),vl=ms(xl),bl=ms(xl);function oo(o){if(o===xl)throw Error(r(174));return o}function ep(o,c){switch(St(bl,c),St(vl,o),St(mn,xl),o=c.nodeType,o){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Tr(null,"");break;default:o=o===8?c.parentNode:c,c=o.namespaceURI||null,o=o.tagName,c=Tr(c,o)}kt(mn),St(mn,c)}function ca(){kt(mn),kt(vl),kt(bl)}function z_(o){oo(bl.current);var c=oo(mn.current),f=Tr(c,o.type);c!==f&&(St(vl,o),St(mn,f))}function tp(o){vl.current===o&&(kt(mn),kt(vl))}var Dt=ms(0);function kh(o){for(var c=o;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var rp=[];function ip(){for(var o=0;o<rp.length;o++)rp[o]._workInProgressVersionPrimary=null;rp.length=0}var Th=E.ReactCurrentDispatcher,np=E.ReactCurrentBatchConfig,ao=0,Pt=null,er=null,hr=null,Eh=!1,Sl=!1,wl=0,CM=0;function Mr(){throw Error(r(321))}function sp(o,c){if(c===null)return!1;for(var f=0;f<c.length&&f<o.length;f++)if(!Ki(o[f],c[f]))return!1;return!0}function op(o,c,f,_,b,w){if(ao=w,Pt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Th.current=o===null||o.memoizedState===null?BM:MM,o=f(_,b),Sl){w=0;do{if(Sl=!1,wl=0,25<=w)throw Error(r(301));w+=1,hr=er=null,c.updateQueue=null,Th.current=LM,o=f(_,b)}while(Sl)}if(Th.current=Lh,c=er!==null&&er.next!==null,ao=0,hr=er=Pt=null,Eh=!1,c)throw Error(r(300));return o}function ap(){var o=wl!==0;return wl=0,o}function yn(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hr===null?Pt.memoizedState=hr=o:hr=hr.next=o,hr}function Pi(){if(er===null){var o=Pt.alternate;o=o!==null?o.memoizedState:null}else o=er.next;var c=hr===null?Pt.memoizedState:hr.next;if(c!==null)hr=c,er=o;else{if(o===null)throw Error(r(310));er=o,o={memoizedState:er.memoizedState,baseState:er.baseState,baseQueue:er.baseQueue,queue:er.queue,next:null},hr===null?Pt.memoizedState=hr=o:hr=hr.next=o}return hr}function Cl(o,c){return typeof c=="function"?c(o):c}function lp(o){var c=Pi(),f=c.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=o;var _=er,b=_.baseQueue,w=f.pending;if(w!==null){if(b!==null){var D=b.next;b.next=w.next,w.next=D}_.baseQueue=b=w,f.pending=null}if(b!==null){w=b.next,_=_.baseState;var N=D=null,V=null,ne=w;do{var fe=ne.lane;if((ao&fe)===fe)V!==null&&(V=V.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),_=ne.hasEagerState?ne.eagerState:o(_,ne.action);else{var ge={lane:fe,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};V===null?(N=V=ge,D=_):V=V.next=ge,Pt.lanes|=fe,lo|=fe}ne=ne.next}while(ne!==null&&ne!==w);V===null?D=_:V.next=N,Ki(_,c.memoizedState)||(ii=!0),c.memoizedState=_,c.baseState=D,c.baseQueue=V,f.lastRenderedState=_}if(o=f.interleaved,o!==null){b=o;do w=b.lane,Pt.lanes|=w,lo|=w,b=b.next;while(b!==o)}else b===null&&(f.lanes=0);return[c.memoizedState,f.dispatch]}function cp(o){var c=Pi(),f=c.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=o;var _=f.dispatch,b=f.pending,w=c.memoizedState;if(b!==null){f.pending=null;var D=b=b.next;do w=o(w,D.action),D=D.next;while(D!==b);Ki(w,c.memoizedState)||(ii=!0),c.memoizedState=w,c.baseQueue===null&&(c.baseState=w),f.lastRenderedState=w}return[w,_]}function F_(){}function N_(o,c){var f=Pt,_=Pi(),b=c(),w=!Ki(_.memoizedState,b);if(w&&(_.memoizedState=b,ii=!0),_=_.queue,hp(q_.bind(null,f,_,o),[o]),_.getSnapshot!==c||w||hr!==null&&hr.memoizedState.tag&1){if(f.flags|=2048,kl(9,H_.bind(null,f,_,b,c),void 0,null),ur===null)throw Error(r(349));(ao&30)!==0||W_(f,c,b)}return b}function W_(o,c,f){o.flags|=16384,o={getSnapshot:c,value:f},c=Pt.updateQueue,c===null?(c={lastEffect:null,stores:null},Pt.updateQueue=c,c.stores=[o]):(f=c.stores,f===null?c.stores=[o]:f.push(o))}function H_(o,c,f,_){c.value=f,c.getSnapshot=_,U_(c)&&V_(o)}function q_(o,c,f){return f(function(){U_(c)&&V_(o)})}function U_(o){var c=o.getSnapshot;o=o.value;try{var f=c();return!Ki(o,f)}catch{return!0}}function V_(o){var c=Hn(o,1);c!==null&&en(c,o,1,-1)}function G_(o){var c=yn();return typeof o=="function"&&(o=o()),c.memoizedState=c.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Cl,lastRenderedState:o},c.queue=o,o=o.dispatch=EM.bind(null,Pt,o),[c.memoizedState,o]}function kl(o,c,f,_){return o={tag:o,create:c,destroy:f,deps:_,next:null},c=Pt.updateQueue,c===null?(c={lastEffect:null,stores:null},Pt.updateQueue=c,c.lastEffect=o.next=o):(f=c.lastEffect,f===null?c.lastEffect=o.next=o:(_=f.next,f.next=o,o.next=_,c.lastEffect=o)),o}function Y_(){return Pi().memoizedState}function Bh(o,c,f,_){var b=yn();Pt.flags|=o,b.memoizedState=kl(1|c,f,void 0,_===void 0?null:_)}function Mh(o,c,f,_){var b=Pi();_=_===void 0?null:_;var w=void 0;if(er!==null){var D=er.memoizedState;if(w=D.destroy,_!==null&&sp(_,D.deps)){b.memoizedState=kl(c,f,w,_);return}}Pt.flags|=o,b.memoizedState=kl(1|c,f,w,_)}function K_(o,c){return Bh(8390656,8,o,c)}function hp(o,c){return Mh(2048,8,o,c)}function X_(o,c){return Mh(4,2,o,c)}function Q_(o,c){return Mh(4,4,o,c)}function Z_(o,c){if(typeof c=="function")return o=o(),c(o),function(){c(null)};if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function J_(o,c,f){return f=f!=null?f.concat([o]):null,Mh(4,4,Z_.bind(null,c,o),f)}function up(){}function ex(o,c){var f=Pi();c=c===void 0?null:c;var _=f.memoizedState;return _!==null&&c!==null&&sp(c,_[1])?_[0]:(f.memoizedState=[o,c],o)}function tx(o,c){var f=Pi();c=c===void 0?null:c;var _=f.memoizedState;return _!==null&&c!==null&&sp(c,_[1])?_[0]:(o=o(),f.memoizedState=[o,c],o)}function rx(o,c,f){return(ao&21)===0?(o.baseState&&(o.baseState=!1,ii=!0),o.memoizedState=f):(Ki(f,c)||(f=A0(),Pt.lanes|=f,lo|=f,o.baseState=!0),c)}function kM(o,c){var f=gt;gt=f!==0&&4>f?f:4,o(!0);var _=np.transition;np.transition={};try{o(!1),c()}finally{gt=f,np.transition=_}}function ix(){return Pi().memoizedState}function TM(o,c,f){var _=Cs(o);if(f={lane:_,action:f,hasEagerState:!1,eagerState:null,next:null},nx(o))sx(c,f);else if(f=I_(o,c,f,_),f!==null){var b=Wr();en(f,o,_,b),ox(f,c,_)}}function EM(o,c,f){var _=Cs(o),b={lane:_,action:f,hasEagerState:!1,eagerState:null,next:null};if(nx(o))sx(c,b);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=c.lastRenderedReducer,w!==null))try{var D=c.lastRenderedState,N=w(D,f);if(b.hasEagerState=!0,b.eagerState=N,Ki(N,D)){var V=c.interleaved;V===null?(b.next=b,Zf(c)):(b.next=V.next,V.next=b),c.interleaved=b;return}}catch{}finally{}f=I_(o,c,b,_),f!==null&&(b=Wr(),en(f,o,_,b),ox(f,c,_))}}function nx(o){var c=o.alternate;return o===Pt||c!==null&&c===Pt}function sx(o,c){Sl=Eh=!0;var f=o.pending;f===null?c.next=c:(c.next=f.next,f.next=c),o.pending=c}function ox(o,c,f){if((f&4194240)!==0){var _=c.lanes;_&=o.pendingLanes,f|=_,c.lanes=f,ff(o,f)}}var Lh={readContext:Di,useCallback:Mr,useContext:Mr,useEffect:Mr,useImperativeHandle:Mr,useInsertionEffect:Mr,useLayoutEffect:Mr,useMemo:Mr,useReducer:Mr,useRef:Mr,useState:Mr,useDebugValue:Mr,useDeferredValue:Mr,useTransition:Mr,useMutableSource:Mr,useSyncExternalStore:Mr,useId:Mr,unstable_isNewReconciler:!1},BM={readContext:Di,useCallback:function(o,c){return yn().memoizedState=[o,c===void 0?null:c],o},useContext:Di,useEffect:K_,useImperativeHandle:function(o,c,f){return f=f!=null?f.concat([o]):null,Bh(4194308,4,Z_.bind(null,c,o),f)},useLayoutEffect:function(o,c){return Bh(4194308,4,o,c)},useInsertionEffect:function(o,c){return Bh(4,2,o,c)},useMemo:function(o,c){var f=yn();return c=c===void 0?null:c,o=o(),f.memoizedState=[o,c],o},useReducer:function(o,c,f){var _=yn();return c=f!==void 0?f(c):c,_.memoizedState=_.baseState=c,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:c},_.queue=o,o=o.dispatch=TM.bind(null,Pt,o),[_.memoizedState,o]},useRef:function(o){var c=yn();return o={current:o},c.memoizedState=o},useState:G_,useDebugValue:up,useDeferredValue:function(o){return yn().memoizedState=o},useTransition:function(){var o=G_(!1),c=o[0];return o=kM.bind(null,o[1]),yn().memoizedState=o,[c,o]},useMutableSource:function(){},useSyncExternalStore:function(o,c,f){var _=Pt,b=yn();if(Lt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=c(),ur===null)throw Error(r(349));(ao&30)!==0||W_(_,c,f)}b.memoizedState=f;var w={value:f,getSnapshot:c};return b.queue=w,K_(q_.bind(null,_,w,o),[o]),_.flags|=2048,kl(9,H_.bind(null,_,w,f,c),void 0,null),f},useId:function(){var o=yn(),c=ur.identifierPrefix;if(Lt){var f=Wn,_=Nn;f=(_&~(1<<32-Yi(_)-1)).toString(32)+f,c=":"+c+"R"+f,f=wl++,0<f&&(c+="H"+f.toString(32)),c+=":"}else f=CM++,c=":"+c+"r"+f.toString(32)+":";return o.memoizedState=c},unstable_isNewReconciler:!1},MM={readContext:Di,useCallback:ex,useContext:Di,useEffect:hp,useImperativeHandle:J_,useInsertionEffect:X_,useLayoutEffect:Q_,useMemo:tx,useReducer:lp,useRef:Y_,useState:function(){return lp(Cl)},useDebugValue:up,useDeferredValue:function(o){var c=Pi();return rx(c,er.memoizedState,o)},useTransition:function(){var o=lp(Cl)[0],c=Pi().memoizedState;return[o,c]},useMutableSource:F_,useSyncExternalStore:N_,useId:ix,unstable_isNewReconciler:!1},LM={readContext:Di,useCallback:ex,useContext:Di,useEffect:hp,useImperativeHandle:J_,useInsertionEffect:X_,useLayoutEffect:Q_,useMemo:tx,useReducer:cp,useRef:Y_,useState:function(){return cp(Cl)},useDebugValue:up,useDeferredValue:function(o){var c=Pi();return er===null?c.memoizedState=o:rx(c,er.memoizedState,o)},useTransition:function(){var o=cp(Cl)[0],c=Pi().memoizedState;return[o,c]},useMutableSource:F_,useSyncExternalStore:N_,useId:ix,unstable_isNewReconciler:!1};function Qi(o,c){if(o&&o.defaultProps){c=ee({},c),o=o.defaultProps;for(var f in o)c[f]===void 0&&(c[f]=o[f]);return c}return c}function dp(o,c,f,_){c=o.memoizedState,f=f(_,c),f=f==null?c:ee({},c,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var Rh={isMounted:function(o){return(o=o._reactInternals)?mt(o)===o:!1},enqueueSetState:function(o,c,f){o=o._reactInternals;var _=Wr(),b=Cs(o),w=qn(_,b);w.payload=c,f!=null&&(w.callback=f),c=vs(o,w,b),c!==null&&(en(c,o,b,_),wh(c,o,b))},enqueueReplaceState:function(o,c,f){o=o._reactInternals;var _=Wr(),b=Cs(o),w=qn(_,b);w.tag=1,w.payload=c,f!=null&&(w.callback=f),c=vs(o,w,b),c!==null&&(en(c,o,b,_),wh(c,o,b))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var f=Wr(),_=Cs(o),b=qn(f,_);b.tag=2,c!=null&&(b.callback=c),c=vs(o,b,_),c!==null&&(en(c,o,_,f),wh(c,o,_))}};function ax(o,c,f,_,b,w,D){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(_,w,D):c.prototype&&c.prototype.isPureReactComponent?!ul(f,_)||!ul(b,w):!0}function lx(o,c,f){var _=!1,b=ys,w=c.contextType;return typeof w=="object"&&w!==null?w=Di(w):(b=ri(c)?ro:Br.current,_=c.contextTypes,w=(_=_!=null)?ra(o,b):ys),c=new c(f,w),o.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Rh,o.stateNode=c,c._reactInternals=o,_&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=w),c}function cx(o,c,f,_){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,_),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,_),c.state!==o&&Rh.enqueueReplaceState(c,c.state,null)}function fp(o,c,f,_){var b=o.stateNode;b.props=f,b.state=o.memoizedState,b.refs={},Jf(o);var w=c.contextType;typeof w=="object"&&w!==null?b.context=Di(w):(w=ri(c)?ro:Br.current,b.context=ra(o,w)),b.state=o.memoizedState,w=c.getDerivedStateFromProps,typeof w=="function"&&(dp(o,c,w,f),b.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(c=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),c!==b.state&&Rh.enqueueReplaceState(b,b.state,null),Ch(o,f,b,_),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function ha(o,c){try{var f="",_=c;do f+=ce(_),_=_.return;while(_);var b=f}catch(w){b=`
|
|
40
|
+
Error generating stack: `+w.message+`
|
|
41
|
+
`+w.stack}return{value:o,source:c,stack:b,digest:null}}function pp(o,c,f){return{value:o,source:null,stack:f??null,digest:c??null}}function gp(o,c){try{console.error(c.value)}catch(f){setTimeout(function(){throw f})}}var RM=typeof WeakMap=="function"?WeakMap:Map;function hx(o,c,f){f=qn(-1,f),f.tag=3,f.payload={element:null};var _=c.value;return f.callback=function(){Oh||(Oh=!0,Lp=_),gp(o,c)},f}function ux(o,c,f){f=qn(-1,f),f.tag=3;var _=o.type.getDerivedStateFromError;if(typeof _=="function"){var b=c.value;f.payload=function(){return _(b)},f.callback=function(){gp(o,c)}}var w=o.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(f.callback=function(){gp(o,c),typeof _!="function"&&(Ss===null?Ss=new Set([this]):Ss.add(this));var D=c.stack;this.componentDidCatch(c.value,{componentStack:D!==null?D:""})}),f}function dx(o,c,f){var _=o.pingCache;if(_===null){_=o.pingCache=new RM;var b=new Set;_.set(c,b)}else b=_.get(c),b===void 0&&(b=new Set,_.set(c,b));b.has(f)||(b.add(f),o=UM.bind(null,o,c,f),c.then(o,o))}function fx(o){do{var c;if((c=o.tag===13)&&(c=o.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return o;o=o.return}while(o!==null);return null}function px(o,c,f,_,b){return(o.mode&1)===0?(o===c?o.flags|=65536:(o.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(c=qn(-1,1),c.tag=2,vs(f,c,1))),f.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var AM=E.ReactCurrentOwner,ii=!1;function Nr(o,c,f,_){c.child=o===null?P_(c,null,f,_):oa(c,o.child,f,_)}function gx(o,c,f,_,b){f=f.render;var w=c.ref;return la(c,b),_=op(o,c,f,_,w,b),f=ap(),o!==null&&!ii?(c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~b,Un(o,c,b)):(Lt&&f&&Hf(c),c.flags|=1,Nr(o,c,_,b),c.child)}function mx(o,c,f,_,b){if(o===null){var w=f.type;return typeof w=="function"&&!jp(w)&&w.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(c.tag=15,c.type=w,yx(o,c,w,_,b)):(o=qh(f.type,null,_,c,c.mode,b),o.ref=c.ref,o.return=c,c.child=o)}if(w=o.child,(o.lanes&b)===0){var D=w.memoizedProps;if(f=f.compare,f=f!==null?f:ul,f(D,_)&&o.ref===c.ref)return Un(o,c,b)}return c.flags|=1,o=Ts(w,_),o.ref=c.ref,o.return=c,c.child=o}function yx(o,c,f,_,b){if(o!==null){var w=o.memoizedProps;if(ul(w,_)&&o.ref===c.ref)if(ii=!1,c.pendingProps=_=w,(o.lanes&b)!==0)(o.flags&131072)!==0&&(ii=!0);else return c.lanes=o.lanes,Un(o,c,b)}return mp(o,c,f,_,b)}function _x(o,c,f){var _=c.pendingProps,b=_.children,w=o!==null?o.memoizedState:null;if(_.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},St(da,_i),_i|=f;else{if((f&1073741824)===0)return o=w!==null?w.baseLanes|f:f,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:o,cachePool:null,transitions:null},c.updateQueue=null,St(da,_i),_i|=o,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},_=w!==null?w.baseLanes:f,St(da,_i),_i|=_}else w!==null?(_=w.baseLanes|f,c.memoizedState=null):_=f,St(da,_i),_i|=_;return Nr(o,c,b,f),c.child}function xx(o,c){var f=c.ref;(o===null&&f!==null||o!==null&&o.ref!==f)&&(c.flags|=512,c.flags|=2097152)}function mp(o,c,f,_,b){var w=ri(f)?ro:Br.current;return w=ra(c,w),la(c,b),f=op(o,c,f,_,w,b),_=ap(),o!==null&&!ii?(c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~b,Un(o,c,b)):(Lt&&_&&Hf(c),c.flags|=1,Nr(o,c,f,b),c.child)}function vx(o,c,f,_,b){if(ri(f)){var w=!0;gh(c)}else w=!1;if(la(c,b),c.stateNode===null)Dh(o,c),lx(c,f,_),fp(c,f,_,b),_=!0;else if(o===null){var D=c.stateNode,N=c.memoizedProps;D.props=N;var V=D.context,ne=f.contextType;typeof ne=="object"&&ne!==null?ne=Di(ne):(ne=ri(f)?ro:Br.current,ne=ra(c,ne));var fe=f.getDerivedStateFromProps,ge=typeof fe=="function"||typeof D.getSnapshotBeforeUpdate=="function";ge||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(N!==_||V!==ne)&&cx(c,D,_,ne),xs=!1;var de=c.memoizedState;D.state=de,Ch(c,_,D,b),V=c.memoizedState,N!==_||de!==V||ti.current||xs?(typeof fe=="function"&&(dp(c,f,fe,_),V=c.memoizedState),(N=xs||ax(c,f,N,_,de,V,ne))?(ge||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount()),typeof D.componentDidMount=="function"&&(c.flags|=4194308)):(typeof D.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=_,c.memoizedState=V),D.props=_,D.state=V,D.context=ne,_=N):(typeof D.componentDidMount=="function"&&(c.flags|=4194308),_=!1)}else{D=c.stateNode,$_(o,c),N=c.memoizedProps,ne=c.type===c.elementType?N:Qi(c.type,N),D.props=ne,ge=c.pendingProps,de=D.context,V=f.contextType,typeof V=="object"&&V!==null?V=Di(V):(V=ri(f)?ro:Br.current,V=ra(c,V));var we=f.getDerivedStateFromProps;(fe=typeof we=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(N!==ge||de!==V)&&cx(c,D,_,V),xs=!1,de=c.memoizedState,D.state=de,Ch(c,_,D,b);var Le=c.memoizedState;N!==ge||de!==Le||ti.current||xs?(typeof we=="function"&&(dp(c,f,we,_),Le=c.memoizedState),(ne=xs||ax(c,f,ne,_,de,Le,V)||!1)?(fe||typeof D.UNSAFE_componentWillUpdate!="function"&&typeof D.componentWillUpdate!="function"||(typeof D.componentWillUpdate=="function"&&D.componentWillUpdate(_,Le,V),typeof D.UNSAFE_componentWillUpdate=="function"&&D.UNSAFE_componentWillUpdate(_,Le,V)),typeof D.componentDidUpdate=="function"&&(c.flags|=4),typeof D.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof D.componentDidUpdate!="function"||N===o.memoizedProps&&de===o.memoizedState||(c.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&de===o.memoizedState||(c.flags|=1024),c.memoizedProps=_,c.memoizedState=Le),D.props=_,D.state=Le,D.context=V,_=ne):(typeof D.componentDidUpdate!="function"||N===o.memoizedProps&&de===o.memoizedState||(c.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&de===o.memoizedState||(c.flags|=1024),_=!1)}return yp(o,c,f,_,w,b)}function yp(o,c,f,_,b,w){xx(o,c);var D=(c.flags&128)!==0;if(!_&&!D)return b&&k_(c,f,!1),Un(o,c,w);_=c.stateNode,AM.current=c;var N=D&&typeof f.getDerivedStateFromError!="function"?null:_.render();return c.flags|=1,o!==null&&D?(c.child=oa(c,o.child,null,w),c.child=oa(c,null,N,w)):Nr(o,c,N,w),c.memoizedState=_.state,b&&k_(c,f,!0),c.child}function bx(o){var c=o.stateNode;c.pendingContext?w_(o,c.pendingContext,c.pendingContext!==c.context):c.context&&w_(o,c.context,!1),ep(o,c.containerInfo)}function Sx(o,c,f,_,b){return sa(),Gf(b),c.flags|=256,Nr(o,c,f,_),c.child}var _p={dehydrated:null,treeContext:null,retryLane:0};function xp(o){return{baseLanes:o,cachePool:null,transitions:null}}function wx(o,c,f){var _=c.pendingProps,b=Dt.current,w=!1,D=(c.flags&128)!==0,N;if((N=D)||(N=o!==null&&o.memoizedState===null?!1:(b&2)!==0),N?(w=!0,c.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),St(Dt,b&1),o===null)return Vf(c),o=c.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((c.mode&1)===0?c.lanes=1:o.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(D=_.children,o=_.fallback,w?(_=c.mode,w=c.child,D={mode:"hidden",children:D},(_&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=D):w=Uh(D,_,0,null),o=fo(o,_,f,null),w.return=c,o.return=c,w.sibling=o,c.child=w,c.child.memoizedState=xp(f),c.memoizedState=_p,o):vp(c,D));if(b=o.memoizedState,b!==null&&(N=b.dehydrated,N!==null))return DM(o,c,D,_,N,b,f);if(w){w=_.fallback,D=c.mode,b=o.child,N=b.sibling;var V={mode:"hidden",children:_.children};return(D&1)===0&&c.child!==b?(_=c.child,_.childLanes=0,_.pendingProps=V,c.deletions=null):(_=Ts(b,V),_.subtreeFlags=b.subtreeFlags&14680064),N!==null?w=Ts(N,w):(w=fo(w,D,f,null),w.flags|=2),w.return=c,_.return=c,_.sibling=w,c.child=_,_=w,w=c.child,D=o.child.memoizedState,D=D===null?xp(f):{baseLanes:D.baseLanes|f,cachePool:null,transitions:D.transitions},w.memoizedState=D,w.childLanes=o.childLanes&~f,c.memoizedState=_p,_}return w=o.child,o=w.sibling,_=Ts(w,{mode:"visible",children:_.children}),(c.mode&1)===0&&(_.lanes=f),_.return=c,_.sibling=null,o!==null&&(f=c.deletions,f===null?(c.deletions=[o],c.flags|=16):f.push(o)),c.child=_,c.memoizedState=null,_}function vp(o,c){return c=Uh({mode:"visible",children:c},o.mode,0,null),c.return=o,o.child=c}function Ah(o,c,f,_){return _!==null&&Gf(_),oa(c,o.child,null,f),o=vp(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function DM(o,c,f,_,b,w,D){if(f)return c.flags&256?(c.flags&=-257,_=pp(Error(r(422))),Ah(o,c,D,_)):c.memoizedState!==null?(c.child=o.child,c.flags|=128,null):(w=_.fallback,b=c.mode,_=Uh({mode:"visible",children:_.children},b,0,null),w=fo(w,b,D,null),w.flags|=2,_.return=c,w.return=c,_.sibling=w,c.child=_,(c.mode&1)!==0&&oa(c,o.child,null,D),c.child.memoizedState=xp(D),c.memoizedState=_p,w);if((c.mode&1)===0)return Ah(o,c,D,null);if(b.data==="$!"){if(_=b.nextSibling&&b.nextSibling.dataset,_)var N=_.dgst;return _=N,w=Error(r(419)),_=pp(w,_,void 0),Ah(o,c,D,_)}if(N=(D&o.childLanes)!==0,ii||N){if(_=ur,_!==null){switch(D&-D){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(_.suspendedLanes|D))!==0?0:b,b!==0&&b!==w.retryLane&&(w.retryLane=b,Hn(o,b),en(_,o,b,-1))}return $p(),_=pp(Error(r(421))),Ah(o,c,D,_)}return b.data==="$?"?(c.flags|=128,c.child=o.child,c=VM.bind(null,o),b._reactRetry=c,null):(o=w.treeContext,yi=gs(b.nextSibling),mi=c,Lt=!0,Xi=null,o!==null&&(Ri[Ai++]=Nn,Ri[Ai++]=Wn,Ri[Ai++]=io,Nn=o.id,Wn=o.overflow,io=c),c=vp(c,_.children),c.flags|=4096,c)}function Cx(o,c,f){o.lanes|=c;var _=o.alternate;_!==null&&(_.lanes|=c),Qf(o.return,c,f)}function bp(o,c,f,_,b){var w=o.memoizedState;w===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:_,tail:f,tailMode:b}:(w.isBackwards=c,w.rendering=null,w.renderingStartTime=0,w.last=_,w.tail=f,w.tailMode=b)}function kx(o,c,f){var _=c.pendingProps,b=_.revealOrder,w=_.tail;if(Nr(o,c,_.children,f),_=Dt.current,(_&2)!==0)_=_&1|2,c.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Cx(o,f,c);else if(o.tag===19)Cx(o,f,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}_&=1}if(St(Dt,_),(c.mode&1)===0)c.memoizedState=null;else switch(b){case"forwards":for(f=c.child,b=null;f!==null;)o=f.alternate,o!==null&&kh(o)===null&&(b=f),f=f.sibling;f=b,f===null?(b=c.child,c.child=null):(b=f.sibling,f.sibling=null),bp(c,!1,b,f,w);break;case"backwards":for(f=null,b=c.child,c.child=null;b!==null;){if(o=b.alternate,o!==null&&kh(o)===null){c.child=b;break}o=b.sibling,b.sibling=f,f=b,b=o}bp(c,!0,f,null,w);break;case"together":bp(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Dh(o,c){(c.mode&1)===0&&o!==null&&(o.alternate=null,c.alternate=null,c.flags|=2)}function Un(o,c,f){if(o!==null&&(c.dependencies=o.dependencies),lo|=c.lanes,(f&c.childLanes)===0)return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,f=Ts(o,o.pendingProps),c.child=f,f.return=c;o.sibling!==null;)o=o.sibling,f=f.sibling=Ts(o,o.pendingProps),f.return=c;f.sibling=null}return c.child}function PM(o,c,f){switch(c.tag){case 3:bx(c),sa();break;case 5:z_(c);break;case 1:ri(c.type)&&gh(c);break;case 4:ep(c,c.stateNode.containerInfo);break;case 10:var _=c.type._context,b=c.memoizedProps.value;St(bh,_._currentValue),_._currentValue=b;break;case 13:if(_=c.memoizedState,_!==null)return _.dehydrated!==null?(St(Dt,Dt.current&1),c.flags|=128,null):(f&c.child.childLanes)!==0?wx(o,c,f):(St(Dt,Dt.current&1),o=Un(o,c,f),o!==null?o.sibling:null);St(Dt,Dt.current&1);break;case 19:if(_=(f&c.childLanes)!==0,(o.flags&128)!==0){if(_)return kx(o,c,f);c.flags|=128}if(b=c.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),St(Dt,Dt.current),_)break;return null;case 22:case 23:return c.lanes=0,_x(o,c,f)}return Un(o,c,f)}var Tx,Sp,Ex,Bx;Tx=function(o,c){for(var f=c.child;f!==null;){if(f.tag===5||f.tag===6)o.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Sp=function(){},Ex=function(o,c,f,_){var b=o.memoizedProps;if(b!==_){o=c.stateNode,oo(mn.current);var w=null;switch(f){case"input":b=pt(o,b),_=pt(o,_),w=[];break;case"select":b=ee({},b,{value:void 0}),_=ee({},_,{value:void 0}),w=[];break;case"textarea":b=ki(o,b),_=ki(o,_),w=[];break;default:typeof b.onClick!="function"&&typeof _.onClick=="function"&&(o.onclick=dh)}ei(f,_);var D;f=null;for(ne in b)if(!_.hasOwnProperty(ne)&&b.hasOwnProperty(ne)&&b[ne]!=null)if(ne==="style"){var N=b[ne];for(D in N)N.hasOwnProperty(D)&&(f||(f={}),f[D]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(n.hasOwnProperty(ne)?w||(w=[]):(w=w||[]).push(ne,null));for(ne in _){var V=_[ne];if(N=b!=null?b[ne]:void 0,_.hasOwnProperty(ne)&&V!==N&&(V!=null||N!=null))if(ne==="style")if(N){for(D in N)!N.hasOwnProperty(D)||V&&V.hasOwnProperty(D)||(f||(f={}),f[D]="");for(D in V)V.hasOwnProperty(D)&&N[D]!==V[D]&&(f||(f={}),f[D]=V[D])}else f||(w||(w=[]),w.push(ne,f)),f=V;else ne==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,N=N?N.__html:void 0,V!=null&&N!==V&&(w=w||[]).push(ne,V)):ne==="children"?typeof V!="string"&&typeof V!="number"||(w=w||[]).push(ne,""+V):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(n.hasOwnProperty(ne)?(V!=null&&ne==="onScroll"&&Ct("scroll",o),w||N===V||(w=[])):(w=w||[]).push(ne,V))}f&&(w=w||[]).push("style",f);var ne=w;(c.updateQueue=ne)&&(c.flags|=4)}},Bx=function(o,c,f,_){f!==_&&(c.flags|=4)};function Tl(o,c){if(!Lt)switch(o.tailMode){case"hidden":c=o.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var _=null;f!==null;)f.alternate!==null&&(_=f),f=f.sibling;_===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:_.sibling=null}}function Lr(o){var c=o.alternate!==null&&o.alternate.child===o.child,f=0,_=0;if(c)for(var b=o.child;b!==null;)f|=b.lanes|b.childLanes,_|=b.subtreeFlags&14680064,_|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)f|=b.lanes|b.childLanes,_|=b.subtreeFlags,_|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=_,o.childLanes=f,c}function IM(o,c,f){var _=c.pendingProps;switch(qf(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lr(c),null;case 1:return ri(c.type)&&ph(),Lr(c),null;case 3:return _=c.stateNode,ca(),kt(ti),kt(Br),ip(),_.pendingContext&&(_.context=_.pendingContext,_.pendingContext=null),(o===null||o.child===null)&&(xh(c)?c.flags|=4:o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Xi!==null&&(Dp(Xi),Xi=null))),Sp(o,c),Lr(c),null;case 5:tp(c);var b=oo(bl.current);if(f=c.type,o!==null&&c.stateNode!=null)Ex(o,c,f,_,b),o.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!_){if(c.stateNode===null)throw Error(r(166));return Lr(c),null}if(o=oo(mn.current),xh(c)){_=c.stateNode,f=c.type;var w=c.memoizedProps;switch(_[gn]=c,_[ml]=w,o=(c.mode&1)!==0,f){case"dialog":Ct("cancel",_),Ct("close",_);break;case"iframe":case"object":case"embed":Ct("load",_);break;case"video":case"audio":for(b=0;b<fl.length;b++)Ct(fl[b],_);break;case"source":Ct("error",_);break;case"img":case"image":case"link":Ct("error",_),Ct("load",_);break;case"details":Ct("toggle",_);break;case"input":dt(_,w),Ct("invalid",_);break;case"select":_._wrapperState={wasMultiple:!!w.multiple},Ct("invalid",_);break;case"textarea":Xs(_,w),Ct("invalid",_)}ei(f,w),b=null;for(var D in w)if(w.hasOwnProperty(D)){var N=w[D];D==="children"?typeof N=="string"?_.textContent!==N&&(w.suppressHydrationWarning!==!0&&uh(_.textContent,N,o),b=["children",N]):typeof N=="number"&&_.textContent!==""+N&&(w.suppressHydrationWarning!==!0&&uh(_.textContent,N,o),b=["children",""+N]):n.hasOwnProperty(D)&&N!=null&&D==="onScroll"&&Ct("scroll",_)}switch(f){case"input":Ke(_),ut(_,w,!0);break;case"textarea":Ke(_),hn(_);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(_.onclick=dh)}_=b,c.updateQueue=_,_!==null&&(c.flags|=4)}else{D=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=Ui(f)),o==="http://www.w3.org/1999/xhtml"?f==="script"?(o=D.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof _.is=="string"?o=D.createElement(f,{is:_.is}):(o=D.createElement(f),f==="select"&&(D=o,_.multiple?D.multiple=!0:_.size&&(D.size=_.size))):o=D.createElementNS(o,f),o[gn]=c,o[ml]=_,Tx(o,c,!1,!1),c.stateNode=o;e:{switch(D=Ei(f,_),f){case"dialog":Ct("cancel",o),Ct("close",o),b=_;break;case"iframe":case"object":case"embed":Ct("load",o),b=_;break;case"video":case"audio":for(b=0;b<fl.length;b++)Ct(fl[b],o);b=_;break;case"source":Ct("error",o),b=_;break;case"img":case"image":case"link":Ct("error",o),Ct("load",o),b=_;break;case"details":Ct("toggle",o),b=_;break;case"input":dt(o,_),b=pt(o,_),Ct("invalid",o);break;case"option":b=_;break;case"select":o._wrapperState={wasMultiple:!!_.multiple},b=ee({},_,{value:void 0}),Ct("invalid",o);break;case"textarea":Xs(o,_),b=ki(o,_),Ct("invalid",o);break;default:b=_}ei(f,b),N=b;for(w in N)if(N.hasOwnProperty(w)){var V=N[w];w==="style"?$n(o,V):w==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&Qs(o,V)):w==="children"?typeof V=="string"?(f!=="textarea"||V!=="")&&un(o,V):typeof V=="number"&&un(o,""+V):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(n.hasOwnProperty(w)?V!=null&&w==="onScroll"&&Ct("scroll",o):V!=null&&R(o,w,V,D))}switch(f){case"input":Ke(o),ut(o,_,!1);break;case"textarea":Ke(o),hn(o);break;case"option":_.value!=null&&o.setAttribute("value",""+ve(_.value));break;case"select":o.multiple=!!_.multiple,w=_.value,w!=null?kr(o,!!_.multiple,w,!1):_.defaultValue!=null&&kr(o,!!_.multiple,_.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=dh)}switch(f){case"button":case"input":case"select":case"textarea":_=!!_.autoFocus;break e;case"img":_=!0;break e;default:_=!1}}_&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Lr(c),null;case 6:if(o&&c.stateNode!=null)Bx(o,c,o.memoizedProps,_);else{if(typeof _!="string"&&c.stateNode===null)throw Error(r(166));if(f=oo(bl.current),oo(mn.current),xh(c)){if(_=c.stateNode,f=c.memoizedProps,_[gn]=c,(w=_.nodeValue!==f)&&(o=mi,o!==null))switch(o.tag){case 3:uh(_.nodeValue,f,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&uh(_.nodeValue,f,(o.mode&1)!==0)}w&&(c.flags|=4)}else _=(f.nodeType===9?f:f.ownerDocument).createTextNode(_),_[gn]=c,c.stateNode=_}return Lr(c),null;case 13:if(kt(Dt),_=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Lt&&yi!==null&&(c.mode&1)!==0&&(c.flags&128)===0)R_(),sa(),c.flags|=98560,w=!1;else if(w=xh(c),_!==null&&_.dehydrated!==null){if(o===null){if(!w)throw Error(r(318));if(w=c.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[gn]=c}else sa(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Lr(c),w=!1}else Xi!==null&&(Dp(Xi),Xi=null),w=!0;if(!w)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=f,c):(_=_!==null,_!==(o!==null&&o.memoizedState!==null)&&_&&(c.child.flags|=8192,(c.mode&1)!==0&&(o===null||(Dt.current&1)!==0?tr===0&&(tr=3):$p())),c.updateQueue!==null&&(c.flags|=4),Lr(c),null);case 4:return ca(),Sp(o,c),o===null&&pl(c.stateNode.containerInfo),Lr(c),null;case 10:return Xf(c.type._context),Lr(c),null;case 17:return ri(c.type)&&ph(),Lr(c),null;case 19:if(kt(Dt),w=c.memoizedState,w===null)return Lr(c),null;if(_=(c.flags&128)!==0,D=w.rendering,D===null)if(_)Tl(w,!1);else{if(tr!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(D=kh(o),D!==null){for(c.flags|=128,Tl(w,!1),_=D.updateQueue,_!==null&&(c.updateQueue=_,c.flags|=4),c.subtreeFlags=0,_=f,f=c.child;f!==null;)w=f,o=_,w.flags&=14680066,D=w.alternate,D===null?(w.childLanes=0,w.lanes=o,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=D.childLanes,w.lanes=D.lanes,w.child=D.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=D.memoizedProps,w.memoizedState=D.memoizedState,w.updateQueue=D.updateQueue,w.type=D.type,o=D.dependencies,w.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),f=f.sibling;return St(Dt,Dt.current&1|2),c.child}o=o.sibling}w.tail!==null&&Ze()>fa&&(c.flags|=128,_=!0,Tl(w,!1),c.lanes=4194304)}else{if(!_)if(o=kh(D),o!==null){if(c.flags|=128,_=!0,f=o.updateQueue,f!==null&&(c.updateQueue=f,c.flags|=4),Tl(w,!0),w.tail===null&&w.tailMode==="hidden"&&!D.alternate&&!Lt)return Lr(c),null}else 2*Ze()-w.renderingStartTime>fa&&f!==1073741824&&(c.flags|=128,_=!0,Tl(w,!1),c.lanes=4194304);w.isBackwards?(D.sibling=c.child,c.child=D):(f=w.last,f!==null?f.sibling=D:c.child=D,w.last=D)}return w.tail!==null?(c=w.tail,w.rendering=c,w.tail=c.sibling,w.renderingStartTime=Ze(),c.sibling=null,f=Dt.current,St(Dt,_?f&1|2:f&1),c):(Lr(c),null);case 22:case 23:return Ip(),_=c.memoizedState!==null,o!==null&&o.memoizedState!==null!==_&&(c.flags|=8192),_&&(c.mode&1)!==0?(_i&1073741824)!==0&&(Lr(c),c.subtreeFlags&6&&(c.flags|=8192)):Lr(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function $M(o,c){switch(qf(c),c.tag){case 1:return ri(c.type)&&ph(),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return ca(),kt(ti),kt(Br),ip(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 5:return tp(c),null;case 13:if(kt(Dt),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));sa()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return kt(Dt),null;case 4:return ca(),null;case 10:return Xf(c.type._context),null;case 22:case 23:return Ip(),null;case 24:return null;default:return null}}var Ph=!1,Rr=!1,jM=typeof WeakSet=="function"?WeakSet:Set,Te=null;function ua(o,c){var f=o.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(_){Ot(o,c,_)}else f.current=null}function wp(o,c,f){try{f()}catch(_){Ot(o,c,_)}}var Mx=!1;function OM(o,c){if(If=eh,o=a_(),Ef(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var _=f.getSelection&&f.getSelection();if(_&&_.rangeCount!==0){f=_.anchorNode;var b=_.anchorOffset,w=_.focusNode;_=_.focusOffset;try{f.nodeType,w.nodeType}catch{f=null;break e}var D=0,N=-1,V=-1,ne=0,fe=0,ge=o,de=null;t:for(;;){for(var we;ge!==f||b!==0&&ge.nodeType!==3||(N=D+b),ge!==w||_!==0&&ge.nodeType!==3||(V=D+_),ge.nodeType===3&&(D+=ge.nodeValue.length),(we=ge.firstChild)!==null;)de=ge,ge=we;for(;;){if(ge===o)break t;if(de===f&&++ne===b&&(N=D),de===w&&++fe===_&&(V=D),(we=ge.nextSibling)!==null)break;ge=de,de=ge.parentNode}ge=we}f=N===-1||V===-1?null:{start:N,end:V}}else f=null}f=f||{start:0,end:0}}else f=null;for($f={focusedElem:o,selectionRange:f},eh=!1,Te=c;Te!==null;)if(c=Te,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,Te=o;else for(;Te!==null;){c=Te;try{var Le=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Le!==null){var Ie=Le.memoizedProps,Ht=Le.memoizedState,re=c.stateNode,K=re.getSnapshotBeforeUpdate(c.elementType===c.type?Ie:Qi(c.type,Ie),Ht);re.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var ie=c.stateNode.containerInfo;ie.nodeType===1?ie.textContent="":ie.nodeType===9&&ie.documentElement&&ie.removeChild(ie.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(me){Ot(c,c.return,me)}if(o=c.sibling,o!==null){o.return=c.return,Te=o;break}Te=c.return}return Le=Mx,Mx=!1,Le}function El(o,c,f){var _=c.updateQueue;if(_=_!==null?_.lastEffect:null,_!==null){var b=_=_.next;do{if((b.tag&o)===o){var w=b.destroy;b.destroy=void 0,w!==void 0&&wp(c,f,w)}b=b.next}while(b!==_)}}function Ih(o,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&o)===o){var _=f.create;f.destroy=_()}f=f.next}while(f!==c)}}function Cp(o){var c=o.ref;if(c!==null){var f=o.stateNode;switch(o.tag){case 5:o=f;break;default:o=f}typeof c=="function"?c(o):c.current=o}}function Lx(o){var c=o.alternate;c!==null&&(o.alternate=null,Lx(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&(delete c[gn],delete c[ml],delete c[Ff],delete c[vM],delete c[bM])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Rx(o){return o.tag===5||o.tag===3||o.tag===4}function Ax(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Rx(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function kp(o,c,f){var _=o.tag;if(_===5||_===6)o=o.stateNode,c?f.nodeType===8?f.parentNode.insertBefore(o,c):f.insertBefore(o,c):(f.nodeType===8?(c=f.parentNode,c.insertBefore(o,f)):(c=f,c.appendChild(o)),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=dh));else if(_!==4&&(o=o.child,o!==null))for(kp(o,c,f),o=o.sibling;o!==null;)kp(o,c,f),o=o.sibling}function Tp(o,c,f){var _=o.tag;if(_===5||_===6)o=o.stateNode,c?f.insertBefore(o,c):f.appendChild(o);else if(_!==4&&(o=o.child,o!==null))for(Tp(o,c,f),o=o.sibling;o!==null;)Tp(o,c,f),o=o.sibling}var xr=null,Zi=!1;function bs(o,c,f){for(f=f.child;f!==null;)Dx(o,c,f),f=f.sibling}function Dx(o,c,f){if(pi&&typeof pi.onCommitFiberUnmount=="function")try{pi.onCommitFiberUnmount(eo,f)}catch{}switch(f.tag){case 5:Rr||ua(f,c);case 6:var _=xr,b=Zi;xr=null,bs(o,c,f),xr=_,Zi=b,xr!==null&&(Zi?(o=xr,f=f.stateNode,o.nodeType===8?o.parentNode.removeChild(f):o.removeChild(f)):xr.removeChild(f.stateNode));break;case 18:xr!==null&&(Zi?(o=xr,f=f.stateNode,o.nodeType===8?zf(o.parentNode,f):o.nodeType===1&&zf(o,f),sl(o)):zf(xr,f.stateNode));break;case 4:_=xr,b=Zi,xr=f.stateNode.containerInfo,Zi=!0,bs(o,c,f),xr=_,Zi=b;break;case 0:case 11:case 14:case 15:if(!Rr&&(_=f.updateQueue,_!==null&&(_=_.lastEffect,_!==null))){b=_=_.next;do{var w=b,D=w.destroy;w=w.tag,D!==void 0&&((w&2)!==0||(w&4)!==0)&&wp(f,c,D),b=b.next}while(b!==_)}bs(o,c,f);break;case 1:if(!Rr&&(ua(f,c),_=f.stateNode,typeof _.componentWillUnmount=="function"))try{_.props=f.memoizedProps,_.state=f.memoizedState,_.componentWillUnmount()}catch(N){Ot(f,c,N)}bs(o,c,f);break;case 21:bs(o,c,f);break;case 22:f.mode&1?(Rr=(_=Rr)||f.memoizedState!==null,bs(o,c,f),Rr=_):bs(o,c,f);break;default:bs(o,c,f)}}function Px(o){var c=o.updateQueue;if(c!==null){o.updateQueue=null;var f=o.stateNode;f===null&&(f=o.stateNode=new jM),c.forEach(function(_){var b=GM.bind(null,o,_);f.has(_)||(f.add(_),_.then(b,b))})}}function Ji(o,c){var f=c.deletions;if(f!==null)for(var _=0;_<f.length;_++){var b=f[_];try{var w=o,D=c,N=D;e:for(;N!==null;){switch(N.tag){case 5:xr=N.stateNode,Zi=!1;break e;case 3:xr=N.stateNode.containerInfo,Zi=!0;break e;case 4:xr=N.stateNode.containerInfo,Zi=!0;break e}N=N.return}if(xr===null)throw Error(r(160));Dx(w,D,b),xr=null,Zi=!1;var V=b.alternate;V!==null&&(V.return=null),b.return=null}catch(ne){Ot(b,c,ne)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Ix(c,o),c=c.sibling}function Ix(o,c){var f=o.alternate,_=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Ji(c,o),_n(o),_&4){try{El(3,o,o.return),Ih(3,o)}catch(Ie){Ot(o,o.return,Ie)}try{El(5,o,o.return)}catch(Ie){Ot(o,o.return,Ie)}}break;case 1:Ji(c,o),_n(o),_&512&&f!==null&&ua(f,f.return);break;case 5:if(Ji(c,o),_n(o),_&512&&f!==null&&ua(f,f.return),o.flags&32){var b=o.stateNode;try{un(b,"")}catch(Ie){Ot(o,o.return,Ie)}}if(_&4&&(b=o.stateNode,b!=null)){var w=o.memoizedProps,D=f!==null?f.memoizedProps:w,N=o.type,V=o.updateQueue;if(o.updateQueue=null,V!==null)try{N==="input"&&w.type==="radio"&&w.name!=null&&ae(b,w),Ei(N,D);var ne=Ei(N,w);for(D=0;D<V.length;D+=2){var fe=V[D],ge=V[D+1];fe==="style"?$n(b,ge):fe==="dangerouslySetInnerHTML"?Qs(b,ge):fe==="children"?un(b,ge):R(b,fe,ge,ne)}switch(N){case"input":ht(b,w);break;case"textarea":Mt(b,w);break;case"select":var de=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!w.multiple;var we=w.value;we!=null?kr(b,!!w.multiple,we,!1):de!==!!w.multiple&&(w.defaultValue!=null?kr(b,!!w.multiple,w.defaultValue,!0):kr(b,!!w.multiple,w.multiple?[]:"",!1))}b[ml]=w}catch(Ie){Ot(o,o.return,Ie)}}break;case 6:if(Ji(c,o),_n(o),_&4){if(o.stateNode===null)throw Error(r(162));b=o.stateNode,w=o.memoizedProps;try{b.nodeValue=w}catch(Ie){Ot(o,o.return,Ie)}}break;case 3:if(Ji(c,o),_n(o),_&4&&f!==null&&f.memoizedState.isDehydrated)try{sl(c.containerInfo)}catch(Ie){Ot(o,o.return,Ie)}break;case 4:Ji(c,o),_n(o);break;case 13:Ji(c,o),_n(o),b=o.child,b.flags&8192&&(w=b.memoizedState!==null,b.stateNode.isHidden=w,!w||b.alternate!==null&&b.alternate.memoizedState!==null||(Mp=Ze())),_&4&&Px(o);break;case 22:if(fe=f!==null&&f.memoizedState!==null,o.mode&1?(Rr=(ne=Rr)||fe,Ji(c,o),Rr=ne):Ji(c,o),_n(o),_&8192){if(ne=o.memoizedState!==null,(o.stateNode.isHidden=ne)&&!fe&&(o.mode&1)!==0)for(Te=o,fe=o.child;fe!==null;){for(ge=Te=fe;Te!==null;){switch(de=Te,we=de.child,de.tag){case 0:case 11:case 14:case 15:El(4,de,de.return);break;case 1:ua(de,de.return);var Le=de.stateNode;if(typeof Le.componentWillUnmount=="function"){_=de,f=de.return;try{c=_,Le.props=c.memoizedProps,Le.state=c.memoizedState,Le.componentWillUnmount()}catch(Ie){Ot(_,f,Ie)}}break;case 5:ua(de,de.return);break;case 22:if(de.memoizedState!==null){Ox(ge);continue}}we!==null?(we.return=de,Te=we):Ox(ge)}fe=fe.sibling}e:for(fe=null,ge=o;;){if(ge.tag===5){if(fe===null){fe=ge;try{b=ge.stateNode,ne?(w=b.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(N=ge.stateNode,V=ge.memoizedProps.style,D=V!=null&&V.hasOwnProperty("display")?V.display:null,N.style.display=In("display",D))}catch(Ie){Ot(o,o.return,Ie)}}}else if(ge.tag===6){if(fe===null)try{ge.stateNode.nodeValue=ne?"":ge.memoizedProps}catch(Ie){Ot(o,o.return,Ie)}}else if((ge.tag!==22&&ge.tag!==23||ge.memoizedState===null||ge===o)&&ge.child!==null){ge.child.return=ge,ge=ge.child;continue}if(ge===o)break e;for(;ge.sibling===null;){if(ge.return===null||ge.return===o)break e;fe===ge&&(fe=null),ge=ge.return}fe===ge&&(fe=null),ge.sibling.return=ge.return,ge=ge.sibling}}break;case 19:Ji(c,o),_n(o),_&4&&Px(o);break;case 21:break;default:Ji(c,o),_n(o)}}function _n(o){var c=o.flags;if(c&2){try{e:{for(var f=o.return;f!==null;){if(Rx(f)){var _=f;break e}f=f.return}throw Error(r(160))}switch(_.tag){case 5:var b=_.stateNode;_.flags&32&&(un(b,""),_.flags&=-33);var w=Ax(o);Tp(o,w,b);break;case 3:case 4:var D=_.stateNode.containerInfo,N=Ax(o);kp(o,N,D);break;default:throw Error(r(161))}}catch(V){Ot(o,o.return,V)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function zM(o,c,f){Te=o,$x(o)}function $x(o,c,f){for(var _=(o.mode&1)!==0;Te!==null;){var b=Te,w=b.child;if(b.tag===22&&_){var D=b.memoizedState!==null||Ph;if(!D){var N=b.alternate,V=N!==null&&N.memoizedState!==null||Rr;N=Ph;var ne=Rr;if(Ph=D,(Rr=V)&&!ne)for(Te=b;Te!==null;)D=Te,V=D.child,D.tag===22&&D.memoizedState!==null?zx(b):V!==null?(V.return=D,Te=V):zx(b);for(;w!==null;)Te=w,$x(w),w=w.sibling;Te=b,Ph=N,Rr=ne}jx(o)}else(b.subtreeFlags&8772)!==0&&w!==null?(w.return=b,Te=w):jx(o)}}function jx(o){for(;Te!==null;){var c=Te;if((c.flags&8772)!==0){var f=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Rr||Ih(5,c);break;case 1:var _=c.stateNode;if(c.flags&4&&!Rr)if(f===null)_.componentDidMount();else{var b=c.elementType===c.type?f.memoizedProps:Qi(c.type,f.memoizedProps);_.componentDidUpdate(b,f.memoizedState,_.__reactInternalSnapshotBeforeUpdate)}var w=c.updateQueue;w!==null&&O_(c,w,_);break;case 3:var D=c.updateQueue;if(D!==null){if(f=null,c.child!==null)switch(c.child.tag){case 5:f=c.child.stateNode;break;case 1:f=c.child.stateNode}O_(c,D,f)}break;case 5:var N=c.stateNode;if(f===null&&c.flags&4){f=N;var V=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&f.focus();break;case"img":V.src&&(f.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ne=c.alternate;if(ne!==null){var fe=ne.memoizedState;if(fe!==null){var ge=fe.dehydrated;ge!==null&&sl(ge)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Rr||c.flags&512&&Cp(c)}catch(de){Ot(c,c.return,de)}}if(c===o){Te=null;break}if(f=c.sibling,f!==null){f.return=c.return,Te=f;break}Te=c.return}}function Ox(o){for(;Te!==null;){var c=Te;if(c===o){Te=null;break}var f=c.sibling;if(f!==null){f.return=c.return,Te=f;break}Te=c.return}}function zx(o){for(;Te!==null;){var c=Te;try{switch(c.tag){case 0:case 11:case 15:var f=c.return;try{Ih(4,c)}catch(V){Ot(c,f,V)}break;case 1:var _=c.stateNode;if(typeof _.componentDidMount=="function"){var b=c.return;try{_.componentDidMount()}catch(V){Ot(c,b,V)}}var w=c.return;try{Cp(c)}catch(V){Ot(c,w,V)}break;case 5:var D=c.return;try{Cp(c)}catch(V){Ot(c,D,V)}}}catch(V){Ot(c,c.return,V)}if(c===o){Te=null;break}var N=c.sibling;if(N!==null){N.return=c.return,Te=N;break}Te=c.return}}var FM=Math.ceil,$h=E.ReactCurrentDispatcher,Ep=E.ReactCurrentOwner,Ii=E.ReactCurrentBatchConfig,nt=0,ur=null,Kt=null,vr=0,_i=0,da=ms(0),tr=0,Bl=null,lo=0,jh=0,Bp=0,Ml=null,ni=null,Mp=0,fa=1/0,Vn=null,Oh=!1,Lp=null,Ss=null,zh=!1,ws=null,Fh=0,Ll=0,Rp=null,Nh=-1,Wh=0;function Wr(){return(nt&6)!==0?Ze():Nh!==-1?Nh:Nh=Ze()}function Cs(o){return(o.mode&1)===0?1:(nt&2)!==0&&vr!==0?vr&-vr:wM.transition!==null?(Wh===0&&(Wh=A0()),Wh):(o=gt,o!==0||(o=window.event,o=o===void 0?16:N0(o.type)),o)}function en(o,c,f,_){if(50<Ll)throw Ll=0,Rp=null,Error(r(185));el(o,f,_),((nt&2)===0||o!==ur)&&(o===ur&&((nt&2)===0&&(jh|=f),tr===4&&ks(o,vr)),si(o,_),f===1&&nt===0&&(c.mode&1)===0&&(fa=Ze()+500,mh&&_s()))}function si(o,c){var f=o.callbackNode;wB(o,c);var _=Qc(o,o===ur?vr:0);if(_===0)f!==null&&pe(f),o.callbackNode=null,o.callbackPriority=0;else if(c=_&-_,o.callbackPriority!==c){if(f!=null&&pe(f),c===1)o.tag===0?SM(Nx.bind(null,o)):T_(Nx.bind(null,o)),_M(function(){(nt&6)===0&&_s()}),f=null;else{switch(D0(_)){case 1:f=cr;break;case 4:f=Li;break;case 16:f=Gi;break;case 536870912:f=Yt;break;default:f=Gi}f=Kx(f,Fx.bind(null,o))}o.callbackPriority=c,o.callbackNode=f}}function Fx(o,c){if(Nh=-1,Wh=0,(nt&6)!==0)throw Error(r(327));var f=o.callbackNode;if(pa()&&o.callbackNode!==f)return null;var _=Qc(o,o===ur?vr:0);if(_===0)return null;if((_&30)!==0||(_&o.expiredLanes)!==0||c)c=Hh(o,_);else{c=_;var b=nt;nt|=2;var w=Hx();(ur!==o||vr!==c)&&(Vn=null,fa=Ze()+500,ho(o,c));do try{HM();break}catch(N){Wx(o,N)}while(!0);Kf(),$h.current=w,nt=b,Kt!==null?c=0:(ur=null,vr=0,c=tr)}if(c!==0){if(c===2&&(b=uf(o),b!==0&&(_=b,c=Ap(o,b))),c===1)throw f=Bl,ho(o,0),ks(o,_),si(o,Ze()),f;if(c===6)ks(o,_);else{if(b=o.current.alternate,(_&30)===0&&!NM(b)&&(c=Hh(o,_),c===2&&(w=uf(o),w!==0&&(_=w,c=Ap(o,w))),c===1))throw f=Bl,ho(o,0),ks(o,_),si(o,Ze()),f;switch(o.finishedWork=b,o.finishedLanes=_,c){case 0:case 1:throw Error(r(345));case 2:uo(o,ni,Vn);break;case 3:if(ks(o,_),(_&130023424)===_&&(c=Mp+500-Ze(),10<c)){if(Qc(o,0)!==0)break;if(b=o.suspendedLanes,(b&_)!==_){Wr(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=Of(uo.bind(null,o,ni,Vn),c);break}uo(o,ni,Vn);break;case 4:if(ks(o,_),(_&4194240)===_)break;for(c=o.eventTimes,b=-1;0<_;){var D=31-Yi(_);w=1<<D,D=c[D],D>b&&(b=D),_&=~w}if(_=b,_=Ze()-_,_=(120>_?120:480>_?480:1080>_?1080:1920>_?1920:3e3>_?3e3:4320>_?4320:1960*FM(_/1960))-_,10<_){o.timeoutHandle=Of(uo.bind(null,o,ni,Vn),_);break}uo(o,ni,Vn);break;case 5:uo(o,ni,Vn);break;default:throw Error(r(329))}}}return si(o,Ze()),o.callbackNode===f?Fx.bind(null,o):null}function Ap(o,c){var f=Ml;return o.current.memoizedState.isDehydrated&&(ho(o,c).flags|=256),o=Hh(o,c),o!==2&&(c=ni,ni=f,c!==null&&Dp(c)),o}function Dp(o){ni===null?ni=o:ni.push.apply(ni,o)}function NM(o){for(var c=o;;){if(c.flags&16384){var f=c.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var _=0;_<f.length;_++){var b=f[_],w=b.getSnapshot;b=b.value;try{if(!Ki(w(),b))return!1}catch{return!1}}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ks(o,c){for(c&=~Bp,c&=~jh,o.suspendedLanes|=c,o.pingedLanes&=~c,o=o.expirationTimes;0<c;){var f=31-Yi(c),_=1<<f;o[f]=-1,c&=~_}}function Nx(o){if((nt&6)!==0)throw Error(r(327));pa();var c=Qc(o,0);if((c&1)===0)return si(o,Ze()),null;var f=Hh(o,c);if(o.tag!==0&&f===2){var _=uf(o);_!==0&&(c=_,f=Ap(o,_))}if(f===1)throw f=Bl,ho(o,0),ks(o,c),si(o,Ze()),f;if(f===6)throw Error(r(345));return o.finishedWork=o.current.alternate,o.finishedLanes=c,uo(o,ni,Vn),si(o,Ze()),null}function Pp(o,c){var f=nt;nt|=1;try{return o(c)}finally{nt=f,nt===0&&(fa=Ze()+500,mh&&_s())}}function co(o){ws!==null&&ws.tag===0&&(nt&6)===0&&pa();var c=nt;nt|=1;var f=Ii.transition,_=gt;try{if(Ii.transition=null,gt=1,o)return o()}finally{gt=_,Ii.transition=f,nt=c,(nt&6)===0&&_s()}}function Ip(){_i=da.current,kt(da)}function ho(o,c){o.finishedWork=null,o.finishedLanes=0;var f=o.timeoutHandle;if(f!==-1&&(o.timeoutHandle=-1,yM(f)),Kt!==null)for(f=Kt.return;f!==null;){var _=f;switch(qf(_),_.tag){case 1:_=_.type.childContextTypes,_!=null&&ph();break;case 3:ca(),kt(ti),kt(Br),ip();break;case 5:tp(_);break;case 4:ca();break;case 13:kt(Dt);break;case 19:kt(Dt);break;case 10:Xf(_.type._context);break;case 22:case 23:Ip()}f=f.return}if(ur=o,Kt=o=Ts(o.current,null),vr=_i=c,tr=0,Bl=null,Bp=jh=lo=0,ni=Ml=null,so!==null){for(c=0;c<so.length;c++)if(f=so[c],_=f.interleaved,_!==null){f.interleaved=null;var b=_.next,w=f.pending;if(w!==null){var D=w.next;w.next=b,_.next=D}f.pending=_}so=null}return o}function Wx(o,c){do{var f=Kt;try{if(Kf(),Th.current=Lh,Eh){for(var _=Pt.memoizedState;_!==null;){var b=_.queue;b!==null&&(b.pending=null),_=_.next}Eh=!1}if(ao=0,hr=er=Pt=null,Sl=!1,wl=0,Ep.current=null,f===null||f.return===null){tr=1,Bl=c,Kt=null;break}e:{var w=o,D=f.return,N=f,V=c;if(c=vr,N.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var ne=V,fe=N,ge=fe.tag;if((fe.mode&1)===0&&(ge===0||ge===11||ge===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var we=fx(D);if(we!==null){we.flags&=-257,px(we,D,N,w,c),we.mode&1&&dx(w,ne,c),c=we,V=ne;var Le=c.updateQueue;if(Le===null){var Ie=new Set;Ie.add(V),c.updateQueue=Ie}else Le.add(V);break e}else{if((c&1)===0){dx(w,ne,c),$p();break e}V=Error(r(426))}}else if(Lt&&N.mode&1){var Ht=fx(D);if(Ht!==null){(Ht.flags&65536)===0&&(Ht.flags|=256),px(Ht,D,N,w,c),Gf(ha(V,N));break e}}w=V=ha(V,N),tr!==4&&(tr=2),Ml===null?Ml=[w]:Ml.push(w),w=D;do{switch(w.tag){case 3:w.flags|=65536,c&=-c,w.lanes|=c;var re=hx(w,V,c);j_(w,re);break e;case 1:N=V;var K=w.type,ie=w.stateNode;if((w.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||ie!==null&&typeof ie.componentDidCatch=="function"&&(Ss===null||!Ss.has(ie)))){w.flags|=65536,c&=-c,w.lanes|=c;var me=ux(w,N,c);j_(w,me);break e}}w=w.return}while(w!==null)}Ux(f)}catch(je){c=je,Kt===f&&f!==null&&(Kt=f=f.return);continue}break}while(!0)}function Hx(){var o=$h.current;return $h.current=Lh,o===null?Lh:o}function $p(){(tr===0||tr===3||tr===2)&&(tr=4),ur===null||(lo&268435455)===0&&(jh&268435455)===0||ks(ur,vr)}function Hh(o,c){var f=nt;nt|=2;var _=Hx();(ur!==o||vr!==c)&&(Vn=null,ho(o,c));do try{WM();break}catch(b){Wx(o,b)}while(!0);if(Kf(),nt=f,$h.current=_,Kt!==null)throw Error(r(261));return ur=null,vr=0,tr}function WM(){for(;Kt!==null;)qx(Kt)}function HM(){for(;Kt!==null&&!ke();)qx(Kt)}function qx(o){var c=Yx(o.alternate,o,_i);o.memoizedProps=o.pendingProps,c===null?Ux(o):Kt=c,Ep.current=null}function Ux(o){var c=o;do{var f=c.alternate;if(o=c.return,(c.flags&32768)===0){if(f=IM(f,c,_i),f!==null){Kt=f;return}}else{if(f=$M(f,c),f!==null){f.flags&=32767,Kt=f;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{tr=6,Kt=null;return}}if(c=c.sibling,c!==null){Kt=c;return}Kt=c=o}while(c!==null);tr===0&&(tr=5)}function uo(o,c,f){var _=gt,b=Ii.transition;try{Ii.transition=null,gt=1,qM(o,c,f,_)}finally{Ii.transition=b,gt=_}return null}function qM(o,c,f,_){do pa();while(ws!==null);if((nt&6)!==0)throw Error(r(327));f=o.finishedWork;var b=o.finishedLanes;if(f===null)return null;if(o.finishedWork=null,o.finishedLanes=0,f===o.current)throw Error(r(177));o.callbackNode=null,o.callbackPriority=0;var w=f.lanes|f.childLanes;if(CB(o,w),o===ur&&(Kt=ur=null,vr=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||zh||(zh=!0,Kx(Gi,function(){return pa(),null})),w=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||w){w=Ii.transition,Ii.transition=null;var D=gt;gt=1;var N=nt;nt|=4,Ep.current=null,OM(o,f),Ix(f,o),hM($f),eh=!!If,$f=If=null,o.current=f,zM(f),yt(),nt=N,gt=D,Ii.transition=w}else o.current=f;if(zh&&(zh=!1,ws=o,Fh=b),w=o.pendingLanes,w===0&&(Ss=null),_B(f.stateNode),si(o,Ze()),c!==null)for(_=o.onRecoverableError,f=0;f<c.length;f++)b=c[f],_(b.value,{componentStack:b.stack,digest:b.digest});if(Oh)throw Oh=!1,o=Lp,Lp=null,o;return(Fh&1)!==0&&o.tag!==0&&pa(),w=o.pendingLanes,(w&1)!==0?o===Rp?Ll++:(Ll=0,Rp=o):Ll=0,_s(),null}function pa(){if(ws!==null){var o=D0(Fh),c=Ii.transition,f=gt;try{if(Ii.transition=null,gt=16>o?16:o,ws===null)var _=!1;else{if(o=ws,ws=null,Fh=0,(nt&6)!==0)throw Error(r(331));var b=nt;for(nt|=4,Te=o.current;Te!==null;){var w=Te,D=w.child;if((Te.flags&16)!==0){var N=w.deletions;if(N!==null){for(var V=0;V<N.length;V++){var ne=N[V];for(Te=ne;Te!==null;){var fe=Te;switch(fe.tag){case 0:case 11:case 15:El(8,fe,w)}var ge=fe.child;if(ge!==null)ge.return=fe,Te=ge;else for(;Te!==null;){fe=Te;var de=fe.sibling,we=fe.return;if(Lx(fe),fe===ne){Te=null;break}if(de!==null){de.return=we,Te=de;break}Te=we}}}var Le=w.alternate;if(Le!==null){var Ie=Le.child;if(Ie!==null){Le.child=null;do{var Ht=Ie.sibling;Ie.sibling=null,Ie=Ht}while(Ie!==null)}}Te=w}}if((w.subtreeFlags&2064)!==0&&D!==null)D.return=w,Te=D;else e:for(;Te!==null;){if(w=Te,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:El(9,w,w.return)}var re=w.sibling;if(re!==null){re.return=w.return,Te=re;break e}Te=w.return}}var K=o.current;for(Te=K;Te!==null;){D=Te;var ie=D.child;if((D.subtreeFlags&2064)!==0&&ie!==null)ie.return=D,Te=ie;else e:for(D=K;Te!==null;){if(N=Te,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:Ih(9,N)}}catch(je){Ot(N,N.return,je)}if(N===D){Te=null;break e}var me=N.sibling;if(me!==null){me.return=N.return,Te=me;break e}Te=N.return}}if(nt=b,_s(),pi&&typeof pi.onPostCommitFiberRoot=="function")try{pi.onPostCommitFiberRoot(eo,o)}catch{}_=!0}return _}finally{gt=f,Ii.transition=c}}return!1}function Vx(o,c,f){c=ha(f,c),c=hx(o,c,1),o=vs(o,c,1),c=Wr(),o!==null&&(el(o,1,c),si(o,c))}function Ot(o,c,f){if(o.tag===3)Vx(o,o,f);else for(;c!==null;){if(c.tag===3){Vx(c,o,f);break}else if(c.tag===1){var _=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(Ss===null||!Ss.has(_))){o=ha(f,o),o=ux(c,o,1),c=vs(c,o,1),o=Wr(),c!==null&&(el(c,1,o),si(c,o));break}}c=c.return}}function UM(o,c,f){var _=o.pingCache;_!==null&&_.delete(c),c=Wr(),o.pingedLanes|=o.suspendedLanes&f,ur===o&&(vr&f)===f&&(tr===4||tr===3&&(vr&130023424)===vr&&500>Ze()-Mp?ho(o,0):Bp|=f),si(o,c)}function Gx(o,c){c===0&&((o.mode&1)===0?c=1:(c=Xc,Xc<<=1,(Xc&130023424)===0&&(Xc=4194304)));var f=Wr();o=Hn(o,c),o!==null&&(el(o,c,f),si(o,f))}function VM(o){var c=o.memoizedState,f=0;c!==null&&(f=c.retryLane),Gx(o,f)}function GM(o,c){var f=0;switch(o.tag){case 13:var _=o.stateNode,b=o.memoizedState;b!==null&&(f=b.retryLane);break;case 19:_=o.stateNode;break;default:throw Error(r(314))}_!==null&&_.delete(c),Gx(o,f)}var Yx;Yx=function(o,c,f){if(o!==null)if(o.memoizedProps!==c.pendingProps||ti.current)ii=!0;else{if((o.lanes&f)===0&&(c.flags&128)===0)return ii=!1,PM(o,c,f);ii=(o.flags&131072)!==0}else ii=!1,Lt&&(c.flags&1048576)!==0&&E_(c,_h,c.index);switch(c.lanes=0,c.tag){case 2:var _=c.type;Dh(o,c),o=c.pendingProps;var b=ra(c,Br.current);la(c,f),b=op(null,c,_,o,b,f);var w=ap();return c.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,ri(_)?(w=!0,gh(c)):w=!1,c.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Jf(c),b.updater=Rh,c.stateNode=b,b._reactInternals=c,fp(c,_,o,f),c=yp(null,c,_,!0,w,f)):(c.tag=0,Lt&&w&&Hf(c),Nr(null,c,b,f),c=c.child),c;case 16:_=c.elementType;e:{switch(Dh(o,c),o=c.pendingProps,b=_._init,_=b(_._payload),c.type=_,b=c.tag=KM(_),o=Qi(_,o),b){case 0:c=mp(null,c,_,o,f);break e;case 1:c=vx(null,c,_,o,f);break e;case 11:c=gx(null,c,_,o,f);break e;case 14:c=mx(null,c,_,Qi(_.type,o),f);break e}throw Error(r(306,_,""))}return c;case 0:return _=c.type,b=c.pendingProps,b=c.elementType===_?b:Qi(_,b),mp(o,c,_,b,f);case 1:return _=c.type,b=c.pendingProps,b=c.elementType===_?b:Qi(_,b),vx(o,c,_,b,f);case 3:e:{if(bx(c),o===null)throw Error(r(387));_=c.pendingProps,w=c.memoizedState,b=w.element,$_(o,c),Ch(c,_,null,f);var D=c.memoizedState;if(_=D.element,w.isDehydrated)if(w={element:_,isDehydrated:!1,cache:D.cache,pendingSuspenseBoundaries:D.pendingSuspenseBoundaries,transitions:D.transitions},c.updateQueue.baseState=w,c.memoizedState=w,c.flags&256){b=ha(Error(r(423)),c),c=Sx(o,c,_,f,b);break e}else if(_!==b){b=ha(Error(r(424)),c),c=Sx(o,c,_,f,b);break e}else for(yi=gs(c.stateNode.containerInfo.firstChild),mi=c,Lt=!0,Xi=null,f=P_(c,null,_,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(sa(),_===b){c=Un(o,c,f);break e}Nr(o,c,_,f)}c=c.child}return c;case 5:return z_(c),o===null&&Vf(c),_=c.type,b=c.pendingProps,w=o!==null?o.memoizedProps:null,D=b.children,jf(_,b)?D=null:w!==null&&jf(_,w)&&(c.flags|=32),xx(o,c),Nr(o,c,D,f),c.child;case 6:return o===null&&Vf(c),null;case 13:return wx(o,c,f);case 4:return ep(c,c.stateNode.containerInfo),_=c.pendingProps,o===null?c.child=oa(c,null,_,f):Nr(o,c,_,f),c.child;case 11:return _=c.type,b=c.pendingProps,b=c.elementType===_?b:Qi(_,b),gx(o,c,_,b,f);case 7:return Nr(o,c,c.pendingProps,f),c.child;case 8:return Nr(o,c,c.pendingProps.children,f),c.child;case 12:return Nr(o,c,c.pendingProps.children,f),c.child;case 10:e:{if(_=c.type._context,b=c.pendingProps,w=c.memoizedProps,D=b.value,St(bh,_._currentValue),_._currentValue=D,w!==null)if(Ki(w.value,D)){if(w.children===b.children&&!ti.current){c=Un(o,c,f);break e}}else for(w=c.child,w!==null&&(w.return=c);w!==null;){var N=w.dependencies;if(N!==null){D=w.child;for(var V=N.firstContext;V!==null;){if(V.context===_){if(w.tag===1){V=qn(-1,f&-f),V.tag=2;var ne=w.updateQueue;if(ne!==null){ne=ne.shared;var fe=ne.pending;fe===null?V.next=V:(V.next=fe.next,fe.next=V),ne.pending=V}}w.lanes|=f,V=w.alternate,V!==null&&(V.lanes|=f),Qf(w.return,f,c),N.lanes|=f;break}V=V.next}}else if(w.tag===10)D=w.type===c.type?null:w.child;else if(w.tag===18){if(D=w.return,D===null)throw Error(r(341));D.lanes|=f,N=D.alternate,N!==null&&(N.lanes|=f),Qf(D,f,c),D=w.sibling}else D=w.child;if(D!==null)D.return=w;else for(D=w;D!==null;){if(D===c){D=null;break}if(w=D.sibling,w!==null){w.return=D.return,D=w;break}D=D.return}w=D}Nr(o,c,b.children,f),c=c.child}return c;case 9:return b=c.type,_=c.pendingProps.children,la(c,f),b=Di(b),_=_(b),c.flags|=1,Nr(o,c,_,f),c.child;case 14:return _=c.type,b=Qi(_,c.pendingProps),b=Qi(_.type,b),mx(o,c,_,b,f);case 15:return yx(o,c,c.type,c.pendingProps,f);case 17:return _=c.type,b=c.pendingProps,b=c.elementType===_?b:Qi(_,b),Dh(o,c),c.tag=1,ri(_)?(o=!0,gh(c)):o=!1,la(c,f),lx(c,_,b),fp(c,_,b,f),yp(null,c,_,!0,o,f);case 19:return kx(o,c,f);case 22:return _x(o,c,f)}throw Error(r(156,c.tag))};function Kx(o,c){return G(o,c)}function YM(o,c,f,_){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $i(o,c,f,_){return new YM(o,c,f,_)}function jp(o){return o=o.prototype,!(!o||!o.isReactComponent)}function KM(o){if(typeof o=="function")return jp(o)?1:0;if(o!=null){if(o=o.$$typeof,o===Y)return 11;if(o===$)return 14}return 2}function Ts(o,c){var f=o.alternate;return f===null?(f=$i(o.tag,c,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=c,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&14680064,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,c=o.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f}function qh(o,c,f,_,b,w){var D=2;if(_=o,typeof o=="function")jp(o)&&(D=1);else if(typeof o=="string")D=5;else e:switch(o){case A:return fo(f.children,b,w,c);case z:D=8,b|=8;break;case U:return o=$i(12,f,c,b|2),o.elementType=U,o.lanes=w,o;case F:return o=$i(13,f,c,b),o.elementType=F,o.lanes=w,o;case O:return o=$i(19,f,c,b),o.elementType=O,o.lanes=w,o;case W:return Uh(f,b,w,c);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case q:D=10;break e;case H:D=9;break e;case Y:D=11;break e;case $:D=14;break e;case j:D=16,_=null;break e}throw Error(r(130,o==null?o:typeof o,""))}return c=$i(D,f,c,b),c.elementType=o,c.type=_,c.lanes=w,c}function fo(o,c,f,_){return o=$i(7,o,_,c),o.lanes=f,o}function Uh(o,c,f,_){return o=$i(22,o,_,c),o.elementType=W,o.lanes=f,o.stateNode={isHidden:!1},o}function Op(o,c,f){return o=$i(6,o,null,c),o.lanes=f,o}function zp(o,c,f){return c=$i(4,o.children!==null?o.children:[],o.key,c),c.lanes=f,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}function XM(o,c,f,_,b){this.tag=c,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=df(0),this.expirationTimes=df(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=df(0),this.identifierPrefix=_,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function Fp(o,c,f,_,b,w,D,N,V){return o=new XM(o,c,f,N,V),c===1?(c=1,w===!0&&(c|=8)):c=0,w=$i(3,null,null,c),o.current=w,w.stateNode=o,w.memoizedState={element:_,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jf(w),o}function QM(o,c,f){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:_==null?null:""+_,children:o,containerInfo:c,implementation:f}}function Xx(o){if(!o)return ys;o=o._reactInternals;e:{if(mt(o)!==o||o.tag!==1)throw Error(r(170));var c=o;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(ri(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(r(171))}if(o.tag===1){var f=o.type;if(ri(f))return C_(o,f,c)}return c}function Qx(o,c,f,_,b,w,D,N,V){return o=Fp(f,_,!0,o,b,w,D,N,V),o.context=Xx(null),f=o.current,_=Wr(),b=Cs(f),w=qn(_,b),w.callback=c??null,vs(f,w,b),o.current.lanes=b,el(o,b,_),si(o,_),o}function Vh(o,c,f,_){var b=c.current,w=Wr(),D=Cs(b);return f=Xx(f),c.context===null?c.context=f:c.pendingContext=f,c=qn(w,D),c.payload={element:o},_=_===void 0?null:_,_!==null&&(c.callback=_),o=vs(b,c,D),o!==null&&(en(o,b,D,w),wh(o,b,D)),D}function Gh(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function Zx(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<c?f:c}}function Np(o,c){Zx(o,c),(o=o.alternate)&&Zx(o,c)}function ZM(){return null}var Jx=typeof reportError=="function"?reportError:function(o){console.error(o)};function Wp(o){this._internalRoot=o}Yh.prototype.render=Wp.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));Vh(o,c,null,null)},Yh.prototype.unmount=Wp.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;co(function(){Vh(null,o,null,null)}),c[zn]=null}};function Yh(o){this._internalRoot=o}Yh.prototype.unstable_scheduleHydration=function(o){if(o){var c=$0();o={blockedOn:null,target:o,priority:c};for(var f=0;f<ds.length&&c!==0&&c<ds[f].priority;f++);ds.splice(f,0,o),f===0&&z0(o)}};function Hp(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Kh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function ev(){}function JM(o,c,f,_,b){if(b){if(typeof _=="function"){var w=_;_=function(){var ne=Gh(D);w.call(ne)}}var D=Qx(c,_,o,0,null,!1,!1,"",ev);return o._reactRootContainer=D,o[zn]=D.current,pl(o.nodeType===8?o.parentNode:o),co(),D}for(;b=o.lastChild;)o.removeChild(b);if(typeof _=="function"){var N=_;_=function(){var ne=Gh(V);N.call(ne)}}var V=Fp(o,0,!1,null,null,!1,!1,"",ev);return o._reactRootContainer=V,o[zn]=V.current,pl(o.nodeType===8?o.parentNode:o),co(function(){Vh(c,V,f,_)}),V}function Xh(o,c,f,_,b){var w=f._reactRootContainer;if(w){var D=w;if(typeof b=="function"){var N=b;b=function(){var V=Gh(D);N.call(V)}}Vh(c,D,o,b)}else D=JM(f,c,o,b,_);return Gh(D)}P0=function(o){switch(o.tag){case 3:var c=o.stateNode;if(c.current.memoizedState.isDehydrated){var f=Ja(c.pendingLanes);f!==0&&(ff(c,f|1),si(c,Ze()),(nt&6)===0&&(fa=Ze()+500,_s()))}break;case 13:co(function(){var _=Hn(o,1);if(_!==null){var b=Wr();en(_,o,1,b)}}),Np(o,1)}},pf=function(o){if(o.tag===13){var c=Hn(o,134217728);if(c!==null){var f=Wr();en(c,o,134217728,f)}Np(o,134217728)}},I0=function(o){if(o.tag===13){var c=Cs(o),f=Hn(o,c);if(f!==null){var _=Wr();en(f,o,c,_)}Np(o,c)}},$0=function(){return gt},j0=function(o,c){var f=gt;try{return gt=o,c()}finally{gt=f}},dn=function(o,c,f){switch(c){case"input":if(ht(o,f),c=f.name,f.type==="radio"&&c!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<f.length;c++){var _=f[c];if(_!==o&&_.form===o.form){var b=fh(_);if(!b)throw Error(r(90));ct(_),ht(_,b)}}}break;case"textarea":Mt(o,f);break;case"select":c=f.value,c!=null&&kr(o,!!f.multiple,c,!1)}},wt=Pp,fi=co;var eL={usingClientEntryPoint:!1,Events:[yl,ea,fh,Js,Vo,Pp]},Rl={findFiberByHostInstance:to,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},tL={bundleType:Rl.bundleType,version:Rl.version,rendererPackageName:Rl.rendererPackageName,rendererConfig:Rl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=Wt(o),o===null?null:o.stateNode},findFiberByHostInstance:Rl.findFiberByHostInstance||ZM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qh.isDisabled&&Qh.supportsFiber)try{eo=Qh.inject(tL),pi=Qh}catch{}}return oi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eL,oi.createPortal=function(o,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hp(c))throw Error(r(200));return QM(o,c,null,f)},oi.createRoot=function(o,c){if(!Hp(o))throw Error(r(299));var f=!1,_="",b=Jx;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onRecoverableError!==void 0&&(b=c.onRecoverableError)),c=Fp(o,1,!1,null,null,f,!1,_,b),o[zn]=c.current,pl(o.nodeType===8?o.parentNode:o),new Wp(c)},oi.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=Wt(c),o=o===null?null:o.stateNode,o},oi.flushSync=function(o){return co(o)},oi.hydrate=function(o,c,f){if(!Kh(c))throw Error(r(200));return Xh(null,o,c,!0,f)},oi.hydrateRoot=function(o,c,f){if(!Hp(o))throw Error(r(405));var _=f!=null&&f.hydratedSources||null,b=!1,w="",D=Jx;if(f!=null&&(f.unstable_strictMode===!0&&(b=!0),f.identifierPrefix!==void 0&&(w=f.identifierPrefix),f.onRecoverableError!==void 0&&(D=f.onRecoverableError)),c=Qx(c,null,o,1,f??null,b,!1,w,D),o[zn]=c.current,pl(o),_)for(o=0;o<_.length;o++)f=_[o],b=f._getVersion,b=b(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,b]:c.mutableSourceEagerHydrationData.push(f,b);return new Yh(c)},oi.render=function(o,c,f){if(!Kh(c))throw Error(r(200));return Xh(null,o,c,!1,f)},oi.unmountComponentAtNode=function(o){if(!Kh(o))throw Error(r(40));return o._reactRootContainer?(co(function(){Xh(null,null,o,!1,function(){o._reactRootContainer=null,o[zn]=null})}),!0):!1},oi.unstable_batchedUpdates=Pp,oi.unstable_renderSubtreeIntoContainer=function(o,c,f,_){if(!Kh(f))throw Error(r(200));if(o==null||o._reactInternals===void 0)throw Error(r(38));return Xh(o,c,f,!1,_)},oi.version="18.3.1-next-f1338f8080-20240426",oi}var lv;function uL(){if(lv)return Vp.exports;lv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Vp.exports=hL(),Vp.exports}var cv;function dL(){if(cv)return Zh;cv=1;var e=uL();return Zh.createRoot=e.createRoot,Zh.hydrateRoot=e.hydrateRoot,Zh}var fL=dL();const pL=yy(fL),gL="chat:stream",mL="chat:assistant",yL="chat:tool-use",_L="chat:tool-result",xL="chat:status",vL="chat:error",bL="chat:user",SL="session:created",wL="session:resumed",CL="sys:connect",Kp=1;function kL(e={}){const{url:t,onMessage:r,autoConnect:i=!0,handshake:n,wsPath:s="/ws",ssePath:a="/sse"}=e,[l,u]=M.useState("disconnected"),[h,d]=M.useState(null),p=M.useRef(null),m=M.useRef(null),y=M.useRef(0),x=M.useRef(null),v=M.useRef(!0),S=M.useRef(r);M.useEffect(()=>{S.current=r},[r]);const C=TL(t),B=EL(t),R=M.useCallback(()=>{p.current&&(p.current.onopen=null,p.current.onclose=null,p.current.onerror=null,p.current.onmessage=null,(p.current.readyState===1||p.current.readyState===0)&&p.current.close(),p.current=null),m.current&&(m.current.close(),m.current=null),x.current&&(clearTimeout(x.current),x.current=null)},[]),E=M.useCallback(H=>{try{const Y=typeof H=="string"?JSON.parse(H):H;S.current&&S.current(Y)}catch(Y){console.warn("[useConnection] Failed to parse message:",Y)}},[]),L=M.useRef(n);M.useEffect(()=>{L.current=n},[n]);const k=M.useCallback(H=>{var F;const Y={v:Kp,type:CL,payload:{clientType:"browser",protocolVersion:Kp,...L.current},source:"client",timestamp:Date.now()};H==="ws"&&((F=p.current)==null?void 0:F.readyState)===1&&p.current.send(JSON.stringify(Y))},[]),A=M.useCallback(()=>{if(!v.current)return;const H=Math.min(1e3*Math.pow(2,y.current),3e4);y.current+=1,u("disconnected"),x.current=setTimeout(()=>{v.current&&U()},H)},[]),z=M.useCallback(()=>{if(v.current){u("connecting");try{const H=new EventSource(`${B}${a}`);m.current=H,H.onopen=()=>{v.current&&(u("connected"),d("sse"),y.current=0)},H.onmessage=Y=>{v.current&&E(Y.data)},H.onerror=()=>{v.current&&(H.close(),m.current=null,d(null),A())}}catch{d(null),A()}}},[B,a,E,A]),U=M.useCallback(()=>{if(v.current){R(),u("connecting");try{const H=new WebSocket(`${C}${s}`);p.current=H,H.onopen=()=>{v.current&&(u("connected"),d("ws"),y.current=0,k("ws"))},H.onmessage=Y=>{v.current&&E(Y.data)},H.onclose=Y=>{v.current&&(p.current=null,d(null),Y.code===1e3||y.current===0?z():A())},H.onerror=()=>{v.current&&y.current===0&&(p.current=null,d(null),z())}}catch{z()}}},[C,s,R,E,k,z,A]),q=M.useCallback((H,Y,F)=>{var $;const O={v:Kp,type:H,payload:Y,source:"client",timestamp:Date.now()};F&&(O.sessionId=F),h==="ws"&&(($=p.current)==null?void 0:$.readyState)===1?p.current.send(JSON.stringify(O)):fetch(`${B}/chat/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:Y==null?void 0:Y.text,sessionId:F})}).catch(j=>{console.warn("[useConnection] REST fallback failed:",j)})},[h,B]);return M.useEffect(()=>(v.current=!0,i&&t&&U(),()=>{v.current=!1,R()}),[t]),{status:l,transport:h,sendEvent:q}}function TL(e){return e?e.startsWith("ws://")||e.startsWith("wss://")?e:e.replace(/^http/,"ws"):"ws://localhost:3456"}function EL(e){return e?e.startsWith("http://")||e.startsWith("https://")?e:e.replace(/^ws/,"http"):"http://localhost:3456"}const xy=M.createContext(null);function BL({url:e,config:t,onMessage:r,handshake:i,wsPath:n,ssePath:s,children:a}){const l=M.useRef(new Set),u=M.useRef(r);M.useEffect(()=>{u.current=r},[r]);const h=M.useCallback(C=>{if(u.current)try{u.current(C)}catch{}for(const B of l.current)try{B(C)}catch{}},[]),d=M.useMemo(()=>{const C={url:e,onMessage:h};return i&&(C.handshake=i),n&&(C.wsPath=n),s&&(C.ssePath=s),C},[e,h,i,n,s]),{status:p,transport:m,sendEvent:y}=kL(d),x=M.useCallback(C=>(l.current.add(C),()=>l.current.delete(C)),[]),v=M.useMemo(()=>e?e.startsWith("http")?e:e.replace(/^ws/,"http"):"http://localhost:3456",[e]),S=M.useMemo(()=>({httpUrl:v,wsUrl:e,config:t||{},status:p,transport:m,subscribe:x,sendEvent:y}),[v,e,t,p,m,x,y]);return g.jsx(xy.Provider,{value:S,children:a})}let ML=0;function po(){return`msg-${Date.now()}-${++ML}`}function LL(e={}){const t=M.useContext(xy),[r,i]=M.useState([]),[n,s]=M.useState("idle"),[a,l]=M.useState(null),[u,h]=M.useState(null),[d,p]=M.useState(null),m=M.useRef(""),y=M.useRef(e);M.useEffect(()=>{y.current=e},[e]);const x=(t==null?void 0:t.httpUrl)||"http://localhost:3456",v=M.useCallback(k=>{if(!(k!=null&&k.type))return;const A=y.current;switch(k.type){case gL:{m.current=k.payload.fullText||"",i(z=>{const U=z[z.length-1];return U&&U.role==="assistant"&&U._streaming?[...z.slice(0,-1),{...U,text:m.current}]:[...z,{id:po(),role:"assistant",text:k.payload.fullText||k.payload.delta||"",timestamp:k.timestamp,_streaming:!0}]}),s("streaming");break}case mL:{m.current="";const z=k.payload.buttons,U=k.payload.blocks;i(q=>{const H=q[q.length-1],Y={};return z!=null&&z.length&&(Y.buttons=z),U!=null&&U.length&&(Y.blocks=U),H&&H.role==="assistant"&&H._streaming?[...q.slice(0,-1),{...H,text:k.payload.text,_streaming:!1,...Y}]:[...q,{id:po(),role:"assistant",text:k.payload.text,timestamp:k.timestamp,_streaming:!1,...Y}]});break}case yL:{const z={id:po(),role:"tool-use",text:`Using ${k.payload.toolName}`,data:k.payload,timestamp:k.timestamp};i(U=>[...U,z]),A.onToolUse&&A.onToolUse(k.payload);break}case _L:{i(z=>[...z,{id:po(),role:"tool-result",data:k.payload,timestamp:k.timestamp}]);break}case xL:{s(k.payload.status||"idle");break}case vL:{const z=k.payload.message||"Unknown error";p(z),i(U=>[...U,{id:po(),role:"error",text:z,timestamp:k.timestamp}]),A.onError&&A.onError(k.payload);break}case bL:{if(k.source==="client")break;i(z=>[...z,{id:po(),role:"user",text:k.payload.text,timestamp:k.timestamp}]);break}case SL:case wL:{l(k.payload.sessionId),k.payload.config&&h(k.payload.config);break}}A.onMessage&&A.onMessage(k)},[]);M.useEffect(()=>{if(t!=null&&t.subscribe)return t.subscribe(v)},[t,v]);const S=M.useCallback(async k=>{p(null);const A={...(t==null?void 0:t.config)||{},...e.config||{}};try{const z=await fetch(`${x}/chat/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:A})}),U=await z.json();if(!z.ok)throw new Error(U.error||"Failed to start session");return l(U.sessionId),U.config&&h(U.config),k&&await B(U.sessionId,k),U.sessionId}catch(z){throw p(z.message),z}},[x,t,e.config]),C=M.useCallback(async k=>{if(k!=null&&k.trim()){if(!a){await S(k);return}await B(a,k)}},[a,S,x]);async function B(k,A){i(z=>[...z,{id:po(),role:"user",text:A,timestamp:Date.now()}]),p(null);try{const z=await fetch(`${x}/chat/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:k,text:A})});if(!z.ok){const U=await z.json().catch(()=>({}));throw new Error(U.error||"Failed to send message")}}catch(z){p(z.message)}}const R=M.useCallback(async()=>{if(a)try{await fetch(`${x}/chat/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:a})})}catch{}},[a,x]),E=M.useCallback(()=>{i([]),m.current=""},[]);return{messages:r,send:C,stop:R,isStreaming:n==="streaming"||n==="thinking",status:n,sessionId:a,resolvedConfig:u,error:d,clearMessages:E,createSession:S}}function RL(){const e=M.useContext(xy),[t,r]=M.useState([]),[i,n]=M.useState(!1),[s,a]=M.useState(null),l=(e==null?void 0:e.httpUrl)||"http://localhost:3456",u=M.useCallback(async p=>{n(!0),a(null);try{const m=p?`?dir=${encodeURIComponent(p)}`:"",y=await fetch(`${l}/chat/sessions${m}`),x=await y.json();if(!y.ok)throw new Error(x.error||"Failed to list sessions");r(x.sessions||[])}catch(m){a(m.message)}finally{n(!1)}},[l]),h=M.useCallback(async p=>{a(null);try{const m={...(e==null?void 0:e.config)||{},...p||{}},y=await fetch(`${l}/chat/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:m})}),x=await y.json();if(!y.ok)throw new Error(x.error||"Failed to create session");return x}catch(m){throw a(m.message),m}},[l,e]),d=M.useCallback(async(p,m)=>{a(null);try{const y={...(e==null?void 0:e.config)||{},...m||{}},x=await fetch(`${l}/chat/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:p,config:y})}),v=await x.json();if(!x.ok)throw new Error(v.error||"Failed to resume session");return v}catch(y){throw a(y.message),y}},[l,e]);return M.useEffect(()=>{u()},[u]),{sessions:t,loading:i,error:s,refresh:u,create:h,resume:d}}const AL="ws://localhost:3456/ws",DL="http://localhost:3456/sse",hv="http://localhost:3456/api";function PL(e){const[t,r]=M.useState("disconnected"),[i,n]=M.useState(null),[s,a]=M.useState(null),l=M.useRef(null),u=M.useRef(null),h=M.useRef(0),d=M.useRef(null),p=M.useRef(!0),m=M.useRef(e);M.useEffect(()=>{m.current=e},[e]);const y=M.useCallback(()=>{l.current&&(l.current.onopen=null,l.current.onclose=null,l.current.onerror=null,l.current.onmessage=null,(l.current.readyState===WebSocket.OPEN||l.current.readyState===WebSocket.CONNECTING)&&l.current.close(),l.current=null),u.current&&(u.current.close(),u.current=null),d.current&&(clearTimeout(d.current),d.current=null)},[]),x=M.useCallback(E=>{var L;try{const k=typeof E=="string"?JSON.parse(E):E;k.type==="sys:connect"&&k.source==="bridge"&&((L=k.payload)!=null&&L.clientId)&&a(k.payload.clientId),m.current&&m.current(k)}catch(k){console.warn("[useConnection] Failed to parse message:",k)}},[]),v=M.useCallback(E=>{var k;const L={v:1,type:"sys:connect",payload:{clientType:"canvas",protocolVersion:1,capabilities:["dashboard","canvas","quiz","playground"]},source:"canvas",timestamp:Date.now()};E==="ws"&&((k=l.current)==null?void 0:k.readyState)===WebSocket.OPEN?l.current.send(JSON.stringify(L)):E==="sse"&&fetch(`${hv}/event`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)}).catch(A=>{console.warn("[useConnection] Failed to send connect handshake via REST:",A)})},[]),S=M.useCallback(()=>{if(!p.current)return;const E=Math.min(1e3*Math.pow(2,h.current),3e4);h.current+=1,console.log(`[useConnection] Reconnecting in ${E}ms (attempt ${h.current})`),r("disconnected"),d.current=setTimeout(()=>{p.current&&B()},E)},[]),C=M.useCallback(()=>{if(p.current){console.log("[useConnection] Falling back to SSE"),r("connecting");try{const E=new EventSource(DL);u.current=E,E.onopen=()=>{p.current&&(console.log("[useConnection] SSE connected"),r("connected"),n("sse"),h.current=0,v("sse"))},E.onmessage=L=>{p.current&&x(L.data)},E.onerror=()=>{p.current&&(console.warn("[useConnection] SSE error"),E.close(),u.current=null,n(null),S())}}catch(E){console.warn("[useConnection] SSE failed to connect:",E),n(null),S()}}},[x,v,S]),B=M.useCallback(()=>{if(p.current){y(),r("connecting");try{const E=new WebSocket(AL);l.current=E,E.onopen=()=>{p.current&&(console.log("[useConnection] WebSocket connected"),r("connected"),n("ws"),h.current=0,v("ws"))},E.onmessage=L=>{p.current&&x(L.data)},E.onclose=L=>{p.current&&(console.log("[useConnection] WebSocket closed:",L.code,L.reason),l.current=null,n(null),L.code===1e3||h.current===0?C():S())},E.onerror=()=>{p.current&&(console.warn("[useConnection] WebSocket error — will try SSE"),h.current===0&&(l.current=null,n(null),C()))}}catch(E){console.warn("[useConnection] WebSocket failed:",E),C()}}},[y,x,v,C,S]),R=M.useCallback((E,L)=>{var A;const k={v:1,type:E,payload:L,source:"canvas",timestamp:Date.now()};i==="ws"&&((A=l.current)==null?void 0:A.readyState)===WebSocket.OPEN?l.current.send(JSON.stringify(k)):fetch(`${hv}/event`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}).catch(z=>{console.warn("[useConnection] Failed to send event via REST:",z)})},[i]);return M.useEffect(()=>(p.current=!0,B(),()=>{p.current=!1,y()}),[]),{status:t,transport:i,clientId:s,sendEvent:R}}const $s={blue:{dark:"#58a6ff",light:"#0969da"},green:{dark:"#3fb950",light:"#1a7f37"},purple:{dark:"#bc8cff",light:"#8250df"},orange:{dark:"#f0883e",light:"#bc4c00"},red:{dark:"#f85149",light:"#cf222e"},yellow:{dark:"#d29922",light:"#9a6700"}},IL={id:"dark",bgPrimary:"#0d1117",bgSecondary:"#161b22",bgTertiary:"#21262d",border:"#30363d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#484f58",textBright:"#e6edf3",accent:"#58a6ff",success:"#3fb950",error:"#f85149",warning:"#d29922",purple:"#bc8cff",orange:"#f0883e",userBubble:"#1f6feb",errorBg:"#3d1416",errorButton:"#da3633"},$L={id:"light",bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgTertiary:"#eaeef2",border:"#d1d5db",textPrimary:"#1f2328",textSecondary:"#656d76",textMuted:"#8b949e",textBright:"#1f2328",accent:"#0969da",success:"#1a7f37",error:"#cf222e",warning:"#9a6700",purple:"#8250df",orange:"#bc4c00",userBubble:"#0969da",errorBg:"#ffebe9",errorButton:"#cf222e"},Ql={dark:IL,light:$L};function jL(e,t){const r=$s[t];return r?{...e,accent:r[e.id]||r.dark}:e}function OL(e){var t;return e==="light"?Ql.light:e==="dark"?Ql.dark:typeof window<"u"&&((t=window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: light)").matches)?Ql.light:Ql.dark}const sS=M.createContext(null);function zL(e){const t=document.documentElement;t.setAttribute("data-theme",e.id),t.style.setProperty("--bg-primary",e.bgPrimary),t.style.setProperty("--bg-secondary",e.bgSecondary),t.style.setProperty("--border",e.border),t.style.setProperty("--text-primary",e.textPrimary),t.style.setProperty("--accent",e.accent),t.style.setProperty("--scrollbar-thumb",e.bgTertiary),t.style.setProperty("--scrollbar-track",e.bgPrimary)}function FL({children:e}){const[t,r]=M.useState("dark"),[i,n]=M.useState("blue"),s=M.useMemo(()=>OL(t),[t]),a=M.useMemo(()=>jL(s,i),[s,i]);M.useEffect(()=>{zL(a)},[a]),M.useEffect(()=>{if(t!=="system")return;const d=window.matchMedia("(prefers-color-scheme: light)"),p=()=>{r("system")};return d.addEventListener("change",p),()=>d.removeEventListener("change",p)},[t]),M.useEffect(()=>{fetch("http://localhost:3456/api/settings").then(d=>d.ok?d.json():null).then(d=>{d&&(d.theme&&["dark","light","system"].includes(d.theme)&&r(d.theme),d.accent&&$s[d.accent]&&n(d.accent))}).catch(()=>{})},[]);const l=M.useCallback(d=>{r(d),fetch("http://localhost:3456/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:d})}).catch(()=>{})},[]),u=M.useCallback(d=>{$s[d]&&(n(d),fetch("http://localhost:3456/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accent:d})}).catch(()=>{}))},[]),h=M.useMemo(()=>({theme:a,preference:t,accentName:i,setThemePreference:l,setAccent:u}),[a,t,i,l,u]);return g.jsx(sS.Provider,{value:h,children:e})}function Bt(){const e=M.useContext(sS);return e||{theme:Ql.dark,preference:"dark",accentName:"blue",setThemePreference:()=>{},setAccent:()=>{}}}function vy(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Fo=vy();function oS(e){Fo=e}var dc={exec:()=>null};function at(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(n,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Vr.caret,"$1"),r=r.replace(n,a),i},getRegex:()=>new RegExp(r,t)};return i}var NL=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Vr={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,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},WL=/^(?:[ \t]*(?:\n|$))+/,HL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,qL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ic=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,UL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,by=/(?:[*+-]|\d{1,9}[.)])/,aS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,lS=at(aS).replace(/bull/g,by).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(),VL=at(aS).replace(/bull/g,by).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(),Sy=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,GL=/^[^\n]+/,wy=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,YL=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wy).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),KL=at(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,by).getRegex(),Dd="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",Cy=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,XL=at("^ {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",Cy).replace("tag",Dd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cS=at(Sy).replace("hr",Ic).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Dd).getRegex(),QL=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cS).getRegex(),ky={blockquote:QL,code:HL,def:YL,fences:qL,heading:UL,hr:Ic,html:XL,lheading:lS,list:KL,newline:WL,paragraph:cS,table:dc,text:GL},uv=at("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ic).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Dd).getRegex(),ZL={...ky,lheading:VL,table:uv,paragraph:at(Sy).replace("hr",Ic).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",uv).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Dd).getRegex()},JL={...ky,html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Cy).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:dc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(Sy).replace("hr",Ic).replace("heading",` *#{1,6} *[^
|
|
42
|
+
]`).replace("lheading",lS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},eR=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tR=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hS=/^( {2,}|\\)\n(?!\s*$)/,rR=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pd=/[\p{P}\p{S}]/u,Ty=/[\s\p{P}\p{S}]/u,uS=/[^\s\p{P}\p{S}]/u,iR=at(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ty).getRegex(),dS=/(?!~)[\p{P}\p{S}]/u,nR=/(?!~)[\s\p{P}\p{S}]/u,sR=/(?:[^\s\p{P}\p{S}]|~)/u,oR=at(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",NL?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fS=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,aR=at(fS,"u").replace(/punct/g,Pd).getRegex(),lR=at(fS,"u").replace(/punct/g,dS).getRegex(),pS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cR=at(pS,"gu").replace(/notPunctSpace/g,uS).replace(/punctSpace/g,Ty).replace(/punct/g,Pd).getRegex(),hR=at(pS,"gu").replace(/notPunctSpace/g,sR).replace(/punctSpace/g,nR).replace(/punct/g,dS).getRegex(),uR=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,uS).replace(/punctSpace/g,Ty).replace(/punct/g,Pd).getRegex(),dR=at(/\\(punct)/,"gu").replace(/punct/g,Pd).getRegex(),fR=at(/^<(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(),pR=at(Cy).replace("(?:-->|$)","-->").getRegex(),gR=at("^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",pR).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qu=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,mR=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",qu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gS=at(/^!?\[(label)\]\[(ref)\]/).replace("label",qu).replace("ref",wy).getRegex(),mS=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",wy).getRegex(),yR=at("reflink|nolink(?!\\()","g").replace("reflink",gS).replace("nolink",mS).getRegex(),dv=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ey={_backpedal:dc,anyPunctuation:dR,autolink:fR,blockSkip:oR,br:hS,code:tR,del:dc,emStrongLDelim:aR,emStrongRDelimAst:cR,emStrongRDelimUnd:uR,escape:eR,link:mR,nolink:mS,punctuation:iR,reflink:gS,reflinkSearch:yR,tag:gR,text:rR,url:dc},_R={...Ey,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",qu).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qu).getRegex()},Ig={...Ey,emStrongRDelimAst:hR,emStrongLDelim:lR,url:at(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",dv).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:at(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",dv).getRegex()},xR={...Ig,br:at(hS).replace("{2,}","*").getRegex(),text:at(Ig.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Jh={normal:ky,gfm:ZL,pedantic:JL},Dl={normal:Ey,gfm:Ig,breaks:xR,pedantic:_R},vR={"&":"&","<":"<",">":">",'"':""","'":"'"},fv=e=>vR[e];function Sn(e,t){if(t){if(Vr.escapeTest.test(e))return e.replace(Vr.escapeReplace,fv)}else if(Vr.escapeTestNoEncode.test(e))return e.replace(Vr.escapeReplaceNoEncode,fv);return e}function pv(e){try{e=encodeURI(e).replace(Vr.percentDecode,"%")}catch{return null}return e}function gv(e,t){var s;let r=e.replace(Vr.findPipe,(a,l,u)=>{let h=!1,d=l;for(;--d>=0&&u[d]==="\\";)h=!h;return h?"|":" |"}),i=r.split(Vr.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(Vr.slashPipe,"|");return i}function Pl(e,t,r){let i=e.length;if(i===0)return"";let n=0;for(;n<i&&e.charAt(i-n-1)===t;)n++;return e.slice(0,i-n)}function bR(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function mv(e,t,r,i,n){let s=t.href,a=t.title||null,l=e[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:l,tokens:i.inlineTokens(l)};return i.state.inLink=!1,u}function SR(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let n=i[1];return t.split(`
|
|
43
|
+
`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[l]=a;return l.length>=n.length?s.slice(n.length):s}).join(`
|
|
44
|
+
`)}var Uu=class{constructor(t){_t(this,"options");_t(this,"rules");_t(this,"lexer");this.options=t||Fo}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Pl(i,`
|
|
45
|
+
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],n=SR(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:n}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let n=Pl(i,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(i=n.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Pl(r[0],`
|
|
46
|
+
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Pl(r[0],`
|
|
47
|
+
`).split(`
|
|
48
|
+
`),n="",s="",a=[];for(;i.length>0;){let l=!1,u=[],h;for(h=0;h<i.length;h++)if(this.rules.other.blockquoteStart.test(i[h]))u.push(i[h]),l=!0;else if(!l)u.push(i[h]);else break;i=i.slice(h);let d=u.join(`
|
|
49
|
+
`),p=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
50
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
51
|
+
${d}`:d,s=s?`${s}
|
|
52
|
+
${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=m,i.length===0)break;let y=a.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let x=y,v=x.raw+`
|
|
53
|
+
`+i.join(`
|
|
54
|
+
`),S=this.blockquote(v);a[a.length-1]=S,n=n.substring(0,n.length-x.raw.length)+S.raw,s=s.substring(0,s.length-x.text.length)+S.text;break}else if((y==null?void 0:y.type)==="list"){let x=y,v=x.raw+`
|
|
55
|
+
`+i.join(`
|
|
56
|
+
`),S=this.list(v);a[a.length-1]=S,n=n.substring(0,n.length-y.raw.length)+S.raw,s=s.substring(0,s.length-x.raw.length)+S.raw,i=v.substring(a.at(-1).raw.length).split(`
|
|
57
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:a,text:s}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),n=i.length>1,s={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let a=this.rules.other.listItemRegex(i),l=!1;for(;t;){let h=!1,d="",p="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;d=r[0],t=t.substring(d.length);let m=r[2].split(`
|
|
58
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,B=>" ".repeat(3*B.length)),y=t.split(`
|
|
59
|
+
`,1)[0],x=!m.trim(),v=0;if(this.options.pedantic?(v=2,p=m.trimStart()):x?v=r[1].length+1:(v=r[2].search(this.rules.other.nonSpaceChar),v=v>4?1:v,p=m.slice(v),v+=r[1].length),x&&this.rules.other.blankLine.test(y)&&(d+=y+`
|
|
60
|
+
`,t=t.substring(y.length+1),h=!0),!h){let B=this.rules.other.nextBulletRegex(v),R=this.rules.other.hrRegex(v),E=this.rules.other.fencesBeginRegex(v),L=this.rules.other.headingBeginRegex(v),k=this.rules.other.htmlBeginRegex(v);for(;t;){let A=t.split(`
|
|
61
|
+
`,1)[0],z;if(y=A,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),z=y):z=y.replace(this.rules.other.tabCharGlobal," "),E.test(y)||L.test(y)||k.test(y)||B.test(y)||R.test(y))break;if(z.search(this.rules.other.nonSpaceChar)>=v||!y.trim())p+=`
|
|
62
|
+
`+z.slice(v);else{if(x||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(m)||L.test(m)||R.test(m))break;p+=`
|
|
63
|
+
`+y}!x&&!y.trim()&&(x=!0),d+=A+`
|
|
64
|
+
`,t=t.substring(A.length+1),m=z.slice(v)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(l=!0));let S=null,C;this.options.gfm&&(S=this.rules.other.listIsTask.exec(p),S&&(C=S[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:d,task:!!S,checked:C,loose:!1,text:p,tokens:[]}),s.raw+=d}let u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let h=0;h<s.items.length;h++)if(this.lexer.state.top=!1,s.items[h].tokens=this.lexer.blockTokens(s.items[h].text,[]),!s.loose){let d=s.items[h].tokens.filter(m=>m.type==="space"),p=d.length>0&&d.some(m=>this.rules.other.anyLine.test(m.raw));s.loose=p}if(s.loose)for(let h=0;h<s.items.length;h++)s.items[h].loose=!0;return s}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:n,title:s}}}table(t){var l;let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=gv(r[1]),n=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(l=r[3])!=null&&l.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
65
|
+
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===n.length){for(let u of n)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<i.length;u++)a.header.push({text:i[u],tokens:this.lexer.inline(i[u]),header:!0,align:a.align[u]});for(let u of s)a.rows.push(gv(u,a.header.length).map((h,d)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:a.align[d]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
|
|
66
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=Pl(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=bR(r[2],"()");if(a===-2)return;if(a>-1){let l=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let n=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?n=n.slice(1):n=n.slice(1,-1)),mv(r,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let n=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[n.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return mv(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||n[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...n[0]].length-1,a,l,u=s,h=0,d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+s);(n=d.exec(r))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){u+=l;continue}else if((n[5]||n[6])&&s%3&&!((s+l)%3)){h+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+h);let p=[...n[0]][0].length,m=t.slice(0,s+n.index+p+l);if(Math.min(s,l)%2){let x=m.slice(1,-1);return{type:"em",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}let y=m.slice(2,-2);return{type:"strong",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return n&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,n;return r[2]==="@"?(i=r[1],n="mailto:"+i):(i=r[1],n=i),{type:"link",raw:r[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(t){var i;let r;if(r=this.rules.inline.url.exec(t)){let n,s;if(r[2]==="@")n=r[0],s="mailto:"+n;else{let a;do a=r[0],r[0]=((i=this.rules.inline._backpedal.exec(r[0]))==null?void 0:i[0])??"";while(a!==r[0]);n=r[0],r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},rn=class $g{constructor(t){_t(this,"tokens");_t(this,"options");_t(this,"state");_t(this,"tokenizer");_t(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Fo,this.options.tokenizer=this.options.tokenizer||new Uu,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:Vr,block:Jh.normal,inline:Dl.normal};this.options.pedantic?(r.block=Jh.pedantic,r.inline=Dl.pedantic):this.options.gfm&&(r.block=Jh.gfm,this.options.breaks?r.inline=Dl.breaks:r.inline=Dl.gfm),this.tokenizer.rules=r}static get rules(){return{block:Jh,inline:Dl}}static lex(t,r){return new $g(r).lex(t)}static lexInline(t,r){return new $g(r).inlineTokens(t)}lex(t){t=t.replace(Vr.carriageReturn,`
|
|
67
|
+
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){var n,s,a;for(this.options.pedantic&&(t=t.replace(Vr.tabCharGlobal," ").replace(Vr.spaceLine,""));t;){let l;if((s=(n=this.options.extensions)==null?void 0:n.block)!=null&&s.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let h=r.at(-1);l.raw.length===1&&h!==void 0?h.raw+=`
|
|
68
|
+
`:r.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let h=r.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
69
|
+
`)?"":`
|
|
70
|
+
`)+l.raw,h.text+=`
|
|
71
|
+
`+l.text,this.inlineQueue.at(-1).src=h.text):r.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let h=r.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
72
|
+
`)?"":`
|
|
73
|
+
`)+l.raw,h.text+=`
|
|
74
|
+
`+l.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},r.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),r.push(l);continue}let u=t;if((a=this.options.extensions)!=null&&a.startBlock){let h=1/0,d=t.slice(1),p;this.options.extensions.startBlock.forEach(m=>{p=m.call({lexer:this},d),typeof p=="number"&&p>=0&&(h=Math.min(h,p))}),h<1/0&&h>=0&&(u=t.substring(0,h+1))}if(this.state.top&&(l=this.tokenizer.paragraph(u))){let h=r.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
|
|
75
|
+
`)?"":`
|
|
76
|
+
`)+l.raw,h.text+=`
|
|
77
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):r.push(l),i=u.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let h=r.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
78
|
+
`)?"":`
|
|
79
|
+
`)+l.raw,h.text+=`
|
|
80
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var u,h,d,p,m;let i=t,n=null;if(this.tokens.links){let y=Object.keys(this.tokens.links);if(y.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)y.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,n.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)s=n[2]?n[2].length:0,i=i.slice(0,n.index+s)+"["+"a".repeat(n[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(u=this.options.hooks)==null?void 0:u.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;let a=!1,l="";for(;t;){a||(l=""),a=!1;let y;if((p=(d=this.options.extensions)==null?void 0:d.inline)!=null&&p.some(v=>(y=v.call({lexer:this},t,r))?(t=t.substring(y.raw.length),r.push(y),!0):!1))continue;if(y=this.tokenizer.escape(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.tag(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.link(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(y.raw.length);let v=r.at(-1);y.type==="text"&&(v==null?void 0:v.type)==="text"?(v.raw+=y.raw,v.text+=y.text):r.push(y);continue}if(y=this.tokenizer.emStrong(t,i,l)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.codespan(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.br(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.del(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.autolink(t)){t=t.substring(y.raw.length),r.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(t))){t=t.substring(y.raw.length),r.push(y);continue}let x=t;if((m=this.options.extensions)!=null&&m.startInline){let v=1/0,S=t.slice(1),C;this.options.extensions.startInline.forEach(B=>{C=B.call({lexer:this},S),typeof C=="number"&&C>=0&&(v=Math.min(v,C))}),v<1/0&&v>=0&&(x=t.substring(0,v+1))}if(y=this.tokenizer.inlineText(x)){t=t.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(l=y.raw.slice(-1)),a=!0;let v=r.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=y.raw,v.text+=y.text):r.push(y);continue}if(t){let v="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return r}},Vu=class{constructor(t){_t(this,"options");_t(this,"parser");this.options=t||Fo}space(t){return""}code({text:t,lang:r,escaped:i}){var a;let n=(a=(r||"").match(Vr.notSpaceStart))==null?void 0:a[0],s=t.replace(Vr.endingNewline,"")+`
|
|
81
|
+
`;return n?'<pre><code class="language-'+Sn(n)+'">'+(i?s:Sn(s,!0))+`</code></pre>
|
|
82
|
+
`:"<pre><code>"+(i?s:Sn(s,!0))+`</code></pre>
|
|
83
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
84
|
+
${this.parser.parse(t)}</blockquote>
|
|
85
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
|
|
86
|
+
`}hr(t){return`<hr>
|
|
87
|
+
`}list(t){let r=t.ordered,i=t.start,n="";for(let l=0;l<t.items.length;l++){let u=t.items[l];n+=this.listitem(u)}let s=r?"ol":"ul",a=r&&i!==1?' start="'+i+'"':"";return"<"+s+a+`>
|
|
88
|
+
`+n+"</"+s+`>
|
|
89
|
+
`}listitem(t){var i;let r="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?((i=t.tokens[0])==null?void 0:i.type)==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+Sn(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):r+=n+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
|
|
90
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
91
|
+
`}table(t){let r="",i="";for(let s=0;s<t.header.length;s++)i+=this.tablecell(t.header[s]);r+=this.tablerow({text:i});let n="";for(let s=0;s<t.rows.length;s++){let a=t.rows[s];i="";for(let l=0;l<a.length;l++)i+=this.tablecell(a[l]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
92
|
+
<thead>
|
|
93
|
+
`+r+`</thead>
|
|
94
|
+
`+n+`</table>
|
|
95
|
+
`}tablerow({text:t}){return`<tr>
|
|
96
|
+
${t}</tr>
|
|
97
|
+
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
|
|
98
|
+
`}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>${Sn(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let n=this.parser.parseInline(i),s=pv(t);if(s===null)return n;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+Sn(r)+'"'),a+=">"+n+"</a>",a}image({href:t,title:r,text:i,tokens:n}){n&&(i=this.parser.parseInline(n,this.parser.textRenderer));let s=pv(t);if(s===null)return Sn(i);t=s;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${Sn(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Sn(t.text)}},By=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""}},nn=class jg{constructor(t){_t(this,"options");_t(this,"renderer");_t(this,"textRenderer");this.options=t||Fo,this.options.renderer=this.options.renderer||new Vu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new By}static parse(t,r){return new jg(r).parse(t)}static parseInline(t,r){return new jg(r).parseInline(t)}parse(t,r=!0){var n,s;let i="";for(let a=0;a<t.length;a++){let l=t[a];if((s=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&s[l.type]){let h=l,d=this.options.extensions.renderers[h.type].call({parser:this},h);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(h.type)){i+=d||"";continue}}let u=l;switch(u.type){case"space":{i+=this.renderer.space(u);continue}case"hr":{i+=this.renderer.hr(u);continue}case"heading":{i+=this.renderer.heading(u);continue}case"code":{i+=this.renderer.code(u);continue}case"table":{i+=this.renderer.table(u);continue}case"blockquote":{i+=this.renderer.blockquote(u);continue}case"list":{i+=this.renderer.list(u);continue}case"html":{i+=this.renderer.html(u);continue}case"def":{i+=this.renderer.def(u);continue}case"paragraph":{i+=this.renderer.paragraph(u);continue}case"text":{let h=u,d=this.renderer.text(h);for(;a+1<t.length&&t[a+1].type==="text";)h=t[++a],d+=`
|
|
99
|
+
`+this.renderer.text(h);r?i+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):i+=d;continue}default:{let h='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}parseInline(t,r=this.renderer){var n,s;let i="";for(let a=0;a<t.length;a++){let l=t[a];if((s=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&s[l.type]){let h=this.options.extensions.renderers[l.type].call({parser:this},l);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){i+=h||"";continue}}let u=l;switch(u.type){case"escape":{i+=r.text(u);break}case"html":{i+=r.html(u);break}case"link":{i+=r.link(u);break}case"image":{i+=r.image(u);break}case"strong":{i+=r.strong(u);break}case"em":{i+=r.em(u);break}case"codespan":{i+=r.codespan(u);break}case"br":{i+=r.br(u);break}case"del":{i+=r.del(u);break}case"text":{i+=r.text(u);break}default:{let h='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}},xu,Zl=(xu=class{constructor(t){_t(this,"options");_t(this,"block");this.options=t||Fo}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?rn.lex:rn.lexInline}provideParser(){return this.block?nn.parse:nn.parseInline}},_t(xu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),_t(xu,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),xu),wR=class{constructor(...t){_t(this,"defaults",vy());_t(this,"options",this.setOptions);_t(this,"parse",this.parseMarkdown(!0));_t(this,"parseInline",this.parseMarkdown(!1));_t(this,"Parser",nn);_t(this,"Renderer",Vu);_t(this,"TextRenderer",By);_t(this,"Lexer",rn);_t(this,"Tokenizer",Uu);_t(this,"Hooks",Zl);this.use(...t)}walkTokens(t,r){var n,s;let i=[];for(let a of t)switch(i=i.concat(r.call(this,a)),a.type){case"table":{let l=a;for(let u of l.header)i=i.concat(this.walkTokens(u.tokens,r));for(let u of l.rows)for(let h of u)i=i.concat(this.walkTokens(h.tokens,r));break}case"list":{let l=a;i=i.concat(this.walkTokens(l.items,r));break}default:{let l=a;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[l.type]?this.defaults.extensions.childTokens[l.type].forEach(u=>{let h=l[u].flat(1/0);i=i.concat(this.walkTokens(h,r))}):l.tokens&&(i=i.concat(this.walkTokens(l.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...l){let u=s.renderer.apply(this,l);return u===!1&&(u=a.apply(this,l)),u}:r.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 a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),n.extensions=r),i.renderer){let s=this.defaults.renderer||new Vu(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let l=a,u=i.renderer[l],h=s[l];s[l]=(...d)=>{let p=u.apply(s,d);return p===!1&&(p=h.apply(s,d)),p||""}}n.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new Uu(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let l=a,u=i.tokenizer[l],h=s[l];s[l]=(...d)=>{let p=u.apply(s,d);return p===!1&&(p=h.apply(s,d)),p}}n.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new Zl;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let l=a,u=i.hooks[l],h=s[l];Zl.passThroughHooks.has(a)?s[l]=d=>{if(this.defaults.async&&Zl.passThroughHooksRespectAsync.has(a))return(async()=>{let m=await u.call(s,d);return h.call(s,m)})();let p=u.call(s,d);return h.call(s,p)}:s[l]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await u.apply(s,d);return m===!1&&(m=await h.apply(s,d)),m})();let p=u.apply(s,d);return p===!1&&(p=h.apply(s,d)),p}}n.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;n.walkTokens=function(l){let u=[];return u.push(a.call(this,l)),s&&(u=u.concat(s.call(this,l))),u}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return rn.lex(t,r??this.defaults)}parser(t,r){return nn.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let n={...i},s={...this.defaults,...n},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return a(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 r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", 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(r):r,u=await(s.hooks?await s.hooks.provideLexer():t?rn.lex:rn.lexInline)(l,s),h=s.hooks?await s.hooks.processAllTokens(u):u;s.walkTokens&&await Promise.all(this.walkTokens(h,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser():t?nn.parse:nn.parseInline)(h,s);return s.hooks?await s.hooks.postprocess(d):d})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let l=(s.hooks?s.hooks.provideLexer():t?rn.lex:rn.lexInline)(r,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let u=(s.hooks?s.hooks.provideParser():t?nn.parse:nn.parseInline)(l,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(l){return a(l)}}}onError(t,r){return i=>{if(i.message+=`
|
|
100
|
+
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+Sn(i.message+"",!0)+"</pre>";return r?Promise.resolve(n):n}if(r)return Promise.reject(i);throw i}}},Ro=new wR;function ot(e,t){return Ro.parse(e,t)}ot.options=ot.setOptions=function(e){return Ro.setOptions(e),ot.defaults=Ro.defaults,oS(ot.defaults),ot};ot.getDefaults=vy;ot.defaults=Fo;ot.use=function(...e){return Ro.use(...e),ot.defaults=Ro.defaults,oS(ot.defaults),ot};ot.walkTokens=function(e,t){return Ro.walkTokens(e,t)};ot.parseInline=Ro.parseInline;ot.Parser=nn;ot.parser=nn.parse;ot.Renderer=Vu;ot.TextRenderer=By;ot.Lexer=rn;ot.lexer=rn.lex;ot.Tokenizer=Uu;ot.Hooks=Zl;ot.parse=ot;ot.options;ot.setOptions;ot.use;ot.walkTokens;ot.parseInline;nn.parse;rn.lex;/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:yS,setPrototypeOf:yv,isFrozen:CR,getPrototypeOf:kR,getOwnPropertyDescriptor:TR}=Object;let{freeze:Kr,seal:Wi,create:vu}=Object,{apply:Og,construct:zg}=typeof Reflect<"u"&&Reflect;Kr||(Kr=function(t){return t});Wi||(Wi=function(t){return t});Og||(Og=function(t,r){for(var i=arguments.length,n=new Array(i>2?i-2:0),s=2;s<i;s++)n[s-2]=arguments[s];return t.apply(r,n)});zg||(zg=function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return new t(...i)});const eu=Xr(Array.prototype.forEach),ER=Xr(Array.prototype.lastIndexOf),_v=Xr(Array.prototype.pop),Il=Xr(Array.prototype.push),BR=Xr(Array.prototype.splice),bu=Xr(String.prototype.toLowerCase),Xp=Xr(String.prototype.toString),Qp=Xr(String.prototype.match),$l=Xr(String.prototype.replace),MR=Xr(String.prototype.indexOf),LR=Xr(String.prototype.trim),Si=Xr(Object.prototype.hasOwnProperty),Hr=Xr(RegExp.prototype.test),jl=RR(TypeError);function Xr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return Og(e,t,i)}}function RR(e){return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return zg(e,r)}}function et(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bu;yv&&yv(e,null);let i=t.length;for(;i--;){let n=t[i];if(typeof n=="string"){const s=r(n);s!==n&&(CR(t)||(t[i]=s),n=s)}e[n]=!0}return e}function AR(e){for(let t=0;t<e.length;t++)Si(e,t)||(e[t]=null);return e}function wn(e){const t=vu(null);for(const[r,i]of yS(e))Si(e,r)&&(Array.isArray(i)?t[r]=AR(i):i&&typeof i=="object"&&i.constructor===Object?t[r]=wn(i):t[r]=i);return t}function Ol(e,t){for(;e!==null;){const i=TR(e,t);if(i){if(i.get)return Xr(i.get);if(typeof i.value=="function")return Xr(i.value)}e=kR(e)}function r(){return null}return r}const xv=Kr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Zp=Kr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Jp=Kr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),DR=Kr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),eg=Kr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),PR=Kr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),vv=Kr(["#text"]),bv=Kr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),tg=Kr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Sv=Kr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),tu=Kr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),IR=Wi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$R=Wi(/<%[\w\W]*|[\w\W]*%>/gm),jR=Wi(/\$\{[\w\W]*/gm),OR=Wi(/^data-[\-\w.\u00B7-\uFFFF]+$/),zR=Wi(/^aria-[\-\w]+$/),_S=Wi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),FR=Wi(/^(?:\w+script|data):/i),NR=Wi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xS=Wi(/^html$/i),WR=Wi(/^[a-z][.\w]*(-[.\w]+)+$/i);var wv=Object.freeze({__proto__:null,ARIA_ATTR:zR,ATTR_WHITESPACE:NR,CUSTOM_ELEMENT:WR,DATA_ATTR:OR,DOCTYPE_NAME:xS,ERB_EXPR:$R,IS_ALLOWED_URI:_S,IS_SCRIPT_OR_DATA:FR,MUSTACHE_EXPR:IR,TMPLIT_EXPR:jR});const zl={element:1,text:3,progressingInstruction:7,comment:8,document:9},HR=function(){return typeof window>"u"?null:window},qR=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null;const n="data-tt-policy-suffix";r&&r.hasAttribute(n)&&(i=r.getAttribute(n));const s="dompurify"+(i?"#"+i:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Cv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function vS(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:HR();const t=Be=>vS(Be);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==zl.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const i=r,n=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:u,NodeFilter:h,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:m,trustedTypes:y}=e,x=u.prototype,v=Ol(x,"cloneNode"),S=Ol(x,"remove"),C=Ol(x,"nextSibling"),B=Ol(x,"childNodes"),R=Ol(x,"parentNode");if(typeof a=="function"){const Be=r.createElement("template");Be.content&&Be.content.ownerDocument&&(r=Be.content.ownerDocument)}let E,L="";const{implementation:k,createNodeIterator:A,createDocumentFragment:z,getElementsByTagName:U}=r,{importNode:q}=i;let H=Cv();t.isSupported=typeof yS=="function"&&typeof R=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Y,ERB_EXPR:F,TMPLIT_EXPR:O,DATA_ATTR:$,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:P,CUSTOM_ELEMENT:Z}=wv;let{IS_ALLOWED_URI:ee}=wv,I=null;const Q=et({},[...xv,...Zp,...Jp,...eg,...vv]);let te=null;const X=et({},[...bv,...tg,...Sv,...tu]);let ce=Object.seal(vu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,ye=null;const ve=Object.seal(vu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ce=!0,Ee=!0,Ke=!1,ct=!0,ze=!1,pt=!0,dt=!1,ae=!1,ht=!1,ut=!1,Vt=!1,zr=!1,kr=!0,ki=!1;const Xs="user-content-";let Mt=!0,hn=!1,Ui={},Tr=null;const bt=et({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Qs=null;const un=et({},["audio","video","img","source","image","track"]);let Ti=null;const Jr=et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),In="http://www.w3.org/1998/Math/MathML",$n="http://www.w3.org/2000/svg",_r="http://www.w3.org/1999/xhtml";let ei=_r,Ei=!1,jn=null;const Zs=et({},[In,$n,_r],Xp);let dn=et({},["mi","mo","mn","ms","mtext"]),di=et({},["annotation-xml"]);const fn=et({},["title","style","font","a","script"]);let Vi=null;const Js=["application/xhtml+xml","text/html"],Vo="text/html";let wt=null,fi=null;const os=r.createElement("form"),as=function(G){return G instanceof RegExp||G instanceof Function},Bi=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(fi&&fi===G)){if((!G||typeof G!="object")&&(G={}),G=wn(G),Vi=Js.indexOf(G.PARSER_MEDIA_TYPE)===-1?Vo:G.PARSER_MEDIA_TYPE,wt=Vi==="application/xhtml+xml"?Xp:bu,I=Si(G,"ALLOWED_TAGS")?et({},G.ALLOWED_TAGS,wt):Q,te=Si(G,"ALLOWED_ATTR")?et({},G.ALLOWED_ATTR,wt):X,jn=Si(G,"ALLOWED_NAMESPACES")?et({},G.ALLOWED_NAMESPACES,Xp):Zs,Ti=Si(G,"ADD_URI_SAFE_ATTR")?et(wn(Jr),G.ADD_URI_SAFE_ATTR,wt):Jr,Qs=Si(G,"ADD_DATA_URI_TAGS")?et(wn(un),G.ADD_DATA_URI_TAGS,wt):un,Tr=Si(G,"FORBID_CONTENTS")?et({},G.FORBID_CONTENTS,wt):bt,oe=Si(G,"FORBID_TAGS")?et({},G.FORBID_TAGS,wt):wn({}),ye=Si(G,"FORBID_ATTR")?et({},G.FORBID_ATTR,wt):wn({}),Ui=Si(G,"USE_PROFILES")?G.USE_PROFILES:!1,Ce=G.ALLOW_ARIA_ATTR!==!1,Ee=G.ALLOW_DATA_ATTR!==!1,Ke=G.ALLOW_UNKNOWN_PROTOCOLS||!1,ct=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ze=G.SAFE_FOR_TEMPLATES||!1,pt=G.SAFE_FOR_XML!==!1,dt=G.WHOLE_DOCUMENT||!1,ut=G.RETURN_DOM||!1,Vt=G.RETURN_DOM_FRAGMENT||!1,zr=G.RETURN_TRUSTED_TYPE||!1,ht=G.FORCE_BODY||!1,kr=G.SANITIZE_DOM!==!1,ki=G.SANITIZE_NAMED_PROPS||!1,Mt=G.KEEP_CONTENT!==!1,hn=G.IN_PLACE||!1,ee=G.ALLOWED_URI_REGEXP||_S,ei=G.NAMESPACE||_r,dn=G.MATHML_TEXT_INTEGRATION_POINTS||dn,di=G.HTML_INTEGRATION_POINTS||di,ce=G.CUSTOM_ELEMENT_HANDLING||{},G.CUSTOM_ELEMENT_HANDLING&&as(G.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ce.tagNameCheck=G.CUSTOM_ELEMENT_HANDLING.tagNameCheck),G.CUSTOM_ELEMENT_HANDLING&&as(G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ce.attributeNameCheck=G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),G.CUSTOM_ELEMENT_HANDLING&&typeof G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ze&&(Ee=!1),Vt&&(ut=!0),Ui&&(I=et({},vv),te=vu(null),Ui.html===!0&&(et(I,xv),et(te,bv)),Ui.svg===!0&&(et(I,Zp),et(te,tg),et(te,tu)),Ui.svgFilters===!0&&(et(I,Jp),et(te,tg),et(te,tu)),Ui.mathMl===!0&&(et(I,eg),et(te,Sv),et(te,tu))),Si(G,"ADD_TAGS")||(ve.tagCheck=null),Si(G,"ADD_ATTR")||(ve.attributeCheck=null),G.ADD_TAGS&&(typeof G.ADD_TAGS=="function"?ve.tagCheck=G.ADD_TAGS:(I===Q&&(I=wn(I)),et(I,G.ADD_TAGS,wt))),G.ADD_ATTR&&(typeof G.ADD_ATTR=="function"?ve.attributeCheck=G.ADD_ATTR:(te===X&&(te=wn(te)),et(te,G.ADD_ATTR,wt))),G.ADD_URI_SAFE_ATTR&&et(Ti,G.ADD_URI_SAFE_ATTR,wt),G.FORBID_CONTENTS&&(Tr===bt&&(Tr=wn(Tr)),et(Tr,G.FORBID_CONTENTS,wt)),G.ADD_FORBID_CONTENTS&&(Tr===bt&&(Tr=wn(Tr)),et(Tr,G.ADD_FORBID_CONTENTS,wt)),Mt&&(I["#text"]=!0),dt&&et(I,["html","head","body"]),I.table&&(et(I,["tbody"]),delete oe.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw jl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=G.TRUSTED_TYPES_POLICY,L=E.createHTML("")}else E===void 0&&(E=qR(y,n)),E!==null&&typeof L=="string"&&(L=E.createHTML(""));Kr&&Kr(G),fi=G}},ls=et({},[...Zp,...Jp,...DR]),pn=et({},[...eg,...PR]),Qa=function(G){let pe=R(G);(!pe||!pe.tagName)&&(pe={namespaceURI:ei,tagName:"template"});const ke=bu(G.tagName),yt=bu(pe.tagName);return jn[G.namespaceURI]?G.namespaceURI===$n?pe.namespaceURI===_r?ke==="svg":pe.namespaceURI===In?ke==="svg"&&(yt==="annotation-xml"||dn[yt]):!!ls[ke]:G.namespaceURI===In?pe.namespaceURI===_r?ke==="math":pe.namespaceURI===$n?ke==="math"&&di[yt]:!!pn[ke]:G.namespaceURI===_r?pe.namespaceURI===$n&&!di[yt]||pe.namespaceURI===In&&!dn[yt]?!1:!pn[ke]&&(fn[ke]||!ls[ke]):!!(Vi==="application/xhtml+xml"&&jn[G.namespaceURI]):!1},Jt=function(G){Il(t.removed,{element:G});try{R(G).removeChild(G)}catch{S(G)}},Fr=function(G,pe){try{Il(t.removed,{attribute:pe.getAttributeNode(G),from:pe})}catch{Il(t.removed,{attribute:null,from:pe})}if(pe.removeAttribute(G),G==="is")if(ut||Vt)try{Jt(pe)}catch{}else try{pe.setAttribute(G,"")}catch{}},Nt=function(G){let pe=null,ke=null;if(ht)G="<remove></remove>"+G;else{const jt=Qp(G,/^[\r\n\t ]+/);ke=jt&&jt[0]}Vi==="application/xhtml+xml"&&ei===_r&&(G='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+G+"</body></html>");const yt=E?E.createHTML(G):G;if(ei===_r)try{pe=new m().parseFromString(yt,Vi)}catch{}if(!pe||!pe.documentElement){pe=k.createDocument(ei,"template",null);try{pe.documentElement.innerHTML=Ei?L:yt}catch{}}const Ze=pe.body||pe.documentElement;return G&&ke&&Ze.insertBefore(r.createTextNode(ke),Ze.childNodes[0]||null),ei===_r?U.call(pe,dt?"html":"body")[0]:dt?pe.documentElement:Ze},On=function(G){return A.call(G.ownerDocument||G,G,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},se=function(G){return G instanceof p&&(typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||!(G.attributes instanceof d)||typeof G.removeAttribute!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function")},Me=function(G){return typeof l=="function"&&G instanceof l};function rt(Be,G,pe){eu(Be,ke=>{ke.call(t,G,pe,fi)})}const mt=function(G){let pe=null;if(rt(H.beforeSanitizeElements,G,null),se(G))return Jt(G),!0;const ke=wt(G.nodeName);if(rt(H.uponSanitizeElement,G,{tagName:ke,allowedTags:I}),pt&&G.hasChildNodes()&&!Me(G.firstElementChild)&&Hr(/<[/\w!]/g,G.innerHTML)&&Hr(/<[/\w!]/g,G.textContent)||G.nodeType===zl.progressingInstruction||pt&&G.nodeType===zl.comment&&Hr(/<[/\w]/g,G.data))return Jt(G),!0;if(!(ve.tagCheck instanceof Function&&ve.tagCheck(ke))&&(!I[ke]||oe[ke])){if(!oe[ke]&&Er(ke)&&(ce.tagNameCheck instanceof RegExp&&Hr(ce.tagNameCheck,ke)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(ke)))return!1;if(Mt&&!Tr[ke]){const yt=R(G)||G.parentNode,Ze=B(G)||G.childNodes;if(Ze&&yt){const jt=Ze.length;for(let cr=jt-1;cr>=0;--cr){const Li=v(Ze[cr],!0);Li.__removalCount=(G.__removalCount||0)+1,yt.insertBefore(Li,C(G))}}}return Jt(G),!0}return G instanceof u&&!Qa(G)||(ke==="noscript"||ke==="noembed"||ke==="noframes")&&Hr(/<\/no(script|embed|frames)/i,G.innerHTML)?(Jt(G),!0):(ze&&G.nodeType===zl.text&&(pe=G.textContent,eu([Y,F,O],yt=>{pe=$l(pe,yt," ")}),G.textContent!==pe&&(Il(t.removed,{element:G.cloneNode()}),G.textContent=pe)),rt(H.afterSanitizeElements,G,null),!1)},Gt=function(G,pe,ke){if(ye[pe]||kr&&(pe==="id"||pe==="name")&&(ke in r||ke in os))return!1;if(!(Ee&&!ye[pe]&&Hr($,pe))){if(!(Ce&&Hr(j,pe))){if(!(ve.attributeCheck instanceof Function&&ve.attributeCheck(pe,G))){if(!te[pe]||ye[pe]){if(!(Er(G)&&(ce.tagNameCheck instanceof RegExp&&Hr(ce.tagNameCheck,G)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(G))&&(ce.attributeNameCheck instanceof RegExp&&Hr(ce.attributeNameCheck,pe)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(pe,G))||pe==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&Hr(ce.tagNameCheck,ke)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(ke))))return!1}else if(!Ti[pe]){if(!Hr(ee,$l(ke,P,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&G!=="script"&&MR(ke,"data:")===0&&Qs[G])){if(!(Ke&&!Hr(W,$l(ke,P,"")))){if(ke)return!1}}}}}}}return!0},Er=function(G){return G!=="annotation-xml"&&Qp(G,Z)},Mi=function(G){rt(H.beforeSanitizeAttributes,G,null);const{attributes:pe}=G;if(!pe||se(G))return;const ke={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let yt=pe.length;for(;yt--;){const Ze=pe[yt],{name:jt,namespaceURI:cr,value:Li}=Ze,Gi=wt(jt),Za=Li;let Yt=jt==="value"?Za:LR(Za);if(ke.attrName=Gi,ke.attrValue=Yt,ke.keepAttr=!0,ke.forceKeepAttr=void 0,rt(H.uponSanitizeAttribute,G,ke),Yt=ke.attrValue,ki&&(Gi==="id"||Gi==="name")&&(Fr(jt,G),Yt=Xs+Yt),pt&&Hr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Yt)){Fr(jt,G);continue}if(Gi==="attributename"&&Qp(Yt,"href")){Fr(jt,G);continue}if(ke.forceKeepAttr)continue;if(!ke.keepAttr){Fr(jt,G);continue}if(!ct&&Hr(/\/>/i,Yt)){Fr(jt,G);continue}ze&&eu([Y,F,O],pi=>{Yt=$l(Yt,pi," ")});const eo=wt(G.nodeName);if(!Gt(eo,Gi,Yt)){Fr(jt,G);continue}if(E&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!cr)switch(y.getAttributeType(eo,Gi)){case"TrustedHTML":{Yt=E.createHTML(Yt);break}case"TrustedScriptURL":{Yt=E.createScriptURL(Yt);break}}if(Yt!==Za)try{cr?G.setAttributeNS(cr,jt,Yt):G.setAttribute(jt,Yt),se(G)?Jt(G):_v(t.removed)}catch{Fr(jt,G)}}rt(H.afterSanitizeAttributes,G,null)},Wt=function Be(G){let pe=null;const ke=On(G);for(rt(H.beforeSanitizeShadowDOM,G,null);pe=ke.nextNode();)rt(H.uponSanitizeShadowNode,pe,null),mt(pe),Mi(pe),pe.content instanceof s&&Be(pe.content);rt(H.afterSanitizeShadowDOM,G,null)};return t.sanitize=function(Be){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,ke=null,yt=null,Ze=null;if(Ei=!Be,Ei&&(Be="<!-->"),typeof Be!="string"&&!Me(Be))if(typeof Be.toString=="function"){if(Be=Be.toString(),typeof Be!="string")throw jl("dirty is not a string, aborting")}else throw jl("toString is not a function");if(!t.isSupported)return Be;if(ae||Bi(G),t.removed=[],typeof Be=="string"&&(hn=!1),hn){if(Be.nodeName){const Li=wt(Be.nodeName);if(!I[Li]||oe[Li])throw jl("root node is forbidden and cannot be sanitized in-place")}}else if(Be instanceof l)pe=Nt("<!---->"),ke=pe.ownerDocument.importNode(Be,!0),ke.nodeType===zl.element&&ke.nodeName==="BODY"||ke.nodeName==="HTML"?pe=ke:pe.appendChild(ke);else{if(!ut&&!ze&&!dt&&Be.indexOf("<")===-1)return E&&zr?E.createHTML(Be):Be;if(pe=Nt(Be),!pe)return ut?null:zr?L:""}pe&&ht&&Jt(pe.firstChild);const jt=On(hn?Be:pe);for(;yt=jt.nextNode();)mt(yt),Mi(yt),yt.content instanceof s&&Wt(yt.content);if(hn)return Be;if(ut){if(Vt)for(Ze=z.call(pe.ownerDocument);pe.firstChild;)Ze.appendChild(pe.firstChild);else Ze=pe;return(te.shadowroot||te.shadowrootmode)&&(Ze=q.call(i,Ze,!0)),Ze}let cr=dt?pe.outerHTML:pe.innerHTML;return dt&&I["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&Hr(xS,pe.ownerDocument.doctype.name)&&(cr="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
|
|
101
|
+
`+cr),ze&&eu([Y,F,O],Li=>{cr=$l(cr,Li," ")}),E&&zr?E.createHTML(cr):cr},t.setConfig=function(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bi(Be),ae=!0},t.clearConfig=function(){fi=null,ae=!1},t.isValidAttribute=function(Be,G,pe){fi||Bi({});const ke=wt(Be),yt=wt(G);return Gt(ke,yt,pe)},t.addHook=function(Be,G){typeof G=="function"&&Il(H[Be],G)},t.removeHook=function(Be,G){if(G!==void 0){const pe=ER(H[Be],G);return pe===-1?void 0:BR(H[Be],pe,1)[0]}return _v(H[Be])},t.removeHooks=function(Be){H[Be]=[]},t.removeAllHooks=function(){H=Cv()},t}var Ns=vS();const rg={learn:{label:"Learn",order:0},progress:{label:"Progress",order:1},visual:{label:"Visual",order:2},author:{label:"Author",order:3}},kv=[{command:"/teach",description:"Continue current lesson",category:"learn",hasArg:!0,argPlaceholder:"<module>"},{command:"/teach --quick",description:"Quick reference for current module",category:"learn"},{command:"/teach --quiz-only",description:"Quiz only",category:"learn"},{command:"/teach --game",description:"Play an interactive game",category:"learn"},{command:"/teach --status",description:"Check lesson progress",category:"learn"},{command:"/learn",description:"Learn any topic (auto-generate module)",category:"learn",hasArg:!0,argPlaceholder:"<topic>"},{command:"/ask",description:"Ask a question about module content",category:"learn",hasArg:!0,argPlaceholder:"<question>"},{command:"/stats",description:"XP, belt, and progress dashboard",category:"progress"},{command:"/level-up",description:"Belt roadmap & next steps",category:"progress"},{command:"/journey",description:"Browse learning journeys",category:"progress"},{command:"/canvas",description:"Open the visual canvas",category:"visual"},{command:"/author",description:"Create a learning module",category:"author"},{command:"/author-pack",description:"Create a module pack",category:"author"}];function UR(e){if(!e||e==="/")return kv;const t=e.toLowerCase();return kv.filter(r=>r.command.toLowerCase().startsWith(t))}function VR(e,t){if(!t)return e;const r=t.toLowerCase();return e.filter(i=>i.slug.toLowerCase().includes(r)||i.title.toLowerCase().includes(r))}function GR(e){const t=e.match(/^\/teach\s+(?!--)(.*)$/i);return t?t[1]:null}const bS=8,YR=M.forwardRef(function({input:t,modules:r,onSelect:i,theme:n},s){const[a,l]=M.useState(0),u=M.useRef(null),h=M.useMemo(()=>GR(t),[t]),d=h!==null,p=M.useMemo(()=>{var B;if(d)return VR(r,h).map(E=>({key:`mod-${E.slug}`,primary:E.slug,secondary:E.title,badge:E.difficulty||E.category,value:`/teach ${E.slug}`,isModule:!0}));const x=UR(t),v=new Map;for(const R of x){const E=R.category||"learn";v.has(E)||v.set(E,[]),v.get(E).push(R)}const S=[],C=[...v.entries()].sort((R,E)=>{var L,k;return(((L=rg[R[0]])==null?void 0:L.order)??99)-(((k=rg[E[0]])==null?void 0:k.order)??99)});for(const[R,E]of C)for(const L of E)S.push({key:L.command,primary:L.command,secondary:L.description,badge:((B=rg[R])==null?void 0:B.label)||R,value:L.hasArg?L.command+" ":L.command,hasArg:L.hasArg});return S},[t,d,h,r]);M.useEffect(()=>{l(0)},[t]),M.useEffect(()=>{if(u.current){const x=u.current.querySelector('[data-active="true"]');x&&x.scrollIntoView({block:"nearest"})}},[a]);const m=M.useCallback(x=>{const v=p[x];v&&i(v.value,v.hasArg)},[p,i]);if(M.useImperativeHandle(s,()=>({handleKeyDown(x){return p.length===0?!1:x.key==="ArrowDown"?(x.preventDefault(),l(v=>(v+1)%p.length),!0):x.key==="ArrowUp"?(x.preventDefault(),l(v=>(v-1+p.length)%p.length),!0):x.key==="Enter"||x.key==="Tab"?(x.preventDefault(),m(a),!0):x.key==="Escape"?(x.preventDefault(),!0):!1}}),[p,a,m]),p.length===0)return null;const y=KR(n);return g.jsxs("div",{style:y.container,ref:u,children:[d&&g.jsx("div",{style:y.header,children:"Modules"}),p.slice(0,bS*2).map((x,v)=>g.jsxs("div",{"data-active":v===a?"true":"false",style:{...y.item,backgroundColor:v===a?n.bgTertiary||"#21262d":"transparent"},onMouseEnter:()=>l(v),onMouseDown:S=>{S.preventDefault(),m(v)},children:[g.jsxs("div",{style:y.itemLeft,children:[g.jsx("span",{style:y.primary,children:x.primary}),g.jsx("span",{style:y.secondary,children:x.secondary})]}),g.jsx("span",{style:y.badge,children:x.badge})]},x.key))]})});function KR(e){return{container:{position:"absolute",bottom:"100%",left:0,right:0,marginBottom:4,maxHeight:bS*40,overflowY:"auto",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,boxShadow:"0 -4px 16px rgba(0,0,0,0.3)",zIndex:100,scrollbarWidth:"thin"},header:{padding:"6px 12px 2px",fontSize:11,fontWeight:600,color:e.textSecondary,textTransform:"uppercase",letterSpacing:"0.05em"},item:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"7px 12px",cursor:"pointer",transition:"background-color 0.08s ease",gap:8},itemLeft:{display:"flex",alignItems:"center",gap:8,minWidth:0,flex:1},primary:{fontSize:13,fontWeight:600,color:e.textPrimary,fontFamily:"monospace",whiteSpace:"nowrap"},secondary:{fontSize:12,color:e.textSecondary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},badge:{fontSize:10,fontWeight:600,color:e.accent,backgroundColor:`${e.accent}18`,padding:"2px 7px",borderRadius:8,whiteSpace:"nowrap",flexShrink:0,textTransform:"capitalize"}}}const XR=/<!--\s*buttons:\s*(\{[\s\S]*?\})\s*-->/g,QR=["single","multi","rating"],ZR=/<!--\s*suggestions:\s*(\[[\s\S]*?\])\s*-->/,JR=[{re:/<!--\s*list:\s*(\{[\s\S]*?\})\s*-->/g,type:"list",required:["items"]},{re:/<!--\s*progress:\s*(\{[\s\S]*?\})\s*-->/g,type:"progress",required:["current","total"]},{re:/<!--\s*card:\s*(\{[\s\S]*?\})\s*-->/g,type:"card",required:["content"]},{re:/<!--\s*code:\s*(\{[\s\S]*?\})\s*-->/g,type:"code",required:["code"]},{re:/<!--\s*steps:\s*(\{[\s\S]*?\})\s*-->/g,type:"steps",required:["steps"]}];function e3(e){if(!e)return{cleanText:"",buttons:[]};const t=[];let r=e;for(const i of[...e.matchAll(XR)]){let n;try{n=JSON.parse(i[1])}catch{continue}if(!n||typeof n!="object"||typeof n.id!="string"||!n.id||!QR.includes(n.type)||!Array.isArray(n.options)||n.options.length===0)continue;const s=n.options.filter(a=>a&&typeof a.label=="string"&&typeof a.value=="string");s.length!==0&&(t.push({id:n.id,type:n.type,prompt:typeof n.prompt=="string"?n.prompt:void 0,options:s}),r=r.replace(i[0],""))}return{cleanText:r.trim(),buttons:t}}function t3(e){if(!e)return{cleanText:"",blocks:[]};const t=[];let r=e;for(const{re:i,type:n,required:s}of JR){i.lastIndex=0;for(const a of[...e.matchAll(i)]){let l;try{l=JSON.parse(a[1])}catch{continue}!l||typeof l!="object"||typeof l.id!="string"||!l.id||s.some(u=>l[u]==null)||(t.push({blockType:n,...l}),r=r.replace(a[0],""))}}return{cleanText:r.trim(),blocks:t}}function r3(e){return e&&e.replace(ZR,"").trim()}ot.setOptions({breaks:!0,gfm:!0});function SS(e){try{return{__html:Ns.sanitize(ot.parse(e))}}catch{return{__html:Ns.sanitize(e)}}}const i3=[{label:"▶ Continue lesson",text:"/teach"},{label:"🎮 Quick game",text:"/teach --game"},{label:"📝 Quiz me",text:"/teach --quiz-only"},{label:"📖 Learn something new",text:"/learn"},{label:"🗺 Browse Journeys",text:"/teach:journey"}],n3=[{label:"▶ Continue",text:"/teach"},{label:"📝 Quiz me",text:"/teach --quiz-only"},{label:"💡 Hint",text:"Give me a hint"},{label:"📖 Quick ref",text:"/teach --quick"}];function s3({buttons:e,onSend:t,isGenerating:r,theme:i}){const[n,s]=M.useState({});if(!e||e.length===0)return null;const a=(u,h)=>{n[u]||r||(s(d=>({...d,[u]:h})),t(h))},l=(u,h)=>{if(n[u]||r)return;const d=h.join(", ");s(p=>({...p,[u]:d})),t(d)};return e.map(u=>g.jsx(o3,{btn:u,selectedValue:n[u.id],isGenerating:r,onSingleClick:h=>a(u.id,h),onMultiSubmit:h=>l(u.id,h),theme:i},u.id))}function o3({btn:e,selectedValue:t,isGenerating:r,onSingleClick:i,onMultiSubmit:n,theme:s}){const[a,l]=M.useState([]),u=t!==void 0,h=u||r,d=v=>{h||l(S=>S.includes(v)?S.filter(C=>C!==v):[...S,v])},p={padding:"6px 14px",fontSize:13,fontFamily:"inherit",borderRadius:8,cursor:h?"default":"pointer",transition:"background-color 0.15s ease, border-color 0.15s ease",borderWidth:1,borderStyle:"solid",borderColor:s.border,backgroundColor:s.bgTertiary||"#21262d",color:s.textPrimary,opacity:h?.55:1},m={...p,backgroundColor:s.success||"#238636",borderColor:s.success||"#238636",color:"#fff",opacity:1},y={...p,backgroundColor:`${s.accent}22`,borderColor:s.accent,color:s.accent};if(e.type==="rating"){const v=e.options||[1,2,3,4,5].map(S=>({label:`${S} ⭐`,value:String(S)}));return g.jsxs("div",{style:{marginTop:10},children:[e.prompt&&g.jsx("div",{style:{fontSize:12,color:s.textSecondary,marginBottom:6},children:e.prompt}),g.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:v.map(S=>g.jsx("button",{style:t===S.value?m:p,onClick:()=>i(S.value),disabled:h,children:S.label},S.value))})]})}if(e.type==="multi"){const v=e.options||[];return g.jsxs("div",{style:{marginTop:10},children:[e.prompt&&g.jsx("div",{style:{fontSize:12,color:s.textSecondary,marginBottom:6},children:e.prompt}),g.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:[v.map(S=>{const C=a.includes(S.value);return g.jsxs("button",{style:u&&(t!=null&&t.includes(S.value))?m:C?y:p,onClick:()=>d(S.value),disabled:h,children:[C&&!u?"✓ ":"",S.label]},S.value)}),!u&&g.jsx("button",{style:{...p,backgroundColor:a.length>0?s.success||"#238636":s.bgTertiary||"#21262d",color:a.length>0?"#fff":s.textSecondary,borderColor:a.length>0?s.success||"#238636":s.border,opacity:a.length>0&&!r?1:.55,cursor:a.length>0&&!r?"pointer":"default"},onClick:()=>a.length>0&&n(a),disabled:a.length===0||r,children:"Submit"})]})]})}const x=e.options||[];return g.jsxs("div",{style:{marginTop:10},children:[e.prompt&&g.jsx("div",{style:{fontSize:12,color:s.textSecondary,marginBottom:6},children:e.prompt}),g.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:x.map(v=>g.jsx("button",{style:t===v.value?m:p,onClick:()=>i(v.value),disabled:h,children:v.label},v.value))})]})}const Tv={book:"📖",code:"💻",rocket:"🚀",star:"⭐",check:"✅",warning:"⚠️",bulb:"💡",gear:"⚙️",puzzle:"🧩",target:"🎯",fire:"🔥",trophy:"🏆",heart:"❤️",flag:"🚩",pin:"📌",zap:"⚡"};function a3({block:e,onSend:t,theme:r}){const{style:i="cards",items:n=[]}=e;return i==="checklist"?g.jsx("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:6},children:n.map((s,a)=>g.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,padding:"6px 10px",borderRadius:6,backgroundColor:`${r.bgTertiary||"#21262d"}88`,cursor:s.action?"pointer":"default"},onClick:()=>s.action&&t(s.action),children:[g.jsx("span",{style:{fontSize:14,flexShrink:0,marginTop:1},children:"☐"}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:13,color:r.textPrimary,fontWeight:500},children:s.title}),s.description&&g.jsx("div",{style:{fontSize:12,color:r.textSecondary,marginTop:2},children:s.description})]})]},a))}):i==="numbered"?g.jsx("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:6},children:n.map((s,a)=>g.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,padding:"6px 10px",cursor:s.action?"pointer":"default"},onClick:()=>s.action&&t(s.action),children:[g.jsx("span",{style:{width:22,height:22,borderRadius:"50%",backgroundColor:r.accent,color:"#fff",fontSize:12,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:a+1}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:13,color:r.textPrimary,fontWeight:500},children:s.title}),s.description&&g.jsx("div",{style:{fontSize:12,color:r.textSecondary,marginTop:2},children:s.description})]})]},a))}):i==="compact"?g.jsx("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:4},children:n.map((s,a)=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:4,cursor:s.action?"pointer":"default",fontSize:13,color:r.textPrimary},onClick:()=>s.action&&t(s.action),children:[s.icon&&g.jsx("span",{style:{fontSize:14},children:Tv[s.icon]||s.icon}),g.jsx("span",{style:{fontWeight:500},children:s.title}),s.description&&g.jsxs("span",{style:{color:r.textSecondary,marginLeft:4},children:["—"," ",s.description]})]},a))}):g.jsx("div",{style:{marginTop:10,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))",gap:8},children:n.map((s,a)=>g.jsxs("div",{style:{padding:"10px 12px",borderRadius:8,border:`1px solid ${r.border}`,backgroundColor:r.bgPrimary,cursor:s.action?"pointer":"default",transition:"border-color 0.15s ease"},onClick:()=>s.action&&t(s.action),children:[s.icon&&g.jsx("div",{style:{fontSize:20,marginBottom:4},children:Tv[s.icon]||s.icon}),g.jsx("div",{style:{fontSize:13,fontWeight:600,color:r.textPrimary},children:s.title}),s.description&&g.jsx("div",{style:{fontSize:12,color:r.textSecondary,marginTop:3},children:s.description})]},a))})}function l3({block:e,theme:t}){const{label:r,current:i=0,total:n=1,style:s="bar"}=e,a=Math.min(100,Math.round(i/n*100));if(s==="ring"){const h=2*Math.PI*28,d=h-a/100*h;return g.jsxs("div",{style:{marginTop:10,display:"flex",alignItems:"center",gap:12},children:[g.jsxs("svg",{width:70,height:70,viewBox:"0 0 70 70",children:[g.jsx("circle",{cx:"35",cy:"35",r:28,fill:"none",stroke:t.border,strokeWidth:5}),g.jsx("circle",{cx:"35",cy:"35",r:28,fill:"none",stroke:t.accent,strokeWidth:5,strokeDasharray:h,strokeDashoffset:d,strokeLinecap:"round",transform:"rotate(-90 35 35)",style:{transition:"stroke-dashoffset 0.4s ease"}}),g.jsxs("text",{x:"35",y:"38",textAnchor:"middle",fontSize:"14",fontWeight:"700",fill:t.textPrimary,children:[a,"%"]})]}),r&&g.jsx("div",{style:{fontSize:13,color:t.textSecondary},children:r})]})}return s==="steps"?g.jsxs("div",{style:{marginTop:10},children:[r&&g.jsx("div",{style:{fontSize:12,color:t.textSecondary,marginBottom:6},children:r}),g.jsx("div",{style:{display:"flex",alignItems:"center",gap:4},children:Array.from({length:n},(l,u)=>g.jsxs(nS.Fragment,{children:[g.jsx("div",{style:{width:24,height:24,borderRadius:"50%",fontSize:11,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:u<i?t.accent:u===i?`${t.accent}44`:t.bgTertiary||"#21262d",color:u<i?"#fff":u===i?t.accent:t.textSecondary,border:u===i?`2px solid ${t.accent}`:"2px solid transparent"},children:u+1}),u<n-1&&g.jsx("div",{style:{flex:1,height:2,minWidth:12,backgroundColor:u<i?t.accent:t.border}})]},u))})]}):g.jsxs("div",{style:{marginTop:10},children:[r&&g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:12,color:t.textSecondary,marginBottom:4},children:[g.jsx("span",{children:r}),g.jsxs("span",{children:[i,"/",n]})]}),g.jsx("div",{style:{height:8,borderRadius:4,backgroundColor:t.bgTertiary||"#21262d",overflow:"hidden"},children:g.jsx("div",{style:{height:"100%",borderRadius:4,backgroundColor:t.accent,width:`${a}%`,transition:"width 0.4s ease"}})})]})}const Ev={tip:{border:"#58a6ff",bg:"#58a6ff15",icon:"💡"},warning:{border:"#d29922",bg:"#d2992215",icon:"⚠️"},error:{border:"#f85149",bg:"#f8514915",icon:"❌"},success:{border:"#3fb950",bg:"#3fb95015",icon:"✅"},concept:{border:"#bc8cff",bg:"#bc8cff15",icon:"🧠"}};function c3({block:e,theme:t}){const{type:r="tip",title:i,content:n}=e,s=Ev[r]||Ev.tip;return g.jsxs("div",{style:{marginTop:10,padding:"10px 14px",borderRadius:8,borderLeft:`4px solid ${s.border}`,backgroundColor:s.bg},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:i?6:0},children:[g.jsx("span",{style:{fontSize:16},children:s.icon}),i&&g.jsx("span",{style:{fontSize:13,fontWeight:600,color:t.textPrimary},children:i})]}),g.jsx("div",{style:{fontSize:13,color:t.textPrimary,lineHeight:1.5},dangerouslySetInnerHTML:SS(n)})]})}function h3({block:e,theme:t}){const{language:r="text",filename:i,code:n,highlight:s=[]}=e,[a,l]=M.useState(!1),u=n.split(`
|
|
102
|
+
`),h=()=>{navigator.clipboard.writeText(n).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)}).catch(()=>{})};return g.jsxs("div",{style:{marginTop:10,borderRadius:8,border:`1px solid ${t.border}`,overflow:"hidden"},children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"6px 12px",backgroundColor:t.bgTertiary||"#21262d",borderBottom:`1px solid ${t.border}`},children:[g.jsx("span",{style:{fontSize:12,color:t.textSecondary,fontFamily:"monospace"},children:i||r}),g.jsx("button",{onClick:h,style:{background:"none",border:"none",color:t.textSecondary,cursor:"pointer",fontSize:12,padding:"2px 6px",borderRadius:4},children:a?"✓ Copied":"Copy"})]}),g.jsx("pre",{style:{margin:0,padding:"10px 12px",fontSize:13,fontFamily:"monospace",color:t.textPrimary,backgroundColor:t.bgPrimary,overflow:"auto",lineHeight:1.6},children:u.map((d,p)=>g.jsx("div",{style:{padding:"0 4px",backgroundColor:s.includes(p+1)?`${t.accent}22`:"transparent",borderLeft:s.includes(p+1)?`3px solid ${t.accent}`:"3px solid transparent"},children:d||" "},p))})]})}function u3({block:e,theme:t}){const{steps:r=[]}=e,i={done:{color:t.success||"#3fb950",icon:"✓",bg:`${t.success||"#3fb950"}22`},active:{color:t.accent,icon:"▶",bg:`${t.accent}22`},pending:{color:t.textSecondary,icon:"○",bg:"transparent"}};return g.jsx("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:0},children:r.map((n,s)=>{const a=i[n.status]||i.pending,l=s===r.length-1;return g.jsxs("div",{style:{display:"flex",gap:10,minHeight:36},children:[g.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",width:24},children:[g.jsx("div",{style:{width:24,height:24,borderRadius:"50%",fontSize:12,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:a.bg,color:a.color,border:n.status==="active"?`2px solid ${a.color}`:"2px solid transparent"},children:a.icon}),!l&&g.jsx("div",{style:{flex:1,width:2,minHeight:12,backgroundColor:n.status==="done"?t.success||"#3fb950":t.border}})]}),g.jsx("div",{style:{fontSize:13,paddingTop:3,color:n.status==="pending"?t.textSecondary:t.textPrimary,fontWeight:n.status==="active"?600:400},children:n.label})]},s)})})}function d3({blocks:e,onSend:t,theme:r}){return!e||e.length===0?null:e.map((i,n)=>{switch(i.blockType){case"list":return g.jsx(a3,{block:i,onSend:t,theme:r},i.id||n);case"progress":return g.jsx(l3,{block:i,theme:r},i.id||n);case"card":return g.jsx(c3,{block:i,theme:r},i.id||n);case"code":return g.jsx(h3,{block:i,theme:r},i.id||n);case"steps":return g.jsx(u3,{block:i,theme:r},i.id||n);default:return null}})}function f3({tool:e,theme:t}){const[r,i]=M.useState(!1);if(!e)return null;const n=typeof e.input=="string"?e.input:JSON.stringify(e.input,null,2);return g.jsxs("div",{style:{maxWidth:"90%",border:`1px solid ${t.border}`,borderRadius:8,overflow:"hidden",marginTop:4},children:[g.jsxs("button",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 12px",fontSize:12,color:t.textSecondary,backgroundColor:t.bgPrimary,border:"none",cursor:"pointer",textAlign:"left"},onClick:()=>i(!r),children:[g.jsx("span",{style:{fontSize:10,width:12},children:r?"▼":"▶"}),g.jsx("span",{style:{fontFamily:"monospace",color:t.purple},children:e.toolName}),e.output!==void 0&&g.jsx("span",{style:{color:t.success,marginLeft:"auto"},children:"✓"})]}),r&&g.jsxs("div",{style:{padding:"8px 12px",backgroundColor:t.bgPrimary,borderTop:`1px solid ${t.bgTertiary}`},children:[n&&g.jsx("pre",{style:{margin:0,padding:8,fontSize:12,fontFamily:"monospace",color:t.textPrimary,backgroundColor:t.bgSecondary,borderRadius:4,overflow:"auto",maxHeight:200,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:n}),e.output!==void 0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{style:{fontSize:11,color:t.textSecondary,marginTop:8,marginBottom:4},children:"Output"}),g.jsx("pre",{style:{margin:0,padding:8,fontSize:12,fontFamily:"monospace",color:t.textPrimary,backgroundColor:t.bgSecondary,borderRadius:4,overflow:"auto",maxHeight:200,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2)})]})]})]})}function p3({messages:e,isStreaming:t,status:r,onSend:i,onStop:n,onNewChat:s,onResume:a,sessions:l,sessionId:u,compact:h,suggestions:d,onMediaClick:p,sessionTitle:m,onToggleDrawer:y,drawerOpen:x}){const{theme:v}=Bt(),S=M.useMemo(()=>g3(v),[v]),[C,B]=M.useState(""),[R,E]=M.useState([]),[L,k]=M.useState(!1),A=M.useRef(null),z=M.useRef(null),U=M.useRef(null),q=M.useMemo(()=>e.map(X=>{if(X.role!=="assistant"||X._streaming||X.buttons||X.blocks||!X.text||!/<!--\s*(buttons|list|progress|card|code|steps|suggestions):/.test(X.text))return X;const{cleanText:oe,buttons:ye}=e3(X.text),{cleanText:ve,blocks:Ce}=t3(oe),Ee=r3(ve),Ke={...X,text:Ee};return ye.length>0&&(Ke.buttons=ye),Ce.length>0&&(Ke.blocks=Ce),Ke}),[e]);M.useEffect(()=>{fetch("http://localhost:3456/api/modules").then(X=>X.ok?X.json():null).then(X=>{X!=null&&X.modules&&E(X.modules)}).catch(()=>{})},[]);const H=M.useCallback(X=>{if(!p)return;const ce=X.target.closest("img");if(ce){X.preventDefault(),X.stopPropagation(),p({type:"image",url:ce.src,alt:ce.alt});return}const oe=X.target.closest("a");oe!=null&&oe.href&&(X.preventDefault(),X.stopPropagation(),p({type:"link",url:oe.href,title:oe.textContent}))},[p]),Y=M.useCallback(()=>{var X;(X=A.current)==null||X.scrollIntoView({behavior:"smooth"})},[]);M.useEffect(()=>{Y()},[e,Y]);const F=M.useCallback(()=>{const X=C.trim();!X||t||(i(X),B(""),k(!1))},[C,t,i]),O=M.useCallback(X=>{if(L&&U.current){if(X.key==="Escape"){X.preventDefault(),k(!1);return}if(U.current.handleKeyDown(X))return}X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),F())},[F,L]),$=M.useCallback(X=>{const ce=X.target.value;B(ce),k(ce.startsWith("/")&&ce.length>0)},[]),j=M.useCallback((X,ce)=>{var oe;B(X),k(!!ce),(oe=z.current)==null||oe.focus()},[]),W=M.useCallback(X=>{r==="thinking"||r==="streaming"||i(X)},[r,i]),P=r==="thinking"||r==="streaming",Z=q.length===0,ee=C.trim().length>0,I=d&&d.length>0?d:n3,Q=d&&d.length>0,te=(u||Q)&&!P&&!ee&&!h;return g.jsxs("div",{style:S.container,children:[g.jsxs("div",{style:S.sessionHeader,children:[g.jsx("button",{onClick:y,style:S.drawerToggle,title:x?"Close sessions":"View sessions",children:g.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[g.jsx("rect",{x:"3",y:"3",width:"7",height:"18",rx:"1"}),g.jsx("line",{x1:"14",y1:"4",x2:"21",y2:"4"}),g.jsx("line",{x1:"14",y1:"9",x2:"21",y2:"9"}),g.jsx("line",{x1:"14",y1:"14",x2:"19",y2:"14"})]})}),m&&g.jsx("span",{style:S.sessionTitle,children:m})]}),g.jsxs("div",{style:S.messageList,children:[Z&&g.jsxs("div",{style:S.welcome,children:[g.jsx("div",{style:S.welcomeTitle,children:"Socrates"}),g.jsx("div",{style:S.welcomeSubtitle,children:"Ask me anything, or try a command:"}),g.jsx("div",{style:S.welcomeCommands,children:["/teach git","/teach react-fundamentals","/stats"].map(X=>g.jsx("button",{style:S.commandChip,onClick:()=>{var ce;B(X),(ce=z.current)==null||ce.focus()},children:X},X))})]}),q.map(X=>{var ce,oe;return X.role==="user"?g.jsxs("div",{style:S.userRow,children:[!h&&g.jsx("div",{style:S.roleLabel,children:"You"}),g.jsx("div",{style:S.userBubble,children:X.text})]},X.id):X.role==="assistant"?g.jsxs("div",{style:S.assistantRow,children:[!h&&g.jsx("div",{style:S.roleLabel,children:"Claude"}),g.jsxs("div",{style:S.assistantBubble,children:[g.jsx("div",{style:S.markdown,dangerouslySetInnerHTML:SS(X.text||""),onClick:H}),X._streaming&&g.jsx("span",{style:S.cursor,children:"|"}),X.blocks&&X.blocks.length>0&&!X._streaming&&g.jsx(d3,{blocks:X.blocks,onSend:i,theme:v}),X.buttons&&X.buttons.length>0&&!X._streaming&&g.jsx(s3,{buttons:X.buttons,onSend:i,isGenerating:P,theme:v})]})]},X.id):X.role==="tool-use"?g.jsx(f3,{tool:X.data,theme:v},X.id):X.role==="tool-result"?g.jsx("div",{style:S.assistantRow,children:g.jsx("div",{style:{maxWidth:"90%",border:`1px solid ${v.border}`,borderRadius:8,overflow:"hidden",marginTop:4},children:g.jsxs("div",{style:{padding:"8px 12px",backgroundColor:v.bgPrimary},children:[g.jsx("div",{style:{fontSize:11,color:v.textSecondary,marginBottom:4},children:"Tool Result"}),g.jsx("pre",{style:{margin:0,padding:8,fontSize:12,fontFamily:"monospace",color:v.textPrimary,backgroundColor:v.bgSecondary,borderRadius:4,overflow:"auto",maxHeight:200,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:typeof((ce=X.data)==null?void 0:ce.output)=="string"?X.data.output:JSON.stringify((oe=X.data)==null?void 0:oe.output,null,2)})]})})},X.id):X.role==="error"?g.jsx("div",{style:S.assistantRow,children:g.jsx("div",{style:{...S.assistantBubble,borderColor:v.error},children:g.jsx("span",{style:{color:v.error},children:X.text})})},X.id):null}),r==="thinking"&&g.jsxs("div",{style:S.statusRow,children:[g.jsx("span",{style:S.statusDot}),"Thinking..."]}),g.jsx("div",{ref:A})]}),Z&&!h&&g.jsx("div",{style:S.quickActions,children:i3.map(X=>g.jsx("button",{style:S.quickActionChip,onClick:()=>W(X.text),disabled:P,children:X.label},X.text))}),!Z&&te&&g.jsx("div",{style:S.suggestionStrip,children:I.map(X=>g.jsx("button",{style:S.suggestionChip,onClick:()=>W(X.text),children:X.label},X.text))}),g.jsxs("div",{style:S.inputArea,children:[L&&g.jsx(YR,{ref:U,input:C,modules:R,onSelect:j,theme:v}),g.jsx("textarea",{ref:z,value:C,onChange:$,onKeyDown:O,placeholder:"Type a message or / for commands...",style:S.textarea,rows:1}),t?g.jsx("button",{style:S.stopButton,onClick:n,children:"Stop"}):g.jsx("button",{style:{...S.sendButton,opacity:C.trim()?1:.4},onClick:F,disabled:!C.trim(),children:"Send"})]})]})}function g3(e){return{container:{display:"flex",flexDirection:"column",height:"100%",minWidth:0},sessionHeader:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderBottom:`1px solid ${e.border}`,flexShrink:0,minHeight:36},drawerToggle:{background:"none",border:"none",color:e.textSecondary,cursor:"pointer",padding:4,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1},sessionTitle:{fontSize:13,fontWeight:500,color:e.textSecondary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},messageList:{flex:1,overflowY:"auto",padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},welcome:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,gap:12,paddingTop:80},welcomeTitle:{fontSize:28,fontWeight:700,color:e.accent},welcomeSubtitle:{fontSize:15,color:e.textSecondary},welcomeCommands:{display:"flex",gap:8,marginTop:8,flexWrap:"wrap",justifyContent:"center"},commandChip:{padding:"6px 14px",fontSize:13,color:e.accent,backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:16,cursor:"pointer",fontFamily:"inherit"},userRow:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},assistantRow:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},roleLabel:{fontSize:11,fontWeight:600,color:e.textSecondary,textTransform:"uppercase",letterSpacing:"0.04em"},userBubble:{maxWidth:"80%",padding:"10px 14px",backgroundColor:e.userBubble,color:"#fff",borderRadius:"16px 16px 4px 16px",fontSize:14,lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},assistantBubble:{maxWidth:"90%",padding:"10px 14px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:"16px 16px 16px 4px",fontSize:14,lineHeight:1.6},markdown:{color:e.textPrimary,wordBreak:"break-word"},cursor:{color:e.accent,animation:"blink 1s step-end infinite"},statusRow:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:e.textSecondary,padding:"4px 0"},statusDot:{width:8,height:8,borderRadius:"50%",backgroundColor:e.warning,animation:"pulse 1.5s ease-in-out infinite"},quickActions:{display:"flex",gap:6,padding:"8px 20px",flexWrap:"wrap"},quickActionChip:{padding:"6px 12px",fontSize:12,color:e.accent,backgroundColor:`${e.accent}11`,border:`1px solid ${e.accent}33`,borderRadius:16,cursor:"pointer",fontFamily:"inherit",transition:"background-color 0.15s ease"},suggestionStrip:{display:"flex",gap:6,padding:"6px 20px",overflowX:"auto",flexShrink:0,scrollbarWidth:"none"},suggestionChip:{padding:"5px 12px",fontSize:12,color:e.accent,backgroundColor:`${e.accent}0d`,border:`1px solid ${e.accent}26`,borderRadius:16,cursor:"pointer",fontFamily:"inherit",whiteSpace:"nowrap",flexShrink:0,transition:"background-color 0.15s ease, border-color 0.15s ease"},inputArea:{position:"relative",display:"flex",alignItems:"flex-end",gap:8,padding:"12px 20px",borderTop:`1px solid ${e.border}`,backgroundColor:e.bgPrimary},textarea:{flex:1,padding:"10px 14px",fontSize:14,color:e.textPrimary,backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,resize:"none",outline:"none",fontFamily:"inherit",lineHeight:1.5,maxHeight:120,overflow:"auto"},sendButton:{padding:"10px 20px",fontSize:14,fontWeight:600,color:"#fff",backgroundColor:e.userBubble,border:"none",borderRadius:12,cursor:"pointer",flexShrink:0},stopButton:{padding:"10px 20px",fontSize:14,fontWeight:600,color:"#fff",backgroundColor:e.errorButton,border:"none",borderRadius:12,cursor:"pointer",flexShrink:0}}}const m3="http://localhost:3456";function y3({data:e,getBelt:t,getNextBelt:r,BELTS:i}){var R;const{theme:n}=Bt(),s=M.useMemo(()=>b3(n),[n]),a=(e==null?void 0:e.progress)||{xp:0,modules:[],streak:0},l=(e==null?void 0:e.achievements)||{unlocked:[],near:[]},u=a.xp||0,h=a.streak||0,d=M.useMemo(()=>t(u),[u,t]),p=M.useMemo(()=>r(u),[u,r]),m=a.modules||[],y=a.continueModule||null,x=m.filter(E=>E.status==="completed").length,v=a.totalCount||m.length||0,S=M.useMemo(()=>{if(!p)return 100;const E=d.minXP,L=p.minXP;return Math.min(100,Math.max(0,(u-E)/(L-E)*100))},[u,d,p]),C=((R=l.unlocked)==null?void 0:R.slice(-3).reverse())||[],B=(l.near||[]).slice(0,4);return g.jsxs("div",{style:s.container,children:[g.jsxs("div",{style:s.heroSection,children:[g.jsxs("div",{style:{...s.beltCard,background:`linear-gradient(135deg, ${d.color}15, ${d.color}08)`,border:`1px solid ${d.color}33`},children:[g.jsx("div",{style:{...s.beltIcon,borderColor:d.color,boxShadow:`0 0 20px ${d.color}25`},children:g.jsx("span",{style:s.beltEmoji,children:d.badge})}),g.jsxs("div",{style:s.beltInfo,children:[g.jsxs("h2",{style:s.beltName,children:[d.name," Belt"]}),g.jsxs("p",{style:s.xpText,children:[u.toLocaleString()," XP"]})]}),g.jsx("span",{style:{...s.beltWatermark,color:d.color},children:d.badge})]}),g.jsxs("div",{style:s.progressCard,children:[g.jsxs("div",{style:s.progressHeader,children:[g.jsx("span",{style:s.progressLabel,children:p?`Next: ${p.badge} ${p.name} Belt`:"Max Level!"}),g.jsx("span",{style:s.progressValue,children:p?`${(p.minXP-u).toLocaleString()} XP to go`:""})]}),g.jsx("div",{style:s.progressBar,children:g.jsx("div",{style:{...s.progressFill,width:`${S}%`,background:`linear-gradient(90deg, ${d.color}, ${(p==null?void 0:p.color)||d.color})`}})}),g.jsxs("div",{style:s.statsRow,children:[g.jsxs("div",{style:s.statItem,children:[g.jsx("span",{style:{color:n.success,fontWeight:700},children:x}),g.jsx("span",{style:{color:n.textSecondary,fontSize:11},children:"Completed"})]}),g.jsxs("div",{style:s.statItem,children:[g.jsx("span",{style:{color:n.accent,fontWeight:700},children:v}),g.jsx("span",{style:{color:n.textSecondary,fontSize:11},children:"Total"})]})]})]}),g.jsxs("div",{style:s.streakCard,children:[g.jsx("span",{style:s.streakIcon,children:h>0?"🔥":"❄️"}),g.jsxs("div",{children:[g.jsxs("p",{style:s.streakCount,children:[h," day streak"]}),g.jsx("p",{style:s.streakSubtext,children:h>0?"Keep it going!":"Start learning today!"})]})]})]}),y&&g.jsx("div",{style:s.section,children:g.jsxs("div",{style:s.continueCard,children:[g.jsx("span",{style:s.continueIcon,children:y.icon||"📖"}),g.jsxs("div",{style:s.continueInfo,children:[g.jsx("h4",{style:s.continueTitle,children:y.title||y.slug}),g.jsxs("p",{style:s.continueStep,children:["Step ",y.step," of ",y.totalSteps]}),g.jsx("div",{style:s.continueProgressBar,children:g.jsx("div",{style:{...s.continueProgressFill,width:`${y.step/y.totalSteps*100}%`}})})]}),g.jsx("div",{style:s.continueCta,children:"Continue →"})]})}),g.jsx(_3,{theme:n}),g.jsxs("div",{style:s.section,children:[g.jsx("div",{style:s.sectionHeader,children:g.jsx("h3",{style:s.sectionTitle,children:"Achievements"})}),C.length>0?g.jsxs("div",{style:s.achievementGrid,children:[C.map(E=>g.jsx(Bv,{achievement:E,state:"unlocked",theme:n},E.id)),B.map(E=>g.jsx(Bv,{achievement:E,state:"near",theme:n},E.id))]}):g.jsxs("div",{style:s.achievementEmpty,children:[g.jsx("span",{style:{fontSize:32,opacity:.4},children:"🏆"}),g.jsx("p",{style:{color:n.textSecondary,fontSize:13,margin:0},children:"Complete activities to earn achievements"})]})]}),g.jsxs("div",{style:s.section,children:[g.jsx("h3",{style:s.sectionTitle,children:"Belt Roadmap"}),g.jsx("div",{style:s.roadmap,children:i.map((E,L)=>{const k=u>=E.minXP,A=d.name===E.name;return g.jsxs("div",{style:{...s.roadmapItem,opacity:k?1:.35},children:[g.jsx("div",{style:{...s.roadmapDot,backgroundColor:k?`${E.color}22`:n.bgTertiary,border:A?`2px solid ${E.color}`:`2px solid ${k?E.color+"66":n.border}`,boxShadow:A?`0 0 12px ${E.color}40`:"none"},children:g.jsx("span",{style:{fontSize:14},children:E.badge})}),g.jsx("span",{style:{...s.roadmapLabel,color:A?n.textPrimary:n.textSecondary,fontWeight:A?600:400},children:E.name}),g.jsxs("span",{style:s.roadmapXP,children:[E.minXP," XP"]}),L<i.length-1&&g.jsx("div",{style:{...s.roadmapLine,backgroundColor:u>=i[L+1].minXP?E.color:n.border}})]},E.name)})})]}),g.jsxs("div",{style:s.section,children:[g.jsx("h3",{style:s.sectionTitle,children:"Modules"}),m.length===0?g.jsxs("div",{style:s.emptyState,children:[g.jsx("p",{style:s.emptyTitle,children:"No modules yet"}),g.jsxs("p",{style:s.emptySubtext,children:["Start a lesson with ",g.jsx("code",{style:s.code,children:"/teach"})," to begin learning"]})]}):g.jsx("div",{style:s.moduleGrid,children:m.map(E=>g.jsx(x3,{module:E,theme:n},E.slug))})]})]})}function _3({theme:e}){var a;const[t,r]=M.useState(null);if(M.useEffect(()=>{fetch(`${m3}/api/journeys`).then(l=>l.ok?l.json():null).then(l=>{if(!(l!=null&&l.activeJourney)||!(l!=null&&l.journeys))return;const u=l.journeys.find(h=>h.slug===l.activeJourney);u&&r(u)}).catch(()=>{})},[]),!t)return null;const{stats:i}=t,n=t.stages[i.currentStageIndex],s=(a=n==null?void 0:n.modules)==null?void 0:a.find(l=>l.status==="available"||l.status==="in_progress");return g.jsxs("div",{style:{padding:16,backgroundColor:`${e.accent}10`,border:`1px solid ${e.accent}33`,borderRadius:12,marginBottom:16},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:[g.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:g.jsx("span",{style:{fontSize:11,fontWeight:600,color:e.accent,textTransform:"uppercase",letterSpacing:"0.5px"},children:"Active Journey"})}),g.jsxs("span",{style:{fontSize:11,color:e.textSecondary},children:["Stage ",i.currentStageIndex+1,"/",i.totalStages]})]}),g.jsx("h4",{style:{fontSize:15,fontWeight:600,color:e.textPrimary,margin:"0 0 4px 0"},children:t.title}),n&&g.jsx("p",{style:{fontSize:12,color:e.textSecondary,margin:"0 0 8px 0"},children:n.name}),g.jsx("div",{style:{height:4,borderRadius:2,backgroundColor:`${e.accent}22`,overflow:"hidden",marginBottom:6},children:g.jsx("div",{style:{height:"100%",borderRadius:2,backgroundColor:e.success||"#3fb950",width:`${i.progressPercent}%`}})}),g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g.jsxs("span",{style:{fontSize:10,color:e.textSecondary},children:[i.completedModules,"/",i.availableModules," modules (",i.progressPercent,"%)"]}),s&&g.jsxs("span",{style:{fontSize:11,color:e.accent},children:["Next: ",s.title]})]})]})}function Bv({achievement:e,state:t,theme:r}){const i=t==="unlocked",n=t==="near",s=v3(e.category,r),a=i?{background:`linear-gradient(135deg, ${s}22, ${s}11)`,border:`1px solid ${s}44`}:{background:r.bgSecondary,border:`1px solid ${r.border}`};return g.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,padding:"14px 10px",borderRadius:12,textAlign:"center",position:"relative",...a},children:[g.jsx("span",{style:{fontSize:28,filter:i?"none":"grayscale(100%)",opacity:i?1:.4},children:e.icon}),g.jsx("span",{style:{fontSize:11,fontWeight:600,color:i?r.textPrimary:r.textSecondary},children:e.name}),i&&e.isNew&&g.jsx("span",{style:{position:"absolute",top:6,right:6,fontSize:9,fontWeight:700,color:r.warning,backgroundColor:`${r.warning}22`,padding:"1px 5px",borderRadius:4},children:"NEW"}),n&&e.current!==void 0&&g.jsxs("div",{style:{width:"80%"},children:[g.jsx("div",{style:{height:3,backgroundColor:r.bgTertiary,borderRadius:2,overflow:"hidden"},children:g.jsx("div",{style:{height:"100%",width:`${Math.min(100,e.current/e.target*100)}%`,backgroundColor:s,borderRadius:2}})}),g.jsxs("span",{style:{fontSize:9,color:r.textMuted},children:[e.current,"/",e.target]})]}),e.rare&&g.jsx("span",{style:{position:"absolute",top:6,left:6,fontSize:8,fontWeight:700,color:r.purple,backgroundColor:`${r.purple}22`,padding:"1px 4px",borderRadius:3},children:"RARE"})]})}function x3({module:e,theme:t}){const{slug:r,title:i,status:n,xp_earned:s,quiz_score:a,walkthrough_step:l}=e,u=n==="completed",h=n==="in-progress",d=n==="locked",p=u?t.success:h?t.accent:t.border;return g.jsxs("div",{style:{padding:"16px 20px",backgroundColor:t.bgSecondary,border:`2px solid ${p}`,borderRadius:10,display:"flex",flexDirection:"column",gap:10,opacity:d?.5:1},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[g.jsx("span",{style:{fontSize:16},children:u?"✅":h?"🟦":"🔒"}),g.jsx("h4",{style:{fontSize:14,fontWeight:600,color:t.textPrimary,margin:0},children:i||r})]}),g.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[s>0&&g.jsxs("span",{style:{fontSize:12,color:t.accent,backgroundColor:`${t.accent}18`,padding:"2px 8px",borderRadius:4},children:[s," XP"]}),a&&g.jsxs("span",{style:{fontSize:12,color:t.success,backgroundColor:`${t.success}18`,padding:"2px 8px",borderRadius:4},children:["Quiz: ",a]}),h&&l&&g.jsxs("span",{style:{fontSize:12,color:t.warning,backgroundColor:`${t.warning}18`,padding:"2px 8px",borderRadius:4},children:["Step ",l]})]}),d&&g.jsx("p",{style:{fontSize:12,color:t.textMuted,fontStyle:"italic",margin:0},children:"Complete prerequisites to unlock"})]})}function v3(e,t){switch(e){case"learning":return t.success;case"quizzes-games":return t.accent;case"streaks":return t.orange;case"belts":return t.purple;default:return t.accent}}function b3(e){return{container:{maxWidth:900,margin:"0 auto",display:"flex",flexDirection:"column",gap:28},heroSection:{display:"flex",gap:16,flexWrap:"wrap"},beltCard:{display:"flex",alignItems:"center",gap:16,padding:"20px 24px",borderRadius:12,flex:"1 1 200px",position:"relative",overflow:"hidden"},beltIcon:{width:56,height:56,borderRadius:"50%",border:"3px solid",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.bgTertiary,flexShrink:0},beltEmoji:{fontSize:28},beltInfo:{display:"flex",flexDirection:"column",gap:4,zIndex:1},beltWatermark:{position:"absolute",right:12,bottom:-8,fontSize:64,opacity:.08,pointerEvents:"none"},beltName:{fontSize:20,fontWeight:700,color:e.textPrimary,margin:0},xpText:{fontSize:14,color:e.textSecondary,margin:0},progressCard:{flex:"2 1 300px",padding:"20px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,display:"flex",flexDirection:"column",justifyContent:"center",gap:10},progressHeader:{display:"flex",justifyContent:"space-between",alignItems:"center"},progressLabel:{fontSize:14,color:e.textPrimary,fontWeight:500},progressValue:{fontSize:13,color:e.textSecondary},progressBar:{height:10,backgroundColor:e.bgTertiary,borderRadius:5,overflow:"hidden"},progressFill:{height:"100%",borderRadius:5,transition:"width 0.6s cubic-bezier(0.22, 1, 0.36, 1)"},statsRow:{display:"flex",gap:20,marginTop:2},statItem:{display:"flex",gap:4,alignItems:"center",fontSize:13},streakCard:{display:"flex",alignItems:"center",gap:12,padding:"20px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,flex:"0 1 180px"},streakIcon:{fontSize:28},streakCount:{fontSize:16,fontWeight:700,color:e.textPrimary,margin:0},streakSubtext:{fontSize:12,color:e.textSecondary,margin:0},section:{display:"flex",flexDirection:"column",gap:12},sectionHeader:{display:"flex",justifyContent:"space-between",alignItems:"center"},sectionTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:0},continueCard:{display:"flex",alignItems:"center",gap:16,padding:"16px 20px",backgroundColor:e.bgSecondary,border:`1px solid ${e.accent}44`,borderRadius:12},continueIcon:{fontSize:32,flexShrink:0},continueInfo:{flex:1,display:"flex",flexDirection:"column",gap:4},continueTitle:{fontSize:15,fontWeight:600,color:e.textPrimary,margin:0},continueStep:{fontSize:12,color:e.textSecondary,margin:0},continueProgressBar:{height:4,backgroundColor:e.bgTertiary,borderRadius:2,overflow:"hidden",marginTop:4},continueProgressFill:{height:"100%",backgroundColor:e.accent,borderRadius:2,transition:"width 0.3s ease"},continueCta:{fontSize:14,fontWeight:600,color:e.accent,flexShrink:0},achievementGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(110px, 1fr))",gap:10},achievementEmpty:{display:"flex",flexDirection:"column",alignItems:"center",gap:8,padding:"32px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12},roadmap:{display:"flex",gap:0,padding:"16px 0",overflowX:"auto"},roadmapItem:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,position:"relative",flex:"1 1 0",minWidth:70},roadmapDot:{width:36,height:36,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},roadmapLabel:{fontSize:12},roadmapXP:{fontSize:10,color:e.textMuted},roadmapLine:{position:"absolute",top:18,left:"55%",right:"-45%",height:2,zIndex:0},moduleGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:12},emptyState:{textAlign:"center",padding:"48px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12},emptyTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:"0 0 8px"},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0},code:{backgroundColor:e.bgTertiary,padding:"2px 6px",borderRadius:4,fontSize:13,fontFamily:"monospace",color:e.accent}}}const S3="modulepreload",w3=function(e){return"/"+e},Mv={},lt=function(t,r,i){let n=Promise.resolve();if(r&&r.length>0){let a=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));n=a(r.map(h=>{if(h=w3(h),h in Mv)return;Mv[h]=!0;const d=h.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":S3,d||(m.as="script"),m.crossOrigin="",m.href=h,u&&m.setAttribute("nonce",u),document.head.appendChild(m),d)return new Promise((y,x)=>{m.addEventListener("load",y),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return n.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var Lv={name:"mermaid",version:"11.12.3",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.13",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.23",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}},Su={exports:{}},C3=Su.exports,Rv;function k3(){return Rv||(Rv=1,(function(e,t){(function(r,i){e.exports=i()})(C3,(function(){var r=1e3,i=6e4,n=36e5,s="millisecond",a="second",l="minute",u="hour",h="day",d="week",p="month",m="quarter",y="year",x="date",v="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var $=["th","st","nd","rd"],j=O%100;return"["+O+($[(j-20)%10]||$[j]||$[0])+"]"}},R=function(O,$,j){var W=String(O);return!W||W.length>=$?O:""+Array($+1-W.length).join(j)+O},E={s:R,z:function(O){var $=-O.utcOffset(),j=Math.abs($),W=Math.floor(j/60),P=j%60;return($<=0?"+":"-")+R(W,2,"0")+":"+R(P,2,"0")},m:function O($,j){if($.date()<j.date())return-O(j,$);var W=12*(j.year()-$.year())+(j.month()-$.month()),P=$.clone().add(W,p),Z=j-P<0,ee=$.clone().add(W+(Z?-1:1),p);return+(-(W+(j-P)/(Z?P-ee:ee-P))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:p,y,w:d,d:h,D:x,h:u,m:l,s:a,ms:s,Q:m}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},L="en",k={};k[L]=B;var A="$isDayjsObject",z=function(O){return O instanceof Y||!(!O||!O[A])},U=function O($,j,W){var P;if(!$)return L;if(typeof $=="string"){var Z=$.toLowerCase();k[Z]&&(P=Z),j&&(k[Z]=j,P=Z);var ee=$.split("-");if(!P&&ee.length>1)return O(ee[0])}else{var I=$.name;k[I]=$,P=I}return!W&&P&&(L=P),P||!W&&L},q=function(O,$){if(z(O))return O.clone();var j=typeof $=="object"?$:{};return j.date=O,j.args=arguments,new Y(j)},H=E;H.l=U,H.i=z,H.w=function(O,$){return q(O,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var Y=(function(){function O(j){this.$L=U(j.locale,null,!0),this.parse(j),this.$x=this.$x||j.x||{},this[A]=!0}var $=O.prototype;return $.parse=function(j){this.$d=(function(W){var P=W.date,Z=W.utc;if(P===null)return new Date(NaN);if(H.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var ee=P.match(S);if(ee){var I=ee[2]-1||0,Q=(ee[7]||"0").substring(0,3);return Z?new Date(Date.UTC(ee[1],I,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,Q)):new Date(ee[1],I,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,Q)}}return new Date(P)})(j),this.init()},$.init=function(){var j=this.$d;this.$y=j.getFullYear(),this.$M=j.getMonth(),this.$D=j.getDate(),this.$W=j.getDay(),this.$H=j.getHours(),this.$m=j.getMinutes(),this.$s=j.getSeconds(),this.$ms=j.getMilliseconds()},$.$utils=function(){return H},$.isValid=function(){return this.$d.toString()!==v},$.isSame=function(j,W){var P=q(j);return this.startOf(W)<=P&&P<=this.endOf(W)},$.isAfter=function(j,W){return q(j)<this.startOf(W)},$.isBefore=function(j,W){return this.endOf(W)<q(j)},$.$g=function(j,W,P){return H.u(j)?this[W]:this.set(P,j)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(j,W){var P=this,Z=!!H.u(W)||W,ee=H.p(j),I=function(Ce,Ee){var Ke=H.w(P.$u?Date.UTC(P.$y,Ee,Ce):new Date(P.$y,Ee,Ce),P);return Z?Ke:Ke.endOf(h)},Q=function(Ce,Ee){return H.w(P.toDate()[Ce].apply(P.toDate("s"),(Z?[0,0,0,0]:[23,59,59,999]).slice(Ee)),P)},te=this.$W,X=this.$M,ce=this.$D,oe="set"+(this.$u?"UTC":"");switch(ee){case y:return Z?I(1,0):I(31,11);case p:return Z?I(1,X):I(0,X+1);case d:var ye=this.$locale().weekStart||0,ve=(te<ye?te+7:te)-ye;return I(Z?ce-ve:ce+(6-ve),X);case h:case x:return Q(oe+"Hours",0);case u:return Q(oe+"Minutes",1);case l:return Q(oe+"Seconds",2);case a:return Q(oe+"Milliseconds",3);default:return this.clone()}},$.endOf=function(j){return this.startOf(j,!1)},$.$set=function(j,W){var P,Z=H.p(j),ee="set"+(this.$u?"UTC":""),I=(P={},P[h]=ee+"Date",P[x]=ee+"Date",P[p]=ee+"Month",P[y]=ee+"FullYear",P[u]=ee+"Hours",P[l]=ee+"Minutes",P[a]=ee+"Seconds",P[s]=ee+"Milliseconds",P)[Z],Q=Z===h?this.$D+(W-this.$W):W;if(Z===p||Z===y){var te=this.clone().set(x,1);te.$d[I](Q),te.init(),this.$d=te.set(x,Math.min(this.$D,te.daysInMonth())).$d}else I&&this.$d[I](Q);return this.init(),this},$.set=function(j,W){return this.clone().$set(j,W)},$.get=function(j){return this[H.p(j)]()},$.add=function(j,W){var P,Z=this;j=Number(j);var ee=H.p(W),I=function(X){var ce=q(Z);return H.w(ce.date(ce.date()+Math.round(X*j)),Z)};if(ee===p)return this.set(p,this.$M+j);if(ee===y)return this.set(y,this.$y+j);if(ee===h)return I(1);if(ee===d)return I(7);var Q=(P={},P[l]=i,P[u]=n,P[a]=r,P)[ee]||1,te=this.$d.getTime()+j*Q;return H.w(te,this)},$.subtract=function(j,W){return this.add(-1*j,W)},$.format=function(j){var W=this,P=this.$locale();if(!this.isValid())return P.invalidDate||v;var Z=j||"YYYY-MM-DDTHH:mm:ssZ",ee=H.z(this),I=this.$H,Q=this.$m,te=this.$M,X=P.weekdays,ce=P.months,oe=P.meridiem,ye=function(Ee,Ke,ct,ze){return Ee&&(Ee[Ke]||Ee(W,Z))||ct[Ke].slice(0,ze)},ve=function(Ee){return H.s(I%12||12,Ee,"0")},Ce=oe||function(Ee,Ke,ct){var ze=Ee<12?"AM":"PM";return ct?ze.toLowerCase():ze};return Z.replace(C,(function(Ee,Ke){return Ke||(function(ct){switch(ct){case"YY":return String(W.$y).slice(-2);case"YYYY":return H.s(W.$y,4,"0");case"M":return te+1;case"MM":return H.s(te+1,2,"0");case"MMM":return ye(P.monthsShort,te,ce,3);case"MMMM":return ye(ce,te);case"D":return W.$D;case"DD":return H.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return ye(P.weekdaysMin,W.$W,X,2);case"ddd":return ye(P.weekdaysShort,W.$W,X,3);case"dddd":return X[W.$W];case"H":return String(I);case"HH":return H.s(I,2,"0");case"h":return ve(1);case"hh":return ve(2);case"a":return Ce(I,Q,!0);case"A":return Ce(I,Q,!1);case"m":return String(Q);case"mm":return H.s(Q,2,"0");case"s":return String(W.$s);case"ss":return H.s(W.$s,2,"0");case"SSS":return H.s(W.$ms,3,"0");case"Z":return ee}return null})(Ee)||ee.replace(":","")}))},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(j,W,P){var Z,ee=this,I=H.p(W),Q=q(j),te=(Q.utcOffset()-this.utcOffset())*i,X=this-Q,ce=function(){return H.m(ee,Q)};switch(I){case y:Z=ce()/12;break;case p:Z=ce();break;case m:Z=ce()/3;break;case d:Z=(X-te)/6048e5;break;case h:Z=(X-te)/864e5;break;case u:Z=X/n;break;case l:Z=X/i;break;case a:Z=X/r;break;default:Z=X}return P?Z:H.a(Z)},$.daysInMonth=function(){return this.endOf(p).$D},$.$locale=function(){return k[this.$L]},$.locale=function(j,W){if(!j)return this.$L;var P=this.clone(),Z=U(j,W,!0);return Z&&(P.$L=Z),P},$.clone=function(){return H.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},O})(),F=Y.prototype;return q.prototype=F,[["$ms",s],["$s",a],["$m",l],["$H",u],["$W",h],["$M",p],["$y",y],["$D",x]].forEach((function(O){F[O[1]]=function($){return this.$g($,O[0],O[1])}})),q.extend=function(O,$){return O.$i||(O($,Y,q),O.$i=!0),q},q.locale=U,q.isDayjs=z,q.unix=function(O){return q(1e3*O)},q.en=k[L],q.Ls=k,q.p={},q}))})(Su)),Su.exports}var T3=k3();const E3=yy(T3);var wS=Object.defineProperty,T=(e,t)=>wS(e,"name",{value:t,configurable:!0}),B3=(e,t)=>{for(var r in t)wS(e,r,{get:t[r],enumerable:!0})},Gn={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},ue={trace:T((...e)=>{},"trace"),debug:T((...e)=>{},"debug"),info:T((...e)=>{},"info"),warn:T((...e)=>{},"warn"),error:T((...e)=>{},"error"),fatal:T((...e)=>{},"fatal")},My=T(function(e="fatal"){let t=Gn.fatal;typeof e=="string"?e.toLowerCase()in Gn&&(t=Gn[e]):typeof e=="number"&&(t=e),ue.trace=()=>{},ue.debug=()=>{},ue.info=()=>{},ue.warn=()=>{},ue.error=()=>{},ue.fatal=()=>{},t<=Gn.fatal&&(ue.fatal=console.error?console.error.bind(console,ji("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ji("FATAL"))),t<=Gn.error&&(ue.error=console.error?console.error.bind(console,ji("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ji("ERROR"))),t<=Gn.warn&&(ue.warn=console.warn?console.warn.bind(console,ji("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ji("WARN"))),t<=Gn.info&&(ue.info=console.info?console.info.bind(console,ji("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ji("INFO"))),t<=Gn.debug&&(ue.debug=console.debug?console.debug.bind(console,ji("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ji("DEBUG"))),t<=Gn.trace&&(ue.trace=console.debug?console.debug.bind(console,ji("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ji("TRACE")))},"setLogLevel"),ji=T(e=>`%c${E3().format("ss.SSS")} : ${e} : `,"format");const wu={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n;switch(i){case"r":return wu.hue2rgb(s,n,e+1/3)*255;case"g":return wu.hue2rgb(s,n,e)*255;case"b":return wu.hue2rgb(s,n,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const n=Math.max(e,t,r),s=Math.min(e,t,r),a=(n+s)/2;if(i==="l")return a*100;if(n===s)return 0;const l=n-s,u=a>.5?l/(2-n-s):l/(n+s);if(i==="s")return u*100;switch(n){case e:return((t-r)/l+(t<r?6:0))*60;case t:return((r-e)/l+2)*60;case r:return((e-t)/l+4)*60;default:return-1}}},M3={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},L3={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},Ye={channel:wu,lang:M3,unit:L3},As={};for(let e=0;e<=255;e++)As[e]=Ye.unit.dec2hex(e);const Dr={ALL:0,RGB:1,HSL:2};class R3{constructor(){this.type=Dr.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Dr.ALL}is(t){return this.type===t}}class A3{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new R3}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Dr.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:n}=t;r===void 0&&(t.h=Ye.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=Ye.channel.rgb2hsl(t,"s")),n===void 0&&(t.l=Ye.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:n}=t;r===void 0&&(t.r=Ye.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=Ye.channel.hsl2rgb(t,"g")),n===void 0&&(t.b=Ye.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Dr.HSL)&&r!==void 0?r:(this._ensureHSL(),Ye.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Dr.HSL)&&r!==void 0?r:(this._ensureHSL(),Ye.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Dr.HSL)&&r!==void 0?r:(this._ensureHSL(),Ye.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Dr.RGB)&&r!==void 0?r:(this._ensureRGB(),Ye.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Dr.RGB)&&r!==void 0?r:(this._ensureRGB(),Ye.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Dr.RGB)&&r!==void 0?r:(this._ensureRGB(),Ye.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Dr.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Dr.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Dr.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Dr.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Dr.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Dr.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Id=new A3({r:0,g:0,b:0,a:0},"transparent"),wa={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(wa.re);if(!t)return;const r=t[1],i=parseInt(r,16),n=r.length,s=n%4===0,a=n>4,l=a?1:17,u=a?8:4,h=s?0:-1,d=a?255:15;return Id.set({r:(i>>u*(h+3)&d)*l,g:(i>>u*(h+2)&d)*l,b:(i>>u*(h+1)&d)*l,a:s?(i&d)*l/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:n}=e;return n<1?`#${As[Math.round(t)]}${As[Math.round(r)]}${As[Math.round(i)]}${As[Math.round(n*255)]}`:`#${As[Math.round(t)]}${As[Math.round(r)]}${As[Math.round(i)]}`}},So={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(So.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return Ye.channel.clamp.h(parseFloat(r)*.9);case"rad":return Ye.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Ye.channel.clamp.h(parseFloat(r)*360)}}return Ye.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(So.re);if(!r)return;const[,i,n,s,a,l]=r;return Id.set({h:So._hue2deg(i),s:Ye.channel.clamp.s(parseFloat(n)),l:Ye.channel.clamp.l(parseFloat(s)),a:a?Ye.channel.clamp.a(l?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:n}=e;return n<1?`hsla(${Ye.lang.round(t)}, ${Ye.lang.round(r)}%, ${Ye.lang.round(i)}%, ${n})`:`hsl(${Ye.lang.round(t)}, ${Ye.lang.round(r)}%, ${Ye.lang.round(i)}%)`}},fc={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=fc.colors[e];if(t)return wa.parse(t)},stringify:e=>{const t=wa.stringify(e);for(const r in fc.colors)if(fc.colors[r]===t)return r}},Jl={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Jl.re);if(!r)return;const[,i,n,s,a,l,u,h,d]=r;return Id.set({r:Ye.channel.clamp.r(n?parseFloat(i)*2.55:parseFloat(i)),g:Ye.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:Ye.channel.clamp.b(u?parseFloat(l)*2.55:parseFloat(l)),a:h?Ye.channel.clamp.a(d?parseFloat(h)/100:parseFloat(h)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:n}=e;return n<1?`rgba(${Ye.lang.round(t)}, ${Ye.lang.round(r)}, ${Ye.lang.round(i)}, ${Ye.lang.round(n)})`:`rgb(${Ye.lang.round(t)}, ${Ye.lang.round(r)}, ${Ye.lang.round(i)})`}},Ln={format:{keyword:fc,hex:wa,rgb:Jl,rgba:Jl,hsl:So,hsla:So},parse:e=>{if(typeof e!="string")return e;const t=wa.parse(e)||Jl.parse(e)||So.parse(e)||fc.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Dr.HSL)||e.data.r===void 0?So.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Jl.stringify(e):wa.stringify(e)},CS=(e,t)=>{const r=Ln.parse(e);for(const i in t)r[i]=Ye.channel.clamp[i](t[i]);return Ln.stringify(r)},pc=(e,t,r=0,i=1)=>{if(typeof e!="number")return CS(e,{a:t});const n=Id.set({r:Ye.channel.clamp.r(e),g:Ye.channel.clamp.g(t),b:Ye.channel.clamp.b(r),a:Ye.channel.clamp.a(i)});return Ln.stringify(n)},D3=e=>{const{r:t,g:r,b:i}=Ln.parse(e),n=.2126*Ye.channel.toLinear(t)+.7152*Ye.channel.toLinear(r)+.0722*Ye.channel.toLinear(i);return Ye.lang.round(n)},P3=e=>D3(e)>=.5,$c=e=>!P3(e),kS=(e,t,r)=>{const i=Ln.parse(e),n=i[t],s=Ye.channel.clamp[t](n+r);return n!==s&&(i[t]=s),Ln.stringify(i)},Re=(e,t)=>kS(e,"l",t),Fe=(e,t)=>kS(e,"l",-t),J=(e,t)=>{const r=Ln.parse(e),i={};for(const n in t)t[n]&&(i[n]=r[n]+t[n]);return CS(e,i)},I3=(e,t,r=50)=>{const{r:i,g:n,b:s,a}=Ln.parse(e),{r:l,g:u,b:h,a:d}=Ln.parse(t),p=r/100,m=p*2-1,y=a-d,v=((m*y===-1?m:(m+y)/(1+m*y))+1)/2,S=1-v,C=i*v+l*S,B=n*v+u*S,R=s*v+h*S,E=a*p+d*(1-p);return pc(C,B,R,E)},xe=(e,t=100)=>{const r=Ln.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,I3(r,e,t)};var TS=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,gc=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,$3=/\s*%%.*\n/gm,Ta,ES=(Ta=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},T(Ta,"UnknownDiagramError"),Ta),Ao={},Ly=T(function(e,t){e=e.replace(TS,"").replace(gc,"").replace($3,`
|
|
103
|
+
`);for(const[r,{detector:i}]of Object.entries(Ao))if(i(e,t))return r;throw new ES(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Fg=T((...e)=>{for(const{id:t,detector:r,loader:i}of e)BS(t,r,i)},"registerLazyLoadedDiagrams"),BS=T((e,t,r)=>{Ao[e]&&ue.warn(`Detector with key ${e} already exists. Overwriting.`),Ao[e]={detector:t,loader:r},ue.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),j3=T(e=>Ao[e].loader,"getDiagramLoader"),Ng=T((e,t,{depth:r=2,clobber:i=!1}={})=>{const n={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>Ng(e,s,n)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=Ng(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),sr=Ng,$d="#ffffff",jd="#f2f2f2",Gr=T((e,t)=>t?J(e,{s:-40,l:10}):J(e,{s:-40,l:-10}),"mkBorder"),Ea,O3=(Ea=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){var r,i,n,s,a,l,u,h,d,p,m,y,x,v,S,C,B,R,E,L,k;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||J(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||J(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Gr(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Gr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Gr(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Gr(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||xe(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||xe(this.tertiaryColor),this.lineColor=this.lineColor||xe(this.background),this.arrowheadColor=this.arrowheadColor||xe(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Fe(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Fe(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||xe(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||Re(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Fe(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Fe(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Re(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Re(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330}),this.darkMode)for(let A=0;A<this.THEME_COLOR_LIMIT;A++)this["cScale"+A]=Fe(this["cScale"+A],75);else for(let A=0;A<this.THEME_COLOR_LIMIT;A++)this["cScale"+A]=Fe(this["cScale"+A],25);for(let A=0;A<this.THEME_COLOR_LIMIT;A++)this["cScaleInv"+A]=this["cScaleInv"+A]||xe(this["cScale"+A]);for(let A=0;A<this.THEME_COLOR_LIMIT;A++)this.darkMode?this["cScalePeer"+A]=this["cScalePeer"+A]||Re(this["cScale"+A],10):this["cScalePeer"+A]=this["cScalePeer"+A]||Fe(this["cScale"+A],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let A=0;A<this.THEME_COLOR_LIMIT;A++)this["cScaleLabel"+A]=this["cScaleLabel"+A]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let A=0;A<5;A++)this["surface"+A]=this["surface"+A]||J(this.mainBkg,{h:180,s:-15,l:t*(5+A*3)}),this["surfacePeer"+A]=this["surfacePeer"+A]||J(this.mainBkg,{h:180,s:-15,l:t*(8+A*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||J(this.primaryColor,{h:64}),this.fillType3=this.fillType3||J(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||J(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||J(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||J(this.primaryColor,{h:128}),this.fillType7=this.fillType7||J(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||J(this.primaryColor,{l:-10}),this.pie5=this.pie5||J(this.secondaryColor,{l:-10}),this.pie6=this.pie6||J(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||J(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||J(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||J(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||J(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||J(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||J(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.radar={axisColor:((r=this.radar)==null?void 0:r.axisColor)||this.lineColor,axisStrokeWidth:((i=this.radar)==null?void 0:i.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((s=this.radar)==null?void 0:s.curveOpacity)||.5,curveStrokeWidth:((a=this.radar)==null?void 0:a.curveStrokeWidth)||2,graticuleColor:((l=this.radar)==null?void 0:l.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((u=this.radar)==null?void 0:u.graticuleStrokeWidth)||1,graticuleOpacity:((h=this.radar)==null?void 0:h.graticuleOpacity)||.3,legendBoxSize:((d=this.radar)==null?void 0:d.legendBoxSize)||12,legendFontSize:((p=this.radar)==null?void 0:p.legendFontSize)||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||$c(this.quadrant1Fill)?Re(this.quadrant1Fill):Fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((m=this.xyChart)==null?void 0:m.backgroundColor)||this.background,titleColor:((y=this.xyChart)==null?void 0:y.titleColor)||this.primaryTextColor,xAxisTitleColor:((x=this.xyChart)==null?void 0:x.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((v=this.xyChart)==null?void 0:v.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((S=this.xyChart)==null?void 0:S.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((C=this.xyChart)==null?void 0:C.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((B=this.xyChart)==null?void 0:B.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((R=this.xyChart)==null?void 0:R.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((E=this.xyChart)==null?void 0:E.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((L=this.xyChart)==null?void 0:L.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((k=this.xyChart)==null?void 0:k.plotColorPalette)||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Fe(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||J(this.primaryColor,{h:-30}),this.git4=this.git4||J(this.primaryColor,{h:-60}),this.git5=this.git5||J(this.primaryColor,{h:-90}),this.git6=this.git6||J(this.primaryColor,{h:60}),this.git7=this.git7||J(this.primaryColor,{h:120}),this.darkMode?(this.git0=Re(this.git0,25),this.git1=Re(this.git1,25),this.git2=Re(this.git2,25),this.git3=Re(this.git3,25),this.git4=Re(this.git4,25),this.git5=Re(this.git5,25),this.git6=Re(this.git6,25),this.git7=Re(this.git7,25)):(this.git0=Fe(this.git0,25),this.git1=Fe(this.git1,25),this.git2=Fe(this.git2,25),this.git3=Fe(this.git3,25),this.git4=Fe(this.git4,25),this.git5=Fe(this.git5,25),this.git6=Fe(this.git6,25),this.git7=Fe(this.git7,25)),this.gitInv0=this.gitInv0||xe(this.git0),this.gitInv1=this.gitInv1||xe(this.git1),this.gitInv2=this.gitInv2||xe(this.git2),this.gitInv3=this.gitInv3||xe(this.git3),this.gitInv4=this.gitInv4||xe(this.git4),this.gitInv5=this.gitInv5||xe(this.git5),this.gitInv6=this.gitInv6||xe(this.git6),this.gitInv7=this.gitInv7||xe(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||$d,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||jd}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},T(Ea,"Theme"),Ea),z3=T(e=>{const t=new O3;return t.calculate(e),t},"getThemeVariables"),Ba,F3=(Ba=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Re(this.primaryColor,16),this.tertiaryColor=J(this.primaryColor,{h:-160}),this.primaryBorderColor=xe(this.background),this.secondaryBorderColor=Gr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Gr(this.tertiaryColor,this.darkMode),this.primaryTextColor=xe(this.primaryColor),this.secondaryTextColor=xe(this.secondaryColor),this.tertiaryTextColor=xe(this.tertiaryColor),this.lineColor=xe(this.background),this.textColor=xe(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Re(xe("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=pc(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=Fe("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Fe(this.sectionBkgColor,10),this.taskBorderColor=pc(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=pc(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Re(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Fe(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var t,r,i,n,s,a,l,u,h,d,p,m,y,x,v,S,C,B,R,E,L;this.secondBkg=Re(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=Re(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=Re(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=J(this.primaryColor,{h:64}),this.fillType3=J(this.secondaryColor,{h:64}),this.fillType4=J(this.primaryColor,{h:-64}),this.fillType5=J(this.secondaryColor,{h:-64}),this.fillType6=J(this.primaryColor,{h:128}),this.fillType7=J(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330});for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleInv"+k]=this["cScaleInv"+k]||xe(this["cScale"+k]);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScalePeer"+k]=this["cScalePeer"+k]||Re(this["cScale"+k],10);for(let k=0;k<5;k++)this["surface"+k]=this["surface"+k]||J(this.mainBkg,{h:30,s:-30,l:-(-10+k*4)}),this["surfacePeer"+k]=this["surfacePeer"+k]||J(this.mainBkg,{h:30,s:-30,l:-(-7+k*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleLabel"+k]=this["cScaleLabel"+k]||this.scaleLabelColor;for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["pie"+k]=this["cScale"+k];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||$c(this.quadrant1Fill)?Re(this.quadrant1Fill):Fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((i=this.xyChart)==null?void 0:i.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((n=this.xyChart)==null?void 0:n.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((s=this.xyChart)==null?void 0:s.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((a=this.xyChart)==null?void 0:a.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((l=this.xyChart)==null?void 0:l.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((u=this.xyChart)==null?void 0:u.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((h=this.xyChart)==null?void 0:h.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((d=this.xyChart)==null?void 0:d.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((p=this.xyChart)==null?void 0:p.plotColorPalette)||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:((m=this.radar)==null?void 0:m.axisColor)||this.lineColor,axisStrokeWidth:((y=this.radar)==null?void 0:y.axisStrokeWidth)||2,axisLabelFontSize:((x=this.radar)==null?void 0:x.axisLabelFontSize)||12,curveOpacity:((v=this.radar)==null?void 0:v.curveOpacity)||.5,curveStrokeWidth:((S=this.radar)==null?void 0:S.curveStrokeWidth)||2,graticuleColor:((C=this.radar)==null?void 0:C.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((B=this.radar)==null?void 0:B.graticuleStrokeWidth)||1,graticuleOpacity:((R=this.radar)==null?void 0:R.graticuleOpacity)||.3,legendBoxSize:((E=this.radar)==null?void 0:E.legendBoxSize)||12,legendFontSize:((L=this.radar)==null?void 0:L.legendFontSize)||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Fe(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Re(this.secondaryColor,20),this.git1=Re(this.pie2||this.secondaryColor,20),this.git2=Re(this.pie3||this.tertiaryColor,20),this.git3=Re(this.pie4||J(this.primaryColor,{h:-30}),20),this.git4=Re(this.pie5||J(this.primaryColor,{h:-60}),20),this.git5=Re(this.pie6||J(this.primaryColor,{h:-90}),10),this.git6=Re(this.pie7||J(this.primaryColor,{h:60}),10),this.git7=Re(this.pie8||J(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||xe(this.git0),this.gitInv1=this.gitInv1||xe(this.git1),this.gitInv2=this.gitInv2||xe(this.git2),this.gitInv3=this.gitInv3||xe(this.git3),this.gitInv4=this.gitInv4||xe(this.git4),this.gitInv5=this.gitInv5||xe(this.git5),this.gitInv6=this.gitInv6||xe(this.git6),this.gitInv7=this.gitInv7||xe(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||xe(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||xe(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Re(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Re(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},T(Ba,"Theme"),Ba),N3=T(e=>{const t=new F3;return t.calculate(e),t},"getThemeVariables"),Ma,W3=(Ma=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=J(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=J(this.primaryColor,{h:-160}),this.primaryBorderColor=Gr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Gr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Gr(this.tertiaryColor,this.darkMode),this.primaryTextColor=xe(this.primaryColor),this.secondaryTextColor=xe(this.secondaryColor),this.tertiaryTextColor=xe(this.tertiaryColor),this.lineColor=xe(this.background),this.textColor=xe(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=pc(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){var t,r,i,n,s,a,l,u,h,d,p,m,y,x,v,S,C,B,R,E,L;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Fe(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Fe(this.tertiaryColor,40);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScale"+k]=Fe(this["cScale"+k],10),this["cScalePeer"+k]=this["cScalePeer"+k]||Fe(this["cScale"+k],25);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleInv"+k]=this["cScaleInv"+k]||J(this["cScale"+k],{h:180});for(let k=0;k<5;k++)this["surface"+k]=this["surface"+k]||J(this.mainBkg,{h:30,l:-(5+k*5)}),this["surfacePeer"+k]=this["surfacePeer"+k]||J(this.mainBkg,{h:30,l:-(7+k*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||xe(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||xe(this.labelTextColor);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleLabel"+k]=this["cScaleLabel"+k]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=Re(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Re(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||Re(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=J(this.primaryColor,{h:64}),this.fillType3=J(this.secondaryColor,{h:64}),this.fillType4=J(this.primaryColor,{h:-64}),this.fillType5=J(this.secondaryColor,{h:-64}),this.fillType6=J(this.primaryColor,{h:128}),this.fillType7=J(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||J(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||J(this.primaryColor,{l:-10}),this.pie5=this.pie5||J(this.secondaryColor,{l:-30}),this.pie6=this.pie6||J(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||J(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||J(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||J(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||J(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||J(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||J(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||$c(this.quadrant1Fill)?Re(this.quadrant1Fill):Fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:((t=this.radar)==null?void 0:t.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((i=this.radar)==null?void 0:i.axisLabelFontSize)||12,curveOpacity:((n=this.radar)==null?void 0:n.curveOpacity)||.5,curveStrokeWidth:((s=this.radar)==null?void 0:s.curveStrokeWidth)||2,graticuleColor:((a=this.radar)==null?void 0:a.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((l=this.radar)==null?void 0:l.graticuleStrokeWidth)||1,graticuleOpacity:((u=this.radar)==null?void 0:u.graticuleOpacity)||.3,legendBoxSize:((h=this.radar)==null?void 0:h.legendBoxSize)||12,legendFontSize:((d=this.radar)==null?void 0:d.legendFontSize)||12},this.xyChart={backgroundColor:((p=this.xyChart)==null?void 0:p.backgroundColor)||this.background,titleColor:((m=this.xyChart)==null?void 0:m.titleColor)||this.primaryTextColor,xAxisTitleColor:((y=this.xyChart)==null?void 0:y.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((x=this.xyChart)==null?void 0:x.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((v=this.xyChart)==null?void 0:v.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((S=this.xyChart)==null?void 0:S.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((C=this.xyChart)==null?void 0:C.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((B=this.xyChart)==null?void 0:B.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((R=this.xyChart)==null?void 0:R.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((E=this.xyChart)==null?void 0:E.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((L=this.xyChart)==null?void 0:L.plotColorPalette)||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||J(this.primaryColor,{h:-30}),this.git4=this.git4||J(this.primaryColor,{h:-60}),this.git5=this.git5||J(this.primaryColor,{h:-90}),this.git6=this.git6||J(this.primaryColor,{h:60}),this.git7=this.git7||J(this.primaryColor,{h:120}),this.darkMode?(this.git0=Re(this.git0,25),this.git1=Re(this.git1,25),this.git2=Re(this.git2,25),this.git3=Re(this.git3,25),this.git4=Re(this.git4,25),this.git5=Re(this.git5,25),this.git6=Re(this.git6,25),this.git7=Re(this.git7,25)):(this.git0=Fe(this.git0,25),this.git1=Fe(this.git1,25),this.git2=Fe(this.git2,25),this.git3=Fe(this.git3,25),this.git4=Fe(this.git4,25),this.git5=Fe(this.git5,25),this.git6=Fe(this.git6,25),this.git7=Fe(this.git7,25)),this.gitInv0=this.gitInv0||Fe(xe(this.git0),25),this.gitInv1=this.gitInv1||xe(this.git1),this.gitInv2=this.gitInv2||xe(this.git2),this.gitInv3=this.gitInv3||xe(this.git3),this.gitInv4=this.gitInv4||xe(this.git4),this.gitInv5=this.gitInv5||xe(this.git5),this.gitInv6=this.gitInv6||xe(this.git6),this.gitInv7=this.gitInv7||xe(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||xe(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||xe(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||$d,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||jd}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},T(Ma,"Theme"),Ma),H3=T(e=>{const t=new W3;return t.calculate(e),t},"getThemeVariables"),La,q3=(La=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=Re("#cde498",10),this.primaryBorderColor=Gr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Gr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Gr(this.tertiaryColor,this.darkMode),this.primaryTextColor=xe(this.primaryColor),this.secondaryTextColor=xe(this.secondaryColor),this.tertiaryTextColor=xe(this.primaryColor),this.lineColor=xe(this.background),this.textColor=xe(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,i,n,s,a,l,u,h,d,p,m,y,x,v,S,C,B,R,E,L;this.actorBorder=Fe(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Fe(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Fe(this.tertiaryColor,40);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScale"+k]=Fe(this["cScale"+k],10),this["cScalePeer"+k]=this["cScalePeer"+k]||Fe(this["cScale"+k],25);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleInv"+k]=this["cScaleInv"+k]||J(this["cScale"+k],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleLabel"+k]=this["cScaleLabel"+k]||this.scaleLabelColor;for(let k=0;k<5;k++)this["surface"+k]=this["surface"+k]||J(this.mainBkg,{h:30,s:-30,l:-(5+k*5)}),this["surfacePeer"+k]=this["surfacePeer"+k]||J(this.mainBkg,{h:30,s:-30,l:-(8+k*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Re(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Re(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=J(this.primaryColor,{h:64}),this.fillType3=J(this.secondaryColor,{h:64}),this.fillType4=J(this.primaryColor,{h:-64}),this.fillType5=J(this.secondaryColor,{h:-64}),this.fillType6=J(this.primaryColor,{h:128}),this.fillType7=J(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||J(this.primaryColor,{l:-30}),this.pie5=this.pie5||J(this.secondaryColor,{l:-30}),this.pie6=this.pie6||J(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||J(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||J(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||J(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||J(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||J(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||J(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||$c(this.quadrant1Fill)?Re(this.quadrant1Fill):Fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:((t=this.radar)==null?void 0:t.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((i=this.radar)==null?void 0:i.axisLabelFontSize)||12,curveOpacity:((n=this.radar)==null?void 0:n.curveOpacity)||.5,curveStrokeWidth:((s=this.radar)==null?void 0:s.curveStrokeWidth)||2,graticuleColor:((a=this.radar)==null?void 0:a.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((l=this.radar)==null?void 0:l.graticuleStrokeWidth)||1,graticuleOpacity:((u=this.radar)==null?void 0:u.graticuleOpacity)||.3,legendBoxSize:((h=this.radar)==null?void 0:h.legendBoxSize)||12,legendFontSize:((d=this.radar)==null?void 0:d.legendFontSize)||12},this.xyChart={backgroundColor:((p=this.xyChart)==null?void 0:p.backgroundColor)||this.background,titleColor:((m=this.xyChart)==null?void 0:m.titleColor)||this.primaryTextColor,xAxisTitleColor:((y=this.xyChart)==null?void 0:y.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((x=this.xyChart)==null?void 0:x.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((v=this.xyChart)==null?void 0:v.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((S=this.xyChart)==null?void 0:S.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((C=this.xyChart)==null?void 0:C.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((B=this.xyChart)==null?void 0:B.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((R=this.xyChart)==null?void 0:R.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((E=this.xyChart)==null?void 0:E.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((L=this.xyChart)==null?void 0:L.plotColorPalette)||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||J(this.primaryColor,{h:-30}),this.git4=this.git4||J(this.primaryColor,{h:-60}),this.git5=this.git5||J(this.primaryColor,{h:-90}),this.git6=this.git6||J(this.primaryColor,{h:60}),this.git7=this.git7||J(this.primaryColor,{h:120}),this.darkMode?(this.git0=Re(this.git0,25),this.git1=Re(this.git1,25),this.git2=Re(this.git2,25),this.git3=Re(this.git3,25),this.git4=Re(this.git4,25),this.git5=Re(this.git5,25),this.git6=Re(this.git6,25),this.git7=Re(this.git7,25)):(this.git0=Fe(this.git0,25),this.git1=Fe(this.git1,25),this.git2=Fe(this.git2,25),this.git3=Fe(this.git3,25),this.git4=Fe(this.git4,25),this.git5=Fe(this.git5,25),this.git6=Fe(this.git6,25),this.git7=Fe(this.git7,25)),this.gitInv0=this.gitInv0||xe(this.git0),this.gitInv1=this.gitInv1||xe(this.git1),this.gitInv2=this.gitInv2||xe(this.git2),this.gitInv3=this.gitInv3||xe(this.git3),this.gitInv4=this.gitInv4||xe(this.git4),this.gitInv5=this.gitInv5||xe(this.git5),this.gitInv6=this.gitInv6||xe(this.git6),this.gitInv7=this.gitInv7||xe(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||xe(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||xe(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||$d,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||jd}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},T(La,"Theme"),La),U3=T(e=>{const t=new q3;return t.calculate(e),t},"getThemeVariables"),Ra,V3=(Ra=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Re(this.contrast,55),this.background="#ffffff",this.tertiaryColor=J(this.primaryColor,{h:-160}),this.primaryBorderColor=Gr(this.primaryColor,this.darkMode),this.secondaryBorderColor=Gr(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Gr(this.tertiaryColor,this.darkMode),this.primaryTextColor=xe(this.primaryColor),this.secondaryTextColor=xe(this.secondaryColor),this.tertiaryTextColor=xe(this.tertiaryColor),this.lineColor=xe(this.background),this.textColor=xe(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||Re(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,i,n,s,a,l,u,h,d,p,m,y,x,v,S,C,B,R,E,L;this.secondBkg=Re(this.contrast,55),this.border2=this.contrast,this.actorBorder=Re(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleInv"+k]=this["cScaleInv"+k]||xe(this["cScale"+k]);for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this.darkMode?this["cScalePeer"+k]=this["cScalePeer"+k]||Re(this["cScale"+k],10):this["cScalePeer"+k]=this["cScalePeer"+k]||Fe(this["cScale"+k],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["cScaleLabel"+k]=this["cScaleLabel"+k]||this.scaleLabelColor;for(let k=0;k<5;k++)this["surface"+k]=this["surface"+k]||J(this.mainBkg,{l:-(5+k*5)}),this["surfacePeer"+k]=this["surfacePeer"+k]||J(this.mainBkg,{l:-(8+k*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=Re(this.contrast,30),this.sectionBkgColor2=Re(this.contrast,30),this.taskBorderColor=Fe(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=Re(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Fe(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=J(this.primaryColor,{h:64}),this.fillType3=J(this.secondaryColor,{h:64}),this.fillType4=J(this.primaryColor,{h:-64}),this.fillType5=J(this.secondaryColor,{h:-64}),this.fillType6=J(this.primaryColor,{h:128}),this.fillType7=J(this.secondaryColor,{h:128});for(let k=0;k<this.THEME_COLOR_LIMIT;k++)this["pie"+k]=this["cScale"+k];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||$c(this.quadrant1Fill)?Re(this.quadrant1Fill):Fe(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((i=this.xyChart)==null?void 0:i.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((n=this.xyChart)==null?void 0:n.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((s=this.xyChart)==null?void 0:s.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((a=this.xyChart)==null?void 0:a.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((l=this.xyChart)==null?void 0:l.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((u=this.xyChart)==null?void 0:u.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((h=this.xyChart)==null?void 0:h.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((d=this.xyChart)==null?void 0:d.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((p=this.xyChart)==null?void 0:p.plotColorPalette)||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:((m=this.radar)==null?void 0:m.axisColor)||this.lineColor,axisStrokeWidth:((y=this.radar)==null?void 0:y.axisStrokeWidth)||2,axisLabelFontSize:((x=this.radar)==null?void 0:x.axisLabelFontSize)||12,curveOpacity:((v=this.radar)==null?void 0:v.curveOpacity)||.5,curveStrokeWidth:((S=this.radar)==null?void 0:S.curveStrokeWidth)||2,graticuleColor:((C=this.radar)==null?void 0:C.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((B=this.radar)==null?void 0:B.graticuleStrokeWidth)||1,graticuleOpacity:((R=this.radar)==null?void 0:R.graticuleOpacity)||.3,legendBoxSize:((E=this.radar)==null?void 0:E.legendBoxSize)||12,legendFontSize:((L=this.radar)==null?void 0:L.legendFontSize)||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Fe(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||J(this.primaryColor,{h:-30}),this.git4=this.pie5||J(this.primaryColor,{h:-60}),this.git5=this.pie6||J(this.primaryColor,{h:-90}),this.git6=this.pie7||J(this.primaryColor,{h:60}),this.git7=this.pie8||J(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||xe(this.git0),this.gitInv1=this.gitInv1||xe(this.git1),this.gitInv2=this.gitInv2||xe(this.git2),this.gitInv3=this.gitInv3||xe(this.git3),this.gitInv4=this.gitInv4||xe(this.git4),this.gitInv5=this.gitInv5||xe(this.git5),this.gitInv6=this.gitInv6||xe(this.git6),this.gitInv7=this.gitInv7||xe(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||$d,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||jd}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},T(Ra,"Theme"),Ra),G3=T(e=>{const t=new V3;return t.calculate(e),t},"getThemeVariables"),Jn={base:{getThemeVariables:z3},dark:{getThemeVariables:N3},default:{getThemeVariables:H3},forest:{getThemeVariables:U3},neutral:{getThemeVariables:G3}},xn={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},MS={...xn,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Jn.default.getThemeVariables(),sequence:{...xn.sequence,messageFont:T(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:T(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:T(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...xn.gantt,tickInterval:void 0,useWidth:void 0},c4:{...xn.c4,useWidth:void 0,personFont:T(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...xn.flowchart,inheritDir:!1},external_personFont:T(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:T(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:T(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:T(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:T(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:T(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:T(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:T(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:T(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:T(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:T(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:T(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:T(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:T(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:T(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:T(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:T(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:T(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:T(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:T(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:T(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...xn.pie,useWidth:984},xyChart:{...xn.xyChart,useWidth:void 0},requirement:{...xn.requirement,useWidth:void 0},packet:{...xn.packet},radar:{...xn.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},LS=T((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...LS(e[i],"")]:[...r,t+i],[]),"keyify"),Y3=new Set(LS(MS,"")),RS=MS,Gu=T(e=>{if(ue.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Gu(t));return}for(const t of Object.keys(e)){if(ue.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!Y3.has(t)||e[t]==null){ue.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){ue.debug("sanitizing object",t),Gu(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(ue.debug("sanitizing css option",t),e[t]=K3(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}ue.debug("After sanitization",e)}},"sanitizeDirective"),K3=T(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),Pa=Object.freeze(RS),ci=sr({},Pa),Yu,Do=[],mc=sr({},Pa),Od=T((e,t)=>{let r=sr({},e),i={};for(const n of t)PS(n),i=sr(i,n);if(r=sr(r,i),i.theme&&i.theme in Jn){const n=sr({},Yu),s=sr(n.themeVariables||{},i.themeVariables);r.theme&&r.theme in Jn&&(r.themeVariables=Jn[r.theme].getThemeVariables(s))}return mc=r,IS(mc),mc},"updateCurrentConfig"),X3=T(e=>(ci=sr({},Pa),ci=sr(ci,e),e.theme&&Jn[e.theme]&&(ci.themeVariables=Jn[e.theme].getThemeVariables(e.themeVariables)),Od(ci,Do),ci),"setSiteConfig"),Q3=T(e=>{Yu=sr({},e)},"saveConfigFromInitialize"),Z3=T(e=>(ci=sr(ci,e),Od(ci,Do),ci),"updateSiteConfig"),AS=T(()=>sr({},ci),"getSiteConfig"),DS=T(e=>(IS(e),sr(mc,e),Ir()),"setConfig"),Ir=T(()=>sr({},mc),"getConfig"),PS=T(e=>{e&&(["secure",...ci.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(ue.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&PS(e[t])}))},"sanitize"),J3=T(e=>{var t;Gu(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Do.push(e),Od(ci,Do)},"addDirective"),Ku=T((e=ci)=>{Do=[],Od(e,Do)},"reset"),eA={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},Av={},tA=T(e=>{Av[e]||(ue.warn(eA[e]),Av[e]=!0)},"issueWarning"),IS=T(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&tA("LAZY_LOAD_DEPRECATED")},"checkConfig"),SU=T(()=>{let e={};Yu&&(e=sr(e,Yu));for(const t of Do)e=sr(e,t);return e},"getUserDefinedConfig"),jc=/<br\s*\/?>/gi,rA=T(e=>e?OS(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),iA=(()=>{let e=!1;return()=>{e||($S(),e=!0)}})();function $S(){const e="data-temp-href-target";Ns.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Ns.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}T($S,"setupDompurifyHooks");var jS=T(e=>(iA(),Ns.sanitize(e)),"removeScript"),Dv=T((e,t)=>{var r;if(((r=t.flowchart)==null?void 0:r.htmlLabels)!==!1){const i=t.securityLevel;i==="antiscript"||i==="strict"?e=jS(e):i!=="loose"&&(e=OS(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=aA(e))}return e},"sanitizeMore"),Hi=T((e,t)=>e&&(t.dompurifyConfig?e=Ns.sanitize(Dv(e,t),t.dompurifyConfig).toString():e=Ns.sanitize(Dv(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),nA=T((e,t)=>typeof e=="string"?Hi(e,t):e.flat().map(r=>Hi(r,t)),"sanitizeTextOrArray"),sA=T(e=>jc.test(e),"hasBreaks"),oA=T(e=>e.split(jc),"splitBreaks"),aA=T(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),OS=T(e=>e.replace(jc,"#br#"),"breakToPlaceholder"),lA=T(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),ar=T(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),cA=T(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),hA=T(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Pv=T(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let n=t[i];if(n===","&&i>0&&i+1<t.length){const s=t[i-1],a=t[i+1];uA(s,a)&&(n=s+","+a,i++,r.pop())}r.push(dA(n))}return r.join("")},"parseGenericTypes"),Wg=T((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),uA=T((e,t)=>{const r=Wg(e,"~"),i=Wg(t,"~");return r===1&&i===1},"shouldCombineSets"),dA=T(e=>{const t=Wg(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let n=i.indexOf("~"),s=i.lastIndexOf("~");for(;n!==-1&&s!==-1&&n!==s;)i[n]="<",i[s]=">",n=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Iv=T(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Hg=/\$\$(.*)\$\$/g,Ia=T(e=>{var t;return(((t=e.match(Hg))==null?void 0:t.length)??0)>0},"hasKatex"),wU=T(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Ry(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const i=document.querySelector("body");i==null||i.insertAdjacentElement("beforeend",r);const n={width:r.clientWidth,height:r.clientHeight};return r.remove(),n},"calculateMathMLDimensions"),fA=T(async(e,t)=>{if(!Ia(e))return e;if(!(Iv()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Hg,"MathML is unsupported in this environment.");{const{default:r}=await lt(async()=>{const{default:n}=await import("./katex-BlHpptmG.js");return{default:n}},[]),i=t.forceLegacyMathML||!Iv()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(jc).map(n=>Ia(n)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${n}</div>`:`<div>${n}</div>`).join("").replace(Hg,(n,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Ry=T(async(e,t)=>Hi(await fA(e,t),t),"renderKatexSanitized"),Ha={getRows:rA,sanitizeText:Hi,sanitizeTextOrArray:nA,hasBreaks:sA,splitBreaks:oA,lineBreakRegex:jc,removeScript:jS,getUrl:lA,evaluate:ar,getMax:cA,getMin:hA},pA=T(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),gA=T(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),zS=T(function(e,t,r,i){const n=gA(t,r,i);pA(e,n)},"configureSvgSize"),mA=T(function(e,t,r,i){const n=t.node().getBBox(),s=n.width,a=n.height;ue.info(`SVG bounds: ${s}x${a}`,n);let l=0,u=0;ue.info(`Graph bounds: ${l}x${u}`,e),l=s+r*2,u=a+r*2,ue.info(`Calculated bounds: ${l}x${u}`),zS(t,u,l,i);const h=`${n.x-r} ${n.y-r} ${n.width+2*r} ${n.height+2*r}`;t.attr("viewBox",h)},"setupGraphViewbox"),Cu={},yA=T((e,t,r)=>{let i="";return e in Cu&&Cu[e]?i=Cu[e](r):ue.warn(`No theme found for ${e}`),` & {
|
|
104
|
+
font-family: ${r.fontFamily};
|
|
105
|
+
font-size: ${r.fontSize};
|
|
106
|
+
fill: ${r.textColor}
|
|
107
|
+
}
|
|
108
|
+
@keyframes edge-animation-frame {
|
|
109
|
+
from {
|
|
110
|
+
stroke-dashoffset: 0;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
@keyframes dash {
|
|
114
|
+
to {
|
|
115
|
+
stroke-dashoffset: 0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
& .edge-animation-slow {
|
|
119
|
+
stroke-dasharray: 9,5 !important;
|
|
120
|
+
stroke-dashoffset: 900;
|
|
121
|
+
animation: dash 50s linear infinite;
|
|
122
|
+
stroke-linecap: round;
|
|
123
|
+
}
|
|
124
|
+
& .edge-animation-fast {
|
|
125
|
+
stroke-dasharray: 9,5 !important;
|
|
126
|
+
stroke-dashoffset: 900;
|
|
127
|
+
animation: dash 20s linear infinite;
|
|
128
|
+
stroke-linecap: round;
|
|
129
|
+
}
|
|
130
|
+
/* Classes common for multiple diagrams */
|
|
131
|
+
|
|
132
|
+
& .error-icon {
|
|
133
|
+
fill: ${r.errorBkgColor};
|
|
134
|
+
}
|
|
135
|
+
& .error-text {
|
|
136
|
+
fill: ${r.errorTextColor};
|
|
137
|
+
stroke: ${r.errorTextColor};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
& .edge-thickness-normal {
|
|
141
|
+
stroke-width: 1px;
|
|
142
|
+
}
|
|
143
|
+
& .edge-thickness-thick {
|
|
144
|
+
stroke-width: 3.5px
|
|
145
|
+
}
|
|
146
|
+
& .edge-pattern-solid {
|
|
147
|
+
stroke-dasharray: 0;
|
|
148
|
+
}
|
|
149
|
+
& .edge-thickness-invisible {
|
|
150
|
+
stroke-width: 0;
|
|
151
|
+
fill: none;
|
|
152
|
+
}
|
|
153
|
+
& .edge-pattern-dashed{
|
|
154
|
+
stroke-dasharray: 3;
|
|
155
|
+
}
|
|
156
|
+
.edge-pattern-dotted {
|
|
157
|
+
stroke-dasharray: 2;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
& .marker {
|
|
161
|
+
fill: ${r.lineColor};
|
|
162
|
+
stroke: ${r.lineColor};
|
|
163
|
+
}
|
|
164
|
+
& .marker.cross {
|
|
165
|
+
stroke: ${r.lineColor};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
& svg {
|
|
169
|
+
font-family: ${r.fontFamily};
|
|
170
|
+
font-size: ${r.fontSize};
|
|
171
|
+
}
|
|
172
|
+
& p {
|
|
173
|
+
margin: 0
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
${i}
|
|
177
|
+
|
|
178
|
+
${t}
|
|
179
|
+
`},"getStyles"),_A=T((e,t)=>{t!==void 0&&(Cu[e]=t)},"addStylesForDiagram"),xA=yA,FS={};B3(FS,{clear:()=>vA,getAccDescription:()=>CA,getAccTitle:()=>SA,getDiagramTitle:()=>TA,setAccDescription:()=>wA,setAccTitle:()=>bA,setDiagramTitle:()=>kA});var Ay="",Dy="",Py="",Iy=T(e=>Hi(e,Ir()),"sanitizeText"),vA=T(()=>{Ay="",Py="",Dy=""},"clear"),bA=T(e=>{Ay=Iy(e).replace(/^\s+/g,"")},"setAccTitle"),SA=T(()=>Ay,"getAccTitle"),wA=T(e=>{Py=Iy(e).replace(/\n\s+/g,`
|
|
180
|
+
`)},"setAccDescription"),CA=T(()=>Py,"getAccDescription"),kA=T(e=>{Dy=Iy(e)},"setDiagramTitle"),TA=T(()=>Dy,"getDiagramTitle"),$v=ue,EA=My,ft=Ir,CU=DS,kU=Pa,$y=T(e=>Hi(e,ft()),"sanitizeText"),BA=mA,MA=T(()=>FS,"getCommonDb"),Xu={},Qu=T((e,t,r)=>{var i;Xu[e]&&$v.warn(`Diagram with id ${e} already registered. Overwriting.`),Xu[e]=t,r&&BS(e,r),_A(e,t.styles),(i=t.injectUtils)==null||i.call(t,$v,EA,ft,$y,BA,MA(),()=>{})},"registerDiagram"),qg=T(e=>{if(e in Xu)return Xu[e];throw new LA(e)},"getDiagram"),Aa,LA=(Aa=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},T(Aa,"DiagramNotFoundError"),Aa),RA={value:()=>{}};function NS(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new ku(r)}function ku(e){this._=e}function AA(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",n=r.indexOf(".");if(n>=0&&(i=r.slice(n+1),r=r.slice(0,n)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}ku.prototype=NS.prototype={constructor:ku,on:function(e,t){var r=this._,i=AA(e+"",r),n,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((n=(e=i[s]).type)&&(n=DA(r[n],e.name)))return n;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(n=(e=i[s]).type)r[n]=jv(r[n],e.name,t);else if(t==null)for(n in r)r[n]=jv(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new ku(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var r=new Array(n),i=0,n,s;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,n=s.length;i<n;++i)s[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],n=0,s=i.length;n<s;++n)i[n].value.apply(t,r)}};function DA(e,t){for(var r=0,i=e.length,n;r<i;++r)if((n=e[r]).name===t)return n.value}function jv(e,t,r){for(var i=0,n=e.length;i<n;++i)if(e[i].name===t){e[i]=RA,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Ug="http://www.w3.org/1999/xhtml";const Ov={svg:"http://www.w3.org/2000/svg",xhtml:Ug,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zd(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Ov.hasOwnProperty(t)?{space:Ov[t],local:e}:e}function PA(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Ug&&t.documentElement.namespaceURI===Ug?t.createElement(e):t.createElementNS(r,e)}}function IA(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function WS(e){var t=zd(e);return(t.local?IA:PA)(t)}function $A(){}function jy(e){return e==null?$A:function(){return this.querySelector(e)}}function jA(e){typeof e!="function"&&(e=jy(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var s=t[n],a=s.length,l=i[n]=new Array(a),u,h,d=0;d<a;++d)(u=s[d])&&(h=e.call(u,u.__data__,d,s))&&("__data__"in u&&(h.__data__=u.__data__),l[d]=h);return new Ci(i,this._parents)}function OA(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function zA(){return[]}function HS(e){return e==null?zA:function(){return this.querySelectorAll(e)}}function FA(e){return function(){return OA(e.apply(this,arguments))}}function NA(e){typeof e=="function"?e=FA(e):e=HS(e);for(var t=this._groups,r=t.length,i=[],n=[],s=0;s<r;++s)for(var a=t[s],l=a.length,u,h=0;h<l;++h)(u=a[h])&&(i.push(e.call(u,u.__data__,h,a)),n.push(u));return new Ci(i,n)}function qS(e){return function(){return this.matches(e)}}function US(e){return function(t){return t.matches(e)}}var WA=Array.prototype.find;function HA(e){return function(){return WA.call(this.children,e)}}function qA(){return this.firstElementChild}function UA(e){return this.select(e==null?qA:HA(typeof e=="function"?e:US(e)))}var VA=Array.prototype.filter;function GA(){return Array.from(this.children)}function YA(e){return function(){return VA.call(this.children,e)}}function KA(e){return this.selectAll(e==null?GA:YA(typeof e=="function"?e:US(e)))}function XA(e){typeof e!="function"&&(e=qS(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var s=t[n],a=s.length,l=i[n]=[],u,h=0;h<a;++h)(u=s[h])&&e.call(u,u.__data__,h,s)&&l.push(u);return new Ci(i,this._parents)}function VS(e){return new Array(e.length)}function QA(){return new Ci(this._enter||this._groups.map(VS),this._parents)}function Zu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zu.prototype={constructor:Zu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ZA(e){return function(){return e}}function JA(e,t,r,i,n,s){for(var a=0,l,u=t.length,h=s.length;a<h;++a)(l=t[a])?(l.__data__=s[a],i[a]=l):r[a]=new Zu(e,s[a]);for(;a<u;++a)(l=t[a])&&(n[a]=l)}function e5(e,t,r,i,n,s,a){var l,u,h=new Map,d=t.length,p=s.length,m=new Array(d),y;for(l=0;l<d;++l)(u=t[l])&&(m[l]=y=a.call(u,u.__data__,l,t)+"",h.has(y)?n[l]=u:h.set(y,u));for(l=0;l<p;++l)y=a.call(e,s[l],l,s)+"",(u=h.get(y))?(i[l]=u,u.__data__=s[l],h.delete(y)):r[l]=new Zu(e,s[l]);for(l=0;l<d;++l)(u=t[l])&&h.get(m[l])===u&&(n[l]=u)}function t5(e){return e.__data__}function r5(e,t){if(!arguments.length)return Array.from(this,t5);var r=t?e5:JA,i=this._parents,n=this._groups;typeof e!="function"&&(e=ZA(e));for(var s=n.length,a=new Array(s),l=new Array(s),u=new Array(s),h=0;h<s;++h){var d=i[h],p=n[h],m=p.length,y=i5(e.call(d,d&&d.__data__,h,i)),x=y.length,v=l[h]=new Array(x),S=a[h]=new Array(x),C=u[h]=new Array(m);r(d,p,v,S,C,y,t);for(var B=0,R=0,E,L;B<x;++B)if(E=v[B]){for(B>=R&&(R=B+1);!(L=S[R])&&++R<x;);E._next=L||null}}return a=new Ci(a,i),a._enter=l,a._exit=u,a}function i5(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function n5(){return new Ci(this._exit||this._groups.map(VS),this._parents)}function s5(e,t,r){var i=this.enter(),n=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(n=t(n),n&&(n=n.selection())),r==null?s.remove():r(s),i&&n?i.merge(n).order():n}function o5(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,n=r.length,s=i.length,a=Math.min(n,s),l=new Array(n),u=0;u<a;++u)for(var h=r[u],d=i[u],p=h.length,m=l[u]=new Array(p),y,x=0;x<p;++x)(y=h[x]||d[x])&&(m[x]=y);for(;u<n;++u)l[u]=r[u];return new Ci(l,this._parents)}function a5(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],n=i.length-1,s=i[n],a;--n>=0;)(a=i[n])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function l5(e){e||(e=c5);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var r=this._groups,i=r.length,n=new Array(i),s=0;s<i;++s){for(var a=r[s],l=a.length,u=n[s]=new Array(l),h,d=0;d<l;++d)(h=a[d])&&(u[d]=h);u.sort(t)}return new Ci(n,this._parents).order()}function c5(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function h5(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function u5(){return Array.from(this)}function d5(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],n=0,s=i.length;n<s;++n){var a=i[n];if(a)return a}return null}function f5(){let e=0;for(const t of this)++e;return e}function p5(){return!this.node()}function g5(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var n=t[r],s=0,a=n.length,l;s<a;++s)(l=n[s])&&e.call(l,l.__data__,s,n);return this}function m5(e){return function(){this.removeAttribute(e)}}function y5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _5(e,t){return function(){this.setAttribute(e,t)}}function x5(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function v5(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function b5(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function S5(e,t){var r=zd(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?y5:m5:typeof t=="function"?r.local?b5:v5:r.local?x5:_5)(r,t))}function GS(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function w5(e){return function(){this.style.removeProperty(e)}}function C5(e,t,r){return function(){this.style.setProperty(e,t,r)}}function k5(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function T5(e,t,r){return arguments.length>1?this.each((t==null?w5:typeof t=="function"?k5:C5)(e,t,r??"")):$a(this.node(),e)}function $a(e,t){return e.style.getPropertyValue(t)||GS(e).getComputedStyle(e,null).getPropertyValue(t)}function E5(e){return function(){delete this[e]}}function B5(e,t){return function(){this[e]=t}}function M5(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function L5(e,t){return arguments.length>1?this.each((t==null?E5:typeof t=="function"?M5:B5)(e,t)):this.node()[e]}function YS(e){return e.trim().split(/^|\s+/)}function Oy(e){return e.classList||new KS(e)}function KS(e){this._node=e,this._names=YS(e.getAttribute("class")||"")}KS.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function XS(e,t){for(var r=Oy(e),i=-1,n=t.length;++i<n;)r.add(t[i])}function QS(e,t){for(var r=Oy(e),i=-1,n=t.length;++i<n;)r.remove(t[i])}function R5(e){return function(){XS(this,e)}}function A5(e){return function(){QS(this,e)}}function D5(e,t){return function(){(t.apply(this,arguments)?XS:QS)(this,e)}}function P5(e,t){var r=YS(e+"");if(arguments.length<2){for(var i=Oy(this.node()),n=-1,s=r.length;++n<s;)if(!i.contains(r[n]))return!1;return!0}return this.each((typeof t=="function"?D5:t?R5:A5)(r,t))}function I5(){this.textContent=""}function $5(e){return function(){this.textContent=e}}function j5(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function O5(e){return arguments.length?this.each(e==null?I5:(typeof e=="function"?j5:$5)(e)):this.node().textContent}function z5(){this.innerHTML=""}function F5(e){return function(){this.innerHTML=e}}function N5(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function W5(e){return arguments.length?this.each(e==null?z5:(typeof e=="function"?N5:F5)(e)):this.node().innerHTML}function H5(){this.nextSibling&&this.parentNode.appendChild(this)}function q5(){return this.each(H5)}function U5(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function V5(){return this.each(U5)}function G5(e){var t=typeof e=="function"?e:WS(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Y5(){return null}function K5(e,t){var r=typeof e=="function"?e:WS(e),i=t==null?Y5:typeof t=="function"?t:jy(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function X5(){var e=this.parentNode;e&&e.removeChild(this)}function Q5(){return this.each(X5)}function Z5(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function J5(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eD(e){return this.select(e?J5:Z5)}function tD(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rD(e){return function(t){e.call(this,t,this.__data__)}}function iD(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function nD(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,n=t.length,s;r<n;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function sD(e,t,r){return function(){var i=this.__on,n,s=rD(t);if(i){for(var a=0,l=i.length;a<l;++a)if((n=i[a]).type===e.type&&n.name===e.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=s,n.options=r),n.value=t;return}}this.addEventListener(e.type,s,r),n={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(n):this.__on=[n]}}function oD(e,t,r){var i=iD(e+""),n,s=i.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,h=l.length,d;u<h;++u)for(n=0,d=l[u];n<s;++n)if((a=i[n]).type===d.type&&a.name===d.name)return d.value}return}for(l=t?sD:nD,n=0;n<s;++n)this.each(l(i[n],t,r));return this}function ZS(e,t,r){var i=GS(e),n=i.CustomEvent;typeof n=="function"?n=new n(t,r):(n=i.document.createEvent("Event"),r?(n.initEvent(t,r.bubbles,r.cancelable),n.detail=r.detail):n.initEvent(t,!1,!1)),e.dispatchEvent(n)}function aD(e,t){return function(){return ZS(this,e,t)}}function lD(e,t){return function(){return ZS(this,e,t.apply(this,arguments))}}function cD(e,t){return this.each((typeof t=="function"?lD:aD)(e,t))}function*hD(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],n=0,s=i.length,a;n<s;++n)(a=i[n])&&(yield a)}var JS=[null];function Ci(e,t){this._groups=e,this._parents=t}function Oc(){return new Ci([[document.documentElement]],JS)}function uD(){return this}Ci.prototype=Oc.prototype={constructor:Ci,select:jA,selectAll:NA,selectChild:UA,selectChildren:KA,filter:XA,data:r5,enter:QA,exit:n5,join:s5,merge:o5,selection:uD,order:a5,sort:l5,call:h5,nodes:u5,node:d5,size:f5,empty:p5,each:g5,attr:S5,style:T5,property:L5,classed:P5,text:O5,html:W5,raise:q5,lower:V5,append:G5,insert:K5,remove:Q5,clone:eD,datum:tD,on:oD,dispatch:cD,[Symbol.iterator]:hD};function it(e){return typeof e=="string"?new Ci([[document.querySelector(e)]],[document.documentElement]):new Ci([[e]],JS)}function zy(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function ew(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function zc(){}var xc=.7,Ju=1/xc,Ca="\\s*([+-]?\\d+)\\s*",vc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dD=/^#([0-9a-f]{3,8})$/,fD=new RegExp(`^rgb\\(${Ca},${Ca},${Ca}\\)$`),pD=new RegExp(`^rgb\\(${Bn},${Bn},${Bn}\\)$`),gD=new RegExp(`^rgba\\(${Ca},${Ca},${Ca},${vc}\\)$`),mD=new RegExp(`^rgba\\(${Bn},${Bn},${Bn},${vc}\\)$`),yD=new RegExp(`^hsl\\(${vc},${Bn},${Bn}\\)$`),_D=new RegExp(`^hsla\\(${vc},${Bn},${Bn},${vc}\\)$`),zv={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};zy(zc,bc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fv,formatHex:Fv,formatHex8:xD,formatHsl:vD,formatRgb:Nv,toString:Nv});function Fv(){return this.rgb().formatHex()}function xD(){return this.rgb().formatHex8()}function vD(){return tw(this).formatHsl()}function Nv(){return this.rgb().formatRgb()}function bc(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=dD.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Wv(t):r===3?new ui(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ru(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ru(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fD.exec(e))?new ui(t[1],t[2],t[3],1):(t=pD.exec(e))?new ui(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gD.exec(e))?ru(t[1],t[2],t[3],t[4]):(t=mD.exec(e))?ru(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yD.exec(e))?Uv(t[1],t[2]/100,t[3]/100,1):(t=_D.exec(e))?Uv(t[1],t[2]/100,t[3]/100,t[4]):zv.hasOwnProperty(e)?Wv(zv[e]):e==="transparent"?new ui(NaN,NaN,NaN,0):null}function Wv(e){return new ui(e>>16&255,e>>8&255,e&255,1)}function ru(e,t,r,i){return i<=0&&(e=t=r=NaN),new ui(e,t,r,i)}function bD(e){return e instanceof zc||(e=bc(e)),e?(e=e.rgb(),new ui(e.r,e.g,e.b,e.opacity)):new ui}function Vg(e,t,r,i){return arguments.length===1?bD(e):new ui(e,t,r,i??1)}function ui(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}zy(ui,Vg,ew(zc,{brighter(e){return e=e==null?Ju:Math.pow(Ju,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xc:Math.pow(xc,e),new ui(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ui(Bo(this.r),Bo(this.g),Bo(this.b),ed(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Hv,formatHex:Hv,formatHex8:SD,formatRgb:qv,toString:qv}));function Hv(){return`#${wo(this.r)}${wo(this.g)}${wo(this.b)}`}function SD(){return`#${wo(this.r)}${wo(this.g)}${wo(this.b)}${wo((isNaN(this.opacity)?1:this.opacity)*255)}`}function qv(){const e=ed(this.opacity);return`${e===1?"rgb(":"rgba("}${Bo(this.r)}, ${Bo(this.g)}, ${Bo(this.b)}${e===1?")":`, ${e})`}`}function ed(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wo(e){return e=Bo(e),(e<16?"0":"")+e.toString(16)}function Uv(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new sn(e,t,r,i)}function tw(e){if(e instanceof sn)return new sn(e.h,e.s,e.l,e.opacity);if(e instanceof zc||(e=bc(e)),!e)return new sn;if(e instanceof sn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,n=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,l=s-n,u=(s+n)/2;return l?(t===s?a=(r-i)/l+(r<i)*6:r===s?a=(i-t)/l+2:a=(t-r)/l+4,l/=u<.5?s+n:2-s-n,a*=60):l=u>0&&u<1?0:a,new sn(a,l,u,e.opacity)}function wD(e,t,r,i){return arguments.length===1?tw(e):new sn(e,t,r,i??1)}function sn(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}zy(sn,wD,ew(zc,{brighter(e){return e=e==null?Ju:Math.pow(Ju,e),new sn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xc:Math.pow(xc,e),new sn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,n=2*r-i;return new ui(ig(e>=240?e-240:e+120,n,i),ig(e,n,i),ig(e<120?e+240:e-120,n,i),this.opacity)},clamp(){return new sn(Vv(this.h),iu(this.s),iu(this.l),ed(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ed(this.opacity);return`${e===1?"hsl(":"hsla("}${Vv(this.h)}, ${iu(this.s)*100}%, ${iu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Vv(e){return e=(e||0)%360,e<0?e+360:e}function iu(e){return Math.max(0,Math.min(1,e||0))}function ig(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Fy=e=>()=>e;function rw(e,t){return function(r){return e+r*t}}function CD(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function TU(e,t){var r=t-e;return r?rw(e,r>180||r<-180?r-360*Math.round(r/360):r):Fy(isNaN(e)?t:e)}function kD(e){return(e=+e)==1?iw:function(t,r){return r-t?CD(t,r,e):Fy(isNaN(t)?r:t)}}function iw(e,t){var r=t-e;return r?rw(e,r):Fy(isNaN(e)?t:e)}const Gv=(function e(t){var r=kD(t);function i(n,s){var a=r((n=Vg(n)).r,(s=Vg(s)).r),l=r(n.g,s.g),u=r(n.b,s.b),h=iw(n.opacity,s.opacity);return function(d){return n.r=a(d),n.g=l(d),n.b=u(d),n.opacity=h(d),n+""}}return i.gamma=e,i})(1);function Ds(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Gg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ng=new RegExp(Gg.source,"g");function TD(e){return function(){return e}}function ED(e){return function(t){return e(t)+""}}function BD(e,t){var r=Gg.lastIndex=ng.lastIndex=0,i,n,s,a=-1,l=[],u=[];for(e=e+"",t=t+"";(i=Gg.exec(e))&&(n=ng.exec(t));)(s=n.index)>r&&(s=t.slice(r,s),l[a]?l[a]+=s:l[++a]=s),(i=i[0])===(n=n[0])?l[a]?l[a]+=n:l[++a]=n:(l[++a]=null,u.push({i:a,x:Ds(i,n)})),r=ng.lastIndex;return r<t.length&&(s=t.slice(r),l[a]?l[a]+=s:l[++a]=s),l.length<2?u[0]?ED(u[0].x):TD(t):(t=u.length,function(h){for(var d=0,p;d<t;++d)l[(p=u[d]).i]=p.x(h);return l.join("")})}var Yv=180/Math.PI,Yg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nw(e,t,r,i,n,s){var a,l,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*r+t*i)&&(r-=e*u,i-=t*u),(l=Math.sqrt(r*r+i*i))&&(r/=l,i/=l,u/=l),e*i<t*r&&(e=-e,t=-t,u=-u,a=-a),{translateX:n,translateY:s,rotate:Math.atan2(t,e)*Yv,skewX:Math.atan(u)*Yv,scaleX:a,scaleY:l}}var nu;function MD(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Yg:nw(t.a,t.b,t.c,t.d,t.e,t.f)}function LD(e){return e==null||(nu||(nu=document.createElementNS("http://www.w3.org/2000/svg","g")),nu.setAttribute("transform",e),!(e=nu.transform.baseVal.consolidate()))?Yg:(e=e.matrix,nw(e.a,e.b,e.c,e.d,e.e,e.f))}function sw(e,t,r,i){function n(h){return h.length?h.pop()+" ":""}function s(h,d,p,m,y,x){if(h!==p||d!==m){var v=y.push("translate(",null,t,null,r);x.push({i:v-4,x:Ds(h,p)},{i:v-2,x:Ds(d,m)})}else(p||m)&&y.push("translate("+p+t+m+r)}function a(h,d,p,m){h!==d?(h-d>180?d+=360:d-h>180&&(h+=360),m.push({i:p.push(n(p)+"rotate(",null,i)-2,x:Ds(h,d)})):d&&p.push(n(p)+"rotate("+d+i)}function l(h,d,p,m){h!==d?m.push({i:p.push(n(p)+"skewX(",null,i)-2,x:Ds(h,d)}):d&&p.push(n(p)+"skewX("+d+i)}function u(h,d,p,m,y,x){if(h!==p||d!==m){var v=y.push(n(y)+"scale(",null,",",null,")");x.push({i:v-4,x:Ds(h,p)},{i:v-2,x:Ds(d,m)})}else(p!==1||m!==1)&&y.push(n(y)+"scale("+p+","+m+")")}return function(h,d){var p=[],m=[];return h=e(h),d=e(d),s(h.translateX,h.translateY,d.translateX,d.translateY,p,m),a(h.rotate,d.rotate,p,m),l(h.skewX,d.skewX,p,m),u(h.scaleX,h.scaleY,d.scaleX,d.scaleY,p,m),h=d=null,function(y){for(var x=-1,v=m.length,S;++x<v;)p[(S=m[x]).i]=S.x(y);return p.join("")}}}var RD=sw(MD,"px, ","px)","deg)"),AD=sw(LD,", ",")",")"),ja=0,ec=0,Fl=0,ow=1e3,td,tc,rd=0,Po=0,Fd=0,Sc=typeof performance=="object"&&performance.now?performance:Date,aw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ny(){return Po||(aw(DD),Po=Sc.now()+Fd)}function DD(){Po=0}function id(){this._call=this._time=this._next=null}id.prototype=lw.prototype={constructor:id,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Ny():+r)+(t==null?0:+t),!this._next&&tc!==this&&(tc?tc._next=this:td=this,tc=this),this._call=e,this._time=r,Kg()},stop:function(){this._call&&(this._call=null,this._time=1/0,Kg())}};function lw(e,t,r){var i=new id;return i.restart(e,t,r),i}function PD(){Ny(),++ja;for(var e=td,t;e;)(t=Po-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ja}function Kv(){Po=(rd=Sc.now())+Fd,ja=ec=0;try{PD()}finally{ja=0,$D(),Po=0}}function ID(){var e=Sc.now(),t=e-rd;t>ow&&(Fd-=t,rd=e)}function $D(){for(var e,t=td,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:td=r);tc=e,Kg(i)}function Kg(e){if(!ja){ec&&(ec=clearTimeout(ec));var t=e-Po;t>24?(e<1/0&&(ec=setTimeout(Kv,e-Sc.now()-Fd)),Fl&&(Fl=clearInterval(Fl))):(Fl||(rd=Sc.now(),Fl=setInterval(ID,ow)),ja=1,aw(Kv))}}function Xv(e,t,r){var i=new id;return t=t==null?0:+t,i.restart(n=>{i.stop(),e(n+t)},t,r),i}var jD=NS("start","end","cancel","interrupt"),OD=[],cw=0,Qv=1,Xg=2,Tu=3,Zv=4,Qg=5,Eu=6;function Nd(e,t,r,i,n,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;zD(e,r,{name:t,index:i,group:n,on:jD,tween:OD,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:cw})}function Wy(e,t){var r=cn(e,t);if(r.state>cw)throw new Error("too late; already scheduled");return r}function Dn(e,t){var r=cn(e,t);if(r.state>Tu)throw new Error("too late; already running");return r}function cn(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function zD(e,t,r){var i=e.__transition,n;i[t]=r,r.timer=lw(s,0,r.time);function s(h){r.state=Qv,r.timer.restart(a,r.delay,r.time),r.delay<=h&&a(h-r.delay)}function a(h){var d,p,m,y;if(r.state!==Qv)return u();for(d in i)if(y=i[d],y.name===r.name){if(y.state===Tu)return Xv(a);y.state===Zv?(y.state=Eu,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete i[d]):+d<t&&(y.state=Eu,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete i[d])}if(Xv(function(){r.state===Tu&&(r.state=Zv,r.timer.restart(l,r.delay,r.time),l(h))}),r.state=Xg,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Xg){for(r.state=Tu,n=new Array(m=r.tween.length),d=0,p=-1;d<m;++d)(y=r.tween[d].value.call(e,e.__data__,r.index,r.group))&&(n[++p]=y);n.length=p+1}}function l(h){for(var d=h<r.duration?r.ease.call(null,h/r.duration):(r.timer.restart(u),r.state=Qg,1),p=-1,m=n.length;++p<m;)n[p].call(e,d);r.state===Qg&&(r.on.call("end",e,e.__data__,r.index,r.group),u())}function u(){r.state=Eu,r.timer.stop(),delete i[t];for(var h in i)return;delete e.__transition}}function FD(e,t){var r=e.__transition,i,n,s=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){s=!1;continue}n=i.state>Xg&&i.state<Qg,i.state=Eu,i.timer.stop(),i.on.call(n?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function ND(e){return this.each(function(){FD(this,e)})}function WD(e,t){var r,i;return function(){var n=Dn(this,e),s=n.tween;if(s!==r){i=r=s;for(var a=0,l=i.length;a<l;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}n.tween=i}}function HD(e,t,r){var i,n;if(typeof r!="function")throw new Error;return function(){var s=Dn(this,e),a=s.tween;if(a!==i){n=(i=a).slice();for(var l={name:t,value:r},u=0,h=n.length;u<h;++u)if(n[u].name===t){n[u]=l;break}u===h&&n.push(l)}s.tween=n}}function qD(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=cn(this.node(),r).tween,n=0,s=i.length,a;n<s;++n)if((a=i[n]).name===e)return a.value;return null}return this.each((t==null?WD:HD)(r,e,t))}function Hy(e,t,r){var i=e._id;return e.each(function(){var n=Dn(this,i);(n.value||(n.value={}))[t]=r.apply(this,arguments)}),function(n){return cn(n,i).value[t]}}function hw(e,t){var r;return(typeof t=="number"?Ds:t instanceof bc?Gv:(r=bc(t))?(t=r,Gv):BD)(e,t)}function UD(e){return function(){this.removeAttribute(e)}}function VD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function GD(e,t,r){var i,n=r+"",s;return function(){var a=this.getAttribute(e);return a===n?null:a===i?s:s=t(i=a,r)}}function YD(e,t,r){var i,n=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===n?null:a===i?s:s=t(i=a,r)}}function KD(e,t,r){var i,n,s;return function(){var a,l=r(this),u;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),u=l+"",a===u?null:a===i&&u===n?s:(n=u,s=t(i=a,l)))}}function XD(e,t,r){var i,n,s;return function(){var a,l=r(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),u=l+"",a===u?null:a===i&&u===n?s:(n=u,s=t(i=a,l)))}}function QD(e,t){var r=zd(e),i=r==="transform"?AD:hw;return this.attrTween(e,typeof t=="function"?(r.local?XD:KD)(r,i,Hy(this,"attr."+e,t)):t==null?(r.local?VD:UD)(r):(r.local?YD:GD)(r,i,t))}function ZD(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function JD(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function eP(e,t){var r,i;function n(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&JD(e,s)),r}return n._value=t,n}function tP(e,t){var r,i;function n(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&ZD(e,s)),r}return n._value=t,n}function rP(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=zd(e);return this.tween(r,(i.local?eP:tP)(i,t))}function iP(e,t){return function(){Wy(this,e).delay=+t.apply(this,arguments)}}function nP(e,t){return t=+t,function(){Wy(this,e).delay=t}}function sP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?iP:nP)(t,e)):cn(this.node(),t).delay}function oP(e,t){return function(){Dn(this,e).duration=+t.apply(this,arguments)}}function aP(e,t){return t=+t,function(){Dn(this,e).duration=t}}function lP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?oP:aP)(t,e)):cn(this.node(),t).duration}function cP(e,t){if(typeof t!="function")throw new Error;return function(){Dn(this,e).ease=t}}function hP(e){var t=this._id;return arguments.length?this.each(cP(t,e)):cn(this.node(),t).ease}function uP(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Dn(this,e).ease=r}}function dP(e){if(typeof e!="function")throw new Error;return this.each(uP(this._id,e))}function fP(e){typeof e!="function"&&(e=qS(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var s=t[n],a=s.length,l=i[n]=[],u,h=0;h<a;++h)(u=s[h])&&e.call(u,u.__data__,h,s)&&l.push(u);return new ts(i,this._parents,this._name,this._id)}function pP(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,n=r.length,s=Math.min(i,n),a=new Array(i),l=0;l<s;++l)for(var u=t[l],h=r[l],d=u.length,p=a[l]=new Array(d),m,y=0;y<d;++y)(m=u[y]||h[y])&&(p[y]=m);for(;l<i;++l)a[l]=t[l];return new ts(a,this._parents,this._name,this._id)}function gP(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function mP(e,t,r){var i,n,s=gP(t)?Wy:Dn;return function(){var a=s(this,e),l=a.on;l!==i&&(n=(i=l).copy()).on(t,r),a.on=n}}function yP(e,t){var r=this._id;return arguments.length<2?cn(this.node(),r).on.on(e):this.each(mP(r,e,t))}function _P(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function xP(){return this.on("end.remove",_P(this._id))}function vP(e){var t=this._name,r=this._id;typeof e!="function"&&(e=jy(e));for(var i=this._groups,n=i.length,s=new Array(n),a=0;a<n;++a)for(var l=i[a],u=l.length,h=s[a]=new Array(u),d,p,m=0;m<u;++m)(d=l[m])&&(p=e.call(d,d.__data__,m,l))&&("__data__"in d&&(p.__data__=d.__data__),h[m]=p,Nd(h[m],t,r,m,h,cn(d,r)));return new ts(s,this._parents,t,r)}function bP(e){var t=this._name,r=this._id;typeof e!="function"&&(e=HS(e));for(var i=this._groups,n=i.length,s=[],a=[],l=0;l<n;++l)for(var u=i[l],h=u.length,d,p=0;p<h;++p)if(d=u[p]){for(var m=e.call(d,d.__data__,p,u),y,x=cn(d,r),v=0,S=m.length;v<S;++v)(y=m[v])&&Nd(y,t,r,v,m,x);s.push(m),a.push(d)}return new ts(s,a,t,r)}var SP=Oc.prototype.constructor;function wP(){return new SP(this._groups,this._parents)}function CP(e,t){var r,i,n;return function(){var s=$a(this,e),a=(this.style.removeProperty(e),$a(this,e));return s===a?null:s===r&&a===i?n:n=t(r=s,i=a)}}function uw(e){return function(){this.style.removeProperty(e)}}function kP(e,t,r){var i,n=r+"",s;return function(){var a=$a(this,e);return a===n?null:a===i?s:s=t(i=a,r)}}function TP(e,t,r){var i,n,s;return function(){var a=$a(this,e),l=r(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),$a(this,e))),a===u?null:a===i&&u===n?s:(n=u,s=t(i=a,l))}}function EP(e,t){var r,i,n,s="style."+t,a="end."+s,l;return function(){var u=Dn(this,e),h=u.on,d=u.value[s]==null?l||(l=uw(t)):void 0;(h!==r||n!==d)&&(i=(r=h).copy()).on(a,n=d),u.on=i}}function BP(e,t,r){var i=(e+="")=="transform"?RD:hw;return t==null?this.styleTween(e,CP(e,i)).on("end.style."+e,uw(e)):typeof t=="function"?this.styleTween(e,TP(e,i,Hy(this,"style."+e,t))).each(EP(this._id,e)):this.styleTween(e,kP(e,i,t),r).on("end.style."+e,null)}function MP(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function LP(e,t,r){var i,n;function s(){var a=t.apply(this,arguments);return a!==n&&(i=(n=a)&&MP(e,a,r)),i}return s._value=t,s}function RP(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,LP(e,t,r??""))}function AP(e){return function(){this.textContent=e}}function DP(e){return function(){var t=e(this);this.textContent=t??""}}function PP(e){return this.tween("text",typeof e=="function"?DP(Hy(this,"text",e)):AP(e==null?"":e+""))}function IP(e){return function(t){this.textContent=e.call(this,t)}}function $P(e){var t,r;function i(){var n=e.apply(this,arguments);return n!==r&&(t=(r=n)&&IP(n)),t}return i._value=e,i}function jP(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,$P(e))}function OP(){for(var e=this._name,t=this._id,r=dw(),i=this._groups,n=i.length,s=0;s<n;++s)for(var a=i[s],l=a.length,u,h=0;h<l;++h)if(u=a[h]){var d=cn(u,t);Nd(u,e,r,h,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new ts(i,this._parents,e,r)}function zP(){var e,t,r=this,i=r._id,n=r.size();return new Promise(function(s,a){var l={value:a},u={value:function(){--n===0&&s()}};r.each(function(){var h=Dn(this,i),d=h.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),h.on=t}),n===0&&s()})}var FP=0;function ts(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function dw(){return++FP}var Yn=Oc.prototype;ts.prototype={constructor:ts,select:vP,selectAll:bP,selectChild:Yn.selectChild,selectChildren:Yn.selectChildren,filter:fP,merge:pP,selection:wP,transition:OP,call:Yn.call,nodes:Yn.nodes,node:Yn.node,size:Yn.size,empty:Yn.empty,each:Yn.each,on:yP,attr:QD,attrTween:rP,style:BP,styleTween:RP,text:PP,textTween:jP,remove:xP,tween:qD,delay:sP,duration:lP,ease:hP,easeVarying:dP,end:zP,[Symbol.iterator]:Yn[Symbol.iterator]};function NP(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var WP={time:null,delay:0,duration:250,ease:NP};function HP(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function qP(e){var t,r;e instanceof ts?(t=e._id,e=e._name):(t=dw(),(r=WP).time=Ny(),e=e==null?null:e+"");for(var i=this._groups,n=i.length,s=0;s<n;++s)for(var a=i[s],l=a.length,u,h=0;h<l;++h)(u=a[h])&&Nd(u,e,t,h,a,r||HP(u,t));return new ts(i,this._parents,e,t)}Oc.prototype.interrupt=ND;Oc.prototype.transition=qP;const Zg=Math.PI,Jg=2*Zg,yo=1e-6,UP=Jg-yo;function fw(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function VP(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return fw;const r=10**t;return function(i){this._+=i[0];for(let n=1,s=i.length;n<s;++n)this._+=Math.round(arguments[n]*r)/r+i[n]}}class GP{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?fw:VP(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,n){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+n}`}bezierCurveTo(t,r,i,n,s,a){this._append`C${+t},${+r},${+i},${+n},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,i,n,s){if(t=+t,r=+r,i=+i,n=+n,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,l=this._y1,u=i-t,h=n-r,d=a-t,p=l-r,m=d*d+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>yo)if(!(Math.abs(p*u-h*d)>yo)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let y=i-a,x=n-l,v=u*u+h*h,S=y*y+x*x,C=Math.sqrt(v),B=Math.sqrt(m),R=s*Math.tan((Zg-Math.acos((v+m-S)/(2*C*B)))/2),E=R/B,L=R/C;Math.abs(E-1)>yo&&this._append`L${t+E*d},${r+E*p}`,this._append`A${s},${s},0,0,${+(p*y>d*x)},${this._x1=t+L*u},${this._y1=r+L*h}`}}arc(t,r,i,n,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let l=i*Math.cos(n),u=i*Math.sin(n),h=t+l,d=r+u,p=1^a,m=a?n-s:s-n;this._x1===null?this._append`M${h},${d}`:(Math.abs(this._x1-h)>yo||Math.abs(this._y1-d)>yo)&&this._append`L${h},${d}`,i&&(m<0&&(m=m%Jg+Jg),m>UP?this._append`A${i},${i},0,1,${p},${t-l},${r-u}A${i},${i},0,1,${p},${this._x1=h},${this._y1=d}`:m>yo&&this._append`A${i},${i},0,${+(m>=Zg)},${p},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+n}h${-i}Z`}toString(){return this._}}function ga(e){return function(){return e}}const EU=Math.abs,BU=Math.atan2,MU=Math.cos,LU=Math.max,RU=Math.min,AU=Math.sin,DU=Math.sqrt,Jv=1e-12,qy=Math.PI,e1=qy/2,PU=2*qy;function IU(e){return e>1?0:e<-1?qy:Math.acos(e)}function $U(e){return e>=1?e1:e<=-1?-e1:Math.asin(e)}function YP(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new GP(t)}function KP(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pw(e){this._context=e}pw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function nd(e){return new pw(e)}function XP(e){return e[0]}function QP(e){return e[1]}function ZP(e,t){var r=ga(!0),i=null,n=nd,s=null,a=YP(l);e=typeof e=="function"?e:e===void 0?XP:ga(e),t=typeof t=="function"?t:t===void 0?QP:ga(t);function l(u){var h,d=(u=KP(u)).length,p,m=!1,y;for(i==null&&(s=n(y=a())),h=0;h<=d;++h)!(h<d&&r(p=u[h],h,u))===m&&((m=!m)?s.lineStart():s.lineEnd()),m&&s.point(+e(p,h,u),+t(p,h,u));if(y)return s=null,y+""||null}return l.x=function(u){return arguments.length?(e=typeof u=="function"?u:ga(+u),l):e},l.y=function(u){return arguments.length?(t=typeof u=="function"?u:ga(+u),l):t},l.defined=function(u){return arguments.length?(r=typeof u=="function"?u:ga(!!u),l):r},l.curve=function(u){return arguments.length?(n=u,i!=null&&(s=n(i)),l):n},l.context=function(u){return arguments.length?(u==null?i=s=null:s=n(i=u),l):i},l}class gw{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function mw(e){return new gw(e,!0)}function yw(e){return new gw(e,!1)}function Ws(){}function sd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Wd(e){this._context=e}Wd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:sd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:sd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bu(e){return new Wd(e)}function _w(e){this._context=e}_w.prototype={areaStart:Ws,areaEnd:Ws,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:sd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JP(e){return new _w(e)}function xw(e){this._context=e}xw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:sd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function e4(e){return new xw(e)}function vw(e,t){this._basis=new Wd(e),this._beta=t}vw.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],n=t[0],s=e[r]-i,a=t[r]-n,l=-1,u;++l<=r;)u=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(i+u*s),this._beta*t[l]+(1-this._beta)*(n+u*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const t4=(function e(t){function r(i){return t===1?new Wd(i):new vw(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function od(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Uy(e,t){this._context=e,this._k=(1-t)/6}Uy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:od(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:od(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const bw=(function e(t){function r(i){return new Uy(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Vy(e,t){this._context=e,this._k=(1-t)/6}Vy.prototype={areaStart:Ws,areaEnd:Ws,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:od(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const r4=(function e(t){function r(i){return new Vy(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Gy(e,t){this._context=e,this._k=(1-t)/6}Gy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:od(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const i4=(function e(t){function r(i){return new Gy(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Yy(e,t,r){var i=e._x1,n=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Jv){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,n=(n*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Jv){var h=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,d=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*h+e._x1*e._l23_2a-t*e._l12_2a)/d,a=(a*h+e._y1*e._l23_2a-r*e._l12_2a)/d}e._context.bezierCurveTo(i,n,s,a,e._x2,e._y2)}function Sw(e,t){this._context=e,this._alpha=t}Sw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Yy(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ww=(function e(t){function r(i){return t?new Sw(i,t):new Uy(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Cw(e,t){this._context=e,this._alpha=t}Cw.prototype={areaStart:Ws,areaEnd:Ws,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Yy(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const n4=(function e(t){function r(i){return t?new Cw(i,t):new Vy(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function kw(e,t){this._context=e,this._alpha=t}kw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Yy(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const s4=(function e(t){function r(i){return t?new kw(i,t):new Gy(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Tw(e){this._context=e}Tw.prototype={areaStart:Ws,areaEnd:Ws,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function o4(e){return new Tw(e)}function t1(e){return e<0?-1:1}function r1(e,t,r){var i=e._x1-e._x0,n=t-e._x1,s=(e._y1-e._y0)/(i||n<0&&-0),a=(r-e._y1)/(n||i<0&&-0),l=(s*n+a*i)/(i+n);return(t1(s)+t1(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(l))||0}function i1(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function sg(e,t,r){var i=e._x0,n=e._y0,s=e._x1,a=e._y1,l=(s-i)/3;e._context.bezierCurveTo(i+l,n+l*t,s-l,a-l*r,s,a)}function ad(e){this._context=e}ad.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:sg(this,this._t0,i1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,sg(this,i1(this,r=r1(this,e,t)),r);break;default:sg(this,this._t0,r=r1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Ew(e){this._context=new Bw(e)}(Ew.prototype=Object.create(ad.prototype)).point=function(e,t){ad.prototype.point.call(this,t,e)};function Bw(e){this._context=e}Bw.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,n,s){this._context.bezierCurveTo(t,e,i,r,s,n)}};function Mw(e){return new ad(e)}function Lw(e){return new Ew(e)}function Rw(e){this._context=e}Rw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=n1(e),n=n1(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(i[0][s],n[0][s],i[1][s],n[1][s],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function n1(e){var t,r=e.length-1,i,n=new Array(r),s=new Array(r),a=new Array(r);for(n[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)n[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(n[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=n[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(n[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)n[t]=(a[t]-n[t+1])/s[t];for(s[r-1]=(e[r]+n[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-n[t+1];return[n,s]}function Aw(e){return new Rw(e)}function Hd(e,t){this._context=e,this._t=t}Hd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Dw(e){return new Hd(e,.5)}function Pw(e){return new Hd(e,0)}function Iw(e){return new Hd(e,1)}function rc(e,t,r){this.k=e,this.x=t,this.y=r}rc.prototype={constructor:rc,scale:function(e){return e===1?this:new rc(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new rc(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};rc.prototype;var a4=T(e=>{var n;const{securityLevel:t}=ft();let r=it("body");if(t==="sandbox"){const a=((n=it(`#i${e}`).node())==null?void 0:n.contentDocument)??document;r=it(a.body)}return r.select(`#${e}`)},"selectSvgElement");function Ky(e){return typeof e>"u"||e===null}T(Ky,"isNothing");function $w(e){return typeof e=="object"&&e!==null}T($w,"isObject");function jw(e){return Array.isArray(e)?e:Ky(e)?[]:[e]}T(jw,"toArray");function Ow(e,t){var r,i,n,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)n=s[r],e[n]=t[n];return e}T(Ow,"extend");function zw(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}T(zw,"repeat");function Fw(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}T(Fw,"isNegativeZero");var l4=Ky,c4=$w,h4=jw,u4=zw,d4=Fw,f4=Ow,or={isNothing:l4,isObject:c4,toArray:h4,repeat:u4,isNegativeZero:d4,extend:f4};function Xy(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
181
|
+
|
|
182
|
+
`+e.mark.snippet),i+" "+r):i}T(Xy,"formatError");function Oa(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Xy(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}T(Oa,"YAMLException$1");Oa.prototype=Object.create(Error.prototype);Oa.prototype.constructor=Oa;Oa.prototype.toString=T(function(t){return this.name+": "+Xy(this,t)},"toString");var hi=Oa;function Mu(e,t,r,i,n){var s="",a="",l=Math.floor(n/2)-1;return i-t>l&&(s=" ... ",t=i-l+s.length),r-i>l&&(a=" ...",r=i+l-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}T(Mu,"getLine");function Lu(e,t){return or.repeat(" ",t-e.length)+e}T(Lu,"padStart");function Nw(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],n=[],s,a=-1;s=r.exec(e.buffer);)n.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var l="",u,h,d=Math.min(e.line+t.linesAfter,n.length).toString().length,p=t.maxLength-(t.indent+d+3);for(u=1;u<=t.linesBefore&&!(a-u<0);u++)h=Mu(e.buffer,i[a-u],n[a-u],e.position-(i[a]-i[a-u]),p),l=or.repeat(" ",t.indent)+Lu((e.line-u+1).toString(),d)+" | "+h.str+`
|
|
183
|
+
`+l;for(h=Mu(e.buffer,i[a],n[a],e.position,p),l+=or.repeat(" ",t.indent)+Lu((e.line+1).toString(),d)+" | "+h.str+`
|
|
184
|
+
`,l+=or.repeat("-",t.indent+d+3+h.pos)+`^
|
|
185
|
+
`,u=1;u<=t.linesAfter&&!(a+u>=n.length);u++)h=Mu(e.buffer,i[a+u],n[a+u],e.position-(i[a]-i[a+u]),p),l+=or.repeat(" ",t.indent)+Lu((e.line+u+1).toString(),d)+" | "+h.str+`
|
|
186
|
+
`;return l.replace(/\n$/,"")}T(Nw,"makeSnippet");var p4=Nw,g4=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],m4=["scalar","sequence","mapping"];function Ww(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}T(Ww,"compileStyleAliases");function Hw(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(g4.indexOf(r)===-1)throw new hi('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Ww(t.styleAliases||null),m4.indexOf(this.kind)===-1)throw new hi('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}T(Hw,"Type$1");var $r=Hw;function em(e,t){var r=[];return e[t].forEach(function(i){var n=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(n=a)}),r[n]=i}),r}T(em,"compileList");function qw(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(T(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}T(qw,"compileMap");function ld(e){return this.extend(e)}T(ld,"Schema$1");ld.prototype.extend=T(function(t){var r=[],i=[];if(t instanceof $r)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new hi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof $r))throw new hi("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new hi("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new hi("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof $r))throw new hi("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var n=Object.create(ld.prototype);return n.implicit=(this.implicit||[]).concat(r),n.explicit=(this.explicit||[]).concat(i),n.compiledImplicit=em(n,"implicit"),n.compiledExplicit=em(n,"explicit"),n.compiledTypeMap=qw(n.compiledImplicit,n.compiledExplicit),n},"extend");var y4=ld,_4=new $r("tag:yaml.org,2002:str",{kind:"scalar",construct:T(function(e){return e!==null?e:""},"construct")}),x4=new $r("tag:yaml.org,2002:seq",{kind:"sequence",construct:T(function(e){return e!==null?e:[]},"construct")}),v4=new $r("tag:yaml.org,2002:map",{kind:"mapping",construct:T(function(e){return e!==null?e:{}},"construct")}),b4=new y4({explicit:[_4,x4,v4]});function Uw(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}T(Uw,"resolveYamlNull");function Vw(){return null}T(Vw,"constructYamlNull");function Gw(e){return e===null}T(Gw,"isNull");var S4=new $r("tag:yaml.org,2002:null",{kind:"scalar",resolve:Uw,construct:Vw,predicate:Gw,represent:{canonical:T(function(){return"~"},"canonical"),lowercase:T(function(){return"null"},"lowercase"),uppercase:T(function(){return"NULL"},"uppercase"),camelcase:T(function(){return"Null"},"camelcase"),empty:T(function(){return""},"empty")},defaultStyle:"lowercase"});function Yw(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}T(Yw,"resolveYamlBoolean");function Kw(e){return e==="true"||e==="True"||e==="TRUE"}T(Kw,"constructYamlBoolean");function Xw(e){return Object.prototype.toString.call(e)==="[object Boolean]"}T(Xw,"isBoolean");var w4=new $r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Yw,construct:Kw,predicate:Xw,represent:{lowercase:T(function(e){return e?"true":"false"},"lowercase"),uppercase:T(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:T(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function Qw(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}T(Qw,"isHexCode");function Zw(e){return 48<=e&&e<=55}T(Zw,"isOctCode");function Jw(e){return 48<=e&&e<=57}T(Jw,"isDecCode");function eC(e){if(e===null)return!1;var t=e.length,r=0,i=!1,n;if(!t)return!1;if(n=e[r],(n==="-"||n==="+")&&(n=e[++r]),n==="0"){if(r+1===t)return!0;if(n=e[++r],n==="b"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(n!=="0"&&n!=="1")return!1;i=!0}return i&&n!=="_"}if(n==="x"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!Qw(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}if(n==="o"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!Zw(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}}if(n==="_")return!1;for(;r<t;r++)if(n=e[r],n!=="_"){if(!Jw(e.charCodeAt(r)))return!1;i=!0}return!(!i||n==="_")}T(eC,"resolveYamlInteger");function tC(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}T(tC,"constructYamlInteger");function rC(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!or.isNegativeZero(e)}T(rC,"isInteger");var C4=new $r("tag:yaml.org,2002:int",{kind:"scalar",resolve:eC,construct:tC,predicate:rC,represent:{binary:T(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:T(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:T(function(e){return e.toString(10)},"decimal"),hexadecimal:T(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),k4=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function iC(e){return!(e===null||!k4.test(e)||e[e.length-1]==="_")}T(iC,"resolveYamlFloat");function nC(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}T(nC,"constructYamlFloat");var T4=/^[-+]?[0-9]+e/;function sC(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(or.isNegativeZero(e))return"-0.0";return r=e.toString(10),T4.test(r)?r.replace("e",".e"):r}T(sC,"representYamlFloat");function oC(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||or.isNegativeZero(e))}T(oC,"isFloat");var E4=new $r("tag:yaml.org,2002:float",{kind:"scalar",resolve:iC,construct:nC,predicate:oC,represent:sC,defaultStyle:"lowercase"}),aC=b4.extend({implicit:[S4,w4,C4,E4]}),B4=aC,lC=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),cC=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function hC(e){return e===null?!1:lC.exec(e)!==null||cC.exec(e)!==null}T(hC,"resolveYamlTimestamp");function uC(e){var t,r,i,n,s,a,l,u=0,h=null,d,p,m;if(t=lC.exec(e),t===null&&(t=cC.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,i,n));if(s=+t[4],a=+t[5],l=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(d=+t[10],p=+(t[11]||0),h=(d*60+p)*6e4,t[9]==="-"&&(h=-h)),m=new Date(Date.UTC(r,i,n,s,a,l,u)),h&&m.setTime(m.getTime()-h),m}T(uC,"constructYamlTimestamp");function dC(e){return e.toISOString()}T(dC,"representYamlTimestamp");var M4=new $r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:hC,construct:uC,instanceOf:Date,represent:dC});function fC(e){return e==="<<"||e===null}T(fC,"resolveYamlMerge");var L4=new $r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:fC}),Qy=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
187
|
+
\r`;function pC(e){if(e===null)return!1;var t,r,i=0,n=e.length,s=Qy;for(r=0;r<n;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}T(pC,"resolveYamlBinary");function gC(e){var t,r,i=e.replace(/[\r\n=]/g,""),n=i.length,s=Qy,a=0,l=[];for(t=0;t<n;t++)t%4===0&&t&&(l.push(a>>16&255),l.push(a>>8&255),l.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=n%4*6,r===0?(l.push(a>>16&255),l.push(a>>8&255),l.push(a&255)):r===18?(l.push(a>>10&255),l.push(a>>2&255)):r===12&&l.push(a>>4&255),new Uint8Array(l)}T(gC,"constructYamlBinary");function mC(e){var t="",r=0,i,n,s=e.length,a=Qy;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return n=s%3,n===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):n===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):n===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}T(mC,"representYamlBinary");function yC(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}T(yC,"isBinary");var R4=new $r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:pC,construct:gC,predicate:yC,represent:mC}),A4=Object.prototype.hasOwnProperty,D4=Object.prototype.toString;function _C(e){if(e===null)return!0;var t=[],r,i,n,s,a,l=e;for(r=0,i=l.length;r<i;r+=1){if(n=l[r],a=!1,D4.call(n)!=="[object Object]")return!1;for(s in n)if(A4.call(n,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}T(_C,"resolveYamlOmap");function xC(e){return e!==null?e:[]}T(xC,"constructYamlOmap");var P4=new $r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:_C,construct:xC}),I4=Object.prototype.toString;function vC(e){if(e===null)return!0;var t,r,i,n,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],I4.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;s[t]=[n[0],i[n[0]]]}return!0}T(vC,"resolveYamlPairs");function bC(e){if(e===null)return[];var t,r,i,n,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],n=Object.keys(i),s[t]=[n[0],i[n[0]]];return s}T(bC,"constructYamlPairs");var $4=new $r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:vC,construct:bC}),j4=Object.prototype.hasOwnProperty;function SC(e){if(e===null)return!0;var t,r=e;for(t in r)if(j4.call(r,t)&&r[t]!==null)return!1;return!0}T(SC,"resolveYamlSet");function wC(e){return e!==null?e:{}}T(wC,"constructYamlSet");var O4=new $r("tag:yaml.org,2002:set",{kind:"mapping",resolve:SC,construct:wC}),CC=B4.extend({implicit:[M4,L4],explicit:[R4,P4,$4,O4]}),Hs=Object.prototype.hasOwnProperty,cd=1,kC=2,TC=3,hd=4,og=1,z4=2,s1=3,F4=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,N4=/[\x85\u2028\u2029]/,W4=/[,\[\]\{\}]/,EC=/^(?:!|!!|![a-z\-]+!)$/i,BC=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function tm(e){return Object.prototype.toString.call(e)}T(tm,"_class");function an(e){return e===10||e===13}T(an,"is_EOL");function zs(e){return e===9||e===32}T(zs,"is_WHITE_SPACE");function Yr(e){return e===9||e===32||e===10||e===13}T(Yr,"is_WS_OR_EOL");function Co(e){return e===44||e===91||e===93||e===123||e===125}T(Co,"is_FLOW_INDICATOR");function MC(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}T(MC,"fromHexCode");function LC(e){return e===120?2:e===117?4:e===85?8:0}T(LC,"escapedHexLen");function RC(e){return 48<=e&&e<=57?e-48:-1}T(RC,"fromDecimalCode");function rm(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
188
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}T(rm,"simpleEscapeSequence");function AC(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}T(AC,"charFromCodepoint");var DC=new Array(256),PC=new Array(256);for(go=0;go<256;go++)DC[go]=rm(go)?1:0,PC[go]=rm(go);var go;function IC(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||CC,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}T(IC,"State$1");function Zy(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=p4(r),new hi(t,r)}T(Zy,"generateError");function Oe(e,t){throw Zy(e,t)}T(Oe,"throwError");function wc(e,t){e.onWarning&&e.onWarning.call(null,Zy(e,t))}T(wc,"throwWarning");var o1={YAML:T(function(t,r,i){var n,s,a;t.version!==null&&Oe(t,"duplication of %YAML directive"),i.length!==1&&Oe(t,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&Oe(t,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),a=parseInt(n[2],10),s!==1&&Oe(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&wc(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:T(function(t,r,i){var n,s;i.length!==2&&Oe(t,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],EC.test(n)||Oe(t,"ill-formed tag handle (first argument) of the TAG directive"),Hs.call(t.tagMap,n)&&Oe(t,'there is a previously declared suffix for "'+n+'" tag handle'),BC.test(s)||Oe(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{Oe(t,"tag prefix is malformed: "+s)}t.tagMap[n]=s},"handleTagDirective")};function es(e,t,r,i){var n,s,a,l;if(t<r){if(l=e.input.slice(t,r),i)for(n=0,s=l.length;n<s;n+=1)a=l.charCodeAt(n),a===9||32<=a&&a<=1114111||Oe(e,"expected valid JSON character");else F4.test(l)&&Oe(e,"the stream contains non-printable characters");e.result+=l}}T(es,"captureSegment");function im(e,t,r,i){var n,s,a,l;for(or.isObject(r)||Oe(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),a=0,l=n.length;a<l;a+=1)s=n[a],Hs.call(t,s)||(t[s]=r[s],i[s]=!0)}T(im,"mergeMappings");function ko(e,t,r,i,n,s,a,l,u){var h,d;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),h=0,d=n.length;h<d;h+=1)Array.isArray(n[h])&&Oe(e,"nested arrays are not supported inside keys"),typeof n=="object"&&tm(n[h])==="[object Object]"&&(n[h]="[object Object]");if(typeof n=="object"&&tm(n)==="[object Object]"&&(n="[object Object]"),n=String(n),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(h=0,d=s.length;h<d;h+=1)im(e,t,s[h],r);else im(e,t,s,r);else!e.json&&!Hs.call(r,n)&&Hs.call(t,n)&&(e.line=a||e.line,e.lineStart=l||e.lineStart,e.position=u||e.position,Oe(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[n]=s,delete r[n];return t}T(ko,"storeMappingPair");function qd(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Oe(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}T(qd,"readLineBreak");function Ut(e,t,r){for(var i=0,n=e.input.charCodeAt(e.position);n!==0;){for(;zs(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(t&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(an(n))for(qd(e),n=e.input.charCodeAt(e.position),i++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&wc(e,"deficient indentation"),i}T(Ut,"skipSeparationSpace");function Fc(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Yr(r)))}T(Fc,"testDocumentSeparator");function Ud(e,t){t===1?e.result+=" ":t>1&&(e.result+=or.repeat(`
|
|
189
|
+
`,t-1))}T(Ud,"writeFoldedLines");function $C(e,t,r){var i,n,s,a,l,u,h,d,p=e.kind,m=e.result,y;if(y=e.input.charCodeAt(e.position),Yr(y)||Co(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(n=e.input.charCodeAt(e.position+1),Yr(n)||r&&Co(n)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,l=!1;y!==0;){if(y===58){if(n=e.input.charCodeAt(e.position+1),Yr(n)||r&&Co(n))break}else if(y===35){if(i=e.input.charCodeAt(e.position-1),Yr(i))break}else{if(e.position===e.lineStart&&Fc(e)||r&&Co(y))break;if(an(y))if(u=e.line,h=e.lineStart,d=e.lineIndent,Ut(e,!1,-1),e.lineIndent>=t){l=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=u,e.lineStart=h,e.lineIndent=d;break}}l&&(es(e,s,a,!1),Ud(e,e.line-u),s=a=e.position,l=!1),zs(y)||(a=e.position+1),y=e.input.charCodeAt(++e.position)}return es(e,s,a,!1),e.result?!0:(e.kind=p,e.result=m,!1)}T($C,"readPlainScalar");function jC(e,t){var r,i,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=n=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(es(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,n=e.position;else return!0;else an(r)?(es(e,i,n,!0),Ud(e,Ut(e,!1,t)),i=n=e.position):e.position===e.lineStart&&Fc(e)?Oe(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);Oe(e,"unexpected end of the stream within a single quoted scalar")}T(jC,"readSingleQuotedScalar");function OC(e,t){var r,i,n,s,a,l;if(l=e.input.charCodeAt(e.position),l!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(l=e.input.charCodeAt(e.position))!==0;){if(l===34)return es(e,r,e.position,!0),e.position++,!0;if(l===92){if(es(e,r,e.position,!0),l=e.input.charCodeAt(++e.position),an(l))Ut(e,!1,t);else if(l<256&&DC[l])e.result+=PC[l],e.position++;else if((a=LC(l))>0){for(n=a,s=0;n>0;n--)l=e.input.charCodeAt(++e.position),(a=MC(l))>=0?s=(s<<4)+a:Oe(e,"expected hexadecimal character");e.result+=AC(s),e.position++}else Oe(e,"unknown escape sequence");r=i=e.position}else an(l)?(es(e,r,i,!0),Ud(e,Ut(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Fc(e)?Oe(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Oe(e,"unexpected end of the stream within a double quoted scalar")}T(OC,"readDoubleQuotedScalar");function zC(e,t){var r=!0,i,n,s,a=e.tag,l,u=e.anchor,h,d,p,m,y,x=Object.create(null),v,S,C,B;if(B=e.input.charCodeAt(e.position),B===91)d=93,y=!1,l=[];else if(B===123)d=125,y=!0,l={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),B=e.input.charCodeAt(++e.position);B!==0;){if(Ut(e,!0,t),B=e.input.charCodeAt(e.position),B===d)return e.position++,e.tag=a,e.anchor=u,e.kind=y?"mapping":"sequence",e.result=l,!0;r?B===44&&Oe(e,"expected the node content, but found ','"):Oe(e,"missed comma between flow collection entries"),S=v=C=null,p=m=!1,B===63&&(h=e.input.charCodeAt(e.position+1),Yr(h)&&(p=m=!0,e.position++,Ut(e,!0,t))),i=e.line,n=e.lineStart,s=e.position,Io(e,t,cd,!1,!0),S=e.tag,v=e.result,Ut(e,!0,t),B=e.input.charCodeAt(e.position),(m||e.line===i)&&B===58&&(p=!0,B=e.input.charCodeAt(++e.position),Ut(e,!0,t),Io(e,t,cd,!1,!0),C=e.result),y?ko(e,l,x,S,v,C,i,n,s):p?l.push(ko(e,null,x,S,v,C,i,n,s)):l.push(v),Ut(e,!0,t),B=e.input.charCodeAt(e.position),B===44?(r=!0,B=e.input.charCodeAt(++e.position)):r=!1}Oe(e,"unexpected end of the stream within a flow collection")}T(zC,"readFlowCollection");function FC(e,t){var r,i,n=og,s=!1,a=!1,l=t,u=0,h=!1,d,p;if(p=e.input.charCodeAt(e.position),p===124)i=!1;else if(p===62)i=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)og===n?n=p===43?s1:z4:Oe(e,"repeat of a chomping mode identifier");else if((d=RC(p))>=0)d===0?Oe(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Oe(e,"repeat of an indentation width identifier"):(l=t+d-1,a=!0);else break;if(zs(p)){do p=e.input.charCodeAt(++e.position);while(zs(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!an(p)&&p!==0)}for(;p!==0;){for(qd(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<l)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>l&&(l=e.lineIndent),an(p)){u++;continue}if(e.lineIndent<l){n===s1?e.result+=or.repeat(`
|
|
190
|
+
`,s?1+u:u):n===og&&s&&(e.result+=`
|
|
191
|
+
`);break}for(i?zs(p)?(h=!0,e.result+=or.repeat(`
|
|
192
|
+
`,s?1+u:u)):h?(h=!1,e.result+=or.repeat(`
|
|
193
|
+
`,u+1)):u===0?s&&(e.result+=" "):e.result+=or.repeat(`
|
|
194
|
+
`,u):e.result+=or.repeat(`
|
|
195
|
+
`,s?1+u:u),s=!0,a=!0,u=0,r=e.position;!an(p)&&p!==0;)p=e.input.charCodeAt(++e.position);es(e,r,e.position,!1)}return!0}T(FC,"readBlockScalar");function nm(e,t){var r,i=e.tag,n=e.anchor,s=[],a,l=!1,u;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),u=e.input.charCodeAt(e.position);u!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Oe(e,"tab characters must not be used in indentation")),!(u!==45||(a=e.input.charCodeAt(e.position+1),!Yr(a))));){if(l=!0,e.position++,Ut(e,!0,-1)&&e.lineIndent<=t){s.push(null),u=e.input.charCodeAt(e.position);continue}if(r=e.line,Io(e,t,TC,!1,!0),s.push(e.result),Ut(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&u!==0)Oe(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return l?(e.tag=i,e.anchor=n,e.kind="sequence",e.result=s,!0):!1}T(nm,"readBlockSequence");function NC(e,t,r){var i,n,s,a,l,u,h=e.tag,d=e.anchor,p={},m=Object.create(null),y=null,x=null,v=null,S=!1,C=!1,B;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),B=e.input.charCodeAt(e.position);B!==0;){if(!S&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Oe(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(B===63||B===58)&&Yr(i))B===63?(S&&(ko(e,p,m,y,x,null,a,l,u),y=x=v=null),C=!0,S=!0,n=!0):S?(S=!1,n=!0):Oe(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,B=i;else{if(a=e.line,l=e.lineStart,u=e.position,!Io(e,r,kC,!1,!0))break;if(e.line===s){for(B=e.input.charCodeAt(e.position);zs(B);)B=e.input.charCodeAt(++e.position);if(B===58)B=e.input.charCodeAt(++e.position),Yr(B)||Oe(e,"a whitespace character is expected after the key-value separator within a block mapping"),S&&(ko(e,p,m,y,x,null,a,l,u),y=x=v=null),C=!0,S=!1,n=!1,y=e.tag,x=e.result;else if(C)Oe(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=h,e.anchor=d,!0}else if(C)Oe(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=h,e.anchor=d,!0}if((e.line===s||e.lineIndent>t)&&(S&&(a=e.line,l=e.lineStart,u=e.position),Io(e,t,hd,!0,n)&&(S?x=e.result:v=e.result),S||(ko(e,p,m,y,x,v,a,l,u),y=x=v=null),Ut(e,!0,-1),B=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&B!==0)Oe(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return S&&ko(e,p,m,y,x,null,a,l,u),C&&(e.tag=h,e.anchor=d,e.kind="mapping",e.result=p),C}T(NC,"readBlockMapping");function WC(e){var t,r=!1,i=!1,n,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&Oe(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):Oe(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Yr(a);)a===33&&(i?Oe(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),EC.test(n)||Oe(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),W4.test(s)&&Oe(e,"tag suffix cannot contain flow indicator characters")}s&&!BC.test(s)&&Oe(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{Oe(e,"tag name is malformed: "+s)}return r?e.tag=s:Hs.call(e.tagMap,n)?e.tag=e.tagMap[n]+s:n==="!"?e.tag="!"+s:n==="!!"?e.tag="tag:yaml.org,2002:"+s:Oe(e,'undeclared tag handle "'+n+'"'),!0}T(WC,"readTagProperty");function HC(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Oe(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Yr(r)&&!Co(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Oe(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}T(HC,"readAnchorProperty");function qC(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Yr(i)&&!Co(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Oe(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Hs.call(e.anchorMap,r)||Oe(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Ut(e,!0,-1),!0}T(qC,"readAlias");function Io(e,t,r,i,n){var s,a,l,u=1,h=!1,d=!1,p,m,y,x,v,S;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=l=hd===r||TC===r,i&&Ut(e,!0,-1)&&(h=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;WC(e)||HC(e);)Ut(e,!0,-1)?(h=!0,l=s,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):l=!1;if(l&&(l=h||n),(u===1||hd===r)&&(cd===r||kC===r?v=t:v=t+1,S=e.position-e.lineStart,u===1?l&&(nm(e,S)||NC(e,S,v))||zC(e,v)?d=!0:(a&&FC(e,v)||jC(e,v)||OC(e,v)?d=!0:qC(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&Oe(e,"alias node should not have any properties")):$C(e,v,cd===r)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(d=l&&nm(e,S))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Oe(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,m=e.implicitTypes.length;p<m;p+=1)if(x=e.implicitTypes[p],x.resolve(e.result)){e.result=x.construct(e.result),e.tag=x.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Hs.call(e.typeMap[e.kind||"fallback"],e.tag))x=e.typeMap[e.kind||"fallback"][e.tag];else for(x=null,y=e.typeMap.multi[e.kind||"fallback"],p=0,m=y.length;p<m;p+=1)if(e.tag.slice(0,y[p].tag.length)===y[p].tag){x=y[p];break}x||Oe(e,"unknown tag !<"+e.tag+">"),e.result!==null&&x.kind!==e.kind&&Oe(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+x.kind+'", not "'+e.kind+'"'),x.resolve(e.result,e.tag)?(e.result=x.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Oe(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}T(Io,"composeNode");function UC(e){var t=e.position,r,i,n,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Ut(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Yr(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),n=[],i.length<1&&Oe(e,"directive name must not be less than one character in length");a!==0;){for(;zs(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!an(a));break}if(an(a))break;for(r=e.position;a!==0&&!Yr(a);)a=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}a!==0&&qd(e),Hs.call(o1,i)?o1[i](e,i,n):wc(e,'unknown document directive "'+i+'"')}if(Ut(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Ut(e,!0,-1)):s&&Oe(e,"directives end mark is expected"),Io(e,e.lineIndent-1,hd,!1,!0),Ut(e,!0,-1),e.checkLineBreaks&&N4.test(e.input.slice(t,e.position))&&wc(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Fc(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Ut(e,!0,-1));return}if(e.position<e.length-1)Oe(e,"end of the stream or a document separator is expected");else return}T(UC,"readDocument");function Jy(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
196
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new IC(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,Oe(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)UC(r);return r.documents}T(Jy,"loadDocuments");function H4(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=Jy(e,r);if(typeof t!="function")return i;for(var n=0,s=i.length;n<s;n+=1)t(i[n])}T(H4,"loadAll$1");function VC(e,t){var r=Jy(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new hi("expected a single document in the stream, but found more")}}T(VC,"load$1");var q4=VC,U4={load:q4},GC=Object.prototype.toString,YC=Object.prototype.hasOwnProperty,e0=65279,V4=9,Cc=10,G4=13,Y4=32,K4=33,X4=34,sm=35,Q4=37,Z4=38,J4=39,eI=42,KC=44,tI=45,ud=58,rI=61,iI=62,nI=63,sI=64,XC=91,QC=93,oI=96,ZC=123,aI=124,JC=125,Or={};Or[0]="\\0";Or[7]="\\a";Or[8]="\\b";Or[9]="\\t";Or[10]="\\n";Or[11]="\\v";Or[12]="\\f";Or[13]="\\r";Or[27]="\\e";Or[34]='\\"';Or[92]="\\\\";Or[133]="\\N";Or[160]="\\_";Or[8232]="\\L";Or[8233]="\\P";var lI=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],cI=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ek(e,t){var r,i,n,s,a,l,u;if(t===null)return{};for(r={},i=Object.keys(t),n=0,s=i.length;n<s;n+=1)a=i[n],l=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),u=e.compiledTypeMap.fallback[a],u&&YC.call(u.styleAliases,l)&&(l=u.styleAliases[l]),r[a]=l;return r}T(ek,"compileStyleMap");function tk(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new hi("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+or.repeat("0",i-t.length)+t}T(tk,"encodeHex");var hI=1,kc=2;function rk(e){this.schema=e.schema||CC,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=or.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ek(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?kc:hI,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}T(rk,"State");function om(e,t){for(var r=or.repeat(" ",t),i=0,n=-1,s="",a,l=e.length;i<l;)n=e.indexOf(`
|
|
197
|
+
`,i),n===-1?(a=e.slice(i),i=l):(a=e.slice(i,n+1),i=n+1),a.length&&a!==`
|
|
198
|
+
`&&(s+=r),s+=a;return s}T(om,"indentString");function dd(e,t){return`
|
|
199
|
+
`+or.repeat(" ",e.indent*t)}T(dd,"generateNextLine");function ik(e,t){var r,i,n;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}T(ik,"testImplicitResolving");function Tc(e){return e===Y4||e===V4}T(Tc,"isWhitespace");function za(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==e0||65536<=e&&e<=1114111}T(za,"isPrintable");function am(e){return za(e)&&e!==e0&&e!==G4&&e!==Cc}T(am,"isNsCharOrWhitespace");function lm(e,t,r){var i=am(e),n=i&&!Tc(e);return(r?i:i&&e!==KC&&e!==XC&&e!==QC&&e!==ZC&&e!==JC)&&e!==sm&&!(t===ud&&!n)||am(t)&&!Tc(t)&&e===sm||t===ud&&n}T(lm,"isPlainSafe");function nk(e){return za(e)&&e!==e0&&!Tc(e)&&e!==tI&&e!==nI&&e!==ud&&e!==KC&&e!==XC&&e!==QC&&e!==ZC&&e!==JC&&e!==sm&&e!==Z4&&e!==eI&&e!==K4&&e!==aI&&e!==rI&&e!==iI&&e!==J4&&e!==X4&&e!==Q4&&e!==sI&&e!==oI}T(nk,"isPlainSafeFirst");function sk(e){return!Tc(e)&&e!==ud}T(sk,"isPlainSafeLast");function ba(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}T(ba,"codePointAt");function t0(e){var t=/^\n* /;return t.test(e)}T(t0,"needIndentIndicator");var ok=1,cm=2,ak=3,lk=4,xa=5;function ck(e,t,r,i,n,s,a,l){var u,h=0,d=null,p=!1,m=!1,y=i!==-1,x=-1,v=nk(ba(e,0))&&sk(ba(e,e.length-1));if(t||a)for(u=0;u<e.length;h>=65536?u+=2:u++){if(h=ba(e,u),!za(h))return xa;v=v&&lm(h,d,l),d=h}else{for(u=0;u<e.length;h>=65536?u+=2:u++){if(h=ba(e,u),h===Cc)p=!0,y&&(m=m||u-x-1>i&&e[x+1]!==" ",x=u);else if(!za(h))return xa;v=v&&lm(h,d,l),d=h}m=m||y&&u-x-1>i&&e[x+1]!==" "}return!p&&!m?v&&!a&&!n(e)?ok:s===kc?xa:cm:r>9&&t0(e)?xa:a?s===kc?xa:cm:m?lk:ak}T(ck,"chooseScalarStyle");function hk(e,t,r,i,n){e.dump=(function(){if(t.length===0)return e.quotingType===kc?'""':"''";if(!e.noCompatMode&&(lI.indexOf(t)!==-1||cI.test(t)))return e.quotingType===kc?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),l=i||e.flowLevel>-1&&r>=e.flowLevel;function u(h){return ik(e,h)}switch(T(u,"testAmbiguity"),ck(t,l,e.indent,a,u,e.quotingType,e.forceQuotes&&!i,n)){case ok:return t;case cm:return"'"+t.replace(/'/g,"''")+"'";case ak:return"|"+hm(t,e.indent)+um(om(t,s));case lk:return">"+hm(t,e.indent)+um(om(uk(t,a),s));case xa:return'"'+dk(t)+'"';default:throw new hi("impossible error: invalid scalar style")}})()}T(hk,"writeScalar");function hm(e,t){var r=t0(e)?String(t):"",i=e[e.length-1]===`
|
|
200
|
+
`,n=i&&(e[e.length-2]===`
|
|
201
|
+
`||e===`
|
|
202
|
+
`),s=n?"+":i?"":"-";return r+s+`
|
|
203
|
+
`}T(hm,"blockHeader");function um(e){return e[e.length-1]===`
|
|
204
|
+
`?e.slice(0,-1):e}T(um,"dropEndingNewline");function uk(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var h=e.indexOf(`
|
|
205
|
+
`);return h=h!==-1?h:e.length,r.lastIndex=h,dm(e.slice(0,h),t)})(),n=e[0]===`
|
|
206
|
+
`||e[0]===" ",s,a;a=r.exec(e);){var l=a[1],u=a[2];s=u[0]===" ",i+=l+(!n&&!s&&u!==""?`
|
|
207
|
+
`:"")+dm(u,t),n=s}return i}T(uk,"foldString");function dm(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,n=0,s,a=0,l=0,u="";i=r.exec(e);)l=i.index,l-n>t&&(s=a>n?a:l,u+=`
|
|
208
|
+
`+e.slice(n,s),n=s+1),a=l;return u+=`
|
|
209
|
+
`,e.length-n>t&&a>n?u+=e.slice(n,a)+`
|
|
210
|
+
`+e.slice(a+1):u+=e.slice(n),u.slice(1)}T(dm,"foldLine");function dk(e){for(var t="",r=0,i,n=0;n<e.length;r>=65536?n+=2:n++)r=ba(e,n),i=Or[r],!i&&za(r)?(t+=e[n],r>=65536&&(t+=e[n+1])):t+=i||tk(r);return t}T(dk,"escapeString");function fk(e,t,r){var i="",n=e.tag,s,a,l;for(s=0,a=r.length;s<a;s+=1)l=r[s],e.replacer&&(l=e.replacer.call(r,String(s),l)),(Rn(e,t,l,!1,!1)||typeof l>"u"&&Rn(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=n,e.dump="["+i+"]"}T(fk,"writeFlowSequence");function fm(e,t,r,i){var n="",s=e.tag,a,l,u;for(a=0,l=r.length;a<l;a+=1)u=r[a],e.replacer&&(u=e.replacer.call(r,String(a),u)),(Rn(e,t+1,u,!0,!0,!1,!0)||typeof u>"u"&&Rn(e,t+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=dd(e,t)),e.dump&&Cc===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=s,e.dump=n||"[]"}T(fm,"writeBlockSequence");function pk(e,t,r){var i="",n=e.tag,s=Object.keys(r),a,l,u,h,d;for(a=0,l=s.length;a<l;a+=1)d="",i!==""&&(d+=", "),e.condenseFlow&&(d+='"'),u=s[a],h=r[u],e.replacer&&(h=e.replacer.call(r,u,h)),Rn(e,t,u,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Rn(e,t,h,!1,!1)&&(d+=e.dump,i+=d));e.tag=n,e.dump="{"+i+"}"}T(pk,"writeFlowMapping");function gk(e,t,r,i){var n="",s=e.tag,a=Object.keys(r),l,u,h,d,p,m;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new hi("sortKeys must be a boolean or a function");for(l=0,u=a.length;l<u;l+=1)m="",(!i||n!=="")&&(m+=dd(e,t)),h=a[l],d=r[h],e.replacer&&(d=e.replacer.call(r,h,d)),Rn(e,t+1,h,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Cc===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,p&&(m+=dd(e,t)),Rn(e,t+1,d,!0,p)&&(e.dump&&Cc===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,n+=m));e.tag=s,e.dump=n||"{}"}T(gk,"writeBlockMapping");function pm(e,t,r){var i,n,s,a,l,u;for(n=r?e.explicitTypes:e.implicitTypes,s=0,a=n.length;s<a;s+=1)if(l=n[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof t=="object"&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(r?l.multi&&l.representName?e.tag=l.representName(t):e.tag=l.tag:e.tag="?",l.represent){if(u=e.styleMap[l.tag]||l.defaultStyle,GC.call(l.represent)==="[object Function]")i=l.represent(t,u);else if(YC.call(l.represent,u))i=l.represent[u](t,u);else throw new hi("!<"+l.tag+'> tag resolver accepts not "'+u+'" style');e.dump=i}return!0}return!1}T(pm,"detectType");function Rn(e,t,r,i,n,s,a){e.tag=null,e.dump=r,pm(e,r,!1)||pm(e,r,!0);var l=GC.call(e.dump),u=i,h;i&&(i=e.flowLevel<0||e.flowLevel>t);var d=l==="[object Object]"||l==="[object Array]",p,m;if(d&&(p=e.duplicates.indexOf(r),m=p!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&t>0)&&(n=!1),m&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(d&&m&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),l==="[object Object]")i&&Object.keys(e.dump).length!==0?(gk(e,t,e.dump,n),m&&(e.dump="&ref_"+p+e.dump)):(pk(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(l==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?fm(e,t-1,e.dump,n):fm(e,t,e.dump,n),m&&(e.dump="&ref_"+p+e.dump)):(fk(e,t,e.dump),m&&(e.dump="&ref_"+p+" "+e.dump));else if(l==="[object String]")e.tag!=="?"&&hk(e,e.dump,t,s,u);else{if(l==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new hi("unacceptable kind of an object to dump "+l)}e.tag!==null&&e.tag!=="?"&&(h=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",e.dump=h+" "+e.dump)}return!0}T(Rn,"writeNode");function mk(e,t){var r=[],i=[],n,s;for(fd(e,r,i),n=0,s=i.length;n<s;n+=1)t.duplicates.push(r[i[n]]);t.usedDuplicates=new Array(s)}T(mk,"getDuplicateReferences");function fd(e,t,r){var i,n,s;if(e!==null&&typeof e=="object")if(n=t.indexOf(e),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(t.push(e),Array.isArray(e))for(n=0,s=e.length;n<s;n+=1)fd(e[n],t,r);else for(i=Object.keys(e),n=0,s=i.length;n<s;n+=1)fd(e[i[n]],t,r)}T(fd,"inspectNode");function uI(e,t){t=t||{};var r=new rk(t);r.noRefs||mk(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Rn(r,0,i,!0,!0)?r.dump+`
|
|
211
|
+
`:""}T(uI,"dump$1");function dI(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}T(dI,"renamed");var fI=aC,pI=U4.load;/*! Bundled license information:
|
|
212
|
+
|
|
213
|
+
js-yaml/dist/js-yaml.mjs:
|
|
214
|
+
(*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
|
|
215
|
+
*/var Pr={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},a1={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function ic(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Rt(e),t=Rt(t);const[r,i]=[e.x,e.y],[n,s]=[t.x,t.y],a=n-r,l=s-i;return{angle:Math.atan(l/a),deltaX:a,deltaY:l}}T(ic,"calculateDeltaAndAngle");var Rt=T(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),gI=T(e=>({x:T(function(t,r,i){let n=0;const s=Rt(i[0]).x<Rt(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Pr,e.arrowTypeStart)){const{angle:y,deltaX:x}=ic(i[0],i[1]);n=Pr[e.arrowTypeStart]*Math.cos(y)*(x>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Pr,e.arrowTypeEnd)){const{angle:y,deltaX:x}=ic(i[i.length-1],i[i.length-2]);n=Pr[e.arrowTypeEnd]*Math.cos(y)*(x>=0?1:-1)}const a=Math.abs(Rt(t).x-Rt(i[i.length-1]).x),l=Math.abs(Rt(t).y-Rt(i[i.length-1]).y),u=Math.abs(Rt(t).x-Rt(i[0]).x),h=Math.abs(Rt(t).y-Rt(i[0]).y),d=Pr[e.arrowTypeStart],p=Pr[e.arrowTypeEnd],m=1;if(a<p&&a>0&&l<p){let y=p+m-a;y*=s==="right"?-1:1,n-=y}if(u<d&&u>0&&h<d){let y=d+m-u;y*=s==="right"?-1:1,n+=y}return Rt(t).x+n},"x"),y:T(function(t,r,i){let n=0;const s=Rt(i[0]).y<Rt(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Pr,e.arrowTypeStart)){const{angle:y,deltaY:x}=ic(i[0],i[1]);n=Pr[e.arrowTypeStart]*Math.abs(Math.sin(y))*(x>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Pr,e.arrowTypeEnd)){const{angle:y,deltaY:x}=ic(i[i.length-1],i[i.length-2]);n=Pr[e.arrowTypeEnd]*Math.abs(Math.sin(y))*(x>=0?1:-1)}const a=Math.abs(Rt(t).y-Rt(i[i.length-1]).y),l=Math.abs(Rt(t).x-Rt(i[i.length-1]).x),u=Math.abs(Rt(t).y-Rt(i[0]).y),h=Math.abs(Rt(t).x-Rt(i[0]).x),d=Pr[e.arrowTypeStart],p=Pr[e.arrowTypeEnd],m=1;if(a<p&&a>0&&l<p){let y=p+m-a;y*=s==="up"?-1:1,n-=y}if(u<d&&u>0&&h<d){let y=d+m-u;y*=s==="up"?-1:1,n+=y}return Rt(t).y+n},"y")}),"getLineFunctionsWithOffset"),r0=T(({flowchart:e})=>{var n,s;const t=((n=e==null?void 0:e.subGraphTitleMargin)==null?void 0:n.top)??0,r=((s=e==null?void 0:e.subGraphTitleMargin)==null?void 0:s.bottom)??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),mI=T(e=>{const{handDrawnSeed:t}=ft();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),qa=T(e=>{const t=yI([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),yI=T(e=>{const t=new Map;return e.forEach(r=>{const[i,n]=r.split(":");t.set(i.trim(),n==null?void 0:n.trim())}),t},"styles2Map"),yk=T(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),Pe=T(e=>{const{stylesArray:t}=qa(e),r=[],i=[],n=[],s=[];return t.forEach(a=>{const l=a[0];yk(l)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),l.includes("stroke")&&n.push(a.join(":")+" !important"),l==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:n,backgroundStyles:s}},"styles2String"),De=T((e,t)=>{var u;const{themeVariables:r,handDrawnSeed:i}=ft(),{nodeBorder:n,mainBkg:s}=r,{stylesMap:a}=qa(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||n,seed:i,strokeWidth:((u=a.get("stroke-width"))==null?void 0:u.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:_I(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),_I=T(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const n=isNaN(t[0])?0:t[0];return[n,n]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),su={},rr={},l1;function xI(){return l1||(l1=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.BLANK_URL=rr.relativeFirstCharacters=rr.whitespaceEscapeCharsRegex=rr.urlSchemeRegex=rr.ctrlCharactersRegex=rr.htmlCtrlEntityRegex=rr.htmlEntitiesRegex=rr.invalidProtocolRegex=void 0,rr.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,rr.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,rr.htmlCtrlEntityRegex=/&(newline|tab);/gi,rr.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,rr.urlSchemeRegex=/^.+(:|:)/gim,rr.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,rr.relativeFirstCharacters=[".","/"],rr.BLANK_URL="about:blank"),rr}var c1;function vI(){if(c1)return su;c1=1,Object.defineProperty(su,"__esModule",{value:!0}),su.sanitizeUrl=s;var e=xI();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var l=a.replace(e.ctrlCharactersRegex,"");return l.replace(e.htmlEntitiesRegex,function(u,h){return String.fromCharCode(h)})}function i(a){return URL.canParse(a)}function n(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var l,u=n(a.trim());do u=r(u).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),u=n(u),l=u.match(e.ctrlCharactersRegex)||u.match(e.htmlEntitiesRegex)||u.match(e.htmlCtrlEntityRegex)||u.match(e.whitespaceEscapeCharsRegex);while(l&&l.length>0);var h=u;if(!h)return e.BLANK_URL;if(t(h))return h;var d=h.trimStart(),p=d.match(e.urlSchemeRegex);if(!p)return h;var m=p[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(m))return e.BLANK_URL;var y=d.replace(/\\/g,"/");if(m==="mailto:"||m.includes("://"))return y;if(m==="http:"||m==="https:"){if(!i(y))return e.BLANK_URL;var x=new URL(y);return x.protocol=x.protocol.toLowerCase(),x.hostname=x.hostname.toLowerCase(),x.toString()}return y}return su}var bI=vI(),_k=typeof global=="object"&&global&&global.Object===Object&&global,SI=typeof self=="object"&&self&&self.Object===Object&&self,Pn=_k||SI||Function("return this")(),pd=Pn.Symbol,xk=Object.prototype,wI=xk.hasOwnProperty,CI=xk.toString,Nl=pd?pd.toStringTag:void 0;function kI(e){var t=wI.call(e,Nl),r=e[Nl];try{e[Nl]=void 0;var i=!0}catch{}var n=CI.call(e);return i&&(t?e[Nl]=r:delete e[Nl]),n}var TI=Object.prototype,EI=TI.toString;function BI(e){return EI.call(e)}var MI="[object Null]",LI="[object Undefined]",h1=pd?pd.toStringTag:void 0;function Ua(e){return e==null?e===void 0?LI:MI:h1&&h1 in Object(e)?kI(e):BI(e)}function No(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var RI="[object AsyncFunction]",AI="[object Function]",DI="[object GeneratorFunction]",PI="[object Proxy]";function i0(e){if(!No(e))return!1;var t=Ua(e);return t==AI||t==DI||t==RI||t==PI}var ag=Pn["__core-js_shared__"],u1=(function(){var e=/[^.]+$/.exec(ag&&ag.keys&&ag.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function II(e){return!!u1&&u1 in e}var $I=Function.prototype,jI=$I.toString;function Wo(e){if(e!=null){try{return jI.call(e)}catch{}try{return e+""}catch{}}return""}var OI=/[\\^$.*+?()[\]{}|]/g,zI=/^\[object .+?Constructor\]$/,FI=Function.prototype,NI=Object.prototype,WI=FI.toString,HI=NI.hasOwnProperty,qI=RegExp("^"+WI.call(HI).replace(OI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function UI(e){if(!No(e)||II(e))return!1;var t=i0(e)?qI:zI;return t.test(Wo(e))}function VI(e,t){return e==null?void 0:e[t]}function Ho(e,t){var r=VI(e,t);return UI(r)?r:void 0}var Ec=Ho(Object,"create");function GI(){this.__data__=Ec?Ec(null):{},this.size=0}function YI(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var KI="__lodash_hash_undefined__",XI=Object.prototype,QI=XI.hasOwnProperty;function ZI(e){var t=this.__data__;if(Ec){var r=t[e];return r===KI?void 0:r}return QI.call(t,e)?t[e]:void 0}var JI=Object.prototype,e6=JI.hasOwnProperty;function t6(e){var t=this.__data__;return Ec?t[e]!==void 0:e6.call(t,e)}var r6="__lodash_hash_undefined__";function i6(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ec&&t===void 0?r6:t,this}function $o(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}$o.prototype.clear=GI;$o.prototype.delete=YI;$o.prototype.get=ZI;$o.prototype.has=t6;$o.prototype.set=i6;function n6(){this.__data__=[],this.size=0}function Vd(e,t){return e===t||e!==e&&t!==t}function Gd(e,t){for(var r=e.length;r--;)if(Vd(e[r][0],t))return r;return-1}var s6=Array.prototype,o6=s6.splice;function a6(e){var t=this.__data__,r=Gd(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():o6.call(t,r,1),--this.size,!0}function l6(e){var t=this.__data__,r=Gd(t,e);return r<0?void 0:t[r][1]}function c6(e){return Gd(this.__data__,e)>-1}function h6(e,t){var r=this.__data__,i=Gd(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function is(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}is.prototype.clear=n6;is.prototype.delete=a6;is.prototype.get=l6;is.prototype.has=c6;is.prototype.set=h6;var Bc=Ho(Pn,"Map");function u6(){this.size=0,this.__data__={hash:new $o,map:new(Bc||is),string:new $o}}function d6(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Yd(e,t){var r=e.__data__;return d6(t)?r[typeof t=="string"?"string":"hash"]:r.map}function f6(e){var t=Yd(this,e).delete(e);return this.size-=t?1:0,t}function p6(e){return Yd(this,e).get(e)}function g6(e){return Yd(this,e).has(e)}function m6(e,t){var r=Yd(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}function Vs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Vs.prototype.clear=u6;Vs.prototype.delete=f6;Vs.prototype.get=p6;Vs.prototype.has=g6;Vs.prototype.set=m6;var y6="Expected a function";function Nc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(y6);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var a=e.apply(this,i);return r.cache=s.set(n,a)||s,a};return r.cache=new(Nc.Cache||Vs),r}Nc.Cache=Vs;function _6(){this.__data__=new is,this.size=0}function x6(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function v6(e){return this.__data__.get(e)}function b6(e){return this.__data__.has(e)}var S6=200;function w6(e,t){var r=this.__data__;if(r instanceof is){var i=r.__data__;if(!Bc||i.length<S6-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Vs(i)}return r.set(e,t),this.size=r.size,this}function Va(e){var t=this.__data__=new is(e);this.size=t.size}Va.prototype.clear=_6;Va.prototype.delete=x6;Va.prototype.get=v6;Va.prototype.has=b6;Va.prototype.set=w6;var gd=(function(){try{var e=Ho(Object,"defineProperty");return e({},"",{}),e}catch{}})();function n0(e,t,r){t=="__proto__"&&gd?gd(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function gm(e,t,r){(r!==void 0&&!Vd(e[t],r)||r===void 0&&!(t in e))&&n0(e,t,r)}function C6(e){return function(t,r,i){for(var n=-1,s=Object(t),a=i(t),l=a.length;l--;){var u=a[++n];if(r(s[u],u,s)===!1)break}return t}}var k6=C6(),vk=typeof exports=="object"&&exports&&!exports.nodeType&&exports,d1=vk&&typeof module=="object"&&module&&!module.nodeType&&module,T6=d1&&d1.exports===vk,f1=T6?Pn.Buffer:void 0,p1=f1?f1.allocUnsafe:void 0;function E6(e,t){if(t)return e.slice();var r=e.length,i=p1?p1(r):new e.constructor(r);return e.copy(i),i}var g1=Pn.Uint8Array;function B6(e){var t=new e.constructor(e.byteLength);return new g1(t).set(new g1(e)),t}function M6(e,t){var r=t?B6(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function L6(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}var m1=Object.create,R6=(function(){function e(){}return function(t){if(!No(t))return{};if(m1)return m1(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();function bk(e,t){return function(r){return e(t(r))}}var Sk=bk(Object.getPrototypeOf,Object),A6=Object.prototype;function Kd(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||A6;return e===r}function D6(e){return typeof e.constructor=="function"&&!Kd(e)?R6(Sk(e)):{}}function Wc(e){return e!=null&&typeof e=="object"}var P6="[object Arguments]";function y1(e){return Wc(e)&&Ua(e)==P6}var wk=Object.prototype,I6=wk.hasOwnProperty,$6=wk.propertyIsEnumerable,md=y1((function(){return arguments})())?y1:function(e){return Wc(e)&&I6.call(e,"callee")&&!$6.call(e,"callee")},yd=Array.isArray,j6=9007199254740991;function Ck(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=j6}function Xd(e){return e!=null&&Ck(e.length)&&!i0(e)}function O6(e){return Wc(e)&&Xd(e)}function z6(){return!1}var kk=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_1=kk&&typeof module=="object"&&module&&!module.nodeType&&module,F6=_1&&_1.exports===kk,x1=F6?Pn.Buffer:void 0,N6=x1?x1.isBuffer:void 0,s0=N6||z6,W6="[object Object]",H6=Function.prototype,q6=Object.prototype,Tk=H6.toString,U6=q6.hasOwnProperty,V6=Tk.call(Object);function G6(e){if(!Wc(e)||Ua(e)!=W6)return!1;var t=Sk(e);if(t===null)return!0;var r=U6.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Tk.call(r)==V6}var Y6="[object Arguments]",K6="[object Array]",X6="[object Boolean]",Q6="[object Date]",Z6="[object Error]",J6="[object Function]",e$="[object Map]",t$="[object Number]",r$="[object Object]",i$="[object RegExp]",n$="[object Set]",s$="[object String]",o$="[object WeakMap]",a$="[object ArrayBuffer]",l$="[object DataView]",c$="[object Float32Array]",h$="[object Float64Array]",u$="[object Int8Array]",d$="[object Int16Array]",f$="[object Int32Array]",p$="[object Uint8Array]",g$="[object Uint8ClampedArray]",m$="[object Uint16Array]",y$="[object Uint32Array]",Et={};Et[c$]=Et[h$]=Et[u$]=Et[d$]=Et[f$]=Et[p$]=Et[g$]=Et[m$]=Et[y$]=!0;Et[Y6]=Et[K6]=Et[a$]=Et[X6]=Et[l$]=Et[Q6]=Et[Z6]=Et[J6]=Et[e$]=Et[t$]=Et[r$]=Et[i$]=Et[n$]=Et[s$]=Et[o$]=!1;function _$(e){return Wc(e)&&Ck(e.length)&&!!Et[Ua(e)]}function x$(e){return function(t){return e(t)}}var Ek=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yc=Ek&&typeof module=="object"&&module&&!module.nodeType&&module,v$=yc&&yc.exports===Ek,lg=v$&&_k.process,v1=(function(){try{var e=yc&&yc.require&&yc.require("util").types;return e||lg&&lg.binding&&lg.binding("util")}catch{}})(),b1=v1&&v1.isTypedArray,o0=b1?x$(b1):_$;function mm(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var b$=Object.prototype,S$=b$.hasOwnProperty;function w$(e,t,r){var i=e[t];(!(S$.call(e,t)&&Vd(i,r))||r===void 0&&!(t in e))&&n0(e,t,r)}function C$(e,t,r,i){var n=!r;r||(r={});for(var s=-1,a=t.length;++s<a;){var l=t[s],u=void 0;u===void 0&&(u=e[l]),n?n0(r,l,u):w$(r,l,u)}return r}function k$(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}var T$=9007199254740991,E$=/^(?:0|[1-9]\d*)$/;function Bk(e,t){var r=typeof e;return t=t??T$,!!t&&(r=="number"||r!="symbol"&&E$.test(e))&&e>-1&&e%1==0&&e<t}var B$=Object.prototype,M$=B$.hasOwnProperty;function L$(e,t){var r=yd(e),i=!r&&md(e),n=!r&&!i&&s0(e),s=!r&&!i&&!n&&o0(e),a=r||i||n||s,l=a?k$(e.length,String):[],u=l.length;for(var h in e)(t||M$.call(e,h))&&!(a&&(h=="length"||n&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Bk(h,u)))&&l.push(h);return l}function R$(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var A$=Object.prototype,D$=A$.hasOwnProperty;function P$(e){if(!No(e))return R$(e);var t=Kd(e),r=[];for(var i in e)i=="constructor"&&(t||!D$.call(e,i))||r.push(i);return r}function Mk(e){return Xd(e)?L$(e,!0):P$(e)}function I$(e){return C$(e,Mk(e))}function $$(e,t,r,i,n,s,a){var l=mm(e,r),u=mm(t,r),h=a.get(u);if(h){gm(e,r,h);return}var d=s?s(l,u,r+"",e,t,a):void 0,p=d===void 0;if(p){var m=yd(u),y=!m&&s0(u),x=!m&&!y&&o0(u);d=u,m||y||x?yd(l)?d=l:O6(l)?d=L6(l):y?(p=!1,d=E6(u,!0)):x?(p=!1,d=M6(u,!0)):d=[]:G6(u)||md(u)?(d=l,md(l)?d=I$(l):(!No(l)||i0(l))&&(d=D6(u))):p=!1}p&&(a.set(u,d),n(d,u,i,s,a),a.delete(u)),gm(e,r,d)}function Lk(e,t,r,i,n){e!==t&&k6(t,function(s,a){if(n||(n=new Va),No(s))$$(e,t,a,r,Lk,i,n);else{var l=i?i(mm(e,a),s,a+"",e,t,n):void 0;l===void 0&&(l=s),gm(e,a,l)}},Mk)}function Rk(e){return e}function j$(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var S1=Math.max;function O$(e,t,r){return t=S1(t===void 0?e.length-1:t,0),function(){for(var i=arguments,n=-1,s=S1(i.length-t,0),a=Array(s);++n<s;)a[n]=i[t+n];n=-1;for(var l=Array(t+1);++n<t;)l[n]=i[n];return l[t]=r(a),j$(e,this,l)}}function z$(e){return function(){return e}}var F$=gd?function(e,t){return gd(e,"toString",{configurable:!0,enumerable:!1,value:z$(t),writable:!0})}:Rk,N$=800,W$=16,H$=Date.now;function q$(e){var t=0,r=0;return function(){var i=H$(),n=W$-(i-r);if(r=i,n>0){if(++t>=N$)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var U$=q$(F$);function V$(e,t){return U$(O$(e,t,Rk),e+"")}function G$(e,t,r){if(!No(r))return!1;var i=typeof t;return(i=="number"?Xd(r)&&Bk(t,r.length):i=="string"&&t in r)?Vd(r[t],e):!1}function Y$(e){return V$(function(t,r){var i=-1,n=r.length,s=n>1?r[n-1]:void 0,a=n>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(n--,s):void 0,a&&G$(r[0],r[1],a)&&(s=n<3?void 0:s,n=1),t=Object(t);++i<n;){var l=r[i];l&&e(t,l,i,s)}return t})}var K$=Y$(function(e,t,r){Lk(e,t,r)}),X$="",Q$={curveBasis:Bu,curveBasisClosed:JP,curveBasisOpen:e4,curveBumpX:mw,curveBumpY:yw,curveBundle:t4,curveCardinalClosed:r4,curveCardinalOpen:i4,curveCardinal:bw,curveCatmullRomClosed:n4,curveCatmullRomOpen:s4,curveCatmullRom:ww,curveLinear:nd,curveLinearClosed:o4,curveMonotoneX:Mw,curveMonotoneY:Lw,curveNatural:Aw,curveStep:Dw,curveStepAfter:Iw,curveStepBefore:Pw},Z$=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,J$=T(function(e,t){const r=Ak(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(l=>l.args);Gu(a),i=sr(i,[...a])}else i=r.args;if(!i)return;let n=Ly(e,t);const s="config";return i[s]!==void 0&&(n==="flowchart-v2"&&(n="flowchart"),i[n]=i[s],delete i[s]),i},"detectInit"),Ak=T(function(e,t=null){var r,i;try{const n=new RegExp(`[%]{2}(?![{]${Z$.source})(?=[}][%]{2}).*
|
|
216
|
+
`,"ig");e=e.trim().replace(n,"").replace(/'/gm,'"'),ue.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let s;const a=[];for(;(s=gc.exec(e))!==null;)if(s.index===gc.lastIndex&&gc.lastIndex++,s&&!t||t&&((r=s[1])!=null&&r.match(t))||t&&((i=s[2])!=null&&i.match(t))){const l=s[1]?s[1]:s[2],u=s[3]?s[3].trim():s[4]?JSON.parse(s[4].trim()):null;a.push({type:l,args:u})}return a.length===0?{type:e,args:null}:a.length===1?a[0]:a}catch(n){return ue.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),ej=T(function(e){return e.replace(gc,"")},"removeDirectives"),tj=T(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function a0(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return Q$[r]??t}T(a0,"interpolateToCurve");function Dk(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?bI.sanitizeUrl(r):r}T(Dk,"formatUrl");var rj=T((e,...t)=>{const r=e.split("."),i=r.length-1,n=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){ue.error(`Function name: ${e} not found in window`);return}s[n](...t)},"runFunc");function l0(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}T(l0,"distance");function Pk(e){let t,r=0;e.forEach(n=>{r+=l0(n,t),t=n});const i=r/2;return c0(e,i)}T(Pk,"traverseEdge");function Ik(e){return e.length===1?e[0]:Pk(e)}T(Ik,"calcLabelPosition");var w1=T((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),c0=T((e,t)=>{let r,i=t;for(const n of e){if(r){const s=l0(n,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:n.x,y:n.y};if(a>0&&a<1)return{x:w1((1-a)*r.x+a*n.x,5),y:w1((1-a)*r.y+a*n.y,5)}}}r=n}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),ij=T((e,t,r)=>{ue.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const n=c0(t,25),s=e?10:5,a=Math.atan2(t[0].y-n.y,t[0].x-n.x),l={x:0,y:0};return l.x=Math.sin(a)*s+(t[0].x+n.x)/2,l.y=-Math.cos(a)*s+(t[0].y+n.y)/2,l},"calcCardinalityPosition");function $k(e,t,r){const i=structuredClone(r);ue.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const n=25+e,s=c0(i,n),a=10+e*.5,l=Math.atan2(i[0].y-s.y,i[0].x-s.x),u={x:0,y:0};return t==="start_left"?(u.x=Math.sin(l+Math.PI)*a+(i[0].x+s.x)/2,u.y=-Math.cos(l+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(u.x=Math.sin(l-Math.PI)*a+(i[0].x+s.x)/2-5,u.y=-Math.cos(l-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(u.x=Math.sin(l)*a+(i[0].x+s.x)/2-5,u.y=-Math.cos(l)*a+(i[0].y+s.y)/2-5):(u.x=Math.sin(l)*a+(i[0].x+s.x)/2,u.y=-Math.cos(l)*a+(i[0].y+s.y)/2),u}T($k,"calcTerminalLabelPosition");function jk(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}T(jk,"getStylesFromArray");var C1=0,nj=T(()=>(C1++,"id-"+Math.random().toString(36).substr(2,12)+"-"+C1),"generateId");function Ok(e){let t="";const r="0123456789abcdef",i=r.length;for(let n=0;n<e;n++)t+=r.charAt(Math.floor(Math.random()*i));return t}T(Ok,"makeRandomHex");var sj=T(e=>Ok(e.length),"random"),oj=T(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),aj=T(function(e,t){const r=t.text.replace(Ha.lineBreakRegex," "),[,i]=Qd(t.fontSize),n=e.append("text");n.attr("x",t.x),n.attr("y",t.y),n.style("text-anchor",t.anchor),n.style("font-family",t.fontFamily),n.style("font-size",i),n.style("font-weight",t.fontWeight),n.attr("fill",t.fill),t.class!==void 0&&n.attr("class",t.class);const s=n.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),n},"drawSimpleText"),lj=Nc((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Ha.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),n=[];let s="";return i.forEach((a,l)=>{const u=rs(`${a} `,r),h=rs(s,r);if(u>t){const{hyphenatedStrings:m,remainingWord:y}=cj(a,t,"-",r);n.push(s,...m),s=y}else h+u>=t?(n.push(s),s=a):s=[s,a].filter(Boolean).join(" ");l+1===i.length&&n.push(s)}),n.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),cj=Nc((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const n=[...e],s=[];let a="";return n.forEach((l,u)=>{const h=`${a}${l}`;if(rs(h,i)>=t){const p=u+1,m=n.length===p,y=`${h}${r}`;s.push(m?h:y),a=""}else a=h}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function zk(e,t){return h0(e,t).height}T(zk,"calculateTextHeight");function rs(e,t){return h0(e,t).width}T(rs,"calculateTextWidth");var h0=Nc((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:n=400}=t;if(!e)return{width:0,height:0};const[,s]=Qd(r),a=["sans-serif",i],l=e.split(Ha.lineBreakRegex),u=[],h=it("body");if(!h.remove)return{width:0,height:0,lineHeight:0};const d=h.append("svg");for(const m of a){let y=0;const x={width:0,height:0,lineHeight:0};for(const v of l){const S=oj();S.text=v||X$;const C=aj(d,S).style("font-size",s).style("font-weight",n).style("font-family",m),B=(C._groups||C)[0][0].getBBox();if(B.width===0&&B.height===0)throw new Error("svg element not in render tree");x.width=Math.round(Math.max(x.width,B.width)),y=Math.round(B.height),x.height+=y,x.lineHeight=Math.round(Math.max(x.lineHeight,y))}u.push(x)}d.remove();const p=isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1;return u[p]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),Da,hj=(Da=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},T(Da,"InitIDGenerator"),Da),ou,uj=T(function(e){return ou=ou||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),ou.innerHTML=e,unescape(ou.textContent)},"entityDecode");function u0(e){return"str"in e}T(u0,"isDetailedError");var dj=T((e,t,r,i)=>{var s;if(!i)return;const n=(s=e.node())==null?void 0:s.getBBox();n&&e.append("text").text(i).attr("text-anchor","middle").attr("x",n.x+n.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Qd=T(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function d0(e,t){return K$({},e,t)}T(d0,"cleanAndMerge");var on={assignWithDepth:sr,wrapLabel:lj,calculateTextHeight:zk,calculateTextWidth:rs,calculateTextDimensions:h0,cleanAndMerge:d0,detectInit:J$,detectDirective:Ak,isSubstringInArray:tj,interpolateToCurve:a0,calcLabelPosition:Ik,calcCardinalityPosition:ij,calcTerminalLabelPosition:$k,formatUrl:Dk,getStylesFromArray:jk,generateId:nj,random:sj,runFunc:rj,entityDecode:uj,insertTitle:dj,isLabelCoordinateInPath:Fk,parseFontSize:Qd,InitIDGenerator:hj},fj=T(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),qo=T(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),jU=T((e,t,{counter:r=0,prefix:i,suffix:n},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${n?`_${n}`:""}`,"getEdgeId");function jr(e){return e??null}T(jr,"handleUndefinedAttr");function Fk(e,t){const r=Math.round(e.x),i=Math.round(e.y),n=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return n.includes(r.toString())||n.includes(i.toString())}T(Fk,"isLabelCoordinateInPath");const pj=Object.freeze({left:0,top:0,width:16,height:16}),_d=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Nk=Object.freeze({...pj,..._d}),gj=Object.freeze({...Nk,body:"",hidden:!1}),mj=Object.freeze({width:null,height:null}),yj=Object.freeze({...mj,..._d}),_j=(e,t,r,i="")=>{const n=e.split(":");if(e.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;i=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const l=n.pop(),u=n.pop(),h={provider:n.length>0?n[0]:i,prefix:u,name:l};return cg(h)?h:null}const s=n[0],a=s.split("-");if(a.length>1){const l={provider:i,prefix:a.shift(),name:a.join("-")};return cg(l)?l:null}if(r&&i===""){const l={provider:i,prefix:"",name:s};return cg(l,r)?l:null}return null},cg=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function xj(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function k1(e,t){const r=xj(e,t);for(const i in gj)i in _d?i in e&&!(i in r)&&(r[i]=_d[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function vj(e,t){const r=e.icons,i=e.aliases||Object.create(null),n=Object.create(null);function s(a){if(r[a])return n[a]=[];if(!(a in n)){n[a]=null;const l=i[a]&&i[a].parent,u=l&&s(l);u&&(n[a]=[l].concat(u))}return n[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),n}function T1(e,t,r){const i=e.icons,n=e.aliases||Object.create(null);let s={};function a(l){s=k1(i[l]||n[l],s)}return a(t),r.forEach(a),k1(e,s)}function bj(e,t){if(e.icons[t])return T1(e,t,[]);const r=vj(e,[t])[t];return r?T1(e,t,r):null}const Sj=/(-?[0-9.]*[0-9]+[0-9.]*)/g,wj=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function E1(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(Sj);if(i===null||!i.length)return e;const n=[];let s=i.shift(),a=wj.test(s);for(;;){if(a){const l=parseFloat(s);isNaN(l)?n.push(s):n.push(Math.ceil(l*t*r)/r)}else n.push(s);if(s=i.shift(),s===void 0)return n.join("");a=!a}}function Cj(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const n=e.indexOf(">",i),s=e.indexOf("</"+t);if(n===-1||s===-1)break;const a=e.indexOf(">",s);if(a===-1)break;r+=e.slice(n+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function kj(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Tj(e,t,r){const i=Cj(e);return kj(i.defs,t+i.content+r)}const Ej=e=>e==="unset"||e==="undefined"||e==="none";function Bj(e,t){const r={...Nk,...e},i={...yj,...t},n={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(v=>{const S=[],C=v.hFlip,B=v.vFlip;let R=v.rotate;C?B?R+=2:(S.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),S.push("scale(-1 1)"),n.top=n.left=0):B&&(S.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),S.push("scale(1 -1)"),n.top=n.left=0);let E;switch(R<0&&(R-=Math.floor(R/4)*4),R=R%4,R){case 1:E=n.height/2+n.top,S.unshift("rotate(90 "+E.toString()+" "+E.toString()+")");break;case 2:S.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:E=n.width/2+n.left,S.unshift("rotate(-90 "+E.toString()+" "+E.toString()+")");break}R%2===1&&(n.left!==n.top&&(E=n.left,n.left=n.top,n.top=E),n.width!==n.height&&(E=n.width,n.width=n.height,n.height=E)),S.length&&(s=Tj(s,'<g transform="'+S.join(" ")+'">',"</g>"))});const a=i.width,l=i.height,u=n.width,h=n.height;let d,p;a===null?(p=l===null?"1em":l==="auto"?h:l,d=E1(p,u/h)):(d=a==="auto"?u:a,p=l===null?E1(d,h/u):l==="auto"?h:l);const m={},y=(v,S)=>{Ej(S)||(m[v]=S.toString())};y("width",d),y("height",p);const x=[n.left,n.top,u,h];return m.viewBox=x.join(" "),{attributes:m,viewBox:x,body:s}}const Mj=/\sid="(\S+)"/g,B1=new Map;function Lj(e){e=e.replace(/[0-9]+$/,"")||"a";const t=B1.get(e)||0;return B1.set(e,t+1),t?`${e}${t}`:e}function Rj(e){const t=[];let r;for(;r=Mj.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(n=>{const s=Lj(n),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function Aj(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function Wk(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var n=i.reduce(function(l,u){var h=u.match(/\n([\t ]+|(?!\s).)/g);return h?l.concat(h.map(function(d){var p,m;return(m=(p=d.match(/[\t ]/g))===null||p===void 0?void 0:p.length)!==null&&m!==void 0?m:0})):l},[]);if(n.length){var s=new RegExp(`
|
|
217
|
+
[ ]{`+Math.min.apply(Math,n)+"}","g");i=i.map(function(l){return l.replace(s,`
|
|
218
|
+
`)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return t.forEach(function(l,u){var h=a.match(/(?:^|\n)( *)$/),d=h?h[1]:"",p=l;typeof l=="string"&&l.includes(`
|
|
219
|
+
`)&&(p=String(l).split(`
|
|
220
|
+
`).map(function(m,y){return y===0?m:""+d+m}).join(`
|
|
221
|
+
`)),a+=p+i[u+1]}),a}var Dj={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},ym=new Map,Hk=new Map,Pj=T(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(ue.debug("Registering icon pack:",t.name),"loader"in t)Hk.set(t.name,t.loader);else if("icons"in t)ym.set(t.name,t.icons);else throw ue.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),qk=T(async(e,t)=>{const r=_j(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let n=ym.get(i);if(!n){const a=Hk.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{n={...await a(),prefix:i},ym.set(i,n)}catch(l){throw ue.error(l),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=bj(n,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),Ij=T(async e=>{try{return await qk(e),!0}catch{return!1}},"isIconAvailable"),Hc=T(async(e,t,r)=>{let i;try{i=await qk(e,t==null?void 0:t.fallbackPrefix)}catch(a){ue.error(a),i=Dj}const n=Bj(i,t),s=Aj(Rj(n.body),{...n.attributes,...r});return Hi(s,Ir())},"getIconSVG");function Uk(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
|
|
222
|
+
`).replace(/\n{2,}/g,`
|
|
223
|
+
`),n=Wk(i);return t===!1?n.replace(/ /g," "):n}T(Uk,"preprocessMarkdown");function Vk(e,t={}){const r=Uk(e,t),i=ot.lexer(r),n=[[]];let s=0;function a(l,u="normal"){l.type==="text"?l.text.split(`
|
|
224
|
+
`).forEach((d,p)=>{p!==0&&(s++,n.push([])),d.split(" ").forEach(m=>{m=m.replace(/'/g,"'"),m&&n[s].push({content:m,type:u})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(h=>{a(h,l.type)}):l.type==="html"&&n[s].push({content:l.text,type:"normal"})}return T(a,"processNode"),i.forEach(l=>{var u;l.type==="paragraph"?(u=l.tokens)==null||u.forEach(h=>{a(h)}):l.type==="html"?n[s].push({content:l.text,type:"normal"}):n[s].push({content:l.raw,type:"normal"})}),n}T(Vk,"markdownToLines");function Gk(e,{markdownAutoWrap:t}={}){const r=ot.lexer(e);function i(n){var s,a,l;return n.type==="text"?t===!1?n.text.replace(/\n */g,"<br/>").replace(/ /g," "):n.text.replace(/\n */g,"<br/>"):n.type==="strong"?`<strong>${(s=n.tokens)==null?void 0:s.map(i).join("")}</strong>`:n.type==="em"?`<em>${(a=n.tokens)==null?void 0:a.map(i).join("")}</em>`:n.type==="paragraph"?`<p>${(l=n.tokens)==null?void 0:l.map(i).join("")}</p>`:n.type==="space"?"":n.type==="html"?`${n.text}`:n.type==="escape"?n.text:(ue.warn(`Unsupported markdown: ${n.type}`),n.raw)}return T(i,"output"),r.map(i).join("")}T(Gk,"markdownToHTML");function Yk(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}T(Yk,"splitTextToChars");function Kk(e,t){const r=Yk(t.content);return f0(e,[],r,t.type)}T(Kk,"splitWordToFitWidth");function f0(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[n,...s]=r,a=[...t,n];return e([{content:a.join(""),type:i}])?f0(e,a,s,i):(t.length===0&&n&&(t.push(n),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}T(f0,"splitWordToFitWidthRecursion");function Xk(e,t){if(e.some(({content:r})=>r.includes(`
|
|
225
|
+
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return xd(e,t)}T(Xk,"splitLineToFitWidth");function xd(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let n="";e[0].content===" "&&(n=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(n!==""&&a.push({content:n,type:"normal"}),a.push(s),t(a))return xd(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[l,u]=Kk(t,s);r.push([l]),u.content&&e.unshift(u)}return xd(e,t,r)}T(xd,"splitLineToFitWidthRecursion");function _m(e,t){t&&e.attr("style",t)}T(_m,"applyStyle");async function Qk(e,t,r,i,n=!1,s=Ir()){const a=e.append("foreignObject");a.attr("width",`${10*r}px`),a.attr("height",`${10*r}px`);const l=a.append("xhtml:div"),u=Ia(t.label)?await Ry(t.label.replace(Ha.lineBreakRegex,`
|
|
226
|
+
`),s):Hi(t.label,s),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");d.html(u),_m(d,t.labelStyle),d.attr("class",`${h} ${i}`),_m(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),l.style("max-width",r+"px"),l.style("text-align","center"),l.attr("xmlns","http://www.w3.org/1999/xhtml"),n&&l.attr("class","labelBkg");let p=l.node().getBoundingClientRect();return p.width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px"),p=l.node().getBoundingClientRect()),a.node()}T(Qk,"addHtmlSpan");function Zd(e,t,r){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em")}T(Zd,"createTspan");function Zk(e,t,r){const i=e.append("text"),n=Zd(i,1,t);Jd(n,r);const s=n.node().getComputedTextLength();return i.remove(),s}T(Zk,"computeWidthOfText");function $j(e,t,r){var a;const i=e.append("text"),n=Zd(i,1,t);Jd(n,[{content:r,type:"normal"}]);const s=(a=n.node())==null?void 0:a.getBoundingClientRect();return s&&i.remove(),s}T($j,"computeDimensionOfText");function Jk(e,t,r,i=!1){const s=t.append("g"),a=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");let u=0;for(const h of r){const d=T(m=>Zk(s,1.1,m)<=e,"checkWidth"),p=d(h)?[h]:Xk(h,d);for(const m of p){const y=Zd(l,u,1.1);Jd(y,m),u++}}if(i){const h=l.node().getBBox(),d=2;return a.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}T(Jk,"createFormattedText");function Jd(e,t){e.text(""),t.forEach((r,i)=>{const n=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?n.text(r.content):n.text(" "+r.content)})}T(Jd,"updateTextContentAndStyles");async function e2(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(n,s,a)=>(r.push((async()=>{const l=`${s}:${a}`;return await Ij(l)?await Hc(l,void 0,{class:"label-icon"}):`<i class='${Hi(n,t).replace(":"," ")}'></i>`})()),n));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}T(e2,"replaceIconSubstring");var Gs=T(async(e,t="",{style:r="",isTitle:i=!1,classes:n="",useHtmlLabels:s=!0,isNode:a=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(ue.debug("XYZ createText",t,r,i,n,s,a,"addSvgBackground: ",u),s){const d=Gk(t,h),p=await e2(qo(d),h),m=t.replace(/\\\\/g,"\\"),y={isNode:a,label:Ia(t)?m:p,labelStyle:r.replace("fill:","color:")};return await Qk(e,y,l,n,u,h)}else{const d=t.replace(/<br\s*\/?>/g,"<br/>"),p=Vk(d.replace("<br>","<br/>"),h),m=Jk(l,e,p,t?u:!1);if(a){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");it(m).attr("style",y)}else{const y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");it(m).select("rect").attr("style",y.replace(/background:/g,"fill:"));const x=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");it(m).select("text").attr("style",x)}return m}},"createText");function hg(e,t,r){if(e&&e.length){const[i,n]=t,s=Math.PI/180*r,a=Math.cos(s),l=Math.sin(s);for(const u of e){const[h,d]=u;u[0]=(h-i)*a-(d-n)*l+i,u[1]=(h-i)*l+(d-n)*a+n}}}function jj(e,t){return e[0]===t[0]&&e[1]===t[1]}function Oj(e,t,r,i=1){const n=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,l=[0,0];if(n)for(const h of a)hg(h,l,n);const u=(function(h,d,p){const m=[];for(const B of h){const R=[...B];jj(R[0],R[R.length-1])||R.push([R[0][0],R[0][1]]),R.length>2&&m.push(R)}const y=[];d=Math.max(d,.1);const x=[];for(const B of m)for(let R=0;R<B.length-1;R++){const E=B[R],L=B[R+1];if(E[1]!==L[1]){const k=Math.min(E[1],L[1]);x.push({ymin:k,ymax:Math.max(E[1],L[1]),x:k===E[1]?E[0]:L[0],islope:(L[0]-E[0])/(L[1]-E[1])})}}if(x.sort(((B,R)=>B.ymin<R.ymin?-1:B.ymin>R.ymin?1:B.x<R.x?-1:B.x>R.x?1:B.ymax===R.ymax?0:(B.ymax-R.ymax)/Math.abs(B.ymax-R.ymax))),!x.length)return y;let v=[],S=x[0].ymin,C=0;for(;v.length||x.length;){if(x.length){let B=-1;for(let R=0;R<x.length&&!(x[R].ymin>S);R++)B=R;x.splice(0,B+1).forEach((R=>{v.push({s:S,edge:R})}))}if(v=v.filter((B=>!(B.edge.ymax<=S))),v.sort(((B,R)=>B.edge.x===R.edge.x?0:(B.edge.x-R.edge.x)/Math.abs(B.edge.x-R.edge.x))),(p!==1||C%d==0)&&v.length>1)for(let B=0;B<v.length;B+=2){const R=B+1;if(R>=v.length)break;const E=v[B].edge,L=v[R].edge;y.push([[Math.round(E.x),S],[Math.round(L.x),S]])}S+=p,v.forEach((B=>{B.edge.x=B.edge.x+p*B.edge.islope})),C++}return y})(a,s,i);if(n){for(const h of a)hg(h,l,-n);(function(h,d,p){const m=[];h.forEach((y=>m.push(...y))),hg(m,d,p)})(u,l,-n)}return u}function qc(e,t){var r;const i=t.hachureAngle+90;let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.round(Math.max(n,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=n),Oj(e,n,i,s||1)}let p0=class{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=qc(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],r));return i}};function ef(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}let zj=class extends p0{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const n=qc(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],l=.5*i*Math.cos(s),u=.5*i*Math.sin(s);for(const[h,d]of n)ef([h,d])&&a.push([[h[0]-l,h[1]+u],[...d]],[[h[0]+l,h[1]-u],[...d]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}};class Fj extends p0{fillPolygons(t,r){const i=this._fillPolygons(t,r),n=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,n);return i.ops=i.ops.concat(s.ops),i}}class Nj{constructor(t){this.helper=t}fillPolygons(t,r){const i=qc(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=n/4;for(const l of t){const u=ef(l),h=u/n,d=Math.ceil(h)-1,p=u-d*n,m=(l[0][0]+l[1][0])/2-n/4,y=Math.min(l[0][1],l[1][1]);for(let x=0;x<d;x++){const v=y+p+x*n,S=m-a+2*Math.random()*a,C=v-a+2*Math.random()*a,B=this.helper.ellipse(S,C,s,s,r);i.push(...B.ops)}}return{type:"fillSketch",ops:i}}}class Wj{constructor(t){this.helper=t}fillPolygons(t,r){const i=qc(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,n=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const l=ef(a),u=Math.floor(l/(i+n)),h=(l+n-u*(i+n))/2;let d=a[0],p=a[1];d[0]>p[0]&&(d=a[1],p=a[0]);const m=Math.atan((p[1]-d[1])/(p[0]-d[0]));for(let y=0;y<u;y++){const x=y*(i+n),v=x+i,S=[d[0]+x*Math.cos(m)+h*Math.cos(m),d[1]+x*Math.sin(m)+h*Math.sin(m)],C=[d[0]+v*Math.cos(m)+h*Math.cos(m),d[1]+v*Math.sin(m)+h*Math.sin(m)];s.push(...this.helper.doubleLineOps(S[0],S[1],C[0],C[1],r))}})),s}}class Hj{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,n=r.zigzagOffset<0?i:r.zigzagOffset,s=qc(t,r=Object.assign({},r,{hachureGap:i+n}));return{type:"fillSketch",ops:this.zigzagLines(s,n,r)}}zigzagLines(t,r,i){const n=[];return t.forEach((s=>{const a=ef(s),l=Math.round(a/(2*r));let u=s[0],h=s[1];u[0]>h[0]&&(u=s[1],h=s[0]);const d=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let p=0;p<l;p++){const m=2*p*r,y=2*(p+1)*r,x=Math.sqrt(2*Math.pow(r,2)),v=[u[0]+m*Math.cos(d),u[1]+m*Math.sin(d)],S=[u[0]+y*Math.cos(d),u[1]+y*Math.sin(d)],C=[v[0]+x*Math.cos(d+Math.PI/4),v[1]+x*Math.sin(d+Math.PI/4)];n.push(...this.helper.doubleLineOps(v[0],v[1],C[0],C[1],i),...this.helper.doubleLineOps(C[0],C[1],S[0],S[1],i))}})),n}}const ai={};class qj{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const Uj=0,ug=1,M1=2,au={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function dg(e,t){return e.type===t}function g0(e){const t=[],r=(function(a){const l=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:Uj,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:ug,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return l[l.length]={type:M1,text:""},l})(e);let i="BOD",n=0,s=r[n];for(;!dg(s,M1);){let a=0;const l=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return g0("M0,0"+e);n++,a=au[s.text],i=s.text}else dg(s,ug)?a=au[i]:(n++,a=au[s.text],i=s.text);if(!(n+a<r.length))throw new Error("Path data ended short");for(let u=n;u<n+a;u++){const h=r[u];if(!dg(h,ug))throw new Error("Param not a number: "+i+","+h.text);l[l.length]=+h.text}if(typeof au[i]!="number")throw new Error("Bad segment: "+i);{const u={key:i,data:l};t.push(u),n+=a,s=r[n],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function t2(e){let t=0,r=0,i=0,n=0;const s=[];for(const{key:a,data:l}of e)switch(a){case"M":s.push({key:"M",data:[...l]}),[t,r]=l,[i,n]=l;break;case"m":t+=l[0],r+=l[1],s.push({key:"M",data:[t,r]}),i=t,n=r;break;case"L":s.push({key:"L",data:[...l]}),[t,r]=l;break;case"l":t+=l[0],r+=l[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...l]}),t=l[4],r=l[5];break;case"c":{const u=l.map(((h,d)=>d%2?h+r:h+t));s.push({key:"C",data:u}),t=u[4],r=u[5];break}case"Q":s.push({key:"Q",data:[...l]}),t=l[2],r=l[3];break;case"q":{const u=l.map(((h,d)=>d%2?h+r:h+t));s.push({key:"Q",data:u}),t=u[2],r=u[3];break}case"A":s.push({key:"A",data:[...l]}),t=l[5],r=l[6];break;case"a":t+=l[5],r+=l[6],s.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,r]});break;case"H":s.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...l]}),r=l[0];break;case"v":r+=l[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...l]}),t=l[2],r=l[3];break;case"s":{const u=l.map(((h,d)=>d%2?h+r:h+t));s.push({key:"S",data:u}),t=u[2],r=u[3];break}case"T":s.push({key:"T",data:[...l]}),t=l[0],r=l[1];break;case"t":t+=l[0],r+=l[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=n}return s}function r2(e){const t=[];let r="",i=0,n=0,s=0,a=0,l=0,u=0;for(const{key:h,data:d}of e){switch(h){case"M":t.push({key:"M",data:[...d]}),[i,n]=d,[s,a]=d;break;case"C":t.push({key:"C",data:[...d]}),i=d[4],n=d[5],l=d[2],u=d[3];break;case"L":t.push({key:"L",data:[...d]}),[i,n]=d;break;case"H":i=d[0],t.push({key:"L",data:[i,n]});break;case"V":n=d[0],t.push({key:"L",data:[i,n]});break;case"S":{let p=0,m=0;r==="C"||r==="S"?(p=i+(i-l),m=n+(n-u)):(p=i,m=n),t.push({key:"C",data:[p,m,...d]}),l=d[0],u=d[1],i=d[2],n=d[3];break}case"T":{const[p,m]=d;let y=0,x=0;r==="Q"||r==="T"?(y=i+(i-l),x=n+(n-u)):(y=i,x=n);const v=i+2*(y-i)/3,S=n+2*(x-n)/3,C=p+2*(y-p)/3,B=m+2*(x-m)/3;t.push({key:"C",data:[v,S,C,B,p,m]}),l=y,u=x,i=p,n=m;break}case"Q":{const[p,m,y,x]=d,v=i+2*(p-i)/3,S=n+2*(m-n)/3,C=y+2*(p-y)/3,B=x+2*(m-x)/3;t.push({key:"C",data:[v,S,C,B,y,x]}),l=p,u=m,i=y,n=x;break}case"A":{const p=Math.abs(d[0]),m=Math.abs(d[1]),y=d[2],x=d[3],v=d[4],S=d[5],C=d[6];p===0||m===0?(t.push({key:"C",data:[i,n,S,C,S,C]}),i=S,n=C):(i!==S||n!==C)&&(i2(i,n,S,C,p,m,y,x,v).forEach((function(B){t.push({key:"C",data:B})})),i=S,n=C);break}case"Z":t.push({key:"Z",data:[]}),i=s,n=a}r=h}return t}function Wl(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function i2(e,t,r,i,n,s,a,l,u,h){const d=(p=a,Math.PI*p/180);var p;let m=[],y=0,x=0,v=0,S=0;if(h)[y,x,v,S]=h;else{[e,t]=Wl(e,t,-d),[r,i]=Wl(r,i,-d);const F=(e-r)/2,O=(t-i)/2;let $=F*F/(n*n)+O*O/(s*s);$>1&&($=Math.sqrt($),n*=$,s*=$);const j=n*n,W=s*s,P=j*W-j*O*O-W*F*F,Z=j*O*O+W*F*F,ee=(l===u?-1:1)*Math.sqrt(Math.abs(P/Z));v=ee*n*O/s+(e+r)/2,S=ee*-s*F/n+(t+i)/2,y=Math.asin(parseFloat(((t-S)/s).toFixed(9))),x=Math.asin(parseFloat(((i-S)/s).toFixed(9))),e<v&&(y=Math.PI-y),r<v&&(x=Math.PI-x),y<0&&(y=2*Math.PI+y),x<0&&(x=2*Math.PI+x),u&&y>x&&(y-=2*Math.PI),!u&&x>y&&(x-=2*Math.PI)}let C=x-y;if(Math.abs(C)>120*Math.PI/180){const F=x,O=r,$=i;x=u&&x>y?y+120*Math.PI/180*1:y+120*Math.PI/180*-1,m=i2(r=v+n*Math.cos(x),i=S+s*Math.sin(x),O,$,n,s,a,0,u,[x,F,v,S])}C=x-y;const B=Math.cos(y),R=Math.sin(y),E=Math.cos(x),L=Math.sin(x),k=Math.tan(C/4),A=4/3*n*k,z=4/3*s*k,U=[e,t],q=[e+A*R,t-z*B],H=[r+A*L,i-z*E],Y=[r,i];if(q[0]=2*U[0]-q[0],q[1]=2*U[1]-q[1],h)return[q,H,Y].concat(m);{m=[q,H,Y].concat(m);const F=[];for(let O=0;O<m.length;O+=3){const $=Wl(m[O][0],m[O][1],d),j=Wl(m[O+1][0],m[O+1][1],d),W=Wl(m[O+2][0],m[O+2][1],d);F.push([$[0],$[1],j[0],j[1],W[0],W[1]])}return F}}const Vj={randOffset:function(e,t){return Ue(e,t)},randOffsetWithRange:function(e,t,r){return vd(e,t,r)},ellipse:function(e,t,r,i,n){const s=s2(r,i,n);return xm(e,t,n,s).opset},doubleLineOps:function(e,t,r,i,n){return qs(e,t,r,i,n,!0)}};function n2(e,t,r,i,n){return{type:"path",ops:qs(e,t,r,i,n)}}function Ru(e,t,r){const i=(e||[]).length;if(i>2){const n=[];for(let s=0;s<i-1;s++)n.push(...qs(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&n.push(...qs(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:n}}return i===2?n2(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function Gj(e,t,r,i,n){return(function(s,a){return Ru(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],n)}function L1(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=lu(r[0],1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:lu(r[0],1.5*(1+.22*t.roughness),D1(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const l=lu(a,1*(1+.2*t.roughness),t),u=t.disableMultiStroke?[]:lu(a,1.5*(1+.22*t.roughness),D1(t));for(const h of l)h.op!=="move"&&i.push(h);for(const h of u)h.op!=="move"&&n.push(h)}}return{type:"path",ops:i.concat(n)}}return{type:"path",ops:[]}}function s2(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),n=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/n;let a=Math.abs(e/2),l=Math.abs(t/2);const u=1-r.curveFitting;return a+=Ue(a*u,r),l+=Ue(l*u,r),{increment:s,rx:a,ry:l}}function xm(e,t,r,i){const[n,s]=P1(i.increment,e,t,i.rx,i.ry,1,i.increment*vd(.1,vd(.4,1,r),r),r);let a=bd(n,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[l]=P1(i.increment,e,t,i.rx,i.ry,1.5,0,r),u=bd(l,null,r);a=a.concat(u)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function R1(e,t,r,i,n,s,a,l,u){const h=e,d=t;let p=Math.abs(r/2),m=Math.abs(i/2);p+=Ue(.01*p,u),m+=Ue(.01*m,u);let y=n,x=s;for(;y<0;)y+=2*Math.PI,x+=2*Math.PI;x-y>2*Math.PI&&(y=0,x=2*Math.PI);const v=2*Math.PI/u.curveStepCount,S=Math.min(v/2,(x-y)/2),C=I1(S,h,d,p,m,y,x,1,u);if(!u.disableMultiStroke){const B=I1(S,h,d,p,m,y,x,1.5,u);C.push(...B)}return a&&(l?C.push(...qs(h,d,h+p*Math.cos(y),d+m*Math.sin(y),u),...qs(h,d,h+p*Math.cos(x),d+m*Math.sin(x),u)):C.push({op:"lineTo",data:[h,d]},{op:"lineTo",data:[h+p*Math.cos(y),d+m*Math.sin(y)]})),{type:"path",ops:C}}function A1(e,t){const r=r2(t2(g0(e))),i=[];let n=[0,0],s=[0,0];for(const{key:a,data:l}of r)switch(a){case"M":s=[l[0],l[1]],n=[l[0],l[1]];break;case"L":i.push(...qs(s[0],s[1],l[0],l[1],t)),s=[l[0],l[1]];break;case"C":{const[u,h,d,p,m,y]=l;i.push(...Yj(u,h,d,p,m,y,s,t)),s=[m,y];break}case"Z":i.push(...qs(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]]}return{type:"path",ops:i}}function fg(e,t){const r=[];for(const i of e)if(i.length){const n=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+Ue(n,t),i[0][1]+Ue(n,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+Ue(n,t),i[a][1]+Ue(n,t)]})}}return{type:"fillPath",ops:r}}function ma(e,t){return(function(r,i){let n=r.fillStyle||"hachure";if(!ai[n])switch(n){case"zigzag":ai[n]||(ai[n]=new zj(i));break;case"cross-hatch":ai[n]||(ai[n]=new Fj(i));break;case"dots":ai[n]||(ai[n]=new Nj(i));break;case"dashed":ai[n]||(ai[n]=new Wj(i));break;case"zigzag-line":ai[n]||(ai[n]=new Hj(i));break;default:n="hachure",ai[n]||(ai[n]=new p0(i))}return ai[n]})(t,Vj).fillPolygons(e,t)}function D1(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function o2(e){return e.randomizer||(e.randomizer=new qj(e.seed||0)),e.randomizer.next()}function vd(e,t,r,i=1){return r.roughness*i*(o2(r)*(t-e)+e)}function Ue(e,t,r=1){return vd(-e,e,t,r)}function qs(e,t,r,i,n,s=!1){const a=s?n.disableMultiStrokeFill:n.disableMultiStroke,l=vm(e,t,r,i,n,!0,!1);if(a)return l;const u=vm(e,t,r,i,n,!0,!0);return l.concat(u)}function vm(e,t,r,i,n,s,a){const l=Math.pow(e-r,2)+Math.pow(t-i,2),u=Math.sqrt(l);let h=1;h=u<200?1:u>500?.4:-.0016668*u+1.233334;let d=n.maxRandomnessOffset||0;d*d*100>l&&(d=u/10);const p=d/2,m=.2+.2*o2(n);let y=n.bowing*n.maxRandomnessOffset*(i-t)/200,x=n.bowing*n.maxRandomnessOffset*(e-r)/200;y=Ue(y,n,h),x=Ue(x,n,h);const v=[],S=()=>Ue(p,n,h),C=()=>Ue(d,n,h),B=n.preserveVertices;return a?v.push({op:"move",data:[e+(B?0:S()),t+(B?0:S())]}):v.push({op:"move",data:[e+(B?0:Ue(d,n,h)),t+(B?0:Ue(d,n,h))]}),a?v.push({op:"bcurveTo",data:[y+e+(r-e)*m+S(),x+t+(i-t)*m+S(),y+e+2*(r-e)*m+S(),x+t+2*(i-t)*m+S(),r+(B?0:S()),i+(B?0:S())]}):v.push({op:"bcurveTo",data:[y+e+(r-e)*m+C(),x+t+(i-t)*m+C(),y+e+2*(r-e)*m+C(),x+t+2*(i-t)*m+C(),r+(B?0:C()),i+(B?0:C())]}),v}function lu(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+Ue(t,r),e[0][1]+Ue(t,r)]),i.push([e[0][0]+Ue(t,r),e[0][1]+Ue(t,r)]);for(let n=1;n<e.length;n++)i.push([e[n][0]+Ue(t,r),e[n][1]+Ue(t,r)]),n===e.length-1&&i.push([e[n][0]+Ue(t,r),e[n][1]+Ue(t,r)]);return bd(i,null,r)}function bd(e,t,r){const i=e.length,n=[];if(i>3){const s=[],a=1-r.curveTightness;n.push({op:"move",data:[e[1][0],e[1][1]]});for(let l=1;l+2<i;l++){const u=e[l];s[0]=[u[0],u[1]],s[1]=[u[0]+(a*e[l+1][0]-a*e[l-1][0])/6,u[1]+(a*e[l+1][1]-a*e[l-1][1])/6],s[2]=[e[l+1][0]+(a*e[l][0]-a*e[l+2][0])/6,e[l+1][1]+(a*e[l][1]-a*e[l+2][1])/6],s[3]=[e[l+1][0],e[l+1][1]],n.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(n.push({op:"move",data:[e[1][0],e[1][1]]}),n.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&n.push(...vm(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return n}function P1(e,t,r,i,n,s,a,l){const u=[],h=[];if(l.roughness===0){e/=4,h.push([t+i*Math.cos(-e),r+n*Math.sin(-e)]);for(let d=0;d<=2*Math.PI;d+=e){const p=[t+i*Math.cos(d),r+n*Math.sin(d)];u.push(p),h.push(p)}h.push([t+i*Math.cos(0),r+n*Math.sin(0)]),h.push([t+i*Math.cos(e),r+n*Math.sin(e)])}else{const d=Ue(.5,l)-Math.PI/2;h.push([Ue(s,l)+t+.9*i*Math.cos(d-e),Ue(s,l)+r+.9*n*Math.sin(d-e)]);const p=2*Math.PI+d-.01;for(let m=d;m<p;m+=e){const y=[Ue(s,l)+t+i*Math.cos(m),Ue(s,l)+r+n*Math.sin(m)];u.push(y),h.push(y)}h.push([Ue(s,l)+t+i*Math.cos(d+2*Math.PI+.5*a),Ue(s,l)+r+n*Math.sin(d+2*Math.PI+.5*a)]),h.push([Ue(s,l)+t+.98*i*Math.cos(d+a),Ue(s,l)+r+.98*n*Math.sin(d+a)]),h.push([Ue(s,l)+t+.9*i*Math.cos(d+.5*a),Ue(s,l)+r+.9*n*Math.sin(d+.5*a)])}return[h,u]}function I1(e,t,r,i,n,s,a,l,u){const h=s+Ue(.1,u),d=[];d.push([Ue(l,u)+t+.9*i*Math.cos(h-e),Ue(l,u)+r+.9*n*Math.sin(h-e)]);for(let p=h;p<=a;p+=e)d.push([Ue(l,u)+t+i*Math.cos(p),Ue(l,u)+r+n*Math.sin(p)]);return d.push([t+i*Math.cos(a),r+n*Math.sin(a)]),d.push([t+i*Math.cos(a),r+n*Math.sin(a)]),bd(d,null,u)}function Yj(e,t,r,i,n,s,a,l){const u=[],h=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3];let d=[0,0];const p=l.disableMultiStroke?1:2,m=l.preserveVertices;for(let y=0;y<p;y++)y===0?u.push({op:"move",data:[a[0],a[1]]}):u.push({op:"move",data:[a[0]+(m?0:Ue(h[0],l)),a[1]+(m?0:Ue(h[0],l))]}),d=m?[n,s]:[n+Ue(h[y],l),s+Ue(h[y],l)],u.push({op:"bcurveTo",data:[e+Ue(h[y],l),t+Ue(h[y],l),r+Ue(h[y],l),i+Ue(h[y],l),d[0],d[1]]});return u}function Hl(e){return[...e]}function $1(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Hl(e[0]),Hl(e[1]),Hl(e[2]),Hl(e[2]));else{const n=[];n.push(e[0],e[0]);for(let l=1;l<e.length;l++)n.push(e[l]),l===e.length-1&&n.push(e[l]);const s=[],a=1-t;i.push(Hl(n[0]));for(let l=1;l+2<n.length;l++){const u=n[l];s[0]=[u[0],u[1]],s[1]=[u[0]+(a*n[l+1][0]-a*n[l-1][0])/6,u[1]+(a*n[l+1][1]-a*n[l-1][1])/6],s[2]=[n[l+1][0]+(a*n[l][0]-a*n[l+2][0])/6,n[l+1][1]+(a*n[l][1]-a*n[l+2][1])/6],s[3]=[n[l+1][0],n[l+1][1]],i.push(s[1],s[2],s[3])}}return i}function Au(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function Kj(e,t,r){const i=Au(t,r);if(i===0)return Au(e,t);let n=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return n=Math.max(0,Math.min(1,n)),Au(e,_o(t,r,n))}function _o(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function bm(e,t,r,i){const n=i||[];if((function(l,u){const h=l[u+0],d=l[u+1],p=l[u+2],m=l[u+3];let y=3*d[0]-2*h[0]-m[0];y*=y;let x=3*d[1]-2*h[1]-m[1];x*=x;let v=3*p[0]-2*m[0]-h[0];v*=v;let S=3*p[1]-2*m[1]-h[1];return S*=S,y<v&&(y=v),x<S&&(x=S),y+x})(e,t)<r){const l=e[t+0];n.length?(s=n[n.length-1],a=l,Math.sqrt(Au(s,a))>1&&n.push(l)):n.push(l),n.push(e[t+3])}else{const u=e[t+0],h=e[t+1],d=e[t+2],p=e[t+3],m=_o(u,h,.5),y=_o(h,d,.5),x=_o(d,p,.5),v=_o(m,y,.5),S=_o(y,x,.5),C=_o(v,S,.5);bm([u,m,v,C],0,r,n),bm([C,S,x,p],0,r,n)}var s,a;return n}function Xj(e,t){return Sd(e,0,e.length,t)}function Sd(e,t,r,i,n){const s=n||[],a=e[t],l=e[r-1];let u=0,h=1;for(let d=t+1;d<r-1;++d){const p=Kj(e[d],a,l);p>u&&(u=p,h=d)}return Math.sqrt(u)>i?(Sd(e,t,h+1,i,s),Sd(e,h,r,i,s)):(s.length||s.push(a),s.push(l)),s}function pg(e,t=.15,r){const i=[],n=(e.length-1)/3;for(let s=0;s<n;s++)bm(e,3*s,t,i);return r&&r>0?Sd(i,0,i.length,r):i}const xi="none";class wd{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,n,s){const a=this._o(s);return this._d("line",[n2(t,r,i,n,a)],a)}rectangle(t,r,i,n,s){const a=this._o(s),l=[],u=Gj(t,r,i,n,a);if(a.fill){const h=[[t,r],[t+i,r],[t+i,r+n],[t,r+n]];a.fillStyle==="solid"?l.push(fg([h],a)):l.push(ma([h],a))}return a.stroke!==xi&&l.push(u),this._d("rectangle",l,a)}ellipse(t,r,i,n,s){const a=this._o(s),l=[],u=s2(i,n,a),h=xm(t,r,a,u);if(a.fill)if(a.fillStyle==="solid"){const d=xm(t,r,a,u).opset;d.type="fillPath",l.push(d)}else l.push(ma([h.estimatedPoints],a));return a.stroke!==xi&&l.push(h.opset),this._d("ellipse",l,a)}circle(t,r,i,n){const s=this.ellipse(t,r,i,i,n);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Ru(t,!1,i)],i)}arc(t,r,i,n,s,a,l=!1,u){const h=this._o(u),d=[],p=R1(t,r,i,n,s,a,l,!0,h);if(l&&h.fill)if(h.fillStyle==="solid"){const m=Object.assign({},h);m.disableMultiStroke=!0;const y=R1(t,r,i,n,s,a,!0,!1,m);y.type="fillPath",d.push(y)}else d.push((function(m,y,x,v,S,C,B){const R=m,E=y;let L=Math.abs(x/2),k=Math.abs(v/2);L+=Ue(.01*L,B),k+=Ue(.01*k,B);let A=S,z=C;for(;A<0;)A+=2*Math.PI,z+=2*Math.PI;z-A>2*Math.PI&&(A=0,z=2*Math.PI);const U=(z-A)/B.curveStepCount,q=[];for(let H=A;H<=z;H+=U)q.push([R+L*Math.cos(H),E+k*Math.sin(H)]);return q.push([R+L*Math.cos(z),E+k*Math.sin(z)]),q.push([R,E]),ma([q],B)})(t,r,i,n,s,a,h));return h.stroke!==xi&&d.push(p),this._d("arc",d,h)}curve(t,r){const i=this._o(r),n=[],s=L1(t,i);if(i.fill&&i.fill!==xi)if(i.fillStyle==="solid"){const a=L1(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],l=t;if(l.length){const u=typeof l[0][0]=="number"?[l]:l;for(const h of u)h.length<3?a.push(...h):h.length===3?a.push(...pg($1([h[0],h[0],h[1],h[2]]),10,(1+i.roughness)/2)):a.push(...pg($1(h),10,(1+i.roughness)/2))}a.length&&n.push(ma([a],i))}return i.stroke!==xi&&n.push(s),this._d("curve",n,i)}polygon(t,r){const i=this._o(r),n=[],s=Ru(t,!0,i);return i.fill&&(i.fillStyle==="solid"?n.push(fg([t],i)):n.push(ma([t],i))),i.stroke!==xi&&n.push(s),this._d("polygon",n,i)}path(t,r){const i=this._o(r),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==xi,a=i.stroke!==xi,l=!!(i.simplification&&i.simplification<1),u=(function(d,p,m){const y=r2(t2(g0(d))),x=[];let v=[],S=[0,0],C=[];const B=()=>{C.length>=4&&v.push(...pg(C,p)),C=[]},R=()=>{B(),v.length&&(x.push(v),v=[])};for(const{key:L,data:k}of y)switch(L){case"M":R(),S=[k[0],k[1]],v.push(S);break;case"L":B(),v.push([k[0],k[1]]);break;case"C":if(!C.length){const A=v.length?v[v.length-1]:S;C.push([A[0],A[1]])}C.push([k[0],k[1]]),C.push([k[2],k[3]]),C.push([k[4],k[5]]);break;case"Z":B(),v.push([S[0],S[1]])}if(R(),!m)return x;const E=[];for(const L of x){const k=Xj(L,m);k.length&&E.push(k)}return E})(t,1,l?4-4*(i.simplification||1):(1+i.roughness)/2),h=A1(t,i);if(s)if(i.fillStyle==="solid")if(u.length===1){const d=A1(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(d.ops)})}else n.push(fg(u,i));else n.push(ma(u,i));return a&&(l?u.forEach((d=>{n.push(Ru(d,!1,i))})):n.push(h)),this._d("path",n,i)}opsToPath(t,r){let i="";for(const n of t.ops){const s=typeof r=="number"&&r>=0?n.data.map((a=>+a.toFixed(r))):n.data;switch(n.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,n=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:xi};break;case"fillPath":a={d:this.opsToPath(s),stroke:xi,strokeWidth:0,fill:i.fill||xi};break;case"fillSketch":a=this.fillSketch(s,i)}a&&n.push(a)}return n}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||xi,strokeWidth:i,fill:xi}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}let Qj=class{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new wd(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":n.save(),n.strokeStyle=i.stroke==="none"?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,a,s),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const l=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,a,s,l),n.restore();break}case"fillSketch":this.fillSketch(n,a,i)}}fillSketch(t,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,n="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((l=>+l.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,n,s){const a=this.gen.line(t,r,i,n,s);return this.draw(a),a}rectangle(t,r,i,n,s){const a=this.gen.rectangle(t,r,i,n,s);return this.draw(a),a}ellipse(t,r,i,n,s){const a=this.gen.ellipse(t,r,i,n,s);return this.draw(a),a}circle(t,r,i,n){const s=this.gen.circle(t,r,i,n);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,n,s,a,l=!1,u){const h=this.gen.arc(t,r,i,n,s,a,l,u);return this.draw(h),h}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}};const cu="http://www.w3.org/2000/svg";let Zj=class{constructor(t,r){this.svg=t,this.gen=new wd(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,s=n.createElementNS(cu,"g"),a=t.options.fixedDecimalPlaceDigits;for(const l of r){let u=null;switch(l.type){case"path":u=n.createElementNS(cu,"path"),u.setAttribute("d",this.opsToPath(l,a)),u.setAttribute("stroke",i.stroke),u.setAttribute("stroke-width",i.strokeWidth+""),u.setAttribute("fill","none"),i.strokeLineDash&&u.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&u.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":u=n.createElementNS(cu,"path"),u.setAttribute("d",this.opsToPath(l,a)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||u.setAttribute("fill-rule","evenodd");break;case"fillSketch":u=this.fillSketch(n,l,i)}u&&s.appendChild(u)}return s}fillSketch(t,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2);const s=t.createElementNS(cu,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",n+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,n,s){const a=this.gen.line(t,r,i,n,s);return this.draw(a)}rectangle(t,r,i,n,s){const a=this.gen.rectangle(t,r,i,n,s);return this.draw(a)}ellipse(t,r,i,n,s){const a=this.gen.ellipse(t,r,i,n,s);return this.draw(a)}circle(t,r,i,n){const s=this.gen.circle(t,r,i,n);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,n,s,a,l=!1,u){const h=this.gen.arc(t,r,i,n,s,a,l,u);return this.draw(h)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}};var Ae={canvas:(e,t)=>new Qj(e,t),svg:(e,t)=>new Zj(e,t),generator:e=>new wd(e),newSeed:()=>wd.newSeed()},qe=T(async(e,t,r)=>{var p,m;let i;const n=t.useHtmlLabels||ar((p=ft())==null?void 0:p.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",jr(t.labelStyle));let l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];const u=await Gs(a,Hi(qo(l),ft()),{useHtmlLabels:n,width:t.width||((m=ft().flowchart)==null?void 0:m.wrappingWidth),cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let h=u.getBBox();const d=((t==null?void 0:t.padding)??0)/2;if(n){const y=u.children[0],x=it(u),v=y.getElementsByTagName("img");if(v){const S=l.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...v].map(C=>new Promise(B=>{function R(){if(C.style.display="flex",C.style.flexDirection="column",S){const E=ft().fontSize?ft().fontSize:window.getComputedStyle(document.body).fontSize,L=5,[k=RS.fontSize]=Qd(E),A=k*L+"px";C.style.minWidth=A,C.style.maxWidth=A}else C.style.width="100%";B(C)}T(R,"setupImage"),setTimeout(()=>{C.complete&&R()}),C.addEventListener("error",R),C.addEventListener("load",R)})))}h=y.getBoundingClientRect(),x.attr("width",h.width),x.attr("height",h.height)}return n?a.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):a.attr("transform","translate(0, "+-h.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:h,halfPadding:d,label:a}},"labelHelper"),gg=T(async(e,t,r)=>{var u,h,d,p,m,y;const i=r.useHtmlLabels||ar((h=(u=ft())==null?void 0:u.flowchart)==null?void 0:h.htmlLabels),n=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Gs(n,Hi(qo(t),ft()),{useHtmlLabels:i,width:r.width||((p=(d=ft())==null?void 0:d.flowchart)==null?void 0:p.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const l=r.padding/2;if(ar((y=(m=ft())==null?void 0:m.flowchart)==null?void 0:y.htmlLabels)){const x=s.children[0],v=it(s);a=x.getBoundingClientRect(),v.attr("width",a.width),v.attr("height",a.height)}return i?n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):n.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:l,label:n}},"insertLabel"),$e=T((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),Ne=T((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function tt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}T(tt,"createPathFromPoints");function Us(e,t,r,i,n,s){const a=[],u=r-e,h=i-t,d=u/s,p=2*Math.PI/d,m=t+h/2;for(let y=0;y<=50;y++){const x=y/50,v=e+x*u,S=m+n*Math.sin(p*(v-e));a.push({x:v,y:S})}return a}T(Us,"generateFullSineWavePoints");function Mc(e,t,r,i,n,s){const a=[],l=n*Math.PI/180,d=(s*Math.PI/180-l)/(i-1);for(let p=0;p<i;p++){const m=l+p*d,y=e+r*Math.cos(m),x=t+r*Math.sin(m);a.push({x:-y,y:-x})}return a}T(Mc,"generateCirclePoints");var Jj=T((e,t)=>{var r=e.x,i=e.y,n=t.x-r,s=t.y-i,a=e.width/2,l=e.height/2,u,h;return Math.abs(s)*a>Math.abs(n)*l?(s<0&&(l=-l),u=s===0?0:l*n/s,h=l):(n<0&&(a=-a),u=a,h=n===0?0:a*s/n),{x:r+u,y:i+h}},"intersectRect"),Ga=Jj;function a2(e,t){t&&e.attr("style",t)}T(a2,"applyStyle");async function l2(e){const t=it(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=t.append("xhtml:div"),i=ft();let n=e.label;e.label&&Ia(e.label)&&(n=await Ry(e.label.replace(Ha.lineBreakRegex,`
|
|
227
|
+
`),i));const a='<span class="'+(e.isNode?"nodeLabel":"edgeLabel")+'" '+(e.labelStyle?'style="'+e.labelStyle+'"':"")+">"+n+"</span>";return r.html(Hi(a,i)),a2(r,e.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}T(l2,"addHtmlLabel");var eO=T(async(e,t,r,i)=>{let n=e||"";if(typeof n=="object"&&(n=n[0]),ar(ft().flowchart.htmlLabels)){n=n.replace(/\\n|\n/g,"<br />"),ue.info("vertexText"+n);const s={isNode:i,label:qo(n).replace(/fa[blrs]?:fa-[\w-]+/g,l=>`<i class='${l.replace(":"," ")}'></i>`),labelStyle:t&&t.replace("fill:","color:")};return await l2(s)}else{const s=document.createElementNS("http://www.w3.org/2000/svg","text");s.setAttribute("style",t.replace("color:","fill:"));let a=[];typeof n=="string"?a=n.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(n)?a=n:a=[];for(const l of a){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),r?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=l.trim(),s.appendChild(u)}return s}},"createLabel"),To=eO,Ys=T((e,t,r,i,n)=>["M",e+n,t,"H",e+r-n,"A",n,n,0,0,1,e+r,t+n,"V",t+i-n,"A",n,n,0,0,1,e+r-n,t+i,"H",e+n,"A",n,n,0,0,1,e,t+i-n,"V",t+n,"A",n,n,0,0,1,e+n,t,"Z"].join(" "),"createRoundedRectPathD"),c2=T(async(e,t)=>{ue.info("Creating subgraph rect for ",t.id,t);const r=ft(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=Pe(t),p=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),m=ar(r.flowchart.htmlLabels),y=p.insert("g").attr("class","cluster-label "),x=await Gs(y,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:!0});let v=x.getBBox();if(ar(r.flowchart.htmlLabels)){const A=x.children[0],z=it(x);v=A.getBoundingClientRect(),z.attr("width",v.width),z.attr("height",v.height)}const S=t.width<=v.width+t.padding?v.width+t.padding:t.width;t.width<=v.width+t.padding?t.diff=(S-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,B=t.x-S/2,R=t.y-C/2;ue.trace("Data ",t,JSON.stringify(t));let E;if(t.look==="handDrawn"){const A=Ae.svg(p),z=De(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:n}),U=A.path(Ys(B,R,S,C,0),z);E=p.insert(()=>(ue.debug("Rough node insert CXC",U),U),":first-child"),E.select("path:nth-child(2)").attr("style",h.join(";")),E.select("path").attr("style",d.join(";").replace("fill","stroke"))}else E=p.insert("rect",":first-child"),E.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",B).attr("y",R).attr("width",S).attr("height",C);const{subGraphTitleTopMargin:L}=r0(r);if(y.attr("transform",`translate(${t.x-v.width/2}, ${t.y-t.height/2+L})`),l){const A=y.select("span");A&&A.attr("style",l)}const k=E.node().getBBox();return t.offsetX=0,t.width=k.width,t.height=k.height,t.offsetY=v.height-t.padding/2,t.intersect=function(A){return Ga(t,A)},{cluster:p,labelBBox:v}},"rect"),tO=T((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.id),i=r.insert("rect",":first-child"),n=0*t.padding,s=n/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+n).attr("height",t.height+n).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(l){return Ga(t,l)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),rO=T(async(e,t)=>{const r=ft(),{themeVariables:i,handDrawnSeed:n}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:l,nodeBorder:u}=i,h=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),d=h.insert("g",":first-child"),p=h.insert("g").attr("class","cluster-label");let m=h.append("rect");const y=p.node().appendChild(await To(t.label,t.labelStyle,void 0,!0));let x=y.getBBox();if(ar(r.flowchart.htmlLabels)){const U=y.children[0],q=it(y);x=U.getBoundingClientRect(),q.attr("width",x.width),q.attr("height",x.height)}const v=0*t.padding,S=v/2,C=(t.width<=x.width+t.padding?x.width+t.padding:t.width)+v;t.width<=x.width+t.padding?t.diff=(C-t.width)/2-t.padding:t.diff=-t.padding;const B=t.height+v,R=t.height+v-x.height-6,E=t.x-C/2,L=t.y-B/2;t.width=C;const k=t.y-t.height/2-S+x.height+2;let A;if(t.look==="handDrawn"){const U=t.cssClasses.includes("statediagram-cluster-alt"),q=Ae.svg(h),H=t.rx||t.ry?q.path(Ys(E,L,C,B,10),{roughness:.7,fill:l,fillStyle:"solid",stroke:u,seed:n}):q.rectangle(E,L,C,B,{seed:n});A=h.insert(()=>H,":first-child");const Y=q.rectangle(E,k,C,R,{fill:U?s:a,fillStyle:U?"hachure":"solid",stroke:u,seed:n});A=h.insert(()=>H,":first-child"),m=h.insert(()=>Y)}else A=d.insert("rect",":first-child"),A.attr("class","outer").attr("x",E).attr("y",L).attr("width",C).attr("height",B).attr("data-look",t.look),m.attr("class","inner").attr("x",E).attr("y",k).attr("width",C).attr("height",R);p.attr("transform",`translate(${t.x-x.width/2}, ${L+1-(ar(r.flowchart.htmlLabels)?0:3)})`);const z=A.node().getBBox();return t.height=z.height,t.offsetX=0,t.offsetY=x.height-t.padding/2,t.labelBBox=x,t.intersect=function(U){return Ga(t,U)},{cluster:h,labelBBox:x}},"roundedWithTitle"),iO=T(async(e,t)=>{ue.info("Creating subgraph rect for ",t.id,t);const r=ft(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=Pe(t),p=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),m=ar(r.flowchart.htmlLabels),y=p.insert("g").attr("class","cluster-label "),x=await Gs(y,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:!0,width:t.width});let v=x.getBBox();if(ar(r.flowchart.htmlLabels)){const A=x.children[0],z=it(x);v=A.getBoundingClientRect(),z.attr("width",v.width),z.attr("height",v.height)}const S=t.width<=v.width+t.padding?v.width+t.padding:t.width;t.width<=v.width+t.padding?t.diff=(S-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,B=t.x-S/2,R=t.y-C/2;ue.trace("Data ",t,JSON.stringify(t));let E;if(t.look==="handDrawn"){const A=Ae.svg(p),z=De(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:n}),U=A.path(Ys(B,R,S,C,t.rx),z);E=p.insert(()=>(ue.debug("Rough node insert CXC",U),U),":first-child"),E.select("path:nth-child(2)").attr("style",h.join(";")),E.select("path").attr("style",d.join(";").replace("fill","stroke"))}else E=p.insert("rect",":first-child"),E.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",B).attr("y",R).attr("width",S).attr("height",C);const{subGraphTitleTopMargin:L}=r0(r);if(y.attr("transform",`translate(${t.x-v.width/2}, ${t.y-t.height/2+L})`),l){const A=y.select("span");A&&A.attr("style",l)}const k=E.node().getBBox();return t.offsetX=0,t.width=k.width,t.height=k.height,t.offsetY=v.height-t.padding/2,t.intersect=function(A){return Ga(t,A)},{cluster:p,labelBBox:v}},"kanbanSection"),nO=T((e,t)=>{const r=ft(),{themeVariables:i,handDrawnSeed:n}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),l=a.insert("g",":first-child"),u=0*t.padding,h=t.width+u;t.diff=-t.padding;const d=t.height+u,p=t.x-h/2,m=t.y-d/2;t.width=h;let y;if(t.look==="handDrawn"){const S=Ae.svg(a).rectangle(p,m,h,d,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:n});y=a.insert(()=>S,":first-child")}else y=l.insert("rect",":first-child"),y.attr("class","divider").attr("x",p).attr("y",m).attr("width",h).attr("height",d).attr("data-look",t.look);const x=y.node().getBBox();return t.height=x.height,t.offsetX=0,t.offsetY=0,t.intersect=function(v){return Ga(t,v)},{cluster:a,labelBBox:{}}},"divider"),sO=c2,oO={rect:c2,squareRect:sO,roundedWithTitle:rO,noteGroup:tO,divider:nO,kanbanSection:iO},h2=new Map,aO=T(async(e,t)=>{const r=t.shape||"rect",i=await oO[r](e,t);return h2.set(t.id,i),i},"insertCluster"),WU=T(()=>{h2=new Map},"clear");function u2(e,t){return e.intersect(t)}T(u2,"intersectNode");var lO=u2;function d2(e,t,r,i){var n=e.x,s=e.y,a=n-i.x,l=s-i.y,u=Math.sqrt(t*t*l*l+r*r*a*a),h=Math.abs(t*r*a/u);i.x<n&&(h=-h);var d=Math.abs(t*r*l/u);return i.y<s&&(d=-d),{x:n+h,y:s+d}}T(d2,"intersectEllipse");var f2=d2;function p2(e,t,r){return f2(e,t,t,r)}T(p2,"intersectCircle");var cO=p2;function g2(e,t,r,i){{const n=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,l=n*r.x+s*r.y+a,u=n*i.x+s*i.y+a,h=1e-6;if(l!==0&&u!==0&&Sm(l,u))return;const d=i.y-r.y,p=r.x-i.x,m=i.x*r.y-r.x*i.y,y=d*e.x+p*e.y+m,x=d*t.x+p*t.y+m;if(Math.abs(y)<h&&Math.abs(x)<h&&Sm(y,x))return;const v=n*p-d*s;if(v===0)return;const S=Math.abs(v/2);let C=s*m-p*a;const B=C<0?(C-S)/v:(C+S)/v;C=d*a-n*m;const R=C<0?(C-S)/v:(C+S)/v;return{x:B,y:R}}}T(g2,"intersectLine");function Sm(e,t){return e*t>0}T(Sm,"sameSign");var hO=g2;function m2(e,t,r){let i=e.x,n=e.y,s=[],a=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){a=Math.min(a,d.x),l=Math.min(l,d.y)}):(a=Math.min(a,t.x),l=Math.min(l,t.y));let u=i-e.width/2-a,h=n-e.height/2-l;for(let d=0;d<t.length;d++){let p=t[d],m=t[d<t.length-1?d+1:0],y=hO(e,r,{x:u+p.x,y:h+p.y},{x:u+m.x,y:h+m.y});y&&s.push(y)}return s.length?(s.length>1&&s.sort(function(d,p){let m=d.x-r.x,y=d.y-r.y,x=Math.sqrt(m*m+y*y),v=p.x-r.x,S=p.y-r.y,C=Math.sqrt(v*v+S*S);return x<C?-1:x===C?0:1}),s[0]):e}T(m2,"intersectPolygon");var uO=m2,Se={node:lO,circle:cO,ellipse:f2,polygon:uO,rect:Ga};function y2(e,t){const{labelStyles:r}=Pe(t);t.labelStyle=r;const i=Ne(t);let n=i;i||(n="anchor");const s=e.insert("g").attr("class",n).attr("id",t.domId||t.id),a=1,{cssStyles:l}=t,u=Ae.svg(s),h=De(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=u.circle(0,0,a*2,h),p=s.insert(()=>d,":first-child");return p.attr("class","anchor").attr("style",jr(l)),$e(t,p),t.intersect=function(m){return ue.info("Circle intersect",t,a,m),Se.circle(t,a,m)},s}T(y2,"anchor");function wm(e,t,r,i,n,s,a){const u=(e+r)/2,h=(t+i)/2,d=Math.atan2(i-t,r-e),p=(r-e)/2,m=(i-t)/2,y=p/n,x=m/s,v=Math.sqrt(y**2+x**2);if(v>1)throw new Error("The given radii are too small to create an arc between the points.");const S=Math.sqrt(1-v**2),C=u+S*s*Math.sin(d)*(a?-1:1),B=h-S*n*Math.cos(d)*(a?-1:1),R=Math.atan2((t-B)/s,(e-C)/n);let L=Math.atan2((i-B)/s,(r-C)/n)-R;a&&L<0&&(L+=2*Math.PI),!a&&L>0&&(L-=2*Math.PI);const k=[];for(let A=0;A<20;A++){const z=A/19,U=R+z*L,q=C+n*Math.cos(U),H=B+s*Math.sin(U);k.push({x:q,y:H})}return k}T(wm,"generateArcPoints");async function _2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=s.width+t.padding+20,l=s.height+t.padding,u=l/2,h=u/(2.5+l/50),{cssStyles:d}=t,p=[{x:a/2,y:-l/2},{x:-a/2,y:-l/2},...wm(-a/2,-l/2,-a/2,l/2,h,u,!1),{x:a/2,y:l/2},...wm(a/2,l/2,a/2,-l/2,h,u,!0)],m=Ae.svg(n),y=De(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=tt(p),v=m.path(x,y),S=n.insert(()=>v,":first-child");return S.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(${h/2}, 0)`),$e(t,S),t.intersect=function(C){return Se.polygon(t,p,C)},n}T(_2,"bowTieRect");function Ks(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(n){return n.x+","+n.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}T(Ks,"insertPolygonShape");async function x2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=s.height+t.padding,l=12,u=s.width+t.padding+l,h=0,d=u,p=-a,m=0,y=[{x:h+l,y:p},{x:d,y:p},{x:d,y:m},{x:h,y:m},{x:h,y:p+l},{x:h+l,y:p}];let x;const{cssStyles:v}=t;if(t.look==="handDrawn"){const S=Ae.svg(n),C=De(t,{}),B=tt(y),R=S.path(B,C);x=n.insert(()=>R,":first-child").attr("transform",`translate(${-u/2}, ${a/2})`),v&&x.attr("style",v)}else x=Ks(n,u,a,y);return i&&x.attr("style",i),$e(t,x),t.intersect=function(S){return Se.polygon(t,y,S)},n}T(x2,"card");function v2(e,t){const{nodeStyles:r}=Pe(t);t.label="";const i=e.insert("g").attr("class",Ne(t)).attr("id",t.domId??t.id),{cssStyles:n}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],l=Ae.svg(i),u=De(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=tt(a),d=l.path(h,u),p=i.insert(()=>d,":first-child");return n&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",n),r&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(m){return Se.polygon(t,a,m)},i}T(v2,"choice");async function m0(e,t,r){const{labelStyles:i,nodeStyles:n}=Pe(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:l}=await qe(e,t,Ne(t)),u=(r==null?void 0:r.padding)??l,h=a.width/2+u;let d;const{cssStyles:p}=t;if(t.look==="handDrawn"){const m=Ae.svg(s),y=De(t,{}),x=m.circle(0,0,h*2,y);d=s.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",jr(p))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0);return $e(t,d),t.calcIntersect=function(m,y){const x=m.width/2;return Se.circle(m,x,y)},t.intersect=function(m){return ue.info("Circle intersect",t,h,m),Se.circle(t,h,m)},s}T(m0,"circle");function b2(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,n={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},l={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${l.x},${l.y}
|
|
228
|
+
M ${n.x},${n.y} L ${a.x},${a.y}`}T(b2,"createLine");function S2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r,t.label="";const n=e.insert("g").attr("class",Ne(t)).attr("id",t.domId??t.id),s=Math.max(30,(t==null?void 0:t.width)??0),{cssStyles:a}=t,l=Ae.svg(n),u=De(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const h=l.circle(0,0,s*2,u),d=b2(s),p=l.path(d,u),m=n.insert(()=>h,":first-child");return m.insert(()=>p),a&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",i),$e(t,m),t.intersect=function(y){return ue.info("crossedCircle intersect",t,{radius:s,point:y}),Se.circle(t,s,y)},n}T(S2,"crossedCircle");function Xn(e,t,r,i=100,n=0,s=180){const a=[],l=n*Math.PI/180,d=(s*Math.PI/180-l)/(i-1);for(let p=0;p<i;p++){const m=l+p*d,y=e+r*Math.cos(m),x=t+r*Math.sin(m);a.push({x:-y,y:-x})}return a}T(Xn,"generateCirclePoints");async function w2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=s.width+(t.padding??0),u=s.height+(t.padding??0),h=Math.max(5,u*.1),{cssStyles:d}=t,p=[...Xn(l/2,-u/2,h,30,-90,0),{x:-l/2-h,y:h},...Xn(l/2+h*2,-h,h,20,-180,-270),...Xn(l/2+h*2,h,h,20,-90,-180),{x:-l/2-h,y:-u/2},...Xn(l/2,u/2,h,20,0,90)],m=[{x:l/2,y:-u/2-h},{x:-l/2,y:-u/2-h},...Xn(l/2,-u/2,h,20,-90,0),{x:-l/2-h,y:-h},...Xn(l/2+l*.1,-h,h,20,-180,-270),...Xn(l/2+l*.1,h,h,20,-90,-180),{x:-l/2-h,y:u/2},...Xn(l/2,u/2,h,20,0,90),{x:-l/2,y:u/2+h},{x:l/2,y:u/2+h}],y=Ae.svg(n),x=De(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=tt(p).replace("Z",""),C=y.path(S,x),B=tt(m),R=y.path(B,{...x}),E=n.insert("g",":first-child");return E.insert(()=>R,":first-child").attr("stroke-opacity",0),E.insert(()=>C,":first-child"),E.attr("class","text"),d&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",i),E.attr("transform",`translate(${h}, 0)`),a.attr("transform",`translate(${-l/2+h-(s.x-(s.left??0))},${-u/2+(t.padding??0)/2-(s.y-(s.top??0))})`),$e(t,E),t.intersect=function(L){return Se.polygon(t,m,L)},n}T(w2,"curlyBraceLeft");function Qn(e,t,r,i=100,n=0,s=180){const a=[],l=n*Math.PI/180,d=(s*Math.PI/180-l)/(i-1);for(let p=0;p<i;p++){const m=l+p*d,y=e+r*Math.cos(m),x=t+r*Math.sin(m);a.push({x:y,y:x})}return a}T(Qn,"generateCirclePoints");async function C2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=s.width+(t.padding??0),u=s.height+(t.padding??0),h=Math.max(5,u*.1),{cssStyles:d}=t,p=[...Qn(l/2,-u/2,h,20,-90,0),{x:l/2+h,y:-h},...Qn(l/2+h*2,-h,h,20,-180,-270),...Qn(l/2+h*2,h,h,20,-90,-180),{x:l/2+h,y:u/2},...Qn(l/2,u/2,h,20,0,90)],m=[{x:-l/2,y:-u/2-h},{x:l/2,y:-u/2-h},...Qn(l/2,-u/2,h,20,-90,0),{x:l/2+h,y:-h},...Qn(l/2+h*2,-h,h,20,-180,-270),...Qn(l/2+h*2,h,h,20,-90,-180),{x:l/2+h,y:u/2},...Qn(l/2,u/2,h,20,0,90),{x:l/2,y:u/2+h},{x:-l/2,y:u/2+h}],y=Ae.svg(n),x=De(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=tt(p).replace("Z",""),C=y.path(S,x),B=tt(m),R=y.path(B,{...x}),E=n.insert("g",":first-child");return E.insert(()=>R,":first-child").attr("stroke-opacity",0),E.insert(()=>C,":first-child"),E.attr("class","text"),d&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",i),E.attr("transform",`translate(${-h}, 0)`),a.attr("transform",`translate(${-l/2+(t.padding??0)/2-(s.x-(s.left??0))},${-u/2+(t.padding??0)/2-(s.y-(s.top??0))})`),$e(t,E),t.intersect=function(L){return Se.polygon(t,m,L)},n}T(C2,"curlyBraceRight");function br(e,t,r,i=100,n=0,s=180){const a=[],l=n*Math.PI/180,d=(s*Math.PI/180-l)/(i-1);for(let p=0;p<i;p++){const m=l+p*d,y=e+r*Math.cos(m),x=t+r*Math.sin(m);a.push({x:-y,y:-x})}return a}T(br,"generateCirclePoints");async function k2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=s.width+(t.padding??0),u=s.height+(t.padding??0),h=Math.max(5,u*.1),{cssStyles:d}=t,p=[...br(l/2,-u/2,h,30,-90,0),{x:-l/2-h,y:h},...br(l/2+h*2,-h,h,20,-180,-270),...br(l/2+h*2,h,h,20,-90,-180),{x:-l/2-h,y:-u/2},...br(l/2,u/2,h,20,0,90)],m=[...br(-l/2+h+h/2,-u/2,h,20,-90,-180),{x:l/2-h/2,y:h},...br(-l/2-h/2,-h,h,20,0,90),...br(-l/2-h/2,h,h,20,-90,0),{x:l/2-h/2,y:-h},...br(-l/2+h+h/2,u/2,h,30,-180,-270)],y=[{x:l/2,y:-u/2-h},{x:-l/2,y:-u/2-h},...br(l/2,-u/2,h,20,-90,0),{x:-l/2-h,y:-h},...br(l/2+h*2,-h,h,20,-180,-270),...br(l/2+h*2,h,h,20,-90,-180),{x:-l/2-h,y:u/2},...br(l/2,u/2,h,20,0,90),{x:-l/2,y:u/2+h},{x:l/2-h-h/2,y:u/2+h},...br(-l/2+h+h/2,-u/2,h,20,-90,-180),{x:l/2-h/2,y:h},...br(-l/2-h/2,-h,h,20,0,90),...br(-l/2-h/2,h,h,20,-90,0),{x:l/2-h/2,y:-h},...br(-l/2+h+h/2,u/2,h,30,-180,-270)],x=Ae.svg(n),v=De(t,{fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const C=tt(p).replace("Z",""),B=x.path(C,v),E=tt(m).replace("Z",""),L=x.path(E,v),k=tt(y),A=x.path(k,{...v}),z=n.insert("g",":first-child");return z.insert(()=>A,":first-child").attr("stroke-opacity",0),z.insert(()=>B,":first-child"),z.insert(()=>L,":first-child"),z.attr("class","text"),d&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",d),i&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",i),z.attr("transform",`translate(${h-h/4}, 0)`),a.attr("transform",`translate(${-l/2+(t.padding??0)/2-(s.x-(s.left??0))},${-u/2+(t.padding??0)/2-(s.y-(s.top??0))})`),$e(t,z),t.intersect=function(U){return Se.polygon(t,y,U)},n}T(k2,"curlyBraces");async function T2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=80,l=20,u=Math.max(a,(s.width+(t.padding??0)*2)*1.25,(t==null?void 0:t.width)??0),h=Math.max(l,s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=h/2,{cssStyles:p}=t,m=Ae.svg(n),y=De(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=u,v=h,S=x-d,C=v/4,B=[{x:S,y:0},{x:C,y:0},{x:0,y:v/2},{x:C,y:v},{x:S,y:v},...Mc(-S,-v/2,d,50,270,90)],R=tt(B),E=m.path(R,y),L=n.insert(()=>E,":first-child");return L.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&L.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&L.selectChildren("path").attr("style",i),L.attr("transform",`translate(${-u/2}, ${-h/2})`),$e(t,L),t.intersect=function(k){return Se.polygon(t,B,k)},n}T(T2,"curvedTrapezoid");var dO=T((e,t,r,i,n,s)=>[`M${e},${t+s}`,`a${n},${s} 0,0,0 ${r},0`,`a${n},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),fO=T((e,t,r,i,n,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${n},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),pO=T((e,t,r,i,n,s)=>[`M${e-r/2},${-i/2}`,`a${n},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function E2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+t.padding,t.width??0),u=l/2,h=u/(2.5+l/50),d=Math.max(s.height+h+t.padding,t.height??0);let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=Ae.svg(n),x=fO(0,0,l,d,u,h),v=pO(0,h,l,d,u,h),S=y.path(x,De(t,{})),C=y.path(v,De(t,{fill:"none"}));p=n.insert(()=>C,":first-child"),p=n.insert(()=>S,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const y=dO(0,0,l,d,u,h);p=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",jr(m)).attr("style",i)}return p.attr("label-offset-y",h),p.attr("transform",`translate(${-l/2}, ${-(d/2+h)})`),$e(t,p),a.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+(t.padding??0)/1.5-(s.y-(s.top??0))})`),t.intersect=function(y){const x=Se.rect(t,y),v=x.x-(t.x??0);if(u!=0&&(Math.abs(v)<(t.width??0)/2||Math.abs(v)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-h)){let S=h*h*(1-v*v/(u*u));S>0&&(S=Math.sqrt(S)),S=h-S,y.y-(t.y??0)>0&&(S=-S),x.y+=S}return x},n}T(E2,"cylinder");async function B2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=s.width+t.padding,u=s.height+t.padding,h=u*.2,d=-l/2,p=-u/2-h/2,{cssStyles:m}=t,y=Ae.svg(n),x=De(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const v=[{x:d,y:p+h},{x:-d,y:p+h},{x:-d,y:-p},{x:d,y:-p},{x:d,y:p},{x:-d,y:p},{x:-d,y:p+h}],S=y.polygon(v.map(B=>[B.x,B.y]),x),C=n.insert(()=>S,":first-child");return C.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),a.attr("transform",`translate(${d+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+h+(t.padding??0)/2-(s.y-(s.top??0))})`),$e(t,C),t.intersect=function(B){return Se.rect(t,B)},n}T(B2,"dividedRectangle");async function M2(e,t){var m,y;const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,halfPadding:a}=await qe(e,t,Ne(t)),u=s.width/2+a+5,h=s.width/2+a;let d;const{cssStyles:p}=t;if(t.look==="handDrawn"){const x=Ae.svg(n),v=De(t,{roughness:.2,strokeWidth:2.5}),S=De(t,{roughness:.2,strokeWidth:1.5}),C=x.circle(0,0,u*2,v),B=x.circle(0,0,h*2,S);d=n.insert("g",":first-child"),d.attr("class",jr(t.cssClasses)).attr("style",jr(p)),(m=d.node())==null||m.appendChild(C),(y=d.node())==null||y.appendChild(B)}else{d=n.insert("g",":first-child");const x=d.insert("circle",":first-child"),v=d.insert("circle");d.attr("class","basic label-container").attr("style",i),x.attr("class","outer-circle").attr("style",i).attr("r",u).attr("cx",0).attr("cy",0),v.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return $e(t,d),t.intersect=function(x){return ue.info("DoubleCircle intersect",t,u,x),Se.circle(t,u,x)},n}T(M2,"doublecircle");function L2(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=Pe(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",Ne(t)).attr("id",t.domId??t.id),a=7,{cssStyles:l}=t,u=Ae.svg(s),{nodeBorder:h}=r,d=De(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(d.roughness=0);const p=u.circle(0,0,a*2,d),m=s.insert(()=>p,":first-child");return m.selectAll("path").attr("style",`fill: ${h} !important;`),l&&l.length>0&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",l),n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),$e(t,m),t.intersect=function(y){return ue.info("filledCircle intersect",t,{radius:a,point:y}),Se.circle(t,a,y)},s}T(L2,"filledCircle");async function R2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=s.width+(t.padding??0),u=l+s.height,h=l+s.height,d=[{x:0,y:-u},{x:h,y:-u},{x:h/2,y:0}],{cssStyles:p}=t,m=Ae.svg(n),y=De(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=tt(d),v=m.path(x,y),S=n.insert(()=>v,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`);return p&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",i),t.width=l,t.height=u,$e(t,S),a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-u/2+(t.padding??0)/2+(s.y-(s.top??0))})`),t.intersect=function(C){return ue.info("Triangle intersect",t,d,C),Se.polygon(t,d,C)},n}T(R2,"flippedTriangle");function A2(e,t,{dir:r,config:{state:i,themeVariables:n}}){const{nodeStyles:s}=Pe(t);t.label="";const a=e.insert("g").attr("class",Ne(t)).attr("id",t.domId??t.id),{cssStyles:l}=t;let u=Math.max(70,(t==null?void 0:t.width)??0),h=Math.max(10,(t==null?void 0:t.height)??0);r==="LR"&&(u=Math.max(10,(t==null?void 0:t.width)??0),h=Math.max(70,(t==null?void 0:t.height)??0));const d=-1*u/2,p=-1*h/2,m=Ae.svg(a),y=De(t,{stroke:n.lineColor,fill:n.lineColor});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=m.rectangle(d,p,u,h,y),v=a.insert(()=>x,":first-child");l&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",l),s&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",s),$e(t,v);const S=(i==null?void 0:i.padding)??0;return t.width&&t.height&&(t.width+=S/2||0,t.height+=S/2||0),t.intersect=function(C){return Se.rect(t,C)},a}T(A2,"forkJoin");async function D2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const n=80,s=50,{shapeSvg:a,bbox:l}=await qe(e,t,Ne(t)),u=Math.max(n,l.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(s,l.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=h/2,{cssStyles:p}=t,m=Ae.svg(a),y=De(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-u/2,y:-h/2},{x:u/2-d,y:-h/2},...Mc(-u/2+d,0,d,50,90,270),{x:u/2-d,y:h/2},{x:-u/2,y:h/2}],v=tt(x),S=m.path(v,y),C=a.insert(()=>S,":first-child");return C.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),$e(t,C),t.intersect=function(B){return ue.info("Pill intersect",t,{radius:d,point:B}),Se.polygon(t,x,B)},a}T(D2,"halfRoundedRectangle");async function P2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=s.height+(t.padding??0),l=s.width+(t.padding??0)*2.5,{cssStyles:u}=t,h=Ae.svg(n),d=De(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let p=l/2;const m=p/6;p=p+m;const y=a/2,x=y/2,v=p-x,S=[{x:-v,y:-y},{x:0,y:-y},{x:v,y:-y},{x:p,y:0},{x:v,y},{x:0,y},{x:-v,y},{x:-p,y:0}],C=tt(S),B=h.path(C,d),R=n.insert(()=>B,":first-child");return R.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",i),t.width=l,t.height=a,$e(t,R),t.intersect=function(E){return Se.polygon(t,S,E)},n}T(P2,"hexagon");async function I2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.label="",t.labelStyle=r;const{shapeSvg:n}=await qe(e,t,Ne(t)),s=Math.max(30,(t==null?void 0:t.width)??0),a=Math.max(30,(t==null?void 0:t.height)??0),{cssStyles:l}=t,u=Ae.svg(n),h=De(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const d=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],p=tt(d),m=u.path(p,h),y=n.insert(()=>m,":first-child");return y.attr("class","basic label-container"),l&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",l),i&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),y.attr("transform",`translate(${-s/2}, ${-a/2})`),$e(t,y),t.intersect=function(x){return ue.info("Pill intersect",t,{points:d}),Se.polygon(t,d,x)},n}T(I2,"hourglass");async function $2(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Pe(t);t.labelStyle=n;const s=t.assetHeight??48,a=t.assetWidth??48,l=Math.max(s,a),u=i==null?void 0:i.wrappingWidth;t.width=Math.max(l,u??0);const{shapeSvg:h,bbox:d,label:p}=await qe(e,t,"icon-shape default"),m=t.pos==="t",y=l,x=l,{nodeBorder:v}=r,{stylesMap:S}=qa(t),C=-x/2,B=-y/2,R=t.label?8:0,E=Ae.svg(h),L=De(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const k=E.rectangle(C,B,x,y,L),A=Math.max(x,d.width),z=y+d.height+R,U=E.rectangle(-A/2,-z/2,A,z,{...L,fill:"transparent",stroke:"none"}),q=h.insert(()=>k,":first-child"),H=h.insert(()=>U);if(t.icon){const Y=h.append("g");Y.html(`<g>${await Hc(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);const F=Y.node().getBBox(),O=F.width,$=F.height,j=F.x,W=F.y;Y.attr("transform",`translate(${-O/2-j},${m?d.height/2+R/2-$/2-W:-d.height/2-R/2-$/2-W})`),Y.attr("style",`color: ${S.get("stroke")??v};`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-z/2:z/2-d.height})`),q.attr("transform",`translate(0,${m?d.height/2+R/2:-d.height/2-R/2})`),$e(t,H),t.intersect=function(Y){if(ue.info("iconSquare intersect",t,Y),!t.label)return Se.rect(t,Y);const F=t.x??0,O=t.y??0,$=t.height??0;let j=[];return m?j=[{x:F-d.width/2,y:O-$/2},{x:F+d.width/2,y:O-$/2},{x:F+d.width/2,y:O-$/2+d.height+R},{x:F+x/2,y:O-$/2+d.height+R},{x:F+x/2,y:O+$/2},{x:F-x/2,y:O+$/2},{x:F-x/2,y:O-$/2+d.height+R},{x:F-d.width/2,y:O-$/2+d.height+R}]:j=[{x:F-x/2,y:O-$/2},{x:F+x/2,y:O-$/2},{x:F+x/2,y:O-$/2+y},{x:F+d.width/2,y:O-$/2+y},{x:F+d.width/2/2,y:O+$/2},{x:F-d.width/2,y:O+$/2},{x:F-d.width/2,y:O-$/2+y},{x:F-x/2,y:O-$/2+y}],Se.polygon(t,j,Y)},h}T($2,"icon");async function j2(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Pe(t);t.labelStyle=n;const s=t.assetHeight??48,a=t.assetWidth??48,l=Math.max(s,a),u=i==null?void 0:i.wrappingWidth;t.width=Math.max(l,u??0);const{shapeSvg:h,bbox:d,label:p}=await qe(e,t,"icon-shape default"),m=20,y=t.label?8:0,x=t.pos==="t",{nodeBorder:v,mainBkg:S}=r,{stylesMap:C}=qa(t),B=Ae.svg(h),R=De(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");const E=C.get("fill");R.stroke=E??S;const L=h.append("g");t.icon&&L.html(`<g>${await Hc(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);const k=L.node().getBBox(),A=k.width,z=k.height,U=k.x,q=k.y,H=Math.max(A,z)*Math.SQRT2+m*2,Y=B.circle(0,0,H,R),F=Math.max(H,d.width),O=H+d.height+y,$=B.rectangle(-F/2,-O/2,F,O,{...R,fill:"transparent",stroke:"none"}),j=h.insert(()=>Y,":first-child"),W=h.insert(()=>$);return L.attr("transform",`translate(${-A/2-U},${x?d.height/2+y/2-z/2-q:-d.height/2-y/2-z/2-q})`),L.attr("style",`color: ${C.get("stroke")??v};`),p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${x?-O/2:O/2-d.height})`),j.attr("transform",`translate(0,${x?d.height/2+y/2:-d.height/2-y/2})`),$e(t,W),t.intersect=function(P){return ue.info("iconSquare intersect",t,P),Se.rect(t,P)},h}T(j2,"iconCircle");async function O2(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Pe(t);t.labelStyle=n;const s=t.assetHeight??48,a=t.assetWidth??48,l=Math.max(s,a),u=i==null?void 0:i.wrappingWidth;t.width=Math.max(l,u??0);const{shapeSvg:h,bbox:d,halfPadding:p,label:m}=await qe(e,t,"icon-shape default"),y=t.pos==="t",x=l+p*2,v=l+p*2,{nodeBorder:S,mainBkg:C}=r,{stylesMap:B}=qa(t),R=-v/2,E=-x/2,L=t.label?8:0,k=Ae.svg(h),A=De(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const z=B.get("fill");A.stroke=z??C;const U=k.path(Ys(R,E,v,x,5),A),q=Math.max(v,d.width),H=x+d.height+L,Y=k.rectangle(-q/2,-H/2,q,H,{...A,fill:"transparent",stroke:"none"}),F=h.insert(()=>U,":first-child").attr("class","icon-shape2"),O=h.insert(()=>Y);if(t.icon){const $=h.append("g");$.html(`<g>${await Hc(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);const j=$.node().getBBox(),W=j.width,P=j.height,Z=j.x,ee=j.y;$.attr("transform",`translate(${-W/2-Z},${y?d.height/2+L/2-P/2-ee:-d.height/2-L/2-P/2-ee})`),$.attr("style",`color: ${B.get("stroke")??S};`)}return m.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${y?-H/2:H/2-d.height})`),F.attr("transform",`translate(0,${y?d.height/2+L/2:-d.height/2-L/2})`),$e(t,O),t.intersect=function($){if(ue.info("iconSquare intersect",t,$),!t.label)return Se.rect(t,$);const j=t.x??0,W=t.y??0,P=t.height??0;let Z=[];return y?Z=[{x:j-d.width/2,y:W-P/2},{x:j+d.width/2,y:W-P/2},{x:j+d.width/2,y:W-P/2+d.height+L},{x:j+v/2,y:W-P/2+d.height+L},{x:j+v/2,y:W+P/2},{x:j-v/2,y:W+P/2},{x:j-v/2,y:W-P/2+d.height+L},{x:j-d.width/2,y:W-P/2+d.height+L}]:Z=[{x:j-v/2,y:W-P/2},{x:j+v/2,y:W-P/2},{x:j+v/2,y:W-P/2+x},{x:j+d.width/2,y:W-P/2+x},{x:j+d.width/2/2,y:W+P/2},{x:j-d.width/2,y:W+P/2},{x:j-d.width/2,y:W-P/2+x},{x:j-v/2,y:W-P/2+x}],Se.polygon(t,Z,$)},h}T(O2,"iconRounded");async function z2(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Pe(t);t.labelStyle=n;const s=t.assetHeight??48,a=t.assetWidth??48,l=Math.max(s,a),u=i==null?void 0:i.wrappingWidth;t.width=Math.max(l,u??0);const{shapeSvg:h,bbox:d,halfPadding:p,label:m}=await qe(e,t,"icon-shape default"),y=t.pos==="t",x=l+p*2,v=l+p*2,{nodeBorder:S,mainBkg:C}=r,{stylesMap:B}=qa(t),R=-v/2,E=-x/2,L=t.label?8:0,k=Ae.svg(h),A=De(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const z=B.get("fill");A.stroke=z??C;const U=k.path(Ys(R,E,v,x,.1),A),q=Math.max(v,d.width),H=x+d.height+L,Y=k.rectangle(-q/2,-H/2,q,H,{...A,fill:"transparent",stroke:"none"}),F=h.insert(()=>U,":first-child"),O=h.insert(()=>Y);if(t.icon){const $=h.append("g");$.html(`<g>${await Hc(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);const j=$.node().getBBox(),W=j.width,P=j.height,Z=j.x,ee=j.y;$.attr("transform",`translate(${-W/2-Z},${y?d.height/2+L/2-P/2-ee:-d.height/2-L/2-P/2-ee})`),$.attr("style",`color: ${B.get("stroke")??S};`)}return m.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${y?-H/2:H/2-d.height})`),F.attr("transform",`translate(0,${y?d.height/2+L/2:-d.height/2-L/2})`),$e(t,O),t.intersect=function($){if(ue.info("iconSquare intersect",t,$),!t.label)return Se.rect(t,$);const j=t.x??0,W=t.y??0,P=t.height??0;let Z=[];return y?Z=[{x:j-d.width/2,y:W-P/2},{x:j+d.width/2,y:W-P/2},{x:j+d.width/2,y:W-P/2+d.height+L},{x:j+v/2,y:W-P/2+d.height+L},{x:j+v/2,y:W+P/2},{x:j-v/2,y:W+P/2},{x:j-v/2,y:W-P/2+d.height+L},{x:j-d.width/2,y:W-P/2+d.height+L}]:Z=[{x:j-v/2,y:W-P/2},{x:j+v/2,y:W-P/2},{x:j+v/2,y:W-P/2+x},{x:j+d.width/2,y:W-P/2+x},{x:j+d.width/2/2,y:W+P/2},{x:j-d.width/2,y:W+P/2},{x:j-d.width/2,y:W-P/2+x},{x:j-v/2,y:W-P/2+x}],Se.polygon(t,Z,$)},h}T(z2,"iconSquare");async function F2(e,t,{config:{flowchart:r}}){const i=new Image;i.src=(t==null?void 0:t.img)??"",await i.decode();const n=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=n/s;const{labelStyles:a}=Pe(t);t.labelStyle=a;const l=r==null?void 0:r.wrappingWidth;t.defaultWidth=r==null?void 0:r.wrappingWidth;const u=Math.max(t.label?l??0:0,(t==null?void 0:t.assetWidth)??n),h=t.constraint==="on"&&t!=null&&t.assetHeight?t.assetHeight*t.imageAspectRatio:u,d=t.constraint==="on"?h/t.imageAspectRatio:(t==null?void 0:t.assetHeight)??s;t.width=Math.max(h,l??0);const{shapeSvg:p,bbox:m,label:y}=await qe(e,t,"image-shape default"),x=t.pos==="t",v=-h/2,S=-d/2,C=t.label?8:0,B=Ae.svg(p),R=De(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");const E=B.rectangle(v,S,h,d,R),L=Math.max(h,m.width),k=d+m.height+C,A=B.rectangle(-L/2,-k/2,L,k,{...R,fill:"none",stroke:"none"}),z=p.insert(()=>E,":first-child"),U=p.insert(()=>A);if(t.img){const q=p.append("image");q.attr("href",t.img),q.attr("width",h),q.attr("height",d),q.attr("preserveAspectRatio","none"),q.attr("transform",`translate(${-h/2},${x?k/2-d:-k/2})`)}return y.attr("transform",`translate(${-m.width/2-(m.x-(m.left??0))},${x?-d/2-m.height/2-C/2:d/2-m.height/2+C/2})`),z.attr("transform",`translate(0,${x?m.height/2+C/2:-m.height/2-C/2})`),$e(t,U),t.intersect=function(q){if(ue.info("iconSquare intersect",t,q),!t.label)return Se.rect(t,q);const H=t.x??0,Y=t.y??0,F=t.height??0;let O=[];return x?O=[{x:H-m.width/2,y:Y-F/2},{x:H+m.width/2,y:Y-F/2},{x:H+m.width/2,y:Y-F/2+m.height+C},{x:H+h/2,y:Y-F/2+m.height+C},{x:H+h/2,y:Y+F/2},{x:H-h/2,y:Y+F/2},{x:H-h/2,y:Y-F/2+m.height+C},{x:H-m.width/2,y:Y-F/2+m.height+C}]:O=[{x:H-h/2,y:Y-F/2},{x:H+h/2,y:Y-F/2},{x:H+h/2,y:Y-F/2+d},{x:H+m.width/2,y:Y-F/2+d},{x:H+m.width/2/2,y:Y+F/2},{x:H-m.width/2,y:Y+F/2},{x:H-m.width/2,y:Y-F/2+d},{x:H-h/2,y:Y-F/2+d}],Se.polygon(t,O,q)},p}T(F2,"imageSquare");async function N2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),u=[{x:0,y:0},{x:a,y:0},{x:a+3*l/6,y:-l},{x:-3*l/6,y:-l}];let h;const{cssStyles:d}=t;if(t.look==="handDrawn"){const p=Ae.svg(n),m=De(t,{}),y=tt(u),x=p.path(y,m);h=n.insert(()=>x,":first-child").attr("transform",`translate(${-a/2}, ${l/2})`),d&&h.attr("style",d)}else h=Ks(n,a,l,u);return i&&h.attr("style",i),t.width=a,t.height=l,$e(t,h),t.intersect=function(p){return Se.polygon(t,u,p)},n}T(N2,"inv_trapezoid");async function tf(e,t,r){const{labelStyles:i,nodeStyles:n}=Pe(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await qe(e,t,Ne(t)),l=Math.max(a.width+r.labelPaddingX*2,(t==null?void 0:t.width)||0),u=Math.max(a.height+r.labelPaddingY*2,(t==null?void 0:t.height)||0),h=-l/2,d=-u/2;let p,{rx:m,ry:y}=t;const{cssStyles:x}=t;if(r!=null&&r.rx&&r.ry&&(m=r.rx,y=r.ry),t.look==="handDrawn"){const v=Ae.svg(s),S=De(t,{}),C=m||y?v.path(Ys(h,d,l,u,m||0),S):v.rectangle(h,d,l,u,S);p=s.insert(()=>C,":first-child"),p.attr("class","basic label-container").attr("style",jr(x))}else p=s.insert("rect",":first-child"),p.attr("class","basic label-container").attr("style",n).attr("rx",jr(m)).attr("ry",jr(y)).attr("x",h).attr("y",d).attr("width",l).attr("height",u);return $e(t,p),t.calcIntersect=function(v,S){return Se.rect(v,S)},t.intersect=function(v){return Se.rect(t,v)},s}T(tf,"drawRect");async function W2(e,t){const{shapeSvg:r,bbox:i,label:n}=await qe(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),n.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),$e(t,s),t.intersect=function(u){return Se.rect(t,u)},r}T(W2,"labelRect");async function H2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=Math.max(s.width+(t.padding??0),(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0),(t==null?void 0:t.height)??0),u=[{x:0,y:0},{x:a+3*l/6,y:0},{x:a,y:-l},{x:-(3*l)/6,y:-l}];let h;const{cssStyles:d}=t;if(t.look==="handDrawn"){const p=Ae.svg(n),m=De(t,{}),y=tt(u),x=p.path(y,m);h=n.insert(()=>x,":first-child").attr("transform",`translate(${-a/2}, ${l/2})`),d&&h.attr("style",d)}else h=Ks(n,a,l,u);return i&&h.attr("style",i),t.width=a,t.height=l,$e(t,h),t.intersect=function(p){return Se.polygon(t,u,p)},n}T(H2,"lean_left");async function q2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=Math.max(s.width+(t.padding??0),(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0),(t==null?void 0:t.height)??0),u=[{x:-3*l/6,y:0},{x:a,y:0},{x:a+3*l/6,y:-l},{x:0,y:-l}];let h;const{cssStyles:d}=t;if(t.look==="handDrawn"){const p=Ae.svg(n),m=De(t,{}),y=tt(u),x=p.path(y,m);h=n.insert(()=>x,":first-child").attr("transform",`translate(${-a/2}, ${l/2})`),d&&h.attr("style",d)}else h=Ks(n,a,l,u);return i&&h.attr("style",i),t.width=a,t.height=l,$e(t,h),t.intersect=function(p){return Se.polygon(t,u,p)},n}T(q2,"lean_right");function U2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.label="",t.labelStyle=r;const n=e.insert("g").attr("class",Ne(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,(t==null?void 0:t.width)??0),l=Math.max(35,(t==null?void 0:t.height)??0),u=7,h=[{x:a,y:0},{x:0,y:l+u/2},{x:a-2*u,y:l+u/2},{x:0,y:2*l},{x:a,y:l-u/2},{x:2*u,y:l-u/2}],d=Ae.svg(n),p=De(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=tt(h),y=d.path(m,p),x=n.insert(()=>y,":first-child");return s&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",i),x.attr("transform",`translate(-${a/2},${-l})`),$e(t,x),t.intersect=function(v){return ue.info("lightningBolt intersect",t,v),Se.polygon(t,h,v)},n}T(U2,"lightningBolt");var gO=T((e,t,r,i,n,s,a)=>[`M${e},${t+s}`,`a${n},${s} 0,0,0 ${r},0`,`a${n},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${n},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),mO=T((e,t,r,i,n,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${n},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${n},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),yO=T((e,t,r,i,n,s)=>[`M${e-r/2},${-i/2}`,`a${n},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function V2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+(t.padding??0),t.width??0),u=l/2,h=u/(2.5+l/50),d=Math.max(s.height+h+(t.padding??0),t.height??0),p=d*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=Ae.svg(n),v=mO(0,0,l,d,u,h,p),S=yO(0,h,l,d,u,h),C=De(t,{}),B=x.path(v,C),R=x.path(S,C);n.insert(()=>R,":first-child").attr("class","line"),m=n.insert(()=>B,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=gO(0,0,l,d,u,h,p);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",jr(y)).attr("style",i)}return m.attr("label-offset-y",h),m.attr("transform",`translate(${-l/2}, ${-(d/2+h)})`),$e(t,m),a.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${-(s.height/2)+h-(s.y-(s.top??0))})`),t.intersect=function(x){const v=Se.rect(t,x),S=v.x-(t.x??0);if(u!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(v.y-(t.y??0))>(t.height??0)/2-h)){let C=h*h*(1-S*S/(u*u));C>0&&(C=Math.sqrt(C)),C=h-C,x.y-(t.y??0)>0&&(C=-C),v.y+=C}return v},n}T(V2,"linedCylinder");async function G2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=u/4,d=u+h,{cssStyles:p}=t,m=Ae.svg(n),y=De(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-l/2-l/2*.1,y:-d/2},{x:-l/2-l/2*.1,y:d/2},...Us(-l/2-l/2*.1,d/2,l/2+l/2*.1,d/2,h,.8),{x:l/2+l/2*.1,y:-d/2},{x:-l/2-l/2*.1,y:-d/2},{x:-l/2,y:-d/2},{x:-l/2,y:d/2*1.1},{x:-l/2,y:-d/2}],v=m.polygon(x.map(C=>[C.x,C.y]),y),S=n.insert(()=>v,":first-child");return S.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(0,${-h/2})`),a.attr("transform",`translate(${-l/2+(t.padding??0)+l/2*.1/2-(s.x-(s.left??0))},${-u/2+(t.padding??0)-h/2-(s.y-(s.top??0))})`),$e(t,S),t.intersect=function(C){return Se.polygon(t,x,C)},n}T(G2,"linedWaveEdgedRect");async function Y2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=5,d=-l/2,p=-u/2,{cssStyles:m}=t,y=Ae.svg(n),x=De(t,{}),v=[{x:d-h,y:p+h},{x:d-h,y:p+u+h},{x:d+l-h,y:p+u+h},{x:d+l-h,y:p+u},{x:d+l,y:p+u},{x:d+l,y:p+u-h},{x:d+l+h,y:p+u-h},{x:d+l+h,y:p-h},{x:d+h,y:p-h},{x:d+h,y:p},{x:d,y:p},{x:d,y:p+h}],S=[{x:d,y:p+h},{x:d+l-h,y:p+h},{x:d+l-h,y:p+u},{x:d+l,y:p+u},{x:d+l,y:p},{x:d,y:p}];t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=tt(v),B=y.path(C,x),R=tt(S),E=y.path(R,{...x,fill:"none"}),L=n.insert(()=>E,":first-child");return L.insert(()=>B,":first-child"),L.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),a.attr("transform",`translate(${-(s.width/2)-h-(s.x-(s.left??0))}, ${-(s.height/2)+h-(s.y-(s.top??0))})`),$e(t,L),t.intersect=function(k){return Se.polygon(t,v,k)},n}T(Y2,"multiRect");async function K2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=u/4,d=u+h,p=-l/2,m=-d/2,y=5,{cssStyles:x}=t,v=Us(p-y,m+d+y,p+l-y,m+d+y,h,.8),S=v==null?void 0:v[v.length-1],C=[{x:p-y,y:m+y},{x:p-y,y:m+d+y},...v,{x:p+l-y,y:S.y-y},{x:p+l,y:S.y-y},{x:p+l,y:S.y-2*y},{x:p+l+y,y:S.y-2*y},{x:p+l+y,y:m-y},{x:p+y,y:m-y},{x:p+y,y:m},{x:p,y:m},{x:p,y:m+y}],B=[{x:p,y:m+y},{x:p+l-y,y:m+y},{x:p+l-y,y:S.y-y},{x:p+l,y:S.y-y},{x:p+l,y:m},{x:p,y:m}],R=Ae.svg(n),E=De(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const L=tt(C),k=R.path(L,E),A=tt(B),z=R.path(A,E),U=n.insert(()=>k,":first-child");return U.insert(()=>z),U.attr("class","basic label-container"),x&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",i),U.attr("transform",`translate(0,${-h/2})`),a.attr("transform",`translate(${-(s.width/2)-y-(s.x-(s.left??0))}, ${-(s.height/2)+y-h/2-(s.y-(s.top??0))})`),$e(t,U),t.intersect=function(q){return Se.polygon(t,C,q)},n}T(K2,"multiWaveEdgedRectangle");async function X2(e,t,{config:{themeVariables:r}}){var B;const{labelStyles:i,nodeStyles:n}=Pe(t);t.labelStyle=i,t.useHtmlLabels||((B=Ir().flowchart)==null?void 0:B.htmlLabels)!==!1||(t.centerLabel=!0);const{shapeSvg:a,bbox:l,label:u}=await qe(e,t,Ne(t)),h=Math.max(l.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),d=Math.max(l.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),p=-h/2,m=-d/2,{cssStyles:y}=t,x=Ae.svg(a),v=De(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const S=x.rectangle(p,m,h,d,v),C=a.insert(()=>S,":first-child");return C.attr("class","basic label-container"),y&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",y),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),$e(t,C),t.intersect=function(R){return Se.rect(t,R)},a}T(X2,"note");var _O=T((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Q2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=s.width+t.padding,l=s.height+t.padding,u=a+l,h=.5,d=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}];let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=Ae.svg(n),x=De(t,{}),v=_O(0,0,u),S=y.path(v,x);p=n.insert(()=>S,":first-child").attr("transform",`translate(${-u/2+h}, ${u/2})`),m&&p.attr("style",m)}else p=Ks(n,u,u,d),p.attr("transform",`translate(${-u/2+h}, ${u/2})`);return i&&p.attr("style",i),$e(t,p),t.calcIntersect=function(y,x){const v=y.width,S=[{x:v/2,y:0},{x:v,y:-v/2},{x:v/2,y:-v},{x:0,y:-v/2}],C=Se.polygon(y,S,x);return{x:C.x-.5,y:C.y-.5}},t.intersect=function(y){return this.calcIntersect(t,y)},n}T(Q2,"question");async function Z2(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+(t.padding??0),(t==null?void 0:t.width)??0),u=Math.max(s.height+(t.padding??0),(t==null?void 0:t.height)??0),h=-l/2,d=-u/2,p=d/2,m=[{x:h+p,y:d},{x:h,y:0},{x:h+p,y:-d},{x:-h,y:-d},{x:-h,y:d}],{cssStyles:y}=t,x=Ae.svg(n),v=De(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const S=tt(m),C=x.path(S,v),B=n.insert(()=>C,":first-child");return B.attr("class","basic label-container"),y&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${-p/2},0)`),a.attr("transform",`translate(${-p/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),$e(t,B),t.intersect=function(R){return Se.polygon(t,m,R)},n}T(Z2,"rect_left_inv_arrow");async function J2(e,t){var z,U;const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;let n;t.cssClasses?n="node "+t.cssClasses:n="node default";const s=e.insert("g").attr("class",n).attr("id",t.domId||t.id),a=s.insert("g"),l=s.insert("g").attr("class","label").attr("style",i),u=t.description,h=t.label,d=l.node().appendChild(await To(h,t.labelStyle,!0,!0));let p={width:0,height:0};if(ar((U=(z=ft())==null?void 0:z.flowchart)==null?void 0:U.htmlLabels)){const q=d.children[0],H=it(d);p=q.getBoundingClientRect(),H.attr("width",p.width),H.attr("height",p.height)}ue.info("Text 2",u);const m=u||[],y=d.getBBox(),x=l.node().appendChild(await To(m.join?m.join("<br/>"):m,t.labelStyle,!0,!0)),v=x.children[0],S=it(x);p=v.getBoundingClientRect(),S.attr("width",p.width),S.attr("height",p.height);const C=(t.padding||0)/2;it(x).attr("transform","translate( "+(p.width>y.width?0:(y.width-p.width)/2)+", "+(y.height+C+5)+")"),it(d).attr("transform","translate( "+(p.width<y.width?0:-(y.width-p.width)/2)+", 0)"),p=l.node().getBBox(),l.attr("transform","translate("+-p.width/2+", "+(-p.height/2-C+3)+")");const B=p.width+(t.padding||0),R=p.height+(t.padding||0),E=-p.width/2-C,L=-p.height/2-C;let k,A;if(t.look==="handDrawn"){const q=Ae.svg(s),H=De(t,{}),Y=q.path(Ys(E,L,B,R,t.rx||0),H),F=q.line(-p.width/2-C,-p.height/2-C+y.height+C,p.width/2+C,-p.height/2-C+y.height+C,H);A=s.insert(()=>(ue.debug("Rough node insert CXC",Y),F),":first-child"),k=s.insert(()=>(ue.debug("Rough node insert CXC",Y),Y),":first-child")}else k=a.insert("rect",":first-child"),A=a.insert("line"),k.attr("class","outer title-state").attr("style",i).attr("x",-p.width/2-C).attr("y",-p.height/2-C).attr("width",p.width+(t.padding||0)).attr("height",p.height+(t.padding||0)),A.attr("class","divider").attr("x1",-p.width/2-C).attr("x2",p.width/2+C).attr("y1",-p.height/2-C+y.height+C).attr("y2",-p.height/2-C+y.height+C);return $e(t,k),t.intersect=function(q){return Se.rect(t,q)},s}T(J2,"rectWithTitle");function nc(e,t,r,i,n,s,a){const u=(e+r)/2,h=(t+i)/2,d=Math.atan2(i-t,r-e),p=(r-e)/2,m=(i-t)/2,y=p/n,x=m/s,v=Math.sqrt(y**2+x**2);if(v>1)throw new Error("The given radii are too small to create an arc between the points.");const S=Math.sqrt(1-v**2),C=u+S*s*Math.sin(d)*(a?-1:1),B=h-S*n*Math.cos(d)*(a?-1:1),R=Math.atan2((t-B)/s,(e-C)/n);let L=Math.atan2((i-B)/s,(r-C)/n)-R;a&&L<0&&(L+=2*Math.PI),!a&&L>0&&(L-=2*Math.PI);const k=[];for(let A=0;A<20;A++){const z=A/19,U=R+z*L,q=C+n*Math.cos(U),H=B+s*Math.sin(U);k.push({x:q,y:H})}return k}T(nc,"generateArcPoints");async function eT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=(t==null?void 0:t.padding)??0,l=(t==null?void 0:t.padding)??0,u=(t!=null&&t.width?t==null?void 0:t.width:s.width)+a*2,h=(t!=null&&t.height?t==null?void 0:t.height:s.height)+l*2,d=t.radius||5,p=t.taper||5,{cssStyles:m}=t,y=Ae.svg(n),x=De(t,{});t.stroke&&(x.stroke=t.stroke),t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const v=[{x:-u/2+p,y:-h/2},{x:u/2-p,y:-h/2},...nc(u/2-p,-h/2,u/2,-h/2+p,d,d,!0),{x:u/2,y:-h/2+p},{x:u/2,y:h/2-p},...nc(u/2,h/2-p,u/2-p,h/2,d,d,!0),{x:u/2-p,y:h/2},{x:-u/2+p,y:h/2},...nc(-u/2+p,h/2,-u/2,h/2-p,d,d,!0),{x:-u/2,y:h/2-p},{x:-u/2,y:-h/2+p},...nc(-u/2,-h/2+p,-u/2+p,-h/2,d,d,!0)],S=tt(v),C=y.path(S,x),B=n.insert(()=>C,":first-child");return B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),$e(t,B),t.intersect=function(R){return Se.polygon(t,v,R)},n}T(eT,"roundedRect");async function tT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=(t==null?void 0:t.padding)??0,u=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=-s.width/2-l,p=-s.height/2-l,{cssStyles:m}=t,y=Ae.svg(n),x=De(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const v=[{x:d,y:p},{x:d+u+8,y:p},{x:d+u+8,y:p+h},{x:d-8,y:p+h},{x:d-8,y:p},{x:d,y:p},{x:d,y:p+h}],S=y.polygon(v.map(B=>[B.x,B.y]),x),C=n.insert(()=>S,":first-child");return C.attr("class","basic label-container").attr("style",jr(m)),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),a.attr("transform",`translate(${-u/2+4+(t.padding??0)-(s.x-(s.left??0))},${-h/2+(t.padding??0)-(s.y-(s.top??0))})`),$e(t,C),t.intersect=function(B){return Se.rect(t,B)},n}T(tT,"shadedProcess");async function rT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=-l/2,d=-u/2,{cssStyles:p}=t,m=Ae.svg(n),y=De(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:h,y:d},{x:h,y:d+u},{x:h+l,y:d+u},{x:h+l,y:d-u/2}],v=tt(x),S=m.path(v,y),C=n.insert(()=>S,":first-child");return C.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),C.attr("transform",`translate(0, ${u/4})`),a.attr("transform",`translate(${-l/2+(t.padding??0)-(s.x-(s.left??0))}, ${-u/4+(t.padding??0)-(s.y-(s.top??0))})`),$e(t,C),t.intersect=function(B){return Se.polygon(t,x,B)},n}T(rT,"slopedRect");async function iT(e,t){const r={rx:0,ry:0,labelPaddingX:t.labelPaddingX??((t==null?void 0:t.padding)||0)*2,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return tf(e,t,r)}T(iT,"squareRect");async function nT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=s.height+t.padding,l=s.width+a/4+t.padding,u=a/2,{cssStyles:h}=t,d=Ae.svg(n),p=De(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:-l/2+u,y:-a/2},{x:l/2-u,y:-a/2},...Mc(-l/2+u,0,u,50,90,270),{x:l/2-u,y:a/2},...Mc(l/2-u,0,u,50,270,450)],y=tt(m),x=d.path(y,p),v=n.insert(()=>x,":first-child");return v.attr("class","basic label-container outer-path"),h&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",h),i&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",i),$e(t,v),t.intersect=function(S){return Se.polygon(t,m,S)},n}T(nT,"stadium");async function sT(e,t){return tf(e,t,{rx:5,ry:5})}T(sT,"state");function oT(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=Pe(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:l,nodeBorder:u}=r,h=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),d=Ae.svg(h),p=De(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=d.circle(0,0,14,{...p,stroke:a,strokeWidth:2}),y=l??u,x=d.circle(0,0,5,{...p,fill:y,stroke:y,strokeWidth:2,fillStyle:"solid"}),v=h.insert(()=>m,":first-child");return v.insert(()=>x),s&&v.selectAll("path").attr("style",s),n&&v.selectAll("path").attr("style",n),$e(t,v),t.intersect=function(S){return Se.circle(t,7,S)},h}T(oT,"stateEnd");function aT(e,t,{config:{themeVariables:r}}){const{lineColor:i}=r,n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let s;if(t.look==="handDrawn"){const l=Ae.svg(n).circle(0,0,14,mI(i));s=n.insert(()=>l),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else s=n.insert("circle",":first-child"),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return $e(t,s),t.intersect=function(a){return Se.circle(t,7,a)},n}T(aT,"stateStart");async function lT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=((t==null?void 0:t.padding)||0)/2,l=s.width+t.padding,u=s.height+t.padding,h=-s.width/2-a,d=-s.height/2-a,p=[{x:0,y:0},{x:l,y:0},{x:l,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const m=Ae.svg(n),y=De(t,{}),x=m.rectangle(h-8,d,l+16,u,y),v=m.line(h,d,h,d+u,y),S=m.line(h+l,d,h+l,d+u,y);n.insert(()=>v,":first-child"),n.insert(()=>S,":first-child");const C=n.insert(()=>x,":first-child"),{cssStyles:B}=t;C.attr("class","basic label-container").attr("style",jr(B)),$e(t,C)}else{const m=Ks(n,l,u,p);i&&m.attr("style",i),$e(t,m)}return t.intersect=function(m){return Se.polygon(t,p,m)},n}T(lT,"subroutine");async function cT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),u=-a/2,h=-l/2,d=.2*l,p=.2*l,{cssStyles:m}=t,y=Ae.svg(n),x=De(t,{}),v=[{x:u-d/2,y:h},{x:u+a+d/2,y:h},{x:u+a+d/2,y:h+l},{x:u-d/2,y:h+l}],S=[{x:u+a-d/2,y:h+l},{x:u+a+d/2,y:h+l},{x:u+a+d/2,y:h+l-p}];t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=tt(v),B=y.path(C,x),R=tt(S),E=y.path(R,{...x,fillStyle:"solid"}),L=n.insert(()=>E,":first-child");return L.insert(()=>B,":first-child"),L.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),$e(t,L),t.intersect=function(k){return Se.polygon(t,v,k)},n}T(cT,"taggedRect");async function hT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=u/4,d=.2*l,p=.2*u,m=u+h,{cssStyles:y}=t,x=Ae.svg(n),v=De(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const S=[{x:-l/2-l/2*.1,y:m/2},...Us(-l/2-l/2*.1,m/2,l/2+l/2*.1,m/2,h,.8),{x:l/2+l/2*.1,y:-m/2},{x:-l/2-l/2*.1,y:-m/2}],C=-l/2+l/2*.1,B=-m/2-p*.4,R=[{x:C+l-d,y:(B+u)*1.4},{x:C+l,y:B+u-p},{x:C+l,y:(B+u)*.9},...Us(C+l,(B+u)*1.3,C+l-d,(B+u)*1.5,-u*.03,.5)],E=tt(S),L=x.path(E,v),k=tt(R),A=x.path(k,{...v,fillStyle:"solid"}),z=n.insert(()=>A,":first-child");return z.insert(()=>L,":first-child"),z.attr("class","basic label-container"),y&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",i),z.attr("transform",`translate(0,${-h/2})`),a.attr("transform",`translate(${-l/2+(t.padding??0)-(s.x-(s.left??0))},${-u/2+(t.padding??0)-h/2-(s.y-(s.top??0))})`),$e(t,z),t.intersect=function(U){return Se.polygon(t,S,U)},n}T(hT,"taggedWaveEdgedRectangle");async function uT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=Math.max(s.width+t.padding,(t==null?void 0:t.width)||0),l=Math.max(s.height+t.padding,(t==null?void 0:t.height)||0),u=-a/2,h=-l/2,d=n.insert("rect",":first-child");return d.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",u).attr("y",h).attr("width",a).attr("height",l),$e(t,d),t.intersect=function(p){return Se.rect(t,p)},n}T(uT,"text");var xO=T((e,t,r,i,n,s)=>`M${e},${t}
|
|
229
|
+
a${n},${s} 0,0,1 0,${-i}
|
|
230
|
+
l${r},0
|
|
231
|
+
a${n},${s} 0,0,1 0,${i}
|
|
232
|
+
M${r},${-i}
|
|
233
|
+
a${n},${s} 0,0,0 0,${i}
|
|
234
|
+
l${-r},0`,"createCylinderPathD"),vO=T((e,t,r,i,n,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${n},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${n},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),bO=T((e,t,r,i,n,s)=>[`M${e+r/2},${-i/2}`,`a${n},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD");async function dT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a,halfPadding:l}=await qe(e,t,Ne(t)),u=t.look==="neo"?l*2:l,h=s.height+u,d=h/2,p=d/(2.5+h/50),m=s.width+p+u,{cssStyles:y}=t;let x;if(t.look==="handDrawn"){const v=Ae.svg(n),S=vO(0,0,m,h,p,d),C=bO(0,0,m,h,p,d),B=v.path(S,De(t,{})),R=v.path(C,De(t,{fill:"none"}));x=n.insert(()=>R,":first-child"),x=n.insert(()=>B,":first-child"),x.attr("class","basic label-container"),y&&x.attr("style",y)}else{const v=xO(0,0,m,h,p,d);x=n.insert("path",":first-child").attr("d",v).attr("class","basic label-container").attr("style",jr(y)).attr("style",i),x.attr("class","basic label-container"),y&&x.selectAll("path").attr("style",y),i&&x.selectAll("path").attr("style",i)}return x.attr("label-offset-x",p),x.attr("transform",`translate(${-m/2}, ${h/2} )`),a.attr("transform",`translate(${-(s.width/2)-p-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),$e(t,x),t.intersect=function(v){const S=Se.rect(t,v),C=S.y-(t.y??0);if(d!=0&&(Math.abs(C)<(t.height??0)/2||Math.abs(C)==(t.height??0)/2&&Math.abs(S.x-(t.x??0))>(t.width??0)/2-p)){let B=p*p*(1-C*C/(d*d));B!=0&&(B=Math.sqrt(Math.abs(B))),B=p-B,v.x-(t.x??0)>0&&(B=-B),S.x+=B}return S},n}T(dT,"tiltedCylinder");async function fT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=s.width+t.padding,l=s.height+t.padding,u=[{x:-3*l/6,y:0},{x:a+3*l/6,y:0},{x:a,y:-l},{x:0,y:-l}];let h;const{cssStyles:d}=t;if(t.look==="handDrawn"){const p=Ae.svg(n),m=De(t,{}),y=tt(u),x=p.path(y,m);h=n.insert(()=>x,":first-child").attr("transform",`translate(${-a/2}, ${l/2})`),d&&h.attr("style",d)}else h=Ks(n,a,l,u);return i&&h.attr("style",i),t.width=a,t.height=l,$e(t,h),t.intersect=function(p){return Se.polygon(t,u,p)},n}T(fT,"trapezoid");async function pT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=60,l=20,u=Math.max(a,s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(l,s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),{cssStyles:d}=t,p=Ae.svg(n),m=De(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-u/2*.8,y:-h/2},{x:u/2*.8,y:-h/2},{x:u/2,y:-h/2*.6},{x:u/2,y:h/2},{x:-u/2,y:h/2},{x:-u/2,y:-h/2*.6}],x=tt(y),v=p.path(x,m),S=n.insert(()=>v,":first-child");return S.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",d),i&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",i),$e(t,S),t.intersect=function(C){return Se.polygon(t,y,C)},n}T(pT,"trapezoidalPentagon");async function gT(e,t){var B;const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=ar((B=ft().flowchart)==null?void 0:B.htmlLabels),u=s.width+(t.padding??0),h=u+s.height,d=u+s.height,p=[{x:0,y:0},{x:d,y:0},{x:d/2,y:-h}],{cssStyles:m}=t,y=Ae.svg(n),x=De(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const v=tt(p),S=y.path(v,x),C=n.insert(()=>S,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`);return m&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=u,t.height=h,$e(t,C),a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${h/2-(s.height+(t.padding??0)/(l?2:1)-(s.y-(s.top??0)))})`),t.intersect=function(R){return ue.info("Triangle intersect",t,p,R),Se.polygon(t,p,R)},n}T(gT,"triangle");async function mT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=u/8,d=u+h,{cssStyles:p}=t,y=70-l,x=y>0?y/2:0,v=Ae.svg(n),S=De(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const C=[{x:-l/2-x,y:d/2},...Us(-l/2-x,d/2,l/2+x,d/2,h,.8),{x:l/2+x,y:-d/2},{x:-l/2-x,y:-d/2}],B=tt(C),R=v.path(B,S),E=n.insert(()=>R,":first-child");return E.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",i),E.attr("transform",`translate(0,${-h/2})`),a.attr("transform",`translate(${-l/2+(t.padding??0)-(s.x-(s.left??0))},${-u/2+(t.padding??0)-h-(s.y-(s.top??0))})`),$e(t,E),t.intersect=function(L){return Se.polygon(t,C,L)},n}T(mT,"waveEdgedRectangle");async function yT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s}=await qe(e,t,Ne(t)),a=100,l=50,u=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=u/h;let p=u,m=h;p>m*d?m=p/d:p=m*d,p=Math.max(p,a),m=Math.max(m,l);const y=Math.min(m*.2,m/4),x=m+y*2,{cssStyles:v}=t,S=Ae.svg(n),C=De(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const B=[{x:-p/2,y:x/2},...Us(-p/2,x/2,p/2,x/2,y,1),{x:p/2,y:-x/2},...Us(p/2,-x/2,-p/2,-x/2,y,-1)],R=tt(B),E=S.path(R,C),L=n.insert(()=>E,":first-child");return L.attr("class","basic label-container"),v&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",v),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),$e(t,L),t.intersect=function(k){return Se.polygon(t,B,k)},n}T(yT,"waveRectangle");async function _T(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await qe(e,t,Ne(t)),l=Math.max(s.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),u=Math.max(s.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=5,d=-l/2,p=-u/2,{cssStyles:m}=t,y=Ae.svg(n),x=De(t,{}),v=[{x:d-h,y:p-h},{x:d-h,y:p+u},{x:d+l,y:p+u},{x:d+l,y:p-h}],S=`M${d-h},${p-h} L${d+l},${p-h} L${d+l},${p+u} L${d-h},${p+u} L${d-h},${p-h}
|
|
235
|
+
M${d-h},${p} L${d+l},${p}
|
|
236
|
+
M${d},${p-h} L${d},${p+u}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=y.path(S,x),B=n.insert(()=>C,":first-child");return B.attr("transform",`translate(${h/2}, ${h/2})`),B.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),a.attr("transform",`translate(${-(s.width/2)+h/2-(s.x-(s.left??0))}, ${-(s.height/2)+h/2-(s.y-(s.top??0))})`),$e(t,B),t.intersect=function(R){return Se.polygon(t,v,R)},n}T(_T,"windowPane");async function y0(e,t){var Q,te,X,ce;const r=t;if(r.alias&&(t.label=r.alias),t.look==="handDrawn"){const{themeVariables:oe}=Ir(),{background:ye}=oe,ve={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ye}`]};await y0(e,ve)}const i=Ir();t.useHtmlLabels=i.htmlLabels;let n=((Q=i.er)==null?void 0:Q.diagramPadding)??10,s=((te=i.er)==null?void 0:te.entityPadding)??6;const{cssStyles:a}=t,{labelStyles:l,nodeStyles:u}=Pe(t);if(r.attributes.length===0&&t.label){const oe={rx:0,ry:0,labelPaddingX:n,labelPaddingY:n*1.5};rs(t.label,i)+oe.labelPaddingX*2<i.er.minEntityWidth&&(t.width=i.er.minEntityWidth);const ye=await tf(e,t,oe);if(!ar(i.htmlLabels)){const ve=ye.select("text"),Ce=(X=ve.node())==null?void 0:X.getBBox();ve.attr("transform",`translate(${-Ce.width/2}, 0)`)}return ye}i.htmlLabels||(n*=1.25,s*=1.25);let h=Ne(t);h||(h="node default");const d=e.insert("g").attr("class",h).attr("id",t.domId||t.id),p=await va(d,t.label??"",i,0,0,["name"],l);p.height+=s;let m=0;const y=[],x=[];let v=0,S=0,C=0,B=0,R=!0,E=!0;for(const oe of r.attributes){const ye=await va(d,oe.type,i,0,m,["attribute-type"],l);v=Math.max(v,ye.width+n);const ve=await va(d,oe.name,i,0,m,["attribute-name"],l);S=Math.max(S,ve.width+n);const Ce=await va(d,oe.keys.join(),i,0,m,["attribute-keys"],l);C=Math.max(C,Ce.width+n);const Ee=await va(d,oe.comment,i,0,m,["attribute-comment"],l);B=Math.max(B,Ee.width+n);const Ke=Math.max(ye.height,ve.height,Ce.height,Ee.height)+s;x.push({yOffset:m,rowHeight:Ke}),m+=Ke}let L=4;C<=n&&(R=!1,C=0,L--),B<=n&&(E=!1,B=0,L--);const k=d.node().getBBox();if(p.width+n*2-(v+S+C+B)>0){const oe=p.width+n*2-(v+S+C+B);v+=oe/L,S+=oe/L,C>0&&(C+=oe/L),B>0&&(B+=oe/L)}const A=v+S+C+B,z=Ae.svg(d),U=De(t,{});t.look!=="handDrawn"&&(U.roughness=0,U.fillStyle="solid");let q=0;x.length>0&&(q=x.reduce((oe,ye)=>oe+((ye==null?void 0:ye.rowHeight)??0),0));const H=Math.max(k.width+n*2,(t==null?void 0:t.width)||0,A),Y=Math.max((q??0)+p.height,(t==null?void 0:t.height)||0),F=-H/2,O=-Y/2;d.selectAll("g:not(:first-child)").each((oe,ye,ve)=>{const Ce=it(ve[ye]),Ee=Ce.attr("transform");let Ke=0,ct=0;if(Ee){const pt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Ee);pt&&(Ke=parseFloat(pt[1]),ct=parseFloat(pt[2]),Ce.attr("class").includes("attribute-name")?Ke+=v:Ce.attr("class").includes("attribute-keys")?Ke+=v+S:Ce.attr("class").includes("attribute-comment")&&(Ke+=v+S+C))}Ce.attr("transform",`translate(${F+n/2+Ke}, ${ct+O+p.height+s/2})`)}),d.select(".name").attr("transform","translate("+-p.width/2+", "+(O+s/2)+")");const $=z.rectangle(F,O,H,Y,U),j=d.insert(()=>$,":first-child").attr("style",a.join("")),{themeVariables:W}=Ir(),{rowEven:P,rowOdd:Z,nodeBorder:ee}=W;y.push(0);for(const[oe,ye]of x.entries()){const Ce=(oe+1)%2===0&&ye.yOffset!==0,Ee=z.rectangle(F,p.height+O+(ye==null?void 0:ye.yOffset),H,ye==null?void 0:ye.rowHeight,{...U,fill:Ce?P:Z,stroke:ee});d.insert(()=>Ee,"g.label").attr("style",a.join("")).attr("class",`row-rect-${Ce?"even":"odd"}`)}let I=z.line(F,p.height+O,H+F,p.height+O,U);d.insert(()=>I).attr("class","divider"),I=z.line(v+F,p.height+O,v+F,Y+O,U),d.insert(()=>I).attr("class","divider"),R&&(I=z.line(v+S+F,p.height+O,v+S+F,Y+O,U),d.insert(()=>I).attr("class","divider")),E&&(I=z.line(v+S+C+F,p.height+O,v+S+C+F,Y+O,U),d.insert(()=>I).attr("class","divider"));for(const oe of y)I=z.line(F,p.height+O+oe,H+F,p.height+O+oe,U),d.insert(()=>I).attr("class","divider");if($e(t,j),u&&t.look!=="handDrawn"){const oe=u.split(";"),ye=(ce=oe==null?void 0:oe.filter(ve=>ve.includes("stroke")))==null?void 0:ce.map(ve=>`${ve}`).join("; ");d.selectAll("path").attr("style",ye??""),d.selectAll(".row-rect-even path").attr("style",u)}return t.intersect=function(oe){return Se.rect(t,oe)},d}T(y0,"erBox");async function va(e,t,r,i=0,n=0,s=[],a=""){const l=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${n})`).attr("style",a);t!==Pv(t)&&(t=Pv(t),t=t.replaceAll("<","<").replaceAll(">",">"));const u=l.node().appendChild(await Gs(l,t,{width:rs(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let d=u.children[0];for(d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">");d.childNodes[0];)d=d.childNodes[0],d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">")}let h=u.getBBox();if(ar(r.htmlLabels)){const d=u.children[0];d.style.textAlign="start";const p=it(u);h=d.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}return h}T(va,"addText");async function xT(e,t,r,i,n=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",Ne(t)).attr("id",t.domId||t.id);let l=null,u=null,h=null,d=null,p=0,m=0,y=0;if(l=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const B=t.annotations[0];await sc(l,{text:`«${B}»`},0),p=l.node().getBBox().height}u=a.insert("g").attr("class","label-group text"),await sc(u,t,0,["font-weight: bolder"]);const x=u.node().getBBox();m=x.height,h=a.insert("g").attr("class","members-group text");let v=0;for(const B of t.members){const R=await sc(h,B,v,[B.parseClassifier()]);v+=R+s}y=h.node().getBBox().height,y<=0&&(y=n/2),d=a.insert("g").attr("class","methods-group text");let S=0;for(const B of t.methods){const R=await sc(d,B,S,[B.parseClassifier()]);S+=R+s}let C=a.node().getBBox();if(l!==null){const B=l.node().getBBox();l.attr("transform",`translate(${-B.width/2})`)}return u.attr("transform",`translate(${-x.width/2}, ${p})`),C=a.node().getBBox(),h.attr("transform",`translate(0, ${p+m+n*2})`),C=a.node().getBBox(),d.attr("transform",`translate(0, ${p+m+(y?y+n*4:n*2)})`),C=a.node().getBBox(),{shapeSvg:a,bbox:C}}T(xT,"textHelper");async function sc(e,t,r,i=[]){const n=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Ir();let a="useHtmlLabels"in t?t.useHtmlLabels:ar(s.htmlLabels)??!0,l="";"text"in t?l=t.text:l=t.label,!a&&l.startsWith("\\")&&(l=l.substring(1)),Ia(l)&&(a=!0);const u=await Gs(n,$y(qo(l)),{width:rs(l,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let h,d=1;if(a){const p=u.children[0],m=it(u);d=p.innerHTML.split("<br>").length,p.innerHTML.includes("</math>")&&(d+=p.innerHTML.split("<mrow>").length-1);const y=p.getElementsByTagName("img");if(y){const x=l.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...y].map(v=>new Promise(S=>{function C(){var B;if(v.style.display="flex",v.style.flexDirection="column",x){const R=((B=s.fontSize)==null?void 0:B.toString())??window.getComputedStyle(document.body).fontSize,L=parseInt(R,10)*5+"px";v.style.minWidth=L,v.style.maxWidth=L}else v.style.width="100%";S(v)}T(C,"setupImage"),setTimeout(()=>{v.complete&&C()}),v.addEventListener("error",C),v.addEventListener("load",C)})))}h=p.getBoundingClientRect(),m.attr("width",h.width),m.attr("height",h.height)}else{i.includes("font-weight: bolder")&&it(u).selectAll("tspan").attr("font-weight",""),d=u.children.length;const p=u.children[0];(u.textContent===""||u.textContent.includes(">"))&&(p.textContent=l[0]+l.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),l[1]===" "&&(p.textContent=p.textContent[0]+" "+p.textContent.substring(1))),p.textContent==="undefined"&&(p.textContent=""),h=u.getBBox()}return n.attr("transform","translate(0,"+(-h.height/(2*d)+r)+")"),h.height}T(sc,"addText");async function vT(e,t){var U,q;const r=ft(),i=r.class.padding??12,n=i,s=t.useHtmlLabels??ar(r.htmlLabels)??!0,a=t;a.annotations=a.annotations??[],a.members=a.members??[],a.methods=a.methods??[];const{shapeSvg:l,bbox:u}=await xT(e,t,r,s,n),{labelStyles:h,nodeStyles:d}=Pe(t);t.labelStyle=h,t.cssStyles=a.styles||"";const p=((U=a.styles)==null?void 0:U.join(";"))||d||"";t.cssStyles||(t.cssStyles=p.replaceAll("!important","").split(";"));const m=a.members.length===0&&a.methods.length===0&&!((q=r.class)!=null&&q.hideEmptyMembersBox),y=Ae.svg(l),x=De(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const v=u.width;let S=u.height;a.members.length===0&&a.methods.length===0?S+=n:a.members.length>0&&a.methods.length===0&&(S+=n*2);const C=-v/2,B=-S/2,R=y.rectangle(C-i,B-i-(m?i:a.members.length===0&&a.methods.length===0?-i/2:0),v+2*i,S+2*i+(m?i*2:a.members.length===0&&a.methods.length===0?-i:0),x),E=l.insert(()=>R,":first-child");E.attr("class","basic label-container");const L=E.node().getBBox();l.selectAll(".text").each((H,Y,F)=>{var Z;const O=it(F[Y]),$=O.attr("transform");let j=0;if($){const I=RegExp(/translate\(([^,]+),([^)]+)\)/).exec($);I&&(j=parseFloat(I[2]))}let W=j+B+i-(m?i:a.members.length===0&&a.methods.length===0?-i/2:0);s||(W-=4);let P=C;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(P=-((Z=O.node())==null?void 0:Z.getBBox().width)/2||0,l.selectAll("text").each(function(ee,I,Q){window.getComputedStyle(Q[I]).textAnchor==="middle"&&(P=0)})),O.attr("transform",`translate(${P}, ${W})`)});const k=l.select(".annotation-group").node().getBBox().height-(m?i/2:0)||0,A=l.select(".label-group").node().getBBox().height-(m?i/2:0)||0,z=l.select(".members-group").node().getBBox().height-(m?i/2:0)||0;if(a.members.length>0||a.methods.length>0||m){const H=y.line(L.x,k+A+B+i,L.x+L.width,k+A+B+i,x);l.insert(()=>H).attr("class","divider").attr("style",p)}if(m||a.members.length>0||a.methods.length>0){const H=y.line(L.x,k+A+z+B+n*2+i,L.x+L.width,k+A+z+B+i+n*2,x);l.insert(()=>H).attr("class","divider").attr("style",p)}if(a.look!=="handDrawn"&&l.selectAll("path").attr("style",p),E.select(":nth-child(2)").attr("style",p),l.selectAll(".divider").select("path").attr("style",p),t.labelStyle?l.selectAll("span").attr("style",t.labelStyle):l.selectAll("span").attr("style",p),!s){const H=RegExp(/color\s*:\s*([^;]*)/),Y=H.exec(p);if(Y){const F=Y[0].replace("color","fill");l.selectAll("tspan").attr("style",F)}else if(h){const F=H.exec(h);if(F){const O=F[0].replace("color","fill");l.selectAll("tspan").attr("style",O)}}}return $e(t,E),t.intersect=function(H){return Se.rect(t,H)},l}T(vT,"classBox");async function bT(e,t){var k,A;const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const n=t,s=t,a=20,l=20,u="verifyMethod"in t,h=Ne(t),d=e.insert("g").attr("class",h).attr("id",t.domId??t.id);let p;u?p=await Cn(d,`<<${n.type}>>`,0,t.labelStyle):p=await Cn(d,"<<Element>>",0,t.labelStyle);let m=p;const y=await Cn(d,n.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+l,u){const z=await Cn(d,`${n.requirementId?`ID: ${n.requirementId}`:""}`,m,t.labelStyle);m+=z;const U=await Cn(d,`${n.text?`Text: ${n.text}`:""}`,m,t.labelStyle);m+=U;const q=await Cn(d,`${n.risk?`Risk: ${n.risk}`:""}`,m,t.labelStyle);m+=q,await Cn(d,`${n.verifyMethod?`Verification: ${n.verifyMethod}`:""}`,m,t.labelStyle)}else{const z=await Cn(d,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=z,await Cn(d,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const x=(((k=d.node())==null?void 0:k.getBBox().width)??200)+a,v=(((A=d.node())==null?void 0:A.getBBox().height)??200)+a,S=-x/2,C=-v/2,B=Ae.svg(d),R=De(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");const E=B.rectangle(S,C,x,v,R),L=d.insert(()=>E,":first-child");if(L.attr("class","basic label-container").attr("style",i),d.selectAll(".label").each((z,U,q)=>{const H=it(q[U]),Y=H.attr("transform");let F=0,O=0;if(Y){const P=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Y);P&&(F=parseFloat(P[1]),O=parseFloat(P[2]))}const $=O-v/2;let j=S+a/2;(U===0||U===1)&&(j=F),H.attr("transform",`translate(${j}, ${$+a})`)}),m>p+y+l){const z=B.line(S,C+p+y+l,S+x,C+p+y+l,R);d.insert(()=>z).attr("style",i)}return $e(t,L),t.intersect=function(z){return Se.rect(t,z)},d}T(bT,"requirementBox");async function Cn(e,t,r,i=""){if(t==="")return 0;const n=e.insert("g").attr("class","label").attr("style",i),s=ft(),a=s.htmlLabels??!0,l=await Gs(n,$y(qo(t)),{width:rs(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let u;if(a){const h=l.children[0],d=it(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}else{const h=l.children[0];for(const d of h.children)d.textContent=d.textContent.replaceAll(">",">").replaceAll("<","<"),i&&d.setAttribute("style",i);u=l.getBBox(),u.height+=6}return n.attr("transform",`translate(${-u.width/2},${-u.height/2+r})`),u.height}T(Cn,"addText");var SO=T(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function ST(e,t,{config:r}){var Y,F;const{labelStyles:i,nodeStyles:n}=Pe(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:l,bbox:u,label:h}=await qe(e,t,Ne(t)),d=t.padding||10;let p="",m;"ticket"in t&&t.ticket&&((Y=r==null?void 0:r.kanban)!=null&&Y.ticketBaseUrl)&&(p=(F=r==null?void 0:r.kanban)==null?void 0:F.ticketBaseUrl.replace("#TICKET#",t.ticket),m=l.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",p).attr("target","_blank"));const y={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let x,v;m?{label:x,bbox:v}=await gg(m,"ticket"in t&&t.ticket||"",y):{label:x,bbox:v}=await gg(l,"ticket"in t&&t.ticket||"",y);const{label:S,bbox:C}=await gg(l,"assigned"in t&&t.assigned||"",y);t.width=a;const B=10,R=(t==null?void 0:t.width)||0,E=Math.max(v.height,C.height)/2,L=Math.max(u.height+B*2,(t==null?void 0:t.height)||0)+E,k=-R/2,A=-L/2;h.attr("transform","translate("+(d-R/2)+", "+(-E-u.height/2)+")"),x.attr("transform","translate("+(d-R/2)+", "+(-E+u.height/2)+")"),S.attr("transform","translate("+(d+R/2-C.width-2*s)+", "+(-E+u.height/2)+")");let z;const{rx:U,ry:q}=t,{cssStyles:H}=t;if(t.look==="handDrawn"){const O=Ae.svg(l),$=De(t,{}),j=U||q?O.path(Ys(k,A,R,L,U||0),$):O.rectangle(k,A,R,L,$);z=l.insert(()=>j,":first-child"),z.attr("class","basic label-container").attr("style",H||null)}else{z=l.insert("rect",":first-child"),z.attr("class","basic label-container __APA__").attr("style",n).attr("rx",U??5).attr("ry",q??5).attr("x",k).attr("y",A).attr("width",R).attr("height",L);const O="priority"in t&&t.priority;if(O){const $=l.append("line"),j=k+2,W=A+Math.floor((U??0)/2),P=A+L-Math.floor((U??0)/2);$.attr("x1",j).attr("y1",W).attr("x2",j).attr("y2",P).attr("stroke-width","4").attr("stroke",SO(O))}}return $e(t,z),t.height=L,t.intersect=function(O){return Se.rect(t,O)},l}T(ST,"kanbanItem");async function wT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,halfPadding:a,label:l}=await qe(e,t,Ne(t)),u=s.width+10*a,h=s.height+8*a,d=.15*u,{cssStyles:p}=t,m=s.width+20,y=s.height+20,x=Math.max(u,m),v=Math.max(h,y);l.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let S;const C=`M0 0
|
|
237
|
+
a${d},${d} 1 0,0 ${x*.25},${-1*v*.1}
|
|
238
|
+
a${d},${d} 1 0,0 ${x*.25},0
|
|
239
|
+
a${d},${d} 1 0,0 ${x*.25},0
|
|
240
|
+
a${d},${d} 1 0,0 ${x*.25},${v*.1}
|
|
241
|
+
|
|
242
|
+
a${d},${d} 1 0,0 ${x*.15},${v*.33}
|
|
243
|
+
a${d*.8},${d*.8} 1 0,0 0,${v*.34}
|
|
244
|
+
a${d},${d} 1 0,0 ${-1*x*.15},${v*.33}
|
|
245
|
+
|
|
246
|
+
a${d},${d} 1 0,0 ${-1*x*.25},${v*.15}
|
|
247
|
+
a${d},${d} 1 0,0 ${-1*x*.25},0
|
|
248
|
+
a${d},${d} 1 0,0 ${-1*x*.25},0
|
|
249
|
+
a${d},${d} 1 0,0 ${-1*x*.25},${-1*v*.15}
|
|
250
|
+
|
|
251
|
+
a${d},${d} 1 0,0 ${-1*x*.1},${-1*v*.33}
|
|
252
|
+
a${d*.8},${d*.8} 1 0,0 0,${-1*v*.34}
|
|
253
|
+
a${d},${d} 1 0,0 ${x*.1},${-1*v*.33}
|
|
254
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const B=Ae.svg(n),R=De(t,{}),E=B.path(C,R);S=n.insert(()=>E,":first-child"),S.attr("class","basic label-container").attr("style",jr(p))}else S=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",C);return S.attr("transform",`translate(${-x/2}, ${-v/2})`),$e(t,S),t.calcIntersect=function(B,R){return Se.rect(B,R)},t.intersect=function(B){return ue.info("Bang intersect",t,B),Se.rect(t,B)},n}T(wT,"bang");async function CT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,halfPadding:a,label:l}=await qe(e,t,Ne(t)),u=s.width+2*a,h=s.height+2*a,d=.15*u,p=.25*u,m=.35*u,y=.2*u,{cssStyles:x}=t;let v;const S=`M0 0
|
|
255
|
+
a${d},${d} 0 0,1 ${u*.25},${-1*u*.1}
|
|
256
|
+
a${m},${m} 1 0,1 ${u*.4},${-1*u*.1}
|
|
257
|
+
a${p},${p} 1 0,1 ${u*.35},${u*.2}
|
|
258
|
+
|
|
259
|
+
a${d},${d} 1 0,1 ${u*.15},${h*.35}
|
|
260
|
+
a${y},${y} 1 0,1 ${-1*u*.15},${h*.65}
|
|
261
|
+
|
|
262
|
+
a${p},${d} 1 0,1 ${-1*u*.25},${u*.15}
|
|
263
|
+
a${m},${m} 1 0,1 ${-1*u*.5},0
|
|
264
|
+
a${d},${d} 1 0,1 ${-1*u*.25},${-1*u*.15}
|
|
265
|
+
|
|
266
|
+
a${d},${d} 1 0,1 ${-1*u*.1},${-1*h*.35}
|
|
267
|
+
a${y},${y} 1 0,1 ${u*.1},${-1*h*.65}
|
|
268
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const C=Ae.svg(n),B=De(t,{}),R=C.path(S,B);v=n.insert(()=>R,":first-child"),v.attr("class","basic label-container").attr("style",jr(x))}else v=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",S);return l.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),v.attr("transform",`translate(${-u/2}, ${-h/2})`),$e(t,v),t.calcIntersect=function(C,B){return Se.rect(C,B)},t.intersect=function(C){return ue.info("Cloud intersect",t,C),Se.rect(t,C)},n}T(CT,"cloud");async function kT(e,t){const{labelStyles:r,nodeStyles:i}=Pe(t);t.labelStyle=r;const{shapeSvg:n,bbox:s,halfPadding:a,label:l}=await qe(e,t,Ne(t)),u=s.width+8*a,h=s.height+2*a,d=5,p=`
|
|
269
|
+
M${-u/2} ${h/2-d}
|
|
270
|
+
v${-h+2*d}
|
|
271
|
+
q0,-${d} ${d},-${d}
|
|
272
|
+
h${u-2*d}
|
|
273
|
+
q${d},0 ${d},${d}
|
|
274
|
+
v${h-2*d}
|
|
275
|
+
q0,${d} -${d},${d}
|
|
276
|
+
h${-u+2*d}
|
|
277
|
+
q-${d},0 -${d},-${d}
|
|
278
|
+
Z
|
|
279
|
+
`,m=n.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",p);return n.append("line").attr("class","node-line-").attr("x1",-u/2).attr("y1",h/2).attr("x2",u/2).attr("y2",h/2),l.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),n.append(()=>l.node()),$e(t,m),t.calcIntersect=function(y,x){return Se.rect(y,x)},t.intersect=function(y){return Se.rect(t,y)},n}T(kT,"defaultMindmapNode");async function TT(e,t){const r={padding:t.padding??0};return m0(e,t,r)}T(TT,"mindmapCircle");var wO=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:iT},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:eT},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:nT},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:lT},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:E2},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:m0},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:wT},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:CT},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Q2},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:P2},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:q2},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:H2},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:fT},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:N2},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:M2},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:uT},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:x2},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:tT},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:aT},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:oT},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:A2},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:I2},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:w2},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:C2},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:k2},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:U2},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:mT},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:D2},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:dT},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:V2},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:T2},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:B2},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:gT},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:_T},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:L2},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:pT},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:R2},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:rT},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:K2},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Y2},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:_2},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:S2},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:hT},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:cT},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:yT},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Z2},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:G2}],CO=T(()=>{const t=[...Object.entries({state:sT,choice:v2,note:X2,rectWithTitle:J2,labelRect:W2,iconSquare:z2,iconCircle:j2,icon:$2,iconRounded:O2,imageSquare:F2,anchor:y2,kanbanItem:ST,mindmapCircle:TT,defaultMindmapNode:kT,classBox:vT,erBox:y0,requirementBox:bT}),...wO.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(n=>[n,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),ET=CO();function kO(e){return e in ET}T(kO,"isValidShape");var rf=new Map;async function BT(e,t,r){let i,n;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?ET[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),n=await s(i,t,r)}else n=await s(e,t,r),i=n;return t.tooltip&&n.attr("title",t.tooltip),rf.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}T(BT,"insertNode");var HU=T((e,t)=>{rf.set(t.id,e)},"setNodeElem"),qU=T(()=>{rf.clear()},"clear"),UU=T(e=>{const t=rf.get(e.id);ue.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),TO=T((e,t,r,i,n,s)=>{t.arrowTypeStart&&j1(e,"start",t.arrowTypeStart,r,i,n,s),t.arrowTypeEnd&&j1(e,"end",t.arrowTypeEnd,r,i,n,s)},"addEdgeMarkers"),EO={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},j1=T((e,t,r,i,n,s,a)=>{var p;const l=EO[r];if(!l){ue.warn(`Unknown arrow type: ${r}`);return}const u=l.type,d=`${n}_${s}-${u}${t==="start"?"Start":"End"}`;if(a&&a.trim()!==""){const m=a.replace(/[^\dA-Za-z]/g,"_"),y=`${d}_${m}`;if(!document.getElementById(y)){const x=document.getElementById(d);if(x){const v=x.cloneNode(!0);v.id=y,v.querySelectorAll("path, circle, line").forEach(C=>{C.setAttribute("stroke",a),l.fill&&C.setAttribute("fill",a)}),(p=x.parentNode)==null||p.appendChild(v)}}e.attr(`marker-${t}`,`url(${i}#${y})`)}else e.attr(`marker-${t}`,`url(${i}#${d})`)},"addEdgeMarker"),Cd=new Map,Sr=new Map,VU=T(()=>{Cd.clear(),Sr.clear()},"clear"),hu=T(e=>e?e.reduce((r,i)=>r+";"+i,""):"","getLabelStyles"),BO=T(async(e,t)=>{let r=ar(ft().flowchart.htmlLabels);const{labelStyles:i}=Pe(t);t.labelStyle=i;const n=await Gs(e,t.label,{style:t.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});ue.info("abc82",t,t.labelType);const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id);a.node().appendChild(n);let l=n.getBBox();if(r){const h=n.children[0],d=it(n);l=h.getBoundingClientRect(),d.attr("width",l.width),d.attr("height",l.height)}a.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),Cd.set(t.id,s),t.width=l.width,t.height=l.height;let u;if(t.startLabelLeft){const h=await To(t.startLabelLeft,hu(t.labelStyle)),d=e.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");u=p.node().appendChild(h);const m=h.getBBox();p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),Sr.get(t.id)||Sr.set(t.id,{}),Sr.get(t.id).startLeft=d,oc(u,t.startLabelLeft)}if(t.startLabelRight){const h=await To(t.startLabelRight,hu(t.labelStyle)),d=e.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");u=d.node().appendChild(h),p.node().appendChild(h);const m=h.getBBox();p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),Sr.get(t.id)||Sr.set(t.id,{}),Sr.get(t.id).startRight=d,oc(u,t.startLabelRight)}if(t.endLabelLeft){const h=await To(t.endLabelLeft,hu(t.labelStyle)),d=e.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");u=p.node().appendChild(h);const m=h.getBBox();p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),d.node().appendChild(h),Sr.get(t.id)||Sr.set(t.id,{}),Sr.get(t.id).endLeft=d,oc(u,t.endLabelLeft)}if(t.endLabelRight){const h=await To(t.endLabelRight,hu(t.labelStyle)),d=e.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");u=p.node().appendChild(h);const m=h.getBBox();p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),d.node().appendChild(h),Sr.get(t.id)||Sr.set(t.id,{}),Sr.get(t.id).endRight=d,oc(u,t.endLabelRight)}return n},"insertEdgeLabel");function oc(e,t){ft().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}T(oc,"setTerminalWidth");var MO=T((e,t)=>{ue.debug("Moving label abc88 ",e.id,e.label,Cd.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=ft(),{subGraphTitleTotalMargin:n}=r0(i);if(e.label){const s=Cd.get(e.id);let a=e.x,l=e.y;if(r){const u=on.calcLabelPosition(r);ue.debug("Moving label "+e.label+" from (",a,",",l,") to (",u.x,",",u.y,") abc88"),t.updatedPath&&(a=u.x,l=u.y)}s.attr("transform",`translate(${a}, ${l+n/2})`)}if(e.startLabelLeft){const s=Sr.get(e.id).startLeft;let a=e.x,l=e.y;if(r){const u=on.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=u.x,l=u.y}s.attr("transform",`translate(${a}, ${l})`)}if(e.startLabelRight){const s=Sr.get(e.id).startRight;let a=e.x,l=e.y;if(r){const u=on.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=u.x,l=u.y}s.attr("transform",`translate(${a}, ${l})`)}if(e.endLabelLeft){const s=Sr.get(e.id).endLeft;let a=e.x,l=e.y;if(r){const u=on.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=u.x,l=u.y}s.attr("transform",`translate(${a}, ${l})`)}if(e.endLabelRight){const s=Sr.get(e.id).endRight;let a=e.x,l=e.y;if(r){const u=on.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=u.x,l=u.y}s.attr("transform",`translate(${a}, ${l})`)}},"positionEdgeLabel"),LO=T((e,t)=>{const r=e.x,i=e.y,n=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,l=e.height/2;return n>=a||s>=l},"outsideNode"),RO=T((e,t,r)=>{ue.debug(`intersection calc abc89:
|
|
280
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
281
|
+
insidePoint : ${JSON.stringify(r)}
|
|
282
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,n=e.y,s=Math.abs(i-r.x),a=e.width/2;let l=r.x<t.x?a-s:a+s;const u=e.height/2,h=Math.abs(t.y-r.y),d=Math.abs(t.x-r.x);if(Math.abs(n-t.y)*a>Math.abs(i-t.x)*u){let p=r.y<t.y?t.y-u-n:n-u-t.y;l=d*p/h;const m={x:r.x<t.x?r.x+l:r.x-d+l,y:r.y<t.y?r.y+h-p:r.y-h+p};return l===0&&(m.x=t.x,m.y=t.y),d===0&&(m.x=t.x),h===0&&(m.y=t.y),ue.debug(`abc89 top/bottom calc, Q ${h}, q ${p}, R ${d}, r ${l}`,m),m}else{r.x<t.x?l=t.x-a-i:l=i-a-t.x;let p=h*l/d,m=r.x<t.x?r.x+d-l:r.x-d+l,y=r.y<t.y?r.y+p:r.y-p;return ue.debug(`sides calc abc89, Q ${h}, q ${p}, R ${d}, r ${l}`,{_x:m,_y:y}),l===0&&(m=t.x,y=t.y),d===0&&(m=t.x),h===0&&(y=t.y),{x:m,y}}},"intersection"),O1=T((e,t)=>{ue.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],n=!1;return e.forEach(s=>{if(ue.info("abc88 checking point",s,t),!LO(t,s)&&!n){const a=RO(t,i,s);ue.debug("abc88 inside",s,i,a),ue.debug("abc88 intersection",a,t);let l=!1;r.forEach(u=>{l=l||u.x===a.x&&u.y===a.y}),r.some(u=>u.x===a.x&&u.y===a.y)?ue.warn("abc88 no intersect",a,r):r.push(a),n=!0}else ue.warn("abc88 outside",s,i),i=s,n||r.push(s)}),ue.debug("returning points",r),r},"cutPathAtIntersect");function MT(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const n=e[i-1],s=e[i],a=e[i+1];(n.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-n.y)>5||n.y===s.y&&s.x===a.x&&Math.abs(s.x-n.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}T(MT,"extractCornerPoints");var z1=T(function(e,t,r){const i=t.x-e.x,n=t.y-e.y,s=Math.sqrt(i*i+n*n),a=r/s;return{x:t.x-a*i,y:t.y-a*n}},"findAdjacentPoint"),AO=T(function(e){const{cornerPointPositions:t}=MT(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const n=e[i-1],s=e[i+1],a=e[i],l=z1(n,a,5),u=z1(s,a,5),h=u.x-l.x,d=u.y-l.y;r.push(l);const p=Math.sqrt(2)*2;let m={x:a.x,y:a.y};if(Math.abs(s.x-n.x)>10&&Math.abs(s.y-n.y)>=10){ue.debug("Corner point fixing",Math.abs(s.x-n.x),Math.abs(s.y-n.y));const y=5;a.x===l.x?m={x:h<0?l.x-y+p:l.x+y-p,y:d<0?l.y-p:l.y+p}:m={x:h<0?l.x-p:l.x+p,y:d<0?l.y-y+p:l.y+y-p}}else ue.debug("Corner point skipping fixing",Math.abs(s.x-n.x),Math.abs(s.y-n.y));r.push(m,u)}else r.push(e[i]);return r},"fixCorners"),DO=T((e,t,r)=>{const i=e-t-r,n=2,s=2,a=n+s,l=Math.floor(i/a),u=Array(l).fill(`${n} ${s}`).join(" ");return`0 ${t} ${u} ${r}`},"generateDashArray"),PO=T(function(e,t,r,i,n,s,a,l=!1){var O;const{handDrawnSeed:u}=ft();let h=t.points,d=!1;const p=n;var m=s;const y=[];for(const $ in t.cssCompiledStyles)yk($)||y.push(t.cssCompiledStyles[$]);ue.debug("UIO intersect check",t.points,m.x,p.x),m.intersect&&p.intersect&&!l&&(h=h.slice(1,t.points.length-1),h.unshift(p.intersect(h[0])),ue.debug("Last point UIO",t.start,"-->",t.end,h[h.length-1],m,m.intersect(h[h.length-1])),h.push(m.intersect(h[h.length-1])));const x=btoa(JSON.stringify(h));t.toCluster&&(ue.info("to cluster abc88",r.get(t.toCluster)),h=O1(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(ue.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=O1(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let v=h.filter($=>!Number.isNaN($.y));v=AO(v);let S=Bu;switch(S=nd,t.curve){case"linear":S=nd;break;case"basis":S=Bu;break;case"cardinal":S=bw;break;case"bumpX":S=mw;break;case"bumpY":S=yw;break;case"catmullRom":S=ww;break;case"monotoneX":S=Mw;break;case"monotoneY":S=Lw;break;case"natural":S=Aw;break;case"step":S=Dw;break;case"stepAfter":S=Iw;break;case"stepBefore":S=Pw;break;default:S=Bu}const{x:C,y:B}=gI(t),R=ZP().x(C).y(B).curve(S);let E;switch(t.thickness){case"normal":E="edge-thickness-normal";break;case"thick":E="edge-thickness-thick";break;case"invisible":E="edge-thickness-invisible";break;default:E="edge-thickness-normal"}switch(t.pattern){case"solid":E+=" edge-pattern-solid";break;case"dotted":E+=" edge-pattern-dotted";break;case"dashed":E+=" edge-pattern-dashed";break;default:E+=" edge-pattern-solid"}let L,k=t.curve==="rounded"?LT(RT(v,t),5):R(v);const A=Array.isArray(t.style)?t.style:[t.style];let z=A.find($=>$==null?void 0:$.startsWith("stroke:")),U=!1;if(t.look==="handDrawn"){const $=Ae.svg(e);Object.assign([],v);const j=$.path(k,{roughness:.3,seed:u});E+=" transition",L=it(j).select("path").attr("id",t.id).attr("class"," "+E+(t.classes?" "+t.classes:"")).attr("style",A?A.reduce((P,Z)=>P+";"+Z,""):"");let W=L.attr("d");L.attr("d",W),e.node().appendChild(L.node())}else{const $=y.join(";"),j=A?A.reduce((te,X)=>te+X+";",""):"";let W="";t.animate&&(W=" edge-animation-fast"),t.animation&&(W=" edge-animation-"+t.animation);const P=($?$+";"+j+";":j)+";"+(A?A.reduce((te,X)=>te+";"+X,""):"");L=e.append("path").attr("d",k).attr("id",t.id).attr("class"," "+E+(t.classes?" "+t.classes:"")+(W??"")).attr("style",P),z=(O=P.match(/stroke:([^;]+)/))==null?void 0:O[1],U=t.animate===!0||!!t.animation||$.includes("animation");const Z=L.node(),ee=typeof Z.getTotalLength=="function"?Z.getTotalLength():0,I=a1[t.arrowTypeStart]||0,Q=a1[t.arrowTypeEnd]||0;if(t.look==="neo"&&!U){const X=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?DO(ee,I,Q):`0 ${I} ${ee-I-Q} ${Q}`}; stroke-dashoffset: 0;`;L.attr("style",X+L.attr("style"))}}L.attr("data-edge",!0),L.attr("data-et","edge"),L.attr("data-id",t.id),L.attr("data-points",x),t.showPoints&&v.forEach($=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",$.x).attr("cy",$.y)});let q="";(ft().flowchart.arrowMarkerAbsolute||ft().state.arrowMarkerAbsolute)&&(q=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,q=q.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ue.info("arrowTypeStart",t.arrowTypeStart),ue.info("arrowTypeEnd",t.arrowTypeEnd),TO(L,t,q,a,i,z);const H=Math.floor(h.length/2),Y=h[H];on.isLabelCoordinateInPath(Y,L.attr("d"))||(d=!0);let F={};return d&&(F.updatedPath=h),F.originalPath=t.points,F},"insertEdge");function LT(e,t){if(e.length<2)return"";let r="";const i=e.length,n=1e-5;for(let s=0;s<i;s++){const a=e[s],l=e[s-1],u=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===i-1)r+=`L${a.x},${a.y}`;else{const h=a.x-l.x,d=a.y-l.y,p=u.x-a.x,m=u.y-a.y,y=Math.hypot(h,d),x=Math.hypot(p,m);if(y<n||x<n){r+=`L${a.x},${a.y}`;continue}const v=h/y,S=d/y,C=p/x,B=m/x,R=v*C+S*B,E=Math.max(-1,Math.min(1,R)),L=Math.acos(E);if(L<n||Math.abs(Math.PI-L)<n){r+=`L${a.x},${a.y}`;continue}const k=Math.min(t/Math.sin(L/2),y/2,x/2),A=a.x-v*k,z=a.y-S*k,U=a.x+C*k,q=a.y+B*k;r+=`L${A},${z}`,r+=`Q${a.x},${a.y} ${U},${q}`}}return r}T(LT,"generateRoundedPath");function Cm(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}T(Cm,"calculateDeltaAndAngle");function RT(e,t){const r=e.map(n=>({...n}));if(e.length>=2&&Pr[t.arrowTypeStart]){const n=Pr[t.arrowTypeStart],s=e[0],a=e[1],{angle:l}=Cm(s,a),u=n*Math.cos(l),h=n*Math.sin(l);r[0].x=s.x+u,r[0].y=s.y+h}const i=e.length;if(i>=2&&Pr[t.arrowTypeEnd]){const n=Pr[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:l}=Cm(a,s),u=n*Math.cos(l),h=n*Math.sin(l);r[i-1].x=s.x-u,r[i-1].y=s.y-h}return r}T(RT,"applyMarkerOffsetsToPoints");var IO=T((e,t,r,i)=>{t.forEach(n=>{QO[n](e,r,i)})},"insertMarkers"),$O=T((e,t,r)=>{ue.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),jO=T((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),OO=T((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),zO=T((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),FO=T((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),NO=T((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),WO=T((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),HO=T((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),qO=T((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),UO=T((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),VO=T((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),GO=T((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),YO=T((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),KO=T((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
|
|
283
|
+
L20,10
|
|
284
|
+
M20,10
|
|
285
|
+
L0,20`)},"requirement_arrow"),XO=T((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),QO={extension:$O,composition:jO,aggregation:OO,dependency:zO,lollipop:FO,point:NO,circle:WO,cross:HO,barb:qO,only_one:UO,zero_or_one:VO,one_or_more:GO,zero_or_more:YO,requirement_arrow:KO,requirement_contains:XO},ZO=IO,JO={common:Ha,getConfig:Ir,insertCluster:aO,insertEdge:PO,insertEdgeLabel:BO,insertMarkers:ZO,insertNode:BT,interpolateToCurve:a0,labelHelper:qe,log:ue,positionEdgeLabel:MO},Lc={},AT=T(e=>{for(const t of e)Lc[t.name]=t},"registerLayoutLoaders"),ez=T(()=>{AT([{name:"dagre",loader:T(async()=>await lt(()=>import("./dagre-6UL2VRFP-Do10BY1y.js"),__vite__mapDeps([0,1,2,3,4,5])),"loader")},{name:"cose-bilkent",loader:T(async()=>await lt(()=>import("./cose-bilkent-S5V4N54A-BTyQiCkr.js"),__vite__mapDeps([6,7])),"loader")}])},"registerDefaultLayoutLoaders");ez();var GU=T(async(e,t)=>{if(!(e.layoutAlgorithm in Lc))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const r=Lc[e.layoutAlgorithm];return(await r.loader()).render(e,t,JO,{algorithm:r.algorithm})},"render"),YU=T((e="",{fallback:t="dagre"}={})=>{if(e in Lc)return e;if(t in Lc)return ue.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),DT="comm",PT="rule",IT="decl",tz="@import",rz="@namespace",iz="@keyframes",nz="@layer",$T=Math.abs,_0=String.fromCharCode;function jT(e){return e.trim()}function Du(e,t,r){return e.replace(t,r)}function sz(e,t,r){return e.indexOf(t,r)}function ka(e,t){return e.charCodeAt(t)|0}function Fa(e,t,r){return e.slice(t,r)}function Tn(e){return e.length}function oz(e){return e.length}function uu(e,t){return t.push(e),e}var nf=1,Na=1,OT=0,qi=0,Qt=0,Ya="";function x0(e,t,r,i,n,s,a,l){return{value:e,root:t,parent:r,type:i,props:n,children:s,line:nf,column:Na,length:a,return:"",siblings:l}}function az(){return Qt}function lz(){return Qt=qi>0?ka(Ya,--qi):0,Na--,Qt===10&&(Na=1,nf--),Qt}function ln(){return Qt=qi<OT?ka(Ya,qi++):0,Na++,Qt===10&&(Na=1,nf++),Qt}function js(){return ka(Ya,qi)}function Pu(){return qi}function sf(e,t){return Fa(Ya,e,t)}function Rc(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function cz(e){return nf=Na=1,OT=Tn(Ya=e),qi=0,[]}function hz(e){return Ya="",e}function mg(e){return jT(sf(qi-1,km(e===91?e+2:e===40?e+1:e)))}function uz(e){for(;(Qt=js())&&Qt<33;)ln();return Rc(e)>2||Rc(Qt)>3?"":" "}function dz(e,t){for(;--t&&ln()&&!(Qt<48||Qt>102||Qt>57&&Qt<65||Qt>70&&Qt<97););return sf(e,Pu()+(t<6&&js()==32&&ln()==32))}function km(e){for(;ln();)switch(Qt){case e:return qi;case 34:case 39:e!==34&&e!==39&&km(Qt);break;case 40:e===41&&km(e);break;case 92:ln();break}return qi}function fz(e,t){for(;ln()&&e+Qt!==57;)if(e+Qt===84&&js()===47)break;return"/*"+sf(t,qi-1)+"*"+_0(e===47?e:ln())}function pz(e){for(;!Rc(js());)ln();return sf(e,qi)}function gz(e){return hz(Iu("",null,null,null,[""],e=cz(e),0,[0],e))}function Iu(e,t,r,i,n,s,a,l,u){for(var h=0,d=0,p=a,m=0,y=0,x=0,v=1,S=1,C=1,B=0,R="",E=n,L=s,k=i,A=R;S;)switch(x=B,B=ln()){case 40:if(x!=108&&ka(A,p-1)==58){sz(A+=Du(mg(B),"&","&\f"),"&\f",$T(h?l[h-1]:0))!=-1&&(C=-1);break}case 34:case 39:case 91:A+=mg(B);break;case 9:case 10:case 13:case 32:A+=uz(x);break;case 92:A+=dz(Pu()-1,7);continue;case 47:switch(js()){case 42:case 47:uu(mz(fz(ln(),Pu()),t,r,u),u),(Rc(x||1)==5||Rc(js()||1)==5)&&Tn(A)&&Fa(A,-1,void 0)!==" "&&(A+=" ");break;default:A+="/"}break;case 123*v:l[h++]=Tn(A)*C;case 125*v:case 59:case 0:switch(B){case 0:case 125:S=0;case 59+d:C==-1&&(A=Du(A,/\f/g,"")),y>0&&(Tn(A)-p||v===0&&x===47)&&uu(y>32?N1(A+";",i,r,p-1,u):N1(Du(A," ","")+";",i,r,p-2,u),u);break;case 59:A+=";";default:if(uu(k=F1(A,t,r,h,d,n,l,R,E=[],L=[],p,s),s),B===123)if(d===0)Iu(A,t,k,k,E,s,p,l,L);else{switch(m){case 99:if(ka(A,3)===110)break;case 108:if(ka(A,2)===97)break;default:d=0;case 100:case 109:case 115:}d?Iu(e,k,k,i&&uu(F1(e,k,k,0,0,n,l,R,n,E=[],p,L),L),n,L,p,l,i?E:L):Iu(A,k,k,k,[""],L,0,l,L)}}h=d=y=0,v=C=1,R=A="",p=a;break;case 58:p=1+Tn(A),y=x;default:if(v<1){if(B==123)--v;else if(B==125&&v++==0&&lz()==125)continue}switch(A+=_0(B),B*v){case 38:C=d>0?1:(A+="\f",-1);break;case 44:l[h++]=(Tn(A)-1)*C,C=1;break;case 64:js()===45&&(A+=mg(ln())),m=js(),d=p=Tn(R=A+=pz(Pu())),B++;break;case 45:x===45&&Tn(A)==2&&(v=0)}}return s}function F1(e,t,r,i,n,s,a,l,u,h,d,p){for(var m=n-1,y=n===0?s:[""],x=oz(y),v=0,S=0,C=0;v<i;++v)for(var B=0,R=Fa(e,m+1,m=$T(S=a[v])),E=e;B<x;++B)(E=jT(S>0?y[B]+" "+R:Du(R,/&\f/g,y[B])))&&(u[C++]=E);return x0(e,t,r,n===0?PT:l,u,h,d,p)}function mz(e,t,r,i){return x0(e,t,r,DT,_0(az()),Fa(e,2,-2),0,i)}function N1(e,t,r,i,n){return x0(e,t,r,IT,Fa(e,0,i),Fa(e,i+1,-1),i,n)}function Tm(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function yz(e,t,r,i){switch(e.type){case nz:if(e.children.length)break;case tz:case rz:case IT:return e.return=e.return||e.value;case DT:return"";case iz:return e.return=e.value+"{"+Tm(e.children,i)+"}";case PT:if(!Tn(e.value=e.props.join(",")))return""}return Tn(r=Tm(e.children,i))?e.return=e.value+"{"+r+"}":""}var _z=bk(Object.keys,Object),xz=Object.prototype,vz=xz.hasOwnProperty;function bz(e){if(!Kd(e))return _z(e);var t=[];for(var r in Object(e))vz.call(e,r)&&r!="constructor"&&t.push(r);return t}var Em=Ho(Pn,"DataView"),Bm=Ho(Pn,"Promise"),Mm=Ho(Pn,"Set"),Lm=Ho(Pn,"WeakMap"),W1="[object Map]",Sz="[object Object]",H1="[object Promise]",q1="[object Set]",U1="[object WeakMap]",V1="[object DataView]",wz=Wo(Em),Cz=Wo(Bc),kz=Wo(Bm),Tz=Wo(Mm),Ez=Wo(Lm),xo=Ua;(Em&&xo(new Em(new ArrayBuffer(1)))!=V1||Bc&&xo(new Bc)!=W1||Bm&&xo(Bm.resolve())!=H1||Mm&&xo(new Mm)!=q1||Lm&&xo(new Lm)!=U1)&&(xo=function(e){var t=Ua(e),r=t==Sz?e.constructor:void 0,i=r?Wo(r):"";if(i)switch(i){case wz:return V1;case Cz:return W1;case kz:return H1;case Tz:return q1;case Ez:return U1}return t});var Bz="[object Map]",Mz="[object Set]",Lz=Object.prototype,Rz=Lz.hasOwnProperty;function G1(e){if(e==null)return!0;if(Xd(e)&&(yd(e)||typeof e=="string"||typeof e.splice=="function"||s0(e)||o0(e)||md(e)))return!e.length;var t=xo(e);if(t==Bz||t==Mz)return!e.size;if(Kd(e))return!bz(e).length;for(var r in e)if(Rz.call(e,r))return!1;return!0}var zT="c4",Az=T(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Dz=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-BWKCTyQi.js");return{diagram:t}},__vite__mapDeps([8,9]));return{id:zT,diagram:e}},"loader"),Pz={id:zT,detector:Az,loader:Dz},Iz=Pz,FT="flowchart",$z=T((e,t)=>{var r,i;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),jz=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-KW4T1sqF.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]));return{id:FT,diagram:e}},"loader"),Oz={id:FT,detector:$z,loader:jz},zz=Oz,NT="flowchart-v2",Fz=T((e,t)=>{var r,i,n;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),Nz=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-KW4T1sqF.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]));return{id:NT,diagram:e}},"loader"),Wz={id:NT,detector:Fz,loader:Nz},Hz=Wz,WT="er",qz=T(e=>/^\s*erDiagram/.test(e),"detector"),Uz=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-DNgu6dMd.js");return{diagram:t}},__vite__mapDeps([15,12,13,14]));return{id:WT,diagram:e}},"loader"),Vz={id:WT,detector:qz,loader:Uz},Gz=Vz,HT="gitGraph",Yz=T(e=>/^\s*gitGraph/.test(e),"detector"),Kz=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-V2S2FVAM-BejNaAVm.js");return{diagram:t}},__vite__mapDeps([16,17,18,19,2,4,5]));return{id:HT,diagram:e}},"loader"),Xz={id:HT,detector:Yz,loader:Kz},Qz=Xz,qT="gantt",Zz=T(e=>/^\s*gantt/.test(e),"detector"),Jz=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-CbJozPBN.js");return{diagram:t}},__vite__mapDeps([20,21,22,23]));return{id:qT,diagram:e}},"loader"),eF={id:qT,detector:Zz,loader:Jz},tF=eF,UT="info",rF=T(e=>/^\s*info/.test(e),"detector"),iF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./infoDiagram-HS3SLOUP-CSJVED2y.js");return{diagram:t}},__vite__mapDeps([24,19,2,4,5]));return{id:UT,diagram:e}},"loader"),nF={id:UT,detector:rF,loader:iF},VT="pie",sF=T(e=>/^\s*pie/.test(e),"detector"),oF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-BvvN7VvQ.js");return{diagram:t}},__vite__mapDeps([25,17,19,2,4,5,26,27,22]));return{id:VT,diagram:e}},"loader"),aF={id:VT,detector:sF,loader:oF},GT="quadrantChart",lF=T(e=>/^\s*quadrantChart/.test(e),"detector"),cF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-C9bx3nEJ.js");return{diagram:t}},__vite__mapDeps([28,21,22,23]));return{id:GT,diagram:e}},"loader"),hF={id:GT,detector:lF,loader:cF},uF=hF,YT="xychart",dF=T(e=>/^\s*xychart(-beta)?/.test(e),"detector"),fF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-BpX6MPWa.js");return{diagram:t}},__vite__mapDeps([29,22,27,21,23]));return{id:YT,diagram:e}},"loader"),pF={id:YT,detector:dF,loader:fF},gF=pF,KT="requirement",mF=T(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),yF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-dmouSXOl.js");return{diagram:t}},__vite__mapDeps([30,12,13]));return{id:KT,diagram:e}},"loader"),_F={id:KT,detector:mF,loader:yF},xF=_F,XT="sequence",vF=T(e=>/^\s*sequenceDiagram/.test(e),"detector"),bF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-B8FOaL2Q.js");return{diagram:t}},__vite__mapDeps([31,9,18]));return{id:XT,diagram:e}},"loader"),SF={id:XT,detector:vF,loader:bF},wF=SF,QT="class",CF=T((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),kF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-DorPdibv.js");return{diagram:t}},__vite__mapDeps([32,33,11,12,13]));return{id:QT,diagram:e}},"loader"),TF={id:QT,detector:CF,loader:kF},EF=TF,ZT="classDiagram",BF=T((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),MF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-DorPdibv.js");return{diagram:t}},__vite__mapDeps([34,33,11,12,13]));return{id:ZT,diagram:e}},"loader"),LF={id:ZT,detector:BF,loader:MF},RF=LF,JT="state",AF=T((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),DF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-aBg0hjTp.js");return{diagram:t}},__vite__mapDeps([35,36,12,13,1,2,3,4]));return{id:JT,diagram:e}},"loader"),PF={id:JT,detector:AF,loader:DF},IF=PF,eE="stateDiagram",$F=T((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),jF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-CeA5jba6.js");return{diagram:t}},__vite__mapDeps([37,36,12,13]));return{id:eE,diagram:e}},"loader"),OF={id:eE,detector:$F,loader:jF},zF=OF,tE="journey",FF=T(e=>/^\s*journey/.test(e),"detector"),NF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-DUxWmkkC.js");return{diagram:t}},__vite__mapDeps([38,9,11,26]));return{id:tE,diagram:e}},"loader"),WF={id:tE,detector:FF,loader:NF},HF=WF,qF=T((e,t,r)=>{ue.debug(`rendering svg for syntax error
|
|
286
|
+
`);const i=a4(t),n=i.append("g");i.attr("viewBox","0 0 2412 512"),zS(i,100,512,!0),n.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),n.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),n.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),n.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),n.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),n.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),n.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),n.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),rE={draw:qF},UF=rE,VF={db:{},renderer:rE,parser:{parse:T(()=>{},"parse")}},GF=VF,iE="flowchart-elk",YF=T((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),KF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-KW4T1sqF.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]));return{id:iE,diagram:e}},"loader"),XF={id:iE,detector:YF,loader:KF},QF=XF,nE="timeline",ZF=T(e=>/^\s*timeline/.test(e),"detector"),JF=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-DrXGRjnB.js");return{diagram:t}},__vite__mapDeps([39,26]));return{id:nE,diagram:e}},"loader"),e8={id:nE,detector:ZF,loader:JF},t8=e8,sE="mindmap",r8=T(e=>/^\s*mindmap/.test(e),"detector"),i8=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-xyu628P9.js");return{diagram:t}},__vite__mapDeps([40,12,13]));return{id:sE,diagram:e}},"loader"),n8={id:sE,detector:r8,loader:i8},s8=n8,oE="kanban",o8=T(e=>/^\s*kanban/.test(e),"detector"),a8=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-LtNWeoYB.js");return{diagram:t}},__vite__mapDeps([41,11]));return{id:oE,diagram:e}},"loader"),l8={id:oE,detector:o8,loader:a8},c8=l8,aE="sankey",h8=T(e=>/^\s*sankey(-beta)?/.test(e),"detector"),u8=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-DRkRC9qB.js");return{diagram:t}},__vite__mapDeps([42,27,22]));return{id:aE,diagram:e}},"loader"),d8={id:aE,detector:h8,loader:u8},f8=d8,lE="packet",p8=T(e=>/^\s*packet(-beta)?/.test(e),"detector"),g8=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-CdWgZIIc.js");return{diagram:t}},__vite__mapDeps([43,17,19,2,4,5]));return{id:lE,diagram:e}},"loader"),m8={id:lE,detector:p8,loader:g8},cE="radar",y8=T(e=>/^\s*radar-beta/.test(e),"detector"),_8=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-D5Aszgz4.js");return{diagram:t}},__vite__mapDeps([44,17,19,2,4,5]));return{id:cE,diagram:e}},"loader"),x8={id:cE,detector:y8,loader:_8},hE="block",v8=T(e=>/^\s*block(-beta)?/.test(e),"detector"),b8=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-CUNKQd-b.js");return{diagram:t}},__vite__mapDeps([45,11,5,2,1,14]));return{id:hE,diagram:e}},"loader"),S8={id:hE,detector:v8,loader:b8},w8=S8,uE="architecture",C8=T(e=>/^\s*architecture/.test(e),"detector"),k8=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-egbtMwua.js");return{diagram:t}},__vite__mapDeps([46,17,19,2,4,5,7]));return{id:uE,diagram:e}},"loader"),T8={id:uE,detector:C8,loader:k8},E8=T8,dE="treemap",B8=T(e=>/^\s*treemap/.test(e),"detector"),M8=T(async()=>{const{diagram:e}=await lt(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-CsMy-r0n.js");return{diagram:t}},__vite__mapDeps([47,13,17,19,2,4,5,23,27,22]));return{id:dE,diagram:e}},"loader"),L8={id:dE,detector:B8,loader:M8},Y1=!1,of=T(()=>{Y1||(Y1=!0,Qu("error",GF,e=>e.toLowerCase().trim()==="error"),Qu("---",{db:{clear:T(()=>{},"clear")},styles:{},renderer:{draw:T(()=>{},"draw")},parser:{parse:T(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:T(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Fg(QF,s8,E8),Fg(Iz,c8,RF,EF,Gz,tF,nF,aF,xF,wF,Hz,zz,t8,Qz,zF,IF,HF,uF,f8,m8,gF,w8,x8,L8))},"addDiagrams"),R8=T(async()=>{ue.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Ao).map(async([r,{detector:i,loader:n}])=>{if(n)try{qg(r)}catch{try{const{diagram:s,id:a}=await n();Qu(a,s,i)}catch(s){throw ue.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Ao[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){ue.error(`Failed to load ${t.length} external diagrams`);for(const r of t)ue.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),A8="graphics-document document";function fE(e,t){e.attr("role",A8),t!==""&&e.attr("aria-roledescription",t)}T(fE,"setA11yDiagramInfo");function pE(e,t,r,i){if(e.insert!==void 0){if(r){const n=`chart-desc-${i}`;e.attr("aria-describedby",n),e.insert("desc",":first-child").attr("id",n).text(r)}if(t){const n=`chart-title-${i}`;e.attr("aria-labelledby",n),e.insert("title",":first-child").attr("id",n).text(t)}}}T(pE,"addSVGa11yTitleDescription");var Lo,Rm=(Lo=class{constructor(t,r,i,n,s){this.type=t,this.text=r,this.db=i,this.parser=n,this.renderer=s}static async fromText(t,r={}){var h,d;const i=Ir(),n=Ly(t,i);t=fj(t)+`
|
|
287
|
+
`;try{qg(n)}catch{const p=j3(n);if(!p)throw new ES(`Diagram ${n} not found.`);const{id:m,diagram:y}=await p();Qu(m,y)}const{db:s,parser:a,renderer:l,init:u}=qg(n);return a.parser&&(a.parser.yy=s),(h=s.clear)==null||h.call(s),u==null||u(i),r.title&&((d=s.setDiagramTitle)==null||d.call(s,r.title)),await a.parse(t),new Lo(n,t,s,a,l)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},T(Lo,"Diagram"),Lo),K1=[],D8=T(()=>{K1.forEach(e=>{e()}),K1=[]},"attachFunctions"),P8=T(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function gE(e){const t=e.match(TS);if(!t)return{text:e,metadata:{}};let r=pI(t[1],{schema:fI})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:e.slice(t[0].length),metadata:i}}T(gE,"extractFrontMatter");var I8=T(e=>e.replace(/\r\n?/g,`
|
|
288
|
+
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),$8=T(e=>{const{text:t,metadata:r}=gE(e),{displayMode:i,title:n,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:n,config:s,text:t}},"processFrontmatter"),j8=T(e=>{const t=on.detectInit(e)??{},r=on.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):(r==null?void 0:r.type)==="wrap"&&(t.wrap=!0),{text:ej(e),directive:t}},"processDirectives");function v0(e){const t=I8(e),r=$8(t),i=j8(r.text),n=d0(r.config,i.directive);return e=P8(i.text),{code:e,title:r.title,config:n}}T(v0,"preprocessDiagram");function mE(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}T(mE,"toBase64");var O8=5e4,z8="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",F8="sandbox",N8="loose",W8="http://www.w3.org/2000/svg",H8="http://www.w3.org/1999/xlink",q8="http://www.w3.org/1999/xhtml",U8="100%",V8="100%",G8="border:0;margin:0;",Y8="margin:0",K8="allow-top-navigation-by-user-activation allow-popups",X8='The "iframe" tag is not supported by your browser.',Q8=["foreignobject"],Z8=["dominant-baseline"];function b0(e){const t=v0(e);return Ku(),J3(t.config??{}),t}T(b0,"processAndSetConfigs");async function yE(e,t){of();try{const{code:r,config:i}=b0(e);return{diagramType:(await xE(r)).type,config:i}}catch(r){if(t!=null&&t.suppressErrors)return!1;throw r}}T(yE,"parse");var X1=T((e,t,r=[])=>`
|
|
289
|
+
.${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),J8=T((e,t=new Map)=>{var i;let r="";if(e.themeCSS!==void 0&&(r+=`
|
|
290
|
+
${e.themeCSS}`),e.fontFamily!==void 0&&(r+=`
|
|
291
|
+
:root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=`
|
|
292
|
+
:root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const l=e.htmlLabels??((i=e.flowchart)==null?void 0:i.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(u=>{G1(u.styles)||l.forEach(h=>{r+=X1(u.id,h,u.styles)}),G1(u.textStyles)||(r+=X1(u.id,"tspan",((u==null?void 0:u.textStyles)||[]).map(h=>h.replace("color","fill"))))})}return r},"createCssStyles"),eN=T((e,t,r,i)=>{const n=J8(e,r),s=xA(t,n,e.themeVariables);return Tm(gz(`${i}{${s}}`),yz)},"createUserStyles"),tN=T((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=qo(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),rN=T((e="",t)=>{var n,s;const r=(s=(n=t==null?void 0:t.viewBox)==null?void 0:n.baseVal)!=null&&s.height?t.viewBox.baseVal.height+"px":V8,i=mE(`<body style="${Y8}">${e}</body>`);return`<iframe style="width:${U8};height:${r};${G8}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${K8}">
|
|
293
|
+
${X8}
|
|
294
|
+
</iframe>`},"putIntoIFrame"),Q1=T((e,t,r,i,n)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",W8);return n&&a.attr("xmlns:xlink",n),a.append("g"),e},"appendDivSvgG");function Am(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}T(Am,"sandboxedIframe");var iN=T((e,t,r,i)=>{var n,s,a;(n=e.getElementById(t))==null||n.remove(),(s=e.getElementById(r))==null||s.remove(),(a=e.getElementById(i))==null||a.remove()},"removeExistingElements"),nN=T(async function(e,t,r){var Y,F,O,$,j,W;of();const i=b0(t);t=i.code;const n=Ir();ue.debug(n),t.length>((n==null?void 0:n.maxTextSize)??O8)&&(t=z8);const s="#"+e,a="i"+e,l="#"+a,u="d"+e,h="#"+u,d=T(()=>{const Z=it(m?l:h).node();Z&&"remove"in Z&&Z.remove()},"removeTempElements");let p=it("body");const m=n.securityLevel===F8,y=n.securityLevel===N8,x=n.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),m){const P=Am(it(r),a);p=it(P.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=it(r);Q1(p,e,u,`font-family: ${x}`,H8)}else{if(iN(document,e,u,a),m){const P=Am(it("body"),a);p=it(P.nodes()[0].contentDocument.body),p.node().style.margin=0}else p=it("body");Q1(p,e,u)}let v,S;try{v=await Rm.fromText(t,{title:i.title})}catch(P){if(n.suppressErrorRendering)throw d(),P;v=await Rm.fromText("error"),S=P}const C=p.select(h).node(),B=v.type,R=C.firstChild,E=R.firstChild,L=(F=(Y=v.renderer).getClasses)==null?void 0:F.call(Y,t,v),k=eN(n,B,L,s),A=document.createElement("style");A.innerHTML=k,R.insertBefore(A,E);try{await v.renderer.draw(t,e,Lv.version,v)}catch(P){throw n.suppressErrorRendering?d():UF.draw(t,e,Lv.version),P}const z=p.select(`${h} svg`),U=($=(O=v.db).getAccTitle)==null?void 0:$.call(O),q=(W=(j=v.db).getAccDescription)==null?void 0:W.call(j);vE(B,z,U,q),p.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",q8);let H=p.select(h).node().innerHTML;if(ue.debug("config.arrowMarkerAbsolute",n.arrowMarkerAbsolute),H=tN(H,m,ar(n.arrowMarkerAbsolute)),m){const P=p.select(h+" svg").node();H=rN(H,P)}else y||(H=Ns.sanitize(H,{ADD_TAGS:Q8,ADD_ATTR:Z8,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(D8(),S)throw S;return d(),{diagramType:B,svg:H,bindFunctions:v.db.bindFunctions}},"render");function _E(e={}){var i;const t=sr({},e);t!=null&&t.fontFamily&&!((i=t.themeVariables)!=null&&i.fontFamily)&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),Q3(t),t!=null&&t.theme&&t.theme in Jn?t.themeVariables=Jn[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Jn.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?X3(t):AS();My(r.logLevel),of()}T(_E,"initialize");var xE=T((e,t={})=>{const{code:r}=v0(e);return Rm.fromText(r,t)},"getDiagramFromText");function vE(e,t,r,i){fE(t,e),pE(t,r,i,t.attr("id"))}T(vE,"addA11yInfo");var jo=Object.freeze({render:nN,parse:yE,getDiagramFromText:xE,initialize:_E,getConfig:Ir,setConfig:DS,getSiteConfig:AS,updateSiteConfig:Z3,reset:T(()=>{Ku()},"reset"),globalReset:T(()=>{Ku(Pa)},"globalReset"),defaultConfig:Pa});My(Ir().logLevel);Ku(Ir());var sN=T((e,t,r)=>{ue.warn(e),u0(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),bE=T(async function(e={querySelector:".mermaid"}){try{await oN(e)}catch(t){if(u0(t)&&ue.error(t.str),wi.parseError&&wi.parseError(t),!e.suppressErrors)throw ue.error("Use the suppressErrors option to suppress these errors"),t}},"run"),oN=T(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=jo.getConfig();ue.debug(`${e?"":"No "}Callback function found`);let n;if(r)n=r;else if(t)n=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");ue.debug(`Found ${n.length} diagrams`),(i==null?void 0:i.startOnLoad)!==void 0&&(ue.debug("Start On Load: "+(i==null?void 0:i.startOnLoad)),jo.updateSiteConfig({startOnLoad:i==null?void 0:i.startOnLoad}));const s=new on.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const l=[];for(const u of Array.from(n)){if(ue.info("Rendering diagram: "+u.id),u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");const h=`mermaid-${s.next()}`;a=u.innerHTML,a=Wk(on.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const d=on.detectInit(a);d&&ue.debug("Detected early reinit: ",d);try{const{svg:p,bindFunctions:m}=await kE(h,a,u);u.innerHTML=p,e&&await e(h),m&&m(u)}catch(p){sN(p,l,wi.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),SE=T(function(e){jo.initialize(e)},"initialize"),aN=T(async function(e,t,r){ue.warn("mermaid.init is deprecated. Please use run instead."),e&&SE(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await bE(i)},"init"),lN=T(async(e,{lazyLoad:t=!0}={})=>{of(),Fg(...e),t===!1&&await R8()},"registerExternalDiagrams"),wE=T(function(){if(wi.startOnLoad){const{startOnLoad:e}=jo.getConfig();e&&wi.run().catch(t=>ue.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",wE,!1);var cN=T(function(e){wi.parseError=e},"setParseErrorHandler"),kd=[],yg=!1,CE=T(async()=>{if(!yg){for(yg=!0;kd.length>0;){const e=kd.shift();if(e)try{await e()}catch(t){ue.error("Error executing queue",t)}}yg=!1}},"executeQueue"),hN=T(async(e,t)=>new Promise((r,i)=>{const n=T(()=>new Promise((s,a)=>{jo.parse(e,t).then(l=>{s(l),r(l)},l=>{var u;ue.error("Error parsing",l),(u=wi.parseError)==null||u.call(wi,l),a(l),i(l)})}),"performCall");kd.push(n),CE().catch(i)}),"parse"),kE=T((e,t,r)=>new Promise((i,n)=>{const s=T(()=>new Promise((a,l)=>{jo.render(e,t,r).then(u=>{a(u),i(u)},u=>{var h;ue.error("Error parsing",u),(h=wi.parseError)==null||h.call(wi,u),l(u),n(u)})}),"performCall");kd.push(s),CE().catch(n)}),"render"),uN=T(()=>Object.keys(Ao).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),wi={startOnLoad:!0,mermaidAPI:jo,parse:hN,render:kE,init:aN,run:bE,registerExternalDiagrams:lN,registerLayoutLoaders:AT,initialize:SE,parseError:void 0,contentLoaded:wE,setParseErrorHandler:cN,detectType:Ly,registerIconPacks:Pj,getRegisteredDiagramsMetadata:uN},Z1=wi;/*! Check if previously processed *//*!
|
|
295
|
+
* Wait for document loaded before starting the execution
|
|
296
|
+
*/let dN=0;const _g=.2,xg=4,J1=.15,fN=.002;function pN({data:e}){const{theme:t}=Bt(),r=M.useMemo(()=>gN(t),[t]),i=M.useRef(null),n=M.useRef(null),[s,a]=M.useState(0),[l,u]=M.useState(!1),[h,d]=M.useState(null),[p,m]=M.useState(1),[y,x]=M.useState({x:0,y:0}),v=M.useRef(!1),S=M.useRef({x:0,y:0}),C=M.useRef({x:0,y:0}),B=(e==null?void 0:e.format)||"mermaid",R=(e==null?void 0:e.content)||"",E=(e==null?void 0:e.steps)||[],L=(e==null?void 0:e.animate)&&E.length>0,k=(e==null?void 0:e.module)||null,A=(e==null?void 0:e.step)||null;M.useEffect(()=>{Z1.initialize({startOnLoad:!1,theme:"dark",themeVariables:{darkMode:t.id==="dark",background:t.bgSecondary,primaryColor:t.bgTertiary,primaryTextColor:t.textPrimary,primaryBorderColor:t.border,lineColor:t.accent,secondaryColor:t.bgTertiary,tertiaryColor:t.bgSecondary,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',fontSize:"14px",nodeBorder:t.accent,mainBkg:t.bgTertiary,nodeTextColor:t.textPrimary,edgeLabelBackground:t.bgSecondary},flowchart:{htmlLabels:!0,curve:"basis"}})},[t]),M.useEffect(()=>{!R&&E.length===0||(d(null),a(0),L?Z():j(R,B).then(()=>{requestAnimationFrame(()=>z())}))},[R,B,E.length]);const z=M.useCallback(()=>{var dt,ae,ht,ut,Vt,zr,kr,ki;const I=n.current,Q=i.current;if(!I||!Q)return;const te=Q.querySelector("svg");if(!te)return;const X=I.getBoundingClientRect(),ce=te.getAttribute("width")?parseFloat(te.getAttribute("width")):((ae=(dt=te.getBBox)==null?void 0:dt.call(te))==null?void 0:ae.width)||((ut=(ht=te.viewBox)==null?void 0:ht.baseVal)==null?void 0:ut.width)||0,oe=te.getAttribute("height")?parseFloat(te.getAttribute("height")):((zr=(Vt=te.getBBox)==null?void 0:Vt.call(te))==null?void 0:zr.height)||((ki=(kr=te.viewBox)==null?void 0:kr.baseVal)==null?void 0:ki.height)||0;if(!ce||!oe)return;const ye=48,ve=48,Ce=X.width-ye,Ee=X.height-ve;if(Ce<=0||Ee<=0)return;const Ke=Ce/ce,ct=Ee/oe,ze=Math.min(Ke,ct,xg),pt=Math.max(_g,ze);m(pt),x({x:0,y:0})},[]);function U(){m(I=>Math.min(I+J1,xg))}function q(){m(I=>Math.max(I-J1,_g))}function H(){m(1),x({x:0,y:0})}function Y(I){I.preventDefault();const Q=-I.deltaY*fN;m(te=>{const X=te+Q*te;return Math.min(Math.max(X,_g),xg)})}function F(I){I.button===0&&(v.current=!0,S.current={x:I.clientX,y:I.clientY},C.current={...y},I.currentTarget.setPointerCapture(I.pointerId))}function O(I){if(!v.current)return;const Q=I.clientX-S.current.x,te=I.clientY-S.current.y;x({x:C.current.x+Q,y:C.current.y+te})}function $(){v.current=!1}async function j(I,Q){const te=i.current;if(te)try{Q==="mermaid"?await W(te,I):Q==="svg"?P(te,I):Q==="d3"?te.innerHTML=`
|
|
297
|
+
<div style="text-align:center; padding:40px; color:${t.textSecondary};">
|
|
298
|
+
<p>D3 visualization support coming soon</p>
|
|
299
|
+
</div>
|
|
300
|
+
`:d(`Unsupported diagram format: ${Q}`)}catch(X){console.error("[Canvas] Render error:",X),d(X.message||"Failed to render diagram")}}async function W(I,Q){I.innerHTML="";const te=`mermaid-${++dN}`;try{const{svg:X}=await Z1.render(te,Q);I.innerHTML=X}catch(X){const ce=document.getElementById(te);throw ce&&ce.remove(),X}}function P(I,Q){I.innerHTML=Q}async function Z(){u(!0);for(let I=0;I<E.length;I++){a(I);const Q=E[I],te=Q.content||Q,X=Q.format||B;if(await j(te,X),I<E.length-1){const ce=Q.delay||1500;await new Promise(oe=>setTimeout(oe,ce))}}u(!1)}function ee(I){if(l||I<0||I>=E.length)return;a(I);const Q=E[I],te=Q.content||Q,X=Q.format||B;j(te,X)}return e?g.jsxs("div",{style:r.container,children:[(k||A)&&g.jsxs("div",{style:r.breadcrumb,children:[k&&g.jsx("span",{style:r.breadcrumbModule,children:k}),k&&A&&g.jsx("span",{style:r.breadcrumbSep,children:"/"}),A&&g.jsx("span",{style:r.breadcrumbStep,children:A})]}),g.jsxs("div",{style:r.zoomControls,children:[g.jsx("button",{onClick:q,style:r.zoomButton,title:"Zoom out","aria-label":"Zoom out",children:"−"}),g.jsxs("span",{style:r.zoomLevel,children:[Math.round(p*100),"%"]}),g.jsx("button",{onClick:U,style:r.zoomButton,title:"Zoom in","aria-label":"Zoom in",children:"+"}),g.jsx("div",{style:r.zoomDivider}),g.jsx("button",{onClick:z,style:r.zoomButton,title:"Fit to canvas","aria-label":"Fit to canvas",children:g.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("polyline",{points:"1,5 1,1 5,1"}),g.jsx("polyline",{points:"9,1 13,1 13,5"}),g.jsx("polyline",{points:"13,9 13,13 9,13"}),g.jsx("polyline",{points:"5,13 1,13 1,9"})]})}),g.jsx("button",{onClick:H,style:r.zoomButton,title:"Reset zoom (100%)","aria-label":"Reset zoom",children:"1:1"})]}),g.jsx("div",{ref:n,style:r.diagramWrapper,onWheel:Y,onPointerDown:F,onPointerMove:O,onPointerUp:$,onPointerCancel:$,children:h?g.jsxs("div",{style:r.errorBox,children:[g.jsx("p",{style:r.errorTitle,children:"Render Error"}),g.jsx("pre",{style:r.errorMessage,children:h}),g.jsx("p",{style:r.errorHint,children:"The diagram syntax may be invalid."})]}):g.jsx("div",{ref:i,style:{...r.diagram,transform:`translate(${y.x}px, ${y.y}px) scale(${p})`,cursor:v.current?"grabbing":"grab"}})}),E.length>0&&g.jsxs("div",{style:r.stepControls,children:[g.jsxs("button",{onClick:()=>ee(s-1),disabled:s===0||l,style:{...r.stepButton,opacity:s===0||l?.4:1},children:["◀"," Prev"]}),g.jsx("div",{style:r.stepIndicators,children:E.map((I,Q)=>g.jsx("button",{onClick:()=>ee(Q),disabled:l,style:{...r.stepDot,backgroundColor:Q===s?t.accent:t.border}},Q))}),g.jsx("span",{style:r.stepLabel,children:l?"Animating...":`Step ${s+1} of ${E.length}`}),g.jsxs("button",{onClick:()=>ee(s+1),disabled:s>=E.length-1||l,style:{...r.stepButton,opacity:s>=E.length-1||l?.4:1},children:["Next ","▶"]})]}),(e==null?void 0:e.awaitingAnswer)&&g.jsxs("div",{style:r.answerPrompt,children:[g.jsx("span",{style:r.promptIcon,children:"💬"}),g.jsx("span",{children:"Answer in the terminal"})]})]}):g.jsxs("div",{style:r.empty,children:[g.jsx("div",{style:r.emptyIcon,children:"🎨"}),g.jsx("p",{style:r.emptyTitle,children:"Canvas Ready"}),g.jsx("p",{style:r.emptySubtext,children:"Diagrams and visualizations will appear here during lessons."})]})}function gN(e){return{container:{display:"flex",flexDirection:"column",gap:8,height:"100%",minHeight:0},breadcrumb:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:e.textSecondary,flexShrink:0},breadcrumbModule:{color:e.accent,fontWeight:500},breadcrumbSep:{color:e.textMuted},breadcrumbStep:{color:e.textPrimary},zoomControls:{display:"flex",alignItems:"center",gap:4,flexShrink:0},zoomButton:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:28,fontSize:14,fontWeight:500,color:e.textSecondary,backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer",transition:"background-color 0.15s ease, color 0.15s ease",padding:0,lineHeight:1},zoomLevel:{fontSize:12,color:e.textSecondary,minWidth:42,textAlign:"center",fontVariantNumeric:"tabular-nums"},zoomDivider:{width:1,height:16,backgroundColor:e.border,margin:"0 4px"},diagramWrapper:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,flex:1,minHeight:300,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",position:"relative",touchAction:"none",userSelect:"none"},diagram:{transformOrigin:"center center",transition:"none",display:"inline-flex",alignItems:"center",justifyContent:"center"},stepControls:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,padding:"8px 0",flexShrink:0},stepButton:{padding:"6px 14px",fontSize:13,fontWeight:500,color:e.textPrimary,backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer",transition:"opacity 0.15s ease"},stepIndicators:{display:"flex",gap:6},stepDot:{width:10,height:10,borderRadius:"50%",border:"none",cursor:"pointer",transition:"background-color 0.2s ease"},stepLabel:{fontSize:12,color:e.textSecondary,minWidth:100,textAlign:"center"},answerPrompt:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"14px 20px",backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:10,fontSize:14,color:e.textPrimary,animation:"pulse 2s infinite",flexShrink:0},promptIcon:{fontSize:18},errorBox:{textAlign:"center",padding:24,color:e.error},errorTitle:{fontSize:16,fontWeight:600,margin:"0 0 8px"},errorMessage:{fontSize:13,fontFamily:"monospace",backgroundColor:e.bgTertiary,padding:"8px 12px",borderRadius:6,margin:"0 0 8px",whiteSpace:"pre-wrap",textAlign:"left",color:e.error},errorHint:{fontSize:13,color:e.textSecondary,margin:0},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0}}}function mN({data:e,sendEvent:t}){const{theme:r}=Bt(),i=M.useMemo(()=>bN(r),[r]);if(!e)return g.jsxs("div",{style:i.empty,children:[g.jsx("div",{style:i.emptyIcon,children:"🧠"}),g.jsx("p",{style:i.emptyTitle,children:"Quiz Mode"}),g.jsx("p",{style:i.emptySubtext,children:"Interactive quizzes will appear here during lessons."})]});const{quizType:n,question:s,items:a,timeLimit:l,options:u,pairs:h,code:d,blanks:p,correctIndex:m,correctAnswer:y}=e;switch(n){case"drag-order":return g.jsx(yN,{question:s,items:a||[],sendEvent:t,theme:r,s:i});case"timed-choice":return g.jsx(_N,{question:s,options:u||a||[],timeLimit:l||30,correctIndex:m,correctAnswer:y,sendEvent:t,theme:r,s:i});case"matching":return g.jsx(xN,{question:s,pairs:h||a||[],sendEvent:t,theme:r,s:i});case"fill-blank":return g.jsx(vN,{question:s,code:d||"",blanks:p||[],sendEvent:t,theme:r,s:i});default:return g.jsx("div",{style:i.errorBox,children:g.jsxs("p",{children:["Unknown quiz type: ",n]})})}}function yN({question:e,items:t,sendEvent:r,theme:i,s:n}){const[s,a]=M.useState(t),[l,u]=M.useState(null),[h,d]=M.useState(null),[p,m]=M.useState(!1),[y,x]=M.useState(null);M.useEffect(()=>{a(t),m(!1),x(null)},[t]);function v(E,L){u(L),E.dataTransfer.effectAllowed="move",E.dataTransfer.setData("text/plain",L.toString()),E.target&&(E.target.style.opacity="0.5")}function S(E){E.target&&(E.target.style.opacity="1"),u(null),d(null)}function C(E,L){E.preventDefault(),E.dataTransfer.dropEffect="move",L!==h&&d(L)}function B(E,L){E.preventDefault();const k=l;if(k===null||k===L)return;const A=[...s],[z]=A.splice(k,1);A.splice(L,0,z),a(A),u(null),d(null)}function R(){m(!0);const E=s.map(A=>typeof A=="string"?A:A.id||A.label),L=t.map(A=>typeof A=="string"?A:A.id||A.label),k=E.length===L.length&&E.every((A,z)=>A===L[z]);r("event:quiz-answer",{quizType:"drag-order",answer:E,correct:k}),x(k?"correct":"wrong")}return g.jsxs("div",{style:n.quizContainer,children:[g.jsx("h2",{style:n.question,children:e}),g.jsx("p",{style:n.hint,children:"Drag items to reorder them"}),g.jsx("div",{style:n.dragList,children:s.map((E,L)=>{const k=typeof E=="string"?E:E.label||E.text||E.id,A=h===L,z=l===L,U=t[L]?typeof t[L]=="string"?t[L]:t[L].id||t[L].label:null,q=typeof E=="string"?E:E.id||E.label,H=p&&U===q,Y=p&&U!==q;return g.jsxs("div",{draggable:!p,onDragStart:F=>v(F,L),onDragEnd:S,onDragOver:F=>C(F,L),onDrop:F=>B(F,L),style:{...n.dragItem,borderColor:p?H?i.success:i.error:A?i.accent:i.border,backgroundColor:z?i.bgTertiary:i.bgSecondary,transform:A?"scale(1.01)":"scale(1)",opacity:p&&Y?.7:1,cursor:p?"default":"grab"},children:[g.jsx("span",{style:n.dragHandle,children:"☰"}),g.jsx("span",{style:n.dragIndex,children:L+1}),g.jsx("span",{style:n.dragLabel,children:k}),p&&H&&g.jsx("span",{style:{marginLeft:"auto"},children:"✅"}),p&&Y&&g.jsx("span",{style:{marginLeft:"auto"},children:"❌"})]},`${k}-${L}`)})}),!p&&g.jsx("button",{onClick:R,style:n.submitButton,children:"Submit Order"}),p&&g.jsx("div",{style:{...n.pendingResult,color:y==="correct"?i.success:i.error},children:y==="correct"?"✅ Correct order!":"❌ Not quite right. Check the highlighted items."})]})}function _N({question:e,options:t,timeLimit:r,correctIndex:i,correctAnswer:n,sendEvent:s,theme:a,s:l}){const[u,h]=M.useState(null),[d,p]=M.useState(!1),[m,y]=M.useState(r),[x,v]=M.useState(null),S=M.useRef(null),C=M.useMemo(()=>{if(typeof i=="number")return i;if(n!=null){const k=t.findIndex(A=>(typeof A=="string"?A:A.id||A.label||A.text)===n);return k>=0?k:null}return null},[i,n,t]);M.useEffect(()=>(h(null),p(!1),y(r),v(null),S.current=setInterval(()=>{y(k=>k<=1?(clearInterval(S.current),0):k-1)},1e3),()=>{S.current&&clearInterval(S.current)}),[e,r]),M.useEffect(()=>{m===0&&!d&&B(null)},[m,d]);function B(k){if(d)return;p(!0),h(k),S.current&&clearInterval(S.current);const A=k!==null?typeof k=="string"?k:k.id||k.label||k:null;let z=!1;k===null?v("timeout"):C!=null?(z=t.indexOf(k)===C,v(z?"correct":"wrong")):v("pending"),s("event:quiz-answer",{quizType:"timed-choice",answer:A,correct:C!=null?z:void 0,timeMs:(r-m)*1e3})}const R=m/r*100,E=m>r*.5?a.success:m>r*.2?a.warning:a.error,L=C!=null&&t[C]?typeof t[C]=="string"?t[C]:t[C].label||t[C].text:null;return g.jsxs("div",{style:l.quizContainer,children:[g.jsx("div",{style:l.timerBar,children:g.jsx("div",{style:{...l.timerFill,width:`${R}%`,backgroundColor:E}})}),g.jsx("div",{style:l.timerLabel,children:g.jsxs("span",{children:["⏱"," ",m,"s"]})}),g.jsx("h2",{style:l.question,children:e}),g.jsx("div",{style:l.choiceGrid,children:t.map((k,A)=>{const z=typeof k=="string"?k:k.label||k.text,U=typeof k=="string"?k:k.id||k.label,q=u!==null&&(typeof u=="string"?u:u.id||u.label)===U,H=d&&C===A,Y=d&&q&&x==="wrong";let F=a.border,O=a.bgSecondary;return d&&H?(F=a.success,O=`${a.success}18`):Y?(F=a.error,O=`${a.error}18`):q&&(F=a.accent,O=`${a.accent}18`),g.jsxs("button",{onClick:()=>!d&&B(k),disabled:d,style:{...l.choiceButton,borderColor:F,backgroundColor:O,cursor:d?"default":"pointer",opacity:d&&!q&&!H?.5:1},children:[g.jsx("span",{style:l.choiceLetter,children:String.fromCharCode(65+A)}),g.jsx("span",{style:l.choiceText,children:z}),d&&H&&g.jsx("span",{style:{marginLeft:"auto",fontSize:18},children:"✅"}),Y&&g.jsx("span",{style:{marginLeft:"auto",fontSize:18},children:"❌"})]},`${U}-${A}`)})}),d&&g.jsxs("div",{style:{...l.pendingResult,color:x==="correct"?a.success:x==="wrong"?a.error:x==="timeout"?a.warning:a.textSecondary},children:[x==="correct"&&"✅ Correct!",x==="wrong"&&(L?`❌ Incorrect. The answer was: ${L}`:"❌ Incorrect."),x==="timeout"&&(L?`⏰ Time's up! The answer was: ${L}`:"⏰ Time's up! No answer submitted."),x==="pending"&&"Checking your answer..."]})]})}function xN({question:e,pairs:t,sendEvent:r,theme:i,s:n}){const[s]=M.useState(()=>t.map(R=>R.left||R.a||R.term)),[a]=M.useState(()=>[...t.map(E=>E.right||E.b||E.definition)].sort(()=>Math.random()-.5)),[l,u]=M.useState({}),[h,d]=M.useState(null),[p,m]=M.useState(!1);M.useEffect(()=>{u({}),d(null),m(!1)},[e]);function y(R){p||d(h===R?null:R)}function x(R){if(p||!h)return;const E={...l};delete E[h];for(const[L,k]of Object.entries(E))k===R&&delete E[L];E[h]=R,u(E),d(null)}const v=M.useMemo(()=>{const R={};for(const E of t){const L=E.left||E.a||E.term,k=E.right||E.b||E.definition;R[L]=k}return R},[t]);function S(){m(!0);const R=s.filter(E=>l[E]===v[E]).length;r("event:quiz-answer",{quizType:"matching",answer:l,correct:R===s.length,score:R})}const C=Object.keys(l).length===s.length,B=new Set(Object.values(l));return g.jsxs("div",{style:n.quizContainer,children:[g.jsx("h2",{style:n.question,children:e}),g.jsx("p",{style:n.hint,children:"Click a left item, then click its match on the right"}),g.jsxs("div",{style:n.matchingContainer,children:[g.jsx("div",{style:n.matchingColumn,children:s.map((R,E)=>{const L=h===R,k=R in l;return g.jsxs("button",{onClick:()=>y(R),disabled:p,style:{...n.matchItem,borderColor:L?i.accent:k?i.success:i.border,backgroundColor:L?`${i.accent}18`:k?`${i.success}10`:i.bgSecondary,cursor:p?"default":"pointer"},children:[R,k&&g.jsx("span",{style:n.matchCheck,children:"✔"})]},`left-${E}`)})}),g.jsx("div",{style:n.matchingArrows,children:s.map((R,E)=>g.jsx("div",{style:n.arrowRow,children:l[R]?g.jsx("span",{style:n.arrowConnected,children:"──▶"}):g.jsx("span",{style:n.arrowEmpty,children:"···"})},E))}),g.jsx("div",{style:n.matchingColumn,children:a.map((R,E)=>{const L=B.has(R);return g.jsx("button",{onClick:()=>x(R),disabled:p||!h,style:{...n.matchItem,borderColor:L?i.success:i.border,backgroundColor:L?`${i.success}10`:i.bgSecondary,cursor:p||!h?"default":"pointer",opacity:p&&!L?.5:1},children:R},`right-${E}`)})})]}),!p&&g.jsx("button",{onClick:S,disabled:!C,style:{...n.submitButton,opacity:C?1:.5,cursor:C?"pointer":"not-allowed"},children:"Submit Matches"}),p&&(()=>{const R=s.filter(L=>l[L]===v[L]).length,E=R===s.length;return g.jsx("div",{style:{...n.pendingResult,color:E?i.success:i.error},children:E?"✅ All matches correct!":`❌ ${R} of ${s.length} correct.`})})()]})}function vN({question:e,code:t,blanks:r,sendEvent:i,theme:n,s}){const[a,l]=M.useState(()=>r.map(()=>"")),[u,h]=M.useState(!1);M.useEffect(()=>{l(r.map(()=>"")),h(!1)},[e,t]);function d(v,S){if(u)return;const C=[...a];C[v]=S,l(C)}function p(){return r.map((v,S)=>{const C=(a[S]||"").trim().toLowerCase();return(Array.isArray(v.answer)?v.answer.map(R=>R.toLowerCase()):[String(v.answer||"").toLowerCase()]).includes(C)})}function m(){h(!0);const S=p().filter(Boolean).length;i("event:quiz-answer",{quizType:"fill-blank",answer:a,correct:S===r.length,score:S})}function y(){const v=t.split(/(___\d+___)/g),S=u?p():[];return v.map((C,B)=>{var E,L;const R=C.match(/___(\d+)___/);if(R){const k=parseInt(R[1],10),A=r[k]||{},z=u&&S[k],U=u&&!S[k];return g.jsxs("span",{style:{display:"inline-block",position:"relative"},children:[g.jsx("input",{type:"text",value:a[k]||"",onChange:q=>d(k,q.target.value),disabled:u,placeholder:A.placeholder||"...",style:{...s.blankInput,width:Math.max(80,(((E=a[k])==null?void 0:E.length)||((L=A.placeholder)==null?void 0:L.length)||3)*9+20),borderColor:z?"#3fb950":U?"#f85149":void 0}}),U&&A.answer&&g.jsxs("span",{style:{display:"block",fontSize:11,color:"#f85149",marginTop:2},children:["Expected: ",Array.isArray(A.answer)?A.answer[0]:A.answer]})]},`blank-${B}`)}return g.jsx("span",{children:C},`code-${B}`)})}const x=a.every(v=>v.trim().length>0);return g.jsxs("div",{style:s.quizContainer,children:[g.jsx("h2",{style:s.question,children:e}),g.jsx("pre",{style:s.codeBlock,children:g.jsx("code",{children:y()})}),!u&&g.jsx("button",{onClick:m,disabled:!x,style:{...s.submitButton,opacity:x?1:.5,cursor:x?"pointer":"not-allowed"},children:"Submit Answer"}),u&&(()=>{const S=p().filter(Boolean).length,C=S===r.length;return g.jsx("div",{style:{...s.pendingResult,color:C?"#3fb950":"#f85149"},children:C?"✅ All blanks correct!":`❌ ${S} of ${r.length} correct.`})})()]})}function bN(e){return{quizContainer:{maxWidth:700,margin:"0 auto",display:"flex",flexDirection:"column",gap:20},question:{fontSize:22,fontWeight:700,color:e.textBright,margin:0,lineHeight:1.4},hint:{fontSize:13,color:e.textSecondary,margin:0},submitButton:{alignSelf:"center",padding:"10px 28px",fontSize:14,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:8,cursor:"pointer",transition:"background-color 0.15s ease"},pendingResult:{textAlign:"center",padding:"12px 20px",backgroundColor:e.bgTertiary,borderRadius:8,fontSize:14,color:e.textSecondary},errorBox:{textAlign:"center",padding:40,color:e.error,fontSize:16},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0},dragList:{display:"flex",flexDirection:"column",gap:8},dragItem:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid",borderRadius:8,transition:"border-color 0.15s ease, transform 0.1s ease, background-color 0.15s ease",userSelect:"none"},dragHandle:{fontSize:16,color:e.textMuted,cursor:"grab"},dragIndex:{width:24,height:24,borderRadius:"50%",backgroundColor:e.bgTertiary,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,color:e.textSecondary,flexShrink:0},dragLabel:{fontSize:14,color:e.textPrimary},timerBar:{height:4,backgroundColor:e.bgTertiary,borderRadius:2,overflow:"hidden"},timerFill:{height:"100%",borderRadius:2,transition:"width 1s linear, background-color 0.3s ease"},timerLabel:{textAlign:"right",fontSize:13,color:e.textSecondary},choiceGrid:{display:"flex",flexDirection:"column",gap:10},choiceButton:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",border:"1px solid",borderRadius:10,textAlign:"left",transition:"border-color 0.15s ease, background-color 0.15s ease",width:"100%",fontSize:14,color:e.textPrimary,fontFamily:"inherit"},choiceLetter:{width:28,height:28,borderRadius:"50%",backgroundColor:e.bgTertiary,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:e.textSecondary,flexShrink:0},choiceText:{flex:1},matchingContainer:{display:"flex",gap:16,alignItems:"flex-start"},matchingColumn:{flex:1,display:"flex",flexDirection:"column",gap:8},matchingArrows:{display:"flex",flexDirection:"column",gap:8,justifyContent:"flex-start",paddingTop:0},arrowRow:{height:46,display:"flex",alignItems:"center",justifyContent:"center"},arrowConnected:{color:e.success,fontFamily:"monospace",fontSize:14},arrowEmpty:{color:e.border,fontFamily:"monospace",fontSize:14},matchItem:{padding:"10px 16px",border:"1px solid",borderRadius:8,fontSize:14,color:e.textPrimary,backgroundColor:e.bgSecondary,fontFamily:"inherit",width:"100%",textAlign:"left",transition:"border-color 0.15s ease, background-color 0.15s ease",display:"flex",alignItems:"center",justifyContent:"space-between"},matchCheck:{color:e.success,marginLeft:8},codeBlock:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,padding:"20px 24px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:14,lineHeight:1.7,color:e.textPrimary,overflow:"auto",whiteSpace:"pre-wrap"},blankInput:{display:"inline-block",padding:"2px 8px",fontSize:14,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',color:e.accent,backgroundColor:e.bgPrimary,border:`1px solid ${e.accent}`,borderRadius:4,outline:"none",verticalAlign:"baseline"}}}const SN=M.lazy(()=>lt(()=>import("./index-BSswTuBk.js"),[]));function wN({data:e,sendEvent:t}){const{theme:r}=Bt(),i=M.useMemo(()=>kN(r),[r]),[n,s]=M.useState(""),[a,l]=M.useState(""),[u,h]=M.useState(""),[d,p]=M.useState(!1),[m,y]=M.useState("javascript");M.useEffect(()=>{if(!e)return;const R=e.starter||"";l(R),s(R),h(""),y(e.language||"javascript"),p(!1)},[e]);const x=M.useCallback(async()=>{if(!d){p(!0),h("Running..."),t("event:code-run",{code:n,language:m});try{const E=await(await fetch("http://localhost:3456/api/playground/exec",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:n,language:m})})).json();E.error?h(E.error):h(E.output||"(no output)")}catch{h("Error: Could not connect to bridge server.")}finally{p(!1)}}},[n,m,d,t]),v=M.useCallback(()=>{s(a),h("")},[a]),S=M.useCallback(()=>{t("event:click",{element:"hint",data:{language:m,code:n}})},[m,n,t]),C={bash:"shell",sh:"shell",javascript:"javascript",js:"javascript",python:"python",py:"python",typescript:"typescript",ts:"typescript"}[m]||m,B=r.id==="light"?"light":"vs-dark";return e?g.jsxs("div",{style:i.container,children:[g.jsxs("div",{style:i.header,children:[g.jsxs("div",{style:i.headerLeft,children:[g.jsx("span",{style:i.langBadge,children:m}),e.instructions&&g.jsx("span",{style:i.instructions,children:e.instructions})]}),g.jsxs("div",{style:i.headerRight,children:[g.jsxs("button",{onClick:S,style:i.hintButton,children:["💡"," Hint"]}),g.jsxs("button",{onClick:v,style:i.resetButton,children:["↺"," Reset"]}),g.jsx("button",{onClick:x,disabled:d,style:{...i.runButton,opacity:d?.7:1},children:d?"⏳ Running...":"▶ Run"})]})]}),g.jsx("div",{style:i.editorContainer,children:g.jsx(M.Suspense,{fallback:g.jsx(CN,{code:n,onChange:s,theme:r,s:i}),children:g.jsx(SN,{height:"350px",language:C,value:n,onChange:R=>s(R||""),theme:B,options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12},renderLineHighlight:"none",overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8}}})})}),g.jsxs("div",{style:i.outputContainer,children:[g.jsxs("div",{style:i.outputHeader,children:[g.jsx("span",{style:i.outputTitle,children:"Output"}),u&&g.jsx("button",{onClick:()=>h(""),style:i.clearButton,children:"Clear"})]}),g.jsx("pre",{style:i.outputContent,children:u||"Run your code to see output here."})]})]}):g.jsxs("div",{style:i.empty,children:[g.jsx("div",{style:i.emptyIcon,children:"💻"}),g.jsx("p",{style:i.emptyTitle,children:"Code Playground"}),g.jsx("p",{style:i.emptySubtext,children:"Interactive code exercises will appear here during lessons."})]})}function CN({code:e,onChange:t,theme:r,s:i}){return g.jsxs("div",{style:i.fallbackContainer,children:[g.jsx("div",{style:i.fallbackLoading,children:"Loading editor..."}),g.jsx("textarea",{value:e,onChange:n=>t(n.target.value),style:i.fallbackTextarea,spellCheck:!1})]})}function kN(e){return{container:{display:"flex",flexDirection:"column",gap:0,maxWidth:900,margin:"0 auto",border:`1px solid ${e.border}`,borderRadius:12,overflow:"hidden"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.border}`,flexWrap:"wrap",gap:8},headerLeft:{display:"flex",alignItems:"center",gap:12},langBadge:{fontSize:12,fontWeight:600,color:e.textPrimary,backgroundColor:e.bgTertiary,padding:"3px 10px",borderRadius:12,textTransform:"uppercase",letterSpacing:"0.05em"},instructions:{fontSize:13,color:e.textSecondary},headerRight:{display:"flex",alignItems:"center",gap:8},hintButton:{padding:"5px 12px",fontSize:13,color:e.warning,backgroundColor:"transparent",border:`1px solid ${e.warning}40`,borderRadius:6,cursor:"pointer",transition:"background-color 0.15s ease"},resetButton:{padding:"5px 12px",fontSize:13,color:e.textSecondary,backgroundColor:"transparent",border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer",transition:"background-color 0.15s ease"},runButton:{padding:"5px 16px",fontSize:13,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:6,cursor:"pointer",transition:"opacity 0.15s ease"},editorContainer:{backgroundColor:e.id==="light"?"#ffffff":"#1e1e1e",minHeight:350},outputContainer:{backgroundColor:e.bgPrimary,borderTop:`1px solid ${e.border}`},outputHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:`1px solid ${e.bgTertiary}`},outputTitle:{fontSize:12,fontWeight:600,color:e.textSecondary,textTransform:"uppercase",letterSpacing:"0.05em"},clearButton:{fontSize:11,color:e.textMuted,backgroundColor:"transparent",border:"none",cursor:"pointer"},outputContent:{padding:"12px 16px",margin:0,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:13,lineHeight:1.6,color:e.textSecondary,minHeight:80,maxHeight:200,overflow:"auto",whiteSpace:"pre-wrap"},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0},fallbackContainer:{position:"relative",height:350},fallbackLoading:{position:"absolute",top:12,right:16,fontSize:12,color:e.textMuted,zIndex:1},fallbackTextarea:{width:"100%",height:"100%",padding:"12px 16px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:14,lineHeight:1.6,color:e.textPrimary,backgroundColor:e.id==="light"?"#ffffff":"#1e1e1e",border:"none",outline:"none",resize:"none"}}}const TN="http://localhost:3456";function EN({data:e,sendEvent:t}){const{theme:r}=Bt(),i=M.useMemo(()=>MN(r),[r]),[n,s]=M.useState([]),[a,l]=M.useState("~"),[u,h]=M.useState(""),[d,p]=M.useState(!1),[m,y]=M.useState(null),[x,v]=M.useState([]),[S,C]=M.useState(-1),B=M.useRef(null),R=M.useRef(null);M.useEffect(()=>{e&&(e.cwd&&l(e.cwd),e.resetHistory&&(s([]),y(null),v([]),C(-1)))},[e]),M.useEffect(()=>{B.current&&typeof B.current.scrollIntoView=="function"&&B.current.scrollIntoView({behavior:"smooth"})},[n]),M.useEffect(()=>{var q;d||(q=R.current)==null||q.focus()},[d,e]);const E=M.useCallback(async q=>{if(q.trim()){p(!0),s(H=>[...H,{type:"command",cwd:a,text:q}]),v(H=>[...H,q]),C(-1);try{const Y=await(await fetch(`${TN}/api/terminal/exec`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:q,sessionId:m,cwd:e==null?void 0:e.cwd})})).json();!m&&Y.sessionId&&y(Y.sessionId),Y.cwd&&l(Y.cwd),Y.output&&s(F=>[...F,{type:"output",text:Y.output,exitCode:Y.exitCode}])}catch{s(Y=>[...Y,{type:"output",text:"Error: Could not connect to bridge server. Is it running?",exitCode:1}])}finally{p(!1)}}},[a,m,e==null?void 0:e.cwd]),L=M.useCallback(q=>{if(q.key==="Enter"&&!d){q.preventDefault();const H=u.trim();H&&(E(H),h(""))}else if(q.key==="ArrowUp"){if(q.preventDefault(),x.length===0)return;const H=S===-1?x.length-1:Math.max(0,S-1);C(H),h(x[H])}else if(q.key==="ArrowDown"){if(q.preventDefault(),S===-1)return;const H=S+1;H>=x.length?(C(-1),h("")):(C(H),h(x[H]))}else q.key==="l"&&q.ctrlKey&&(q.preventDefault(),s([]))},[u,d,E,x,S]),k=eb(a);if(!e)return g.jsxs("div",{style:i.empty,children:[g.jsx("div",{style:i.emptyIcon,children:">_"}),g.jsx("p",{style:i.emptyTitle,children:"Practice Terminal"}),g.jsx("p",{style:i.emptySubtext,children:"A hands-on terminal will appear here during lessons."})]});const A=e.validations||[],z=A.filter(q=>q.passed).length,U=A.length>0&&z===A.length;return g.jsxs("div",{style:i.container,children:[g.jsxs("div",{style:i.taskPanel,children:[g.jsxs("div",{style:i.taskHeader,children:[g.jsx("span",{style:i.taskLabel,children:"Task"}),e.module&&g.jsx("span",{style:i.moduleBadge,children:e.module}),A.length>0&&g.jsxs("span",{style:{...i.progressBadge,color:U?r.success:r.warning},children:[z,"/",A.length]})]}),g.jsx("p",{style:i.taskText,children:e.task}),A.length>0&&g.jsx("div",{style:i.validations,children:A.map((q,H)=>g.jsxs("div",{style:i.validationRow,children:[g.jsx("span",{style:{...i.validationCheck,color:q.passed?r.success:r.textMuted},children:q.passed?"✓":"○"}),g.jsx("span",{style:{...i.validationLabel,color:q.passed?r.textSecondary:r.textPrimary,textDecoration:q.passed?"line-through":"none"},children:q.label})]},H))}),e.feedback&&g.jsxs("div",{style:i.feedbackBox,children:[g.jsx("span",{style:i.feedbackIcon,children:U?"✓":"→"}),g.jsx("span",{style:i.feedbackText,children:e.feedback})]}),e.hints&&e.hints.length>0&&g.jsx(BN,{hints:e.hints,theme:r,s:i})]}),g.jsxs("div",{style:i.terminalArea,onClick:()=>{var q;return(q=R.current)==null?void 0:q.focus()},children:[g.jsxs("div",{style:i.terminalHeader,children:[g.jsxs("div",{style:i.terminalDots,children:[g.jsx("span",{style:{...i.dot,backgroundColor:r.error}}),g.jsx("span",{style:{...i.dot,backgroundColor:r.warning}}),g.jsx("span",{style:{...i.dot,backgroundColor:r.success}})]}),g.jsx("span",{style:i.terminalTitle,children:k})]}),g.jsxs("div",{style:i.terminalBody,children:[n.map((q,H)=>g.jsx("div",{children:q.type==="command"?g.jsxs("div",{style:i.cmdLine,children:[g.jsxs("span",{style:i.prompt,children:[eb(q.cwd)," $"]}),g.jsx("span",{style:i.cmdText,children:q.text})]}):g.jsx("pre",{style:{...i.outputText,color:q.exitCode!==0?r.error:r.textSecondary},children:q.text})},H)),g.jsxs("div",{style:i.cmdLine,children:[g.jsxs("span",{style:i.prompt,children:[k," $"]}),g.jsx("input",{ref:R,type:"text",value:u,onChange:q=>h(q.target.value),onKeyDown:L,disabled:d,style:i.cmdInput,spellCheck:!1,autoComplete:"off",placeholder:d?"Running...":"Type a command..."})]}),g.jsx("div",{ref:B})]})]})]})}function BN({hints:e,theme:t,s:r}){const[i,n]=M.useState(!1),[s,a]=M.useState(0);return g.jsx("div",{style:r.hintSection,children:i?g.jsxs("div",{children:[g.jsx("p",{style:r.hintText,children:e[s]}),g.jsx("div",{style:r.hintNav,children:s<e.length-1&&g.jsxs("button",{onClick:()=>a(l=>l+1),style:r.hintButton,children:["Next hint (",s+1,"/",e.length,")"]})})]}):g.jsx("button",{onClick:()=>n(!0),style:r.hintButton,children:"Show hint"})})}function eb(e){if(!e)return"~";const t=e.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~"),r=t.split("/");return r.length<=3?t:r[0]+"/.../"+r.slice(-2).join("/")}function MN(e){return{container:{display:"flex",flexDirection:"column",gap:0,maxWidth:900,margin:"0 auto",border:`1px solid ${e.border}`,borderRadius:12,overflow:"hidden",height:"calc(100vh - 120px)"},taskPanel:{padding:"16px 20px",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.border}`,flexShrink:0},taskHeader:{display:"flex",alignItems:"center",gap:10,marginBottom:8},taskLabel:{fontSize:11,fontWeight:700,color:e.accent,textTransform:"uppercase",letterSpacing:"0.08em"},moduleBadge:{fontSize:11,color:e.textSecondary,backgroundColor:e.bgTertiary,padding:"2px 8px",borderRadius:8},progressBadge:{fontSize:11,fontWeight:600,marginLeft:"auto"},taskText:{fontSize:14,lineHeight:1.6,color:e.textBright,margin:0},validations:{marginTop:12,display:"flex",flexDirection:"column",gap:4},validationRow:{display:"flex",alignItems:"center",gap:8},validationCheck:{fontSize:14,fontWeight:700,width:18,textAlign:"center"},validationLabel:{fontSize:13},feedbackBox:{marginTop:12,padding:"10px 14px",backgroundColor:e.bgPrimary,border:`1px solid ${e.border}`,borderRadius:8,display:"flex",alignItems:"flex-start",gap:10},feedbackIcon:{color:e.accent,fontSize:14,fontWeight:700,flexShrink:0,marginTop:1},feedbackText:{fontSize:13,lineHeight:1.5,color:e.textPrimary},hintSection:{marginTop:10},hintButton:{fontSize:12,color:e.warning,backgroundColor:"transparent",border:`1px solid ${e.warning}40`,borderRadius:6,padding:"4px 10px",cursor:"pointer"},hintText:{fontSize:13,color:e.warning,margin:"6px 0",lineHeight:1.5},hintNav:{display:"flex",gap:8},terminalArea:{flex:1,display:"flex",flexDirection:"column",backgroundColor:e.bgPrimary,overflow:"hidden",cursor:"text"},terminalHeader:{display:"flex",alignItems:"center",gap:10,padding:"8px 14px",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.bgTertiary}`,flexShrink:0},terminalDots:{display:"flex",gap:6},dot:{width:10,height:10,borderRadius:"50%"},terminalTitle:{fontSize:12,color:e.textMuted,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace'},terminalBody:{flex:1,overflow:"auto",padding:"12px 14px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:13,lineHeight:1.6},cmdLine:{display:"flex",alignItems:"baseline",gap:8,minHeight:22},prompt:{color:e.success,fontWeight:600,whiteSpace:"nowrap",flexShrink:0},cmdText:{color:e.textBright},outputText:{margin:"2px 0 8px 0",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",whiteSpace:"pre-wrap",wordBreak:"break-word"},cmdInput:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",color:e.textBright,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:13,lineHeight:1.6,padding:0,caretColor:e.accent},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',color:e.success},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0}}}function LN({data:e,getBelt:t}){const{theme:r}=Bt(),i=M.useMemo(()=>RN(r),[r]),[n,s]=M.useState(!1),[a,l]=M.useState([]),u=(e==null?void 0:e.type)||(e==null?void 0:e.celebrationType)||"xp",h=(e==null?void 0:e.xpAwarded)??(e==null?void 0:e.xp)??(e==null?void 0:e.points)??0,d=(e==null?void 0:e.newBelt)??(e==null?void 0:e.belt)??null;M.useMemo(()=>d&&t?t(d==="string"?0:99999):null,[d,t]);const p={white:{badge:"⬜",color:"#e6e6e6"},yellow:{badge:"🟨",color:"#f0c040"},green:{badge:"🟩",color:r.success},blue:{badge:"🟦",color:r.accent},purple:{badge:"🟪",color:r.purple},brown:{badge:"🟫",color:"#a0522d"},black:{badge:"⬛",color:r.textMuted}},m=d&&p[d.toLowerCase()]||null;return M.useEffect(()=>{s(!0);const y=[r.accent,r.success,r.warning,r.purple,r.error,r.orange,r.textBright],v=Array.from({length:u==="perfect-score"?80:u==="level-up"?60:40},(S,C)=>({id:C,x:Math.random()*100,delay:Math.random()*.8,duration:1.5+Math.random()*2,color:y[Math.floor(Math.random()*y.length)],size:4+Math.random()*8,shape:Math.random()>.5?"square":"circle",rotation:Math.random()*360,drift:(Math.random()-.5)*40}));l(v)},[u]),g.jsxs("div",{style:{...i.overlay,opacity:n?1:0},children:[g.jsx("div",{style:i.confettiContainer,children:a.map(y=>g.jsx("div",{style:{position:"absolute",left:`${y.x}%`,top:"-10px",width:y.size,height:y.shape==="circle"?y.size:y.size*1.5,backgroundColor:y.color,borderRadius:y.shape==="circle"?"50%":"2px",transform:`rotate(${y.rotation}deg)`,animation:`confettiFall ${y.duration}s ${y.delay}s ease-in forwards`,opacity:0}},y.id))}),g.jsxs("div",{style:i.content,children:[h>0&&g.jsxs("div",{style:i.xpAward,children:["+",h," XP"]},`xp-${h}`),u==="level-up"&&m&&g.jsxs("div",{style:i.levelUp,children:[g.jsx("div",{style:{...i.beltGlow,boxShadow:`0 0 40px ${m.color}60, 0 0 80px ${m.color}30`,borderColor:m.color},children:g.jsx("span",{style:i.beltEmoji,children:m.badge})}),g.jsxs("h2",{style:i.levelUpTitle,children:["You earned ",d.charAt(0).toUpperCase()+d.slice(1)," Belt!"]})]}),u==="perfect-score"&&g.jsxs("div",{style:i.perfectScore,children:[g.jsx("span",{style:i.perfectIcon,children:"⭐"}),g.jsx("h2",{style:i.perfectTitle,children:"Perfect Score!"})]}),u==="xp"&&!d&&g.jsxs("div",{style:i.simpleXP,children:[g.jsx("span",{style:i.checkIcon,children:"✅"}),(e==null?void 0:e.title)&&g.jsx("h2",{style:{color:r.textBright,fontSize:20,fontWeight:700,margin:"8px 0 0"},children:e.title}),(e==null?void 0:e.subtitle)&&g.jsx("p",{style:{color:r.textSecondary,fontSize:14,margin:"4px 0 0"},children:e.subtitle})]})]}),g.jsx("style",{children:`
|
|
301
|
+
@keyframes confettiFall {
|
|
302
|
+
0% {
|
|
303
|
+
opacity: 1;
|
|
304
|
+
transform: translateY(0) rotate(0deg);
|
|
305
|
+
}
|
|
306
|
+
100% {
|
|
307
|
+
opacity: 0;
|
|
308
|
+
transform: translateY(100vh) rotate(720deg);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
@keyframes floatUp {
|
|
312
|
+
0% {
|
|
313
|
+
opacity: 0;
|
|
314
|
+
transform: translateY(20px) scale(0.8);
|
|
315
|
+
}
|
|
316
|
+
20% {
|
|
317
|
+
opacity: 1;
|
|
318
|
+
transform: translateY(0) scale(1.1);
|
|
319
|
+
}
|
|
320
|
+
40% {
|
|
321
|
+
transform: translateY(-10px) scale(1);
|
|
322
|
+
}
|
|
323
|
+
100% {
|
|
324
|
+
opacity: 0;
|
|
325
|
+
transform: translateY(-60px) scale(0.9);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
@keyframes pulseGlow {
|
|
329
|
+
0%, 100% {
|
|
330
|
+
transform: scale(1);
|
|
331
|
+
}
|
|
332
|
+
50% {
|
|
333
|
+
transform: scale(1.1);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
@keyframes bounceIn {
|
|
337
|
+
0% {
|
|
338
|
+
opacity: 0;
|
|
339
|
+
transform: scale(0.3);
|
|
340
|
+
}
|
|
341
|
+
50% {
|
|
342
|
+
opacity: 1;
|
|
343
|
+
transform: scale(1.05);
|
|
344
|
+
}
|
|
345
|
+
70% {
|
|
346
|
+
transform: scale(0.95);
|
|
347
|
+
}
|
|
348
|
+
100% {
|
|
349
|
+
transform: scale(1);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
`})]})}function RN(e){return{overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:`${e.bgPrimary}bf`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,transition:"opacity 0.3s ease",pointerEvents:"none"},confettiContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",pointerEvents:"none"},content:{display:"flex",flexDirection:"column",alignItems:"center",gap:20,zIndex:1},xpAward:{fontSize:48,fontWeight:800,color:e.success,textShadow:`0 0 20px ${e.success}60`,animation:"floatUp 2.5s ease-out forwards"},levelUp:{display:"flex",flexDirection:"column",alignItems:"center",gap:16,animation:"bounceIn 0.6s ease-out"},beltGlow:{width:100,height:100,borderRadius:"50%",border:"3px solid",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.bgTertiary,animation:"pulseGlow 1.5s ease-in-out infinite"},beltEmoji:{fontSize:48},levelUpTitle:{fontSize:28,fontWeight:800,color:e.textBright,margin:0,textAlign:"center"},perfectScore:{display:"flex",flexDirection:"column",alignItems:"center",gap:12,animation:"bounceIn 0.6s ease-out"},perfectIcon:{fontSize:64,animation:"pulseGlow 1s ease-in-out infinite"},perfectTitle:{fontSize:28,fontWeight:800,color:e.warning,margin:0,textShadow:`0 0 20px ${e.warning}60`},simpleXP:{animation:"bounceIn 0.5s ease-out"},checkIcon:{fontSize:64}}}function AN({data:e,onLinkClick:t}){const{theme:r}=Bt(),i=M.useMemo(()=>DN(r),[r]),n=M.useRef(null),[s,a]=M.useState(300),l=(e==null?void 0:e.html)||"",u=(e==null?void 0:e.title)||"",h=(e==null?void 0:e.module)||null,d=`<!DOCTYPE html>
|
|
353
|
+
<html>
|
|
354
|
+
<head>
|
|
355
|
+
<meta charset="utf-8">
|
|
356
|
+
<style>
|
|
357
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
358
|
+
body {
|
|
359
|
+
margin: 0;
|
|
360
|
+
padding: 16px;
|
|
361
|
+
background: ${r.bgPrimary};
|
|
362
|
+
color: ${r.textPrimary};
|
|
363
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
|
|
364
|
+
font-size: 14px;
|
|
365
|
+
line-height: 1.6;
|
|
366
|
+
overflow-x: hidden;
|
|
367
|
+
}
|
|
368
|
+
img {
|
|
369
|
+
max-width: 100%;
|
|
370
|
+
height: auto;
|
|
371
|
+
border-radius: 8px;
|
|
372
|
+
}
|
|
373
|
+
video, audio {
|
|
374
|
+
max-width: 100%;
|
|
375
|
+
border-radius: 8px;
|
|
376
|
+
}
|
|
377
|
+
iframe {
|
|
378
|
+
border: 0;
|
|
379
|
+
border-radius: 8px;
|
|
380
|
+
}
|
|
381
|
+
a {
|
|
382
|
+
color: ${r.accent};
|
|
383
|
+
text-decoration: none;
|
|
384
|
+
}
|
|
385
|
+
a:hover {
|
|
386
|
+
text-decoration: underline;
|
|
387
|
+
}
|
|
388
|
+
h1, h2, h3 {
|
|
389
|
+
color: ${r.textBright};
|
|
390
|
+
margin-top: 0;
|
|
391
|
+
}
|
|
392
|
+
p {
|
|
393
|
+
margin: 8px 0;
|
|
394
|
+
}
|
|
395
|
+
.card {
|
|
396
|
+
background: ${r.bgSecondary};
|
|
397
|
+
border: 1px solid ${r.border};
|
|
398
|
+
border-radius: 10px;
|
|
399
|
+
padding: 16px;
|
|
400
|
+
margin: 8px 0;
|
|
401
|
+
}
|
|
402
|
+
.caption {
|
|
403
|
+
color: ${r.textSecondary};
|
|
404
|
+
font-size: 13px;
|
|
405
|
+
margin-top: 8px;
|
|
406
|
+
text-align: center;
|
|
407
|
+
}
|
|
408
|
+
</style>
|
|
409
|
+
</head>
|
|
410
|
+
<body>
|
|
411
|
+
${l}
|
|
412
|
+
<script>
|
|
413
|
+
// Send height to parent for auto-resize
|
|
414
|
+
function sendHeight() {
|
|
415
|
+
const h = document.documentElement.scrollHeight;
|
|
416
|
+
window.parent.postMessage({ type: 'iframe-resize', height: h }, '*');
|
|
417
|
+
}
|
|
418
|
+
const ro = new ResizeObserver(sendHeight);
|
|
419
|
+
ro.observe(document.body);
|
|
420
|
+
window.addEventListener('load', sendHeight);
|
|
421
|
+
sendHeight();
|
|
422
|
+
|
|
423
|
+
// Intercept link clicks — route to parent for internal display
|
|
424
|
+
document.addEventListener('click', function(e) {
|
|
425
|
+
const anchor = e.target.closest('a');
|
|
426
|
+
if (!anchor || !anchor.href) return;
|
|
427
|
+
// Skip non-http links (mailto:, javascript:, etc.)
|
|
428
|
+
if (!anchor.href.startsWith('http')) return;
|
|
429
|
+
e.preventDefault();
|
|
430
|
+
e.stopPropagation();
|
|
431
|
+
window.parent.postMessage({
|
|
432
|
+
type: 'iframe-link-click',
|
|
433
|
+
url: anchor.href,
|
|
434
|
+
title: anchor.textContent || '',
|
|
435
|
+
}, '*');
|
|
436
|
+
}, true);
|
|
437
|
+
<\/script>
|
|
438
|
+
</body>
|
|
439
|
+
</html>`;return M.useEffect(()=>{function p(m){var y,x;((y=m.data)==null?void 0:y.type)==="iframe-resize"&&typeof m.data.height=="number"&&a(Math.max(100,Math.min(m.data.height+32,2e3))),((x=m.data)==null?void 0:x.type)==="iframe-link-click"&&m.data.url&&t&&t({url:m.data.url,title:m.data.title})}return window.addEventListener("message",p),()=>window.removeEventListener("message",p)},[t]),e?g.jsxs("div",{style:i.container,children:[(h||u)&&g.jsxs("div",{style:i.breadcrumb,children:[h&&g.jsx("span",{style:i.breadcrumbModule,children:h}),h&&u&&g.jsx("span",{style:i.breadcrumbSep,children:"/"}),u&&g.jsx("span",{style:i.breadcrumbTitle,children:u})]}),g.jsx("div",{style:i.iframeWrapper,children:g.jsx("iframe",{ref:n,srcDoc:d,sandbox:"allow-scripts allow-same-origin",style:{...i.iframe,height:s},title:u||"Rich content"})})]}):g.jsxs("div",{style:i.empty,children:[g.jsx("div",{style:i.emptyIcon,children:"</>"}),g.jsx("p",{style:i.emptyTitle,children:"HTML Content"}),g.jsx("p",{style:i.emptySubtext,children:"Rich media and custom content will appear here during lessons."})]})}function DN(e){return{container:{display:"flex",flexDirection:"column",gap:16,maxWidth:1e3,margin:"0 auto"},breadcrumb:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:e.textSecondary},breadcrumbModule:{color:e.accent,fontWeight:500},breadcrumbSep:{color:e.textMuted},breadcrumbTitle:{color:e.textPrimary},iframeWrapper:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,overflow:"hidden"},iframe:{width:"100%",border:"none",display:"block",transition:"height 0.2s ease"},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',color:e.accent},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0}}}function PN(e){if(!(e!=null&&e.gameType))return e;const t={...e};switch(t.gameType){case"speed-round":!t.rounds&&t.questions&&(t.rounds=t.questions);break;case"bug-hunt":!t.snippets&&t.bugs&&(t.snippets=t.bugs),!t.snippets&&t.code&&(t.snippets=t.code);break;case"classify":!t.categories&&t.buckets&&(t.categories=t.buckets),!t.items&&t.cards&&(t.items=t.cards);break;case"scenario":!t.steps&&t.scenarios&&(t.steps=t.scenarios),!t.steps&&t.story&&(t.steps=t.story),!t.steps&&t.choices&&(t.steps=[{id:"start",situation:t.scenario||t.description||t.title,choices:t.choices}]);break;case"command-sprint":!t.challenges&&t.commands&&(t.challenges=t.commands),!t.challenges&&t.prompts&&(t.challenges=t.prompts),!t.challenges&&t.tasks&&(t.challenges=t.tasks);break;case"memory-match":if(!t.pairs&&t.cards){const r=t.cards;if(r.length>0&&r[0].match!=null){const i=new Map;for(const n of r){const s=n.match??n.id;i.has(s)?i.get(s).push(n):i.set(s,[n])}t.pairs=[...i.values()].filter(n=>n.length>=2).map(n=>({front:n[0].text||n[0].label,back:n[1].text||n[1].label}))}}break}return t}function IN({data:e,sendEvent:t}){const{theme:r}=Bt(),i=M.useMemo(()=>HN(r),[r]),[n,s]=M.useState(!1),[a,l]=M.useState(null);M.useEffect(()=>{s(!1),l(null)},[e]);const u=M.useCallback(m=>{const y=m.accuracy>=1?3:m.accuracy>=.7?2:m.accuracy>=.4?1:0,x={...m,stars:y};l(x),s(!0),t("event:game-result",x)},[t]),h=M.useCallback(()=>{s(!1),l(null)},[]);if(!e)return g.jsxs("div",{style:i.empty,children:[g.jsx("div",{style:i.emptyIcon,children:"🎮"}),g.jsx("p",{style:i.emptyTitle,children:"Game Mode"}),g.jsx("p",{style:i.emptySubtext,children:"Interactive games will appear here to practice module topics."})]});if(n&&a)return g.jsx(WN,{result:a,gameTitle:e.title,onPlayAgain:h,theme:r,s:i});const d=PN(e),{gameType:p}=d;switch(p){case"speed-round":return g.jsx($N,{data:d,onEnd:u,theme:r,s:i});case"bug-hunt":return g.jsx(jN,{data:d,onEnd:u,theme:r,s:i});case"classify":return g.jsx(ON,{data:d,onEnd:u,theme:r,s:i});case"scenario":return g.jsx(zN,{data:d,onEnd:u,theme:r,s:i});case"command-sprint":return g.jsx(FN,{data:d,onEnd:u,theme:r,s:i});case"memory-match":return g.jsx(NN,{data:d,onEnd:u,theme:r,s:i});default:return g.jsx("div",{style:i.errorBox,children:g.jsxs("p",{children:["Unknown game type: ",p]})})}}function $N({data:e,onEnd:t,theme:r,s:i}){var Y;const{rounds:n=[],title:s}=e,[a,l]=M.useState(0),[u,h]=M.useState(3),[d,p]=M.useState(0),[m,y]=M.useState(0),[x,v]=M.useState(0),[S,C]=M.useState(((Y=n[0])==null?void 0:Y.timeLimit)||15),[B,R]=M.useState(null),[E,L]=M.useState(null),[k]=M.useState(Date.now()),A=M.useRef(null),z=n[a];M.useEffect(()=>{if(!(!z||u<=0))return C(z.timeLimit||15),R(null),L(null),A.current=setInterval(()=>{C(F=>F<=1?(clearInterval(A.current),0):F-1)},1e3),()=>clearInterval(A.current)},[a,z,u]),M.useEffect(()=>{S===0&&B===null&&z&&U(-1)},[S]);function U(F){if(B!==null)return;R(F),clearInterval(A.current);const O=F===z.answer;L(O?"correct":"wrong");const $=O?m+1:0,j=$>=5?3:$>=3?2:1,W=O?100*j:0,P=O?u:u-1;p(Z=>Z+W),y($),v(Z=>Math.max(Z,$)),h(P),setTimeout(()=>{if(P<=0){const Z=a+(O?1:0);t({gameType:"speed-round",score:d+W,maxScore:n.length*300,accuracy:Z/n.length,timeMs:Date.now()-k,streakMax:Math.max(x,$),correct:Z,total:n.length});return}if(a+1>=n.length){const Z=a+(O?1:0);t({gameType:"speed-round",score:d+W,maxScore:n.length*300,accuracy:Z/n.length,timeMs:Date.now()-k,streakMax:Math.max(x,$),correct:Z,total:n.length});return}l(Z=>Z+1)},800)}if(!z)return null;const q=S/(z.timeLimit||15)*100,H=S>10?r.success:S>5?r.warning:r.error;return g.jsxs("div",{style:i.gameContainer,children:[g.jsxs("div",{style:i.gameHeader,children:[g.jsx("span",{style:i.gameTitle,children:s||"Speed Round"}),g.jsxs("span",{style:i.roundCounter,children:[a+1," / ",n.length]})]}),g.jsxs("div",{style:i.statusBar,children:[g.jsx("div",{style:i.livesDisplay,children:Array.from({length:3},(F,O)=>g.jsx("span",{style:{opacity:O<u?1:.2,fontSize:20},children:"❤️"},O))}),m>=3&&g.jsxs("span",{style:i.streakBadge,children:[m>=5?"3x":"2x"," streak!"]}),g.jsxs("span",{style:i.scoreDisplay,children:[d," pts"]})]}),g.jsx("div",{style:i.timerBar,children:g.jsx("div",{style:{...i.timerFill,width:`${q}%`,backgroundColor:H}})}),g.jsx("h2",{style:i.question,children:z.question}),g.jsx("div",{style:i.choiceGrid,children:(z.options||[]).map((F,O)=>{const $=typeof F=="string"?F:F.label,j=B===O,W=O===z.answer,P=B!==null;let Z=r.border,ee=r.bgSecondary;return P&&W?(Z=r.success,ee=`${r.success}18`):P&&j&&!W?(Z=r.error,ee=`${r.error}18`):j&&(Z=r.accent),g.jsxs("button",{onClick:()=>U(O),disabled:B!==null,style:{...i.choiceButton,borderColor:Z,backgroundColor:ee,cursor:B!==null?"default":"pointer",opacity:P&&!j&&!W?.4:1,animation:P&&j&&!W?"shake 0.3s ease":void 0},children:[g.jsx("span",{style:i.choiceLetter,children:String.fromCharCode(65+O)}),g.jsx("span",{style:i.choiceText,children:$})]},O)})})]})}function jN({data:e,onEnd:t,theme:r,s:i}){const{snippets:n=[],title:s}=e,[a,l]=M.useState(0),[u,h]=M.useState(null),[d,p]=M.useState(!1),[m,y]=M.useState(!1),x=M.useRef(0),[v]=M.useState(Date.now()),S=n[a];function C(E){u===null&&(h(E),E===S.bugLine&&(x.current+=1),p(!0))}function B(){const E=x.current;if(a+1>=n.length){t({gameType:"bug-hunt",score:E,maxScore:n.length,accuracy:E/n.length,timeMs:Date.now()-v,streakMax:0,correct:E,total:n.length});return}l(L=>L+1),h(null),p(!1),y(!1)}if(!S||!S.code)return g.jsxs("div",{style:i.errorBox,children:[g.jsx("p",{children:"Bug Hunt: no code snippets provided."}),g.jsx("p",{style:{fontSize:12,color:r.textMuted},children:"Expected: snippets array with code, bugLine, hint"})]});const R=S.code.split(`
|
|
440
|
+
`);return g.jsxs("div",{style:i.gameContainer,children:[g.jsxs("div",{style:i.gameHeader,children:[g.jsx("span",{style:i.gameTitle,children:s||"Bug Hunt"}),g.jsxs("span",{style:i.roundCounter,children:[a+1," / ",n.length]})]}),g.jsx("p",{style:i.hint,children:"Find the buggy line. Click to select."}),!m&&u===null&&S.hint&&g.jsx("button",{onClick:()=>y(!0),style:i.hintButton,children:"Show Hint"}),m&&u===null&&g.jsx("div",{style:i.hintBox,children:g.jsx("p",{style:i.hintText,children:S.hint})}),g.jsx("div",{style:i.codeBlock,children:R.map((E,L)=>{const k=L+1,A=u===k,z=k===S.bugLine,U=u!==null;let q="transparent";return U&&z?q=`${r.success}20`:U&&A&&!z&&(q=`${r.error}20`),g.jsxs("div",{onClick:()=>C(k),style:{...i.codeLine,backgroundColor:q,cursor:u!==null?"default":"pointer",borderLeft:A?"3px solid "+(z?r.success:r.error):U&&z?`3px solid ${r.success}`:"3px solid transparent"},children:[g.jsx("span",{style:i.lineNumber,children:k}),g.jsx("span",{style:i.lineContent,children:E||" "})]},L)})}),d&&g.jsxs("div",{style:{...i.explanationBox,borderColor:u===S.bugLine?r.success:r.error},children:[g.jsx("p",{style:i.explanationLabel,children:u===S.bugLine?"Correct!":`Wrong — the bug is on line ${S.bugLine}`}),g.jsx("p",{style:i.explanationText,children:S.explanation}),g.jsx("button",{onClick:B,style:i.nextButton,children:a+1>=n.length?"See Results":"Next Snippet"})]})]})}function ON({data:e,onEnd:t,theme:r,s:i}){const{categories:n=[],items:s=[],title:a}=e,[l]=M.useState(()=>[...s].sort(()=>Math.random()-.5)),[u,h]=M.useState(0),[d,p]=M.useState(3),[m,y]=M.useState(0),[x,v]=M.useState(null),[S]=M.useState(Date.now()),C=l[u];function B(E){if(!C||x)return;const L=C.category===E;v({category:E,correct:L}),L?y(k=>k+1):p(k=>k-1),setTimeout(()=>{if(v(null),(L?d:d-1)<=0||u+1>=l.length){const A=m+(L?1:0);t({gameType:"classify",score:A,maxScore:l.length,accuracy:A/l.length,timeMs:Date.now()-S,streakMax:0,correct:A,total:l.length});return}h(A=>A+1)},600)}if(!C)return g.jsxs("div",{style:i.errorBox,children:[g.jsx("p",{children:"Classify: no items to sort."}),g.jsx("p",{style:{fontSize:12,color:r.textMuted},children:"Expected: categories and items arrays"})]});const R=[r.accent,r.success,r.warning,r.purple];return g.jsxs("div",{style:i.gameContainer,children:[g.jsxs("div",{style:i.gameHeader,children:[g.jsx("span",{style:i.gameTitle,children:a||"Classify"}),g.jsxs("span",{style:i.roundCounter,children:[u+1," / ",l.length]})]}),g.jsxs("div",{style:i.statusBar,children:[g.jsx("div",{style:i.livesDisplay,children:Array.from({length:3},(E,L)=>g.jsx("span",{style:{opacity:L<d?1:.2,fontSize:20},children:"❤️"},L))}),g.jsxs("span",{style:i.scoreDisplay,children:[m," / ",l.length]})]}),g.jsx("div",{style:i.bucketsRow,children:n.map((E,L)=>{const k=typeof E=="string"?E:E.name,A=typeof E=="object"&&E.color||R[L%R.length],z=x&&x.category===k,U=z?x.correct?`${r.success}30`:`${r.error}30`:`${A}10`;return g.jsx("button",{onClick:()=>B(k),style:{...i.bucket,borderColor:A,backgroundColor:U,transform:z&&!x.correct?"translateX(4px)":"none",transition:"all 0.2s ease"},children:g.jsx("span",{style:{color:A,fontWeight:700,fontSize:14},children:k})},k)})}),g.jsx("div",{style:i.itemCard,children:g.jsx("p",{style:i.itemText,children:C.text})})]})}function zN({data:e,onEnd:t,theme:r,s:i}){var k;const{steps:n=[],title:s,startHealth:a=5}=e,[l,u]=M.useState(((k=n[0])==null?void 0:k.id)||0),[h,d]=M.useState(a),[p,m]=M.useState(null),[y,x]=M.useState(0),[v,S]=M.useState(0),[C]=M.useState(Date.now()),B=n.find(A=>A.id===l)||n[y];function R(A,z){if(p!==null)return;m(z);const U=Math.max(0,h+(A.health||0));d(U),A.health>=0&&S(q=>q+1),setTimeout(()=>{if(U<=0||!A.next||A.next==="end"){const q=y+1;t({gameType:"scenario",score:v+(A.health>=0?1:0),maxScore:q,accuracy:(v+(A.health>=0?1:0))/q,timeMs:Date.now()-C,streakMax:0,correct:v+(A.health>=0?1:0),total:q,healthRemaining:U});return}u(A.next),x(q=>q+1),m(null)},1800)}if(!B)return g.jsxs("div",{style:i.errorBox,children:[g.jsx("p",{children:"Scenario game: no steps data provided."}),g.jsx("p",{style:{fontSize:12,color:r.textMuted},children:"Expected: steps array with id, situation, choices"})]});const E=h/a*100,L=E>60?r.success:E>30?r.warning:r.error;return g.jsxs("div",{style:i.gameContainer,children:[g.jsxs("div",{style:i.gameHeader,children:[g.jsx("span",{style:i.gameTitle,children:s||"Scenario"}),g.jsxs("span",{style:i.roundCounter,children:["Step ",y+1]})]}),g.jsx("div",{style:i.healthBarOuter,children:g.jsx("div",{style:{...i.healthBarInner,width:`${E}%`,backgroundColor:L}})}),g.jsxs("div",{style:{textAlign:"right",fontSize:12,color:r.textSecondary,marginBottom:16},children:["Health: ",h," / ",a]}),g.jsx("div",{style:i.scenarioPanel,children:g.jsx("p",{style:i.situationText,children:B.situation})}),g.jsx("div",{style:i.choiceGrid,children:(B.choices||[]).map((A,z)=>{const U=p===z;return g.jsxs("div",{children:[g.jsx("button",{onClick:()=>R(A,z),disabled:p!==null,style:{...i.scenarioChoice,borderColor:U?r.accent:r.border,backgroundColor:U?`${r.accent}18`:r.bgSecondary,cursor:p!==null?"default":"pointer",opacity:p!==null&&!U?.4:1},children:A.text}),U&&g.jsxs("div",{style:{...i.consequenceBox,borderColor:A.health>=0?r.success:r.error},children:[g.jsx("p",{style:i.consequenceText,children:A.consequence}),A.health!==0&&g.jsxs("span",{style:{color:A.health>0?r.success:r.error,fontWeight:700,fontSize:13},children:[A.health>0?"+":"",A.health," health"]})]})]},z)})})]})}function FN({data:e,onEnd:t,theme:r,s:i}){var L;const{challenges:n=[],title:s}=e,[a,l]=M.useState(0),[u,h]=M.useState(""),[d,p]=M.useState(null),[m,y]=M.useState(0),[x]=M.useState(Date.now()),[v,S]=M.useState(((L=n[0])==null?void 0:L.timeLimit)||30),C=M.useRef(null),B=M.useRef(null),R=n[a];M.useEffect(()=>(h(""),p(null),S((R==null?void 0:R.timeLimit)||30),C.current&&C.current.focus(),B.current=setInterval(()=>{S(k=>k<=1?(clearInterval(B.current),0):k-1)},1e3),()=>clearInterval(B.current)),[a]),M.useEffect(()=>{v===0&&d===null&&R&&(clearInterval(B.current),p("wrong"),setTimeout(()=>{if(a+1>=n.length){t({gameType:"command-sprint",score:m,maxScore:n.length,accuracy:m/n.length,timeMs:Date.now()-x,streakMax:0,correct:m,total:n.length});return}l(k=>k+1)},1e3))},[v]);function E(k){if(k.preventDefault(),d!==null||!R)return;clearInterval(B.current);const A=u.trim(),U=[R.answer,...R.alternates||[]].some(q=>q.toLowerCase()===A.toLowerCase());p(U?"correct":"wrong"),U&&y(q=>q+1),setTimeout(()=>{if(a+1>=n.length){const q=m+(U?1:0);t({gameType:"command-sprint",score:q,maxScore:n.length,accuracy:q/n.length,timeMs:Date.now()-x,streakMax:0,correct:q,total:n.length});return}l(q=>q+1)},1e3)}return R?g.jsxs("div",{style:i.gameContainer,children:[g.jsxs("div",{style:i.gameHeader,children:[g.jsx("span",{style:i.gameTitle,children:s||"Command Sprint"}),g.jsxs("span",{style:i.roundCounter,children:[a+1," / ",n.length]})]}),g.jsx("div",{style:i.timerBar,children:g.jsx("div",{style:{...i.timerFill,width:`${v/(R.timeLimit||30)*100}%`,backgroundColor:v>10?r.success:v>5?r.warning:r.error}})}),g.jsx("div",{style:i.sprintPrompt,children:g.jsx("p",{style:i.sprintTask,children:R.prompt})}),g.jsxs("form",{onSubmit:E,style:i.sprintForm,children:[g.jsxs("div",{style:{...i.sprintInputWrapper,borderColor:d==="correct"?r.success:d==="wrong"?r.error:r.accent},children:[g.jsx("span",{style:i.sprintCaret,children:">"}),g.jsx("input",{ref:C,type:"text",value:u,onChange:k=>h(k.target.value),disabled:d!==null,placeholder:"Type your command...",autoComplete:"off",autoCapitalize:"off",spellCheck:!1,style:i.sprintInput})]}),d===null&&g.jsx("button",{type:"submit",style:i.submitButton,children:"Submit"})]}),d==="wrong"&&g.jsxs("div",{style:i.sprintAnswer,children:[g.jsx("span",{style:{color:r.error},children:"Expected: "}),g.jsx("code",{style:i.sprintCode,children:R.answer})]}),d==="correct"&&g.jsx("div",{style:{...i.sprintAnswer,borderColor:r.success},children:g.jsx("span",{style:{color:r.success},children:"Correct!"})})]}):g.jsxs("div",{style:i.errorBox,children:[g.jsx("p",{children:"Command Sprint: no challenges data provided."}),g.jsx("p",{style:{fontSize:12,color:r.textMuted},children:"Expected: challenges array with prompt, answer, timeLimit"})]})}function NN({data:e,onEnd:t,theme:r,s:i}){const{pairs:n=[],title:s}=e,[a,l]=M.useState([]),[u,h]=M.useState([]),[d,p]=M.useState(new Set),[m,y]=M.useState(0),[x]=M.useState(Date.now()),v=M.useRef(!1);M.useEffect(()=>{const B=[];n.forEach((R,E)=>{B.push({id:`t-${E}`,pairId:E,text:R.term,side:"term"}),B.push({id:`d-${E}`,pairId:E,text:R.definition,side:"def"})});for(let R=B.length-1;R>0;R--){const E=Math.floor(Math.random()*(R+1));[B[R],B[E]]=[B[E],B[R]]}l(B),h([]),p(new Set),y(0)},[n]);function S(B){if(v.current||u.includes(B)||d.has(a[B].pairId))return;const R=[...u,B];if(h(R),R.length===2){y(k=>k+1),v.current=!0;const[E,L]=R;if(a[E].pairId===a[L].pairId){const k=new Set(d);k.add(a[E].pairId),setTimeout(()=>{if(p(k),h([]),v.current=!1,k.size===n.length){const A=m+1,z=n.length;t({gameType:"memory-match",score:Math.max(0,z*2-A),maxScore:z,accuracy:Math.min(1,z/A),timeMs:Date.now()-x,streakMax:0,correct:k.size,total:n.length,moves:A})}},500)}else setTimeout(()=>{h([]),v.current=!1},800)}}const C=a.length<=12?4:6;return g.jsxs("div",{style:i.gameContainer,children:[g.jsxs("div",{style:i.gameHeader,children:[g.jsx("span",{style:i.gameTitle,children:s||"Memory Match"}),g.jsxs("span",{style:i.roundCounter,children:["Moves: ",m]})]}),g.jsx("p",{style:i.hint,children:"Flip cards to find matching term-definition pairs"}),g.jsx("div",{style:{...i.cardGrid,gridTemplateColumns:`repeat(${C}, 1fr)`},children:a.map((B,R)=>{const E=u.includes(R),L=d.has(B.pairId),k=E||L;return g.jsx("button",{onClick:()=>S(R),disabled:L,style:{...i.memoryCard,backgroundColor:L?`${r.success}15`:k?r.bgSecondary:r.bgTertiary,borderColor:L?r.success:k?r.accent:r.border,cursor:L?"default":"pointer",transform:"rotateY(0deg)"},children:k?g.jsx("span",{style:{...i.cardText,color:B.side==="term"?r.accent:r.textPrimary,fontSize:B.text.length>30?11:13},children:B.text}):g.jsx("span",{style:i.cardBack,children:"?"})},B.id)})}),g.jsxs("div",{style:{textAlign:"center",marginTop:16,fontSize:13,color:r.textSecondary},children:[d.size," / ",n.length," pairs found"]})]})}function WN({result:e,gameTitle:t,onPlayAgain:r,theme:i,s:n}){const{score:s=0,maxScore:a=1,accuracy:l=0,timeMs:u=0,streakMax:h=0,stars:d=0,correct:p=0,total:m=0,moves:y}=e,x=Math.round(u/1e3),v=Math.floor(x/60),S=x%60,C=v>0?`${v}m ${S}s`:`${S}s`,B=Math.round(l*100),R=Array.from({length:3},(E,L)=>L<d?"⭐":"☆").join(" ");return g.jsx("div",{style:n.gameContainer,children:g.jsxs("div",{style:n.resultsCard,children:[g.jsx("h2",{style:n.resultsTitle,children:t||"Game Complete"}),g.jsx("div",{style:n.starsRow,children:R}),g.jsxs("div",{style:n.resultsGrid,children:[g.jsxs("div",{style:n.resultStat,children:[g.jsxs("span",{style:n.resultValue,children:[B,"%"]}),g.jsx("span",{style:n.resultLabel,children:"Accuracy"})]}),g.jsxs("div",{style:n.resultStat,children:[g.jsxs("span",{style:n.resultValue,children:[p,"/",m]}),g.jsx("span",{style:n.resultLabel,children:"Correct"})]}),g.jsxs("div",{style:n.resultStat,children:[g.jsx("span",{style:n.resultValue,children:C}),g.jsx("span",{style:n.resultLabel,children:"Time"})]}),h>0&&g.jsxs("div",{style:n.resultStat,children:[g.jsx("span",{style:n.resultValue,children:h}),g.jsx("span",{style:n.resultLabel,children:"Best Streak"})]}),y!==void 0&&g.jsxs("div",{style:n.resultStat,children:[g.jsx("span",{style:n.resultValue,children:y}),g.jsx("span",{style:n.resultLabel,children:"Moves"})]})]}),g.jsxs("div",{style:n.xpEarned,children:["+",d===3?40:25," XP"]}),g.jsx("button",{onClick:r,style:n.playAgainButton,children:"Play Again"})]})})}function HN(e){return{gameContainer:{maxWidth:700,margin:"0 auto",display:"flex",flexDirection:"column",gap:16},gameHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},gameTitle:{fontSize:20,fontWeight:700,color:e.textBright},roundCounter:{fontSize:14,color:e.textSecondary,padding:"4px 10px",backgroundColor:e.bgTertiary,borderRadius:6},statusBar:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},livesDisplay:{display:"flex",gap:4},streakBadge:{fontSize:13,fontWeight:700,color:e.warning,padding:"2px 8px",backgroundColor:`${e.warning}18`,borderRadius:4},scoreDisplay:{fontSize:16,fontWeight:700,color:e.accent},timerBar:{height:4,backgroundColor:e.bgTertiary,borderRadius:2,overflow:"hidden"},timerFill:{height:"100%",borderRadius:2,transition:"width 1s linear, background-color 0.3s ease"},question:{fontSize:20,fontWeight:700,color:e.textBright,margin:0,lineHeight:1.4},hint:{fontSize:13,color:e.textSecondary,margin:0},choiceGrid:{display:"flex",flexDirection:"column",gap:10},choiceButton:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",border:"1px solid",borderRadius:10,textAlign:"left",transition:"border-color 0.15s ease, background-color 0.15s ease, opacity 0.3s ease",width:"100%",fontSize:14,color:e.textPrimary,fontFamily:"inherit",cursor:"pointer"},choiceLetter:{width:28,height:28,borderRadius:"50%",backgroundColor:e.bgTertiary,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:e.textSecondary,flexShrink:0},choiceText:{flex:1},submitButton:{alignSelf:"center",padding:"10px 28px",fontSize:14,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:8,cursor:"pointer"},nextButton:{padding:"8px 20px",fontSize:13,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:6,cursor:"pointer",marginTop:8},errorBox:{textAlign:"center",padding:40,color:e.error,fontSize:16},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0},hintButton:{alignSelf:"flex-start",padding:"6px 14px",fontSize:13,fontWeight:600,color:e.warning,backgroundColor:"transparent",border:`1px solid ${e.warning}`,borderRadius:6,cursor:"pointer",fontFamily:"inherit"},hintBox:{padding:"12px 16px",border:`1px solid ${e.warning}`,borderRadius:8,backgroundColor:`${e.warning}10`},hintText:{color:e.warning,fontSize:14,margin:0,lineHeight:1.5},codeBlock:{backgroundColor:e.bgPrimary,border:`1px solid ${e.border}`,borderRadius:10,overflow:"hidden",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:14,lineHeight:1.6},codeLine:{display:"flex",alignItems:"flex-start",padding:"2px 12px 2px 0",transition:"background-color 0.15s ease"},lineNumber:{width:40,textAlign:"right",paddingRight:12,color:e.textMuted,userSelect:"none",flexShrink:0},lineContent:{color:e.textPrimary,whiteSpace:"pre"},explanationBox:{padding:"16px 20px",border:"1px solid",borderRadius:8,backgroundColor:e.bgSecondary},explanationLabel:{fontSize:15,fontWeight:700,color:e.textBright,margin:"0 0 8px 0"},explanationText:{fontSize:14,color:e.textSecondary,margin:0,lineHeight:1.5},bucketsRow:{display:"flex",gap:10,justifyContent:"center",flexWrap:"wrap"},bucket:{flex:"1 1 120px",maxWidth:200,padding:"16px 12px",border:"2px solid",borderRadius:10,backgroundColor:"transparent",cursor:"pointer",textAlign:"center",fontFamily:"inherit",transition:"all 0.2s ease"},itemCard:{padding:"24px 20px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,textAlign:"center"},itemText:{fontSize:16,color:e.textBright,margin:0,lineHeight:1.5},healthBarOuter:{height:8,backgroundColor:e.bgTertiary,borderRadius:4,overflow:"hidden"},healthBarInner:{height:"100%",borderRadius:4,transition:"width 0.5s ease, background-color 0.3s ease"},scenarioPanel:{padding:"24px 20px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10},situationText:{fontSize:16,color:e.textBright,margin:0,lineHeight:1.6},scenarioChoice:{display:"block",width:"100%",padding:"14px 18px",border:"1px solid",borderRadius:10,fontSize:14,color:e.textPrimary,fontFamily:"inherit",textAlign:"left",transition:"border-color 0.15s ease, background-color 0.15s ease, opacity 0.3s ease"},consequenceBox:{margin:"8px 0 0 16px",padding:"12px 16px",border:"1px solid",borderRadius:8,backgroundColor:e.bgPrimary},consequenceText:{fontSize:14,color:e.textPrimary,margin:0,lineHeight:1.5},sprintPrompt:{padding:"20px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,textAlign:"center"},sprintTask:{fontSize:18,fontWeight:600,color:e.textBright,margin:0,lineHeight:1.4},sprintForm:{display:"flex",flexDirection:"column",gap:12,alignItems:"center"},sprintInputWrapper:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"12px 16px",backgroundColor:e.bgPrimary,border:"2px solid",borderRadius:8,transition:"border-color 0.2s ease"},sprintCaret:{color:e.success,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontWeight:700,fontSize:16,flexShrink:0},sprintInput:{flex:1,background:"none",border:"none",outline:"none",color:e.textPrimary,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:15},sprintAnswer:{padding:"12px 16px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:8,fontSize:14,textAlign:"center"},sprintCode:{fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',color:e.accent},cardGrid:{display:"grid",gap:10,justifyContent:"center"},memoryCard:{aspectRatio:"1 / 1",minHeight:80,display:"flex",alignItems:"center",justifyContent:"center",padding:8,border:"2px solid",borderRadius:10,fontFamily:"inherit",transition:"all 0.2s ease",cursor:"pointer"},cardText:{textAlign:"center",lineHeight:1.3,wordBreak:"break-word"},cardBack:{fontSize:24,fontWeight:700,color:e.textMuted},resultsCard:{maxWidth:500,margin:"40px auto 0",padding:"40px 32px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:16,textAlign:"center",display:"flex",flexDirection:"column",gap:20},resultsTitle:{fontSize:24,fontWeight:700,color:e.textBright,margin:0},starsRow:{fontSize:32,letterSpacing:8},resultsGrid:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:24},resultStat:{display:"flex",flexDirection:"column",alignItems:"center",gap:4},resultValue:{fontSize:28,fontWeight:700,color:e.accent},resultLabel:{fontSize:12,color:e.textSecondary,textTransform:"uppercase",letterSpacing:1},xpEarned:{fontSize:20,fontWeight:700,color:e.success,padding:"8px 16px",backgroundColor:`${e.success}15`,borderRadius:8,alignSelf:"center"},playAgainButton:{padding:"12px 32px",fontSize:15,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:8,cursor:"pointer",alignSelf:"center"}}}const qN=[{id:"home",label:"Home",icon:"🏠"},{id:"modules",label:"Modules",icon:"📚"},{id:"journeys",label:"Journeys",icon:"🗺"},{id:"achievements",label:"Achievements",icon:"🏆"},{id:"about",label:"About",icon:"ℹ"},{id:"playground",label:"Playground",icon:"🧪"},{id:"settings",label:"Settings",icon:"⚙"}];function UN({activeNav:e,onNavClick:t,belt:r,xp:i,streak:n,onNewChat:s}){const{theme:a}=Bt(),l=M.useMemo(()=>VN(a),[a]);return g.jsxs("nav",{style:l.nav,children:[g.jsxs("div",{style:l.left,children:[g.jsx("span",{style:l.logo,children:"⬡ Socrates"}),g.jsx("div",{style:l.navItems,children:qN.map(u=>g.jsxs("button",{style:e===u.id?l.navItemActive:l.navItem,onClick:()=>t(u.id),children:[u.icon," ",u.label]},u.id))})]}),g.jsxs("div",{style:l.right,children:[r&&g.jsxs("div",{style:{...l.beltBadge,background:`linear-gradient(135deg, ${r.color}22, ${r.color}11)`,border:`1px solid ${r.color}44`},children:[g.jsx("span",{children:r.badge}),g.jsxs("span",{style:{color:r.color,fontWeight:600},children:[r.name," Belt"]}),g.jsx("span",{style:{color:a.textSecondary},children:"·"}),g.jsxs("span",{style:{color:a.textPrimary},children:[i," XP"]})]}),n>0&&g.jsxs("div",{style:l.streakBadge,children:[g.jsx("span",{children:"🔥"}),g.jsx("span",{style:{color:a.orange,fontWeight:600},children:n})]})]})]})}function VN(e){return{nav:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",height:48,backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.border}`,flexShrink:0},left:{display:"flex",alignItems:"center",gap:16},logo:{fontSize:14,fontWeight:800,color:e.accent,letterSpacing:"-0.5px"},navItems:{display:"flex",gap:2,marginLeft:8},navItem:{padding:"4px 10px",fontSize:11,color:e.textSecondary,backgroundColor:"transparent",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"inherit"},navItemActive:{padding:"4px 10px",fontSize:11,color:e.textPrimary,backgroundColor:e.bgTertiary,border:"none",borderRadius:6,cursor:"pointer",fontFamily:"inherit"},right:{display:"flex",alignItems:"center",gap:8},beltBadge:{display:"flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:16,fontSize:10},streakBadge:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:16,fontSize:11,background:`${e.orange}22`,border:`1px solid ${e.orange}44`}}}function GN({onClick:e}){const{theme:t}=Bt(),r=M.useMemo(()=>YN(t),[t]);return g.jsx("button",{style:r.bubble,onClick:e,title:"Open chat",children:g.jsx("span",{style:r.icon,children:"💬"})})}function YN(e){return{bubble:{position:"fixed",bottom:16,right:16,width:44,height:44,borderRadius:"50%",background:`linear-gradient(135deg, ${e.userBubble}, ${e.accent})`,border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 2px 12px ${e.accent}33`,zIndex:100,transition:"transform 0.15s ease"},icon:{fontSize:18,lineHeight:1}}}const KN="canvas:diagram",XN="canvas:quiz",QN="canvas:code",ZN="canvas:dashboard",JN="canvas:html",eW="canvas:celebrate",tW="canvas:terminal",rW="canvas:game",iW="canvas:settings",nW="canvas:workshop",sW="canvas:workshop-update",oW="canvas:code-result",aW="canvas:journey-browser",lW="canvas:journey-map",cW="canvas:web-embed",hW="event:quiz-answer",uW="event:code-run",dW="event:click",fW="event:drag-complete",pW="event:terminal-command",gW="event:game-result",mW="event:pty-output",yW="event:file-save",_W="event:workshop-done",xW="event:terminal-share",vW="capture:text",bW="capture:page",SW="context:topic",wW="context:match",CW="chat:send",kW="chat:assistant",TW="chat:stream",EW="chat:tool-use",BW="chat:tool-result",MW="chat:status",LW="chat:stop",RW="chat:suggestions",AW="session:list",DW="session:update",PW="sys:connect",IW="sys:disconnect",$W="sys:tier-change",jW="sys:heartbeat",OW={canvas:[KN,XN,QN,ZN,JN,eW,tW,rW,iW,nW,sW,oW,aW,lW,cW],event:[hW,uW,dW,fW,pW,gW,mW,yW,_W,xW],capture:[vW,bW],context:[SW,wW],chat:[CW,kW,TW,EW,BW,MW,LW,RW],session:[AW,DW],system:[PW,IW,$W,jW]};new Set(Object.values(OW).flat());const du={LEARNING:"learning",QUIZZES_GAMES:"quizzes-games",STREAKS:"streaks",BELTS:"belts"},vg=[{id:"first-steps",icon:"🌱",name:"First Steps",description:"Complete your first module",category:"learning",criteria:{type:"modules-completed",target:1}},{id:"bookworm",icon:"📚",name:"Bookworm",description:"Complete 5 modules",category:"learning",criteria:{type:"modules-completed",target:5}},{id:"scholar",icon:"🎓",name:"Scholar",description:"Complete 20 modules",category:"learning",criteria:{type:"modules-completed",target:20}},{id:"encyclopedist",icon:"🏛",name:"Encyclopedist",description:"Complete all modules",category:"learning",criteria:{type:"modules-completed-all"}},{id:"deep-diver",icon:"🧠",name:"Deep Diver",description:"Complete 3 advanced modules",category:"learning",criteria:{type:"advanced-completed",target:3}},{id:"author",icon:"✍️",name:"Author",description:"Create a custom module",category:"learning",criteria:{type:"modules-authored",target:1}},{id:"speed-demon",icon:"⚡",name:"Speed Demon",description:"5 quizzes under 10s each",category:"quizzes-games",criteria:{type:"fast-quizzes",target:5}},{id:"perfect-score",icon:"🎯",name:"Perfect Score",description:"100% on any quiz",category:"quizzes-games",criteria:{type:"quiz-perfect",target:1}},{id:"bug-squasher",icon:"🐛",name:"Bug Squasher",description:"Win 10 Bug Hunt games",category:"quizzes-games",criteria:{type:"bug-hunt-wins",target:10}},{id:"memory-master",icon:"🧩",name:"Memory Master",description:"Perfect memory match 5 times",category:"quizzes-games",criteria:{type:"memory-perfect",target:5}},{id:"command-racer",icon:"🏘",name:"Command Racer",description:"100% on Command Sprint",category:"quizzes-games",criteria:{type:"command-sprint-perfect",target:1}},{id:"game-night",icon:"🎲",name:"Game Night",description:"Play all 6 game types",category:"quizzes-games",criteria:{type:"game-types-played",target:6}},{id:"streak-breaker",icon:"🔥",name:"Streak Breaker",description:"5x streak multiplier in Speed Round",category:"quizzes-games",criteria:{type:"speed-streak",target:5}},{id:"triple-crown",icon:"👑",name:"Triple Crown",description:"3 stars on 10 different games",category:"quizzes-games",criteria:{type:"three-star-games",target:10}},{id:"on-fire",icon:"🔥",name:"On Fire",description:"5-day learning streak",category:"streaks",criteria:{type:"streak-days",target:5}},{id:"marathon",icon:"🏃",name:"Marathon",description:"30-day learning streak",category:"streaks",criteria:{type:"streak-days",target:30}},{id:"night-owl",icon:"🦉",name:"Night Owl",description:"Study after midnight",category:"streaks",criteria:{type:"time-of-day",target:"night"},rare:!0},{id:"early-bird",icon:"☀️",name:"Early Bird",description:"Study before 7am",category:"streaks",criteria:{type:"time-of-day",target:"morning"},rare:!0},{id:"consistent",icon:"📅",name:"Consistent",description:"Learn something every day for a week",category:"streaks",criteria:{type:"streak-days",target:7}},{id:"belt-white",icon:"⚪",name:"White Belt",description:"Earn the White Belt",category:"belts",criteria:{type:"belt-earned",target:"White"}},{id:"belt-yellow",icon:"🟡",name:"Yellow Belt",description:"Earn the Yellow Belt",category:"belts",criteria:{type:"belt-earned",target:"Yellow"}},{id:"belt-green",icon:"🟢",name:"Green Belt",description:"Earn the Green Belt",category:"belts",criteria:{type:"belt-earned",target:"Green"}},{id:"belt-blue",icon:"🔵",name:"Blue Belt",description:"Earn the Blue Belt",category:"belts",criteria:{type:"belt-earned",target:"Blue"}},{id:"belt-purple",icon:"🟣",name:"Purple Belt",description:"Earn the Purple Belt",category:"belts",criteria:{type:"belt-earned",target:"Purple"}},{id:"belt-brown",icon:"🟤",name:"Brown Belt",description:"Earn the Brown Belt",category:"belts",criteria:{type:"belt-earned",target:"Brown"}},{id:"belt-black",icon:"⚫",name:"Black Belt",description:"Earn the Black Belt",category:"belts",criteria:{type:"belt-earned",target:"Black"}},{id:"pathfinder",icon:"🧭",name:"Pathfinder",description:"Start your first learning journey",category:"journeys",criteria:{type:"journeys-started",target:1}},{id:"stage-clear",icon:"🏁",name:"Stage Clear",description:"Complete a journey stage",category:"journeys",criteria:{type:"journey-stages-completed",target:1}},{id:"journey-complete",icon:"🏆",name:"Journey Complete",description:"Complete an entire learning journey",category:"journeys",criteria:{type:"journeys-completed",target:1}},{id:"multi-path",icon:"🛤",name:"Multi-Path",description:"Complete 3 different journeys",category:"journeys",criteria:{type:"journeys-completed",target:3}}],zW=[{id:"claude-haiku-4-5",label:"Haiku",description:"Fastest responses, lower cost"},{id:"claude-sonnet-4-6",label:"Sonnet",description:"Balanced speed and quality"},{id:"claude-opus-4-6",label:"Opus",description:"Most capable, best for complex tasks"}],FW="claude-sonnet-4-6",NW=50,tb=[{key:du.LEARNING,label:"Learning Milestones",icon:"📖"},{key:du.QUIZZES_GAMES,label:"Quizzes & Games",icon:"🎮"},{key:du.STREAKS,label:"Streaks & Dedication",icon:"🔥"},{key:du.BELTS,label:"Belt Milestones",icon:"🥋"}];function WW(e,t){switch(e){case"learning":return t.success;case"quizzes-games":return t.accent;case"streaks":return t.orange;case"belts":return t.purple;default:return t.accent}}function HW({data:e}){var d;const{theme:t}=Bt(),r=M.useMemo(()=>qW(t),[t]),i=(e==null?void 0:e.achievements)||{unlocked:[],near:[]},n=M.useMemo(()=>{const p=new Map;for(const m of i.unlocked||[])p.set(m.id,m);return p},[i.unlocked]),s=M.useMemo(()=>{const p=new Map;for(const m of i.near||[])p.set(m.id,m);return p},[i.near]),a=((d=i.unlocked)==null?void 0:d.length)||0,l=vg.length-a,u=vg.filter(p=>p.rare&&n.has(p.id)).length,h=M.useMemo(()=>{const p={};for(const m of tb)p[m.key]=[];for(const m of vg)p[m.category]&&p[m.category].push(m);return p},[]);return g.jsxs("div",{style:r.container,children:[g.jsxs("div",{style:r.statsBar,children:[g.jsxs("div",{style:{...r.statCard,border:`1px solid ${t.warning}44`},children:[g.jsx("span",{style:{fontSize:24},children:"🏆"}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:22,fontWeight:700,color:t.warning},children:a}),g.jsx("div",{style:{fontSize:11,color:t.textSecondary},children:"Unlocked"})]})]}),g.jsxs("div",{style:{...r.statCard,border:`1px solid ${t.border}`},children:[g.jsx("span",{style:{fontSize:24},children:"🔒"}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:22,fontWeight:700,color:t.textSecondary},children:l}),g.jsx("div",{style:{fontSize:11,color:t.textSecondary},children:"Locked"})]})]}),g.jsxs("div",{style:{...r.statCard,border:`1px solid ${t.purple}44`},children:[g.jsx("span",{style:{fontSize:24},children:"✨"}),g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:22,fontWeight:700,color:t.purple},children:u}),g.jsx("div",{style:{fontSize:11,color:t.textSecondary},children:"Rare"})]})]})]}),tb.map(p=>{const m=h[p.key]||[],y=WW(p.key,t);return g.jsxs("div",{style:r.categorySection,children:[g.jsxs("div",{style:r.categoryHeader,children:[g.jsx("span",{children:p.icon}),g.jsx("h3",{style:r.categoryTitle,children:p.label}),g.jsxs("span",{style:{fontSize:11,color:t.textMuted,marginLeft:"auto"},children:[m.filter(x=>n.has(x.id)).length,"/",m.length]})]}),g.jsx("div",{style:r.badgeGrid,children:m.map(x=>{const v=n.get(x.id),S=s.get(x.id),C=!!v,B=!C&&!!S;return g.jsxs("div",{style:{...r.badge,background:C?`linear-gradient(135deg, ${y}22, ${y}11)`:t.bgSecondary,border:C?`1px solid ${y}44`:`1px solid ${t.border}`,boxShadow:C?`0 0 12px ${y}15`:"none"},children:[x.rare&&g.jsx("span",{style:{position:"absolute",top:6,right:6,fontSize:8,fontWeight:700,color:t.purple,backgroundColor:`${t.purple}22`,padding:"1px 4px",borderRadius:3},children:"RARE"}),C&&v.isNew&&g.jsx("span",{style:{position:"absolute",top:6,left:6,fontSize:8,fontWeight:700,color:t.warning,backgroundColor:`${t.warning}22`,padding:"1px 4px",borderRadius:3},children:"NEW"}),g.jsx("span",{style:{fontSize:32,filter:C?"none":"grayscale(100%)",opacity:C?1:.4},children:x.icon}),g.jsx("span",{style:{fontSize:12,fontWeight:600,color:C?t.textPrimary:t.textSecondary},children:x.name}),g.jsx("span",{style:{fontSize:10,color:t.textMuted,textAlign:"center",lineHeight:1.3},children:x.description}),C&&v.date&&g.jsx("span",{style:{fontSize:9,color:t.textMuted},children:v.date}),!C&&g.jsx("span",{style:{fontSize:9,color:t.textMuted},children:"???"}),B&&S.current!==void 0&&g.jsxs("div",{style:{width:"80%",marginTop:2},children:[g.jsx("div",{style:{height:3,backgroundColor:t.bgTertiary,borderRadius:2,overflow:"hidden"},children:g.jsx("div",{style:{height:"100%",width:`${Math.min(100,S.current/S.target*100)}%`,backgroundColor:y,borderRadius:2}})}),g.jsxs("span",{style:{fontSize:9,color:t.textMuted},children:[S.current,"/",S.target]})]})]},x.id)})})]},p.key)})]})}function qW(e){return{container:{maxWidth:900,margin:"0 auto",display:"flex",flexDirection:"column",gap:28},statsBar:{display:"flex",gap:12,flexWrap:"wrap"},statCard:{flex:"1 1 140px",display:"flex",alignItems:"center",gap:12,padding:"16px 20px",backgroundColor:e.bgSecondary,borderRadius:12},categorySection:{display:"flex",flexDirection:"column",gap:12},categoryHeader:{display:"flex",alignItems:"center",gap:8},categoryTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:0},badgeGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(130px, 1fr))",gap:10},badge:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,padding:"16px 10px",borderRadius:12,textAlign:"center",position:"relative",transition:"transform 0.15s ease",cursor:"default"}}}const UW=["All","Developer","Leadership","AI","Product","Testing","General"],VW={developer:["developer-skills","fundamentals","frameworks","languages","claude-code","data"],leadership:["leadership"],ai:["ai-and-llm"],product:["product-management","project-management","ux-design"],testing:["quality-assurance"],general:["general","architecture"]};function GW({data:e,onStartLearning:t,onSelectModule:r}){var L;const{theme:i}=Bt(),n=M.useMemo(()=>YW(i),[i]),[s,a]=M.useState([]),[l,u]=M.useState(""),[h,d]=M.useState("All"),[p,m]=M.useState(null),y=((L=e==null?void 0:e.progress)==null?void 0:L.modules)||[];M.useEffect(()=>{fetch("http://localhost:3456/api/modules").then(k=>k.ok?k.json():[]).then(k=>{const A=Array.isArray(k)?k:k.modules||[];a(A)}).catch(()=>a([]))},[]);const x=M.useMemo(()=>{const k=new Map;for(const A of y)k.set(A.slug,A);return s.map(A=>({...A,...k.get(A.slug)||{}}))},[s,y]),v=M.useMemo(()=>{let k=x;if(l.trim()){const A=l.toLowerCase();k=k.filter(z=>(z.title||"").toLowerCase().includes(A)||(z.description||"").toLowerCase().includes(A)||(z.slug||"").toLowerCase().includes(A))}if(h!=="All"){const A=h.toLowerCase(),z=VW[A];z?k=k.filter(U=>z.includes((U.category||"general").toLowerCase())):k=k.filter(U=>(U.category||"general").toLowerCase()===A)}return k},[x,l,h]),S=v.filter(k=>k.status&&k.status!=="completed"),C=v.filter(k=>k.status==="completed"),B=v,R=k=>{switch((k||"").toLowerCase()){case"beginner":return i.success;case"intermediate":return i.warning;case"advanced":return i.error;default:return i.textMuted}},E=(k,A)=>{const z=p===k.slug;return g.jsxs("div",{style:{...n.card,borderColor:A||i.border,transform:z?"translateY(-2px)":"none",boxShadow:z?`0 6px 20px ${i.bgPrimary}80`:"none",cursor:"pointer"},onClick:()=>r?r(k):null,onMouseEnter:()=>m(k.slug),onMouseLeave:()=>m(null),children:[g.jsxs("div",{style:n.cardHeader,children:[g.jsx("span",{style:n.cardIcon,children:k.icon||"📘"}),g.jsxs("div",{style:n.cardTitleWrap,children:[g.jsx("h4",{style:n.cardTitle,children:k.title||k.slug}),k.category&&g.jsx("span",{style:n.categoryBadge,children:k.category})]})]}),k.description&&g.jsx("p",{style:n.cardDescription,children:k.description}),g.jsxs("div",{style:n.cardFooter,children:[k.difficulty&&g.jsx("span",{style:{...n.difficultyBadge,color:R(k.difficulty),backgroundColor:`${R(k.difficulty)}18`},children:k.difficulty}),k.status==="completed"&&g.jsxs("span",{style:n.completedBadge,children:["✓"," Done"]}),k.status&&k.status!=="completed"&&k.walkthroughStep!=null&&g.jsxs("span",{style:n.progressBadge,children:["Step ",k.walkthroughStep,"/",k.totalSteps||"?"]}),k.xpEarned>0&&g.jsxs("span",{style:n.xpBadge,children:[k.xpEarned," XP"]}),t&&g.jsx("button",{style:n.startButton,onClick:U=>{U.stopPropagation(),t(k.slug)},children:k.status==="completed"?"Review":k.status?"Continue":"Start Learning"})]})]},k.slug)};return g.jsxs("div",{style:n.container,children:[g.jsxs("div",{style:n.toolbar,children:[g.jsx("input",{type:"text",placeholder:"Search modules...",value:l,onChange:k=>u(k.target.value),style:n.searchInput}),g.jsx("div",{style:n.chips,children:UW.map(k=>g.jsx("button",{"data-testid":`filter-${k.toLowerCase()}`,onClick:()=>d(k),style:{...n.chip,backgroundColor:h===k?i.accent:i.bgTertiary,color:h===k?i.bgPrimary:i.textSecondary,fontWeight:h===k?600:400},children:k},k))})]}),S.length>0&&g.jsxs("div",{style:n.section,children:[g.jsx("h3",{style:n.sectionTitle,children:"In Progress"}),g.jsx("div",{style:n.grid,children:S.map(k=>E(k,i.accent))})]}),C.length>0&&g.jsxs("div",{style:n.section,children:[g.jsx("h3",{style:n.sectionTitle,children:"Completed"}),g.jsx("div",{style:n.grid,children:C.map(k=>E(k,i.success))})]}),g.jsxs("div",{style:n.section,children:[g.jsx("h3",{style:n.sectionTitle,children:"All Modules"}),B.length>0?g.jsx("div",{style:n.grid,children:B.map(k=>E(k,null))}):g.jsxs("div",{style:n.emptyState,children:[g.jsx("span",{style:n.emptyIcon,children:"🔍"}),g.jsx("p",{style:n.emptyTitle,children:"No modules found"}),g.jsx("p",{style:n.emptySubtext,children:l?`No results for "${l}". Try a different search term.`:"No modules available in this category yet."})]})]})]})}function YW(e){return{container:{maxWidth:960,margin:"0 auto",display:"flex",flexDirection:"column",gap:28},toolbar:{display:"flex",flexDirection:"column",gap:12},searchInput:{width:"100%",padding:"10px 14px",fontSize:14,backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:8,color:e.textPrimary,outline:"none",boxSizing:"border-box"},chips:{display:"flex",gap:8,flexWrap:"wrap"},chip:{padding:"5px 14px",fontSize:13,border:"none",borderRadius:16,cursor:"pointer",transition:"background-color 0.15s ease, color 0.15s ease"},section:{display:"flex",flexDirection:"column",gap:12},sectionTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:0},grid:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:14},card:{padding:16,backgroundColor:e.bgSecondary,border:"1px solid",borderRadius:10,display:"flex",flexDirection:"column",gap:10,transition:"transform 0.15s ease, box-shadow 0.15s ease"},cardHeader:{display:"flex",alignItems:"flex-start",gap:10},cardIcon:{fontSize:32,lineHeight:1,flexShrink:0},cardTitleWrap:{display:"flex",flexDirection:"column",gap:4,minWidth:0},cardTitle:{fontSize:14,fontWeight:600,color:e.textPrimary,margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},categoryBadge:{fontSize:11,color:e.textMuted,textTransform:"capitalize"},cardDescription:{fontSize:13,color:e.textSecondary,margin:0,lineHeight:1.4,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},cardFooter:{display:"flex",gap:8,flexWrap:"wrap",marginTop:"auto"},difficultyBadge:{fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:4,textTransform:"capitalize"},completedBadge:{fontSize:11,fontWeight:600,color:e.success,backgroundColor:`${e.success}18`,padding:"2px 8px",borderRadius:4},progressBadge:{fontSize:11,fontWeight:600,color:e.accent,backgroundColor:`${e.accent}18`,padding:"2px 8px",borderRadius:4},xpBadge:{fontSize:11,fontWeight:600,color:e.warning,backgroundColor:`${e.warning}18`,padding:"2px 8px",borderRadius:4},startButton:{marginLeft:"auto",padding:"4px 12px",fontSize:11,fontWeight:600,color:e.bgPrimary,backgroundColor:e.accent,border:"none",borderRadius:6,cursor:"pointer"},emptyState:{textAlign:"center",padding:"48px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,display:"flex",flexDirection:"column",alignItems:"center",gap:8},emptyIcon:{fontSize:36,opacity:.4},emptyTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0,maxWidth:320}}}const KW=["Appearance","Learning","Notifications","Connections","Data"],XW={Appearance:"✨",Learning:"📚",Notifications:"🔔",Connections:"🔗",Data:"💾"},QW=["beginner","intermediate","advanced"],ZW=["gentle","standard","strict"],TE="http://localhost:3456/api/settings";function ql(e){return fetch(TE,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).catch(()=>{})}function JW(){const{theme:e,preference:t,accentName:r,setThemePreference:i,setAccent:n}=Bt(),s=M.useMemo(()=>eH(e),[e]),[a,l]=M.useState("Appearance"),[u,h]=M.useState(14),[d,p]=M.useState(!0),[m,y]=M.useState(!0),[x,v]=M.useState(!0),[S,C]=M.useState(FW),[B,R]=M.useState("intermediate"),[E,L]=M.useState(!0),[k,A]=M.useState("standard"),[z,U]=M.useState(!0),[q,H]=M.useState(!0),[Y,F]=M.useState(!1),[O]=M.useState("http://localhost:3456"),[$,j]=M.useState("unknown"),[W,P]=M.useState("FULL"),[Z,ee]=M.useState({modules:0,quizzes:0,xp:0}),[I,Q]=M.useState(!1),[te,X]=M.useState(0),[ce,oe]=M.useState(0),[ye,ve]=M.useState(!1);M.useEffect(()=>{fetch(TE).then(ae=>ae.ok?ae.json():null).then(ae=>{ae&&(ae.fontSize&&h(ae.fontSize),ae.confetti!==void 0&&p(ae.confetti),ae.transitions!==void 0&&y(ae.transitions),ae.diagrams!==void 0&&v(ae.diagrams),ae.model&&C(ae.model),ae.difficulty&&R(ae.difficulty),ae.quizTimer!==void 0&&L(ae.quizTimer),ae.strictness&&A(ae.strictness),ae.streakReminders!==void 0&&U(ae.streakReminders),ae.achievementPopups!==void 0&&H(ae.achievementPopups),ae.soundEffects!==void 0&&F(ae.soundEffects),ae.extensionStatus&&j(ae.extensionStatus),ae.tier&&P(ae.tier),ae.history&&ee(ae.history))}).catch(()=>{}),fetch("http://localhost:3456/api/sessions").then(ae=>ae.ok?ae.json():null).then(ae=>{ae!=null&&ae.sessions&&(X(ae.sessions.length),oe(ae.sessions.reduce((ht,ut)=>ht+(ut.messageCount||0),0)))}).catch(()=>{})},[]);const Ce=M.useCallback(ae=>{h(ht=>{const ut=Math.max(12,Math.min(18,ht+ae));return ql({fontSize:ut}),ut})},[]),Ee=M.useCallback((ae,ht)=>{ae(ut=>(ql({[ht]:!ut}),!ut))},[]),Ke=M.useCallback(()=>{fetch("http://localhost:3456/api/progress").then(ae=>ae.json()).then(ae=>{const ht=new Blob([JSON.stringify(ae,null,2)],{type:"application/json"}),ut=document.createElement("a");ut.href=URL.createObjectURL(ht),ut.download="claudeteach-progress.json",ut.click()}).catch(()=>{})},[]),ct=M.useCallback(()=>{if(!I){Q(!0);return}fetch("http://localhost:3456/api/progress",{method:"DELETE"}).then(()=>{ee({modules:0,quizzes:0,xp:0}),Q(!1)}).catch(()=>{})},[I]),ze=M.useCallback(()=>{if(!ye){ve(!0);return}fetch("http://localhost:3456/api/sessions",{method:"DELETE"}).then(()=>{X(0),oe(0),ve(!1)}).catch(()=>{})},[ye]),pt=(ae,ht,ut)=>g.jsxs("div",{style:s.toggleRow,children:[g.jsx("span",{style:s.toggleLabel,children:ae}),g.jsx("button",{style:{...s.toggleTrack,background:ht?e.accent:e.bgTertiary},onClick:ut,children:g.jsx("span",{style:{...s.toggleThumb,transform:ht?"translateX(18px)":"translateX(2px)"}})})]}),dt=(ae,ht,ut,Vt)=>g.jsxs("button",{onClick:ut,style:{...s.selectionCard,borderColor:ht?e.accent:e.border,background:ht?`${e.accent}12`:e.bgSecondary},children:[g.jsx("span",{style:{...s.cardLabel,color:ht?e.accent:e.textPrimary},children:ae}),Vt&&g.jsx("span",{style:s.cardSub,children:Vt})]},ae);return g.jsxs("div",{style:s.wrapper,children:[g.jsxs("nav",{style:s.sidebar,children:[g.jsx("h2",{style:s.sidebarTitle,children:"Settings"}),KW.map(ae=>g.jsxs("button",{onClick:()=>l(ae),style:{...s.tabBtn,background:a===ae?`${e.accent}18`:"transparent",color:a===ae?e.accent:e.textSecondary,borderLeft:a===ae?`3px solid ${e.accent}`:"3px solid transparent"},children:[g.jsx("span",{style:s.tabIcon,children:XW[ae]}),ae]},ae))]}),g.jsxs("main",{style:s.content,children:[a==="Appearance"&&g.jsxs(g.Fragment,{children:[g.jsx(qr,{title:"Theme",s,children:g.jsx("div",{style:s.cardRow,children:["dark","light","system"].map(ae=>dt(ae.charAt(0).toUpperCase()+ae.slice(1),t===ae,()=>i(ae),ae==="dark"?"Easy on the eyes":ae==="light"?"Bright & clean":"Match OS setting"))})}),g.jsx(qr,{title:"Accent Color",s,children:g.jsx("div",{style:s.colorRow,children:Object.keys($s).map(ae=>g.jsx("button",{onClick:()=>n(ae),style:{...s.colorCircle,background:$s[ae][e.id]||$s[ae].dark,boxShadow:r===ae?`0 0 0 3px ${e.bgPrimary}, 0 0 0 5px ${$s[ae][e.id]||$s[ae].dark}`:"none",transform:r===ae?"scale(1.15)":"scale(1)"},title:ae},ae))})}),g.jsx(qr,{title:"Font Size",s,children:g.jsxs("div",{style:s.fontRow,children:[g.jsx("button",{style:s.fontBtn,onClick:()=>Ce(-1),disabled:u<=12,children:"-"}),g.jsxs("span",{style:s.fontValue,children:[u,"px"]}),g.jsx("button",{style:s.fontBtn,onClick:()=>Ce(1),disabled:u>=18,children:"+"})]})}),g.jsxs(qr,{title:"Animations",s,children:[pt("Confetti celebrations",d,()=>Ee(p,"confetti")),pt("UI transitions",m,()=>Ee(y,"transitions")),pt("Diagram animations",x,()=>Ee(v,"diagrams"))]})]}),a==="Learning"&&g.jsxs(g.Fragment,{children:[g.jsxs(qr,{title:"AI Model",s,children:[g.jsx("div",{style:s.cardRow,children:zW.map(ae=>dt(ae.label,S===ae.id,()=>{C(ae.id),ql({model:ae.id}),window.dispatchEvent(new CustomEvent("settings:model-changed",{detail:ae.id}))},ae.description))}),g.jsx("p",{style:{fontSize:12,color:e.textMuted,marginTop:8},children:"Applies to new chat sessions"})]}),g.jsx(qr,{title:"Default Difficulty",s,children:g.jsx("select",{value:B,onChange:ae=>{R(ae.target.value),ql({difficulty:ae.target.value})},style:s.select,children:QW.map(ae=>g.jsx("option",{value:ae,children:ae.charAt(0).toUpperCase()+ae.slice(1)},ae))})}),g.jsx(qr,{title:"Quiz Timer",s,children:pt("Enable countdown timer on quizzes",E,()=>Ee(L,"quizTimer"))}),g.jsx(qr,{title:"Socratic Strictness",s,children:g.jsx("div",{style:s.cardRow,children:ZW.map(ae=>dt(ae.charAt(0).toUpperCase()+ae.slice(1),k===ae,()=>{A(ae),ql({strictness:ae})},ae==="gentle"?"More hints & guidance":ae==="standard"?"Balanced approach":"Minimal hand-holding"))})})]}),a==="Notifications"&&g.jsx(g.Fragment,{children:g.jsxs(qr,{title:"Alerts",s,children:[pt("Streak reminders",z,()=>Ee(U,"streakReminders")),pt("Achievement popups",q,()=>Ee(H,"achievementPopups")),pt("Sound effects",Y,()=>Ee(F,"soundEffects"))]})}),a==="Connections"&&g.jsxs(g.Fragment,{children:[g.jsx(qr,{title:"Bridge Server",s,children:g.jsxs("div",{style:s.infoRow,children:[g.jsx("span",{style:s.infoLabel,children:"URL"}),g.jsx("span",{style:s.infoValue,children:O})]})}),g.jsx(qr,{title:"Extension",s,children:g.jsxs("div",{style:s.infoRow,children:[g.jsx("span",{style:s.infoLabel,children:"Status"}),g.jsx("span",{style:{...s.statusBadge,background:$==="connected"?`${e.success}22`:`${e.warning}22`,color:$==="connected"?e.success:e.warning},children:$==="connected"?"Connected":$==="unknown"?"Checking...":"Disconnected"})]})}),g.jsx(qr,{title:"Tier",s,children:g.jsxs("div",{style:s.infoRow,children:[g.jsx("span",{style:s.infoLabel,children:"Enhancement level"}),g.jsx("span",{style:{...s.statusBadge,background:`${e.accent}22`,color:e.accent},children:W})]})})]}),a==="Data"&&g.jsxs(g.Fragment,{children:[g.jsx(qr,{title:"Learning History",s,children:g.jsxs("div",{style:s.statGrid,children:[g.jsxs("div",{style:s.statCell,children:[g.jsx("span",{style:s.statNum,children:Z.modules}),g.jsx("span",{style:s.statLabel,children:"Modules"})]}),g.jsxs("div",{style:s.statCell,children:[g.jsx("span",{style:s.statNum,children:Z.quizzes}),g.jsx("span",{style:s.statLabel,children:"Quizzes"})]}),g.jsxs("div",{style:s.statCell,children:[g.jsx("span",{style:s.statNum,children:Z.xp}),g.jsx("span",{style:s.statLabel,children:"Total XP"})]})]})}),g.jsxs(qr,{title:"Session History",s,children:[g.jsxs("p",{style:{fontSize:13,color:e.textSecondary,margin:"0 0 10px"},children:[te," saved session",te!==1?"s":""," with ",ce," total message",ce!==1?"s":""]}),g.jsx("div",{style:s.btnRow,children:g.jsx("button",{style:{...s.dangerBtn,background:ye?e.error:"transparent",color:ye?"#fff":e.error},onClick:ze,children:ye?"Confirm Purge":"Purge Session History"})}),ye&&g.jsx("p",{style:s.warnText,children:"This will permanently delete all conversation history. Click again to confirm."})]}),g.jsxs(qr,{title:"Export & Reset",s,children:[g.jsxs("div",{style:s.btnRow,children:[g.jsx("button",{style:s.primaryBtn,onClick:Ke,children:"Export Progress"}),g.jsx("button",{style:{...s.dangerBtn,background:I?e.error:"transparent"},onClick:ct,children:I?"Confirm Reset":"Reset Progress"})]}),I&&g.jsx("p",{style:s.warnText,children:"This will permanently erase all progress. Click again to confirm."})]})]})]})]})}function qr({title:e,s:t,children:r}){return g.jsxs("div",{style:t.section,children:[g.jsx("h3",{style:t.sectionTitle,children:e}),r]})}function eH(e){return{wrapper:{display:"flex",height:"100%",minHeight:0,background:e.bgPrimary,color:e.textPrimary},sidebar:{width:220,minWidth:220,background:e.bgSecondary,borderRight:`1px solid ${e.border}`,padding:"24px 0",display:"flex",flexDirection:"column",gap:2},sidebarTitle:{fontSize:18,fontWeight:700,color:e.textBright,padding:"0 20px 16px",margin:0,letterSpacing:"-0.02em"},tabBtn:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"10px 20px",border:"none",cursor:"pointer",fontSize:14,fontWeight:500,fontFamily:"inherit",textAlign:"left",transition:"all 0.15s"},tabIcon:{fontSize:16,width:22,textAlign:"center"},content:{flex:1,overflow:"auto",padding:"32px 40px",display:"flex",flexDirection:"column",gap:8},section:{marginBottom:24},sectionTitle:{fontSize:13,fontWeight:600,color:e.textSecondary,textTransform:"uppercase",letterSpacing:"0.06em",margin:"0 0 12px"},cardRow:{display:"flex",gap:12},selectionCard:{flex:1,padding:"14px 16px",borderRadius:10,border:"2px solid",cursor:"pointer",background:"none",fontFamily:"inherit",textAlign:"left",transition:"all 0.15s",display:"flex",flexDirection:"column",gap:4},cardLabel:{fontSize:14,fontWeight:600},cardSub:{fontSize:12,color:e.textMuted},colorRow:{display:"flex",gap:14,alignItems:"center"},colorCircle:{width:32,height:32,borderRadius:"50%",border:"none",cursor:"pointer",transition:"all 0.2s"},fontRow:{display:"flex",alignItems:"center",gap:16},fontBtn:{width:36,height:36,borderRadius:8,border:`1px solid ${e.border}`,background:e.bgSecondary,color:e.textPrimary,fontSize:18,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit"},fontValue:{fontSize:16,fontWeight:600,color:e.textBright,minWidth:48,textAlign:"center"},toggleRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0"},toggleLabel:{fontSize:14,color:e.textPrimary},toggleTrack:{width:42,height:24,borderRadius:12,border:"none",cursor:"pointer",position:"relative",transition:"background 0.2s",padding:0},toggleThumb:{width:20,height:20,borderRadius:"50%",background:"#fff",position:"absolute",top:2,transition:"transform 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"},select:{padding:"8px 12px",borderRadius:8,border:`1px solid ${e.border}`,background:e.bgSecondary,color:e.textPrimary,fontSize:14,fontFamily:"inherit",cursor:"pointer",minWidth:200},infoRow:{display:"flex",alignItems:"center",gap:12,padding:"8px 0"},infoLabel:{fontSize:13,color:e.textSecondary,minWidth:120},infoValue:{fontSize:14,color:e.textPrimary,fontFamily:"monospace",background:e.bgTertiary,padding:"4px 10px",borderRadius:6},statusBadge:{fontSize:13,fontWeight:600,padding:"4px 12px",borderRadius:20},statGrid:{display:"flex",gap:16},statCell:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:4,padding:16,background:e.bgSecondary,borderRadius:10,border:`1px solid ${e.border}`},statNum:{fontSize:24,fontWeight:700,color:e.textBright},statLabel:{fontSize:12,color:e.textSecondary},btnRow:{display:"flex",gap:12},primaryBtn:{padding:"10px 20px",borderRadius:8,border:"none",background:e.accent,color:"#fff",fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},dangerBtn:{padding:"10px 20px",borderRadius:8,border:`1px solid ${e.error}`,color:e.error,fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},warnText:{fontSize:13,color:e.error,marginTop:8}}}/**
|
|
441
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
442
|
+
* @license MIT
|
|
443
|
+
*
|
|
444
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
445
|
+
* @license MIT
|
|
446
|
+
*
|
|
447
|
+
* Originally forked from (with the author's permission):
|
|
448
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
449
|
+
* http://bellard.org/jslinux/
|
|
450
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
451
|
+
*/var EE=Object.defineProperty,tH=Object.getOwnPropertyDescriptor,rH=(e,t)=>{for(var r in t)EE(e,r,{get:t[r],enumerable:!0})},Ft=(e,t,r,i)=>{for(var n=i>1?void 0:i?tH(t,r):t,s=e.length-1,a;s>=0;s--)(a=e[s])&&(n=(i?a(t,r,n):a(n))||n);return i&&n&&EE(t,r,n),n},be=(e,t)=>(r,i)=>t(r,i,e),rb="Terminal input",Dm={get:()=>rb,set:e=>rb=e},ib="Too much output to announce, navigate to rows manually to read",Pm={get:()=>ib,set:e=>ib=e};function iH(e){return e.replace(/\r?\n/g,"\r")}function nH(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function sH(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function oH(e,t,r,i){if(e.stopPropagation(),e.clipboardData){let n=e.clipboardData.getData("text/plain");BE(n,t,r,i)}}function BE(e,t,r,i){e=iH(e),e=nH(e,r.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function ME(e,t,r){let i=r.getBoundingClientRect(),n=e.clientX-i.left-10,s=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${n}px`,t.style.top=`${s}px`,t.style.zIndex="1000",t.focus()}function nb(e,t,r,i,n){ME(e,t,r),n&&i.rightClickSelect(e),t.value=i.selectionText,t.select()}function Ps(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function af(e,t=0,r=e.length){let i="";for(let n=t;n<r;++n){let s=e[n];s>65535?(s-=65536,i+=String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):i+=String.fromCharCode(s)}return i}var aH=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let i=0,n=0;if(this._interim){let s=e.charCodeAt(n++);56320<=s&&s<=57343?t[i++]=(this._interim-55296)*1024+s-56320+65536:(t[i++]=this._interim,t[i++]=s),this._interim=0}for(let s=n;s<r;++s){let a=e.charCodeAt(s);if(55296<=a&&a<=56319){if(++s>=r)return this._interim=a,i;let l=e.charCodeAt(s);56320<=l&&l<=57343?t[i++]=(a-55296)*1024+l-56320+65536:(t[i++]=a,t[i++]=l);continue}a!==65279&&(t[i++]=a)}return i}},lH=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let i=0,n,s,a,l,u=0,h=0;if(this.interim[0]){let m=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let x=0,v;for(;(v=this.interim[++x]&63)&&x<4;)y<<=6,y|=v;let S=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,C=S-x;for(;h<C;){if(h>=r)return 0;if(v=e[h++],(v&192)!==128){h--,m=!0;break}else this.interim[x++]=v,y<<=6,y|=v&63}m||(S===2?y<128?h--:t[i++]=y:S===3?y<2048||y>=55296&&y<=57343||y===65279||(t[i++]=y):y<65536||y>1114111||(t[i++]=y)),this.interim.fill(0)}let d=r-4,p=h;for(;p<r;){for(;p<d&&!((n=e[p])&128)&&!((s=e[p+1])&128)&&!((a=e[p+2])&128)&&!((l=e[p+3])&128);)t[i++]=n,t[i++]=s,t[i++]=a,t[i++]=l,p+=4;if(n=e[p++],n<128)t[i++]=n;else if((n&224)===192){if(p>=r)return this.interim[0]=n,i;if(s=e[p++],(s&192)!==128){p--;continue}if(u=(n&31)<<6|s&63,u<128){p--;continue}t[i++]=u}else if((n&240)===224){if(p>=r)return this.interim[0]=n,i;if(s=e[p++],(s&192)!==128){p--;continue}if(p>=r)return this.interim[0]=n,this.interim[1]=s,i;if(a=e[p++],(a&192)!==128){p--;continue}if(u=(n&15)<<12|(s&63)<<6|a&63,u<2048||u>=55296&&u<=57343||u===65279)continue;t[i++]=u}else if((n&248)===240){if(p>=r)return this.interim[0]=n,i;if(s=e[p++],(s&192)!==128){p--;continue}if(p>=r)return this.interim[0]=n,this.interim[1]=s,i;if(a=e[p++],(a&192)!==128){p--;continue}if(p>=r)return this.interim[0]=n,this.interim[1]=s,this.interim[2]=a,i;if(l=e[p++],(l&192)!==128){p--;continue}if(u=(n&7)<<18|(s&63)<<12|(a&63)<<6|l&63,u<65536||u>1114111)continue;t[i++]=u}}return i}},LE="",Os=" ",Uc=class RE{constructor(){this.fg=0,this.bg=0,this.extended=new Td}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new RE;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Td=class AE{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new AE(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ni=class DE extends Uc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Td,this.combinedData=""}static fromCharData(t){let r=new DE;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ps(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let i=t[1].charCodeAt(0);if(55296<=i&&i<=56319){let n=t[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(i-55296)*1024+n-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},sb="di$target",Im="di$dependencies",bg=new Map;function cH(e){return e[Im]||[]}function yr(e){if(bg.has(e))return bg.get(e);let t=function(r,i,n){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");hH(t,r,n)};return t._id=e,bg.set(e,t),t}function hH(e,t,r){t[sb]===t?t[Im].push({id:e,index:r}):(t[Im]=[{id:e,index:r}],t[sb]=t)}var Qr=yr("BufferService"),PE=yr("CoreMouseService"),Uo=yr("CoreService"),uH=yr("CharsetService"),S0=yr("InstantiationService"),IE=yr("LogService"),Zr=yr("OptionsService"),$E=yr("OscLinkService"),dH=yr("UnicodeService"),Vc=yr("DecorationService"),$m=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){var d;let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let i=[],n=this._optionsService.rawOptions.linkHandler,s=new Ni,a=r.getTrimmedLength(),l=-1,u=-1,h=!1;for(let p=0;p<a;p++)if(!(u===-1&&!r.hasContent(p))){if(r.loadCell(p,s),s.hasExtendedAttrs()&&s.extended.urlId)if(u===-1){u=p,l=s.extended.urlId;continue}else h=s.extended.urlId!==l;else u!==-1&&(h=!0);if(h||u!==-1&&p===a-1){let m=(d=this._oscLinkService.getLinkData(l))==null?void 0:d.uri;if(m){let y={start:{x:u+1,y:e},end:{x:p+(!h&&p===a-1?1:0),y:e}},x=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{let v=new URL(m);["http:","https:"].includes(v.protocol)||(x=!0)}catch{x=!0}x||i.push({text:m,range:y,activate:(v,S)=>n?n.activate(v,S,y):fH(v,S),hover:(v,S)=>{var C;return(C=n==null?void 0:n.hover)==null?void 0:C.call(n,v,S,y)},leave:(v,S)=>{var C;return(C=n==null?void 0:n.leave)==null?void 0:C.call(n,v,S,y)}})}h=!1,s.hasExtendedAttrs()&&s.extended.urlId?(u=p,l=s.extended.urlId):(u=-1,l=-1)}}t(i)}};$m=Ft([be(0,Qr),be(1,Zr),be(2,$E)],$m);function fH(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
452
|
+
|
|
453
|
+
WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var lf=yr("CharSizeService"),ns=yr("CoreBrowserService"),w0=yr("MouseService"),ss=yr("RenderService"),pH=yr("SelectionService"),jE=yr("CharacterJoinerService"),Ka=yr("ThemeService"),OE=yr("LinkProviderService"),gH=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ob.isErrorNoTelemetry(e)?new ob(e.message+`
|
|
454
|
+
|
|
455
|
+
`+e.stack):new Error(e.message+`
|
|
456
|
+
|
|
457
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},mH=new gH;function $u(e){yH(e)||mH.onUnexpectedError(e)}var jm="Canceled";function yH(e){return e instanceof _H?!0:e instanceof Error&&e.name===jm&&e.message===jm}var _H=class extends Error{constructor(){super(jm),this.name=this.message}};function xH(e){return new Error(`Illegal argument: ${e}`)}var ob=class Om extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Om)return t;let r=new Om;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},zm=class zE extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,zE.prototype)}};function vi(e,t=0){return e[e.length-(1+t)]}var vH;(e=>{function t(s){return s<0}e.isLessThan=t;function r(s){return s<=0}e.isLessThanOrEqual=r;function i(s){return s>0}e.isGreaterThan=i;function n(s){return s===0}e.isNeitherLessOrGreaterThan=n,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(vH||(vH={}));function bH(e,t){let r=this,i=!1,n;return function(){return i||(i=!0,t||(n=e.apply(r,arguments))),n}}var FE;(e=>{function t(E){return E&&typeof E=="object"&&typeof E[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function i(){return r}e.empty=i;function*n(E){yield E}e.single=n;function s(E){return t(E)?E:n(E)}e.wrap=s;function a(E){return E||r}e.from=a;function*l(E){for(let L=E.length-1;L>=0;L--)yield E[L]}e.reverse=l;function u(E){return!E||E[Symbol.iterator]().next().done===!0}e.isEmpty=u;function h(E){return E[Symbol.iterator]().next().value}e.first=h;function d(E,L){let k=0;for(let A of E)if(L(A,k++))return!0;return!1}e.some=d;function p(E,L){for(let k of E)if(L(k))return k}e.find=p;function*m(E,L){for(let k of E)L(k)&&(yield k)}e.filter=m;function*y(E,L){let k=0;for(let A of E)yield L(A,k++)}e.map=y;function*x(E,L){let k=0;for(let A of E)yield*L(A,k++)}e.flatMap=x;function*v(...E){for(let L of E)yield*L}e.concat=v;function S(E,L,k){let A=k;for(let z of E)A=L(A,z);return A}e.reduce=S;function*C(E,L,k=E.length){for(L<0&&(L+=E.length),k<0?k+=E.length:k>E.length&&(k=E.length);L<k;L++)yield E[L]}e.slice=C;function B(E,L=Number.POSITIVE_INFINITY){let k=[];if(L===0)return[k,E];let A=E[Symbol.iterator]();for(let z=0;z<L;z++){let U=A.next();if(U.done)return[k,e.empty()];k.push(U.value)}return[k,{[Symbol.iterator](){return A}}]}e.consume=B;async function R(E){let L=[];for await(let k of E)L.push(k);return Promise.resolve(L)}e.asyncToArray=R})(FE||(FE={}));function Oo(e){if(FE.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(i){t.push(i)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function SH(...e){return At(()=>Oo(e))}function At(e){return{dispose:bH(()=>{e()})}}var NE=class WE{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Oo(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?WE.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};NE.DISABLE_DISPOSED_WARNING=!1;var Fs=NE,Qe=class{constructor(){this._store=new Fs,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Qe.None=Object.freeze({dispose(){}});var Wa=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Zn=typeof window=="object"?window:globalThis,Fm=class Nm{constructor(t){this.element=t,this.next=Nm.Undefined,this.prev=Nm.Undefined}};Fm.Undefined=new Fm(void 0);var It=Fm,ab=class{constructor(){this._first=It.Undefined,this._last=It.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===It.Undefined}clear(){let e=this._first;for(;e!==It.Undefined;){let t=e.next;e.prev=It.Undefined,e.next=It.Undefined,e=t}this._first=It.Undefined,this._last=It.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new It(e);if(this._first===It.Undefined)this._first=r,this._last=r;else if(t){let n=this._last;this._last=r,r.prev=n,n.next=r}else{let n=this._first;this._first=r,r.next=n,n.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==It.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==It.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==It.Undefined&&e.next!==It.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===It.Undefined&&e.next===It.Undefined?(this._first=It.Undefined,this._last=It.Undefined):e.next===It.Undefined?(this._last=this._last.prev,this._last.next=It.Undefined):e.prev===It.Undefined&&(this._first=this._first.next,this._first.prev=It.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==It.Undefined;)yield e.element,e=e.next}},wH=globalThis.performance&&typeof globalThis.performance.now=="function",CH=class HE{static create(t){return new HE(t)}constructor(t){this._now=wH&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Cr;(e=>{e.None=()=>Qe.None;function t(Y,F){return p(Y,()=>{},0,void 0,!0,void 0,F)}e.defer=t;function r(Y){return(F,O=null,$)=>{let j=!1,W;return W=Y(P=>{if(!j)return W?W.dispose():j=!0,F.call(O,P)},null,$),j&&W.dispose(),W}}e.once=r;function i(Y,F,O){return h(($,j=null,W)=>Y(P=>$.call(j,F(P)),null,W),O)}e.map=i;function n(Y,F,O){return h(($,j=null,W)=>Y(P=>{F(P),$.call(j,P)},null,W),O)}e.forEach=n;function s(Y,F,O){return h(($,j=null,W)=>Y(P=>F(P)&&$.call(j,P),null,W),O)}e.filter=s;function a(Y){return Y}e.signal=a;function l(...Y){return(F,O=null,$)=>{let j=SH(...Y.map(W=>W(P=>F.call(O,P))));return d(j,$)}}e.any=l;function u(Y,F,O,$){let j=O;return i(Y,W=>(j=F(j,W),j),$)}e.reduce=u;function h(Y,F){let O,$={onWillAddFirstListener(){O=Y(j.fire,j)},onDidRemoveLastListener(){O==null||O.dispose()}},j=new _e($);return F==null||F.add(j),j.event}function d(Y,F){return F instanceof Array?F.push(Y):F&&F.add(Y),Y}function p(Y,F,O=100,$=!1,j=!1,W,P){let Z,ee,I,Q=0,te,X={leakWarningThreshold:W,onWillAddFirstListener(){Z=Y(oe=>{Q++,ee=F(ee,oe),$&&!I&&(ce.fire(ee),ee=void 0),te=()=>{let ye=ee;ee=void 0,I=void 0,(!$||Q>1)&&ce.fire(ye),Q=0},typeof O=="number"?(clearTimeout(I),I=setTimeout(te,O)):I===void 0&&(I=0,queueMicrotask(te))})},onWillRemoveListener(){j&&Q>0&&(te==null||te())},onDidRemoveLastListener(){te=void 0,Z.dispose()}},ce=new _e(X);return P==null||P.add(ce),ce.event}e.debounce=p;function m(Y,F=0,O){return e.debounce(Y,($,j)=>$?($.push(j),$):[j],F,void 0,!0,void 0,O)}e.accumulate=m;function y(Y,F=($,j)=>$===j,O){let $=!0,j;return s(Y,W=>{let P=$||!F(W,j);return $=!1,j=W,P},O)}e.latch=y;function x(Y,F,O){return[e.filter(Y,F,O),e.filter(Y,$=>!F($),O)]}e.split=x;function v(Y,F=!1,O=[],$){let j=O.slice(),W=Y(ee=>{j?j.push(ee):Z.fire(ee)});$&&$.add(W);let P=()=>{j==null||j.forEach(ee=>Z.fire(ee)),j=null},Z=new _e({onWillAddFirstListener(){W||(W=Y(ee=>Z.fire(ee)),$&&$.add(W))},onDidAddFirstListener(){j&&(F?setTimeout(P):P())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return $&&$.add(Z),Z.event}e.buffer=v;function S(Y,F){return(O,$,j)=>{let W=F(new B);return Y(function(P){let Z=W.evaluate(P);Z!==C&&O.call($,Z)},void 0,j)}}e.chain=S;let C=Symbol("HaltChainable");class B{constructor(){this.steps=[]}map(F){return this.steps.push(F),this}forEach(F){return this.steps.push(O=>(F(O),O)),this}filter(F){return this.steps.push(O=>F(O)?O:C),this}reduce(F,O){let $=O;return this.steps.push(j=>($=F($,j),$)),this}latch(F=(O,$)=>O===$){let O=!0,$;return this.steps.push(j=>{let W=O||!F(j,$);return O=!1,$=j,W?j:C}),this}evaluate(F){for(let O of this.steps)if(F=O(F),F===C)break;return F}}function R(Y,F,O=$=>$){let $=(...Z)=>P.fire(O(...Z)),j=()=>Y.on(F,$),W=()=>Y.removeListener(F,$),P=new _e({onWillAddFirstListener:j,onDidRemoveLastListener:W});return P.event}e.fromNodeEventEmitter=R;function E(Y,F,O=$=>$){let $=(...Z)=>P.fire(O(...Z)),j=()=>Y.addEventListener(F,$),W=()=>Y.removeEventListener(F,$),P=new _e({onWillAddFirstListener:j,onDidRemoveLastListener:W});return P.event}e.fromDOMEventEmitter=E;function L(Y){return new Promise(F=>r(Y)(F))}e.toPromise=L;function k(Y){let F=new _e;return Y.then(O=>{F.fire(O)},()=>{F.fire(void 0)}).finally(()=>{F.dispose()}),F.event}e.fromPromise=k;function A(Y,F){return Y(O=>F.fire(O))}e.forward=A;function z(Y,F,O){return F(O),Y($=>F($))}e.runAndSubscribe=z;class U{constructor(F,O){this._observable=F,this._counter=0,this._hasChanged=!1;let $={onWillAddFirstListener:()=>{F.addObserver(this)},onDidRemoveLastListener:()=>{F.removeObserver(this)}};this.emitter=new _e($),O&&O.add(this.emitter)}beginUpdate(F){this._counter++}handlePossibleChange(F){}handleChange(F,O){this._hasChanged=!0}endUpdate(F){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function q(Y,F){return new U(Y,F).emitter.event}e.fromObservable=q;function H(Y){return(F,O,$)=>{let j=0,W=!1,P={beginUpdate(){j++},endUpdate(){j--,j===0&&(Y.reportChanges(),W&&(W=!1,F.call(O)))},handlePossibleChange(){},handleChange(){W=!0}};Y.addObserver(P),Y.reportChanges();let Z={dispose(){Y.removeObserver(P)}};return $ instanceof Fs?$.add(Z):Array.isArray($)&&$.push(Z),Z}}e.fromObservableLight=H})(Cr||(Cr={}));var Wm=class Hm{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Hm._idPool++}`,Hm.all.add(this)}start(t){this._stopWatch=new CH,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Wm.all=new Set,Wm._idPool=0;var kH=Wm,TH=-1,qE=class UE{constructor(t,r,i=(UE._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=i,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let i=this.threshold;if(i<=0||r<i)return;this._stacks||(this._stacks=new Map);let n=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,n+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let[s,a]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${a}):`;console.warn(l),console.warn(s);let u=new MH(l,s);this._errorHandler(u)}return()=>{let s=this._stacks.get(t.value)||0;this._stacks.set(t.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[i,n]of this._stacks)(!t||r<n)&&(t=[i,n],r=n);return t}};qE._idPool=1;var EH=qE,BH=class VE{constructor(t){this.value=t}static create(){let t=new Error;return new VE(t.stack??"")}print(){console.warn(this.value.split(`
|
|
458
|
+
`).slice(2).join(`
|
|
459
|
+
`))}},MH=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},LH=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},RH=0,Sg=class{constructor(e){this.value=e,this.id=RH++}},AH=2,DH,_e=class{constructor(t){var r,i,n,s;this._size=0,this._options=t,this._leakageMon=(r=this._options)!=null&&r.leakWarningThreshold?new EH((t==null?void 0:t.onListenerError)??$u,((i=this._options)==null?void 0:i.leakWarningThreshold)??TH):void 0,this._perfMon=(n=this._options)!=null&&n._profName?new kH(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var t,r,i,n;this._disposed||(this._disposed=!0,((t=this._deliveryQueue)==null?void 0:t.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(r=this._options)==null?void 0:r.onDidRemoveLastListener)==null||i.call(r),(n=this._leakageMon)==null||n.dispose())}get event(){return this._event??(this._event=(t,r,i)=>{var l,u,h,d,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let y=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],x=new LH(`${m}. HINT: Stack shows most frequent listener (${y[1]}-times)`,y[0]);return(((l=this._options)==null?void 0:l.onListenerError)||$u)(x),Qe.None}if(this._disposed)return Qe.None;r&&(t=t.bind(r));let n=new Sg(t),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=BH.create(),s=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof Sg?(this._deliveryQueue??(this._deliveryQueue=new PH),this._listeners=[this._listeners,n]):this._listeners.push(n):((h=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||h.call(u,this),this._listeners=n,(p=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||p.call(d,this)),this._size++;let a=At(()=>{s==null||s(),this._removeListener(n)});return i instanceof Fs?i.add(a):Array.isArray(i)&&i.push(a),a}),this._event}_removeListener(t){var s,a,l,u;if((a=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||a.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||u.call(l,this),this._size=0;return}let r=this._listeners,i=r.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[i]=void 0;let n=this._deliveryQueue.current===this;if(this._size*AH<=r.length){let h=0;for(let d=0;d<r.length;d++)r[d]?r[h++]=r[d]:n&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=h}}_deliver(t,r){var n;if(!t)return;let i=((n=this._options)==null?void 0:n.onListenerError)||$u;if(!i){t.value(r);return}try{t.value(r)}catch(s){i(s)}}_deliverQueue(t){let r=t.current._listeners;for(;t.i<t.end;)this._deliver(r[t.i++],t.value);t.reset()}fire(t){var r,i,n,s;if((r=this._deliveryQueue)!=null&&r.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)==null||i.stop()),(n=this._perfMon)==null||n.start(this._size),this._listeners)if(this._listeners instanceof Sg)this._deliver(this._listeners,t);else{let a=this._deliveryQueue;a.enqueue(this,t,this._listeners.length),this._deliverQueue(a)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},PH=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},qm=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new _e,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new _e,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let i=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(i,t),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let i=this.getWindowId(r);this.mapWindowIdToFullScreen.set(i,t),this._onDidChangeFullscreen.fire(i)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};qm.INSTANCE=new qm;var C0=qm;function IH(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}C0.INSTANCE.onDidChangeZoomLevel;function $H(e){return C0.INSTANCE.getZoomFactor(e)}C0.INSTANCE.onDidChangeFullscreen;var Xa=typeof navigator=="object"?navigator.userAgent:"",Um=Xa.indexOf("Firefox")>=0,jH=Xa.indexOf("AppleWebKit")>=0,k0=Xa.indexOf("Chrome")>=0,OH=!k0&&Xa.indexOf("Safari")>=0;Xa.indexOf("Electron/")>=0;Xa.indexOf("Android")>=0;var wg=!1;if(typeof Zn.matchMedia=="function"){let e=Zn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Zn.matchMedia("(display-mode: fullscreen)");wg=e.matches,IH(Zn,e,({matches:r})=>{wg&&t.matches||(wg=r)})}var Sa="en",Vm=!1,Gm=!1,ju=!1,GE=!1,fu,Ou=Sa,lb=Sa,zH,tn,Mo=globalThis,wr,tS;typeof Mo.vscode<"u"&&typeof Mo.vscode.process<"u"?wr=Mo.vscode.process:typeof process<"u"&&typeof((tS=process==null?void 0:process.versions)==null?void 0:tS.node)=="string"&&(wr=process);var rS,FH=typeof((rS=wr==null?void 0:wr.versions)==null?void 0:rS.electron)=="string",NH=FH&&(wr==null?void 0:wr.type)==="renderer",iS;if(typeof wr=="object"){Vm=wr.platform==="win32",Gm=wr.platform==="darwin",ju=wr.platform==="linux",ju&&wr.env.SNAP&&wr.env.SNAP_REVISION,wr.env.CI||wr.env.BUILD_ARTIFACTSTAGINGDIRECTORY,fu=Sa,Ou=Sa;let e=wr.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);fu=t.userLocale,lb=t.osLocale,Ou=t.resolvedLanguage||Sa,zH=(iS=t.languagePack)==null?void 0:iS.translationsConfigFile}catch{}GE=!0}else typeof navigator=="object"&&!NH?(tn=navigator.userAgent,Vm=tn.indexOf("Windows")>=0,Gm=tn.indexOf("Macintosh")>=0,(tn.indexOf("Macintosh")>=0||tn.indexOf("iPad")>=0||tn.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ju=tn.indexOf("Linux")>=0,(tn==null?void 0:tn.indexOf("Mobi"))>=0,Ou=globalThis._VSCODE_NLS_LANGUAGE||Sa,fu=navigator.language.toLowerCase(),lb=fu):console.error("Unable to resolve platform.");var YE=Vm,Mn=Gm,WH=ju,cb=GE,An=tn,Bs=Ou,HH;(e=>{function t(){return Bs}e.value=t;function r(){return Bs.length===2?Bs==="en":Bs.length>=3?Bs[0]==="e"&&Bs[1]==="n"&&Bs[2]==="-":!1}e.isDefaultVariant=r;function i(){return Bs==="en"}e.isDefault=i})(HH||(HH={}));var qH=typeof Mo.postMessage=="function"&&!Mo.importScripts;(()=>{if(qH){let e=[];Mo.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i<n;i++){let s=e[i];if(s.id===r.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return r=>{let i=++t;e.push({id:i,callback:r}),Mo.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var UH=!!(An&&An.indexOf("Chrome")>=0);An&&An.indexOf("Firefox")>=0;!UH&&An&&An.indexOf("Safari")>=0;An&&An.indexOf("Edg/")>=0;An&&An.indexOf("Android")>=0;var ya=typeof navigator=="object"?navigator:{};cb||document.queryCommandSupported&&document.queryCommandSupported("copy")||ya&&ya.clipboard&&ya.clipboard.writeText,cb||ya&&ya.clipboard&&ya.clipboard.readText;var T0=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Cg=new T0,hb=new T0,ub=new T0,VH=new Array(230),KE;(e=>{function t(l){return Cg.keyCodeToStr(l)}e.toString=t;function r(l){return Cg.strToKeyCode(l)}e.fromString=r;function i(l){return hb.keyCodeToStr(l)}e.toUserSettingsUS=i;function n(l){return ub.keyCodeToStr(l)}e.toUserSettingsGeneral=n;function s(l){return hb.strToKeyCode(l)||ub.strToKeyCode(l)}e.fromUserSettings=s;function a(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Cg.keyCodeToStr(l)}e.toElectronAccelerator=a})(KE||(KE={}));var GH=class XE{constructor(t,r,i,n,s){this.ctrlKey=t,this.shiftKey=r,this.altKey=i,this.metaKey=n,this.keyCode=s}equals(t){return t instanceof XE&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",i=this.altKey?"1":"0",n=this.metaKey?"1":"0";return`K${t}${r}${i}${n}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new YH([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},YH=class{constructor(e){if(e.length===0)throw xH("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t<r;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function KH(e){if(e.charCode){let r=String.fromCharCode(e.charCode).toUpperCase();return KE.fromString(r)}let t=e.keyCode;if(t===3)return 7;if(Um)switch(t){case 59:return 85;case 60:if(WH)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Mn)return 57;break}else if(jH&&(Mn&&t===93||!Mn&&t===92))return 57;return VH[t]||0}var XH=Mn?256:2048,QH=512,ZH=1024,JH=Mn?2048:256,db=class{constructor(e){var r;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(r=t.getModifierState)==null?void 0:r.call(t,"AltGraph"),this.keyCode=KH(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=XH),this.altKey&&(t|=QH),this.shiftKey&&(t|=ZH),this.metaKey&&(t|=JH),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new GH(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},fb=new WeakMap;function e9(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,r=e.parent.location;if(t.origin!=="null"&&r.origin!=="null"&&t.origin!==r.origin)return null}catch{return null}return e.parent}var t9=class{static getSameOriginWindowChain(e){let t=fb.get(e);if(!t){t=[],fb.set(e,t);let r=e,i;do i=e9(r),i?t.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):t.push({window:new WeakRef(r),iframeElement:null}),r=i;while(r)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let r=0,i=0,n=this.getSameOriginWindowChain(e);for(let s of n){let a=s.window.deref();if(r+=(a==null?void 0:a.scrollY)??0,i+=(a==null?void 0:a.scrollX)??0,a===t||!s.iframeElement)break;let l=s.iframeElement.getBoundingClientRect();r+=l.top,i+=l.left}return{top:r,left:i}}},pu=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let r=t9.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},pb=class{constructor(e,t=0,r=0){var n;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=t;let i=!1;if(k0){let s=navigator.userAgent.match(/Chrome\/(\d+)/);i=(s?parseInt(s[1]):123)<=122}if(e){let s=e,a=e,l=((n=e.view)==null?void 0:n.devicePixelRatio)||1;if(typeof s.wheelDeltaY<"u")i?this.deltaY=s.wheelDeltaY/(120*l):this.deltaY=s.wheelDeltaY/120;else if(typeof a.VERTICAL_AXIS<"u"&&a.axis===a.VERTICAL_AXIS)this.deltaY=-a.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?Um&&!Mn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")OH&&YE?this.deltaX=-(s.wheelDeltaX/120):i?this.deltaX=s.wheelDeltaX/(120*l):this.deltaX=s.wheelDeltaX/120;else if(typeof a.HORIZONTAL_AXIS<"u"&&a.axis===a.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?Um&&!Mn?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(i?this.deltaY=e.wheelDelta/(120*l):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},QE=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),r9;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof i9?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Cr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:QE})})(r9||(r9={}));var i9=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?QE:(this._emitter||(this._emitter=new _e),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},E0=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new zm("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new zm("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},n9=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new zm("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=r.setInterval(()=>{e()},t);this.disposable=At(()=>{r.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},s9;(e=>{async function t(i){let n,s=await Promise.all(i.map(a=>a.then(l=>l,l=>{n||(n=l)})));if(typeof n<"u")throw n;return s}e.settled=t;function r(i){return new Promise(async(n,s)=>{try{await i(n,s)}catch(a){s(a)}})}e.withAsyncBody=r})(s9||(s9={}));var gb=class zi{static fromArray(t){return new zi(r=>{r.emitMany(t)})}static fromPromise(t){return new zi(async r=>{r.emitMany(await t)})}static fromPromises(t){return new zi(async r=>{await Promise.all(t.map(async i=>r.emitOne(await i)))})}static merge(t){return new zi(async r=>{await Promise.all(t.map(async i=>{for await(let n of i)r.emitOne(n)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new _e,queueMicrotask(async()=>{let i={emitOne:n=>this.emitOne(n),emitMany:n=>this.emitMany(n),reject:n=>this.reject(n)};try{await Promise.resolve(t(i)),this.resolve()}catch(n){this.reject(n)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Cr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new zi(async i=>{for await(let n of t)i.emitOne(r(n))})}map(t){return zi.map(this,t)}static filter(t,r){return new zi(async i=>{for await(let n of t)r(n)&&i.emitOne(n)})}filter(t){return zi.filter(this,t)}static coalesce(t){return zi.filter(t,r=>!!r)}coalesce(){return zi.coalesce(this)}static async toPromise(t){let r=[];for await(let i of t)r.push(i);return r}toPromise(){return zi.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};gb.EMPTY=gb.fromArray([]);var{getWindow:En,getWindowId:o9,onDidRegisterWindow:a9}=(function(){let e=new Map,t={window:Zn,disposables:new Fs};e.set(Zn.vscodeWindowId,t);let r=new _e,i=new _e,n=new _e;function s(a,l){return(typeof a=="number"?e.get(a):void 0)??(l?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:i.event,registerWindow(a){if(e.has(a.vscodeWindowId))return Qe.None;let l=new Fs,u={window:a,disposables:l.add(new Fs)};return e.set(a.vscodeWindowId,u),l.add(At(()=>{e.delete(a.vscodeWindowId),i.fire(a)})),l.add(Ge(a,fr.BEFORE_UNLOAD,()=>{n.fire(a)})),r.fire(u),l},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return e.has(a)},getWindowById:s,getWindow(a){var h;let l=a;if((h=l==null?void 0:l.ownerDocument)!=null&&h.defaultView)return l.ownerDocument.defaultView.window;let u=a;return u!=null&&u.view?u.view.window:Zn},getDocument(a){return En(a).document}}})(),l9=class{constructor(e,t,r,i){this._node=e,this._type=t,this._handler=r,this._options=i||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ge(e,t,r,i){return new l9(e,t,r,i)}var mb=function(e,t,r,i){return Ge(e,t,r,i)},B0,c9=class extends n9{constructor(e){super(),this.defaultTarget=e&&En(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},yb=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){$u(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,i=new Map,n=s=>{r.set(s,!1);let a=e.get(s)??[];for(t.set(s,a),e.set(s,[]),i.set(s,!0);a.length>0;)a.sort(yb.sort),a.shift().execute();i.set(s,!1)};B0=(s,a,l=0)=>{let u=o9(s),h=new yb(a,l),d=e.get(u);return d||(d=[],e.set(u,d)),d.push(h),r.get(u)||(r.set(u,!0),s.requestAnimationFrame(()=>n(u))),h}})();function h9(e){let t=e.getBoundingClientRect(),r=En(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var fr={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},u9=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=li(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=li(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=li(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=li(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=li(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=li(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=li(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=li(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=li(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=li(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=li(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=li(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=li(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=li(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function li(e){return typeof e=="number"?`${e}px`:e}function _c(e){return new u9(e)}var ZE=class{constructor(){this._hooks=new Fs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,i,n){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=i,this._onStopCallback=n;let s=e;try{e.setPointerCapture(t),this._hooks.add(At(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=En(e)}this._hooks.add(Ge(s,fr.POINTER_MOVE,a=>{if(a.buttons!==r){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(Ge(s,fr.POINTER_UP,a=>this.stopMonitoring(!0)))}};function d9(e,t,r){let i=null,n=null;if(typeof r.value=="function"?(i="value",n=r.value,n.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(i="get",n=r.get),!n)throw new Error("not supported");let s=`$memoize$${t}`;r[i]=function(...a){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:n.apply(this,a)}),this[s]}}var kn;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(kn||(kn={}));var ac=class Ar extends Qe{constructor(){super(),this.dispatched=!1,this.targets=new ab,this.ignoreTargets=new ab,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Cr.runAndSubscribe(a9,({window:t,disposables:r})=>{r.add(Ge(t.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),r.add(Ge(t.document,"touchend",i=>this.onTouchEnd(t,i))),r.add(Ge(t.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:Zn,disposables:this._store}))}static addTarget(t){if(!Ar.isTouchDevice())return Qe.None;Ar.INSTANCE||(Ar.INSTANCE=new Ar);let r=Ar.INSTANCE.targets.push(t);return At(r)}static ignoreTarget(t){if(!Ar.isTouchDevice())return Qe.None;Ar.INSTANCE||(Ar.INSTANCE=new Ar);let r=Ar.INSTANCE.ignoreTargets.push(t);return At(r)}static isTouchDevice(){return"ontouchstart"in Zn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=t.targetTouches.length;i<n;i++){let s=t.targetTouches.item(i);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:r,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[r],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};let a=this.newGestureEvent(kn.Start,s.target);a.pageX=s.pageX,a.pageY=s.pageY,this.dispatchEvent(a)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,r){let i=Date.now(),n=Object.keys(this.activeTouches).length;for(let s=0,a=r.changedTouches.length;s<a;s++){let l=r.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("move of an UNKNOWN touch",l);continue}let u=this.activeTouches[l.identifier],h=Date.now()-u.initialTimeStamp;if(h<Ar.HOLD_DELAY&&Math.abs(u.initialPageX-vi(u.rollingPageX))<30&&Math.abs(u.initialPageY-vi(u.rollingPageY))<30){let d=this.newGestureEvent(kn.Tap,u.initialTarget);d.pageX=vi(u.rollingPageX),d.pageY=vi(u.rollingPageY),this.dispatchEvent(d)}else if(h>=Ar.HOLD_DELAY&&Math.abs(u.initialPageX-vi(u.rollingPageX))<30&&Math.abs(u.initialPageY-vi(u.rollingPageY))<30){let d=this.newGestureEvent(kn.Contextmenu,u.initialTarget);d.pageX=vi(u.rollingPageX),d.pageY=vi(u.rollingPageY),this.dispatchEvent(d)}else if(n===1){let d=vi(u.rollingPageX),p=vi(u.rollingPageY),m=vi(u.rollingTimestamps)-u.rollingTimestamps[0],y=d-u.rollingPageX[0],x=p-u.rollingPageY[0],v=[...this.targets].filter(S=>u.initialTarget instanceof Node&&S.contains(u.initialTarget));this.inertia(t,v,i,Math.abs(y)/m,y>0?1:-1,d,Math.abs(x)/m,x>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(kn.End,u.initialTarget)),delete this.activeTouches[l.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let i=document.createEvent("CustomEvent");return i.initEvent(t,!1,!0),i.initialTarget=r,i.tapCount=0,i}dispatchEvent(t){if(t.type===kn.Tap){let r=new Date().getTime(),i=0;r-this._lastSetTapCountTime>Ar.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=r,t.tapCount=i}else(t.type===kn.Change||t.type===kn.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let i of this.ignoreTargets)if(i.contains(t.initialTarget))return;let r=[];for(let i of this.targets)if(i.contains(t.initialTarget)){let n=0,s=t.initialTarget;for(;s&&s!==i;)n++,s=s.parentElement;r.push([n,i])}r.sort((i,n)=>i[0]-n[0]);for(let[i,n]of r)n.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,i,n,s,a,l,u,h){this.handle=B0(t,()=>{let d=Date.now(),p=d-i,m=0,y=0,x=!0;n+=Ar.SCROLL_FRICTION*p,l+=Ar.SCROLL_FRICTION*p,n>0&&(x=!1,m=s*n*p),l>0&&(x=!1,y=u*l*p);let v=this.newGestureEvent(kn.Change);v.translationX=m,v.translationY=y,r.forEach(S=>S.dispatchEvent(v)),x||this.inertia(t,r,d,n,s,a+m,l,u,h+y)})}onTouchMove(t){let r=Date.now();for(let i=0,n=t.changedTouches.length;i<n;i++){let s=t.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}let a=this.activeTouches[s.identifier],l=this.newGestureEvent(kn.Change,a.initialTarget);l.translationX=s.pageX-vi(a.rollingPageX),l.translationY=s.pageY-vi(a.rollingPageY),l.pageX=s.pageX,l.pageY=s.pageY,this.dispatchEvent(l),a.rollingPageX.length>3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(s.pageX),a.rollingPageY.push(s.pageY),a.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};ac.SCROLL_FRICTION=-.005,ac.HOLD_DELAY=700,ac.CLEAR_TAP_COUNT_TIME=400,Ft([d9],ac,"isTouchDevice",1);var f9=ac,M0=class extends Qe{onclick(e,t){this._register(Ge(e,fr.CLICK,r=>t(new pu(En(e),r))))}onmousedown(e,t){this._register(Ge(e,fr.MOUSE_DOWN,r=>t(new pu(En(e),r))))}onmouseover(e,t){this._register(Ge(e,fr.MOUSE_OVER,r=>t(new pu(En(e),r))))}onmouseleave(e,t){this._register(Ge(e,fr.MOUSE_LEAVE,r=>t(new pu(En(e),r))))}onkeydown(e,t){this._register(Ge(e,fr.KEY_DOWN,r=>t(new db(r))))}onkeyup(e,t){this._register(Ge(e,fr.KEY_UP,r=>t(new db(r))))}oninput(e,t){this._register(Ge(e,fr.INPUT,t))}onblur(e,t){this._register(Ge(e,fr.BLUR,t))}onfocus(e,t){this._register(Ge(e,fr.FOCUS,t))}onchange(e,t){this._register(Ge(e,fr.CHANGE,t))}ignoreGesture(e){return f9.ignoreTarget(e)}},_b=11,p9=class extends M0{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=_b+"px",this.domNode.style.height=_b+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new ZE),this._register(mb(this.bgDomNode,fr.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(mb(this.domNode,fr.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new c9),this._pointerdownScheduleRepeatTimer=this._register(new E0)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,En(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},g9=class Ym{constructor(t,r,i,n,s,a,l){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,i=i|0,n=n|0,s=s|0,a=a|0,l=l|0),this.rawScrollLeft=n,this.rawScrollTop=l,r<0&&(r=0),n+r>i&&(n=i-r),n<0&&(n=0),s<0&&(s=0),l+s>a&&(l=a-s),l<0&&(l=0),this.width=r,this.scrollWidth=i,this.scrollLeft=n,this.height=s,this.scrollHeight=a,this.scrollTop=l}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new Ym(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Ym(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let i=this.width!==t.width,n=this.scrollWidth!==t.scrollWidth,s=this.scrollLeft!==t.scrollLeft,a=this.height!==t.height,l=this.scrollHeight!==t.scrollHeight,u=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:s,heightChanged:a,scrollHeightChanged:l,scrollTopChanged:u}}},m9=class extends Qe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new g9(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(i=this._smoothScrolling)==null||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let i;t?i=new vb(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):i=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=i}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=vb.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},xb=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function kg(e,t){let r=t-e;return function(i){return e+r*x9(i)}}function y9(e,t,r){return function(i){return i<r?e(i/r):t((i-r)/(1-r))}}var vb=class Km{constructor(t,r,i,n){this.from=t,this.to=r,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,r,i){if(Math.abs(t-r)>2.5*i){let n,s;return t<r?(n=t+.75*i,s=r-.75*i):(n=t-.75*i,s=r+.75*i),y9(kg(t,n),kg(s,r),.33)}return kg(t,r)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let r=(t-this.startTime)/this.duration;if(r<1){let i=this.scrollLeft(r),n=this.scrollTop(r);return new xb(i,n,!1)}return new xb(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,r,i){return Km.start(t,r,i)}static start(t,r,i){i=i+10;let n=Date.now()-10;return new Km(t,r,n,i)}};function _9(e){return Math.pow(e,3)}function x9(e){return 1-_9(1-e)}var v9=class extends Qe{constructor(e,t,r){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new E0)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},b9=140,JE=class extends M0{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new v9(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new ZE),this._shouldRender=!0,this.domNode=_c(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Ge(this.domNode.domNode,fr.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new p9(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,i){this.slider=_c(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof i=="number"&&this.slider.setHeight(i),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ge(this.slider.domNode,fr.POINTER_DOWN,n=>{n.button===0&&(n.preventDefault(),this._sliderPointerDown(n))})),this.onclick(this.slider.domNode,n=>{n.leftButton&&n.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),i=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),n=this._sliderPointerPosition(e);r<=n&&n<=i?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let n=h9(this.domNode.domNode);t=e.pageX-n.left,r=e.pageY-n.top}let i=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(i):this._scrollbarState.getDesiredScrollPositionFromOffset(i)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),i=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{let s=this._sliderOrthogonalPointerPosition(n),a=Math.abs(s-r);if(YE&&a>b9){this._setDesiredScrollPositionNow(i.getScrollPosition());return}let l=this._sliderPointerPosition(n)-t;this._setDesiredScrollPositionNow(i.getDesiredScrollPositionFromDelta(l))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},eB=class Xm{constructor(t,r,i,n,s,a){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(t),this._visibleSize=n,this._scrollSize=s,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Xm(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,i,n,s){let a=Math.max(0,i-t),l=Math.max(0,a-2*r),u=n>0&&n>i;if(!u)return{computedAvailableSize:Math.round(a),computedIsNeeded:u,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(i*l/n))),d=(l-h)/(n-i),p=s*d;return{computedAvailableSize:Math.round(a),computedIsNeeded:u,computedSliderSize:Math.round(h),computedSliderRatio:d,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let t=Xm._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,i=this._scrollPosition;return r<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let r=this._computedSliderPosition+t;return Math.round(r/this._computedSliderRatio)}},S9=class extends JE{constructor(e,t,r){let i=e.getScrollDimensions(),n=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new eB(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,i.width,i.scrollWidth,n.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},w9=class extends JE{constructor(e,t,r){let i=e.getScrollDimensions(),n=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new eB(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,i.height,i.scrollHeight,n.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},C9=500,bb=50,k9=class{constructor(e,t,r){this.timestamp=e,this.deltaX=t,this.deltaY=r,this.score=0}},Qm=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,r=0,i=1,n=this._rear;do{let s=n===this._front?t:Math.pow(2,-i);if(t-=s,r+=this._memory[n].score*s,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}while(!0);return r<=.5}acceptStandardWheelEvent(t){if(k0){let r=En(t.browserEvent),i=$H(r);this.accept(Date.now(),t.deltaX*i,t.deltaY*i)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,r,i){let n=null,s=new k9(t,r,i);this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(n=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s),s.score=this._computeScore(s,n)}_computeScore(t,r){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(i+=.25),r){let n=Math.abs(t.deltaX),s=Math.abs(t.deltaY),a=Math.abs(r.deltaX),l=Math.abs(r.deltaY),u=Math.max(Math.min(n,a),1),h=Math.max(Math.min(s,l),1),d=Math.max(n,a),p=Math.max(s,l);d%u===0&&p%h===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Qm.INSTANCE=new Qm;var T9=Qm,E9=class extends M0{constructor(e,t,r){super(),this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new _e),this.onWillScroll=this._onWillScroll.event,this._options=M9(t),this._scrollable=r,this._register(this._scrollable.onScroll(n=>{this._onWillScroll.fire(n),this._onDidScroll(n),this._onScroll.fire(n)}));let i={onMouseWheel:n=>this._onMouseWheel(n),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new w9(this._scrollable,this._options,i)),this._horizontalScrollbar=this._register(new S9(this._scrollable,this._options,i)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=_c(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=_c(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=_c(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,n=>this._onMouseOver(n)),this.onmouseleave(this._listenOnDomNode,n=>this._onMouseLeave(n)),this._hideTimeout=this._register(new E0),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Oo(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Mn&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new pb(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Oo(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new pb(r))};this._mouseWheelToDispose.push(Ge(this._listenOnDomNode,fr.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var n;if((n=e.browserEvent)!=null&&n.defaultPrevented)return;let t=T9.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);let l=!Mn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);let u=this._scrollable.getFutureScrollPosition(),h={};if(s){let d=bb*s,p=u.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(h,p)}if(a){let d=bb*a,p=u.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(h,p)}h=this._scrollable.validateScrollPosition(h),(u.scrollLeft!==h.scrollLeft||u.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),r=!0)}let i=r;!i&&this._options.alwaysConsumeMouseWheel&&(i=!0),!i&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(i=!0),i&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,i=r?" left":"",n=t?" top":"",s=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${i}`),this._topShadowDomNode.setClassName(`shadow${n}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${n}${i}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),C9)}},B9=class extends E9{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function M9(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Mn&&(t.className+=" mac"),t}var Zm=class extends Qe{constructor(e,t,r,i,n,s,a,l){super(),this._bufferService=r,this._optionsService=a,this._renderService=l,this._onRequestScrollLines=this._register(new _e),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let u=this._register(new m9({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>B0(i.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{u.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new B9(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},u)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(n.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Cr.runAndSubscribe(s.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=s.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(At(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=i.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(At(()=>this._styleElement.remove())),this._register(Cr.runAndSubscribe(s.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${s.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${s.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${s.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
460
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};Zm=Ft([be(2,Qr),be(3,ns),be(4,PE),be(5,Ka),be(6,Zr),be(7,ss)],Zm);var Jm=class extends Qe{constructor(e,t,r,i,n){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=i,this._renderService=n,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(s=>this._removeDecoration(s))),this._register(At(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var i;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((i=e==null?void 0:e.options)==null?void 0:i.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Jm=Ft([be(1,Qr),be(2,ns),be(3,Vc),be(4,ss)],Jm);var L9=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},vn={full:0,left:0,center:0,right:0},Ms={full:0,left:0,center:0,right:0},Ul={full:0,left:0,center:0,right:0},Ed=class extends Qe{constructor(e,t,r,i,n,s,a,l){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=i,this._renderService=n,this._optionsService=s,this._themeService=a,this._coreBrowserService=l,this._colorZoneStore=new L9,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(h=this._viewportElement.parentElement)==null||h.insertBefore(this._canvas,this._viewportElement),this._register(At(()=>{var d;return(d=this._canvas)==null?void 0:d.remove()}));let u=this._canvas.getContext("2d");if(u)this._ctx=u;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Ms.full=this._canvas.width,Ms.left=e,Ms.center=t,Ms.right=e,this._refreshDrawHeightConstants(),Ul.full=1,Ul.left=1,Ul.center=1+Ms.left,Ul.right=1+Ms.left+Ms.center}_refreshDrawHeightConstants(){vn.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);vn.left=t,vn.center=t,vn.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*vn.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*vn.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*vn.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*vn.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Ul[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-vn[e.position||"full"]/2),Ms[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+vn[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Ed=Ft([be(2,Qr),be(3,Vc),be(4,ss),be(5,Zr),be(6,Ka),be(7,ns)],Ed);var le;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
461
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(le||(le={}));var zu;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(zu||(zu={}));var tB;(e=>e.ST=`${le.ESC}\\`)(tB||(tB={}));var ey=class{constructor(e,t,r,i,n,s){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=i,this._coreService=n,this._renderService=s,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.length<e.length?this._coreService.triggerDataEvent(`${le.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let s=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};ey=Ft([be(2,Qr),be(3,Zr),be(4,Uo),be(5,ss)],ey);var pr=0,gr=0,mr=0,zt=0,Sb={css:"#00000000",rgba:0},Zt;(e=>{function t(n,s,a,l){return l!==void 0?`#${mo(n)}${mo(s)}${mo(a)}${mo(l)}`:`#${mo(n)}${mo(s)}${mo(a)}`}e.toCss=t;function r(n,s,a,l=255){return(n<<24|s<<16|a<<8|l)>>>0}e.toRgba=r;function i(n,s,a,l){return{css:e.toCss(n,s,a,l),rgba:e.toRgba(n,s,a,l)}}e.toColor=i})(Zt||(Zt={}));var Tt;(e=>{function t(u,h){if(zt=(h.rgba&255)/255,zt===1)return{css:h.css,rgba:h.rgba};let d=h.rgba>>24&255,p=h.rgba>>16&255,m=h.rgba>>8&255,y=u.rgba>>24&255,x=u.rgba>>16&255,v=u.rgba>>8&255;pr=y+Math.round((d-y)*zt),gr=x+Math.round((p-x)*zt),mr=v+Math.round((m-v)*zt);let S=Zt.toCss(pr,gr,mr),C=Zt.toRgba(pr,gr,mr);return{css:S,rgba:C}}e.blend=t;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function i(u,h,d){let p=Fu.ensureContrastRatio(u.rgba,h.rgba,d);if(p)return Zt.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=i;function n(u){let h=(u.rgba|255)>>>0;return[pr,gr,mr]=Fu.toChannels(h),{css:Zt.toCss(pr,gr,mr),rgba:h}}e.opaque=n;function s(u,h){return zt=Math.round(h*255),[pr,gr,mr]=Fu.toChannels(u.rgba),{css:Zt.toCss(pr,gr,mr,zt),rgba:Zt.toRgba(pr,gr,mr,zt)}}e.opacity=s;function a(u,h){return zt=u.rgba&255,s(u,zt*h/255)}e.multiplyOpacity=a;function l(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=l})(Tt||(Tt={}));var $t;(e=>{let t,r;try{let n=document.createElement("canvas");n.width=1,n.height=1;let s=n.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function i(n){if(n.match(/#[\da-f]{3,8}/i))switch(n.length){case 4:return pr=parseInt(n.slice(1,2).repeat(2),16),gr=parseInt(n.slice(2,3).repeat(2),16),mr=parseInt(n.slice(3,4).repeat(2),16),Zt.toColor(pr,gr,mr);case 5:return pr=parseInt(n.slice(1,2).repeat(2),16),gr=parseInt(n.slice(2,3).repeat(2),16),mr=parseInt(n.slice(3,4).repeat(2),16),zt=parseInt(n.slice(4,5).repeat(2),16),Zt.toColor(pr,gr,mr,zt);case 7:return{css:n,rgba:(parseInt(n.slice(1),16)<<8|255)>>>0};case 9:return{css:n,rgba:parseInt(n.slice(1),16)>>>0}}let s=n.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return pr=parseInt(s[1]),gr=parseInt(s[2]),mr=parseInt(s[3]),zt=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),Zt.toColor(pr,gr,mr,zt);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=n,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[pr,gr,mr,zt]=t.getImageData(0,0,1,1).data,zt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Zt.toRgba(pr,gr,mr,zt),css:n}}e.toColor=i})($t||($t={}));var Ur;(e=>{function t(i){return r(i>>16&255,i>>8&255,i&255)}e.relativeLuminance=t;function r(i,n,s){let a=i/255,l=n/255,u=s/255,h=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return h*.2126+d*.7152+p*.0722}e.relativeLuminance2=r})(Ur||(Ur={}));var Fu;(e=>{function t(a,l){if(zt=(l&255)/255,zt===1)return l;let u=l>>24&255,h=l>>16&255,d=l>>8&255,p=a>>24&255,m=a>>16&255,y=a>>8&255;return pr=p+Math.round((u-p)*zt),gr=m+Math.round((h-m)*zt),mr=y+Math.round((d-y)*zt),Zt.toRgba(pr,gr,mr)}e.blend=t;function r(a,l,u){let h=Ur.relativeLuminance(a>>8),d=Ur.relativeLuminance(l>>8);if(Kn(h,d)<u){if(d<h){let y=i(a,l,u),x=Kn(h,Ur.relativeLuminance(y>>8));if(x<u){let v=n(a,l,u),S=Kn(h,Ur.relativeLuminance(v>>8));return x>S?y:v}return y}let p=n(a,l,u),m=Kn(h,Ur.relativeLuminance(p>>8));if(m<u){let y=i(a,l,u),x=Kn(h,Ur.relativeLuminance(y>>8));return m>x?p:y}return p}}e.ensureContrastRatio=r;function i(a,l,u){let h=a>>24&255,d=a>>16&255,p=a>>8&255,m=l>>24&255,y=l>>16&255,x=l>>8&255,v=Kn(Ur.relativeLuminance2(m,y,x),Ur.relativeLuminance2(h,d,p));for(;v<u&&(m>0||y>0||x>0);)m-=Math.max(0,Math.ceil(m*.1)),y-=Math.max(0,Math.ceil(y*.1)),x-=Math.max(0,Math.ceil(x*.1)),v=Kn(Ur.relativeLuminance2(m,y,x),Ur.relativeLuminance2(h,d,p));return(m<<24|y<<16|x<<8|255)>>>0}e.reduceLuminance=i;function n(a,l,u){let h=a>>24&255,d=a>>16&255,p=a>>8&255,m=l>>24&255,y=l>>16&255,x=l>>8&255,v=Kn(Ur.relativeLuminance2(m,y,x),Ur.relativeLuminance2(h,d,p));for(;v<u&&(m<255||y<255||x<255);)m=Math.min(255,m+Math.ceil((255-m)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),v=Kn(Ur.relativeLuminance2(m,y,x),Ur.relativeLuminance2(h,d,p));return(m<<24|y<<16|x<<8|255)>>>0}e.increaseLuminance=n;function s(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=s})(Fu||(Fu={}));function mo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Kn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var R9=class extends Uc{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Bd=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Ni}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let r=[],i=t.translateToString(!0),n=0,s=0,a=0,l=t.getFg(0),u=t.getBg(0);for(let h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==l||this._workCell.bg!==u){if(h-n>1){let d=this._getJoinedRanges(i,a,s,t,n);for(let p=0;p<d.length;p++)r.push(d[p])}n=h,a=s,l=this._workCell.fg,u=this._workCell.bg}s+=this._workCell.getChars().length||Os.length}if(this._bufferService.cols-n>1){let h=this._getJoinedRanges(i,a,s,t,n);for(let d=0;d<h.length;d++)r.push(h[d])}return r}_getJoinedRanges(e,t,r,i,n){let s=e.substring(t,r),a=[];try{a=this._characterJoiners[0].handler(s)}catch(l){console.error(l)}for(let l=1;l<this._characterJoiners.length;l++)try{let u=this._characterJoiners[l].handler(s);for(let h=0;h<u.length;h++)Bd._mergeRanges(a,u[h])}catch(u){console.error(u)}return this._stringRangesToCellRanges(a,i,n),a}_stringRangesToCellRanges(e,t,r){let i=0,n=!1,s=0,a=e[i];if(a){for(let l=r;l<this._bufferService.cols;l++){let u=t.getWidth(l),h=t.getString(l).length||Os.length;if(u!==0){if(!n&&a[0]<=s&&(a[0]=l,n=!0),a[1]<=s){if(a[1]=l,a=e[++i],!a)break;a[0]<=s?(a[0]=l,n=!0):n=!1}s+=h}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let r=!1;for(let i=0;i<e.length;i++){let n=e[i];if(r){if(t[1]<=n[0])return e[i-1][1]=t[1],e;if(t[1]<=n[1])return e[i-1][1]=Math.max(t[1],n[1]),e.splice(i,1),e;e.splice(i,1),i--}else{if(t[1]<=n[0])return e.splice(i,0,t),e;if(t[1]<=n[1])return n[0]=Math.min(t[0],n[0]),e;t[0]<n[1]&&(n[0]=Math.min(t[0],n[0]),r=!0);continue}}return r?e[e.length-1][1]=t[1]:e.push(t),e}};Bd=Ft([be(0,Qr)],Bd);function A9(e){return 57508<=e&&e<=57558}function D9(e){return 9472<=e&&e<=9631}function P9(e){return A9(e)||D9(e)}function I9(){return{css:{canvas:gu(),cell:gu()},device:{canvas:gu(),cell:gu(),char:{width:0,height:0,left:0,top:0}}}}function gu(){return{width:0,height:0}}var ty=class{constructor(e,t,r,i,n,s,a){this._document=e,this._characterJoinerService=t,this._optionsService=r,this._coreBrowserService=i,this._coreService=n,this._decorationService=s,this._themeService=a,this._workCell=new Ni,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,r){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=r}createRow(e,t,r,i,n,s,a,l,u,h,d){let p=[],m=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,x=e.getNoBgTrimmedLength();r&&x<s+1&&(x=s+1);let v,S=0,C="",B=0,R=0,E=0,L=0,k=!1,A=0,z=!1,U=0,q=0,H=[],Y=h!==-1&&d!==-1;for(let F=0;F<x;F++){e.loadCell(F,this._workCell);let O=this._workCell.getWidth();if(O===0)continue;let $=!1,j=F>=q,W=F,P=this._workCell;if(m.length>0&&F===m[0][0]&&j){let ze=m.shift(),pt=this._isCellInSelection(ze[0],t);for(B=ze[0]+1;B<ze[1];B++)j&&(j=pt===this._isCellInSelection(B,t));j&&(j=!r||s<ze[0]||s>=ze[1]),j?($=!0,P=new R9(this._workCell,e.translateToString(!0,ze[0],ze[1]),ze[1]-ze[0]),W=ze[1]-1,O=P.getWidth()):q=ze[1]}let Z=this._isCellInSelection(F,t),ee=r&&F===s,I=Y&&F>=h&&F<=d,Q=!1;this._decorationService.forEachDecorationAtCell(F,t,void 0,ze=>{Q=!0});let te=P.getChars()||Os;if(te===" "&&(P.isUnderline()||P.isOverline())&&(te=" "),U=O*l-u.get(te,P.isBold(),P.isItalic()),!v)v=this._document.createElement("span");else if(S&&(Z&&z||!Z&&!z&&P.bg===R)&&(Z&&z&&y.selectionForeground||P.fg===E)&&P.extended.ext===L&&I===k&&U===A&&!ee&&!$&&!Q&&j){P.isInvisible()?C+=Os:C+=te,S++;continue}else S&&(v.textContent=C),v=this._document.createElement("span"),S=0,C="";if(R=P.bg,E=P.fg,L=P.extended.ext,k=I,A=U,z=Z,$&&s>=F&&s<=W&&(s=F),!this._coreService.isCursorHidden&&ee&&this._coreService.isCursorInitialized){if(H.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&H.push("xterm-cursor-blink"),H.push(i==="bar"?"xterm-cursor-bar":i==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(n)switch(n){case"outline":H.push("xterm-cursor-outline");break;case"block":H.push("xterm-cursor-block");break;case"bar":H.push("xterm-cursor-bar");break;case"underline":H.push("xterm-cursor-underline");break}}if(P.isBold()&&H.push("xterm-bold"),P.isItalic()&&H.push("xterm-italic"),P.isDim()&&H.push("xterm-dim"),P.isInvisible()?C=Os:C=P.getChars()||Os,P.isUnderline()&&(H.push(`xterm-underline-${P.extended.underlineStyle}`),C===" "&&(C=" "),!P.isUnderlineColorDefault()))if(P.isUnderlineColorRGB())v.style.textDecorationColor=`rgb(${Uc.toColorRGB(P.getUnderlineColor()).join(",")})`;else{let ze=P.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&P.isBold()&&ze<8&&(ze+=8),v.style.textDecorationColor=y.ansi[ze].css}P.isOverline()&&(H.push("xterm-overline"),C===" "&&(C=" ")),P.isStrikethrough()&&H.push("xterm-strikethrough"),I&&(v.style.textDecoration="underline");let X=P.getFgColor(),ce=P.getFgColorMode(),oe=P.getBgColor(),ye=P.getBgColorMode(),ve=!!P.isInverse();if(ve){let ze=X;X=oe,oe=ze;let pt=ce;ce=ye,ye=pt}let Ce,Ee,Ke=!1;this._decorationService.forEachDecorationAtCell(F,t,void 0,ze=>{ze.options.layer!=="top"&&Ke||(ze.backgroundColorRGB&&(ye=50331648,oe=ze.backgroundColorRGB.rgba>>8&16777215,Ce=ze.backgroundColorRGB),ze.foregroundColorRGB&&(ce=50331648,X=ze.foregroundColorRGB.rgba>>8&16777215,Ee=ze.foregroundColorRGB),Ke=ze.options.layer==="top")}),!Ke&&Z&&(Ce=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,oe=Ce.rgba>>8&16777215,ye=50331648,Ke=!0,y.selectionForeground&&(ce=50331648,X=y.selectionForeground.rgba>>8&16777215,Ee=y.selectionForeground)),Ke&&H.push("xterm-decoration-top");let ct;switch(ye){case 16777216:case 33554432:ct=y.ansi[oe],H.push(`xterm-bg-${oe}`);break;case 50331648:ct=Zt.toColor(oe>>16,oe>>8&255,oe&255),this._addStyle(v,`background-color:#${wb((oe>>>0).toString(16),"0",6)}`);break;case 0:default:ve?(ct=y.foreground,H.push("xterm-bg-257")):ct=y.background}switch(Ce||P.isDim()&&(Ce=Tt.multiplyOpacity(ct,.5)),ce){case 16777216:case 33554432:P.isBold()&&X<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(X+=8),this._applyMinimumContrast(v,ct,y.ansi[X],P,Ce,void 0)||H.push(`xterm-fg-${X}`);break;case 50331648:let ze=Zt.toColor(X>>16&255,X>>8&255,X&255);this._applyMinimumContrast(v,ct,ze,P,Ce,Ee)||this._addStyle(v,`color:#${wb(X.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(v,ct,y.foreground,P,Ce,Ee)||ve&&H.push("xterm-fg-257")}H.length&&(v.className=H.join(" "),H.length=0),!ee&&!$&&!Q&&j?S++:v.textContent=C,U!==this.defaultSpacing&&(v.style.letterSpacing=`${U}px`),p.push(v),F=W}return v&&S&&(v.textContent=C),p}_applyMinimumContrast(e,t,r,i,n,s){if(this._optionsService.rawOptions.minimumContrastRatio===1||P9(i.getCode()))return!1;let a=this._getContrastCache(i),l;if(!n&&!s&&(l=a.getColor(t.rgba,r.rgba)),l===void 0){let u=this._optionsService.rawOptions.minimumContrastRatio/(i.isDim()?2:1);l=Tt.ensureContrastRatio(n||t,s||r,u),a.setColor((n||t).rgba,(s||r).rgba,l??null)}return l?(this._addStyle(e,`color:${l.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,i=this._selectionEnd;return!r||!i?!1:this._columnSelectMode?r[0]<=i[0]?e>=r[0]&&t>=r[1]&&e<i[0]&&t<=i[1]:e<r[0]&&t>=r[1]&&e>=i[0]&&t<=i[1]:t>r[1]&&t<i[1]||r[1]===i[1]&&t===r[1]&&e>=r[0]&&e<i[0]||r[1]<i[1]&&t===i[1]&&e<i[0]||r[1]<i[1]&&t===r[1]&&e>=r[0]}};ty=Ft([be(1,jE),be(2,Zr),be(3,ns),be(4,Uo),be(5,Vc),be(6,Ka)],ty);function wb(e,t,r){for(;e.length<r;)e=t+e;return e}var $9=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let r=e.createElement("span");r.classList.add("xterm-char-measure-element");let i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontWeight="bold";let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontStyle="italic";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold",s.style.fontStyle="italic",this._measureElements=[r,i,n,s],this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(n),this._container.appendChild(s),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,r,i){e===this._font&&t===this._fontSize&&r===this._weight&&i===this._weightBold||(this._font=e,this._fontSize=t,this._weight=r,this._weightBold=i,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${i}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${i}`,this.clear())}get(e,t,r){let i=0;if(!t&&!r&&e.length===1&&(i=e.charCodeAt(0))<256){if(this._flat[i]!==-9999)return this._flat[i];let a=this._measure(e,0);return a>0&&(this._flat[i]=a),a}let n=e;t&&(n+="B"),r&&(n+="I");let s=this._holey.get(n);if(s===void 0){let a=0;t&&(a|=1),r&&(a|=2),s=this._measure(e,a),s>0&&this._holey.set(n,s)}return s}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},j9=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,r,i=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let n=e.buffers.active.ydisp,s=t[1]-n,a=r[1]-n,l=Math.max(s,0),u=Math.min(a,e.rows-1);if(l>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=i,this.viewportStartRow=s,this.viewportEndRow=a,this.viewportCappedStartRow=l,this.viewportCappedEndRow=u,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t<this.endCol&&r<=this.viewportCappedEndRow:t<this.startCol&&r>=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol):!1}};function O9(){return new j9}var Tg="xterm-dom-renderer-owner-",Oi="xterm-rows",mu="xterm-fg-",Cb="xterm-bg-",Vl="xterm-focus",yu="xterm-selection",z9=1,ry=class extends Qe{constructor(e,t,r,i,n,s,a,l,u,h,d,p,m,y){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=i,this._viewportElement=n,this._helperContainer=s,this._linkifier2=a,this._charSizeService=u,this._optionsService=h,this._bufferService=d,this._coreService=p,this._coreBrowserService=m,this._themeService=y,this._terminalClass=z9++,this._rowElements=[],this._selectionRenderModel=O9(),this.onRequestRedraw=this._register(new _e).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Oi),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(yu),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=I9(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(x=>this._injectCss(x))),this._injectCss(this._themeService.colors),this._rowFactory=l.createInstance(ty,document),this._element.classList.add(Tg+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(x=>this._handleLinkHover(x))),this._register(this._linkifier2.onHideLinkUnderline(x=>this._handleLinkLeave(x))),this._register(At(()=>{this._element.classList.remove(Tg+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new $9(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Oi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Oi} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Oi} .xterm-dim { color: ${Tt.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let r=`blink_underline_${this._terminalClass}`,i=`blink_bar_${this._terminalClass}`,n=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${i} { 50% { box-shadow: none; }}`,t+=`@keyframes ${n} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Oi}.${Vl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Oi}.${Vl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Oi}.${Vl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Oi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Oi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Oi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Oi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Oi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${yu} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${yu} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${yu} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[s,a]of e.ansi.entries())t+=`${this._terminalSelector} .${mu}${s} { color: ${a.css}; }${this._terminalSelector} .${mu}${s}.xterm-dim { color: ${Tt.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${Cb}${s} { background-color: ${a.css}; }`;t+=`${this._terminalSelector} .${mu}257 { color: ${Tt.opaque(e.background).css}; }${this._terminalSelector} .${mu}257.xterm-dim { color: ${Tt.multiplyOpacity(Tt.opaque(e.background),.5).css}; }${this._terminalSelector} .${Cb}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let r=this._rowElements.length;r<=t;r++){let i=this._document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Vl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Vl),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let i=this._selectionRenderModel.viewportStartRow,n=this._selectionRenderModel.viewportEndRow,s=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,l=this._document.createDocumentFragment();if(r){let u=e[0]>t[0];l.appendChild(this._createSelectionElement(s,u?t[0]:e[0],u?e[0]:t[0],a-s+1))}else{let u=i===s?e[0]:0,h=s===n?t[0]:this._bufferService.cols;l.appendChild(this._createSelectionElement(s,u,h));let d=a-s-1;if(l.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,d)),s!==a){let p=n===a?t[0]:this._bufferService.cols;l.appendChild(this._createSelectionElement(a,0,p))}}this._selectionContainer.appendChild(l)}_createSelectionElement(e,t,r,i=1){let n=this._document.createElement("div"),s=t*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(r-t);return s+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-s),n.style.height=`${i*this.dimensions.css.cell.height}px`,n.style.top=`${e*this.dimensions.css.cell.height}px`,n.style.left=`${s}px`,n.style.width=`${a}px`,n}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let r=this._bufferService.buffer,i=r.ybase+r.y,n=Math.min(r.x,this._bufferService.cols-1),s=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,l=this._optionsService.rawOptions.cursorInactiveStyle;for(let u=e;u<=t;u++){let h=u+r.ydisp,d=this._rowElements[u],p=r.lines.get(h);if(!d||!p)break;d.replaceChildren(...this._rowFactory.createRow(p,h,h===i,a,l,n,s,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Tg}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,r,i,n,s){r<0&&(e=0),i<0&&(t=0);let a=this._bufferService.rows-1;r=Math.max(Math.min(r,a),0),i=Math.max(Math.min(i,a),0),n=Math.min(n,this._bufferService.cols);let l=this._bufferService.buffer,u=l.ybase+l.y,h=Math.min(l.x,n-1),d=this._optionsService.rawOptions.cursorBlink,p=this._optionsService.rawOptions.cursorStyle,m=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=r;y<=i;++y){let x=y+l.ydisp,v=this._rowElements[y],S=l.lines.get(x);if(!v||!S)break;v.replaceChildren(...this._rowFactory.createRow(S,x,x===u,p,m,h,d,this.dimensions.css.cell.width,this._widthCache,s?y===r?e:0:-1,s?(y===i?t:n)-1:-1))}}};ry=Ft([be(7,S0),be(8,lf),be(9,Zr),be(10,Qr),be(11,Uo),be(12,ns),be(13,Ka)],ry);var iy=class extends Qe{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new _e),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new N9(this._optionsService))}catch{this._measureStrategy=this._register(new F9(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};iy=Ft([be(2,Zr)],iy);var rB=class extends Qe{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},F9=class extends rB{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},N9=class extends rB{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},W9=class extends Qe{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new H9(this._window)),this._onDprChange=this._register(new _e),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new _e),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this._register(Cr.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ge(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ge(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},H9=class extends Qe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Wa),this._onDprChange=this._register(new _e),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(At(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ge(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},q9=class extends Qe{constructor(){super(),this.linkProviders=[],this._register(At(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function L0(e,t,r){let i=r.getBoundingClientRect(),n=e.getComputedStyle(r),s=parseInt(n.getPropertyValue("padding-left")),a=parseInt(n.getPropertyValue("padding-top"));return[t.clientX-i.left-s,t.clientY-i.top-a]}function U9(e,t,r,i,n,s,a,l,u){if(!s)return;let h=L0(e,t,r);if(h)return h[0]=Math.ceil((h[0]+(u?a/2:0))/a),h[1]=Math.ceil(h[1]/l),h[0]=Math.min(Math.max(h[0],1),i+(u?1:0)),h[1]=Math.min(Math.max(h[1],1),n),h}var ny=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,i,n){return U9(window,e,t,r,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,n)}getMouseReportCoords(e,t){let r=L0(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};ny=Ft([be(0,ss),be(1,lf)],ny);var V9=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},iB={};rH(iB,{getSafariVersion:()=>Y9,isChromeOS:()=>aB,isFirefox:()=>nB,isIpad:()=>K9,isIphone:()=>X9,isLegacyEdge:()=>G9,isLinux:()=>R0,isMac:()=>Md,isNode:()=>cf,isSafari:()=>sB,isWindows:()=>oB});var cf=typeof process<"u"&&"title"in process,Gc=cf?"node":navigator.userAgent,Yc=cf?"node":navigator.platform,nB=Gc.includes("Firefox"),G9=Gc.includes("Edge"),sB=/^((?!chrome|android).)*safari/i.test(Gc);function Y9(){if(!sB)return 0;let e=Gc.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Md=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Yc),K9=Yc==="iPad",X9=Yc==="iPhone",oB=["Windows","Win16","Win32","WinCE"].includes(Yc),R0=Yc.indexOf("Linux")>=0,aB=/\bCrOS\b/.test(Gc),lB=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,r=0,i=e.timeRemaining(),n=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),r=Math.max(t,r),n=e.timeRemaining(),r*1.5>n){i-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-t))}ms`),this._start();return}i=n}this.clear()}},Q9=class extends lB{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},Z9=class extends lB{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Ld=!cf&&"requestIdleCallback"in window?Z9:Q9,J9=class{constructor(){this._queue=new Ld}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},sy=class extends Qe{constructor(e,t,r,i,n,s,a,l,u){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=i,this._coreService=n,this._coreBrowserService=l,this._renderer=this._register(new Wa),this._pausedResizeTask=new J9,this._observerDisposable=this._register(new Wa),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new _e),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new _e),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new _e),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new _e),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new V9((h,d)=>this._renderRows(h,d),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new e7(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(At(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>{var h;return(h=this._renderer.value)==null?void 0:h.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(s.onDecorationRegistered(()=>this._fullRefresh())),this._register(s.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(u.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(i=>this._handleIntersectionChange(i[i.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=At(()=>r.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let i=this._syncOutputHandler.flush();i&&(e=Math.min(e,i.start),t=Math.max(t,i.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var r;return(r=this._renderer.value)==null?void 0:r.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,r){var i;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(i=this._renderer.value)==null||i.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};sy=Ft([be(2,Zr),be(3,lf),be(4,Uo),be(5,Vc),be(6,Qr),be(7,ns),be(8,Ka)],sy);var e7=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function t7(e,t,r,i){let n=r.buffer.x,s=r.buffer.y;if(!r.buffer.hasScrollback)return n7(n,s,e,t,r,i)+hf(s,t,r,i)+s7(n,s,e,t,r,i);let a;if(s===t)return a=n>e?"D":"C",Dc(Math.abs(n-e),Ac(a,i));a=s>t?"D":"C";let l=Math.abs(s-t),u=i7(s>t?e:n,r)+(l-1)*r.cols+1+r7(s>t?n:e);return Dc(u,Ac(a,i))}function r7(e,t){return e-1}function i7(e,t){return t.cols-e}function n7(e,t,r,i,n,s){return hf(t,i,n,s).length===0?"":Dc(hB(e,t,e,t-zo(t,n),!1,n).length,Ac("D",s))}function hf(e,t,r,i){let n=e-zo(e,r),s=t-zo(t,r),a=Math.abs(n-s)-o7(e,t,r);return Dc(a,Ac(cB(e,t),i))}function s7(e,t,r,i,n,s){let a;hf(t,i,n,s).length>0?a=i-zo(i,n):a=t;let l=i,u=a7(e,t,r,i,n,s);return Dc(hB(e,a,r,l,u==="C",n).length,Ac(u,s))}function o7(e,t,r){var a;let i=0,n=e-zo(e,r),s=t-zo(t,r);for(let l=0;l<Math.abs(n-s);l++){let u=cB(e,t)==="A"?-1:1;(a=r.buffer.lines.get(n+u*l))!=null&&a.isWrapped&&i++}return i}function zo(e,t){let r=0,i=t.buffer.lines.get(e),n=i==null?void 0:i.isWrapped;for(;n&&e>=0&&e<t.rows;)r++,i=t.buffer.lines.get(--e),n=i==null?void 0:i.isWrapped;return r}function a7(e,t,r,i,n,s){let a;return hf(r,i,n,s).length>0?a=i-zo(i,n):a=t,e<r&&a<=i||e>=r&&a<i?"C":"D"}function cB(e,t){return e>t?"A":"B"}function hB(e,t,r,i,n,s){let a=e,l=t,u="";for(;(a!==r||l!==i)&&l>=0&&l<s.buffer.lines.length;)a+=n?1:-1,n&&a>s.cols-1?(u+=s.buffer.translateBufferLineToString(l,!1,e,a),a=0,e=0,l++):!n&&a<0&&(u+=s.buffer.translateBufferLineToString(l,!1,0,e+1),a=s.cols-1,e=a,l--);return u+s.buffer.translateBufferLineToString(l,!1,e,a)}function Ac(e,t){let r=t?"O":"[";return le.ESC+r+e}function Dc(e,t){e=Math.floor(e);let r="";for(let i=0;i<e;i++)r+=t;return r}var l7=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function kb(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Eg=50,c7=15,h7=50,u7=500,d7=" ",f7=new RegExp(d7,"g"),oy=class extends Qe{constructor(e,t,r,i,n,s,a,l,u){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=i,this._coreService=n,this._mouseService=s,this._optionsService=a,this._renderService=l,this._coreBrowserService=u,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Ni,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new _e),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new _e),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new _e),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new _e),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new l7(this._bufferService),this._activeSelectionMode=0,this._register(At(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,i=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let n=e[0]<t[0]?e[0]:t[0],s=e[0]<t[0]?t[0]:e[0];for(let a=e[1];a<=t[1];a++){let l=r.translateBufferLineToString(a,!0,n,s);i.push(l)}}else{let n=e[1]===t[1]?t[0]:void 0;i.push(r.translateBufferLineToString(e[1],!0,e[0],n));for(let s=e[1]+1;s<=t[1]-1;s++){let a=r.lines.get(s),l=r.translateBufferLineToString(s,!0);a!=null&&a.isWrapped?i[i.length-1]+=l:i.push(l)}if(e[1]!==t[1]){let s=r.lines.get(t[1]),a=r.translateBufferLineToString(t[1],!0,0,t[0]);s&&s.isWrapped?i[i.length-1]+=a:i.push(a)}}return i.map(n=>n.replace(f7," ")).join(oB?`\r
|
|
462
|
+
`:`
|
|
463
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),R0&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!r||!i||!t?!1:this._areCoordsInSelection(t,r,i)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!r||!i?!1:this._areCoordsInSelection([e,t],r,i)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var n,s;let r=(s=(n=this._linkifier.currentLink)==null?void 0:n.link)==null?void 0:s.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=kb(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let i=this._getMouseBufferCoords(e);return i?(this._selectWordAt(i,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=L0(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-Eg),Eg),t/=Eg,t/Math.abs(t)+Math.round(t*(c7-1)))}shouldForceSelection(e){return Md?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),h7)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Md&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let i=r.lines.get(this._model.selectionEnd[1]);i&&i.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<u7&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&r[0]!==void 0&&r[1]!==void 0){let i=t7(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(i,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,t,r);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,r)}_fireOnSelectionChange(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let i=0;t>=i;i++){let n=e.loadCell(i,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:n>1&&t!==i&&(r+=n-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,i=!0){if(e[0]>=this._bufferService.cols)return;let n=this._bufferService.buffer,s=n.lines.get(e[1]);if(!s)return;let a=n.translateBufferLineToString(e[1],!1),l=this._convertViewportColToCharacterIndex(s,e[0]),u=l,h=e[0]-l,d=0,p=0,m=0,y=0;if(a.charAt(l)===" "){for(;l>0&&a.charAt(l-1)===" ";)l--;for(;u<a.length&&a.charAt(u+1)===" ";)u++}else{let S=e[0],C=e[0];s.getWidth(S)===0&&(d++,S--),s.getWidth(C)===2&&(p++,C++);let B=s.getString(C).length;for(B>1&&(y+=B-1,u+=B-1);S>0&&l>0&&!this._isCharWordSeparator(s.loadCell(S-1,this._workCell));){s.loadCell(S-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(d++,S--):R>1&&(m+=R-1,l-=R-1),l--,S--}for(;C<s.length&&u+1<a.length&&!this._isCharWordSeparator(s.loadCell(C+1,this._workCell));){s.loadCell(C+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(p++,C++):R>1&&(y+=R-1,u+=R-1),u++,C++}}u++;let x=l+h-d+m,v=Math.min(this._bufferService.cols,u-l+d+p-m-y);if(!(!t&&a.slice(l,u).trim()==="")){if(r&&x===0&&s.getCodePoint(0)!==32){let S=n.lines.get(e[1]-1);if(S&&s.isWrapped&&S.getCodePoint(this._bufferService.cols-1)!==32){let C=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(C){let B=this._bufferService.cols-C.start;x-=B,v+=B}}}if(i&&x+v===this._bufferService.cols&&s.getCodePoint(this._bufferService.cols-1)!==32){let S=n.lines.get(e[1]+1);if(S!=null&&S.isWrapped&&S.getCodePoint(0)!==32){let C=this._getWordAt([0,e[1]+1],!1,!1,!0);C&&(v+=C.length)}}return{start:x,length:v}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=kb(r,this._bufferService.cols)}};oy=Ft([be(3,Qr),be(4,Uo),be(5,w0),be(6,Zr),be(7,ss),be(8,ns)],oy);var Tb=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Eb=class{constructor(){this._color=new Tb,this._css=new Tb}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},ir=Object.freeze((()=>{let e=[$t.toColor("#2e3436"),$t.toColor("#cc0000"),$t.toColor("#4e9a06"),$t.toColor("#c4a000"),$t.toColor("#3465a4"),$t.toColor("#75507b"),$t.toColor("#06989a"),$t.toColor("#d3d7cf"),$t.toColor("#555753"),$t.toColor("#ef2929"),$t.toColor("#8ae234"),$t.toColor("#fce94f"),$t.toColor("#729fcf"),$t.toColor("#ad7fa8"),$t.toColor("#34e2e2"),$t.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let i=t[r/36%6|0],n=t[r/6%6|0],s=t[r%6];e.push({css:Zt.toCss(i,n,s),rgba:Zt.toRgba(i,n,s)})}for(let r=0;r<24;r++){let i=8+r*10;e.push({css:Zt.toCss(i,i,i),rgba:Zt.toRgba(i,i,i)})}return e})()),vo=$t.toColor("#ffffff"),lc=$t.toColor("#000000"),Bb=$t.toColor("#ffffff"),Mb=lc,Gl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},p7=vo,ay=class extends Qe{constructor(e){super(),this._optionsService=e,this._contrastCache=new Eb,this._halfContrastCache=new Eb,this._onChangeColors=this._register(new _e),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:vo,background:lc,cursor:Bb,cursorAccent:Mb,selectionForeground:void 0,selectionBackgroundTransparent:Gl,selectionBackgroundOpaque:Tt.blend(lc,Gl),selectionInactiveBackgroundTransparent:Gl,selectionInactiveBackgroundOpaque:Tt.blend(lc,Gl),scrollbarSliderBackground:Tt.opacity(vo,.2),scrollbarSliderHoverBackground:Tt.opacity(vo,.4),scrollbarSliderActiveBackground:Tt.opacity(vo,.5),overviewRulerBorder:vo,ansi:ir.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=xt(e.foreground,vo),t.background=xt(e.background,lc),t.cursor=Tt.blend(t.background,xt(e.cursor,Bb)),t.cursorAccent=Tt.blend(t.background,xt(e.cursorAccent,Mb)),t.selectionBackgroundTransparent=xt(e.selectionBackground,Gl),t.selectionBackgroundOpaque=Tt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=xt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Tt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?xt(e.selectionForeground,Sb):void 0,t.selectionForeground===Sb&&(t.selectionForeground=void 0),Tt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Tt.opacity(t.selectionBackgroundTransparent,.3)),Tt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Tt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=xt(e.scrollbarSliderBackground,Tt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=xt(e.scrollbarSliderHoverBackground,Tt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=xt(e.scrollbarSliderActiveBackground,Tt.opacity(t.foreground,.5)),t.overviewRulerBorder=xt(e.overviewRulerBorder,p7),t.ansi=ir.slice(),t.ansi[0]=xt(e.black,ir[0]),t.ansi[1]=xt(e.red,ir[1]),t.ansi[2]=xt(e.green,ir[2]),t.ansi[3]=xt(e.yellow,ir[3]),t.ansi[4]=xt(e.blue,ir[4]),t.ansi[5]=xt(e.magenta,ir[5]),t.ansi[6]=xt(e.cyan,ir[6]),t.ansi[7]=xt(e.white,ir[7]),t.ansi[8]=xt(e.brightBlack,ir[8]),t.ansi[9]=xt(e.brightRed,ir[9]),t.ansi[10]=xt(e.brightGreen,ir[10]),t.ansi[11]=xt(e.brightYellow,ir[11]),t.ansi[12]=xt(e.brightBlue,ir[12]),t.ansi[13]=xt(e.brightMagenta,ir[13]),t.ansi[14]=xt(e.brightCyan,ir[14]),t.ansi[15]=xt(e.brightWhite,ir[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<r;i++)t.ansi[i+16]=xt(e.extendedAnsi[i],ir[i+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};ay=Ft([be(0,Zr)],ay);function xt(e,t){if(e!==void 0)try{return $t.toColor(e)}catch{}return t}var g7=class{constructor(...e){this._entries=new Map;for(let[t,r]of e)this.set(t,r)}set(e,t){let r=this._entries.get(e);return this._entries.set(e,t),r}forEach(e){for(let[t,r]of this._entries.entries())e(t,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},m7=class{constructor(){this._services=new g7,this._services.set(S0,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let r=cH(e).sort((s,a)=>s.index-a.index),i=[];for(let s of r){let a=this._services.get(s.id);if(!a)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${s.id._id}.`);i.push(a)}let n=r.length>0?r[0].index:t.length;if(t.length!==n)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${n+1} conflicts with ${t.length} static arguments`);return new e(...t,...i)}},y7={trace:0,debug:1,info:2,warn:3,error:4,off:5},_7="xterm.js: ",ly=class extends Qe{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=y7[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":_7)+t,...r)}trace(e,...t){var r;this._logLevel<=0&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var r;this._logLevel<=1&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var r;this._logLevel<=2&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var r;this._logLevel<=3&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var r;this._logLevel<=4&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,e,t)}};ly=Ft([be(0,Zr)],ly);var Lb=class extends Qe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new _e),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new _e),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new _e),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...r){if(t){for(let i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+r.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<r.length;i++)this._array[this._getCyclicIndex(e+i)]=r[i];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let i=this._length+r.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let n=t-1;n>=0;n--)this.set(e+n+r,this.get(e+n));let i=e+t+r-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<t;i++)this.set(e+i+r,this.get(e+i))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Xe=3,Xt=Object.freeze(new Uc),_u=0,Bg=2,cc=class uB{constructor(t,r,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Xe);let n=r||Ni.fromCharData([0,LE,1,0]);for(let s=0;s<t;++s)this.setCell(s,n);this.length=t}get(t){let r=this._data[t*Xe+0],i=r&2097151;return[this._data[t*Xe+1],r&2097152?this._combined[t]:i?Ps(i):"",r>>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,r){this._data[t*Xe+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Xe+0]=t|2097152|r[2]<<22):this._data[t*Xe+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Xe+0]>>22}hasWidth(t){return this._data[t*Xe+0]&12582912}getFg(t){return this._data[t*Xe+1]}getBg(t){return this._data[t*Xe+2]}hasContent(t){return this._data[t*Xe+0]&4194303}getCodePoint(t){let r=this._data[t*Xe+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Xe+0]&2097152}getString(t){let r=this._data[t*Xe+0];return r&2097152?this._combined[t]:r&2097151?Ps(r&2097151):""}isProtected(t){return this._data[t*Xe+2]&536870912}loadCell(t,r){return _u=t*Xe,r.content=this._data[_u+0],r.fg=this._data[_u+1],r.bg=this._data[_u+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Xe+0]=r.content,this._data[t*Xe+1]=r.fg,this._data[t*Xe+2]=r.bg}setCellFromCodepoint(t,r,i,n){n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*Xe+0]=r|i<<22,this._data[t*Xe+1]=n.fg,this._data[t*Xe+2]=n.bg}addCodepointToCell(t,r,i){let n=this._data[t*Xe+0];n&2097152?this._combined[t]+=Ps(r):n&2097151?(this._combined[t]=Ps(n&2097151)+Ps(r),n&=-2097152,n|=2097152):n=r|1<<22,i&&(n&=-12582913,n|=i<<22),this._data[t*Xe+0]=n}insertCells(t,r,i){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),r<this.length-t){let n=new Ni;for(let s=this.length-t-r-1;s>=0;--s)this.setCell(t+r+s,this.loadCell(t+s,n));for(let s=0;s<r;++s)this.setCell(t+s,i)}else for(let n=t;n<this.length;++n)this.setCell(n,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(t,r,i){if(t%=this.length,r<this.length-t){let n=new Ni;for(let s=0;s<this.length-t-r;++s)this.setCell(t+s,this.loadCell(t+r+s,n));for(let s=this.length-r;s<this.length;++s)this.setCell(s,i)}else for(let n=t;n<this.length;++n)this.setCell(n,i);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,i)}replaceCells(t,r,i,n=!1){if(n){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,i);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,i),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,i);t<r&&t<this.length;)this.setCell(t++,i)}resize(t,r){if(t===this.length)return this._data.length*4*Bg<this._data.buffer.byteLength;let i=t*Xe;if(t>this.length){if(this._data.buffer.byteLength>=i*4)this._data=new Uint32Array(this._data.buffer,0,i);else{let n=new Uint32Array(i);n.set(this._data),this._data=n}for(let n=this.length;n<t;++n)this.setCell(n,r)}else{this._data=this._data.subarray(0,i);let n=Object.keys(this._combined);for(let a=0;a<n.length;a++){let l=parseInt(n[a],10);l>=t&&delete this._combined[l]}let s=Object.keys(this._extendedAttrs);for(let a=0;a<s.length;a++){let l=parseInt(s[a],10);l>=t&&delete this._extendedAttrs[l]}}return this.length=t,i*4*Bg<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Bg<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r){for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,t);return}this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(let r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){let t=new uB(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let r in this._combined)t._combined[r]=this._combined[r];for(let r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Xe+0]&4194303)return t+(this._data[t*Xe+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Xe+0]&4194303||this._data[t*Xe+2]&50331648)return t+(this._data[t*Xe+0]>>22);return 0}copyCellsFrom(t,r,i,n,s){let a=t._data;if(s)for(let u=n-1;u>=0;u--){for(let h=0;h<Xe;h++)this._data[(i+u)*Xe+h]=a[(r+u)*Xe+h];a[(r+u)*Xe+2]&268435456&&(this._extendedAttrs[i+u]=t._extendedAttrs[r+u])}else for(let u=0;u<n;u++){for(let h=0;h<Xe;h++)this._data[(i+u)*Xe+h]=a[(r+u)*Xe+h];a[(r+u)*Xe+2]&268435456&&(this._extendedAttrs[i+u]=t._extendedAttrs[r+u])}let l=Object.keys(t._combined);for(let u=0;u<l.length;u++){let h=parseInt(l[u],10);h>=r&&(this._combined[h-r+i]=t._combined[h])}}translateToString(t,r,i,n){r=r??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),n&&(n.length=0);let s="";for(;r<i;){let a=this._data[r*Xe+0],l=a&2097151,u=a&2097152?this._combined[r]:l?Ps(l):Os;if(s+=u,n)for(let h=0;h<u.length;++h)n.push(r);r+=a>>22||1}return n&&n.push(r),s}};function x7(e,t,r,i,n,s){let a=[];for(let l=0;l<e.length-1;l++){let u=l,h=e.get(++u);if(!h.isWrapped)continue;let d=[e.get(l)];for(;u<e.length&&h.isWrapped;)d.push(h),h=e.get(++u);if(!s&&i>=l&&i<u){l+=d.length-1;continue}let p=0,m=Pc(d,p,t),y=1,x=0;for(;y<d.length;){let S=Pc(d,y,t),C=S-x,B=r-m,R=Math.min(C,B);d[p].copyCellsFrom(d[y],x,m,R,!1),m+=R,m===r&&(p++,m=0),x+=R,x===S&&(y++,x=0),m===0&&p!==0&&d[p-1].getWidth(r-1)===2&&(d[p].copyCellsFrom(d[p-1],r-1,m++,1,!1),d[p-1].setCell(r-1,n))}d[p].replaceCells(m,r,n);let v=0;for(let S=d.length-1;S>0&&(S>p||d[S].getTrimmedLength()===0);S--)v++;v>0&&(a.push(l+d.length-v),a.push(v)),l+=d.length-1}return a}function v7(e,t){let r=[],i=0,n=t[i],s=0;for(let a=0;a<e.length;a++)if(n===a){let l=t[++i];e.onDeleteEmitter.fire({index:a-s,amount:l}),a+=l-1,s+=l,n=t[++i]}else r.push(a);return{layout:r,countRemoved:s}}function b7(e,t){let r=[];for(let i=0;i<t.length;i++)r.push(e.get(t[i]));for(let i=0;i<r.length;i++)e.set(i,r[i]);e.length=t.length}function S7(e,t,r){let i=[],n=e.map((u,h)=>Pc(e,h,t)).reduce((u,h)=>u+h),s=0,a=0,l=0;for(;l<n;){if(n-l<r){i.push(n-l);break}s+=r;let u=Pc(e,a,t);s>u&&(s-=u,a++);let h=e[a].getWidth(s-1)===2;h&&s--;let d=h?r-1:r;i.push(d),l+=d}return i}function Pc(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let i=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,n=e[t+1].getWidth(0)===2;return i&&n?r-1:r}var dB=class fB{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=fB._nextId++,this._onDispose=this.register(new _e),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Oo(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};dB._nextId=1;var w7=dB,lr={},bo=lr.B;lr[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};lr.A={"#":"£"};lr.B=void 0;lr[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};lr.C=lr[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};lr.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};lr.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};lr.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};lr.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};lr.E=lr[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};lr.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};lr.H=lr[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};lr["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Rb=4294967295,Ab=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Xt.clone(),this.savedCharset=bo,this.markers=[],this._nullCell=Ni.fromCharData([0,LE,1,0]),this._whitespaceCell=Ni.fromCharData([0,Os,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Ld,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Lb(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Td),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Td),this._whitespaceCell}getBlankLine(e,t){return new cc(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>Rb?Rb:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Xt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new Lb(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(Xt),i=0,n=this._getCorrectBufferLength(t);if(n>this.lines.maxLength&&(this.lines.maxLength=n),this.lines.length>0){if(this._cols<e)for(let a=0;a<this.lines.length;a++)i+=+this.lines.get(a).resize(e,r);let s=0;if(this._rows<t)for(let a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new cc(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new cc(e,r)));else for(let a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(n<this.lines.maxLength){let a=this.lines.length-n;a>0&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=n}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let s=0;s<this.lines.length;s++)i+=+this.lines.get(s).resize(e,r);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),i>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,i=x7(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Xt),r);if(i.length>0){let n=v7(this.lines,i);b7(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let i=this.getNullCell(Xt),n=r;for(;n-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new cc(e,i))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,i=this.getNullCell(Xt),n=[],s=0;for(let a=this.lines.length-1;a>=0;a--){let l=this.lines.get(a);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;let u=[l];for(;l.isWrapped&&a>0;)l=this.lines.get(--a),u.unshift(l);if(!r){let R=this.ybase+this.y;if(R>=a&&R<a+u.length)continue}let h=u[u.length-1].getTrimmedLength(),d=S7(u,this._cols,e),p=d.length-u.length,m;this.ybase===0&&this.y!==this.lines.length-1?m=Math.max(0,this.y-this.lines.maxLength+p):m=Math.max(0,this.lines.length-this.lines.maxLength+p);let y=[];for(let R=0;R<p;R++){let E=this.getBlankLine(Xt,!0);y.push(E)}y.length>0&&(n.push({start:a+u.length+s,newLines:y}),s+=y.length),u.push(...y);let x=d.length-1,v=d[x];v===0&&(x--,v=d[x]);let S=u.length-p-1,C=h;for(;S>=0;){let R=Math.min(C,v);if(u[x]===void 0)break;if(u[x].copyCellsFrom(u[S],C-R,v-R,R,!0),v-=R,v===0&&(x--,v=d[x]),C-=R,C===0){S--;let E=Math.max(S,0);C=Pc(u,E,this._cols)}}for(let R=0;R<u.length;R++)d[R]<e&&u[R].setCell(d[R],i);let B=p-m;for(;B-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(n.length>0){let a=[],l=[];for(let v=0;v<this.lines.length;v++)l.push(this.lines.get(v));let u=this.lines.length,h=u-1,d=0,p=n[d];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);let m=0;for(let v=Math.min(this.lines.maxLength-1,u+s-1);v>=0;v--)if(p&&p.start>h+m){for(let S=p.newLines.length-1;S>=0;S--)this.lines.set(v--,p.newLines[S]);v++,a.push({index:h+1,amount:p.newLines.length}),m+=p.newLines.length,p=n[++d]}else this.lines.set(v,l[h--]);let y=0;for(let v=a.length-1;v>=0;v--)a[v].index+=y,this.lines.onInsertEmitter.fire(a[v]),y+=a[v].amount;let x=Math.max(0,u+s-this.lines.maxLength);x>0&&this.lines.onTrimEmitter.fire(x)}}translateBufferLineToString(e,t,r=0,i){let n=this.lines.get(e);return n?n.translateToString(t,r,i):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new w7(e);return this.markers.push(t),t.register(this.lines.onTrim(r=>{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.line<r.index+r.amount&&t.dispose(),t.line>r.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},C7=class extends Qe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new _e),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new Ab(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Ab(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},pB=2,gB=1,cy=class extends Qe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new _e),this.onResize=this._onResize.event,this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,pB),this.rows=Math.max(e.rawOptions.rows||0,gB),this.buffers=this._register(new C7(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,i=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,i;i=this._cachedBlankLine,(!i||i.length!==this.cols||i.getFg(0)!==e.fg||i.getBg(0)!==e.bg)&&(i=r.getBlankLine(e,t),this._cachedBlankLine=i),i.isWrapped=t;let n=r.ybase+r.scrollTop,s=r.ybase+r.scrollBottom;if(r.scrollTop===0){let a=r.lines.isFull;s===r.lines.length-1?a?r.lines.recycle().copyFrom(i):r.lines.push(i.clone()):r.lines.splice(s+1,0,i.clone()),a?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let a=s-n+1;r.lines.shiftElements(n+1,a-1,-1),r.lines.set(s,i.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};cy=Ft([be(0,Zr)],cy);var _a={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Md,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},k7=["normal","bold","100","200","300","400","500","600","700","800","900"],T7=class extends Qe{constructor(e){super(),this._onOptionChange=this._register(new _e),this.onOptionChange=this._onOptionChange.event;let t={..._a};for(let r in e)if(r in t)try{let i=e[r];t[r]=this._sanitizeAndValidateOption(r,i)}catch(i){console.error(i)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(At(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in _a))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,i)=>{if(!(r in _a))throw new Error(`No option with key "${r}"`);i=this._sanitizeAndValidateOption(r,i),this.rawOptions[r]!==i&&(this.rawOptions[r]=i,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let i={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,i)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=_a[e]),!E7(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=_a[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=k7.includes(t)?t:_a[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function E7(e){return e==="block"||e==="underline"||e==="bar"}function hc(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let i in e)r[i]=t<=1?e[i]:e[i]&&hc(e[i],t-1);return r}var Db=Object.freeze({insertMode:!1}),Pb=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),hy=class extends Qe{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new _e),this.onData=this._onData.event,this._onUserInput=this._register(new _e),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new _e),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new _e),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=hc(Db),this.decPrivateModes=hc(Pb)}reset(){this.modes=hc(Db),this.decPrivateModes=hc(Pb)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};hy=Ft([be(0,Qr),be(1,IE),be(2,Zr)],hy);var Ib={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Mg(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var Lg=String.fromCharCode,$b={DEFAULT:e=>{let t=[Mg(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Lg(t[0])}${Lg(t[1])}${Lg(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Mg(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Mg(e,!0)};${e.x};${e.y}${t}`}},uy=class extends Qe{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new _e),this.onProtocolChange=this._onProtocolChange.event;for(let i of Object.keys(Ib))this.addProtocol(i,Ib[i]);for(let i of Object.keys($b))this.addEncoding(i,$b[i]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let i=t/r,n=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=i+0,Math.abs(e.deltaY)<50&&(n*=.3),this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};uy=Ft([be(0,Qr),be(1,Uo),be(2,Zr)],uy);var Rg=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],B7=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],nr;function M7(e,t){let r=0,i=t.length-1,n;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=r;)if(n=r+i>>1,e>t[n][1])r=n+1;else if(e<t[n][0])i=n-1;else return!0;return!1}var L7=class{constructor(){if(this.version="6",!nr){nr=new Uint8Array(65536),nr.fill(1),nr[0]=0,nr.fill(0,1,32),nr.fill(0,127,160),nr.fill(2,4352,4448),nr[9001]=2,nr[9002]=2,nr.fill(2,11904,42192),nr[12351]=1,nr.fill(2,44032,55204),nr.fill(2,63744,64256),nr.fill(2,65040,65050),nr.fill(2,65072,65136),nr.fill(2,65280,65377),nr.fill(2,65504,65511);for(let e=0;e<Rg.length;++e)nr.fill(0,Rg[e][0],Rg[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?nr[e]:M7(e,B7)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),i=r===0&&t!==0;if(i){let n=Eo.extractWidth(t);n===0?i=!1:n>r&&(r=n)}return Eo.createPropertyValue(0,r,i)}},Eo=class Nu{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new _e,this.onChange=this._onChange.event;let t=new L7;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,i=!1){return(t&16777215)<<3|(r&3)<<1|(i?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,i=0,n=t.length;for(let s=0;s<n;++s){let a=t.charCodeAt(s);if(55296<=a&&a<=56319){if(++s>=n)return r+this.wcwidth(a);let h=t.charCodeAt(s);56320<=h&&h<=57343?a=(a-55296)*1024+h-56320+65536:r+=this.wcwidth(h)}let l=this.charProperties(a,i),u=Nu.extractWidth(l);Nu.extractShouldJoin(l)&&(u-=Nu.extractWidth(i)),r+=u,i=l}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},R7=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function jb(e){var i;let t=(i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:i.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var Yl=2147483647,A7=256,mB=class dy{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>A7)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new dy;if(!t.length)return r;for(let i=Array.isArray(t[0])?1:0;i<t.length;++i){let n=t[i];if(Array.isArray(n))for(let s=0;s<n.length;++s)r.addSubParam(n[s]);else r.addParam(n)}return r}clone(){let t=new dy(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let r=0;r<this.length;++r){t.push(this.params[r]);let i=this._subParamsIdx[r]>>8,n=this._subParamsIdx[r]&255;n-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,n))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Yl?Yl:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Yl?Yl:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,i=this._subParamsIdx[t]&255;return i-r>0?this._subParams.subarray(r,i):null}getSubParamsAll(){let t={};for(let r=0;r<this.length;++r){let i=this._subParamsIdx[r]>>8,n=this._subParamsIdx[r]&255;n-i>0&&(t[r]=this._subParams.slice(i,n))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i=this._digitIsSub?this._subParams:this.params,n=i[r-1];i[r-1]=~n?Math.min(n*10+t,Yl):t}},Kl=[],D7=class{constructor(){this._state=0,this._active=Kl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Kl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Kl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Kl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",af(e,t,r));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t<r;){let i=e[t++];if(i===59){this._state=2,this._start();break}if(i<48||57<i){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+i-48}this._state===2&&r-t>0&&this._put(e,t,r)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let r=!1,i=this._active.length-1,n=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,n=this._stack.fallThrough,this._stack.paused=!1),!n&&r===!1){for(;i>=0&&(r=this._active[i].end(e),r!==!0);i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if(r=this._active[i].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}this._active=Kl,this._id=-1,this._state=0}}},bi=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=af(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(r=>(this._data="",this._hitLimit=!1,r));return this._data="",this._hitLimit=!1,t}},Xl=[],P7=class{constructor(){this._handlers=Object.create(null),this._active=Xl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Xl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Xl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Xl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",af(e,t,r));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,i=this._active.length-1,n=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,n=this._stack.fallThrough,this._stack.paused=!1),!n&&r===!1){for(;i>=0&&(r=this._active[i].unhook(e),r!==!0);i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if(r=this._active[i].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}this._active=Xl,this._ident=0}},uc=new mB;uc.addParam(0);var Ob=class{constructor(e){this._handler=e,this._data="",this._params=uc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():uc,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=af(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=uc,this._data="",this._hitLimit=!1,r));return this._params=uc,this._data="",this._hitLimit=!1,t}},I7=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,i){this.table[t<<8|e]=r<<4|i}addMany(e,t,r,i){for(let n=0;n<e.length;n++)this.table[t<<8|e[n]]=r<<4|i}},Fi=160,$7=(function(){let e=new I7(4095),t=Array.apply(null,Array(256)).map((l,u)=>u),r=(l,u)=>t.slice(l,u),i=r(32,127),n=r(0,24);n.push(25),n.push.apply(n,r(28,32));let s=r(0,14),a;e.setDefault(1,0),e.addMany(i,0,2,0);for(a in s)e.addMany([24,26,153,154],a,3,0),e.addMany(r(128,144),a,3,0),e.addMany(r(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(n,0,3,0),e.addMany(n,1,3,1),e.add(127,1,0,1),e.addMany(n,8,0,8),e.addMany(n,3,3,3),e.add(127,3,0,3),e.addMany(n,4,3,4),e.add(127,4,0,4),e.addMany(n,6,3,6),e.addMany(n,5,3,5),e.add(127,5,0,5),e.addMany(n,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(n,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(n,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(n,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(n,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(n,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(n,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Fi,0,2,0),e.add(Fi,8,5,8),e.add(Fi,6,0,6),e.add(Fi,11,0,11),e.add(Fi,13,13,13),e})(),j7=class extends Qe{constructor(e=$7){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new mB,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,i)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(At(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new D7),this._dcsParser=this._register(new P7),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let n=0;n<e.intermediates.length;++n){let s=e.intermediates.charCodeAt(n);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=s}}if(e.final.length!==1)throw new Error("final must be a single byte");let i=e.final.charCodeAt(0);if(t[0]>i||i>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=i,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let i=this._escHandlers[r];return i.push(t),{dispose:()=>{let n=i.indexOf(t);n!==-1&&i.splice(n,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let i=this._csiHandlers[r];return i.push(t),{dispose:()=>{let n=i.indexOf(t);n!==-1&&i.splice(n,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,r,i,n){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=i,this._parseStack.chunkPos=n}parse(e,t,r){let i=0,n=0,s=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,s=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let l=this._parseStack.handlers,u=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&u>-1){for(;u>=0&&(a=l[u](this._params),a!==!0);u--)if(a instanceof Promise)return this._parseStack.handlerPos=u,a}this._parseStack.handlers=[];break;case 4:if(r===!1&&u>-1){for(;u>=0&&(a=l[u](),a!==!0);u--)if(a instanceof Promise)return this._parseStack.handlerPos=u,a}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(i!==24&&i!==26,r),a)return a;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],a=this._oscParser.end(i!==24&&i!==26,r),a)return a;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,s=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let l=s;l<t;++l){switch(i=e[l],n=this._transitions.table[this.currentState<<8|(i<160?i:Fi)],n>>4){case 2:for(let m=l+1;;++m){if(m>=t||(i=e[m])<32||i>126&&i<Fi){this._printHandler(e,l,m),l=m-1;break}if(++m>=t||(i=e[m])<32||i>126&&i<Fi){this._printHandler(e,l,m),l=m-1;break}if(++m>=t||(i=e[m])<32||i>126&&i<Fi){this._printHandler(e,l,m),l=m-1;break}if(++m>=t||(i=e[m])<32||i>126&&i<Fi){this._printHandler(e,l,m),l=m-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let u=this._csiHandlers[this._collect<<8|i],h=u?u.length-1:-1;for(;h>=0&&(a=u[h](this._params),a!==!0);h--)if(a instanceof Promise)return this._preserveStack(3,u,h,n,l),a;h<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++l<t&&(i=e[l])>47&&i<60);l--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let d=this._escHandlers[this._collect<<8|i],p=d?d.length-1:-1;for(;p>=0&&(a=d[p](),a!==!0);p--)if(a instanceof Promise)return this._preserveStack(4,d,p,n,l),a;p<0&&this._escHandlerFb(this._collect<<8|i),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|i,this._params);break;case 13:for(let m=l+1;;++m)if(m>=t||(i=e[m])===24||i===26||i===27||i>127&&i<Fi){this._dcsParser.put(e,l,m),l=m-1;break}break;case 14:if(a=this._dcsParser.unhook(i!==24&&i!==26),a)return this._preserveStack(6,[],0,n,l),a;i===27&&(n|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let m=l+1;;m++)if(m>=t||(i=e[m])<32||i>127&&i<Fi){this._oscParser.put(e,l,m),l=m-1;break}break;case 6:if(a=this._oscParser.end(i!==24&&i!==26),a)return this._preserveStack(5,[],0,n,l),a;i===27&&(n|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=n&15}}},O7=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,z7=/^[\da-f]+$/;function zb(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let r=O7.exec(t);if(r){let i=r[1]?15:r[4]?255:r[7]?4095:65535;return[Math.round(parseInt(r[1]||r[4]||r[7]||r[10],16)/i*255),Math.round(parseInt(r[2]||r[5]||r[8]||r[11],16)/i*255),Math.round(parseInt(r[3]||r[6]||r[9]||r[12],16)/i*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),z7.exec(t)&&[3,6,9,12].includes(t.length))){let r=t.length/3,i=[0,0,0];for(let n=0;n<3;++n){let s=parseInt(t.slice(r*n,r*n+r),16);i[n]=r===1?s<<4:r===2?s:r===3?s>>4:s>>8}return i}}function Ag(e,t){let r=e.toString(16),i=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return i;case 12:return(i+i).slice(0,3);default:return i+i}}function F7(e,t=16){let[r,i,n]=e;return`rgb:${Ag(r,t)}/${Ag(i,t)}/${Ag(n,t)}`}var N7={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ls=131072,Fb=10;function Nb(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Wb=5e3,Hb=0,W7=class extends Qe{constructor(e,t,r,i,n,s,a,l,u=new j7){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=i,this._optionsService=n,this._oscLinkService=s,this._coreMouseService=a,this._unicodeService=l,this._parser=u,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new aH,this._utf8Decoder=new lH,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Xt.clone(),this._eraseAttrDataInternal=Xt.clone(),this._onRequestBell=this._register(new _e),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new _e),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new _e),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new _e),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new _e),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new _e),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new _e),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new _e),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new _e),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new _e),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new _e),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new _e),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new _e),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new fy(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,d)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:d.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,d,p)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:d,data:p})}),this._parser.setDcsHandlerFallback((h,d,p)=>{d==="HOOK"&&(p=p.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:d,payload:p})}),this._parser.setPrintHandler((h,d,p)=>this.print(h,d,p)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(le.BEL,()=>this.bell()),this._parser.setExecuteHandler(le.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(le.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(le.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(le.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(le.BS,()=>this.backspace()),this._parser.setExecuteHandler(le.HT,()=>this.tab()),this._parser.setExecuteHandler(le.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(le.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(zu.IND,()=>this.index()),this._parser.setExecuteHandler(zu.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(zu.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new bi(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new bi(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new bi(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new bi(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new bi(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new bi(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new bi(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new bi(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new bi(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new bi(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new bi(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new bi(h=>this.restoreCursorColor(h))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let h in lr)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Ob((h,d)=>this.requestStatusString(h,d)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,i){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=i}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),Wb))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Wb} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,i=this._activeBuffer.x,n=this._activeBuffer.y,s=0,a=this._parseStack.paused;if(a){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;i=this._parseStack.cursorStartX,n=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Ls&&(s=this._parseStack.position+Ls)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Ls&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ls))),a||this._dirtyRowTracker.clearRange(),e.length>Ls)for(let h=s;h<e.length;h+=Ls){let d=h+Ls<e.length?h+Ls:e.length,p=typeof e=="string"?this._stringDecoder.decode(e.substring(h,d),this._parseBuffer):this._utf8Decoder.decode(e.subarray(h,d),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,p))return this._preserveStack(i,n,p,h),this._logSlowResolvingAsync(r),r}else if(!a){let h=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,h))return this._preserveStack(i,n,h,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==i||this._activeBuffer.y!==n)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),u=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);u<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(u,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(e,t,r){let i,n,s=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,u=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,d=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-t>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let m=this._parser.precedingJoinState;for(let y=t;y<r;++y){if(i=e[y],i<127&&s){let C=s[String.fromCharCode(i)];C&&(i=C.charCodeAt(0))}let x=this._unicodeService.charProperties(i,m);n=Eo.extractWidth(x);let v=Eo.extractShouldJoin(x),S=v?Eo.extractWidth(m):0;if(m=x,a&&this._onA11yChar.fire(Ps(i)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+n-S>l){if(u){let C=p,B=this._activeBuffer.x-S;for(this._activeBuffer.x=S,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),S>0&&p instanceof cc&&p.copyCellsFrom(C,B,0,S,!1);B<l;)C.setCellFromCodepoint(B++,0,1,d)}else if(this._activeBuffer.x=l-1,n===2)continue}if(v&&this._activeBuffer.x){let C=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-C,i,n);for(let B=n-S;--B>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(h&&(p.insertCells(this._activeBuffer.x,n-S,this._activeBuffer.getNullCell(d)),p.getWidth(l-1)===2&&p.setCellFromCodepoint(l-1,0,1,d)),p.setCellFromCodepoint(this._activeBuffer.x++,i,n,d),n>0)for(;--n;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=m,this._activeBuffer.x<l&&r-t>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>Nb(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Ob(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new bi(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,i=!1,n=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),n),i&&(s.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var i;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r<this._bufferService.rows;r++)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&i.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-i+1;for(;t--;)this._activeBuffer.lines.splice(n-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,i;for(i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-i;t--;)this._activeBuffer.lines.splice(r,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(Xt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let r=e.params[0]||1,i=Eo.extractWidth(t),n=this._activeBuffer.x-i,s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(n),a=new Uint32Array(s.length*r),l=0;for(let h=0;h<s.length;){let d=s.codePointAt(h)||0;a[l++]=d,h+=d>65535?2:1}let u=l;for(let h=1;h<r;++h)a.copyWithin(u,0,l),u+=l;return this.print(a,0,u),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(le.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(le.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(le.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(le.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(le.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,bo),this._charsetService.setgCharset(1,bo),this._charsetService.setgCharset(2,bo),this._charsetService.setgCharset(3,bo);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(v=>(v[v.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",v[v.SET=1]="SET",v[v.RESET=2]="RESET",v[v.PERMANENTLY_SET=3]="PERMANENTLY_SET",v[v.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let i=this._coreService.decPrivateModes,{activeProtocol:n,activeEncoding:s}=this._coreMouseService,a=this._coreService,{buffers:l,cols:u}=this._bufferService,{active:h,alt:d}=l,p=this._optionsService.rawOptions,m=(v,S)=>(a.triggerDataEvent(`${le.ESC}[${t?"":"?"}${v};${S}$y`),!0),y=v=>v?1:2,x=e.params[0];return t?x===2?m(x,4):x===4?m(x,y(a.modes.insertMode)):x===12?m(x,3):x===20?m(x,y(p.convertEol)):m(x,0):x===1?m(x,y(i.applicationCursorKeys)):x===3?m(x,p.windowOptions.setWinLines?u===80?2:u===132?1:0:0):x===6?m(x,y(i.origin)):x===7?m(x,y(i.wraparound)):x===8?m(x,3):x===9?m(x,y(n==="X10")):x===12?m(x,y(p.cursorBlink)):x===25?m(x,y(!a.isCursorHidden)):x===45?m(x,y(i.reverseWraparound)):x===66?m(x,y(i.applicationKeypad)):x===67?m(x,4):x===1e3?m(x,y(n==="VT200")):x===1002?m(x,y(n==="DRAG")):x===1003?m(x,y(n==="ANY")):x===1004?m(x,y(i.sendFocus)):x===1005?m(x,4):x===1006?m(x,y(s==="SGR")):x===1015?m(x,4):x===1016?m(x,y(s==="SGR_PIXELS")):x===1048?m(x,1):x===47||x===1047||x===1049?m(x,y(h===d)):x===2004?m(x,y(i.bracketedPasteMode)):x===2026?m(x,y(i.synchronizedOutput)):m(x,0)}_updateAttrColor(e,t,r,i,n){return t===2?(e|=50331648,e&=-16777216,e|=Uc.fromColorRGB([r,i,n])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let i=[0,0,-1,0,0,0],n=0,s=0;do{if(i[s+n]=e.params[t+s],e.hasSubParams(t+s)){let a=e.getSubParams(t+s),l=0;do i[1]===5&&(n=1),i[s+l+1+n]=a[l];while(++l<a.length&&l+s+1+n<i.length);break}if(i[1]===5&&s+n>=2||i[1]===2&&s+n>=5)break;i[1]&&(n=1)}while(++s+t<e.length&&s+n<i.length);for(let a=2;a<i.length;++a)i[a]===-1&&(i[a]=0);switch(i[0]){case 38:r.fg=this._updateAttrColor(r.fg,i[1],i[3],i[4],i[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,i[1],i[3],i[4],i[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,i[1],i[3],i[4],i[5])}return s}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Xt.fg,e.bg=Xt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,i=this._curAttrData;for(let n=0;n<t;n++)r=e.params[n],r>=30&&r<=37?(i.fg&=-50331904,i.fg|=16777216|r-30):r>=40&&r<=47?(i.bg&=-50331904,i.bg|=16777216|r-40):r>=90&&r<=97?(i.fg&=-50331904,i.fg|=16777216|r-90|8):r>=100&&r<=107?(i.bg&=-50331904,i.bg|=16777216|r-100|8):r===0?this._processSGR0(i):r===1?i.fg|=134217728:r===3?i.bg|=67108864:r===4?(i.fg|=268435456,this._processUnderline(e.hasSubParams(n)?e.getSubParams(n)[0]:1,i)):r===5?i.fg|=536870912:r===7?i.fg|=67108864:r===8?i.fg|=1073741824:r===9?i.fg|=2147483648:r===2?i.bg|=134217728:r===21?this._processUnderline(2,i):r===22?(i.fg&=-134217729,i.bg&=-134217729):r===23?i.bg&=-67108865:r===24?(i.fg&=-268435457,this._processUnderline(0,i)):r===25?i.fg&=-536870913:r===27?i.fg&=-67108865:r===28?i.fg&=-1073741825:r===29?i.fg&=2147483647:r===39?(i.fg&=-67108864,i.fg|=Xt.fg&16777215):r===49?(i.bg&=-67108864,i.bg|=Xt.bg&16777215):r===38||r===48||r===58?n+=this._extractColor(e,n,i):r===53?i.bg|=1073741824:r===55?i.bg&=-1073741825:r===59?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):r===100?(i.fg&=-67108864,i.fg|=Xt.fg&16777215,i.bg&=-67108864,i.bg|=Xt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${le.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${le.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${le.ESC}[?${t};${r}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Xt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Nb(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${le.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Fb&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Fb&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let i=r.shift(),n=r.shift();if(/^\d+$/.exec(i)){let s=parseInt(i);if(qb(s))if(n==="?")t.push({type:0,index:s});else{let a=zb(n);a&&t.push({type:1,index:s,color:a})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),i=e.slice(t+1);return i?this._createHyperlink(r,i):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),i,n=r.findIndex(s=>s.startsWith("id="));return n!==-1&&(i=r[n].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let i=0;i<r.length&&!(t>=this._specialColors.length);++i,++t)if(r[i]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let n=zb(r[i]);n&&this._onColor.fire([{type:1,index:this._specialColors[t],color:n}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let i=0;i<r.length;++i)if(/^\d+$/.exec(r[i])){let n=parseInt(r[i]);qb(n)&&t.push({type:2,index:n})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,bo),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(N7[e[0]],lr[e[1]]||bo),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Xt.clone(),this._eraseAttrDataInternal=Xt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Ni;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let r=this._activeBuffer.ybase+this._activeBuffer.y+t,i=this._activeBuffer.lines.get(r);i&&(i.fill(e),i.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let r=a=>(this._coreService.triggerDataEvent(`${le.ESC}${a}${le.ESC}\\`),!0),i=this._bufferService.buffer,n=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[n.cursorStyle]-(n.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},fy=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Hb=e,e=t,t=Hb),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};fy=Ft([be(0,Qr)],fy);function qb(e){return 0<=e&&e<256}var H7=5e7,Ub=12,q7=50,U7=class extends Qe{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new _e),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let r;for(;r=this._writeBuffer.shift();){this._action(r);let i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>H7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let i=this._writeBuffer[this._bufferOffset],n=this._action(i,t);if(n){let a=l=>performance.now()-r>=Ub?setTimeout(()=>this._innerWrite(0,l)):this._innerWrite(r,l);n.catch(l=>(queueMicrotask(()=>{throw l}),Promise.resolve(!1))).then(a);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=i.length,performance.now()-r>=Ub)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>q7&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},py=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let l=t.addMarker(t.ybase+t.y),u={data:e,id:this._nextId++,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(u,l)),this._dataByLinkId.set(u.id,u),u.id}let r=e,i=this._getEntryIdKey(r),n=this._entriesWithId.get(i);if(n)return this.addLineToLink(n.id,t.ybase+t.y),n.id;let s=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(a,s)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(i=>i.line!==t)){let i=this._bufferService.buffer.addMarker(t);r.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(r,i))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};py=Ft([be(0,Qr)],py);var Vb=!1,V7=class extends Qe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Wa),this._onBinary=this._register(new _e),this.onBinary=this._onBinary.event,this._onData=this._register(new _e),this.onData=this._onData.event,this._onLineFeed=this._register(new _e),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new _e),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new _e),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new _e),this._instantiationService=new m7,this.optionsService=this._register(new T7(e)),this._instantiationService.setService(Zr,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(cy)),this._instantiationService.setService(Qr,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(ly)),this._instantiationService.setService(IE,this._logService),this.coreService=this._register(this._instantiationService.createInstance(hy)),this._instantiationService.setService(Uo,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(uy)),this._instantiationService.setService(PE,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Eo)),this._instantiationService.setService(dH,this.unicodeService),this._charsetService=this._instantiationService.createInstance(R7),this._instantiationService.setService(uH,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(py),this._instantiationService.setService($E,this._oscLinkService),this._inputHandler=this._register(new W7(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Cr.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Cr.forward(this._bufferService.onResize,this._onResize)),this._register(Cr.forward(this.coreService.onData,this._onData)),this._register(Cr.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new U7((t,r)=>this._inputHandler.parse(t,r))),this._register(Cr.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new _e),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Vb&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Vb=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,pB),t=Math.max(t,gB),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(jb.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(jb(this._bufferService),!1))),this._windowsWrappingHeuristics.value=At(()=>{for(let t of e)t.dispose()})}}},G7={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function Y7(e,t,r,i){var a;let n={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?n.key=le.ESC+"OA":n.key=le.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?n.key=le.ESC+"OD":n.key=le.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?n.key=le.ESC+"OC":n.key=le.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?n.key=le.ESC+"OB":n.key=le.ESC+"[B");break;case 8:n.key=e.ctrlKey?"\b":le.DEL,e.altKey&&(n.key=le.ESC+n.key);break;case 9:if(e.shiftKey){n.key=le.ESC+"[Z";break}n.key=le.HT,n.cancel=!0;break;case 13:n.key=e.altKey?le.ESC+le.CR:le.CR,n.cancel=!0;break;case 27:n.key=le.ESC,e.altKey&&(n.key=le.ESC+le.ESC),n.cancel=!0;break;case 37:if(e.metaKey)break;s?n.key=le.ESC+"[1;"+(s+1)+"D":t?n.key=le.ESC+"OD":n.key=le.ESC+"[D";break;case 39:if(e.metaKey)break;s?n.key=le.ESC+"[1;"+(s+1)+"C":t?n.key=le.ESC+"OC":n.key=le.ESC+"[C";break;case 38:if(e.metaKey)break;s?n.key=le.ESC+"[1;"+(s+1)+"A":t?n.key=le.ESC+"OA":n.key=le.ESC+"[A";break;case 40:if(e.metaKey)break;s?n.key=le.ESC+"[1;"+(s+1)+"B":t?n.key=le.ESC+"OB":n.key=le.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(n.key=le.ESC+"[2~");break;case 46:s?n.key=le.ESC+"[3;"+(s+1)+"~":n.key=le.ESC+"[3~";break;case 36:s?n.key=le.ESC+"[1;"+(s+1)+"H":t?n.key=le.ESC+"OH":n.key=le.ESC+"[H";break;case 35:s?n.key=le.ESC+"[1;"+(s+1)+"F":t?n.key=le.ESC+"OF":n.key=le.ESC+"[F";break;case 33:e.shiftKey?n.type=2:e.ctrlKey?n.key=le.ESC+"[5;"+(s+1)+"~":n.key=le.ESC+"[5~";break;case 34:e.shiftKey?n.type=3:e.ctrlKey?n.key=le.ESC+"[6;"+(s+1)+"~":n.key=le.ESC+"[6~";break;case 112:s?n.key=le.ESC+"[1;"+(s+1)+"P":n.key=le.ESC+"OP";break;case 113:s?n.key=le.ESC+"[1;"+(s+1)+"Q":n.key=le.ESC+"OQ";break;case 114:s?n.key=le.ESC+"[1;"+(s+1)+"R":n.key=le.ESC+"OR";break;case 115:s?n.key=le.ESC+"[1;"+(s+1)+"S":n.key=le.ESC+"OS";break;case 116:s?n.key=le.ESC+"[15;"+(s+1)+"~":n.key=le.ESC+"[15~";break;case 117:s?n.key=le.ESC+"[17;"+(s+1)+"~":n.key=le.ESC+"[17~";break;case 118:s?n.key=le.ESC+"[18;"+(s+1)+"~":n.key=le.ESC+"[18~";break;case 119:s?n.key=le.ESC+"[19;"+(s+1)+"~":n.key=le.ESC+"[19~";break;case 120:s?n.key=le.ESC+"[20;"+(s+1)+"~":n.key=le.ESC+"[20~";break;case 121:s?n.key=le.ESC+"[21;"+(s+1)+"~":n.key=le.ESC+"[21~";break;case 122:s?n.key=le.ESC+"[23;"+(s+1)+"~":n.key=le.ESC+"[23~";break;case 123:s?n.key=le.ESC+"[24;"+(s+1)+"~":n.key=le.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?n.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?n.key=le.NUL:e.keyCode>=51&&e.keyCode<=55?n.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?n.key=le.DEL:e.keyCode===219?n.key=le.ESC:e.keyCode===220?n.key=le.FS:e.keyCode===221&&(n.key=le.GS);else if((!r||i)&&e.altKey&&!e.metaKey){let l=(a=G7[e.keyCode])==null?void 0:a[e.shiftKey?1:0];if(l)n.key=le.ESC+l;else if(e.keyCode>=65&&e.keyCode<=90){let u=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(u);e.shiftKey&&(h=h.toUpperCase()),n.key=le.ESC+h}else if(e.keyCode===32)n.key=le.ESC+(e.ctrlKey?le.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let u=e.code.slice(3,4);e.shiftKey||(u=u.toLowerCase()),n.key=le.ESC+u,n.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(n.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?n.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(n.key=le.US),e.key==="@"&&(n.key=le.NUL));break}return n}var qt=0,K7=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Ld,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Ld,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((n,s)=>this._getKey(n)-this._getKey(s)),t=0,r=0,i=new Array(this._array.length+this._insertedValues.length);for(let n=0;n<i.length;n++)r>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(i[n]=e[t],t++):i[n]=this._array[r++];this._array=i,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(qt=this._search(t),qt===-1)||this._getKey(this._array[qt])!==t)return!1;do if(this._array[qt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(qt),!0;while(++qt<this._array.length&&this._getKey(this._array[qt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((n,s)=>n-s),t=0,r=new Array(this._array.length-e.length),i=0;for(let n=0;n<this._array.length;n++)e[t]===n?t++:r[i++]=this._array[n];this._array=r,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(qt=this._search(e),!(qt<0||qt>=this._array.length)&&this._getKey(this._array[qt])===e))do yield this._array[qt];while(++qt<this._array.length&&this._getKey(this._array[qt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(qt=this._search(e),!(qt<0||qt>=this._array.length)&&this._getKey(this._array[qt])===e))do t(this._array[qt]);while(++qt<this._array.length&&this._getKey(this._array[qt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,r=this._array.length-1;for(;r>=t;){let i=t+r>>1,n=this._getKey(this._array[i]);if(n>e)r=i-1;else if(n<e)t=i+1;else{for(;i>0&&this._getKey(this._array[i-1])===e;)i--;return i}}return t}},Dg=0,Gb=0,X7=class extends Qe{constructor(){super(),this._decorations=new K7(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new _e),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new _e),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(At(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new Q7(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),i=t.onDispose(()=>{i.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let i=0,n=0;for(let s of this._decorations.getKeyIterator(t))i=s.options.x??0,n=i+(s.options.width??1),e>=i&&e<n&&(!r||(s.options.layer??"bottom")===r)&&(yield s)}forEachDecorationAtCell(e,t,r,i){this._decorations.forEachByKey(t,n=>{Dg=n.options.x??0,Gb=Dg+(n.options.width??1),e>=Dg&&e<Gb&&(!r||(n.options.layer??"bottom")===r)&&i(n)})}},Q7=class extends Fs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new _e),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new _e),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=$t.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=$t.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Z7=1e3,J7=class{constructor(e,t=Z7){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let i=performance.now();if(i-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let n=i-this._lastRefreshMs,s=this._debounceThresholdMS-n;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},s)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Yb=20,Rd=class extends Qe{constructor(e,t,r,i){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=i,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let n=this._coreBrowserService.mainDocument;this._accessibilityContainer=n.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=n.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let s=0;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);if(this._topBoundaryFocusListener=s=>this._handleBoundaryFocus(s,0),this._bottomBoundaryFocusListener=s=>this._handleBoundaryFocus(s,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=n.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new J7(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(s=>this._handleResize(s.rows))),this._register(this._terminal.onRender(s=>this._refreshRows(s.start,s.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(s=>this._handleChar(s))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
464
|
+
`))),this._register(this._terminal.onA11yTab(s=>this._handleTab(s))),this._register(this._terminal.onKey(s=>this._handleKey(s.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ge(n,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(At(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Yb+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
465
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Yb+1&&(this._liveRegion.textContent+=Pm.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,i=r.lines.length.toString();for(let n=e;n<=t;n++){let s=r.lines.get(r.ydisp+n),a=[],l=(s==null?void 0:s.translateToString(!0,void 0,void 0,a))||"",u=(r.ydisp+n+1).toString(),h=this._rowElements[n];h&&(l.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=l,this._rowColumns.set(h,a)),h.setAttribute("aria-posinset",u),h.setAttribute("aria-setsize",i),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,i=this._rowElements[t===0?1:this._rowElements.length-2],n=r.getAttribute("aria-posinset"),s=t===0?"1":`${this._terminal.buffer.lines.length}`;if(n===s||e.relatedTarget!==i)return;let a,l;if(t===0?(a=r,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(a=this._rowElements.shift(),l=r,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let u=this._createAccessibilityTreeNode();this._rowElements.unshift(u),this._rowContainer.insertAdjacentElement("afterbegin",u)}else{let u=this._createAccessibilityTreeNode();this._rowElements.push(u),this._rowContainer.appendChild(u)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var l;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let i=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(i)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:i,offset:((l=i.textContent)==null?void 0:l.length)??0}),!this._rowContainer.contains(r.node))return;let n=({node:u,offset:h})=>{let d=u instanceof Text?u.parentNode:u,p=parseInt(d==null?void 0:d.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let m=this._rowColumns.get(d);if(!m)return console.warn("columns is null. Race condition?"),null;let y=h<m.length?m[h]:m.slice(-1)[0]+1;return y>=this._terminal.cols&&(++p,y=0),{row:p,column:y}},s=n(t),a=n(r);if(!(!s||!a)){if(s.row>a.row||s.row===a.row&&s.column>=a.column)throw new Error("invalid range");this._terminal.select(s.column,s.row,(a.row-s.row)*this._terminal.cols-s.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var n,s;e.style.transform="";let t=e.getBoundingClientRect().width,r=(s=(n=this._rowColumns.get(e))==null?void 0:n.slice(-1))==null?void 0:s[0];if(!r)return;let i=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${i/t})`}};Rd=Ft([be(1,S0),be(2,ns),be(3,ss)],Rd);var gy=class extends Qe{constructor(e,t,r,i,n){super(),this._element=e,this._mouseService=t,this._renderService=r,this._bufferService=i,this._linkProviderService=n,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new _e),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new _e),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(At(()=>{var s;Oo(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(s=this._activeProviderReplies)==null||s.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ge(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ge(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ge(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ge(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let i=0;i<r.length;i++){let n=r[i];if(n.classList.contains("xterm"))break;if(n.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var i,n;(!this._activeProviderReplies||!t)&&((i=this._activeProviderReplies)==null||i.forEach(s=>{s==null||s.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[s,a]of this._linkProviderService.linkProviders.entries())t?(n=this._activeProviderReplies)!=null&&n.get(s)&&(r=this._checkLinkProviderResult(s,e,r)):a.provideLinks(e.y,l=>{var h,d;if(this._isMouseOut)return;let u=l==null?void 0:l.map(p=>({link:p}));(h=this._activeProviderReplies)==null||h.set(s,u),r=this._checkLinkProviderResult(s,e,r),((d=this._activeProviderReplies)==null?void 0:d.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let i=0;i<t.size;i++){let n=t.get(i);if(n)for(let s=0;s<n.length;s++){let a=n[s],l=a.link.range.start.y<e?0:a.link.range.start.x,u=a.link.range.end.y>e?this._bufferService.cols:a.link.range.end.x;for(let h=l;h<=u;h++){if(r.has(h)){n.splice(s--,1);break}r.add(h)}}}}_checkLinkProviderResult(e,t,r){var s;if(!this._activeProviderReplies)return r;let i=this._activeProviderReplies.get(e),n=!1;for(let a=0;a<e;a++)(!this._activeProviderReplies.has(a)||this._activeProviderReplies.get(a))&&(n=!0);if(!n&&i){let a=i.find(l=>this._linkAtPosition(l.link,t));a&&(r=!0,this._handleNewLink(a))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let a=0;a<this._activeProviderReplies.size;a++){let l=(s=this._activeProviderReplies.get(a))==null?void 0:s.find(u=>this._linkAtPosition(u.link,t));if(l){r=!0,this._handleNewLink(l);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&eq(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Oo(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var r,i;return(i=(r=this._currentLink)==null?void 0:r.state)==null?void 0:i.decorations.pointerCursor},set:r=>{var i;(i=this._currentLink)!=null&&i.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,i;return(i=(r=this._currentLink)==null?void 0:r.state)==null?void 0:i.decorations.underline},set:r=>{var i,n,s;(i=this._currentLink)!=null&&i.state&&((s=(n=this._currentLink)==null?void 0:n.state)==null?void 0:s.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let i=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(i,n),this._lastMouseEvent)){let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._askForLink(s,!1)}})))}_linkHover(e,t,r){var i;(i=this._currentLink)!=null&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,i=this._bufferService.buffer.ydisp,n=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-i-1,r.end.x,r.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(n)}_linkLeave(e,t,r){var i;(i=this._currentLink)!=null&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,n=t.y*this._bufferService.cols+t.x;return r<=n&&n<=i}_positionFromMouseEvent(e,t,r){let i=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,i,n){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:n}}};gy=Ft([be(1,w0),be(2,ss),be(3,Qr),be(4,OE)],gy);function eq(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var tq=class extends V7{constructor(e={}){super(e),this._linkifier=this._register(new Wa),this.browser=iB,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Wa),this._onCursorMove=this._register(new _e),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new _e),this.onKey=this._onKey.event,this._onRender=this._register(new _e),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new _e),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new _e),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new _e),this.onBell=this._onBell.event,this._onFocus=this._register(new _e),this._onBlur=this._register(new _e),this._onA11yCharEmitter=this._register(new _e),this._onA11yTabEmitter=this._register(new _e),this._onWillOpen=this._register(new _e),this._setup(),this._decorationService=this._instantiationService.createInstance(X7),this._instantiationService.setService(Vc,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(q9),this._instantiationService.setService(OE,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance($m)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Cr.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Cr.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Cr.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Cr.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(At(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let r,i="";switch(t.index){case 256:r="foreground",i="10";break;case 257:r="background",i="11";break;case 258:r="cursor",i="12";break;default:r="ansi",i="4;"+t.index}switch(t.type){case 0:let n=Tt.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${le.ESC}]${i};${F7(n)}${tB.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(s=>s.ansi[t.index]=Zt.toColor(...t.color));else{let s=r;this._themeService.modifyColors(a=>a[s]=Zt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Rd,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),i=this._renderService.dimensions.css.cell.height,n=t.getWidth(r),s=this._renderService.dimensions.css.cell.width*n,a=this.buffer.y*this._renderService.dimensions.css.cell.height,l=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=l+"px",this.textarea.style.top=a+"px",this.textarea.style.width=s+"px",this.textarea.style.height=i+"px",this.textarea.style.lineHeight=i+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ge(this.element,"copy",t=>{this.hasSelection()&&sH(t,this._selectionService)}));let e=t=>oH(t,this.textarea,this.coreService,this.optionsService);this._register(Ge(this.textarea,"paste",e)),this._register(Ge(this.element,"paste",e)),nB?this._register(Ge(this.element,"mousedown",t=>{t.button===2&&nb(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ge(this.element,"contextmenu",t=>{nb(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),R0&&this._register(Ge(this.element,"auxclick",t=>{t.button===1&&ME(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ge(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ge(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ge(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ge(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ge(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ge(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ge(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var n;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((n=this.element)==null?void 0:n.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ge(this.screenElement,"mousemove",s=>this.updateCursorStyle(s))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Dm.get()),aB||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(W9,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(ns,this._coreBrowserService),this._register(Ge(this.textarea,"focus",s=>this._handleTextAreaFocus(s))),this._register(Ge(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(iy,this._document,this._helperContainer),this._instantiationService.setService(lf,this._charSizeService),this._themeService=this._instantiationService.createInstance(ay),this._instantiationService.setService(Ka,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Bd),this._instantiationService.setService(jE,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(sy,this.rows,this.screenElement)),this._instantiationService.setService(ss,this._renderService),this._register(this._renderService.onRenderedViewportChange(s=>this._onRender.fire(s))),this.onResize(s=>this._renderService.resize(s.cols,s.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(ey,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(ny),this._instantiationService.setService(w0,this._mouseService);let i=this._linkifier.value=this._register(this._instantiationService.createInstance(gy,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(Zm,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(s=>{super.scrollLines(s,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(oy,this.element,this.screenElement,i)),this._instantiationService.setService(pH,this._selectionService),this._register(this._selectionService.onRequestScrollLines(s=>this.scrollLines(s.amount,s.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(s=>this._renderService.handleSelectionChanged(s.start,s.end,s.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(s=>{this.textarea.value=s,this.textarea.focus(),this.textarea.select()})),this._register(Cr.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var s;this._selectionService.refresh(),(s=this._viewport)==null||s.queueSync()})),this._register(this._instantiationService.createInstance(Jm,this.screenElement)),this._register(Ge(this.element,"mousedown",s=>this._selectionService.handleMouseDown(s))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Rd,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",s=>this._handleScreenReaderModeOptionChange(s))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ed,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",s=>{!this._overviewRulerRenderer&&s&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ed,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(ry,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(s){var h,d,p,m,y;let a=e._mouseService.getMouseReportCoords(s,e.screenElement);if(!a)return!1;let l,u;switch(s.overrideType||s.type){case"mousemove":u=32,s.buttons===void 0?(l=3,s.button!==void 0&&(l=s.button<3?s.button:3)):l=s.buttons&1?0:s.buttons&4?1:s.buttons&2?2:3;break;case"mouseup":u=0,l=s.button<3?s.button:3;break;case"mousedown":u=1,l=s.button<3?s.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(s)===!1)return!1;let x=s.deltaY;if(x===0||e.coreMouseService.consumeWheelEvent(s,(m=(p=(d=(h=e._renderService)==null?void 0:h.dimensions)==null?void 0:d.device)==null?void 0:p.cell)==null?void 0:m.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;u=x<0?0:1,l=4;break;default:return!1}return u===void 0||l===void 0||l>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:l,action:u,ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey})}let i={mouseup:null,wheel:null,mousedrag:null,mousemove:null},n={mouseup:s=>(r(s),s.buttons||(this._document.removeEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.removeEventListener("mousemove",i.mousedrag)),this.cancel(s)),wheel:s=>(r(s),this.cancel(s,!0)),mousedrag:s=>{s.buttons&&r(s)},mousemove:s=>{s.buttons||r(s)}};this._register(this.coreMouseService.onProtocolChange(s=>{s?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(s)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),s&8?i.mousemove||(t.addEventListener("mousemove",n.mousemove),i.mousemove=n.mousemove):(t.removeEventListener("mousemove",i.mousemove),i.mousemove=null),s&16?i.wheel||(t.addEventListener("wheel",n.wheel,{passive:!1}),i.wheel=n.wheel):(t.removeEventListener("wheel",i.wheel),i.wheel=null),s&2?i.mouseup||(i.mouseup=n.mouseup):(this._document.removeEventListener("mouseup",i.mouseup),i.mouseup=null),s&4?i.mousedrag||(i.mousedrag=n.mousedrag):(this._document.removeEventListener("mousemove",i.mousedrag),i.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ge(t,"mousedown",s=>{if(s.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(s)))return r(s),i.mouseup&&this._document.addEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.addEventListener("mousemove",i.mousedrag),this.cancel(s)})),this._register(Ge(t,"wheel",s=>{var a,l,u,h,d;if(!i.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(s)===!1)return!1;if(!this.buffer.hasScrollback){if(s.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(s,(h=(u=(l=(a=e._renderService)==null?void 0:a.dimensions)==null?void 0:l.device)==null?void 0:u.cell)==null?void 0:h.height,(d=e._coreBrowserService)==null?void 0:d.dpr)===0)return this.cancel(s,!0);let p=le.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(s.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(p,!0),this.cancel(s,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){BE(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,r){this._selectionService.setSelection(e,t,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var r;(r=this._selectionService)==null||r.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=Y7(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let i=this.rows-1;return this.scrollLines(r.type===2?-i:i),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((r.key===le.ETX||r.key===le.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(rq(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var r;(r=this._charSizeService)==null||r.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Xt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(le.ESC+"[I"):this.coreService.triggerDataEvent(le.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${le.ESC}[4;${r};${t}t`);break;case 1:let i=this._renderService.dimensions.css.cell.width.toFixed(0),n=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${le.ESC}[6;${n};${i}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function rq(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var iq=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},nq=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Ni)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},Kb=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new nq(t)}getNullCell(){return new Ni}},sq=class extends Qe{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new _e),this.onBufferChange=this._onBufferChange.event,this._normal=new Kb(this._core.buffers.normal,"normal"),this._alternate=new Kb(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},oq=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,i)=>t(r,i.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},aq=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},lq=["cols","rows"],bn=0,cq=class extends Qe{constructor(e){super(),this._core=this._register(new tq(e)),this._addonManager=this._register(new iq),this._publicOptions={...this._core.options};let t=i=>this._core.options[i],r=(i,n)=>{this._checkReadonlyOptions(i),this._core.options[i]=n};for(let i in this._core.options){let n={get:t.bind(this,i),set:r.bind(this,i)};Object.defineProperty(this._publicOptions,i,n)}}_checkReadonlyOptions(e){if(lq.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new oq(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new aq(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new sq(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
466
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Dm.get()},set promptLabel(e){Dm.set(e)},get tooMuchOutput(){return Pm.get()},set tooMuchOutput(e){Pm.set(e)}}}_verifyIntegers(...e){for(bn of e)if(bn===1/0||isNaN(bn)||bn%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(bn of e)if(bn&&(bn===1/0||isNaN(bn)||bn%1!==0||bn<0))throw new Error("This API only accepts positive integers")}};/**
|
|
467
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
468
|
+
* @license MIT
|
|
469
|
+
*
|
|
470
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
471
|
+
* @license MIT
|
|
472
|
+
*
|
|
473
|
+
* Originally forked from (with the author's permission):
|
|
474
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
475
|
+
* http://bellard.org/jslinux/
|
|
476
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
477
|
+
*/var hq=2,uq=1,dq=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var p;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((p=this._terminal.options.overviewRuler)==null?void 0:p.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),n=Math.max(0,parseInt(r.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),a={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},l=a.top+a.bottom,u=a.right+a.left,h=i-l,d=n-u-t;return{cols:Math.max(hq,Math.floor(d/e.css.cell.width)),rows:Math.max(uq,Math.floor(h/e.css.cell.height))}}};/**
|
|
478
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
479
|
+
* @license MIT
|
|
480
|
+
*
|
|
481
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
482
|
+
* @license MIT
|
|
483
|
+
*
|
|
484
|
+
* Originally forked from (with the author's permission):
|
|
485
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
486
|
+
* http://bellard.org/jslinux/
|
|
487
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
488
|
+
*/var fq=class{constructor(e,t,r,i={}){this._terminal=e,this._regex=t,this._handler=r,this._options=i}provideLinks(e,t){let r=gq.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(r))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(r,i)=>{if(this._options.hover){let{range:n}=t;this._options.hover(r,i,n)}},t))}};function pq(e){try{let t=new URL(e),r=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch{return!1}}var gq=class Wu{static computeLink(t,r,i,n){let s=new RegExp(r.source,(r.flags||"")+"g"),[a,l]=Wu._getWindowedLineStrings(t-1,i),u=a.join(""),h,d=[];for(;h=s.exec(u);){let p=h[0];if(!pq(p))continue;let[m,y]=Wu._mapStrIdx(i,l,0,h.index),[x,v]=Wu._mapStrIdx(i,m,y,p.length);if(m===-1||y===-1||x===-1||v===-1)continue;let S={start:{x:y+1,y:m+1},end:{x:v,y:x+1}};d.push({range:S,text:p,activate:n})}return d}static _getWindowedLineStrings(t,r){let i,n=t,s=t,a=0,l="",u=[];if(i=r.buffer.active.getLine(t)){let h=i.translateToString(!0);if(i.isWrapped&&h[0]!==" "){for(a=0;(i=r.buffer.active.getLine(--n))&&a<2048&&(l=i.translateToString(!0),a+=l.length,u.push(l),!(!i.isWrapped||l.indexOf(" ")!==-1)););u.reverse()}for(u.push(h),a=0;(i=r.buffer.active.getLine(++s))&&i.isWrapped&&a<2048&&(l=i.translateToString(!0),a+=l.length,u.push(l),l.indexOf(" ")===-1););}return[u,n]}static _mapStrIdx(t,r,i,n){let s=t.buffer.active,a=s.getNullCell(),l=i;for(;n;){let u=s.getLine(r);if(!u)return[-1,-1];for(let h=l;h<u.length;++h){u.getCell(h,a);let d=a.getChars();if(a.getWidth()&&(n-=d.length||1,h===u.length-1&&d==="")){let p=s.getLine(r+1);p&&p.isWrapped&&(p.getCell(0,a),a.getWidth()===2&&(n+=1))}if(n<0)return[r,h]}r++,l=0}return[r,l]}},mq=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function yq(e,t){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var _q=class{constructor(e=yq,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,r=t.urlRegex||mq;this._linkProvider=this._terminal.registerLinkProvider(new fq(this._terminal,r,this._handler,t))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};const xq="http://localhost:3456",vq="ws://localhost:3456";function Hu(e,t=NW){var a;if(!((a=e==null?void 0:e.buffer)!=null&&a.active))return"";const r=e.buffer.active,i=r.length,n=Math.max(0,i-t),s=[];for(let l=n;l<i;l++){const u=r.getLine(l);u&&s.push(u.translateToString(!0))}for(;s.length&&!s[s.length-1].trim();)s.pop();return s.join(`
|
|
489
|
+
`)}function yB({data:e,sendEvent:t,onSendToChat:r,embedded:i,sessionId:n,onSessionReady:s,onTerminalReady:a}){const{theme:l}=Bt(),u=M.useMemo(()=>Sq(l),[l]),h=M.useRef(null),d=M.useRef(null),p=M.useRef(null),m=M.useRef(null),[y,x]=M.useState(!1),[v,S]=M.useState(n||null);M.useEffect(()=>{if(n){S(n);return}let L=!1;async function k(){var A,z,U,q,H,Y;try{const O=await(await fetch(`${xq}/api/pty/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e==null?void 0:e.cwd,cols:((U=(z=(A=p.current)==null?void 0:A.proposeDimensions)==null?void 0:z.call(A))==null?void 0:U.cols)||120,rows:((Y=(H=(q=p.current)==null?void 0:q.proposeDimensions)==null?void 0:H.call(q))==null?void 0:Y.rows)||30})})).json();!L&&O.sessionId&&(S(O.sessionId),s&&s(O.sessionId))}catch{}}return k(),()=>{L=!0}},[e==null?void 0:e.cwd,n,s]),M.useEffect(()=>{if(!h.current)return;const L=new cq({cursorBlink:!0,cursorStyle:"bar",fontSize:14,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',lineHeight:1.4,theme:{background:l.bgPrimary,foreground:l.textBright||"#c9d1d9",cursor:l.accent||"#58a6ff",cursorAccent:l.bgPrimary,selectionBackground:(l.accent||"#58a6ff")+"40",black:"#484f58",red:l.error||"#f85149",green:l.success||"#3fb950",yellow:l.warning||"#d29922",blue:l.accent||"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:l.textPrimary||"#c9d1d9",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},allowTransparency:!1,scrollback:5e3}),k=new dq,A=new _q;L.loadAddon(k),L.loadAddon(A),L.open(h.current),k.fit(),d.current=L,p.current=k,a&&a(L);const z=new ResizeObserver(()=>{try{k.fit()}catch{}});return z.observe(h.current),()=>{z.disconnect(),L.dispose(),d.current=null,p.current=null}},[l]),M.useEffect(()=>{if(!v||!d.current)return;const L=d.current,k=new WebSocket(`${vq}/ws/terminal/${v}`);m.current=k,k.onopen=()=>{if(x(!0),p.current){const U=p.current.proposeDimensions();U&&k.send(JSON.stringify({type:"resize",cols:U.cols,rows:U.rows}))}},k.onmessage=U=>{try{const q=JSON.parse(U.data);q.type==="data"?L.write(q.data):q.type==="exit"&&(L.writeln(`\r
|
|
490
|
+
\x1B[90m[Process exited with code ${q.exitCode}]\x1B[0m`),x(!1))}catch{}},k.onclose=()=>x(!1),k.onerror=()=>x(!1);const A=L.onData(U=>{k.readyState===WebSocket.OPEN&&k.send(JSON.stringify({type:"input",data:U}))}),z=L.onResize(({cols:U,rows:q})=>{k.readyState===WebSocket.OPEN&&k.send(JSON.stringify({type:"resize",cols:U,rows:q}))});return()=>{A.dispose(),z.dispose(),k.close(),m.current=null,x(!1)}},[v]),M.useCallback(()=>{if(p.current)try{p.current.fit()}catch{}},[]);const C=M.useCallback(()=>{if(!d.current)return;const L=Hu(d.current);if(L.trim()){if(r){const k=`**Terminal Output**
|
|
491
|
+
\`\`\`
|
|
492
|
+
${L}
|
|
493
|
+
\`\`\``;r(k)}t&&t("event:terminal-share",{sessionId:v,output:L,lineCount:L.split(`
|
|
494
|
+
`).length})}},[v,r,t]);if(i)return g.jsxs("div",{style:u.embeddedContainer,children:[g.jsxs("div",{style:u.terminalHeader,children:[g.jsxs("div",{style:u.terminalDots,children:[g.jsx("span",{style:{...u.dot,backgroundColor:l.error}}),g.jsx("span",{style:{...u.dot,backgroundColor:l.warning}}),g.jsx("span",{style:{...u.dot,backgroundColor:l.success}})]}),g.jsx("span",{style:u.terminalTitle,children:"Terminal"}),r&&y&&g.jsx("button",{onClick:C,style:u.sendToChatBtn,children:"Send to Chat"}),g.jsx("span",{style:{...u.statusDot,backgroundColor:y?l.success:l.textMuted}})]}),g.jsx("div",{ref:h,style:u.terminalBody})]});if(!e&&!n)return g.jsxs("div",{style:u.empty,children:[g.jsx("div",{style:u.emptyIcon,children:">_"}),g.jsx("p",{style:u.emptyTitle,children:"Interactive Terminal"}),g.jsx("p",{style:u.emptySubtext,children:"A real terminal with full shell access will appear here during lessons."})]});const B=(e==null?void 0:e.validations)||[],R=B.filter(L=>L.passed).length,E=B.length>0&&R===B.length;return g.jsxs("div",{style:u.container,children:[(e==null?void 0:e.task)&&g.jsxs("div",{style:u.taskPanel,children:[g.jsxs("div",{style:u.taskHeader,children:[g.jsx("span",{style:u.taskLabel,children:"Task"}),e.module&&g.jsx("span",{style:u.moduleBadge,children:e.module}),B.length>0&&g.jsxs("span",{style:{...u.progressBadge,color:E?l.success:l.warning},children:[R,"/",B.length]})]}),g.jsx("p",{style:u.taskText,children:e.task}),B.length>0&&g.jsx("div",{style:u.validations,children:B.map((L,k)=>g.jsxs("div",{style:u.validationRow,children:[g.jsx("span",{style:{...u.validationCheck,color:L.passed?l.success:l.textMuted},children:L.passed?"✓":"○"}),g.jsx("span",{style:{...u.validationLabel,color:L.passed?l.textSecondary:l.textPrimary,textDecoration:L.passed?"line-through":"none"},children:L.label})]},k))}),e.hints&&e.hints.length>0&&g.jsx(bq,{hints:e.hints,theme:l,s:u})]}),g.jsxs("div",{style:u.terminalArea,children:[g.jsxs("div",{style:u.terminalHeader,children:[g.jsxs("div",{style:u.terminalDots,children:[g.jsx("span",{style:{...u.dot,backgroundColor:l.error}}),g.jsx("span",{style:{...u.dot,backgroundColor:l.warning}}),g.jsx("span",{style:{...u.dot,backgroundColor:l.success}})]}),g.jsx("span",{style:u.terminalTitle,children:"Terminal"}),r&&y&&g.jsx("button",{onClick:C,style:u.sendToChatBtn,children:"Send to Chat"}),g.jsx("span",{style:{...u.statusDot,backgroundColor:y?l.success:l.textMuted}})]}),g.jsx("div",{ref:h,style:u.terminalBody})]})]})}function bq({hints:e,theme:t,s:r}){const[i,n]=M.useState(!1),[s,a]=M.useState(0);return g.jsx("div",{style:r.hintSection,children:i?g.jsxs("div",{children:[g.jsx("p",{style:r.hintText,children:e[s]}),g.jsx("div",{style:r.hintNav,children:s<e.length-1&&g.jsxs("button",{onClick:()=>a(l=>l+1),style:r.hintButton,children:["Next hint (",s+1,"/",e.length,")"]})})]}):g.jsx("button",{onClick:()=>n(!0),style:r.hintButton,children:"Show hint"})})}function Sq(e){return{container:{display:"flex",flexDirection:"column",gap:0,maxWidth:900,margin:"0 auto",border:`1px solid ${e.border}`,borderRadius:12,overflow:"hidden",height:"calc(100vh - 120px)"},embeddedContainer:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},taskPanel:{padding:"16px 20px",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.border}`,flexShrink:0},taskHeader:{display:"flex",alignItems:"center",gap:10,marginBottom:8},taskLabel:{fontSize:11,fontWeight:700,color:e.accent,textTransform:"uppercase",letterSpacing:"0.08em"},moduleBadge:{fontSize:11,color:e.textSecondary,backgroundColor:e.bgTertiary,padding:"2px 8px",borderRadius:8},progressBadge:{fontSize:11,fontWeight:600,marginLeft:"auto"},taskText:{fontSize:14,lineHeight:1.6,color:e.textBright,margin:0},validations:{marginTop:12,display:"flex",flexDirection:"column",gap:4},validationRow:{display:"flex",alignItems:"center",gap:8},validationCheck:{fontSize:14,fontWeight:700,width:18,textAlign:"center"},validationLabel:{fontSize:13},hintSection:{marginTop:10},hintButton:{fontSize:12,color:e.warning,backgroundColor:"transparent",border:`1px solid ${e.warning}40`,borderRadius:6,padding:"4px 10px",cursor:"pointer"},hintText:{fontSize:13,color:e.warning,margin:"6px 0",lineHeight:1.5},hintNav:{display:"flex",gap:8},terminalArea:{flex:1,display:"flex",flexDirection:"column",backgroundColor:e.bgPrimary,overflow:"hidden"},terminalHeader:{display:"flex",alignItems:"center",gap:10,padding:"8px 14px",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.bgTertiary}`,flexShrink:0},terminalDots:{display:"flex",gap:6},dot:{width:10,height:10,borderRadius:"50%"},terminalTitle:{fontSize:12,color:e.textMuted,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace'},sendToChatBtn:{fontSize:11,color:e.accent,backgroundColor:"transparent",border:`1px solid ${e.accent}40`,borderRadius:4,padding:"2px 8px",cursor:"pointer",marginLeft:"auto",whiteSpace:"nowrap"},statusDot:{width:6,height:6,borderRadius:"50%"},terminalBody:{flex:1,padding:"4px 8px",overflow:"hidden"},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',color:e.success},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0}}}const wq=M.lazy(()=>lt(()=>import("./index-BSswTuBk.js"),[])),Xb="http://localhost:3456";function Cq({data:e,sendEvent:t,onSendToChat:r}){const{theme:i}=Bt(),n=M.useMemo(()=>Tq(i),[i]),[s,a]=M.useState(null),[l,u]=M.useState(0),[h,d]=M.useState([]),[p,m]=M.useState([]),[y,x]=M.useState(50),[v,S]=M.useState(!1),C=M.useRef(null),B=M.useRef(null),R=M.useCallback($=>{B.current=$},[]),E=M.useCallback($=>{const j=B.current?Hu(B.current):"",W=h.filter(I=>I.modified).map(I=>I.name),P=p.filter(I=>I.passed).length;let ee=`${$?"**Workshop Complete**":"**Workshop Progress**"}
|
|
495
|
+
Task: ${(e==null?void 0:e.task)||"N/A"}
|
|
496
|
+
Validations: ${P}/${p.length} passed`;return W.length>0&&(ee+=`
|
|
497
|
+
Files: ${W.join(", ")}`),j.trim()&&(ee+=`
|
|
498
|
+
|
|
499
|
+
\`\`\`terminal
|
|
500
|
+
${j}
|
|
501
|
+
\`\`\``),ee},[h,p,e==null?void 0:e.task]),L=M.useCallback(()=>{const $=E(!0);if(r&&r($),t){const j=B.current?Hu(B.current):"";t("event:workshop-done",{sessionId:s,completed:!0,task:e==null?void 0:e.task,validations:p.map(W=>({label:W.label,passed:W.passed})),files:h.filter(W=>W.modified).map(W=>W.name),output:j})}},[E,r,t,s,e==null?void 0:e.task,p,h]),k=M.useCallback(()=>{const $=E(!1);if(r&&r($),t){const j=B.current?Hu(B.current):"";t("event:workshop-done",{sessionId:s,completed:!1,task:e==null?void 0:e.task,validations:p.map(W=>({label:W.label,passed:W.passed})),files:h.filter(W=>W.modified).map(W=>W.name),output:j})}},[E,r,t,s,e==null?void 0:e.task,p,h]);M.useEffect(()=>{if(!e)return;d((e.files||[]).map(j=>({...j,modified:!1,savedContent:j.content}))),m((e.validations||[]).map(j=>({...j,passed:!1}))),u(0),a(null);async function $(){try{const W=await(await fetch(`${Xb}/api/workshop/setup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e.cwd,files:e.files,setup:e.setup})})).json();W.sessionId&&a(W.sessionId)}catch{}}$()},[e]),M.useEffect(()=>{e!=null&&e.validations&&m(e.validations.map($=>({...$})))},[e==null?void 0:e.validations]);const A=M.useCallback($=>{d(j=>j.map((W,P)=>P===l?{...W,content:$||"",modified:!0}:W))},[l]),z=M.useCallback(async()=>{const $=h[l];if(!(!$||!s))try{await fetch(`${Xb}/api/workshop/setup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:null,files:[{name:$.name,content:$.content}]})}),d(j=>j.map((W,P)=>P===l?{...W,modified:!1,savedContent:W.content}:W)),t("event:file-save",{file:$.name,sessionId:s})}catch{}},[h,l,s,t]);M.useEffect(()=>{const $=j=>{(j.metaKey||j.ctrlKey)&&j.key==="s"&&(j.preventDefault(),z())};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[z]);const U=M.useCallback($=>{$.preventDefault(),S(!0),document.body.style.cursor="col-resize",document.body.style.userSelect="none";const j=P=>{if(!C.current)return;const Z=C.current.getBoundingClientRect(),ee=(P.clientX-Z.left)/Z.width*100;x(Math.min(Math.max(ee,20),80))},W=()=>{S(!1),document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",W)};window.addEventListener("mousemove",j),window.addEventListener("mouseup",W)},[]),q=h[l],H=q&&({bash:"shell",sh:"shell",js:"javascript",py:"python",ts:"typescript"}[q.language]||q.language)||"javascript",Y=i.id==="light"?"light":"vs-dark",F=p.filter($=>$.passed).length,O=p.length>0&&F===p.length;return e?g.jsxs("div",{style:n.container,children:[g.jsxs("div",{style:n.taskBar,children:[g.jsxs("div",{style:n.taskBarLeft,children:[g.jsx("span",{style:n.taskLabel,children:"Workshop"}),e.module&&g.jsx("span",{style:n.moduleBadge,children:e.module})]}),g.jsx("p",{style:n.taskText,children:e.task}),g.jsxs("div",{style:n.taskBarRight,children:[p.length>0&&g.jsx("div",{style:n.validationRow,children:p.map(($,j)=>g.jsxs("span",{style:{...n.validationPill,backgroundColor:$.passed?i.success+"20":i.bgTertiary,color:$.passed?i.success:i.textSecondary,borderColor:$.passed?i.success+"40":i.border},children:[$.passed?"✓":"○"," ",$.label]},j))}),e.hints&&e.hints.length>0&&g.jsx(kq,{hints:e.hints,theme:i,s:n}),r&&g.jsx("button",{onClick:k,style:n.sendToChatBtn,children:"Send to Chat"}),O&&r&&g.jsx("button",{onClick:L,style:n.doneBtn,children:"Done"})]})]}),g.jsxs("div",{style:n.workspace,ref:C,children:[g.jsxs("div",{style:{...n.editorPane,width:`${y}%`},children:[h.length>1&&g.jsx("div",{style:n.fileTabs,children:h.map(($,j)=>g.jsxs("button",{onClick:()=>u(j),style:{...n.fileTab,backgroundColor:j===l?i.bgPrimary:"transparent",color:j===l?i.textBright:i.textSecondary,borderBottomColor:j===l?i.accent:"transparent"},children:[$.name,$.modified&&g.jsx("span",{style:n.modifiedDot,children:"●"})]},$.name))}),g.jsx("div",{style:n.editorBody,children:q&&g.jsx(M.Suspense,{fallback:g.jsx("div",{style:n.editorLoading,children:"Loading editor..."}),children:g.jsx(wq,{height:"100%",language:H,value:q.content,onChange:A,theme:Y,options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:8},renderLineHighlight:"none",overviewRulerBorder:!1,readOnly:q.readonly||!1,scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8}}})})}),g.jsxs("div",{style:n.editorFooter,children:[g.jsx("span",{style:n.footerLang,children:H}),(q==null?void 0:q.modified)&&g.jsxs("button",{onClick:z,style:n.saveButton,children:["Save (",navigator.platform.includes("Mac")?"⌘":"Ctrl","+S)"]}),(q==null?void 0:q.readonly)&&g.jsx("span",{style:n.readonlyBadge,children:"read-only"})]})]}),g.jsx("div",{style:{...n.resizeHandle,cursor:"col-resize"},onMouseDown:U,children:g.jsx("div",{style:n.resizeGrip})}),g.jsx("div",{style:{...n.terminalPane,width:`${100-y}%`},children:g.jsx(yB,{embedded:!0,sessionId:s,sendEvent:t,onSendToChat:r,onTerminalReady:R})})]})]}):g.jsxs("div",{style:n.empty,children:[g.jsx("div",{style:n.emptyIcon,children:"🛠"}),g.jsx("p",{style:n.emptyTitle,children:"Workshop"}),g.jsx("p",{style:n.emptySubtext,children:"Interactive coding workshops with editor + terminal will appear here."})]})}function kq({hints:e,theme:t,s:r}){const[i,n]=M.useState(!1),[s,a]=M.useState(0);return g.jsxs("div",{style:r.hintContainer,children:[g.jsx("button",{onClick:()=>n(!i),style:r.hintToggle,children:i?"Hide hints":"Show hint"}),i&&g.jsxs("div",{style:r.hintPopup,children:[g.jsx("p",{style:r.hintText,children:e[s]}),s<e.length-1&&g.jsxs("button",{onClick:()=>a(l=>l+1),style:r.hintNext,children:["Next hint (",s+1,"/",e.length,")"]})]})]})}function Tq(e){return{container:{display:"flex",flexDirection:"column",height:"calc(100vh - 80px)",overflow:"hidden",border:`1px solid ${e.border}`,borderRadius:12},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0},taskBar:{padding:"12px 20px",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.border}`,flexShrink:0,display:"flex",flexDirection:"column",gap:6},taskBarLeft:{display:"flex",alignItems:"center",gap:10},taskLabel:{fontSize:11,fontWeight:700,color:e.accent,textTransform:"uppercase",letterSpacing:"0.08em"},moduleBadge:{fontSize:11,color:e.textSecondary,backgroundColor:e.bgTertiary,padding:"2px 8px",borderRadius:8},taskText:{fontSize:14,lineHeight:1.5,color:e.textBright,margin:0},taskBarRight:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},validationRow:{display:"flex",gap:6,flexWrap:"wrap"},validationPill:{fontSize:12,padding:"3px 10px",borderRadius:12,border:"1px solid",whiteSpace:"nowrap"},workspace:{flex:1,display:"flex",overflow:"hidden"},editorPane:{display:"flex",flexDirection:"column",overflow:"hidden",minWidth:0},terminalPane:{display:"flex",flexDirection:"column",overflow:"hidden",minWidth:0},resizeHandle:{width:6,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:e.border,position:"relative",zIndex:5},resizeGrip:{width:3,height:32,borderRadius:2,background:e.textMuted||e.border,opacity:.5},fileTabs:{display:"flex",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.border}`,flexShrink:0,overflow:"auto"},fileTab:{padding:"8px 16px",fontSize:13,border:"none",borderBottom:"2px solid transparent",cursor:"pointer",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6,fontFamily:'"SFMono-Regular", Consolas, monospace'},modifiedDot:{fontSize:8,color:e.warning},editorBody:{flex:1,overflow:"hidden",backgroundColor:e.id==="light"?"#ffffff":"#1e1e1e"},editorLoading:{padding:20,color:e.textMuted,fontSize:13},editorFooter:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 12px",backgroundColor:e.bgSecondary,borderTop:`1px solid ${e.border}`,flexShrink:0},footerLang:{fontSize:11,color:e.textMuted,textTransform:"uppercase"},saveButton:{fontSize:12,color:e.accent,backgroundColor:"transparent",border:`1px solid ${e.accent}40`,borderRadius:4,padding:"2px 8px",cursor:"pointer"},readonlyBadge:{fontSize:11,color:e.textMuted,fontStyle:"italic"},hintContainer:{position:"relative",marginLeft:"auto"},hintToggle:{fontSize:12,color:e.warning,backgroundColor:"transparent",border:`1px solid ${e.warning}40`,borderRadius:6,padding:"4px 10px",cursor:"pointer"},hintPopup:{position:"absolute",top:"100%",right:0,marginTop:6,padding:"10px 14px",backgroundColor:e.bgPrimary,border:`1px solid ${e.border}`,borderRadius:8,boxShadow:`0 4px 12px ${e.bgPrimary}80`,zIndex:20,minWidth:240,maxWidth:360},hintText:{fontSize:13,color:e.warning,margin:"0 0 8px 0",lineHeight:1.5},hintNext:{fontSize:12,color:e.warning,backgroundColor:"transparent",border:`1px solid ${e.warning}40`,borderRadius:4,padding:"2px 8px",cursor:"pointer"},sendToChatBtn:{fontSize:12,color:e.accent,backgroundColor:"transparent",border:`1px solid ${e.accent}40`,borderRadius:6,padding:"4px 12px",cursor:"pointer",whiteSpace:"nowrap"},doneBtn:{fontSize:12,fontWeight:600,color:"#fff",backgroundColor:e.success,border:"none",borderRadius:6,padding:"5px 16px",cursor:"pointer",whiteSpace:"nowrap"}}}function Qb(e){if(!e||typeof e!="string")return!1;try{const t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"}catch{return!1}}function Eq({data:e,sendEvent:t,onReportBack:r}){const{theme:i}=Bt(),n=M.useMemo(()=>Bq(i),[i]),s=M.useRef(null),a=M.useRef(null),[l,u]=M.useState(!1),[h,d]=M.useState(!0),p=(e==null?void 0:e.url)||"",m=(e==null?void 0:e.title)||"",y=(e==null?void 0:e.module)||null,x=(e==null?void 0:e.annotations)||[],v=(e==null?void 0:e.splitUrl)||null,S=Qb(p),C=v?Qb(v):!1;M.useEffect(()=>{u(!1)},[p]);const B=M.useCallback(()=>{u(!0)},[]),R=M.useCallback(()=>{p&&window.open(p,"_blank","noopener,noreferrer")},[p]),E=M.useCallback(()=>{v&&window.open(v,"_blank","noopener,noreferrer")},[v]),L=M.useCallback(()=>{s.current&&(u(!1),s.current.src=p)},[p]),k=M.useCallback(()=>{r&&r(`I'm looking at: ${p}`)},[p,r]);if(!e)return g.jsxs("div",{style:n.empty,children:[g.jsx("div",{style:n.emptyIcon,children:"🌐"}),g.jsx("p",{style:n.emptyTitle,children:"Web Embed"}),g.jsx("p",{style:n.emptySubtext,children:"Real websites will appear here during lessons for inspection and exploration."})]});if(!S)return g.jsxs("div",{style:n.empty,children:[g.jsx("div",{style:n.emptyIcon,children:"⚠️"}),g.jsx("p",{style:n.emptyTitle,children:"Invalid URL"}),g.jsxs("p",{style:n.emptySubtext,children:["The provided URL is not valid for embedding: ",p]})]});const A=v&&C;return g.jsxs("div",{style:n.container,children:[(y||m)&&g.jsxs("div",{style:n.breadcrumb,children:[y&&g.jsx("span",{style:n.breadcrumbModule,children:y}),y&&m&&g.jsx("span",{style:n.breadcrumbSep,children:"/"}),m&&g.jsx("span",{style:n.breadcrumbTitle,children:m})]}),g.jsxs("div",{style:n.toolbar,children:[g.jsxs("div",{style:n.urlBar,children:[g.jsx("span",{style:n.urlIcon,children:"🔒"}),g.jsx("span",{style:n.urlText,title:p,children:p})]}),g.jsxs("div",{style:n.toolbarActions,children:[g.jsx("button",{style:n.toolbarBtn,onClick:L,title:"Refresh",children:"↻"}),x.length>0&&g.jsx("button",{style:{...n.toolbarBtn,...h?n.toolbarBtnActive:{}},onClick:()=>d(z=>!z),title:h?"Hide annotations":"Show annotations",children:"📌"}),r&&g.jsx("button",{style:n.toolbarBtn,onClick:k,title:"Report back to chat",children:"💬"}),g.jsx("button",{style:n.toolbarBtn,onClick:R,title:"Open in new tab",children:"↗"})]})]}),g.jsxs("div",{style:A?n.splitWrapper:n.iframeWrapper,children:[g.jsx("div",{style:A?n.splitPane:n.fullPane,children:l?g.jsxs("div",{style:n.errorFallback,children:[g.jsx("p",{style:n.errorTitle,children:"This site blocks embedding"}),g.jsx("p",{style:n.errorSubtext,children:"Some websites set security headers that prevent them from being displayed in an iframe."}),g.jsx("button",{style:n.openTabBtn,onClick:R,children:"Open in new tab ↗"})]}):g.jsxs("div",{style:n.iframeContainer,children:[g.jsx("iframe",{ref:s,src:p,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups",style:n.iframe,title:m||"Embedded website",onError:B}),h&&x.length>0&&g.jsx("div",{style:n.annotationOverlay,children:x.map((z,U)=>g.jsxs("div",{style:{...n.annotation,top:`${z.y??10}%`,left:`${z.x??10}%`},title:z.text||"",children:[g.jsx("span",{style:n.annotationNumber,children:U+1}),z.text&&g.jsx("span",{style:n.annotationText,children:z.text})]},U))})]})}),A&&g.jsxs(g.Fragment,{children:[g.jsx("div",{style:n.splitDivider}),g.jsxs("div",{style:n.splitPane,children:[g.jsxs("div",{style:n.splitUrlBar,children:[g.jsx("span",{style:n.urlIcon,children:"🔒"}),g.jsx("span",{style:n.urlText,title:v,children:v}),g.jsx("button",{style:n.toolbarBtn,onClick:E,title:"Open in new tab",children:"↗"})]}),g.jsx("div",{style:n.iframeContainer,children:g.jsx("iframe",{ref:a,src:v,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups",style:n.iframe,title:"Comparison site"})})]})]})]})]})}function Bq(e){return{container:{display:"flex",flexDirection:"column",flex:1,height:"100%",minHeight:0,gap:8},breadcrumb:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:e.textSecondary,flexShrink:0},breadcrumbModule:{color:e.accent,fontWeight:500},breadcrumbSep:{color:e.textMuted},breadcrumbTitle:{color:e.textPrimary},toolbar:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,flexShrink:0},urlBar:{flex:1,display:"flex",alignItems:"center",gap:6,minWidth:0,padding:"4px 8px",backgroundColor:e.bgTertiary,borderRadius:6,overflow:"hidden"},urlIcon:{fontSize:12,flexShrink:0},urlText:{fontSize:12,color:e.textSecondary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'},toolbarActions:{display:"flex",alignItems:"center",gap:4,flexShrink:0},toolbarBtn:{width:30,height:30,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,color:e.textSecondary,backgroundColor:"transparent",border:"1px solid transparent",borderRadius:6,cursor:"pointer",transition:"background 0.15s ease, border-color 0.15s ease"},toolbarBtnActive:{backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`},iframeWrapper:{flex:1,display:"flex",flexDirection:"column",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,overflow:"hidden",minHeight:0},splitWrapper:{flex:1,display:"flex",flexDirection:"row",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,overflow:"hidden",minHeight:0},fullPane:{flex:1,display:"flex",flexDirection:"column",minHeight:0},splitPane:{flex:1,display:"flex",flexDirection:"column",minWidth:0,minHeight:0},splitDivider:{width:3,backgroundColor:e.border,flexShrink:0},splitUrlBar:{display:"flex",alignItems:"center",gap:6,padding:"4px 10px",borderBottom:`1px solid ${e.border}`,flexShrink:0},iframeContainer:{position:"relative",flex:1,minHeight:0},iframe:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",display:"block"},annotationOverlay:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",zIndex:5},annotation:{position:"absolute",display:"flex",alignItems:"center",gap:6,pointerEvents:"auto",cursor:"default",transform:"translate(-50%, -50%)"},annotationNumber:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,color:"#fff",backgroundColor:e.accent,borderRadius:"50%",boxShadow:"0 2px 8px rgba(0,0,0,0.4)",flexShrink:0},annotationText:{fontSize:12,fontWeight:500,color:e.textBright,backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:6,padding:"4px 8px",boxShadow:"0 2px 8px rgba(0,0,0,0.3)",maxWidth:200,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},errorFallback:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:12,padding:32},errorTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},errorSubtext:{fontSize:14,color:e.textSecondary,margin:0,textAlign:"center",maxWidth:400},openTabBtn:{padding:"8px 20px",fontSize:14,fontWeight:500,color:"#fff",backgroundColor:e.accent,border:"none",borderRadius:8,cursor:"pointer",marginTop:8},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0}}}function Mq(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3);if(r<60)return"just now";const i=Math.floor(r/60);if(i<60)return`${i}m ago`;const n=Math.floor(i/60);if(n<24)return`${n}h ago`;const s=Math.floor(n/24);return s<7?`${s}d ago`:new Date(e).toLocaleDateString()}function Lq(e){const t=new Date,r=new Date(t.getFullYear(),t.getMonth(),t.getDate()),i=new Date(r-864e5),n=new Date(r-7*864e5),s={Today:[],Yesterday:[],"This Week":[],Older:[]};for(const a of e){const l=new Date(a.lastActive);l>=r?s.Today.push(a):l>=i?s.Yesterday.push(a):l>=n?s["This Week"].push(a):s.Older.push(a)}return s}function Rq({session:e,isActive:t,onSelect:r,onDelete:i,onRename:n,onTogglePin:s}){const{theme:a}=Bt(),[l,u]=M.useState(!1),[h,d]=M.useState(!1),[p,m]=M.useState(e.title),y=M.useRef(null),x=M.useRef(null);M.useEffect(()=>{h&&x.current&&x.current.focus()},[h]),M.useEffect(()=>{if(!l)return;const S=C=>{y.current&&!y.current.contains(C.target)&&u(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[l]);const v=()=>{const S=p.trim();S&&S!==e.title&&n(e.sessionId,S),d(!1)};return g.jsxs("div",{onClick:()=>!h&&r(e.sessionId),style:{padding:"10px 12px",borderRadius:8,cursor:"pointer",background:t?`${a.accent}18`:"transparent",borderLeft:t?`3px solid ${a.accent}`:"3px solid transparent",transition:"background 0.15s",position:"relative"},onMouseEnter:S=>{t||(S.currentTarget.style.background=`${a.textPrimary}08`)},onMouseLeave:S=>{t||(S.currentTarget.style.background="transparent")},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,minWidth:0},children:[h?g.jsx("input",{ref:x,value:p,onChange:S=>m(S.target.value),onBlur:v,onKeyDown:S=>{S.key==="Enter"&&v(),S.key==="Escape"&&d(!1)},onClick:S=>S.stopPropagation(),style:{flex:1,background:a.bgPrimary,border:`1px solid ${a.accent}`,borderRadius:4,padding:"2px 6px",color:a.textPrimary,fontSize:13,fontFamily:"inherit",outline:"none",minWidth:0}}):g.jsxs("span",{style:{fontSize:13,fontWeight:500,color:t?a.accent:a.textPrimary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:[e.pinned?"📌 ":"",e.title]}),g.jsx("button",{onClick:S=>{S.stopPropagation(),u(!l)},style:{background:"none",border:"none",color:a.textSecondary,cursor:"pointer",padding:"2px 4px",fontSize:14,lineHeight:1,opacity:.6,flexShrink:0},children:"⋮"})]}),g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:3},children:[e.module&&g.jsx("span",{style:{fontSize:10,fontWeight:600,color:a.success,background:`${a.success}18`,padding:"1px 6px",borderRadius:10},children:e.module}),e.topic&&!e.module&&g.jsx("span",{style:{fontSize:10,fontWeight:600,color:a.accent,background:`${a.accent}18`,padding:"1px 6px",borderRadius:10},children:e.topic.slice(0,20)}),g.jsx("span",{style:{fontSize:11,color:a.textSecondary,marginLeft:"auto"},children:Mq(e.lastActive)})]}),e.firstMessage&&g.jsx("div",{style:{fontSize:11,color:a.textSecondary,marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",opacity:.7},children:e.firstMessage}),l&&g.jsx("div",{ref:y,style:{position:"absolute",top:8,right:8,background:a.bgSecondary,border:`1px solid ${a.border}`,borderRadius:8,padding:4,boxShadow:"0 4px 12px rgba(0,0,0,0.3)",zIndex:100,minWidth:130},children:[{label:"Rename",action:()=>{d(!0),u(!1)}},{label:e.pinned?"Unpin":"Pin",action:()=>{s(e.sessionId,!e.pinned),u(!1)}},{label:"Delete",action:()=>{i(e.sessionId),u(!1)},danger:!0}].map(S=>g.jsx("button",{onClick:C=>{C.stopPropagation(),S.action()},style:{display:"block",width:"100%",padding:"6px 12px",border:"none",borderRadius:4,background:"none",color:S.danger?a.error:a.textPrimary,fontSize:12,cursor:"pointer",textAlign:"left",fontFamily:"inherit"},onMouseEnter:C=>{C.currentTarget.style.background=`${a.textPrimary}10`},onMouseLeave:C=>{C.currentTarget.style.background="none"},children:S.label},S.label))})]})}function Aq({open:e,sessions:t,activeSessionId:r,onSelect:i,onNewChat:n,onDelete:s,onRename:a,onTogglePin:l,onClose:u}){const{theme:h}=Bt(),[d,p]=M.useState(""),m=M.useMemo(()=>{if(!d.trim())return t;const x=d.toLowerCase();return t.filter(v=>{var S,C,B;return((S=v.title)==null?void 0:S.toLowerCase().includes(x))||((C=v.module)==null?void 0:C.toLowerCase().includes(x))||((B=v.topic)==null?void 0:B.toLowerCase().includes(x))})},[t,d]),y=M.useMemo(()=>Lq(m),[m]);return e?g.jsxs("div",{style:{width:280,height:"100%",background:h.bgSecondary,borderRight:`1px solid ${h.border}`,display:"flex",flexDirection:"column",position:"relative",zIndex:50,flexShrink:0},children:[g.jsxs("div",{style:{padding:"16px 14px 12px",borderBottom:`1px solid ${h.border}`,display:"flex",alignItems:"center",gap:8},children:[g.jsx("span",{style:{fontSize:15,fontWeight:700,color:h.textBright,flex:1},children:"Sessions"}),g.jsx("button",{onClick:n,style:{background:h.accent,color:"#fff",border:"none",borderRadius:6,padding:"5px 12px",fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},children:"+ New"}),g.jsx("button",{onClick:u,style:{background:"none",border:"none",color:h.textSecondary,cursor:"pointer",fontSize:16,padding:"2px 4px",lineHeight:1},children:"✕"})]}),g.jsx("div",{style:{padding:"8px 14px"},children:g.jsx("input",{value:d,onChange:x=>p(x.target.value),placeholder:"Search sessions...",style:{width:"100%",padding:"7px 10px",borderRadius:6,border:`1px solid ${h.border}`,background:h.bgPrimary,color:h.textPrimary,fontSize:12,fontFamily:"inherit",outline:"none",boxSizing:"border-box"}})}),g.jsx("div",{style:{flex:1,overflow:"auto",padding:"4px 8px 8px"},children:t.length===0?g.jsx("div",{style:{padding:20,textAlign:"center",color:h.textSecondary,fontSize:13},children:"Start a conversation to create your first session"}):m.length===0?g.jsxs("div",{style:{padding:20,textAlign:"center",color:h.textSecondary,fontSize:13},children:['No sessions match "',d,'"']}):Object.entries(y).map(([x,v])=>v.length===0?null:g.jsxs("div",{children:[g.jsx("div",{style:{fontSize:11,fontWeight:600,color:h.textSecondary,textTransform:"uppercase",letterSpacing:"0.05em",padding:"10px 6px 4px"},children:x}),v.map(S=>g.jsx(Rq,{session:S,isActive:S.sessionId===r,onSelect:i,onDelete:s,onRename:a,onTogglePin:l},S.sessionId))]},x))})]}):null}const Dq=[{icon:"🎓",name:"Socratic Teaching",desc:"Guided dialogue that asks questions instead of giving answers — you discover concepts yourself"},{icon:"📚",name:"Module Library",desc:"Browse, install, and search a growing library of learning modules across categories and difficulty levels"},{icon:"🧠",name:"Free-Style Learning",desc:"Ask to learn any topic — the system auto-generates a full module with walkthrough, quiz, and resources on the fly"},{icon:"🗺",name:"Learning Journeys",desc:"Multi-module paths that guide you through a subject in the right order, tracking prerequisites and progress"},{icon:"💬",name:"Q&A from Modules",desc:"Ask questions about any installed module and get answers grounded in the module content"},{icon:"🖥",name:"Visual Canvas",desc:"Rich browser UI with diagrams, quizzes, code playgrounds, terminals, and games — side by side with chat"},{icon:"📟",name:"Terminal Mode",desc:"Full teaching experience in the CLI — no browser needed, with real PTY terminal sessions"},{icon:"🧩",name:"Chrome Extension",desc:"Detects what you're reading and suggests relevant modules — privacy-first, reads only page title and meta tags"},{icon:"🏆",name:"Gamification",desc:"XP, belt ranks, streaks, and 26 achievements to keep you motivated and track your growth"},{icon:"✍",name:"Module Authoring",desc:"Create your own modules with guided step-by-step authoring, or build full module packs"},{icon:"💾",name:"Progress Tracking",desc:"All progress saved locally in .teach-progress.yaml — resume any session exactly where you left off"},{icon:"🔄",name:"Session Management",desc:"Multiple chat sessions with history, pinning, renaming, and resume support"}],Pq=[{category:"Interactive Lessons",items:[{icon:"🚶",name:"Walkthrough",desc:"Step-by-step guided lesson with Task / Question / Checkpoint pattern",cmd:"/teach <module>"},{icon:"⚡",name:"Quick Reference",desc:"Concise cheat sheet — key commands, syntax, and patterns at a glance",cmd:"/teach <module> --quick"},{icon:"🤖",name:"Implement Mode",desc:"AI implements and explains as it goes — watch and learn from working code",cmd:"/teach <module> --implement"}]},{category:"Quizzes",items:[{icon:"🎯",name:"Timed Choice",desc:"Multiple-choice questions with a countdown timer — test speed and recall"},{icon:"🔀",name:"Drag & Order",desc:"Arrange items in the correct sequence — great for learning workflows and pipelines"},{icon:"🔗",name:"Matching",desc:"Connect related concepts — pair commands with descriptions, terms with definitions"},{icon:"✏",name:"Fill in the Blank",desc:"Complete code snippets or commands from memory — tests precise recall"}]},{category:"Games",items:[{icon:"⌨",name:"Command Sprint",desc:"Type the correct command as fast as you can — timed challenges with alternates accepted"},{icon:"🎭",name:"Scenario",desc:"Choose-your-own-adventure with health points — make decisions and face consequences"},{icon:"🐛",name:"Bug Hunt",desc:"Find and fix bugs in code snippets before time runs out"},{icon:"⚡",name:"Speed Round",desc:"Rapid-fire questions — answer as many as you can in the time limit"},{icon:"🏷",name:"Classify",desc:"Sort items into the correct categories — drag and drop under pressure"},{icon:"🧠",name:"Memory Match",desc:"Flip cards to find matching pairs — reinforce associations between concepts"}]},{category:"Hands-On Practice",items:[{icon:"💻",name:"Code Playground",desc:"Write and run code (Bash, JavaScript, Python) with instant feedback in a sandboxed environment"},{icon:"📟",name:"Real Terminal",desc:"Full PTY terminal session — run real commands with Socratic guidance and validation"},{icon:"🔧",name:"Workshop",desc:"Split-pane terminal + code editor — build real projects with step-by-step scenarios"},{icon:"💪",name:"Exercises",desc:"Practice tasks with validation checklists and progressive hints — verify your own work"}]},{category:"Visual Learning",items:[{icon:"📊",name:"Mermaid Diagrams",desc:"Auto-generated flowcharts, sequence diagrams, and architecture views rendered live"},{icon:"🔀",name:"Flow Diagrams",desc:"Step-by-step visual flows that animate concepts like Git branching or data pipelines"},{icon:"🏗",name:"Architecture Diagrams",desc:"System architecture views showing how components connect and communicate"},{icon:"🌐",name:"HTML Content",desc:"Rich media — embedded videos, interactive demos, and curated visual resources"}]}],Iq=[{file:"module.yaml",desc:"Metadata — title, XP values, difficulty, prerequisites, trigger phrases, visual types",icon:"⚙"},{file:"content.md",desc:"Core reading material that covers the topic in depth",icon:"📖"},{file:"walkthrough.md",desc:"Step-by-step guided lesson using the Task → Question → Checkpoint pattern",icon:"🚶"},{file:"quiz.md",desc:"Multiple-choice assessment with hidden answers and explanations",icon:"❓"},{file:"exercises.md",desc:"Hands-on practice tasks with validation checklists and progressive hints",icon:"💪"},{file:"resources.md",desc:"Curated external links — docs, videos, interactive tools",icon:"🔗"},{file:"game.yaml",desc:"Interactive games — command sprints, scenario-based challenges",icon:"🎮"},{file:"workshop.yaml",desc:"Live terminal + code editor sessions with real-time validation",icon:"🔧"}],Zb=[{label:"Resolve Module",detail:"Find the module in registries (built-in, local, generated)"},{label:"Resume Progress",detail:"Load .teach-progress.yaml to pick up where you left off"},{label:"Present Task",detail:"Show the next walkthrough step with a concrete task to perform"},{label:"Ask Question",detail:"Pose a Socratic question — make the learner think before acting"},{label:"Wait & Observe",detail:"Watch terminal commands, code runs, or quiz answers in real time"},{label:"Socratic Feedback",detail:"Guide with follow-up questions, not just right/wrong"},{label:"Confirm Checkpoint",detail:"Verify understanding before advancing to the next step"},{label:"Award XP",detail:"Grant experience points and update belt progress"}],$q=[{name:"Full",badge:"⬡",desc:"Canvas + Chat — visual diagrams, interactive quizzes, code playgrounds, and guided chat side by side",color:"accent"},{name:"Canvas",badge:"◧",desc:"Visual-only — all canvas features work standalone when no chat is available",color:"success"},{name:"Terminal",badge:"▣",desc:"CLI-only — the complete teaching experience runs in your terminal, no browser needed",color:"warning"}],jq=[{name:"White",xp:0,color:"#e6e6e6"},{name:"Yellow",xp:50,color:"#f0c040"},{name:"Green",xp:150,color:"#3fb950"},{name:"Blue",xp:300,color:"#58a6ff"},{name:"Purple",xp:500,color:"#bc8cff"},{name:"Brown",xp:800,color:"#a0522d"},{name:"Black",xp:1200,color:"#484f58"}],Oq=[{activity:"Walkthrough step",xp:10},{activity:"Quiz complete",xp:20},{activity:"Quiz perfect score",xp:30},{activity:"Exercise complete",xp:15},{activity:"Game complete",xp:25},{activity:"Game perfect score",xp:40},{activity:"Module complete",xp:50},{activity:"Code run (correct)",xp:15}];function zq(){const{theme:e}=Bt(),t=M.useMemo(()=>Fq(e),[e]);return g.jsxs("div",{style:t.container,children:[g.jsx("h1",{style:t.title,children:"How ClaudeTeach Works"}),g.jsx("p",{style:t.subtitle,children:"A Socratic AI teaching platform that combines guided dialogue, hands-on practice, and gamification to help you truly understand — not just memorize."}),g.jsxs("section",{style:t.section,children:[g.jsx("h2",{style:t.sectionTitle,children:"The Socratic Method"}),g.jsxs("div",{style:t.card,children:[g.jsxs("p",{style:t.text,children:["ClaudeTeach follows one core principle: ",g.jsx("strong",{style:t.strong,children:"ask, don't tell."})," Instead of lecturing, the system guides you to discover answers through carefully crafted questions. You write all the code, run all the commands, and arrive at understanding on your own terms."]}),g.jsxs("div",{style:t.patternBox,children:[g.jsx("div",{style:t.patternTitle,children:"Every walkthrough step follows this pattern:"}),g.jsxs("div",{style:t.patternSteps,children:[g.jsxs("div",{style:t.patternStep,children:[g.jsx("span",{style:t.patternIcon,children:"📋"}),g.jsxs("div",{children:[g.jsx("div",{style:t.patternLabel,children:"Task"}),g.jsx("div",{style:t.patternDesc,children:"A concrete action to perform"})]})]}),g.jsx("div",{style:t.patternArrow,children:"→"}),g.jsxs("div",{style:t.patternStep,children:[g.jsx("span",{style:t.patternIcon,children:"🤔"}),g.jsxs("div",{children:[g.jsx("div",{style:t.patternLabel,children:"Question"}),g.jsx("div",{style:t.patternDesc,children:"Think before you act — predict the outcome"})]})]}),g.jsx("div",{style:t.patternArrow,children:"→"}),g.jsxs("div",{style:t.patternStep,children:[g.jsx("span",{style:t.patternIcon,children:"✅"}),g.jsxs("div",{children:[g.jsx("div",{style:t.patternLabel,children:"Checkpoint"}),g.jsx("div",{style:t.patternDesc,children:"Verify understanding before moving on"})]})]})]})]}),g.jsx("p",{style:t.text,children:`When you answer, the system doesn't just say "correct" or "wrong." It responds with follow-up questions that deepen your understanding or gently redirect your thinking.`})]})]}),g.jsxs("section",{style:t.section,children:[g.jsx("h2",{style:t.sectionTitle,children:"Features"}),g.jsx("div",{style:t.featureGrid,children:Dq.map(r=>g.jsxs("div",{style:t.featureCard,children:[g.jsx("span",{style:t.featureIcon,children:r.icon}),g.jsxs("div",{children:[g.jsx("div",{style:t.featureName,children:r.name}),g.jsx("div",{style:t.featureDesc,children:r.desc})]})]},r.name))})]}),g.jsxs("section",{style:t.section,children:[g.jsx("h2",{style:t.sectionTitle,children:"Lesson Types"}),g.jsx("p",{style:t.text,children:"Modules combine multiple activity types to create a rich, varied learning experience. Each type targets a different way of learning."}),Pq.map(r=>g.jsxs("div",{style:t.lessonGroup,children:[g.jsx("h3",{style:t.lessonGroupTitle,children:r.category}),g.jsx("div",{style:t.lessonGrid,children:r.items.map(i=>g.jsxs("div",{style:t.lessonCard,children:[g.jsxs("div",{style:t.lessonHeader,children:[g.jsx("span",{style:t.lessonIcon,children:i.icon}),g.jsx("span",{style:t.lessonName,children:i.name}),i.cmd&&g.jsx("code",{style:t.lessonCmd,children:i.cmd})]}),g.jsx("div",{style:t.lessonDesc,children:i.desc})]},i.name))})]},r.category))]}),g.jsxs("section",{style:t.section,children:[g.jsx("h2",{style:t.sectionTitle,children:"Anatomy of a Module"}),g.jsx("p",{style:t.text,children:"Each learning module is a folder of plain-text files. Together they form a complete learning experience — from reading to practice to assessment."}),g.jsx("div",{style:t.fileGrid,children:Iq.map(r=>g.jsxs("div",{style:t.fileCard,children:[g.jsxs("div",{style:t.fileHeader,children:[g.jsx("span",{style:t.fileIcon,children:r.icon}),g.jsx("code",{style:t.fileName,children:r.file})]}),g.jsx("div",{style:t.fileDesc,children:r.desc})]},r.file))}),g.jsxs("div",{style:t.card,children:[g.jsx("div",{style:t.patternTitle,children:"Example: walkthrough.md step"}),g.jsx("pre",{style:t.codeBlock,children:`## Step 1: Your First Repository
|
|
502
|
+
|
|
503
|
+
**Task:** Create a new directory and initialize it as a Git repository.
|
|
504
|
+
|
|
505
|
+
**Question:** Before we run any commands — what do you think
|
|
506
|
+
\`git init\` actually creates? What would you expect to find
|
|
507
|
+
in the directory afterward?
|
|
508
|
+
|
|
509
|
+
**Checkpoint:** The user should mention the .git hidden directory
|
|
510
|
+
and understand it stores Git's internal data.`})]})]}),g.jsxs("section",{style:t.section,children:[g.jsx("h2",{style:t.sectionTitle,children:"The Learning Flow"}),g.jsx("p",{style:t.text,children:"When you start a teaching session, the system orchestrates a feedback loop that adapts to your pace and understanding."}),g.jsx("div",{style:t.flowContainer,children:Zb.map((r,i)=>g.jsxs("div",{style:t.flowStep,children:[g.jsx("div",{style:t.flowNumber,children:i+1}),g.jsxs("div",{style:t.flowContent,children:[g.jsx("div",{style:t.flowLabel,children:r.label}),g.jsx("div",{style:t.flowDetail,children:r.detail})]}),i<Zb.length-1&&g.jsx("div",{style:t.flowConnector})]},i))}),g.jsx("p",{style:{...t.text,...t.textMuted},children:"Steps 3–7 repeat for each walkthrough step, creating a continuous Socratic dialogue until the module is complete."})]}),g.jsxs("section",{style:t.section,children:[g.jsx("h2",{style:t.sectionTitle,children:"Three Tiers of Experience"}),g.jsx("p",{style:t.text,children:"Socrates uses progressive enhancement — the teaching experience works everywhere, from a rich visual canvas down to a plain terminal."}),g.jsx("div",{style:t.tierGrid,children:$q.map(r=>g.jsxs("div",{style:t.tierCard,children:[g.jsx("div",{style:{...t.tierBadge,color:e[r.color]},children:r.badge}),g.jsx("div",{style:{...t.tierName,color:e[r.color]},children:r.name}),g.jsx("div",{style:t.tierDesc,children:r.desc})]},r.name))})]}),g.jsxs("section",{style:t.section,children:[g.jsx("h2",{style:t.sectionTitle,children:"Gamification"}),g.jsxs("div",{style:t.gamifRow,children:[g.jsxs("div",{style:t.gamifCard,children:[g.jsx("h3",{style:t.gamifTitle,children:"Belt System"}),g.jsx("p",{style:t.textSmall,children:"Earn XP to advance through belts — from White to Black."}),g.jsx("div",{style:t.beltList,children:jq.map(r=>g.jsxs("div",{style:t.beltItem,children:[g.jsx("div",{style:{...t.beltDot,backgroundColor:r.color}}),g.jsx("span",{style:t.beltName,children:r.name}),g.jsxs("span",{style:t.beltXp,children:[r.xp," XP"]})]},r.name))})]}),g.jsxs("div",{style:t.gamifCard,children:[g.jsx("h3",{style:t.gamifTitle,children:"XP Awards"}),g.jsx("p",{style:t.textSmall,children:"Every activity earns experience points."}),g.jsx("div",{style:t.xpTable,children:Oq.map(r=>g.jsxs("div",{style:t.xpRow,children:[g.jsx("span",{style:t.xpActivity,children:r.activity}),g.jsxs("span",{style:t.xpValue,children:["+",r.xp," XP"]})]},r.activity))})]}),g.jsxs("div",{style:t.gamifCard,children:[g.jsx("h3",{style:t.gamifTitle,children:"Streaks & Achievements"}),g.jsx("p",{style:t.textSmall,children:"Maintain a daily learning streak to build momentum. Unlock achievements for milestones like completing your first module, earning a perfect quiz score, or reaching a new belt."}),g.jsxs("div",{style:t.achievementExamples,children:[g.jsx("div",{style:t.achievementItem,children:"🔥 Daily streak counter"}),g.jsx("div",{style:t.achievementItem,children:"🎯 Perfect quiz scores"}),g.jsx("div",{style:t.achievementItem,children:"🏅 Belt promotions"}),g.jsx("div",{style:t.achievementItem,children:"📚 Module completions"}),g.jsx("div",{style:t.achievementItem,children:"⚡ Speed challenges"})]})]})]})]}),g.jsxs("footer",{style:t.footer,children:["Start learning with ",g.jsx("code",{style:t.inlineCode,children:"/teach <module>"})," or browse available modules in the Modules tab."]})]})}function Fq(e){const t={backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,padding:20};return{container:{maxWidth:900,margin:"0 auto",padding:"8px 0 40px",fontFamily:"inherit"},title:{fontSize:26,fontWeight:700,color:e.textBright,margin:"0 0 6px"},subtitle:{fontSize:14,color:e.textSecondary,lineHeight:1.6,margin:"0 0 28px",maxWidth:640},section:{marginBottom:32},sectionTitle:{fontSize:18,fontWeight:700,color:e.accent,margin:"0 0 10px"},card:t,text:{fontSize:13,lineHeight:1.7,color:e.textPrimary,margin:"0 0 12px"},textMuted:{color:e.textSecondary,fontStyle:"italic"},textSmall:{fontSize:12,color:e.textSecondary,lineHeight:1.5,margin:"0 0 12px"},strong:{color:e.accent,fontWeight:600},patternBox:{...t,margin:"14px 0"},patternTitle:{fontSize:11,fontWeight:600,color:e.textSecondary,textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:12},patternSteps:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},patternStep:{display:"flex",alignItems:"flex-start",gap:8,flex:"1 1 140px",minWidth:140},patternIcon:{fontSize:20,flexShrink:0,marginTop:1},patternLabel:{fontSize:13,fontWeight:600,color:e.textBright},patternDesc:{fontSize:11,color:e.textSecondary,lineHeight:1.4},patternArrow:{fontSize:18,color:e.textMuted,flexShrink:0},featureGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:10,margin:"12px 0"},featureCard:{...t,padding:14,display:"flex",alignItems:"flex-start",gap:10},featureIcon:{fontSize:20,flexShrink:0,marginTop:1},featureName:{fontSize:13,fontWeight:600,color:e.textBright,marginBottom:2},featureDesc:{fontSize:11,color:e.textSecondary,lineHeight:1.5},lessonGroup:{marginBottom:16},lessonGroupTitle:{fontSize:13,fontWeight:700,color:e.textBright,margin:"0 0 8px",paddingLeft:2},lessonGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:10},lessonCard:{...t,padding:14},lessonHeader:{display:"flex",alignItems:"center",gap:6,marginBottom:6,flexWrap:"wrap"},lessonIcon:{fontSize:16,flexShrink:0},lessonName:{fontSize:13,fontWeight:600,color:e.textBright},lessonCmd:{fontSize:10,fontFamily:"monospace",color:e.accent,backgroundColor:e.bgTertiary,padding:"1px 6px",borderRadius:4,marginLeft:"auto"},lessonDesc:{fontSize:11,color:e.textSecondary,lineHeight:1.5},fileGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:10,margin:"12px 0 16px"},fileCard:{...t,padding:14},fileHeader:{display:"flex",alignItems:"center",gap:8,marginBottom:6},fileIcon:{fontSize:16},fileName:{fontSize:12,fontFamily:"monospace",color:e.accent,fontWeight:600},fileDesc:{fontSize:11,color:e.textSecondary,lineHeight:1.5},codeBlock:{backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:6,padding:14,fontSize:11,fontFamily:"monospace",color:e.textPrimary,lineHeight:1.6,overflowX:"auto",margin:"8px 0 0",whiteSpace:"pre-wrap"},flowContainer:{position:"relative",margin:"12px 0"},flowStep:{display:"flex",alignItems:"flex-start",gap:12,position:"relative",paddingBottom:8},flowNumber:{width:28,height:28,borderRadius:"50%",backgroundColor:e.accent,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,flexShrink:0,zIndex:1},flowContent:{paddingTop:3,flex:1},flowLabel:{fontSize:13,fontWeight:600,color:e.textBright},flowDetail:{fontSize:11,color:e.textSecondary,lineHeight:1.4,marginTop:2},flowConnector:{position:"absolute",left:13,top:28,width:2,height:"calc(100% - 20px)",backgroundColor:e.border},tierGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:12,margin:"12px 0"},tierCard:{...t,padding:18,textAlign:"center"},tierBadge:{fontSize:28,marginBottom:6},tierName:{fontSize:15,fontWeight:700,marginBottom:6},tierDesc:{fontSize:11,color:e.textSecondary,lineHeight:1.5},gamifRow:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:12,margin:"12px 0"},gamifCard:{...t,padding:18},gamifTitle:{fontSize:14,fontWeight:700,color:e.textBright,margin:"0 0 4px"},beltList:{display:"flex",flexDirection:"column",gap:6},beltItem:{display:"flex",alignItems:"center",gap:8,fontSize:12},beltDot:{width:10,height:10,borderRadius:"50%",flexShrink:0},beltName:{color:e.textPrimary,fontWeight:500,flex:1},beltXp:{color:e.textSecondary,fontSize:11,fontFamily:"monospace"},xpTable:{display:"flex",flexDirection:"column",gap:4},xpRow:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:12,padding:"3px 0",borderBottom:`1px solid ${e.border}`},xpActivity:{color:e.textPrimary},xpValue:{color:e.success,fontWeight:600,fontFamily:"monospace",fontSize:11},achievementExamples:{display:"flex",flexDirection:"column",gap:6},achievementItem:{fontSize:12,color:e.textPrimary,padding:"4px 8px",backgroundColor:e.bgTertiary,borderRadius:6},footer:{textAlign:"center",fontSize:13,color:e.textSecondary,padding:"20px 0 0",borderTop:`1px solid ${e.border}`},inlineCode:{fontSize:12,fontFamily:"monospace",color:e.accent,backgroundColor:e.bgTertiary,padding:"2px 6px",borderRadius:4}}}const Nq="http://localhost:3456",Wq={code:"💻",server:"🖥",layers:"📦",smartphone:"📱",users:"👥","shield-check":"🛡",brain:"🧠",target:"🎯","bar-chart":"📊",palette:"🎨",terminal:"⌨",book:"📖"};function Hq({onSelectJourney:e,onStartModule:t}){const{theme:r}=Bt(),[i,n]=M.useState([]),[s,a]=M.useState(null),[l,u]=M.useState(!0),h=M.useMemo(()=>qq(r),[r]);return M.useEffect(()=>{fetch(`${Nq}/api/journeys`).then(d=>d.ok?d.json():{journeys:[]}).then(d=>{n(d.journeys||[]),a(d.activeJourney||null),u(!1)}).catch(()=>u(!1))},[]),l?g.jsx("div",{style:h.container,children:g.jsx("div",{style:h.loading,children:"Loading journeys..."})}):g.jsxs("div",{style:h.container,children:[g.jsxs("div",{style:h.header,children:[g.jsx("h2",{style:h.title,children:"Learning Journeys"}),g.jsx("p",{style:h.subtitle,children:"Choose a career path to guide your learning"})]}),g.jsx("div",{style:h.grid,children:i.map(d=>{const p=s===d.slug,m=Wq[d.icon]||"📖",{stats:y}=d;return g.jsxs("div",{style:{...h.card,...p?h.cardActive:{}},onClick:()=>e(d),children:[p&&g.jsx("div",{style:h.activeBadge,children:"Active"}),g.jsx("div",{style:h.cardIcon,children:m}),g.jsx("h3",{style:h.cardTitle,children:d.title}),g.jsx("p",{style:h.cardDesc,children:d.description}),g.jsxs("div",{style:h.cardMeta,children:[g.jsxs("span",{style:h.metaItem,children:[y.totalStages," stages"]}),g.jsx("span",{style:h.metaDot,children:"·"}),g.jsxs("span",{style:h.metaItem,children:[y.availableModules," modules"]}),y.comingSoonModules>0&&g.jsxs(g.Fragment,{children:[g.jsx("span",{style:h.metaDot,children:"·"}),g.jsxs("span",{style:h.metaComingSoon,children:["+",y.comingSoonModules," coming"]})]})]}),y.estimatedHours&&g.jsxs("div",{style:h.cardTime,children:["~",d.estimatedHours,"h estimated"]}),y.completedModules>0?g.jsxs("div",{style:h.progressSection,children:[g.jsx("div",{style:h.progressBar,children:g.jsx("div",{style:{...h.progressFill,width:`${y.progressPercent}%`}})}),g.jsxs("span",{style:h.progressText,children:[y.completedModules,"/",y.availableModules," modules · ",y.progressPercent,"%"]})]}):g.jsx("div",{style:h.difficultyBadge,children:d.difficulty})]},d.slug)})})]})}function qq(e){return{container:{maxWidth:960,margin:"0 auto"},loading:{textAlign:"center",padding:40,color:e.textSecondary,fontSize:14},header:{marginBottom:24},title:{fontSize:22,fontWeight:700,color:e.textPrimary,margin:0},subtitle:{fontSize:13,color:e.textSecondary,margin:"6px 0 0 0"},grid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:16},card:{position:"relative",padding:20,backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,cursor:"pointer",transition:"border-color 0.15s ease, transform 0.15s ease"},cardActive:{borderColor:e.accent,boxShadow:`0 0 0 1px ${e.accent}44`},activeBadge:{position:"absolute",top:12,right:12,padding:"2px 8px",fontSize:10,fontWeight:600,color:e.accent,backgroundColor:`${e.accent}22`,borderRadius:10,textTransform:"uppercase",letterSpacing:"0.5px"},cardIcon:{fontSize:28,marginBottom:8},cardTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:"0 0 6px 0"},cardDesc:{fontSize:12,color:e.textSecondary,margin:"0 0 12px 0",lineHeight:1.4},cardMeta:{display:"flex",alignItems:"center",gap:4,fontSize:11,color:e.textSecondary,marginBottom:8},metaItem:{color:e.textSecondary},metaDot:{color:e.border},metaComingSoon:{color:e.orange||"#f0883e",fontStyle:"italic"},cardTime:{fontSize:11,color:e.textMuted||e.textSecondary,marginBottom:12},progressSection:{marginTop:8},progressBar:{height:4,borderRadius:2,backgroundColor:e.bgTertiary||e.border,overflow:"hidden",marginBottom:4},progressFill:{height:"100%",borderRadius:2,backgroundColor:e.success||"#3fb950",transition:"width 0.3s ease"},progressText:{fontSize:10,color:e.textSecondary},difficultyBadge:{display:"inline-block",marginTop:8,padding:"2px 8px",fontSize:10,color:e.textSecondary,backgroundColor:e.bgTertiary||`${e.border}66`,borderRadius:10,textTransform:"capitalize"}}}const Uq={code:"💻",server:"🖥",layers:"📦",smartphone:"📱",users:"👥","shield-check":"🛡",brain:"🧠",target:"🎯","bar-chart":"📊",palette:"🎨",terminal:"⌨",book:"📖"},Vq={completed:"✓",in_progress:"●",available:"○",locked:"🔒"};function Gq({journey:e,onBack:t,onStartModule:r,onActivate:i}){const{theme:n}=Bt(),s=M.useMemo(()=>Yq(n),[n]);if(!e)return g.jsxs("div",{style:s.empty,children:[g.jsx("p",{style:s.emptyTitle,children:"No journey selected"}),t&&g.jsx("button",{style:s.backBtn,onClick:t,children:"Browse journeys"})]});const{stages:a=[],stats:l={}}=e,u=Uq[e.icon]||"📖",h=!!e.isActive;return g.jsxs("div",{style:s.container,children:[g.jsx("div",{style:s.header,children:t&&g.jsx("button",{style:s.backBtn,onClick:t,children:"← Back to Journeys"})}),g.jsxs("div",{style:s.heroSection,children:[g.jsx("div",{style:s.heroIcon,children:u}),g.jsxs("div",{style:s.heroInfo,children:[g.jsx("h2",{style:s.heroTitle,children:e.title}),g.jsx("p",{style:s.heroDesc,children:e.description}),g.jsxs("div",{style:s.heroMeta,children:[g.jsx("span",{style:s.metaBadge,children:e.difficulty}),g.jsx("span",{style:s.metaSep,children:"·"}),g.jsxs("span",{style:s.metaText,children:[l.totalStages," stages"]}),g.jsx("span",{style:s.metaSep,children:"·"}),g.jsxs("span",{style:s.metaText,children:[l.availableModules," modules"]}),l.comingSoonModules>0&&g.jsxs(g.Fragment,{children:[g.jsx("span",{style:s.metaSep,children:"·"}),g.jsxs("span",{style:s.metaComingSoon,children:["+",l.comingSoonModules," coming"]})]}),e.estimatedHours&&g.jsxs(g.Fragment,{children:[g.jsx("span",{style:s.metaSep,children:"·"}),g.jsxs("span",{style:s.metaText,children:["~",e.estimatedHours,"h"]})]})]})]})]}),l.availableModules>0&&g.jsxs("div",{style:s.progressSection,children:[g.jsxs("div",{style:s.progressHeader,children:[g.jsx("span",{style:s.progressLabel,children:"Progress"}),g.jsxs("span",{style:s.progressValue,children:[l.completedModules,"/",l.availableModules," modules · ",l.progressPercent,"%"]})]}),g.jsx("div",{style:s.progressTrack,children:g.jsx("div",{style:{...s.progressFill,width:`${l.progressPercent}%`}})})]}),i&&!h&&g.jsx("button",{style:s.activateBtn,onClick:()=>i(e),children:l.completedModules>0?"Set as Active Journey":"Start Journey"}),h&&g.jsx("div",{style:s.activeBadge,children:"Active Journey"}),g.jsx("div",{style:s.timeline,children:a.map((d,p)=>{const m=p===a.length-1,y=Vq[d.status]||"○",x=d.status==="completed",v=d.status==="in_progress",S=d.status==="locked";return g.jsxs("div",{style:s.stageBlock,children:[g.jsxs("div",{style:s.stageHeader,children:[g.jsx("div",{style:{...s.stageIconCircle,...x?s.stageIconCompleted:{},...v?s.stageIconActive:{},...S?s.stageIconLocked:{}},children:g.jsx("span",{style:s.stageIconText,children:y})}),g.jsxs("div",{style:s.stageInfo,children:[g.jsxs("div",{style:s.stageNameRow,children:[g.jsxs("span",{style:{...s.stageName,...S?s.stageNameLocked:{}},children:["Stage ",p+1," — ",d.name]}),v&&g.jsx("span",{style:s.stageStatusBadge,children:"In Progress"}),x&&g.jsx("span",{style:s.stageCompletedBadge,children:"Complete"})]}),d.description&&g.jsx("p",{style:{...s.stageDesc,...S?s.stageDescLocked:{}},children:d.description})]})]}),g.jsxs("div",{style:s.stageBody,children:[!m&&g.jsx("div",{style:{...s.connectorLine,...x?s.connectorCompleted:{}}}),g.jsx("div",{style:s.moduleList,children:(d.modules||[]).map((C,B)=>{const R=S&&C.status!=="coming_soon"?"locked":C.status,E=R==="available"||R==="in_progress",L=R==="completed",k=R==="coming_soon",A=R==="locked";return g.jsxs("div",{style:{...s.moduleCard,...E?s.moduleCardClickable:{},...A?s.moduleCardLocked:{},...k?s.moduleCardComingSoon:{}},onClick:E&&r?()=>r(C.slug):void 0,children:[g.jsxs("div",{style:s.moduleLeft,children:[g.jsx("span",{style:{...s.moduleIcon,...L?s.moduleIconCompleted:{},...E?s.moduleIconActive:{},...A?s.moduleIconLocked:{},...k?s.moduleIconComingSoon:{}},children:L?"✓":k?"◌":A?"·":"▸"}),g.jsxs("div",{children:[g.jsx("span",{style:{...s.moduleTitle,...A?s.moduleTitleLocked:{},...k?s.moduleTitleComingSoon:{}},children:C.title}),C.difficulty&&!k&&g.jsx("span",{style:s.moduleDifficulty,children:C.difficulty})]})]}),g.jsxs("div",{style:s.moduleRight,children:[E&&g.jsx("span",{style:s.moduleAction,children:C.status==="in_progress"?"Continue →":"Start →"}),L&&g.jsx("span",{style:s.moduleCompleted,children:"✓ Done"}),k&&g.jsx("span",{style:s.moduleComingSoonLabel,children:"Coming Soon"})]})]},C.slug||B)})})]})]},p)})})]})}function Yq(e){const t=e.accent||"#58a6ff",r=e.success||"#3fb950",i=e.orange||"#f0883e",n=e.textMuted||e.textSecondary;return{container:{maxWidth:720,margin:"0 auto",paddingBottom:48},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:300,gap:12},emptyTitle:{fontSize:16,color:e.textSecondary,margin:0},header:{marginBottom:8},backBtn:{padding:"6px 14px",fontSize:13,color:e.textSecondary,backgroundColor:"transparent",border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer",fontFamily:"inherit",transition:"border-color 0.15s"},heroSection:{display:"flex",gap:16,alignItems:"flex-start",marginBottom:20},heroIcon:{fontSize:40,lineHeight:1,flexShrink:0,marginTop:2},heroInfo:{flex:1},heroTitle:{margin:0,fontSize:24,fontWeight:700,color:e.textBright||e.textPrimary},heroDesc:{margin:"6px 0 10px",fontSize:13,color:e.textSecondary,lineHeight:1.5},heroMeta:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,fontSize:12},metaBadge:{padding:"2px 8px",fontSize:10,fontWeight:600,color:e.textSecondary,backgroundColor:e.bgTertiary||`${e.border}66`,borderRadius:10,textTransform:"capitalize"},metaSep:{color:e.border},metaText:{color:e.textSecondary},metaComingSoon:{color:i,fontStyle:"italic"},progressSection:{marginBottom:16,padding:"12px 16px",backgroundColor:e.bgSecondary,borderRadius:8,border:`1px solid ${e.border}`},progressHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},progressLabel:{fontSize:12,fontWeight:600,color:e.textSecondary},progressValue:{fontSize:12,color:e.textSecondary},progressTrack:{height:6,borderRadius:3,backgroundColor:e.bgTertiary||e.border,overflow:"hidden"},progressFill:{height:"100%",borderRadius:3,backgroundColor:r,transition:"width 0.4s ease"},activateBtn:{marginBottom:24,padding:"10px 24px",fontSize:14,fontWeight:600,color:"#fff",backgroundColor:t,border:"none",borderRadius:8,cursor:"pointer",fontFamily:"inherit",transition:"opacity 0.15s"},activeBadge:{display:"inline-block",marginBottom:24,padding:"4px 12px",fontSize:11,fontWeight:600,color:r,backgroundColor:`${r}18`,borderRadius:10,textTransform:"uppercase",letterSpacing:"0.5px"},timeline:{position:"relative"},stageBlock:{position:"relative"},stageHeader:{display:"flex",gap:12,alignItems:"flex-start"},stageIconCircle:{width:32,height:32,borderRadius:"50%",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.bgTertiary||e.border,border:`2px solid ${e.border}`,fontSize:14,zIndex:1},stageIconCompleted:{backgroundColor:`${r}22`,borderColor:r},stageIconActive:{backgroundColor:`${t}22`,borderColor:t},stageIconLocked:{opacity:.5},stageIconText:{fontSize:13,lineHeight:1},stageInfo:{flex:1,paddingTop:4},stageNameRow:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},stageName:{fontSize:15,fontWeight:600,color:e.textBright||e.textPrimary},stageNameLocked:{color:n,opacity:.6},stageStatusBadge:{padding:"1px 8px",fontSize:10,fontWeight:600,color:t,backgroundColor:`${t}18`,borderRadius:10,textTransform:"uppercase",letterSpacing:"0.3px"},stageCompletedBadge:{padding:"1px 8px",fontSize:10,fontWeight:600,color:r,backgroundColor:`${r}18`,borderRadius:10,textTransform:"uppercase",letterSpacing:"0.3px"},stageDesc:{margin:"4px 0 0",fontSize:12,color:e.textSecondary,lineHeight:1.4},stageDescLocked:{opacity:.5},stageBody:{position:"relative",marginLeft:15,paddingLeft:28,paddingTop:10,paddingBottom:8},connectorLine:{position:"absolute",left:0,top:0,bottom:0,width:2,backgroundColor:e.border},connectorCompleted:{backgroundColor:r},moduleList:{display:"flex",flexDirection:"column",gap:6},moduleCard:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 14px",borderRadius:8,backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,transition:"border-color 0.15s, background-color 0.15s"},moduleCardClickable:{cursor:"pointer",borderColor:`${t}44`},moduleCardLocked:{opacity:.45},moduleCardComingSoon:{opacity:.55,borderStyle:"dashed"},moduleLeft:{display:"flex",alignItems:"center",gap:10,minWidth:0},moduleIcon:{fontSize:14,width:20,textAlign:"center",flexShrink:0,color:e.textSecondary},moduleIconCompleted:{color:r},moduleIconActive:{color:t},moduleIconLocked:{color:n,opacity:.5},moduleIconComingSoon:{color:i},moduleTitle:{fontSize:13,fontWeight:500,color:e.textPrimary},moduleTitleLocked:{color:n},moduleTitleComingSoon:{color:n,fontStyle:"italic"},moduleDifficulty:{display:"inline-block",marginLeft:8,padding:"1px 6px",fontSize:10,color:e.textSecondary,backgroundColor:e.bgTertiary||`${e.border}44`,borderRadius:8,textTransform:"capitalize",verticalAlign:"middle"},moduleRight:{flexShrink:0,marginLeft:12},moduleAction:{fontSize:12,fontWeight:600,color:t},moduleCompleted:{fontSize:11,color:r,fontWeight:500},moduleComingSoonLabel:{fontSize:11,color:i,fontStyle:"italic"}}}const Jb=[{key:"content.md",label:"Content",icon:"📖"},{key:"walkthrough.md",label:"Walkthrough",icon:"🚶"},{key:"exercises.md",label:"Exercises",icon:"📝"},{key:"quiz.md",label:"Quiz",icon:"❓"},{key:"quick-ref.md",label:"Quick Ref",icon:"⚡"},{key:"resources.md",label:"Resources",icon:"🔗"}];function Kq(e,t){if(!e)return null;const r=e.split(`
|
|
511
|
+
`),i=[];let n=0,s=0;for(;n<r.length;){const a=r[n];if(a.trimStart().startsWith("```")){const u=a.trimStart().slice(3).trim(),h=[];for(n++;n<r.length&&!r[n].trimStart().startsWith("```");)h.push(r[n]),n++;n++,i.push(g.jsxs("pre",{style:{backgroundColor:t.bgTertiary,border:`1px solid ${t.border}`,borderRadius:6,padding:"12px 16px",margin:"8px 0",overflowX:"auto",fontSize:13,lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',color:t.textPrimary},children:[u&&g.jsx("div",{style:{fontSize:11,color:t.textMuted,marginBottom:6},children:u}),g.jsx("code",{children:h.join(`
|
|
512
|
+
`)})]},s++));continue}if(a.trim()===""){n++;continue}const l=a.match(/^(#{1,6})\s+(.+)$/);if(l){const u=l[1].length,h=l[2],d={1:24,2:20,3:17,4:15,5:14,6:13};i.push(g.jsx("div",{style:{fontSize:d[u]||14,fontWeight:u<=2?700:600,color:u<=2?t.textBright:t.textPrimary,marginTop:u<=2?24:16,marginBottom:8,paddingBottom:u<=2?6:0,borderBottom:u<=2?`1px solid ${t.border}`:"none"},children:Rs(h,t)},s++)),n++;continue}if(/^(-{3,}|\*{3,}|_{3,})$/.test(a.trim())){i.push(g.jsx("hr",{style:{border:"none",borderTop:`1px solid ${t.border}`,margin:"16px 0"}},s++)),n++;continue}if(a.trim().startsWith("<!--")){for(;n<r.length&&!r[n].includes("-->");)n++;n++;continue}if(a.includes("|")&&n+1<r.length&&/^\s*\|[\s\-:|]+\|\s*$/.test(r[n+1])){const u=[],h=a.split("|").map(d=>d.trim()).filter(Boolean);for(n+=2;n<r.length&&r[n].includes("|")&&r[n].trim()!=="";)u.push(r[n].split("|").map(d=>d.trim()).filter(Boolean)),n++;i.push(g.jsx("div",{style:{overflowX:"auto",margin:"8px 0"},children:g.jsxs("table",{style:{borderCollapse:"collapse",width:"100%",fontSize:13},children:[g.jsx("thead",{children:g.jsx("tr",{children:h.map((d,p)=>g.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`2px solid ${t.border}`,color:t.textBright,fontWeight:600,whiteSpace:"nowrap"},children:Rs(d,t)},p))})}),g.jsx("tbody",{children:u.map((d,p)=>g.jsx("tr",{children:d.map((m,y)=>g.jsx("td",{style:{padding:"6px 12px",borderBottom:`1px solid ${t.border}`,color:t.textPrimary},children:Rs(m,t)},y))},p))})]})},s++));continue}if(/^(\s*)[-*+]\s/.test(a)){const u=[];for(;n<r.length&&/^(\s*)[-*+]\s/.test(r[n]);){const h=r[n].match(/^(\s*)[-*+]\s+(.+)$/);h&&u.push({text:h[2],indent:h[1].length}),n++}i.push(g.jsx("ul",{style:{margin:"6px 0",paddingLeft:24,color:t.textPrimary,fontSize:14,lineHeight:1.7},children:u.map((h,d)=>g.jsx("li",{style:{marginLeft:h.indent>0?16:0},children:Rs(h.text,t)},d))},s++));continue}if(/^\s*\d+[.)]\s/.test(a)){const u=[];for(;n<r.length&&/^\s*\d+[.)]\s/.test(r[n]);){const h=r[n].match(/^\s*\d+[.)]\s+(.+)$/);h&&u.push(h[1]),n++}i.push(g.jsx("ol",{style:{margin:"6px 0",paddingLeft:24,color:t.textPrimary,fontSize:14,lineHeight:1.7},children:u.map((h,d)=>g.jsx("li",{children:Rs(h,t)},d))},s++));continue}if(a.startsWith(">")){const u=[];for(;n<r.length&&r[n].startsWith(">");)u.push(r[n].replace(/^>\s?/,"")),n++;i.push(g.jsx("blockquote",{style:{borderLeft:`3px solid ${t.accent}`,paddingLeft:14,margin:"8px 0",color:t.textSecondary,fontSize:14,lineHeight:1.6,fontStyle:"italic"},children:u.map((h,d)=>g.jsx("div",{children:Rs(h,t)},d))},s++));continue}if(/^- \[[ x]\]\s/.test(a)){const u=[];for(;n<r.length&&/^- \[[ x]\]\s/.test(r[n]);){const h=r[n].includes("[x]"),d=r[n].replace(/^- \[[ x]\]\s+/,"");u.push({checked:h,text:d}),n++}i.push(g.jsx("ul",{style:{listStyle:"none",margin:"6px 0",paddingLeft:4,color:t.textPrimary,fontSize:14,lineHeight:1.7},children:u.map((h,d)=>g.jsxs("li",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[g.jsx("span",{style:{color:h.checked?t.success:t.textMuted,flexShrink:0},children:h.checked?"☑":"☐"}),g.jsx("span",{style:{color:h.checked?t.textSecondary:t.textPrimary},children:Rs(h.text,t)})]},d))},s++));continue}i.push(g.jsx("p",{style:{margin:"6px 0",color:t.textPrimary,fontSize:14,lineHeight:1.7},children:Rs(a,t)},s++)),n++}return i}function Rs(e,t){if(!e)return e;const r=[];let i=e,n=0;for(;i.length>0;){let s=i.match(/^(.*?)`([^`]+)`/);if(s){s[1]&&r.push(s[1]),r.push(g.jsx("code",{style:{backgroundColor:t.bgTertiary,padding:"1px 6px",borderRadius:4,fontSize:"0.9em",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',color:t.accent},children:s[2]},n++)),i=i.slice(s[0].length);continue}if(s=i.match(/^(.*?)\*\*(.+?)\*\*/),s){s[1]&&r.push(s[1]),r.push(g.jsx("strong",{style:{color:t.textBright,fontWeight:600},children:s[2]},n++)),i=i.slice(s[0].length);continue}if(s=i.match(/^(.*?)\*(.+?)\*/),s){s[1]&&r.push(s[1]),r.push(g.jsx("em",{children:s[2]},n++)),i=i.slice(s[0].length);continue}if(s=i.match(/^(.*?)\[([^\]]+)\]\(([^)]+)\)/),s){s[1]&&r.push(s[1]),r.push(g.jsx("a",{href:s[3],target:"_blank",rel:"noopener noreferrer",style:{color:t.accent,textDecoration:"none"},onMouseEnter:a=>a.target.style.textDecoration="underline",onMouseLeave:a=>a.target.style.textDecoration="none",children:s[2]},n++)),i=i.slice(s[0].length);continue}r.push(i);break}return r.length===1?r[0]:r}function Xq({moduleData:e,onBack:t,onStartLearning:r}){const{theme:i}=Bt(),n=M.useMemo(()=>Qq(i),[i]),s=M.useRef(null),[a,l]=M.useState(null),[u,h]=M.useState(null),[d,p]=M.useState(!0),[m,y]=M.useState(null),[x,v]=M.useState(null),[S,C]=M.useState(null),[B,R]=M.useState(!1),E=e==null?void 0:e.slug;M.useEffect(()=>{E&&(p(!0),y(null),fetch(`http://localhost:3456/api/module/${encodeURIComponent(E)}`).then(O=>{if(!O.ok)throw new Error("Module not found");return O.json()}).then(O=>{l(O.files||{}),h(O.meta||{});const $=Jb.find(j=>{var W;return(W=O.files)==null?void 0:W[j.key]});v(($==null?void 0:$.key)||null),p(!1)}).catch(O=>{y(O.message),p(!1)}))},[E]),M.useEffect(()=>{s.current&&(s.current.scrollTop=0)},[x]);const L=M.useMemo(()=>a?Jb.filter(O=>a[O.key]):[],[a]),k=(u==null?void 0:u.title)||(e==null?void 0:e.title)||E,A=(e==null?void 0:e.icon)||"📘",z=(e==null?void 0:e.category)||(u==null?void 0:u.category)||"",U=(e==null?void 0:e.difficulty)||(u==null?void 0:u.difficulty)||"",q=(u==null?void 0:u.description)||(e==null?void 0:e.description)||"",H=a&&x?a[x]:null,Y=O=>{switch((O||"").toLowerCase()){case"beginner":return i.success;case"intermediate":return i.warning;case"advanced":return i.error;default:return i.textMuted}},F=(e==null?void 0:e.status)==="completed"?"Review":e!=null&&e.status?"Continue":"Start Learning";return g.jsxs("div",{style:n.container,children:[g.jsxs("div",{style:n.header,children:[g.jsxs("button",{style:n.backButton,onClick:t,children:["←"," Modules"]}),g.jsxs("div",{style:n.headerContent,children:[g.jsxs("div",{style:n.headerTop,children:[g.jsx("span",{style:n.icon,children:A}),g.jsxs("div",{style:n.headerInfo,children:[g.jsx("h2",{style:n.title,children:k}),g.jsxs("div",{style:n.badges,children:[z&&g.jsx("span",{style:n.categoryBadge,children:z}),U&&g.jsx("span",{style:{...n.difficultyBadge,color:Y(U),backgroundColor:`${Y(U)}18`},children:U}),(e==null?void 0:e.status)==="completed"&&g.jsxs("span",{style:n.completedBadge,children:["✓"," Completed"]}),(e==null?void 0:e.status)&&e.status!=="completed"&&e.walkthroughStep!=null&&g.jsxs("span",{style:n.progressBadge,children:["Step ",e.walkthroughStep,"/",e.totalSteps||"?"]}),(e==null?void 0:e.xpEarned)>0&&g.jsxs("span",{style:n.xpBadge,children:[e.xpEarned," XP"]})]})]}),r&&g.jsx("button",{style:{...n.startButton,backgroundColor:B?i.accentHover||"#4b9eff":i.accent},onClick:()=>r(E),onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:F})]}),q&&g.jsx("p",{style:n.description,children:q})]})]}),d?g.jsxs("div",{style:n.loadingState,children:[g.jsx("div",{style:n.spinner}),g.jsx("p",{style:n.loadingText,children:"Loading materials..."})]}):m?g.jsxs("div",{style:n.errorState,children:[g.jsx("span",{style:n.errorIcon,children:"⚠️"}),g.jsx("p",{style:n.errorTitle,children:"Failed to load module"}),g.jsx("p",{style:n.errorSubtext,children:m})]}):L.length===0?g.jsxs("div",{style:n.errorState,children:[g.jsx("span",{style:n.errorIcon,children:"📚"}),g.jsx("p",{style:n.errorTitle,children:"No materials available"}),g.jsx("p",{style:n.errorSubtext,children:"This module doesn't have any readable content files yet."})]}):g.jsxs("div",{style:n.body,children:[g.jsx("div",{style:n.tabBar,children:L.map(O=>g.jsxs("button",{onClick:()=>v(O.key),onMouseEnter:()=>C(O.key),onMouseLeave:()=>C(null),style:{...n.tab,backgroundColor:x===O.key?`${i.accent}18`:S===O.key?i.bgTertiary:"transparent",color:x===O.key?i.accent:i.textSecondary,borderBottom:x===O.key?`2px solid ${i.accent}`:"2px solid transparent"},children:[g.jsx("span",{style:n.tabIcon,children:O.icon}),g.jsx("span",{children:O.label})]},O.key))}),g.jsx("div",{style:n.content,ref:s,children:H?Kq(H,i):g.jsx("p",{style:{color:i.textMuted},children:"Select a tab to view content."})})]}),g.jsx("style",{children:`
|
|
513
|
+
@keyframes spin {
|
|
514
|
+
from { transform: rotate(0deg); }
|
|
515
|
+
to { transform: rotate(360deg); }
|
|
516
|
+
}
|
|
517
|
+
`})]})}function Qq(e){return{container:{display:"flex",flexDirection:"column",height:"100%",maxWidth:960,margin:"0 auto",width:"100%"},header:{display:"flex",flexDirection:"column",gap:12,paddingBottom:16,borderBottom:`1px solid ${e.border}`,flexShrink:0},backButton:{display:"inline-flex",alignItems:"center",gap:4,padding:"4px 0",background:"none",border:"none",color:e.accent,fontSize:13,fontWeight:500,cursor:"pointer",fontFamily:"inherit",alignSelf:"flex-start"},headerContent:{display:"flex",flexDirection:"column",gap:8},headerTop:{display:"flex",alignItems:"center",gap:14},icon:{fontSize:36,lineHeight:1,flexShrink:0},headerInfo:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4},title:{fontSize:20,fontWeight:700,color:e.textBright,margin:0},badges:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},categoryBadge:{fontSize:11,color:e.textMuted,textTransform:"capitalize"},difficultyBadge:{fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:4,textTransform:"capitalize"},completedBadge:{fontSize:11,fontWeight:600,color:e.success,backgroundColor:`${e.success}18`,padding:"2px 8px",borderRadius:4},progressBadge:{fontSize:11,fontWeight:600,color:e.accent,backgroundColor:`${e.accent}18`,padding:"2px 8px",borderRadius:4},xpBadge:{fontSize:11,fontWeight:600,color:e.warning,backgroundColor:`${e.warning}18`,padding:"2px 8px",borderRadius:4},startButton:{flexShrink:0,padding:"8px 20px",fontSize:13,fontWeight:600,color:e.bgPrimary,backgroundColor:e.accent,border:"none",borderRadius:8,cursor:"pointer",transition:"background-color 0.15s ease"},description:{fontSize:14,color:e.textSecondary,margin:0,lineHeight:1.5},body:{display:"flex",flexDirection:"column",flex:1,minHeight:0},tabBar:{display:"flex",gap:0,borderBottom:`1px solid ${e.border}`,flexShrink:0,marginTop:12,overflowX:"auto"},tab:{display:"flex",alignItems:"center",gap:6,padding:"10px 16px",border:"none",background:"none",cursor:"pointer",fontSize:13,fontWeight:500,whiteSpace:"nowrap",transition:"background-color 0.12s ease, color 0.12s ease",fontFamily:"inherit"},tabIcon:{fontSize:14,flexShrink:0},content:{flex:1,overflowY:"auto",paddingTop:16,paddingBottom:32,minHeight:0},loadingState:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16},spinner:{width:32,height:32,border:`3px solid ${e.border}`,borderTop:`3px solid ${e.accent}`,borderRadius:"50%",animation:"spin 0.8s linear infinite"},loadingText:{fontSize:14,color:e.textSecondary,margin:0},errorState:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:24},errorIcon:{fontSize:36,opacity:.5},errorTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:0},errorSubtext:{fontSize:14,color:e.textSecondary,margin:0,textAlign:"center",maxWidth:320}}}const Zq="http://localhost:3456";function Jq(e,t){return fetch(`${Zq}/api/canvas`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({v:1,type:e,payload:t,source:"playground",timestamp:Date.now()})}).then(r=>r.json())}const eS=[{category:"Diagrams",icon:"📊",items:[{label:"Mermaid Flowchart",desc:"Animated step-through diagram",type:"canvas:diagram",payload:{format:"mermaid",content:`graph TD
|
|
518
|
+
A[Working Directory] -->|git add| B[Staging Area]
|
|
519
|
+
B -->|git commit| C[Local Repo]
|
|
520
|
+
C -->|git push| D[Remote Repo]`,animate:!0}},{label:"Sequence Diagram",desc:"Client-server interaction",type:"canvas:diagram",payload:{format:"mermaid",content:`sequenceDiagram
|
|
521
|
+
participant Client
|
|
522
|
+
participant Server
|
|
523
|
+
participant DB
|
|
524
|
+
Client->>Server: POST /api/users
|
|
525
|
+
Server->>DB: INSERT INTO users
|
|
526
|
+
DB-->>Server: OK
|
|
527
|
+
Server-->>Client: 201 Created`}}]},{category:"Quizzes",icon:"📝",items:[{label:"Timed Choice",desc:"Multiple choice with timer",type:"canvas:quiz",payload:{quizType:"timed-choice",question:"What does git add do?",options:["Stage changes for commit","Push to remote","Create a branch","Delete a file"],correctIndex:0,timeLimit:30}},{label:"Drag Order",desc:"Sort items in correct order",type:"canvas:quiz",payload:{quizType:"drag-order",question:"Put these git steps in order:",options:["git add .",'git commit -m "msg"',"git push origin main"],correctIndex:0}},{label:"Matching",desc:"Match terms to definitions",type:"canvas:quiz",payload:{quizType:"matching",question:"Match the command to its purpose:",pairs:[{left:"git add",right:"Stage changes"},{left:"git commit",right:"Save snapshot"},{left:"git push",right:"Upload to remote"}]}},{label:"Fill in the Blank",desc:"Complete the code",type:"canvas:quiz",payload:{quizType:"fill-blank",question:"Complete the command to stage all files:",code:"git ___0___ .",blanks:[{index:0,answer:"add"}]}}]},{category:"Games",icon:"🎮",items:[{label:"Speed Round",desc:"Quick-fire Q&A",type:"canvas:game",payload:{gameType:"speed-round",title:"Git Command Sprint",module:"demo",rounds:[{question:"Stage changes?",answer:"git add",options:["git add","git commit","git push"]},{question:"Save snapshot?",answer:"git commit",options:["git add","git commit","git push"]},{question:"Upload to remote?",answer:"git push",options:["git add","git commit","git push"]}]}},{label:"Memory Match",desc:"Match pairs from memory",type:"canvas:game",payload:{gameType:"memory-match",title:"Git Memory Match",module:"demo",pairs:[{term:"git add",definition:"Stage changes"},{term:"git commit",definition:"Save snapshot"},{term:"git push",definition:"Upload to remote"}]}},{label:"Classify",desc:"Sort items into categories",type:"canvas:game",payload:{gameType:"classify",title:"Local vs Remote",module:"demo",categories:["Local","Remote"],items:[{text:"git add",category:"Local"},{text:"git commit",category:"Local"},{text:"git push",category:"Remote"},{text:"git pull",category:"Remote"}]}}]},{category:"Terminal",icon:"💻",items:[{label:"Practice Terminal",desc:"Task with validations and hints",type:"canvas:terminal",payload:{task:'Create a new directory called "my-project" and initialize it as a Git repository.',validations:[{label:"my-project directory created",passed:!1},{label:".git directory exists",passed:!1}],hints:["Use mkdir to create a directory","Use git init inside the directory"],module:"demo",cwd:"/tmp"}}]},{category:"Code Editor",icon:"⌨️",items:[{label:"Code Playground",desc:"Interactive code editor with run",type:"canvas:code",payload:{language:"javascript",code:`// Write a function that returns the sum of two numbers
|
|
528
|
+
function add(a, b) {
|
|
529
|
+
// your code here
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
console.log(add(2, 3)); // should print 5`,tests:[{input:"add(2, 3)",expected:"5"},{input:"add(-1, 1)",expected:"0"}],hints:["Use the + operator","Return the result of a + b"]}}]},{category:"HTML Content",icon:"🖼️",items:[{label:"Image Card",desc:"Styled image with caption",type:"canvas:html",payload:{html:'<div style="text-align:center;padding:20px"><img src="https://picsum.photos/600/300" alt="Random landscape" style="max-width:100%;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.3)"><p style="color:#8b949e;margin-top:12px;font-size:14px">A beautiful random landscape from Picsum</p></div>'}},{label:"Further Reading",desc:"Link card with dark theme",type:"canvas:html",payload:{html:'<div style="background:#161b22;border:1px solid #30363d;border-radius:10px;padding:20px"><h3 style="color:#e6edf3;margin:0 0 12px">Further Reading</h3><div style="display:flex;flex-direction:column;gap:8px"><a href="https://git-scm.com/doc" target="_blank" style="display:block;padding:10px 14px;background:#21262d;border-radius:8px;color:#58a6ff;text-decoration:none"><strong>Git Documentation</strong><br><span style="color:#8b949e;font-size:13px">Official reference manual</span></a><a href="https://learngitbranching.js.org" target="_blank" style="display:block;padding:10px 14px;background:#21262d;border-radius:8px;color:#58a6ff;text-decoration:none"><strong>Learn Git Branching</strong><br><span style="color:#8b949e;font-size:13px">Interactive visual tutorial</span></a></div></div>',title:"Further Reading"}},{label:"Video Embed",desc:"YouTube video player",type:"canvas:html",payload:{html:'<div style="position:relative;padding-bottom:56.25%;height:0"><iframe src="https://www.youtube.com/embed/HVsySz-h9r4" style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;border-radius:8px" allowfullscreen></iframe></div><p style="color:#c9d1d9;margin-top:12px;font-size:14px">Git Tutorial for Beginners (12:34)</p>'}}]},{category:"Web Embed",icon:"🌐",items:[{label:"Basic Embed",desc:"Embed a website in an iframe",type:"canvas:web-embed",payload:{url:"https://httpbin.org",title:"httpbin — HTTP testing",module:"demo"}},{label:"With Annotations",desc:"Embed with overlay annotations",type:"canvas:web-embed",payload:{url:"https://httpbin.org",title:"Annotated httpbin",annotations:[{x:20,y:10,text:"Navigation area"},{x:50,y:50,text:"Main content"}]}},{label:"Split View",desc:"Side-by-side comparison",type:"canvas:web-embed",payload:{url:"https://httpbin.org",splitUrl:"https://httpbin.org/html",title:"Compare layouts"}}]},{category:"Dashboard",icon:"📈",items:[{label:"Progress Dashboard",desc:"XP, belt, modules, achievements",type:"canvas:dashboard",payload:{progress:{xp:275,belt:"green",modules:[{slug:"git",status:"completed",xp:120},{slug:"react-hooks",status:"in-progress",step:5,xp:85},{slug:"testing",status:"not-started",xp:0}],streak:3,completedCount:1,totalCount:3},achievements:{unlocked:[],near:[]}}}]},{category:"Celebrations",icon:"🎉",items:[{label:"XP Award",desc:"Confetti with XP amount",type:"canvas:celebrate",payload:{type:"xp",xpAwarded:25}},{label:"Level Up",desc:"Belt promotion celebration",type:"canvas:celebrate",payload:{type:"level-up",xpAwarded:50,newBelt:"green"}},{label:"Perfect Score",desc:"Extra confetti for perfection",type:"canvas:celebrate",payload:{type:"perfect-score",xpAwarded:30}}]},{category:"Real Terminal",icon:"🖥️",items:[{label:"PTY Terminal",desc:"Full interactive shell via WebSocket",type:"canvas:real-terminal",payload:{cwd:"/tmp",module:"demo"}}]},{category:"Workshop",icon:"🔧",items:[{label:"Code Workshop",desc:"Editor + terminal + task bar",type:"canvas:workshop",payload:{task:"Implement the add function and make the tests pass.",files:[{name:"utils.js",content:`function add(a, b) {
|
|
533
|
+
// TODO: implement
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
module.exports = { add };`,language:"javascript"},{name:"test.js",content:`const { add } = require("./utils");
|
|
537
|
+
console.log(add(2, 3) === 5 ? "PASS" : "FAIL");
|
|
538
|
+
console.log(add(-1, 1) === 0 ? "PASS" : "FAIL");`,language:"javascript"}],validations:[{label:"add(2, 3) returns 5",passed:!1},{label:"add(-1, 1) returns 0",passed:!1}],hints:["Use the + operator","Return a + b"],cwd:"/tmp/workshop",module:"demo"}}]},{category:"Lists & Controls",icon:"📋",items:[{label:"Smart List (Cards)",desc:"Card grid with icons and actions",type:"chat:send",payload:{role:"assistant",content:`Here are some topics to explore:
|
|
539
|
+
|
|
540
|
+
<!-- list: {"id":"topics-demo","style":"cards","items":[{"icon":"book","title":"Variables","description":"Store and manage data","action":"Teach me about variables"},{"icon":"code","title":"Functions","description":"Reusable blocks of logic","action":"Teach me about functions"},{"icon":"rocket","title":"Async/Await","description":"Handle asynchronous operations","action":"Teach me about async/await"},{"icon":"puzzle","title":"Closures","description":"Functions that remember scope","action":"Teach me about closures"}]} -->`}},{label:"Smart List (Numbered)",desc:"Ordered step list",type:"chat:send",payload:{role:"assistant",content:`Follow these steps to set up your project:
|
|
541
|
+
|
|
542
|
+
<!-- list: {"id":"setup-steps","style":"numbered","items":[{"title":"Install Node.js","description":"Download from nodejs.org"},{"title":"Clone the repository","description":"git clone https://github.com/example/repo"},{"title":"Install dependencies","description":"Run npm install in the project root"},{"title":"Start the dev server","description":"Run npm run dev"}]} -->`}},{label:"Smart List (Checklist)",desc:"Checkable task list",type:"chat:send",payload:{role:"assistant",content:`Your exercise checklist:
|
|
543
|
+
|
|
544
|
+
<!-- list: {"id":"checklist-demo","style":"checklist","items":[{"title":"Create a new branch","description":"Use git checkout -b feature/my-feature"},{"title":"Write the function","description":"Implement the add() function"},{"title":"Add unit tests","description":"Cover edge cases"},{"title":"Submit a pull request"}]} -->`}},{label:"Smart List (Compact)",desc:"Dense inline list",type:"chat:send",payload:{role:"assistant",content:`Quick reference:
|
|
545
|
+
|
|
546
|
+
<!-- list: {"id":"compact-demo","style":"compact","items":[{"icon":"zap","title":"git add","description":"Stage changes"},{"icon":"check","title":"git commit","description":"Save snapshot"},{"icon":"rocket","title":"git push","description":"Upload to remote"},{"icon":"target","title":"git pull","description":"Download updates"}]} -->`}},{label:"Progress Bar",desc:"Horizontal fill bar",type:"chat:send",payload:{role:"assistant",content:`You're making great progress!
|
|
547
|
+
|
|
548
|
+
<!-- progress: {"id":"progress-bar","label":"Walkthrough Progress","current":3,"total":7,"style":"bar"} -->`}},{label:"Progress Steps",desc:"Step dots like a wizard",type:"chat:send",payload:{role:"assistant",content:`Module progress:
|
|
549
|
+
|
|
550
|
+
<!-- progress: {"id":"progress-steps","label":"React Hooks","current":4,"total":6,"style":"steps"} -->`}},{label:"Progress Ring",desc:"Circular percentage",type:"chat:send",payload:{role:"assistant",content:`Overall completion:
|
|
551
|
+
|
|
552
|
+
<!-- progress: {"id":"progress-ring","label":"Course Completion","current":7,"total":10,"style":"ring"} -->`}},{label:"Info Card (Tip)",desc:"Blue tip callout",type:"chat:send",payload:{role:"assistant",content:'Here\'s something useful:\n\n<!-- card: {"id":"tip-demo","type":"tip","title":"Pro Tip","content":"Use `const` by default, switch to `let` only when you need reassignment. Never use `var` in modern JavaScript."} -->'}},{label:"Info Card (Warning)",desc:"Yellow warning callout",type:"chat:send",payload:{role:"assistant",content:`Watch out for this:
|
|
553
|
+
|
|
554
|
+
<!-- card: {"id":"warn-demo","type":"warning","title":"Common Mistake","content":"Don't forget to \`await\` your async functions — otherwise you'll get a Promise object instead of the actual value."} -->`}},{label:"Info Card (Concept)",desc:"Purple concept highlight",type:"chat:send",payload:{role:"assistant",content:`Key concept:
|
|
555
|
+
|
|
556
|
+
<!-- card: {"id":"concept-demo","type":"concept","title":"Closure","content":"A **closure** is a function that has access to variables from its outer (enclosing) scope, even after the outer function has returned."} -->`}},{label:"Code Snippet",desc:"Highlighted code with copy button",type:"chat:send",payload:{role:"assistant",content:`Here's the implementation:
|
|
557
|
+
|
|
558
|
+
<!-- code: {"id":"code-demo","language":"javascript","filename":"utils.js","code":"function debounce(fn, delay) {\\n let timer;\\n return function (...args) {\\n clearTimeout(timer);\\n timer = setTimeout(() => fn.apply(this, args), delay);\\n };\\n}","highlight":[3,4]} -->`}},{label:"Step Tracker",desc:"Visual step-by-step progress",type:"chat:send",payload:{role:"assistant",content:`Exercise progress:
|
|
559
|
+
|
|
560
|
+
<!-- steps: {"id":"steps-demo","current":2,"steps":[{"label":"Create file","status":"done"},{"label":"Write function","status":"done"},{"label":"Add tests","status":"active"},{"label":"Run tests","status":"pending"},{"label":"Submit PR","status":"pending"}]} -->`}}]},{category:"Chat Actions",icon:"💬",items:[{label:"Assistant Message",desc:"Send a markdown chat message",type:"chat:send",payload:{role:"assistant",content:`**Great question!** Git has three main areas:
|
|
561
|
+
|
|
562
|
+
1. **Working Directory** — where you edit files
|
|
563
|
+
2. **Staging Area** — where you prepare commits
|
|
564
|
+
3. **Repository** — where commits are stored
|
|
565
|
+
|
|
566
|
+
Which area do you think \`git add\` moves files to?`}},{label:"Update Suggestion Chips",desc:"Change the bottom suggestion strip",type:"chat:suggestions",payload:{suggestions:[{label:"🧪 Run tests",text:"npm test"},{label:"📊 Show diagram",text:"Show me a diagram"},{label:"🎮 Play game",text:"/teach --game"},{label:"💡 Give hint",text:"Give me a hint"}]}},{label:"Smart Buttons (Single)",desc:"Single-choice inline buttons",type:"chat:send",payload:{role:"assistant",content:`What would you like to learn about?
|
|
567
|
+
|
|
568
|
+
<!-- buttons: {"id":"topic-demo","type":"single","prompt":"Pick a topic:","options":[{"label":"Variables","value":"Teach me about variables"},{"label":"Functions","value":"Teach me about functions"},{"label":"Loops","value":"Teach me about loops"}]} -->`}},{label:"Smart Buttons (Multi)",desc:"Multi-select with submit",type:"chat:send",payload:{role:"assistant",content:`Which of these have you used before?
|
|
569
|
+
|
|
570
|
+
<!-- buttons: {"id":"prereqs-demo","type":"multi","prompt":"Select all that apply:","options":[{"label":"Git","value":"Git"},{"label":"npm","value":"npm"},{"label":"VS Code","value":"VS Code"},{"label":"Docker","value":"Docker"}]} -->`}},{label:"Smart Buttons (Rating)",desc:"1-5 difficulty rating",type:"chat:send",payload:{role:"assistant",content:`How difficult was that exercise?
|
|
571
|
+
|
|
572
|
+
<!-- buttons: {"id":"rating-demo","type":"rating","prompt":"Rate the difficulty:","options":[{"label":"1 - Easy","value":"Difficulty: 1/5"},{"label":"2","value":"Difficulty: 2/5"},{"label":"3","value":"Difficulty: 3/5"},{"label":"4","value":"Difficulty: 4/5"},{"label":"5 - Hard","value":"Difficulty: 5/5"}]} -->`}}]}];function eU({item:e,theme:t,onPreview:r}){const[i,n]=M.useState(null),[s,a]=M.useState(!1),l=e.type.startsWith("canvas:")&&e.type!=="canvas:celebrate",u=M.useCallback(async()=>{n("sending");try{const d=await Jq(e.type,e.payload);n(d.ok?"sent":"error")}catch{n("error")}setTimeout(()=>n(null),4e3)},[e]),h=tU(t);return g.jsxs("div",{style:h.card,children:[g.jsxs("div",{style:h.cardHeader,children:[g.jsxs("div",{children:[g.jsx("div",{style:h.cardLabel,children:e.label}),g.jsx("div",{style:h.cardDesc,children:e.desc})]}),g.jsxs("div",{style:h.cardActions,children:[g.jsxs("button",{style:h.toggleBtn,onClick:()=>a(d=>!d),title:s?"Hide payload":"Show payload",children:[s?"▾":"▸"," JSON"]}),g.jsx("button",{style:{...h.sendBtn,...i==="sent"?h.sendBtnSent:{},...i==="error"?h.sendBtnError:{}},onClick:u,disabled:i==="sending",children:i==="sending"?"...":i==="sent"?"✓ Sent":i==="error"?"✗ Error":"▶ Send"}),i==="sent"&&l&&r&&g.jsx("button",{style:h.previewBtn,onClick:()=>r(e.type),title:"View the rendered component",children:"👁 View"})]})]}),s&&g.jsx("pre",{style:h.payload,children:JSON.stringify(e.payload,null,2)}),g.jsx("div",{style:h.typeBadge,children:e.type})]})}function tU(e){return{card:{background:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:10,padding:"14px 16px",position:"relative"},cardHeader:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12},cardLabel:{fontSize:14,fontWeight:600,color:e.textPrimary},cardDesc:{fontSize:12,color:e.textSecondary,marginTop:2},cardActions:{display:"flex",gap:6,flexShrink:0},toggleBtn:{padding:"4px 10px",fontSize:11,color:e.textSecondary,background:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer",fontFamily:"monospace"},sendBtn:{padding:"4px 14px",fontSize:12,fontWeight:600,color:"#fff",background:e.accent,border:"none",borderRadius:6,cursor:"pointer",minWidth:72,transition:"background 0.2s"},sendBtnSent:{background:e.success||"#3fb950"},sendBtnError:{background:e.error||"#f85149"},previewBtn:{padding:"4px 10px",fontSize:12,fontWeight:600,color:"#fff",background:"#8b5cf6",border:"none",borderRadius:6,cursor:"pointer",minWidth:60},payload:{marginTop:10,padding:12,background:e.bgPrimary,border:`1px solid ${e.border}`,borderRadius:8,fontSize:11,lineHeight:1.5,color:e.textSecondary,overflow:"auto",maxHeight:300,fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word"},typeBadge:{position:"absolute",bottom:8,right:10,fontSize:10,color:e.accent,fontFamily:"monospace",opacity:.6}}}function rU({onPreview:e}){const{theme:t}=Bt(),[r,i]=M.useState(()=>{const a={};return eS.forEach(l=>{a[l.category]=!0}),a}),n=M.useCallback(a=>{i(l=>({...l,[a]:!l[a]}))},[]),s=M.useMemo(()=>iU(t),[t]);return g.jsxs("div",{style:s.container,children:[g.jsxs("div",{style:s.header,children:[g.jsx("h1",{style:s.title,children:"Canvas Playground"}),g.jsxs("p",{style:s.subtitle,children:["Interactive demo of every canvas component and chat action. Click ",g.jsx("strong",{children:"Send"})," to fire, then ",g.jsx("strong",{children:"View"})," to see the result. Chat actions appear in the chat pane. Use ",g.jsx("strong",{children:"Back"})," to return here."]})]}),g.jsx("div",{style:s.grid,children:eS.map(a=>g.jsxs("div",{style:s.section,children:[g.jsxs("button",{style:s.sectionHeader,onClick:()=>n(a.category),children:[g.jsx("span",{style:s.sectionIcon,children:a.icon}),g.jsx("span",{style:s.sectionTitle,children:a.category}),g.jsx("span",{style:s.sectionCount,children:a.items.length}),g.jsx("span",{style:s.sectionChevron,children:r[a.category]?"▾":"▸"})]}),r[a.category]&&g.jsx("div",{style:s.sectionBody,children:a.items.map((l,u)=>g.jsx(eU,{item:l,theme:t,onPreview:e},u))})]},a.category))})]})}function iU(e){return{container:{maxWidth:900,margin:"0 auto",padding:"0 0 40px"},header:{marginBottom:24},title:{fontSize:24,fontWeight:700,color:e.textPrimary,margin:0},subtitle:{fontSize:13,color:e.textSecondary,marginTop:6,lineHeight:1.5},grid:{display:"flex",flexDirection:"column",gap:16},section:{background:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,overflow:"hidden"},sectionHeader:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"12px 16px",background:"none",border:"none",cursor:"pointer",fontFamily:"inherit",textAlign:"left"},sectionIcon:{fontSize:18},sectionTitle:{fontSize:15,fontWeight:600,color:e.textPrimary,flex:1},sectionCount:{fontSize:11,color:e.textMuted||e.textSecondary,background:e.bgTertiary,padding:"2px 8px",borderRadius:10},sectionChevron:{fontSize:12,color:e.textSecondary},sectionBody:{display:"flex",flexDirection:"column",gap:8,padding:"0 12px 12px"}}}const Is="http://localhost:3456",my=`${Is}/api`,nU=/<!--\s*buttons:\s*(\{[\s\S]*?\})\s*-->/g,sU=["single","multi","rating"];function oU(e){if(!e||typeof e!="string")return{cleanText:"",buttons:[]};const t=[];let r=e;for(const i of[...e.matchAll(nU)]){let n;try{n=JSON.parse(i[1])}catch{continue}if(!n||typeof n!="object"||typeof n.id!="string"||!n.id||!sU.includes(n.type)||!Array.isArray(n.options)||n.options.length===0)continue;const s=n.options.filter(a=>a&&typeof a.label=="string"&&typeof a.value=="string");s.length!==0&&(t.push({id:n.id,type:n.type,prompt:typeof n.prompt=="string"?n.prompt:void 0,options:s}),r=r.replace(i[0],""))}return{cleanText:r.trim(),buttons:t}}const aU=[{re:/<!--\s*list:\s*(\{[\s\S]*?\})\s*-->/g,type:"list",required:["items"]},{re:/<!--\s*progress:\s*(\{[\s\S]*?\})\s*-->/g,type:"progress",required:["current","total"]},{re:/<!--\s*card:\s*(\{[\s\S]*?\})\s*-->/g,type:"card",required:["content"]},{re:/<!--\s*code:\s*(\{[\s\S]*?\})\s*-->/g,type:"code",required:["code"]},{re:/<!--\s*steps:\s*(\{[\s\S]*?\})\s*-->/g,type:"steps",required:["steps"]}];function lU(e){if(!e||typeof e!="string")return{cleanText:"",blocks:[]};const t=[];let r=e;for(const{re:i,type:n,required:s}of aU){i.lastIndex=0;for(const a of[...e.matchAll(i)]){let l;try{l=JSON.parse(a[1])}catch{continue}!l||typeof l!="object"||typeof l.id!="string"||!l.id||s.some(u=>l[u]==null)||(t.push({blockType:n,...l}),r=r.replace(a[0],""))}}return{cleanText:r.trim(),blocks:t}}const he={dashboard:"dashboard",canvas:"canvas",quiz:"quiz",playground:"playground",terminal:"terminal",realTerminal:"real-terminal",workshop:"workshop",game:"game",html:"html",webEmbed:"web-embed",modules:"modules",achievements:"achievements",settings:"settings",journeys:"journeys",journeyMap:"journey-map",moduleDetail:"module-detail",about:"about",playgroundDemo:"playground-demo"},vt={chat:"chat",visual:"visual",immersive:"immersive"};function cU(e,t){if(e===vt.chat)return"100%";if(e===vt.immersive)return"0%";switch(t){case he.quiz:return"30%";case he.playground:case he.terminal:case he.realTerminal:case he.canvas:case he.settings:return"35%";case he.workshop:case he.webEmbed:return"25%";case he.achievements:return"38%";default:return"40%"}}const hU=new Set([he.terminal,he.realTerminal,he.workshop,he.playground,he.game,he.settings,he.achievements,he.modules,he.moduleDetail,he.journeys,he.journeyMap,he.about,he.webEmbed,he.playgroundDemo,he.canvas,he.html]),Ad=[{name:"White",minXP:0,badge:"⬜",color:"#e6e6e6"},{name:"Yellow",minXP:50,badge:"🟨",color:"#f0c040"},{name:"Green",minXP:150,badge:"🟩",color:"#3fb950"},{name:"Blue",minXP:400,badge:"🟦",color:"#58a6ff"},{name:"Purple",minXP:800,badge:"🟦a",color:"#bc8cff"},{name:"Brown",minXP:1500,badge:"🟫",color:"#a0522d"},{name:"Black",minXP:3e3,badge:"⬛",color:"#484f58"}];function Pg(e){let t=Ad[0];for(const r of Ad)e>=r.minXP&&(t=r);return t}function uU(e){for(const t of Ad)if(e<t.minXP)return t;return null}function dU(){var On;const{theme:e}=Bt(),[t,r]=M.useState(vt.chat),[i,n]=M.useState("home"),[s,a]=M.useState(null),[l,u]=M.useState(null),[h,d]=M.useState(null),[p,m]=M.useState(null),[y,x]=M.useState(null),[v,S]=M.useState(null),[C,B]=M.useState(null),[R,E]=M.useState(null),[L,k]=M.useState(null),[A,z]=M.useState(null),[U,q]=M.useState(null),[H,Y]=M.useState(null),[F,O]=M.useState(null),[$,j]=M.useState(null),[W,P]=M.useState(null),[Z,ee]=M.useState(0),[I,Q]=M.useState(null),te=LL(),{sessions:X}=RL(),[ce,oe]=M.useState(!1),[ye,ve]=M.useState([]),[Ce,Ee]=M.useState(null),[Ke,ct]=M.useState([]),[ze,pt]=M.useState([]),dt=M.useCallback(()=>{fetch(`${Is}/api/sessions`).then(se=>se.ok?se.json():null).then(se=>{se!=null&&se.sessions&&ve(se.sessions)}).catch(()=>{})},[]);M.useEffect(()=>{dt()},[dt,te.sessionId]);const ae=M.useMemo(()=>{const se=Ke.length===0?te.messages:te.messages.length===0?Ke:[...Ke,...te.messages];return ze.length===0?se:[...se,...ze]},[Ke,te.messages,ze]);M.useEffect(()=>{if(!te.sessionId||ye.length===0){Ee(null);return}const se=ye.find(Me=>Me.sessionId===te.sessionId);Ee((se==null?void 0:se.title)||null)},[te.sessionId,ye]);const ht=M.useRef(null),ut=M.useRef(!1),Vt=M.useRef([]),[zr,kr]=M.useState(!1),ki=M.useCallback(se=>{switch(se){case he.dashboard:return l;case he.canvas:return h;case he.quiz:return p;case he.playground:return y;case he.terminal:return v;case he.game:return C;case he.html:return R;case he.realTerminal:return L;case he.workshop:return A;case he.webEmbed:return U;default:return null}},[l,h,p,y,v,C,R,L,A,U]),Xs=M.useCallback((se,Me)=>{switch(se){case he.dashboard:u(Me);break;case he.canvas:d(Me);break;case he.quiz:m(Me);break;case he.playground:x(Me);break;case he.terminal:S(Me);break;case he.game:B(Me);break;case he.html:E(Me);break;case he.realTerminal:k(Me);break;case he.workshop:z(Me);break;case he.webEmbed:q(Me);break}},[u,d,m,x,S,B,E,k,z,q]),Mt=M.useCallback(se=>{a(Me=>{if(Me&&Me!==se){const rt=ki(Me);Vt.current=[...Vt.current,{mode:Me,data:rt}].slice(-20),kr(!0)}return se}),se===he.game?r(vt.immersive):r(vt.visual)},[ki]),hn=M.useCallback(()=>{const se=Vt.current;if(se.length===0)return;const Me=se[se.length-1];Vt.current=se.slice(0,-1),kr(se.length>1),Xs(Me.mode,Me.data),a(Me.mode),Me.mode===he.game?r(vt.immersive):r(vt.visual)},[Xs]),Ui=M.useCallback(()=>{a(null),r(vt.chat),n(null),Vt.current=[],kr(!1)},[]),Tr=M.useCallback(()=>{r(vt.visual)},[]),bt=M.useCallback(()=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{a(se=>hU.has(se)?se:he.dashboard),r(vt.visual),n("home")},6e4)},[]),Qs=M.useCallback(se=>{switch(n(se),se){case"home":a(he.dashboard),r(vt.visual);break;case"modules":a(he.modules),r(vt.visual);break;case"achievements":a(he.achievements),r(vt.visual);break;case"settings":a(he.settings),r(vt.visual);break;case"journeys":a(he.journeys),r(vt.visual);break;case"about":a(he.about),r(vt.visual);break;case"playground":a(he.playgroundDemo),r(vt.visual);break}bt()},[bt]),un=M.useCallback(se=>{var rt,mt,Gt,Er,Mi;if(!se||!se.type)return;const Me=se.source==="playground";switch(se.type){case"canvas:dashboard":u(se.payload),Me||(a(Wt=>{const Be=Wt&&Wt!==he.dashboard;return se.source==="bridge"&&Be?Wt:(n("home"),he.dashboard)}),r(vt.visual)),bt();break;case"canvas:diagram":d(se.payload),Me||(Mt(he.canvas),n(null)),bt();break;case"canvas:quiz":m(se.payload),Me||(Mt(he.quiz),n(null)),bt();break;case"canvas:code":x(se.payload),Me||(Mt(he.playground),n(null)),bt();break;case"canvas:terminal":S(se.payload),Me||(Mt(he.terminal),n(null)),bt();break;case"canvas:game":B(se.payload),Me||(Mt(he.game),n(null));break;case"canvas:html":E(se.payload),Me||(Mt(he.html),n(null)),bt();break;case"canvas:web-embed":q(se.payload),Me||(Mt(he.webEmbed),n(null));break;case"canvas:real-terminal":k(se.payload),Me||(Mt(he.realTerminal),n(null)),bt();break;case"canvas:workshop":z(se.payload),Me||(Mt(he.workshop),n(null)),bt();break;case"canvas:journey-browser":Mt(he.journeys),n("journeys"),bt();break;case"canvas:journey-map":Y(se.payload),Mt(he.journeyMap),n("journeys"),bt();break;case"canvas:workshop-update":z(Wt=>Wt?{...Wt,...se.payload}:se.payload),bt();break;case"canvas:celebrate":j(se.payload),t===vt.immersive&&(r(vt.visual),a(he.dashboard),n("home")),setTimeout(()=>j(null),5e3);break;case"event:game-result":r(vt.visual),a(he.dashboard),n("home"),bt();break;case"chat:send":if((rt=se.payload)!=null&&rt.role&&((mt=se.payload)!=null&&mt.content)){const{cleanText:Wt,buttons:Be}=oU(se.payload.content),{cleanText:G,blocks:pe}=lU(Wt),ke={role:se.payload.role,text:G,id:`injected-${Date.now()}`};Be.length>0&&(ke.buttons=Be),pe.length>0&&(ke.blocks=pe),pt(yt=>[...yt,ke])}break;case"chat:suggestions":Q(((Gt=se.payload)==null?void 0:Gt.suggestions)||null);break}(Er=se.payload)!=null&&Er.module&&P(se.payload.module),((Mi=se.payload)==null?void 0:Mi.streak)!==void 0&&ee(se.payload.streak)},[Mt,bt,t]),{status:Ti,sendEvent:Jr}=PL(un),In=M.useCallback(({type:se,url:Me,alt:rt,title:mt})=>{if(!Me)return;const Gt=mt||rt||Me,Er=se==="image"?`<img src="${Me}" alt="${rt||""}" style="max-width:100%;height:auto;" />`:`<a href="${Me}" target="_blank">${Gt}</a>`;E({html:Er,title:Gt,module:W}),Mt(he.html),n(null),bt(),Jr("event:click",{element:se,data:{url:Me,alt:rt,title:mt}})},[Mt,bt,W,Jr]),$n=M.useCallback(({url:se,title:Me})=>{if(!se)return;q({url:se,title:Me||se,module:W}),Mt(he.webEmbed),n(null)},[Mt,W]),_r=M.useCallback(se=>{Q(null),te.send(se)},[te]),ei=M.useCallback(se=>{te.send(se)},[te]),Ei=M.useCallback(()=>{Q(null),te.clearMessages(),ct([]),pt([]),Ee(null),oe(!1),setTimeout(dt,500)},[te,dt]),jn=M.useCallback(async se=>{var Me;if(se===te.sessionId){oe(!1);return}te.clearMessages(),ct([]),Q(null),oe(!1);try{const rt=await fetch(`${Is}/api/sessions/${se}`);if(rt.ok){const mt=await rt.json();(Me=mt.messages)!=null&&Me.length&&ct(mt.messages),Ee(mt.title||null)}}catch{}try{await fetch(`${my}/chat/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:se})})}catch{}dt()},[te,dt]),Zs=M.useCallback(async se=>{te.clearMessages();try{await fetch(`${my}/chat/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:se})})}catch{}},[te]),dn=M.useCallback(async se=>{try{await fetch(`${Is}/api/sessions/${se}`,{method:"DELETE"})}catch{}se===te.sessionId&&(te.clearMessages(),Ee(null)),dt()},[te,dt]),di=M.useCallback(async(se,Me)=>{try{await fetch(`${Is}/api/sessions/${se}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:Me})})}catch{}se===te.sessionId&&Ee(Me),dt()},[te.sessionId,dt]),fn=M.useCallback(async(se,Me)=>{try{await fetch(`${Is}/api/sessions/${se}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({pinned:Me})})}catch{}dt()},[dt]);M.useEffect(()=>{Ti!=="connected"||ut.current||(ut.current=!0,fetch(`${Is}/api/progress`).then(se=>se.ok?se.json():null).then(se=>{var mt,Gt,Er,Mi;if(!se)return;const Me=Object.entries(se.modules||{}).map(([Wt,Be])=>({slug:Wt,...Be})),rt={progress:{xp:((mt=se.user)==null?void 0:mt.xp)||0,belt:(Gt=se.user)==null?void 0:Gt.belt,modules:Me,streak:((Er=se.user)==null?void 0:Er.streak)||0,completedCount:Me.filter(Wt=>Wt.status==="completed").length,totalCount:Me.length},achievements:se.achievements||{unlocked:[],near:[]}};u(rt),a(Wt=>Wt&&Wt!==he.dashboard?Wt:(r(vt.visual),n("home"),he.dashboard)),(Mi=se.user)!=null&&Mi.streak&&ee(se.user.streak)}).catch(()=>{}))},[Ti]),M.useEffect(()=>()=>{ht.current&&clearTimeout(ht.current)},[]);const[Vi,Js]=M.useState(()=>{try{return localStorage.getItem("socrates-chat-width")}catch{return null}}),[Vo,wt]=M.useState(!1),fi=M.useRef(null),os=M.useCallback(se=>{const Me=`${Math.min(Math.max(se,15),70)}%`;Js(Me);try{localStorage.setItem("socrates-chat-width",Me)}catch{}},[]),as=M.useCallback(se=>{se.preventDefault(),wt(!0),document.body.style.cursor="col-resize",document.body.style.userSelect="none";const Me=Gt=>Gt.touches?Gt.touches[0].clientX:Gt.clientX,rt=Gt=>{if(!fi.current)return;const Er=fi.current.getBoundingClientRect(),Mi=(Me(Gt)-Er.left)/Er.width*100;os(Mi)},mt=()=>{wt(!1),document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",rt),window.removeEventListener("mouseup",mt),window.removeEventListener("touchmove",rt),window.removeEventListener("touchend",mt)};window.addEventListener("mousemove",rt),window.addEventListener("mouseup",mt),window.addEventListener("touchmove",rt,{passive:!1}),window.addEventListener("touchend",mt)},[os]),Bi=((On=l==null?void 0:l.progress)==null?void 0:On.xp)??0,ls=Pg(Bi),pn=cU(t,s),Qa=t===vt.visual&&Vi?Vi:pn,Jt=t!==vt.chat,Fr=t!==vt.immersive,Nt=M.useMemo(()=>fU(e),[e]);return g.jsxs("div",{style:Nt.container,children:[g.jsx(UN,{activeNav:i,onNavClick:Qs,belt:ls,xp:Bi,streak:Z,onNewChat:Ei}),te.error&&g.jsxs("div",{style:Nt.errorBanner,children:[g.jsxs("span",{children:["Connection to Claude lost: ",te.error]}),g.jsx("button",{style:Nt.reconnectButton,onClick:()=>Ei(),children:"Reconnect"})]}),g.jsxs("div",{style:Nt.splitPane,ref:fi,children:[Fr&&g.jsxs("div",{style:{...Nt.chatPane,width:Qa,transition:Vo?"none":Nt.chatPane.transition,display:"flex",flexDirection:"row"},children:[g.jsx(Aq,{open:ce,sessions:ye,activeSessionId:te.sessionId,onSelect:jn,onNewChat:Ei,onDelete:dn,onRename:di,onTogglePin:fn,onClose:()=>oe(!1)}),g.jsx("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:g.jsx(p3,{messages:ae,isStreaming:te.isStreaming,status:te.status,onSend:_r,onStop:te.stop,onNewChat:Ei,onResume:Zs,sessions:X,sessionId:te.sessionId,compact:t===vt.visual&&["quiz","playground","terminal","real-terminal","workshop","canvas","settings","web-embed"].includes(s),onMediaClick:In,suggestions:I,sessionTitle:Ce,onToggleDrawer:()=>oe(se=>!se),drawerOpen:ce})})]}),Fr&&Jt&&g.jsx("div",{style:Nt.resizeHandle,onMouseDown:as,onTouchStart:as,onDoubleClick:()=>{Js(null);try{localStorage.removeItem("socrates-chat-width")}catch{}},title:"Drag to resize · Double-click to reset",children:g.jsx("div",{style:Nt.resizeGrip})}),Jt&&g.jsxs("div",{style:Nt.visualPane,children:[t!==vt.immersive&&g.jsxs("div",{style:Nt.canvasControls,children:[zr&&g.jsx("button",{style:Nt.backButton,onClick:hn,title:"Go back",children:"← Back"}),g.jsx("button",{style:Nt.closeVisual,onClick:Ui,children:"✕"})]}),g.jsxs("div",{style:{...Nt.visualContent,padding:s===he.workshop||s===he.realTerminal||s===he.webEmbed?0:24,...s===he.webEmbed?{overflow:"hidden",display:"flex",flexDirection:"column"}:{}},children:[s===he.dashboard&&g.jsx(y3,{data:l,getBelt:Pg,getNextBelt:uU,BELTS:Ad}),s===he.canvas&&g.jsx(pN,{data:h}),s===he.quiz&&g.jsx(mN,{data:p,sendEvent:Jr}),s===he.playground&&g.jsx(wN,{data:y,sendEvent:Jr}),s===he.terminal&&g.jsx(EN,{data:v,sendEvent:Jr}),s===he.game&&g.jsx(IN,{data:C,sendEvent:Jr}),s===he.html&&g.jsx(AN,{data:R,onLinkClick:$n}),s===he.webEmbed&&g.jsx(Eq,{data:U,sendEvent:Jr,onReportBack:ei}),s===he.realTerminal&&g.jsx(yB,{data:L,sendEvent:Jr,onSendToChat:ei}),s===he.workshop&&g.jsx(Cq,{data:A,sendEvent:Jr,onSendToChat:ei}),s===he.modules&&g.jsx(GW,{data:l,onStartLearning:se=>_r("/teach "+se),onSelectModule:se=>{O(se),a(he.moduleDetail)}}),s===he.moduleDetail&&F&&g.jsx(Xq,{moduleData:F,onBack:()=>a(he.modules),onStartLearning:se=>_r("/teach "+se)}),s===he.achievements&&g.jsx(HW,{data:l}),s===he.settings&&g.jsx(JW,{}),s===he.journeys&&g.jsx(Hq,{onSelectJourney:se=>{Y(se),a(he.journeyMap)},onStartModule:se=>_r("/teach "+se)}),s===he.journeyMap&&g.jsx(Gq,{journey:H,onBack:()=>a(he.journeys),onStartModule:se=>_r("/teach "+se),onActivate:se=>{fetch("http://localhost:3456/api/journeys/activate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:se.slug})}).then(()=>a(he.journeys))}}),s===he.about&&g.jsx(zq,{}),s===he.playgroundDemo&&g.jsx(rU,{onPreview:se=>{const rt={"canvas:diagram":he.canvas,"canvas:quiz":he.quiz,"canvas:code":he.playground,"canvas:terminal":he.terminal,"canvas:real-terminal":he.realTerminal,"canvas:workshop":he.workshop,"canvas:game":he.game,"canvas:html":he.html,"canvas:web-embed":he.webEmbed,"canvas:dashboard":he.dashboard}[se];rt&&Mt(rt)}})]})]})]}),t===vt.immersive&&g.jsx(GN,{onClick:Tr}),$&&g.jsx(LN,{data:$,getBelt:Pg})]})}function fU(e){return{container:{display:"flex",flexDirection:"column",height:"100vh",backgroundColor:e.bgPrimary,color:e.textPrimary},errorBanner:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 20px",backgroundColor:e.errorBg,borderBottom:`1px solid ${e.error}`,fontSize:13,color:e.error,flexShrink:0},reconnectButton:{padding:"4px 12px",fontSize:12,color:"#fff",backgroundColor:e.errorButton,border:"none",borderRadius:6,cursor:"pointer"},splitPane:{display:"flex",flex:1,overflow:"hidden"},chatPane:{display:"flex",flexDirection:"column",transition:"width 0.3s ease, opacity 0.3s ease",minWidth:0,overflow:"hidden"},resizeHandle:{width:6,cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:e.border,transition:"background 0.15s ease",position:"relative",zIndex:5},resizeGrip:{width:3,height:32,borderRadius:2,background:e.textMuted||e.border,opacity:.5,transition:"opacity 0.15s ease"},visualPane:{flex:1,display:"flex",flexDirection:"column",position:"relative",minWidth:0,overflow:"hidden"},canvasControls:{position:"absolute",top:8,right:8,zIndex:10,display:"flex",alignItems:"center",gap:4},backButton:{height:28,padding:"0 10px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:500,color:e.textSecondary,backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer",fontFamily:"inherit"},closeVisual:{width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,color:e.textSecondary,backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer"},visualContent:{flex:1,overflow:"auto",padding:24},placeholder:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:12,color:e.textPrimary}}}function pU(){const[e,t]=M.useState(null);M.useEffect(()=>{fetch(`${Is}/api/settings`).then(i=>i.ok?i.json():null).then(i=>{i!=null&&i.model&&t(i.model)}).catch(()=>{})},[]),M.useEffect(()=>{const i=n=>t(n.detail);return window.addEventListener("settings:model-changed",i),()=>window.removeEventListener("settings:model-changed",i)},[]);const r=M.useMemo(()=>e?{model:e}:{},[e]);return g.jsx(BL,{url:my,config:r,children:g.jsx(dU,{})})}pL.createRoot(document.getElementById("root")).render(g.jsx(nS.StrictMode,{children:g.jsx(FL,{children:g.jsx(pU,{})})}));export{FS as $,pc as A,B3 as B,BA as C,d0 as D,RS as E,Ir as F,sj as G,a4 as H,Lv as I,fI as J,H3 as K,Ia as L,wU as M,Qd as N,lA as O,Ry as P,Pv as Q,ZP as R,Bu as S,nj as T,jc as U,mA as V,$c as W,Re as X,Fe as Y,X$ as Z,T as _,SA as a,w$ as a$,YP as a0,e1 as a1,Jv as a2,PU as a3,MU as a4,AU as a5,RU as a6,EU as a7,qy as a8,DU as a9,V$ as aA,O6 as aB,z$ as aC,i0 as aD,G1 as aE,$j as aF,KP as aG,SU as aH,yy as aI,Hc as aJ,Pj as aK,Dj as aL,M as aM,nS as aN,Fy as aO,Ds as aP,bc as aQ,Gv as aR,BD as aS,No as aT,G$ as aU,Mk as aV,Vd as aW,Xd as aX,yd as aY,Rk as aZ,Bk as a_,BU as aa,ga as ab,$U as ac,IU as ad,LU as ae,aO as af,BT as ag,UU as ah,gI as ai,ar as aj,Gs as ak,r0 as al,e2 as am,qo as an,jk as ao,Ye as ap,Ln as aq,ZO as ar,qU as as,VU as at,WU as au,$e as av,HU as aw,PO as ax,MO as ay,BO as az,bA as b,Pe as b0,yk as b1,ui as b2,bD as b3,zy as b4,ew as b5,zc as b6,iw as b7,TU as b8,E3 as b9,o0 as bA,Ck as bB,Mm as bC,Y$ as bD,Kd as bE,mU as bF,lt as bG,U$ as ba,O$ as bb,k6 as bc,n0 as bd,x$ as be,K$ as bf,Wc as bg,Ua as bh,pd as bi,L$ as bj,bz as bk,Nc as bl,md as bm,C$ as bn,Sk as bo,B6 as bp,M6 as bq,xo as br,v1 as bs,L6 as bt,s0 as bu,E6 as bv,D6 as bw,Va as bx,Vs as by,g1 as bz,ft as c,it as d,zS as e,sr as f,CA as g,rs as h,Hi as i,bI as j,Ha as k,ue as l,zk as m,CU as n,YU as o,kA as p,TA as q,GU as r,wA as s,pI as t,on as u,kO as v,lj as w,jU as x,vA as y,kU as z};
|