lookatstudy-mobile 0.31.0 → 0.31.2
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/package.json +1 -1
- package/server.cjs +15331 -9819
- package/sql-wasm.wasm +0 -0
- package/web/assets/{CanvasStage-Cyt4NB7v.js → CanvasStage-BbqLSbD4.js} +1 -1
- package/web/assets/{CommandPalette-maHlqYwL.js → CommandPalette-DQ5w84ic.js} +1 -1
- package/web/assets/{CompanionBotLab-BjbCeiRW.js → CompanionBotLab-4Juuhsy3.js} +1 -1
- package/web/assets/{CourseSearchPanel-wyjGWBGr.js → CourseSearchPanel-ThxY4JL1.js} +1 -1
- package/web/assets/{ExamView-BoGgfcwj.js → ExamView-DVLRcljJ.js} +1 -1
- package/web/assets/{ReviewPanel-BxY2T_Ut.js → ReviewPanel-D1jKVMQK.js} +1 -1
- package/web/assets/{SettingsView-CdxkxEkP.js → SettingsView-BHoTkY38.js} +2 -2
- package/web/assets/{VoicePanel-BzRCM6vH.js → VoicePanel-BP1Ur7sF.js} +1 -1
- package/web/assets/{abnfDiagram-N423BO3Z-iXwATPSN.js → abnfDiagram-VCTEODGH-Ca-5zS8J.js} +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-ODA7YWAP-C1yAT6qh.js → abnfDiagram-VCTEODGH-ODA7YWAP-ZI6_0Jfq.js} +1 -1
- package/web/assets/{arc-DIdxrd7q.js → arc-D2ssjz3E.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-C4PU3XN7-NvY1Ic-5.js → architectureDiagram-5GKGNRK7-C4PU3XN7-B2bOUqy0.js} +1 -1
- package/web/assets/{architectureDiagram-T3A2C74G-DwrvQJhj.js → architectureDiagram-5GKGNRK7-DCEYr1uX.js} +1 -1
- package/web/assets/{arrow-right-33rr0pBZ.js → arrow-right---oCZhx2.js} +1 -1
- package/web/assets/blockDiagram-I7D4REHJ-Dx9xiTwp.js +129 -0
- package/web/assets/{blockDiagram-NRAW4CY4-UMJ6PMQQ-DsNh9SAm.js → blockDiagram-NRAW4CY4-UMJ6PMQQ-Do5yGQuh.js} +1 -1
- package/web/assets/c4Diagram-7LVT6UL2-DXh9Ebug.js +38 -0
- package/web/assets/{c4Diagram-UCG6FXSJ-75X3U2P3-Df4YtSzV.js → c4Diagram-UCG6FXSJ-75X3U2P3-DH7ShBLp.js} +1 -1
- package/web/assets/channel-CNRWz7VW.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-D2YxB7H3.js → chunk-2Q5K7J3B-Bbluh_im.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-CdfFIz--.js → chunk-5VM5RSS4-CwJZ1eAQ.js} +1 -1
- package/web/assets/{chunk-7XDTSPCN-BBCpJUAH.js → chunk-7XDTSPCN-3TtQfLC2.js} +1 -1
- package/web/assets/{chunk-CTNIYPP6-DW2rJhu_.js → chunk-CTNIYPP6--48noAMq.js} +1 -1
- package/web/assets/{chunk-CXNFBKHE-renpw2QE.js → chunk-CXNFBKHE-BMfLUSYr.js} +1 -1
- package/web/assets/{chunk-2GRJ4B5K-BqUg5toN.js → chunk-F27PBJKO-DQz5Eh8R.js} +1 -1
- package/web/assets/{chunk-5RXB4S5H-zfO8batT.js → chunk-IMKFNOWR-mEHtzDJe.js} +5 -5
- package/web/assets/{chunk-ISA7TJRJ-DhN-xjNX.js → chunk-ISA7TJRJ-Cua7d2fi.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-smESCI0k.js → chunk-JWPE2WC7-DqWkk9f8.js} +1 -1
- package/web/assets/{chunk-LV3HUYFY-DTGGOw_N.js → chunk-LV3HUYFY-BCzMQT8Q.js} +1 -1
- package/web/assets/{chunk-M3IUQBOH-Cp2xYH3K.js → chunk-M3IUQBOH-B-r9ydC6.js} +1 -1
- package/web/assets/{chunk-NDIOYS4C-B_iYUPk5.js → chunk-NDIOYS4C-DkAwrWHj.js} +1 -1
- package/web/assets/{chunk-KBJHAD2P-CLazgX1V.js → chunk-POPQ4Y6H-BjpioqkZ.js} +1 -1
- package/web/assets/{chunk-RE4WF27V-DFrNGxeZ.js → chunk-RE4WF27V-CJEnGv6g.js} +1 -1
- package/web/assets/{chunk-6Q2QTUOP-c0FQ_SfU.js → chunk-SVP7TREG-DGaiaQgi.js} +4 -4
- package/web/assets/{chunk-GF5L2VYU-DiF8ZWcT.js → chunk-TICWLB2K-DqXyoflV.js} +1 -1
- package/web/assets/{chunk-VII2H2IX-CTIhHlIp.js → chunk-VII2H2IX-CHqS8QXi.js} +1 -1
- package/web/assets/{chunk-X5GNSKZ3-BnL2P09p.js → chunk-X5GNSKZ3-CPiurspk.js} +1 -1
- package/web/assets/{chunk-XCWWM2C3-B3diWYxV.js → chunk-XCWWM2C3-CnpRc-BX.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-Cm9DsbCI.js → chunk-XXDRQBXY-xXPgDheN.js} +1 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-C5s2iR9J.js +1 -0
- package/web/assets/classDiagram-ZZMXUADV-Cjli-tvb.js +1 -0
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-C5s2iR9J.js +1 -0
- package/web/assets/classDiagram-v2-VYDZK3BY-Cjli-tvb.js +1 -0
- package/web/assets/{core-CnhTLa0G.js → core-iYZpQJa6.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-B1ZJcbUV.js → cose-bilkent-JH36ORCC-Dr_WUhVB.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-OB24KH3T-BJpRu0cc.js → cose-bilkent-JH36ORCC-OB24KH3T-CQsWVK5X.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-GVF3BKWE-CLl32jOg.js → cynefin-OW5HDTMX-GVF3BKWE-DwLRaQ37.js} +1 -1
- package/web/assets/{cynefin-VYW2F7L2-BFZHy-wK.js → cynefin-OW5HDTMX-fybCqBi3.js} +3 -3
- package/web/assets/{cynefinDiagram-MW4NZA55-BECq_tlH.js → cynefinDiagram-5FMLGOSQ-BLqywzF8.js} +2 -2
- package/web/assets/{cynefinDiagram-5FMLGOSQ-H3WIRU3N-BpmHF9Wo.js → cynefinDiagram-5FMLGOSQ-H3WIRU3N-D7Mzcgjs.js} +1 -1
- package/web/assets/cytoscape.esm-Ix0LnXOy.js +331 -0
- package/web/assets/{dagre-3AP2YEHR-DCERTXHT-DIUrMTsj.js → dagre-3AP2YEHR-DCERTXHT-C3dpohva.js} +1 -1
- package/web/assets/dagre-GXQ25YYZ-QPjECY_W.js +4 -0
- package/web/assets/diagram-S7CK7UJ4-CwZRApeF.js +30 -0
- package/web/assets/{diagram-S7CK7UJ4-MULGZGEL-Bpt08-bP.js → diagram-S7CK7UJ4-MULGZGEL-Czqn_Fna.js} +1 -1
- package/web/assets/diagram-UQ7AKVKN-Bo8gzrdx.js +41 -0
- package/web/assets/{diagram-UQ7AKVKN-YQBY353J-DORAQMoA.js → diagram-UQ7AKVKN-YQBY353J-CgDXcRAT.js} +1 -1
- package/web/assets/{diagram-B4RE2ZJO-dNtQBNGN.js → diagram-VSXAHHWV-0w4db5zY.js} +3 -3
- package/web/assets/{diagram-VSXAHHWV-WLNH2ELY-Ce82dDi6.js → diagram-VSXAHHWV-WLNH2ELY-DbTl04rE.js} +1 -1
- package/web/assets/{diagram-Q27KOJAE-Bi0oJVBH.js → diagram-VX7I27RA-DJvH_pmt.js} +11 -11
- package/web/assets/{diagram-VX7I27RA-XW6YQV5G-D-fdo9DM.js → diagram-VX7I27RA-XW6YQV5G-fzWHr6UJ.js} +1 -1
- package/web/assets/{diagram-LBJQPF4R-BoiQEUHl.js → diagram-Z3DM3KII-DsT5qGVe.js} +2 -2
- package/web/assets/{diagram-Z3DM3KII-HG7RF65D-ZqMt25Js.js → diagram-Z3DM3KII-HG7RF65D-CDqb1-LL.js} +1 -1
- package/web/assets/{ebnfDiagram-BXEA7PRR-R3UwRAR7.js → ebnfDiagram-PWID7BFC-BoB0yBxV.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-OKY4VHYD-DDVM1P1I.js → ebnfDiagram-PWID7BFC-OKY4VHYD-Dl7tZHv0.js} +1 -1
- package/web/assets/{elk.bundled-Dv5OJ-BO.js → elk.bundled-Fo5ndUql.js} +1 -1
- package/web/assets/erDiagram-RLTQ6QDP-TcPkrxxF.js +99 -0
- package/web/assets/{erDiagram-SSCWMZ5O-PIPKOIK7-CxTLMFn2.js → erDiagram-SSCWMZ5O-PIPKOIK7-C13XODn3.js} +1 -1
- package/web/assets/{flowDiagram-A5DVABFB-2Z4AVO5R-DRUX3zZ5.js → flowDiagram-A5DVABFB-2Z4AVO5R-DNbmNTnm.js} +1 -1
- package/web/assets/flowDiagram-HODETNUW-D2o5XxIm.js +168 -0
- package/web/assets/{ganttDiagram-PKOTCBZU-D-5FV0PV.js → ganttDiagram-EL5Y4UJY-D36iMZvH.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-JZNG7GOG-DjG0obYU.js → ganttDiagram-EL5Y4UJY-JZNG7GOG-C5IgtJLL.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-DMWMLL3G-D70uly9x.js → gitGraphDiagram-WWUBYQGX-DMWMLL3G-BA7YVBKU.js} +1 -1
- package/web/assets/{gitGraphDiagram-DS77QQ5N-DF-LawNi.js → gitGraphDiagram-WWUBYQGX-DoayvLMW.js} +3 -3
- package/web/assets/{index-X3hjUtR3.js → index-5UvRMS_e.js} +1 -1
- package/web/assets/index-CJuEfFQr.js +53 -0
- package/web/assets/{index-CApU5KjU.js → index-DtMB_WdP.js} +1 -1
- package/web/assets/{index-DawWPxKA.js → index-Zmq94tKz.js} +4 -4
- package/web/assets/{infoDiagram-6WML65LV-w8kz4hEa.js → infoDiagram-27XIBGKW-DbMBXMvx.js} +1 -1
- package/web/assets/{infoDiagram-RXCK75RN-HANS5KVC-C1PHC-YD.js → infoDiagram-RXCK75RN-HANS5KVC-NdEBDyb0.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-7GCIT7WU-BrPFk2Ox.js → ishikawaDiagram-5VMMS53U-7GCIT7WU-CzqV69s-.js} +1 -1
- package/web/assets/{ishikawaDiagram-WSZJBQD7-C34Z0ADb.js → ishikawaDiagram-5VMMS53U-j9THtiQE.js} +4 -4
- package/web/assets/{journeyDiagram-NVQOT4AX-B6wtGi4C.js → journeyDiagram-3NMN7TZE-C3h3msUP.js} +2 -2
- package/web/assets/{journeyDiagram-EYS64GPL-OAPELBT7-CVn7FA19.js → journeyDiagram-EYS64GPL-OAPELBT7-ChETfPiS.js} +1 -1
- package/web/assets/{kanban-definition-3QL26DDD-I7RKWQQY-DSkHnZWn.js → kanban-definition-3QL26DDD-I7RKWQQY-Wjr70XLu.js} +1 -1
- package/web/assets/{kanban-definition-27J2QSJJ-Cauno8t4.js → kanban-definition-UXKFOSKX-C1b6cL5N.js} +6 -6
- package/web/assets/{katex-N6JRN4PM-7jQy_F2_.js → katex-N6JRN4PM-BIpBcqrZ.js} +1 -1
- package/web/assets/layout-D2XzcM9d.js +1 -0
- package/web/assets/{linear-DQOfHiUP.js → linear-CZIIlCMp.js} +1 -1
- package/web/assets/{main-BXa7WYYr.css → main-D9IB7N5p.css} +1 -1
- package/web/assets/{main-CmJlqSDk.js → main-Dj875aWF.js} +83 -83
- package/web/assets/{mermaid-layout-elk.core-h_IjwDpP.js → mermaid-layout-elk.core-CNNSrMhF.js} +2 -2
- package/web/assets/mermaid.core-CnNeOEec.js +312 -0
- package/web/assets/{mindmap-definition-FBJOCRG2-KIYZG64Y-De94GIvB.js → mindmap-definition-FBJOCRG2-KIYZG64Y-CE91aZQc.js} +1 -1
- package/web/assets/{mindmap-definition-FAOFIHXS-oc1QsLGD.js → mindmap-definition-YA3MSWOX-Dz0JwUgH.js} +1 -1
- package/web/assets/{pegDiagram-VL7TDLO6-C9eNGZDr.js → pegDiagram-XKGWAZYB-BEOg8IHd.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-OIP57N6J-C2k8WABX.js → pegDiagram-XKGWAZYB-OIP57N6J-CB6_i_dk.js} +1 -1
- package/web/assets/{pet-D6jEJc1f.js → pet-B9Zl6XGT.js} +1 -1
- package/web/assets/pie-CJLEE_I4.js +1 -0
- package/web/assets/{pieDiagram-E7YTZNPT-2UOTW327-h1VN7kXL.js → pieDiagram-E7YTZNPT-2UOTW327-C_aP-GDD.js} +1 -1
- package/web/assets/{pieDiagram-7S7Q4E2Y-lAjmXNe_.js → pieDiagram-E7YTZNPT-Btcl-uz0.js} +3 -3
- package/web/assets/{quadrantDiagram-CIZ2JOQS-B0NfwoFD.js → quadrantDiagram-AXDQQJYC-CA7HBTBO.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-SN3ASJJK-CVllGfdW.js → quadrantDiagram-AXDQQJYC-SN3ASJJK-CAd5tIhG.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-34742W6X-CqYqMw2v.js → railroadDiagram-O6MQD6OU-34742W6X-CLWiLZG6.js} +1 -1
- package/web/assets/{railroadDiagram-AXF67PYL-BiLISELA.js → railroadDiagram-O6MQD6OU-B7dkMwzi.js} +1 -1
- package/web/assets/{render-O7CIS3YK-C1DYXW0Z.js → render-O7CIS3YK-DQb_czkx.js} +7 -7
- package/web/assets/{requirementDiagram-LRYGKXZP-BMUGWzen.js → requirementDiagram-BXWQKSXE-C70GJhMZ.js} +5 -5
- package/web/assets/{requirementDiagram-EFPCY7ZU-NGAFFSMB-6i5RYobc.js → requirementDiagram-EFPCY7ZU-NGAFFSMB-Bc0CRxi2.js} +1 -1
- package/web/assets/{rotate-ccw-DhViz0iw.js → rotate-ccw-JEjtXKlH.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-3D3M4XPB-EtCUQUn1.js → sankeyDiagram-P5KCCOFB-3D3M4XPB-B9PL6--N.js} +1 -1
- package/web/assets/{sankeyDiagram-W5VNT64P-C_r4P5MM.js → sankeyDiagram-P5KCCOFB-BJl2AqaQ.js} +2 -2
- package/web/assets/{sequenceDiagram-SI44F4Z6-pG01U8Cr.js → sequenceDiagram-WJ2MYXX4-DtmTM2Q1.js} +4 -4
- package/web/assets/{sequenceDiagram-WJ2MYXX4-Q2IOPB4R-sL3lWU4l.js → sequenceDiagram-WJ2MYXX4-Q2IOPB4R-DH1L8a7Q.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-TfK3b41W.js → sizeCapture-INFHLROL-e9akerky.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-PSGVOMYM-VHssc8WH.js → sizeCapture-X5ZJPWSS-PSGVOMYM-CSyLq32l.js} +1 -1
- package/web/assets/stateDiagram-D77RDMKH-Dc057ccO.js +1 -0
- package/web/assets/{stateDiagram-HBIQ2CUA-4M2S6MAN-DY0svUZL.js → stateDiagram-HBIQ2CUA-4M2S6MAN-D_uV5i1Q.js} +1 -1
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-DBkBTIqA.js +1 -0
- package/web/assets/stateDiagram-v2-MP3YSRHH-D6iIkIH3.js +1 -0
- package/web/assets/swimlanes-42K2YHIH-ILKBiMPk.js +1 -0
- package/web/assets/{swimlanes-XN3QIQJK-N6N2CCQ6-tXCXpXUD.js → swimlanes-XN3QIQJK-N6N2CCQ6-CJ7qUhPg.js} +1 -1
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-lkgr5sGZ.js +8 -0
- package/web/assets/swimlanesDiagram-VR7AAH4N-D-ke9u7H.js +8 -0
- package/web/assets/{time-BgujFIZT.js → time-C0TNQg6r.js} +1 -1
- package/web/assets/{timeline-definition-Z64GVDOM-BID9BJj_.js → timeline-definition-24CTP7MA-BckRkRye.js} +3 -3
- package/web/assets/{timeline-definition-24CTP7MA-KN7RSRVM-uhQqtZRP.js → timeline-definition-24CTP7MA-KN7RSRVM-DxSbNuQs.js} +1 -1
- package/web/assets/{transform-B5_amWNh.js → transform-Bd_a5eGM.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-AKJ7LXAN-MJEMZHM_.js → vennDiagram-4TSXK5OY-AKJ7LXAN-hG9roRh0.js} +1 -1
- package/web/assets/{vennDiagram-T6HMQDX7-noYkNxPf.js → vennDiagram-4TSXK5OY-Bxkq0y0p.js} +5 -5
- package/web/assets/{wardleyDiagram-VM6X3IG4-3B6A3BN5-D_oZuxaD.js → wardleyDiagram-VM6X3IG4-3B6A3BN5-CLmKLRJP.js} +1 -1
- package/web/assets/{wardleyDiagram-T6FBY63Y-CnUMOnEG.js → wardleyDiagram-VM6X3IG4-CaTbamBI.js} +1 -1
- package/web/assets/xychartDiagram-S5SC5T6Z-CHtC3u6M.js +7 -0
- package/web/assets/{xychartDiagram-S5SC5T6Z-OBDNV6WG-Cd6y2GuD.js → xychartDiagram-S5SC5T6Z-OBDNV6WG-ZjDcqfTl.js} +1 -1
- package/web/index.html +3 -3
- package/web/pet.html +2 -2
- package/web/assets/blockDiagram-VBNYF7ZC-BX4qMKoE.js +0 -132
- package/web/assets/c4Diagram-5PPSVZJV-wjiwvuPV.js +0 -10
- package/web/assets/channel-D9baWZnV.js +0 -1
- package/web/assets/chunk-RYQCIY6F-CXmfoCP1.js +0 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-CiuZ0TyW.js +0 -1
- package/web/assets/classDiagram-JCYQIIEL-DJMqLmfy.js +0 -1
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-CiuZ0TyW.js +0 -1
- package/web/assets/classDiagram-v2-OCEON4UE-DJMqLmfy.js +0 -1
- package/web/assets/cytoscape.esm-DTSO7Bv0.js +0 -331
- package/web/assets/dagre-VZM6K2ZE-D-oITinM.js +0 -4
- package/web/assets/diagram-7IWD3JNH-07yeFgf1.js +0 -30
- package/web/assets/diagram-UB23O5K3-FLVFr6Cc.js +0 -41
- package/web/assets/erDiagram-JOGREHBK-Dr_g_g8q.js +0 -85
- package/web/assets/flowDiagram-UKHOOZJN-BEX6wJhw.js +0 -156
- package/web/assets/graph-C9eacEi8.js +0 -1
- package/web/assets/index-DZN4z5wF.js +0 -53
- package/web/assets/layout-DEXfKzaS.js +0 -1
- package/web/assets/map-Czzmt4hB.js +0 -1
- package/web/assets/mermaid.core-n1vgOa_E.js +0 -314
- package/web/assets/pie-5VdQHRMI.js +0 -1
- package/web/assets/stateDiagram-OKZ733FA-CHPWqFKU.js +0 -1
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-B2GuWRPu.js +0 -1
- package/web/assets/stateDiagram-v2-UEYNNEHI-mdLp8HQQ.js +0 -1
- package/web/assets/swimlanes-SLNWSIFB-BoK2wZ7r.js +0 -2
- package/web/assets/swimlanesDiagram-ULZ7WXOC-CI3RFQDZ.js +0 -8
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-DLkFvd5d.js +0 -8
- package/web/assets/xychartDiagram-ELKLHX3M-Ck_2zrW5.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as c,T as y,W as U,X as G,Y as tr,$ as E,a0 as Y,a1 as W,a2 as ie,a3 as m,a4 as L,a5 as g,a6 as P,a7 as Oe,a8 as xe,a9 as I,aa as oe,ab as ar,ac as de,ad as S,ae as N,af as z,ag as ir,ah as T,ai as or,aj as dr,ak as sr,al as ur,am as fr}from"./render-O7CIS3YK-C1DYXW0Z.js";import{_ as s}from"./mermaid-layout-elk.core-h_IjwDpP.js";function x(e,n,r,t){var a;do a=ie(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}s(x,"addDummyNode");function Le(e){var n=new y().setGraph(e.graph());return c(e.nodes(),function(r){n.setNode(r,e.node(r))}),c(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}s(Le,"simplify");function se(e){var n=new y({multigraph:e.isMultigraph()}).setGraph(e.graph());return c(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),c(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}s(se,"asNonCompoundGraph");function J(e,n){var r=e.x,t=e.y,a=n.x-r,i=n.y-t,o=e.width/2,d=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var u,f;return Math.abs(i)*o>Math.abs(a)*d?(i<0&&(d=-d),u=d*a/i,f=d):(a<0&&(o=-o),u=o,f=o*i/a),{x:r+u,y:t+f}}s(J,"intersectRect");function j(e){var n=m(L(ue(e)+1),function(){return[]});return c(e.nodes(),function(r){var t=e.node(r),a=t.rank;g(a)||(n[a][t.order]=r)}),n}s(j,"buildLayerMatrix");function Ne(e){var n=P(m(e.nodes(),function(r){return e.node(r).rank}));c(e.nodes(),function(r){var t=e.node(r);Oe(t,"rank")&&(t.rank-=n)})}s(Ne,"normalizeRanks");function _e(e){var n=P(m(e.nodes(),function(i){return e.node(i).rank})),r=[];c(e.nodes(),function(i){var o=e.node(i).rank-n;r[o]||(r[o]=[]),r[o].push(i)});var t=0,a=e.graph().nodeRankFactor;c(r,function(i,o){g(i)&&o%a!==0?--t:t&&c(i,function(d){e.node(d).rank+=t})})}s(_e,"removeEmptyRanks");function $(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),x(e,"border",a,n)}s($,"addBorderNode");function ue(e){return E(m(e.nodes(),function(n){var r=e.node(n).rank;if(!g(r))return r}))}s(ue,"maxRank");function Ce(e,n){var r={lhs:[],rhs:[]};return c(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}s(Ce,"partition");function Pe(e,n){var r=xe();try{return n()}finally{console.log(e+" time: "+(xe()-r)+"ms")}}s(Pe,"time");function Re(e,n){return n()}s(Re,"notime");function Ie(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&c(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,o=a.maxRank+1;i<o;++i)K(e,"borderLeft","_bl",r,a,i),K(e,"borderRight","_br",r,a,i)}}s(n,"dfs"),c(e.children(),n)}s(Ie,"addBorderSegments");function K(e,n,r,t,a,i){var o={width:0,height:0,rank:i,borderType:n},d=a[n][i-1],u=x(e,"border",o,r);a[n][i]=u,e.setParent(u,t),d&&e.setEdge(d,u,{weight:1})}s(K,"addBorderNode");function Se(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&fe(e)}s(Se,"adjust");function Te(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&je(e),(n==="lr"||n==="rl")&&(Me(e),fe(e))}s(Te,"undo");function fe(e){c(e.nodes(),function(n){Q(e.node(n))}),c(e.edges(),function(n){Q(e.edge(n))})}s(fe,"swapWidthHeight");function Q(e){var n=e.width;e.width=e.height,e.height=n}s(Q,"swapWidthHeightOne");function je(e){c(e.nodes(),function(n){M(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,M),Object.prototype.hasOwnProperty.call(r,"y")&&M(r)})}s(je,"reverseY");function M(e){e.y=-e.y}s(M,"reverseYOne");function Me(e){c(e.nodes(),function(n){F(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,F),Object.prototype.hasOwnProperty.call(r,"x")&&F(r)})}s(Me,"swapXY");function F(e){var n=e.x;e.x=e.y,e.y=n}s(F,"swapXYOne");var O,cr=(O=class{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return Z(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&Z(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,Fe)),t=t._prev;return"["+n.join(", ")+"]"}},s(O,"List"),O);function Z(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}s(Z,"unlink");function Fe(e,n){if(e!=="_next"&&e!=="_prev")return n}s(Fe,"filterOutLinks");var lr=ur(1);function Ve(e,n){if(e.nodeCount()<=1)return[];var r=Ae(e,n||lr),t=Be(r.graph,r.buckets,r.zeroIdx);return I(m(t,function(a){return e.outEdges(a.v,a.w)}))}s(Ve,"greedyFAS");function Be(e,n,r){for(var t=[],a=n[n.length-1],i=n[0],o;e.nodeCount();){for(;o=i.dequeue();)V(e,n,r,o);for(;o=a.dequeue();)V(e,n,r,o);if(e.nodeCount()){for(var d=n.length-2;d>0;--d)if(o=n[d].dequeue(),o){t=t.concat(V(e,n,r,o,!0));break}}}return t}s(Be,"doGreedyFAS");function V(e,n,r,t,a){var i=a?[]:void 0;return c(e.inEdges(t.v),function(o){var d=e.edge(o),u=e.node(o.v);a&&i.push({v:o.v,w:o.w}),u.out-=d,D(n,r,u)}),c(e.outEdges(t.v),function(o){var d=e.edge(o),u=o.w,f=e.node(u);f.in-=d,D(n,r,f)}),e.removeNode(t.v),i}s(V,"removeNode");function Ae(e,n){var r=new y,t=0,a=0;c(e.nodes(),function(d){r.setNode(d,{v:d,in:0,out:0})}),c(e.edges(),function(d){var u=r.edge(d.v,d.w)||0,f=n(d),l=u+f;r.setEdge(d.v,d.w,l),a=Math.max(a,r.node(d.v).out+=f),t=Math.max(t,r.node(d.w).in+=f)});var i=L(a+t+3).map(function(){return new cr}),o=t+1;return c(r.nodes(),function(d){D(i,o,r.node(d))}),{graph:r,buckets:i,zeroIdx:o}}s(Ae,"buildState");function D(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}s(D,"assignBucket");function Ge(e){var n=e.graph().acyclicer==="greedy"?Ve(e,r(e)):Ye(e);c(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,ie("rev"))});function r(t){return function(a){return t.edge(a).weight}}s(r,"weightFn")}s(Ge,"run");function Ye(e){var n=[],r={},t={};function a(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,c(e.outEdges(i),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?n.push(o):a(o.w)}),delete r[i])}return s(a,"dfs"),c(e.nodes(),a),n}s(Ye,"dfsFAS");function De(e){c(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}s(De,"undo");function We(e){e.graph().dummyChains=[],c(e.edges(),function(n){ze(e,n)})}s(We,"run");function ze(e,n){var r=n.v,t=e.node(r).rank,a=n.w,i=e.node(a).rank,o=n.name,d=e.edge(n),u=d.labelRank;if(i!==t+1){e.removeEdge(n);var f=void 0,l,h;for(h=0,++t;t<i;++h,++t)d.points=[],f={width:0,height:0,edgeLabel:d,edgeObj:n,rank:t},l=x(e,"edge",f,"_d"),t===u&&(f.width=d.width,f.height=d.height,f.dummy="edge-label",f.labelpos=d.labelpos),e.setEdge(r,l,{weight:d.weight},o),h===0&&e.graph().dummyChains.push(l),r=l;e.setEdge(r,a,{weight:d.weight},o)}}s(ze,"normalizeEdge");function Xe(e){c(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}s(Xe,"undo");function X(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var i=P(m(e.outEdges(t),function(o){return r(o.w)-e.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}s(r,"dfs"),c(e.sources(),r)}s(X,"longestPath");function _(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}s(_,"slack");function ce(e){var n=new y({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,i;qe(n,e)<t;)a=He(n,e),i=n.hasNode(a.v)?_(e,a):-_(e,a),Ue(n,e,i);return n}s(ce,"feasibleTree");function qe(e,n){function r(t){c(n.nodeEdges(t),function(a){var i=a.v,o=t===i?a.w:i;!e.hasNode(o)&&!_(n,a)&&(e.setNode(o,{}),e.setEdge(t,o,{}),r(o))})}return s(r,"dfs"),c(e.nodes(),r),e.nodeCount()}s(qe,"tightTree");function He(e,n){return oe(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return _(n,r)})}s(He,"findMinSlackEdge");function Ue(e,n,r){c(e.nodes(),function(t){n.node(t).rank+=r})}s(Ue,"shiftRanks");Je.CycleException=R;function Je(e){var n={},r={},t=[];function a(i){if(Object.prototype.hasOwnProperty.call(r,i))throw new R;Object.prototype.hasOwnProperty.call(n,i)||(r[i]=!0,n[i]=!0,c(e.predecessors(i),a),delete r[i],t.push(i))}if(s(a,"visit"),c(e.sinks(),a),ar(n)!==e.nodeCount())throw new R;return t}s(Je,"topsort");function R(){}s(R,"CycleException");R.prototype=new Error;function le(e,n,r){fr(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],i={};return c(n,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);he(e,o,r==="post",i,t,a)}),a}s(le,"dfs");function he(e,n,r,t,a,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),c(a(n),function(o){he(e,o,r,t,a,i)}),r&&i.push(n))}s(he,"doDfs");function $e(e,n){return le(e,n,"post")}s($e,"postorder");function Ke(e,n){return le(e,n,"pre")}s(Ke,"preorder");k.initLowLimValues=H;k.initCutValues=q;k.calcCutValue=ve;k.leaveEdge=we;k.enterEdge=me;k.exchangeEdges=be;function k(e){e=Le(e),X(e);var n=ce(e);H(n),q(n,e);for(var r,t;r=we(n);)t=me(n,e,r),be(n,e,r,t)}s(k,"networkSimplex");function q(e,n){var r=$e(e,e.nodes());r=r.slice(0,r.length-1),c(r,function(t){Qe(e,n,t)})}s(q,"initCutValues");function Qe(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=ve(e,n,r)}s(Qe,"assignCutValue");function ve(e,n,r){var t=e.node(r),a=t.parent,i=!0,o=n.edge(r,a),d=0;return o||(i=!1,o=n.edge(a,r)),d=o.weight,c(n.nodeEdges(r),function(u){var f=u.v===r,l=f?u.w:u.v;if(l!==a){var h=f===i,v=n.edge(u).weight;if(d+=h?v:-v,en(e,r,l)){var p=e.edge(r,l).cutvalue;d+=h?-p:p}}}),d}s(ve,"calcCutValue");function H(e,n){arguments.length<2&&(n=e.nodes()[0]),pe(e,{},1,n)}s(H,"initLowLimValues");function pe(e,n,r,t,a){var i=r,o=e.node(t);return n[t]=!0,c(e.neighbors(t),function(d){Object.prototype.hasOwnProperty.call(n,d)||(r=pe(e,n,r,d,t))}),o.low=i,o.lim=r++,a?o.parent=a:delete o.parent,r}s(pe,"dfsAssignLowLim");function we(e){return de(e.edges(),function(n){return e.edge(n).cutvalue<0})}s(we,"leaveEdge");function me(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var i=e.node(t),o=e.node(a),d=i,u=!1;i.lim>o.lim&&(d=o,u=!0);var f=S(n.edges(),function(l){return u===ee(e,e.node(l.v),d)&&u!==ee(e,e.node(l.w),d)});return oe(f,function(l){return _(n,l)})}s(me,"enterEdge");function be(e,n,r,t){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(t.v,t.w,{}),H(e),q(e,n),Ze(e,n)}s(be,"exchangeEdges");function Ze(e,n){var r=de(e.nodes(),function(a){return!n.node(a).parent}),t=Ke(e,r);t=t.slice(1),c(t,function(a){var i=e.node(a).parent,o=n.edge(a,i),d=!1;o||(o=n.edge(i,a),d=!0),n.node(a).rank=n.node(i).rank+(d?o.minlen:-o.minlen)})}s(Ze,"updateRanks");function en(e,n,r){return e.hasEdge(n,r)}s(en,"isTreeEdge");function ee(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}s(ee,"isDescendant");function nn(e){switch(e.graph().ranker){case"network-simplex":ne(e);break;case"tight-tree":rn(e);break;case"longest-path":hr(e);break;default:ne(e)}}s(nn,"rank");var hr=X;function rn(e){X(e),ce(e)}s(rn,"tightTreeRanker");function ne(e){k(e)}s(ne,"networkSimplexRanker");function tn(e){var n=x(e,"root",{},"_root"),r=an(e),t=E(N(r))-1,a=2*t+1;e.graph().nestingRoot=n,c(e.edges(),function(o){e.edge(o).minlen*=a});var i=on(e)+1;c(e.children(),function(o){ge(e,n,a,i,t,r,o)}),e.graph().nodeRankFactor=a}s(tn,"run");function ge(e,n,r,t,a,i,o){var d=e.children(o);if(!d.length){o!==n&&e.setEdge(n,o,{weight:0,minlen:r});return}var u=$(e,"_bt"),f=$(e,"_bb"),l=e.node(o);e.setParent(u,o),l.borderTop=u,e.setParent(f,o),l.borderBottom=f,c(d,function(h){ge(e,n,r,t,a,i,h);var v=e.node(h),p=v.borderTop?v.borderTop:h,w=v.borderBottom?v.borderBottom:h,b=v.borderTop?t:2*t,C=p!==w?1:a-i[o]+1;e.setEdge(u,p,{weight:b,minlen:C,nestingEdge:!0}),e.setEdge(w,f,{weight:b,minlen:C,nestingEdge:!0})}),e.parent(o)||e.setEdge(n,u,{weight:0,minlen:a+i[o]})}s(ge,"dfs");function an(e){var n={};function r(t,a){var i=e.children(t);i&&i.length&&c(i,function(o){r(o,a+1)}),n[t]=a}return s(r,"dfs"),c(e.children(),function(t){r(t,1)}),n}s(an,"treeDepths");function on(e){return z(e.edges(),function(n,r){return n+e.edge(r).weight},0)}s(on,"sumWeights");function dn(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,c(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}s(dn,"cleanup");function sn(e,n,r){var t={},a;c(r,function(i){for(var o=e.parent(i),d,u;o;){if(d=e.parent(o),d?(u=t[d],t[d]=o):(u=a,a=o),u&&u!==o){n.setEdge(u,o);return}o=d}})}s(sn,"addSubgraphConstraints");function un(e,n,r){var t=fn(e),a=new y({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return e.node(i)});return c(e.nodes(),function(i){var o=e.node(i),d=e.parent(i);(o.rank===n||o.minRank<=n&&n<=o.maxRank)&&(a.setNode(i),a.setParent(i,d||t),c(e[r](i),function(u){var f=u.v===i?u.w:u.v,l=a.edge(f,i),h=g(l)?0:l.weight;a.setEdge(f,i,{weight:e.edge(u).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&a.setNode(i,{borderLeft:o.borderLeft[n],borderRight:o.borderRight[n]}))}),a}s(un,"buildLayerGraph");function fn(e){for(var n;e.hasNode(n=ie("_root")););return n}s(fn,"createRootNode");function cn(e,n){for(var r=0,t=1;t<n.length;++t)r+=ln(e,n[t-1],n[t]);return r}s(cn,"crossCount");function ln(e,n,r){for(var t=ir(r,m(r,function(f,l){return l})),a=I(m(n,function(f){return T(m(e.outEdges(f),function(l){return{pos:t[l.w],weight:e.edge(l).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var o=2*i-1;i-=1;var d=m(new Array(o),function(){return 0}),u=0;return c(a.forEach(function(f){var l=f.pos+i;d[l]+=f.weight;for(var h=0;l>0;)l%2&&(h+=d[l+1]),l=l-1>>1,d[l]+=f.weight;u+=f.weight*h})),u}s(ln,"twoLayerCrossCount");function hn(e){var n={},r=S(e.nodes(),function(d){return!e.children(d).length}),t=E(m(r,function(d){return e.node(d).rank})),a=m(L(t+1),function(){return[]});function i(d){if(!Oe(n,d)){n[d]=!0;var u=e.node(d);a[u.rank].push(d),c(e.successors(d),i)}}s(i,"dfs");var o=T(r,function(d){return e.node(d).rank});return c(o,i),a}s(hn,"initOrder");function vn(e,n){return m(n,function(r){var t=e.inEdges(r);if(t.length){var a=z(t,function(i,o){var d=e.edge(o),u=e.node(o.v);return{sum:i.sum+d.weight*u.order,weight:i.weight+d.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}s(vn,"barycenter");function pn(e,n){var r={};c(e,function(a,i){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};g(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),c(n.edges(),function(a){var i=r[a.v],o=r[a.w];!g(i)&&!g(o)&&(o.indegree++,i.out.push(r[a.w]))});var t=S(r,function(a){return!a.indegree});return wn(t)}s(pn,"resolveConflicts");function wn(e){var n=[];function r(i){return function(o){o.merged||(g(o.barycenter)||g(i.barycenter)||o.barycenter>=i.barycenter)&&mn(i,o)}}s(r,"handleIn");function t(i){return function(o){o.in.push(i),--o.indegree===0&&e.push(o)}}for(s(t,"handleOut");e.length;){var a=e.pop();n.push(a),c(a.in.reverse(),r(a)),c(a.out,t(a))}return m(S(n,function(i){return!i.merged}),function(i){return G(i,["vs","i","barycenter","weight"])})}s(wn,"doResolveConflicts");function mn(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}s(mn,"mergeEntries");function bn(e,n){var r=Ce(e,function(l){return Object.prototype.hasOwnProperty.call(l,"barycenter")}),t=r.lhs,a=T(r.rhs,function(l){return-l.i}),i=[],o=0,d=0,u=0;t.sort(gn(!!n)),u=re(i,a,u),c(t,function(l){u+=l.vs.length,i.push(l.vs),o+=l.barycenter*l.weight,d+=l.weight,u=re(i,a,u)});var f={vs:I(i)};return d&&(f.barycenter=o/d,f.weight=d),f}s(bn,"sort");function re(e,n,r){for(var t;n.length&&(t=Y(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}s(re,"consumeUnsortable");function gn(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}s(gn,"compareWithBias");function ye(e,n,r,t){var a=e.children(n),i=e.node(n),o=i?i.borderLeft:void 0,d=i?i.borderRight:void 0,u={};o&&(a=S(a,function(w){return w!==o&&w!==d}));var f=vn(e,a);c(f,function(w){if(e.children(w.v).length){var b=ye(e,w.v,r,t);u[w.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&kn(w,b)}});var l=pn(f,r);yn(l,u);var h=bn(l,t);if(o&&(h.vs=I([o,h.vs,d]),e.predecessors(o).length)){var v=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(d)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+v.order+p.order)/(h.weight+2),h.weight+=2}return h}s(ye,"sortSubgraph");function yn(e,n){c(e,function(r){r.vs=I(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}s(yn,"expandSubgraphs");function kn(e,n){g(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}s(kn,"mergeBarycenters");function En(e){var n=ue(e),r=te(e,L(1,n+1),"inEdges"),t=te(e,L(n-1,-1,-1),"outEdges"),a=hn(e);ae(e,a);for(var i=Number.POSITIVE_INFINITY,o,d=0,u=0;u<4;++d,++u){xn(d%2?r:t,d%4>=2),a=j(e);var f=cn(e,a);f<i&&(u=0,o=or(a),i=f)}ae(e,o)}s(En,"order");function te(e,n,r){return m(n,function(t){return un(e,t,r)})}s(te,"buildLayerGraphs");function xn(e,n){var r=new y;c(e,function(t){var a=t.graph().root,i=ye(t,a,r,n);c(i.vs,function(o,d){t.node(o).order=d}),sn(t,r,i.vs)})}s(xn,"sweepLayerGraphs");function ae(e,n){c(n,function(r){c(r,function(t,a){e.node(t).order=a})})}s(ae,"assignOrder");function On(e){var n=Nn(e);c(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,i=Ln(e,n,a.v,a.w),o=i.path,d=i.lca,u=0,f=o[u],l=!0;r!==a.w;){if(t=e.node(r),l){for(;(f=o[u])!==d&&e.node(f).maxRank<t.rank;)u++;f===d&&(l=!1)}if(!l){for(;u<o.length-1&&e.node(f=o[u+1]).minRank<=t.rank;)u++;f=o[u]}e.setParent(r,f),r=e.successors(r)[0]}})}s(On,"parentDummyChains");function Ln(e,n,r,t){var a=[],i=[],o=Math.min(n[r].low,n[t].low),d=Math.max(n[r].lim,n[t].lim),u,f;u=r;do u=e.parent(u),a.push(u);while(u&&(n[u].low>o||d>n[u].lim));for(f=u,u=t;(u=e.parent(u))!==f;)i.push(u);return{path:a.concat(i.reverse()),lca:f}}s(Ln,"findPath");function Nn(e){var n={},r=0;function t(a){var i=r;c(e.children(a),t),n[a]={low:i,lim:r++}}return s(t,"dfs"),c(e.children(),t),n}s(Nn,"postorder");function _n(e,n){var r={};function t(a,i){var o=0,d=0,u=a.length,f=Y(i);return c(i,function(l,h){var v=Pn(e,l),p=v?e.node(v).order:u;(v||l===f)&&(c(i.slice(d,h+1),function(w){c(e.predecessors(w),function(b){var C=e.node(b),Ee=C.order;(Ee<o||p<Ee)&&!(C.dummy&&e.node(w).dummy)&&ke(r,b,w)})}),d=h+1,o=p)}),i}return s(t,"visitLayer"),z(n,t),r}s(_n,"findType1Conflicts");function Cn(e,n){var r={};function t(i,o,d,u,f){var l;c(L(o,d),function(h){l=i[h],e.node(l).dummy&&c(e.predecessors(l),function(v){var p=e.node(v);p.dummy&&(p.order<u||p.order>f)&&ke(r,v,l)})})}s(t,"scan");function a(i,o){var d=-1,u,f=0;return c(o,function(l,h){if(e.node(l).dummy==="border"){var v=e.predecessors(l);v.length&&(u=e.node(v[0]).order,t(o,f,h,d,u),f=h,d=u)}t(o,f,o.length,u,i.length)}),o}return s(a,"visitLayer"),z(n,a),r}s(Cn,"findType2Conflicts");function Pn(e,n){if(e.node(n).dummy)return de(e.predecessors(n),function(r){return e.node(r).dummy})}s(Pn,"findOtherInnerSegmentNode");function ke(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}s(ke,"addConflict");function Rn(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}s(Rn,"hasConflict");function In(e,n,r,t){var a={},i={},o={};return c(n,function(d){c(d,function(u,f){a[u]=u,i[u]=u,o[u]=f})}),c(n,function(d){var u=-1;c(d,function(f){var l=t(f);if(l.length){l=T(l,function(b){return o[b]});for(var h=(l.length-1)/2,v=Math.floor(h),p=Math.ceil(h);v<=p;++v){var w=l[v];i[f]===f&&u<o[w]&&!Rn(r,f,w)&&(i[w]=f,i[f]=a[f]=a[w],u=o[w])}}})}),{root:a,align:i}}s(In,"verticalAlignment");function Sn(e,n,r,t,a){var i={},o=Tn(e,n,r,a),d=a?"borderLeft":"borderRight";function u(h,v){for(var p=o.nodes(),w=p.pop(),b={};w;)b[w]?h(w):(b[w]=!0,p.push(w),p=p.concat(v(w))),w=p.pop()}s(u,"iterate");function f(h){i[h]=o.inEdges(h).reduce(function(v,p){return Math.max(v,i[p.v]+o.edge(p))},0)}s(f,"pass1");function l(h){var v=o.outEdges(h).reduce(function(w,b){return Math.min(w,i[b.w]-o.edge(b))},Number.POSITIVE_INFINITY),p=e.node(h);v!==Number.POSITIVE_INFINITY&&p.borderType!==d&&(i[h]=Math.max(i[h],v))}return s(l,"pass2"),u(f,o.predecessors.bind(o)),u(l,o.successors.bind(o)),c(t,function(h){i[h]=i[r[h]]}),i}s(Sn,"horizontalCompaction");function Tn(e,n,r,t){var a=new y,i=e.graph(),o=Bn(i.nodesep,i.edgesep,t);return c(n,function(d){var u;c(d,function(f){var l=r[f];if(a.setNode(l),u){var h=r[u],v=a.edge(h,l);a.setEdge(h,l,Math.max(o(e,f,u),v||0))}u=f})}),a}s(Tn,"buildBlockGraph");function jn(e,n){return oe(N(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return dr(r,function(i,o){var d=An(e,o)/2;t=Math.max(i+d,t),a=Math.min(i-d,a)}),t-a})}s(jn,"findSmallestWidthAlignment");function Mn(e,n){var r=N(n),t=P(r),a=E(r);c(["u","d"],function(i){c(["l","r"],function(o){var d=i+o,u=e[d],f;if(u!==n){var l=N(u);f=o==="l"?t-P(l):a-E(l),f&&(e[d]=W(u,function(h){return h+f}))}})})}s(Mn,"alignCoordinates");function Fn(e,n){return W(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=T(m(e,t));return(a[1]+a[2])/2})}s(Fn,"balance");function Vn(e){var n=j(e),r=U(_n(e,n),Cn(e,n)),t={},a;c(["u","d"],function(o){a=o==="u"?n:N(n).reverse(),c(["l","r"],function(d){d==="r"&&(a=m(a,function(h){return N(h).reverse()}));var u=(o==="u"?e.predecessors:e.successors).bind(e),f=In(e,a,r,u),l=Sn(e,a,f.root,f.align,d==="r");d==="r"&&(l=W(l,function(h){return-h})),t[o+d]=l})});var i=jn(e,t);return Mn(t,i),Fn(t,e.graph().align)}s(Vn,"positionX");function Bn(e,n,r){return function(t,a,i){var o=t.node(a),d=t.node(i),u=0,f;if(u+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":f=-o.width/2;break;case"r":f=o.width/2;break}if(f&&(u+=r?f:-f),f=0,u+=(o.dummy?n:e)/2,u+=(d.dummy?n:e)/2,u+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":f=d.width/2;break;case"r":f=-d.width/2;break}return f&&(u+=r?f:-f),f=0,u}}s(Bn,"sep");function An(e,n){return e.node(n).width}s(An,"width");function Gn(e){e=se(e),Yn(e),sr(Vn(e),function(n,r){e.node(r).x=n})}s(Gn,"position");function Yn(e){var n=j(e),r=e.graph().ranksep,t=0;c(n,function(a){var i=E(m(a,function(o){return e.node(o).height}));c(a,function(o){e.node(o).y=t+i/2}),t+=i+r})}s(Yn,"positionY");function vr(e,n){var r=n&&n.debugTiming?Pe:Re;r("layout",()=>{var t=r(" buildLayoutGraph",()=>zn(e));r(" runLayout",()=>Dn(t,r)),r(" updateInputGraph",()=>Wn(e,t))})}s(vr,"layout");function Dn(e,n){n(" makeSpaceForEdgeLabels",()=>Xn(e)),n(" removeSelfEdges",()=>er(e)),n(" acyclic",()=>Ge(e)),n(" nestingGraph.run",()=>tn(e)),n(" rank",()=>nn(se(e))),n(" injectEdgeLabelProxies",()=>qn(e)),n(" removeEmptyRanks",()=>_e(e)),n(" nestingGraph.cleanup",()=>dn(e)),n(" normalizeRanks",()=>Ne(e)),n(" assignRankMinMax",()=>Hn(e)),n(" removeEdgeLabelProxies",()=>Un(e)),n(" normalize.run",()=>We(e)),n(" parentDummyChains",()=>On(e)),n(" addBorderSegments",()=>Ie(e)),n(" order",()=>En(e)),n(" insertSelfEdges",()=>nr(e)),n(" adjustCoordinateSystem",()=>Se(e)),n(" position",()=>Gn(e)),n(" positionSelfEdges",()=>rr(e)),n(" removeBorderNodes",()=>Zn(e)),n(" normalize.undo",()=>Xe(e)),n(" fixupEdgeLabelCoords",()=>Kn(e)),n(" undoCoordinateSystem",()=>Te(e)),n(" translateGraph",()=>Jn(e)),n(" assignNodeIntersects",()=>$n(e)),n(" reversePoints",()=>Qn(e)),n(" acyclic.undo",()=>De(e))}s(Dn,"runLayout");function Wn(e,n){c(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),c(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}s(Wn,"updateInputGraph");var pr=["nodesep","edgesep","ranksep","marginx","marginy"],wr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},mr=["acyclicer","ranker","rankdir","align"],br=["width","height"],gr={width:0,height:0},yr=["minlen","weight","width","height","labeloffset"],kr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Er=["labelpos"];function zn(e){var n=new y({multigraph:!0,compound:!0}),r=A(e.graph());return n.setGraph(U({},wr,B(r,pr),G(r,mr))),c(e.nodes(),function(t){var a=A(e.node(t));n.setNode(t,tr(B(a,br),gr)),n.setParent(t,e.parent(t))}),c(e.edges(),function(t){var a=A(e.edge(t));n.setEdge(t,U({},kr,B(a,yr),G(a,Er)))}),n}s(zn,"buildLayoutGraph");function Xn(e){var n=e.graph();n.ranksep/=2,c(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}s(Xn,"makeSpaceForEdgeLabels");function qn(e){c(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),i={rank:(a.rank-t.rank)/2+t.rank,e:n};x(e,"edge-proxy",i,"_ep")}})}s(qn,"injectEdgeLabelProxies");function Hn(e){var n=0;c(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=E(n,t.maxRank))}),e.graph().maxRank=n}s(Hn,"assignRankMinMax");function Un(e){c(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}s(Un,"removeEdgeLabelProxies");function Jn(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,i=e.graph(),o=i.marginx||0,d=i.marginy||0;function u(f){var l=f.x,h=f.y,v=f.width,p=f.height;n=Math.min(n,l-v/2),r=Math.max(r,l+v/2),t=Math.min(t,h-p/2),a=Math.max(a,h+p/2)}s(u,"getExtremes"),c(e.nodes(),function(f){u(e.node(f))}),c(e.edges(),function(f){var l=e.edge(f);Object.prototype.hasOwnProperty.call(l,"x")&&u(l)}),n-=o,t-=d,c(e.nodes(),function(f){var l=e.node(f);l.x-=n,l.y-=t}),c(e.edges(),function(f){var l=e.edge(f);c(l.points,function(h){h.x-=n,h.y-=t}),Object.prototype.hasOwnProperty.call(l,"x")&&(l.x-=n),Object.prototype.hasOwnProperty.call(l,"y")&&(l.y-=t)}),i.width=r-n+o,i.height=a-t+d}s(Jn,"translateGraph");function $n(e){c(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=a,o=t),r.points.unshift(J(t,i)),r.points.push(J(a,o))})}s($n,"assignNodeIntersects");function Kn(e){c(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}s(Kn,"fixupEdgeLabelCoords");function Qn(e){c(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}s(Qn,"reversePointsForReversedEdges");function Zn(e){c(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(Y(r.borderLeft)),o=e.node(Y(r.borderRight));r.width=Math.abs(o.x-i.x),r.height=Math.abs(a.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),c(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}s(Zn,"removeBorderNodes");function er(e){c(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}s(er,"removeSelfEdges");function nr(e){var n=j(e);c(n,function(r){var t=0;c(r,function(a,i){var o=e.node(a);o.order=i+t,c(o.selfEdges,function(d){x(e,"selfedge",{width:d.label.width,height:d.label.height,rank:o.rank,order:i+ ++t,e:d.e,label:d.label},"_se")}),delete o.selfEdges})})}s(nr,"insertSelfEdges");function rr(e){c(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,i=t.y,o=r.x-a,d=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*o/3,y:i-d},{x:a+5*o/6,y:i-d},{x:a+o,y:i},{x:a+5*o/6,y:i+d},{x:a+2*o/3,y:i+d}],r.label.x=r.x,r.label.y=r.y}})}s(rr,"positionSelfEdges");function B(e,n){return W(G(e,n),Number)}s(B,"selectNumberAttrs");function A(e){var n={};return c(e,function(r,t){n[t.toLowerCase()]=r}),n}s(A,"canonicalize");export{vr as l};
|
|
1
|
+
import{V as c,T as y,W as U,X as G,Y as tr,$ as E,a0 as Y,a1 as W,a2 as ie,a3 as m,a4 as L,a5 as g,a6 as P,a7 as Oe,a8 as xe,a9 as I,aa as oe,ab as ar,ac as de,ad as S,ae as N,af as z,ag as ir,ah as T,ai as or,aj as dr,ak as sr,al as ur,am as fr}from"./render-O7CIS3YK-DQb_czkx.js";import{_ as s}from"./mermaid-layout-elk.core-CNNSrMhF.js";function x(e,n,r,t){var a;do a=ie(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}s(x,"addDummyNode");function Le(e){var n=new y().setGraph(e.graph());return c(e.nodes(),function(r){n.setNode(r,e.node(r))}),c(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}s(Le,"simplify");function se(e){var n=new y({multigraph:e.isMultigraph()}).setGraph(e.graph());return c(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),c(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}s(se,"asNonCompoundGraph");function J(e,n){var r=e.x,t=e.y,a=n.x-r,i=n.y-t,o=e.width/2,d=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var u,f;return Math.abs(i)*o>Math.abs(a)*d?(i<0&&(d=-d),u=d*a/i,f=d):(a<0&&(o=-o),u=o,f=o*i/a),{x:r+u,y:t+f}}s(J,"intersectRect");function j(e){var n=m(L(ue(e)+1),function(){return[]});return c(e.nodes(),function(r){var t=e.node(r),a=t.rank;g(a)||(n[a][t.order]=r)}),n}s(j,"buildLayerMatrix");function Ne(e){var n=P(m(e.nodes(),function(r){return e.node(r).rank}));c(e.nodes(),function(r){var t=e.node(r);Oe(t,"rank")&&(t.rank-=n)})}s(Ne,"normalizeRanks");function _e(e){var n=P(m(e.nodes(),function(i){return e.node(i).rank})),r=[];c(e.nodes(),function(i){var o=e.node(i).rank-n;r[o]||(r[o]=[]),r[o].push(i)});var t=0,a=e.graph().nodeRankFactor;c(r,function(i,o){g(i)&&o%a!==0?--t:t&&c(i,function(d){e.node(d).rank+=t})})}s(_e,"removeEmptyRanks");function $(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),x(e,"border",a,n)}s($,"addBorderNode");function ue(e){return E(m(e.nodes(),function(n){var r=e.node(n).rank;if(!g(r))return r}))}s(ue,"maxRank");function Ce(e,n){var r={lhs:[],rhs:[]};return c(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}s(Ce,"partition");function Pe(e,n){var r=xe();try{return n()}finally{console.log(e+" time: "+(xe()-r)+"ms")}}s(Pe,"time");function Re(e,n){return n()}s(Re,"notime");function Ie(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&c(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,o=a.maxRank+1;i<o;++i)K(e,"borderLeft","_bl",r,a,i),K(e,"borderRight","_br",r,a,i)}}s(n,"dfs"),c(e.children(),n)}s(Ie,"addBorderSegments");function K(e,n,r,t,a,i){var o={width:0,height:0,rank:i,borderType:n},d=a[n][i-1],u=x(e,"border",o,r);a[n][i]=u,e.setParent(u,t),d&&e.setEdge(d,u,{weight:1})}s(K,"addBorderNode");function Se(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&fe(e)}s(Se,"adjust");function Te(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&je(e),(n==="lr"||n==="rl")&&(Me(e),fe(e))}s(Te,"undo");function fe(e){c(e.nodes(),function(n){Q(e.node(n))}),c(e.edges(),function(n){Q(e.edge(n))})}s(fe,"swapWidthHeight");function Q(e){var n=e.width;e.width=e.height,e.height=n}s(Q,"swapWidthHeightOne");function je(e){c(e.nodes(),function(n){M(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,M),Object.prototype.hasOwnProperty.call(r,"y")&&M(r)})}s(je,"reverseY");function M(e){e.y=-e.y}s(M,"reverseYOne");function Me(e){c(e.nodes(),function(n){F(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,F),Object.prototype.hasOwnProperty.call(r,"x")&&F(r)})}s(Me,"swapXY");function F(e){var n=e.x;e.x=e.y,e.y=n}s(F,"swapXYOne");var O,cr=(O=class{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return Z(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&Z(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,Fe)),t=t._prev;return"["+n.join(", ")+"]"}},s(O,"List"),O);function Z(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}s(Z,"unlink");function Fe(e,n){if(e!=="_next"&&e!=="_prev")return n}s(Fe,"filterOutLinks");var lr=ur(1);function Ve(e,n){if(e.nodeCount()<=1)return[];var r=Ae(e,n||lr),t=Be(r.graph,r.buckets,r.zeroIdx);return I(m(t,function(a){return e.outEdges(a.v,a.w)}))}s(Ve,"greedyFAS");function Be(e,n,r){for(var t=[],a=n[n.length-1],i=n[0],o;e.nodeCount();){for(;o=i.dequeue();)V(e,n,r,o);for(;o=a.dequeue();)V(e,n,r,o);if(e.nodeCount()){for(var d=n.length-2;d>0;--d)if(o=n[d].dequeue(),o){t=t.concat(V(e,n,r,o,!0));break}}}return t}s(Be,"doGreedyFAS");function V(e,n,r,t,a){var i=a?[]:void 0;return c(e.inEdges(t.v),function(o){var d=e.edge(o),u=e.node(o.v);a&&i.push({v:o.v,w:o.w}),u.out-=d,D(n,r,u)}),c(e.outEdges(t.v),function(o){var d=e.edge(o),u=o.w,f=e.node(u);f.in-=d,D(n,r,f)}),e.removeNode(t.v),i}s(V,"removeNode");function Ae(e,n){var r=new y,t=0,a=0;c(e.nodes(),function(d){r.setNode(d,{v:d,in:0,out:0})}),c(e.edges(),function(d){var u=r.edge(d.v,d.w)||0,f=n(d),l=u+f;r.setEdge(d.v,d.w,l),a=Math.max(a,r.node(d.v).out+=f),t=Math.max(t,r.node(d.w).in+=f)});var i=L(a+t+3).map(function(){return new cr}),o=t+1;return c(r.nodes(),function(d){D(i,o,r.node(d))}),{graph:r,buckets:i,zeroIdx:o}}s(Ae,"buildState");function D(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}s(D,"assignBucket");function Ge(e){var n=e.graph().acyclicer==="greedy"?Ve(e,r(e)):Ye(e);c(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,ie("rev"))});function r(t){return function(a){return t.edge(a).weight}}s(r,"weightFn")}s(Ge,"run");function Ye(e){var n=[],r={},t={};function a(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,c(e.outEdges(i),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?n.push(o):a(o.w)}),delete r[i])}return s(a,"dfs"),c(e.nodes(),a),n}s(Ye,"dfsFAS");function De(e){c(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}s(De,"undo");function We(e){e.graph().dummyChains=[],c(e.edges(),function(n){ze(e,n)})}s(We,"run");function ze(e,n){var r=n.v,t=e.node(r).rank,a=n.w,i=e.node(a).rank,o=n.name,d=e.edge(n),u=d.labelRank;if(i!==t+1){e.removeEdge(n);var f=void 0,l,h;for(h=0,++t;t<i;++h,++t)d.points=[],f={width:0,height:0,edgeLabel:d,edgeObj:n,rank:t},l=x(e,"edge",f,"_d"),t===u&&(f.width=d.width,f.height=d.height,f.dummy="edge-label",f.labelpos=d.labelpos),e.setEdge(r,l,{weight:d.weight},o),h===0&&e.graph().dummyChains.push(l),r=l;e.setEdge(r,a,{weight:d.weight},o)}}s(ze,"normalizeEdge");function Xe(e){c(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}s(Xe,"undo");function X(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var i=P(m(e.outEdges(t),function(o){return r(o.w)-e.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}s(r,"dfs"),c(e.sources(),r)}s(X,"longestPath");function _(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}s(_,"slack");function ce(e){var n=new y({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,i;qe(n,e)<t;)a=He(n,e),i=n.hasNode(a.v)?_(e,a):-_(e,a),Ue(n,e,i);return n}s(ce,"feasibleTree");function qe(e,n){function r(t){c(n.nodeEdges(t),function(a){var i=a.v,o=t===i?a.w:i;!e.hasNode(o)&&!_(n,a)&&(e.setNode(o,{}),e.setEdge(t,o,{}),r(o))})}return s(r,"dfs"),c(e.nodes(),r),e.nodeCount()}s(qe,"tightTree");function He(e,n){return oe(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return _(n,r)})}s(He,"findMinSlackEdge");function Ue(e,n,r){c(e.nodes(),function(t){n.node(t).rank+=r})}s(Ue,"shiftRanks");Je.CycleException=R;function Je(e){var n={},r={},t=[];function a(i){if(Object.prototype.hasOwnProperty.call(r,i))throw new R;Object.prototype.hasOwnProperty.call(n,i)||(r[i]=!0,n[i]=!0,c(e.predecessors(i),a),delete r[i],t.push(i))}if(s(a,"visit"),c(e.sinks(),a),ar(n)!==e.nodeCount())throw new R;return t}s(Je,"topsort");function R(){}s(R,"CycleException");R.prototype=new Error;function le(e,n,r){fr(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],i={};return c(n,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);he(e,o,r==="post",i,t,a)}),a}s(le,"dfs");function he(e,n,r,t,a,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),c(a(n),function(o){he(e,o,r,t,a,i)}),r&&i.push(n))}s(he,"doDfs");function $e(e,n){return le(e,n,"post")}s($e,"postorder");function Ke(e,n){return le(e,n,"pre")}s(Ke,"preorder");k.initLowLimValues=H;k.initCutValues=q;k.calcCutValue=ve;k.leaveEdge=we;k.enterEdge=me;k.exchangeEdges=be;function k(e){e=Le(e),X(e);var n=ce(e);H(n),q(n,e);for(var r,t;r=we(n);)t=me(n,e,r),be(n,e,r,t)}s(k,"networkSimplex");function q(e,n){var r=$e(e,e.nodes());r=r.slice(0,r.length-1),c(r,function(t){Qe(e,n,t)})}s(q,"initCutValues");function Qe(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=ve(e,n,r)}s(Qe,"assignCutValue");function ve(e,n,r){var t=e.node(r),a=t.parent,i=!0,o=n.edge(r,a),d=0;return o||(i=!1,o=n.edge(a,r)),d=o.weight,c(n.nodeEdges(r),function(u){var f=u.v===r,l=f?u.w:u.v;if(l!==a){var h=f===i,v=n.edge(u).weight;if(d+=h?v:-v,en(e,r,l)){var p=e.edge(r,l).cutvalue;d+=h?-p:p}}}),d}s(ve,"calcCutValue");function H(e,n){arguments.length<2&&(n=e.nodes()[0]),pe(e,{},1,n)}s(H,"initLowLimValues");function pe(e,n,r,t,a){var i=r,o=e.node(t);return n[t]=!0,c(e.neighbors(t),function(d){Object.prototype.hasOwnProperty.call(n,d)||(r=pe(e,n,r,d,t))}),o.low=i,o.lim=r++,a?o.parent=a:delete o.parent,r}s(pe,"dfsAssignLowLim");function we(e){return de(e.edges(),function(n){return e.edge(n).cutvalue<0})}s(we,"leaveEdge");function me(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var i=e.node(t),o=e.node(a),d=i,u=!1;i.lim>o.lim&&(d=o,u=!0);var f=S(n.edges(),function(l){return u===ee(e,e.node(l.v),d)&&u!==ee(e,e.node(l.w),d)});return oe(f,function(l){return _(n,l)})}s(me,"enterEdge");function be(e,n,r,t){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(t.v,t.w,{}),H(e),q(e,n),Ze(e,n)}s(be,"exchangeEdges");function Ze(e,n){var r=de(e.nodes(),function(a){return!n.node(a).parent}),t=Ke(e,r);t=t.slice(1),c(t,function(a){var i=e.node(a).parent,o=n.edge(a,i),d=!1;o||(o=n.edge(i,a),d=!0),n.node(a).rank=n.node(i).rank+(d?o.minlen:-o.minlen)})}s(Ze,"updateRanks");function en(e,n,r){return e.hasEdge(n,r)}s(en,"isTreeEdge");function ee(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}s(ee,"isDescendant");function nn(e){switch(e.graph().ranker){case"network-simplex":ne(e);break;case"tight-tree":rn(e);break;case"longest-path":hr(e);break;default:ne(e)}}s(nn,"rank");var hr=X;function rn(e){X(e),ce(e)}s(rn,"tightTreeRanker");function ne(e){k(e)}s(ne,"networkSimplexRanker");function tn(e){var n=x(e,"root",{},"_root"),r=an(e),t=E(N(r))-1,a=2*t+1;e.graph().nestingRoot=n,c(e.edges(),function(o){e.edge(o).minlen*=a});var i=on(e)+1;c(e.children(),function(o){ge(e,n,a,i,t,r,o)}),e.graph().nodeRankFactor=a}s(tn,"run");function ge(e,n,r,t,a,i,o){var d=e.children(o);if(!d.length){o!==n&&e.setEdge(n,o,{weight:0,minlen:r});return}var u=$(e,"_bt"),f=$(e,"_bb"),l=e.node(o);e.setParent(u,o),l.borderTop=u,e.setParent(f,o),l.borderBottom=f,c(d,function(h){ge(e,n,r,t,a,i,h);var v=e.node(h),p=v.borderTop?v.borderTop:h,w=v.borderBottom?v.borderBottom:h,b=v.borderTop?t:2*t,C=p!==w?1:a-i[o]+1;e.setEdge(u,p,{weight:b,minlen:C,nestingEdge:!0}),e.setEdge(w,f,{weight:b,minlen:C,nestingEdge:!0})}),e.parent(o)||e.setEdge(n,u,{weight:0,minlen:a+i[o]})}s(ge,"dfs");function an(e){var n={};function r(t,a){var i=e.children(t);i&&i.length&&c(i,function(o){r(o,a+1)}),n[t]=a}return s(r,"dfs"),c(e.children(),function(t){r(t,1)}),n}s(an,"treeDepths");function on(e){return z(e.edges(),function(n,r){return n+e.edge(r).weight},0)}s(on,"sumWeights");function dn(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,c(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}s(dn,"cleanup");function sn(e,n,r){var t={},a;c(r,function(i){for(var o=e.parent(i),d,u;o;){if(d=e.parent(o),d?(u=t[d],t[d]=o):(u=a,a=o),u&&u!==o){n.setEdge(u,o);return}o=d}})}s(sn,"addSubgraphConstraints");function un(e,n,r){var t=fn(e),a=new y({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return e.node(i)});return c(e.nodes(),function(i){var o=e.node(i),d=e.parent(i);(o.rank===n||o.minRank<=n&&n<=o.maxRank)&&(a.setNode(i),a.setParent(i,d||t),c(e[r](i),function(u){var f=u.v===i?u.w:u.v,l=a.edge(f,i),h=g(l)?0:l.weight;a.setEdge(f,i,{weight:e.edge(u).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&a.setNode(i,{borderLeft:o.borderLeft[n],borderRight:o.borderRight[n]}))}),a}s(un,"buildLayerGraph");function fn(e){for(var n;e.hasNode(n=ie("_root")););return n}s(fn,"createRootNode");function cn(e,n){for(var r=0,t=1;t<n.length;++t)r+=ln(e,n[t-1],n[t]);return r}s(cn,"crossCount");function ln(e,n,r){for(var t=ir(r,m(r,function(f,l){return l})),a=I(m(n,function(f){return T(m(e.outEdges(f),function(l){return{pos:t[l.w],weight:e.edge(l).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var o=2*i-1;i-=1;var d=m(new Array(o),function(){return 0}),u=0;return c(a.forEach(function(f){var l=f.pos+i;d[l]+=f.weight;for(var h=0;l>0;)l%2&&(h+=d[l+1]),l=l-1>>1,d[l]+=f.weight;u+=f.weight*h})),u}s(ln,"twoLayerCrossCount");function hn(e){var n={},r=S(e.nodes(),function(d){return!e.children(d).length}),t=E(m(r,function(d){return e.node(d).rank})),a=m(L(t+1),function(){return[]});function i(d){if(!Oe(n,d)){n[d]=!0;var u=e.node(d);a[u.rank].push(d),c(e.successors(d),i)}}s(i,"dfs");var o=T(r,function(d){return e.node(d).rank});return c(o,i),a}s(hn,"initOrder");function vn(e,n){return m(n,function(r){var t=e.inEdges(r);if(t.length){var a=z(t,function(i,o){var d=e.edge(o),u=e.node(o.v);return{sum:i.sum+d.weight*u.order,weight:i.weight+d.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}s(vn,"barycenter");function pn(e,n){var r={};c(e,function(a,i){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};g(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),c(n.edges(),function(a){var i=r[a.v],o=r[a.w];!g(i)&&!g(o)&&(o.indegree++,i.out.push(r[a.w]))});var t=S(r,function(a){return!a.indegree});return wn(t)}s(pn,"resolveConflicts");function wn(e){var n=[];function r(i){return function(o){o.merged||(g(o.barycenter)||g(i.barycenter)||o.barycenter>=i.barycenter)&&mn(i,o)}}s(r,"handleIn");function t(i){return function(o){o.in.push(i),--o.indegree===0&&e.push(o)}}for(s(t,"handleOut");e.length;){var a=e.pop();n.push(a),c(a.in.reverse(),r(a)),c(a.out,t(a))}return m(S(n,function(i){return!i.merged}),function(i){return G(i,["vs","i","barycenter","weight"])})}s(wn,"doResolveConflicts");function mn(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}s(mn,"mergeEntries");function bn(e,n){var r=Ce(e,function(l){return Object.prototype.hasOwnProperty.call(l,"barycenter")}),t=r.lhs,a=T(r.rhs,function(l){return-l.i}),i=[],o=0,d=0,u=0;t.sort(gn(!!n)),u=re(i,a,u),c(t,function(l){u+=l.vs.length,i.push(l.vs),o+=l.barycenter*l.weight,d+=l.weight,u=re(i,a,u)});var f={vs:I(i)};return d&&(f.barycenter=o/d,f.weight=d),f}s(bn,"sort");function re(e,n,r){for(var t;n.length&&(t=Y(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}s(re,"consumeUnsortable");function gn(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}s(gn,"compareWithBias");function ye(e,n,r,t){var a=e.children(n),i=e.node(n),o=i?i.borderLeft:void 0,d=i?i.borderRight:void 0,u={};o&&(a=S(a,function(w){return w!==o&&w!==d}));var f=vn(e,a);c(f,function(w){if(e.children(w.v).length){var b=ye(e,w.v,r,t);u[w.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&kn(w,b)}});var l=pn(f,r);yn(l,u);var h=bn(l,t);if(o&&(h.vs=I([o,h.vs,d]),e.predecessors(o).length)){var v=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(d)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+v.order+p.order)/(h.weight+2),h.weight+=2}return h}s(ye,"sortSubgraph");function yn(e,n){c(e,function(r){r.vs=I(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}s(yn,"expandSubgraphs");function kn(e,n){g(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}s(kn,"mergeBarycenters");function En(e){var n=ue(e),r=te(e,L(1,n+1),"inEdges"),t=te(e,L(n-1,-1,-1),"outEdges"),a=hn(e);ae(e,a);for(var i=Number.POSITIVE_INFINITY,o,d=0,u=0;u<4;++d,++u){xn(d%2?r:t,d%4>=2),a=j(e);var f=cn(e,a);f<i&&(u=0,o=or(a),i=f)}ae(e,o)}s(En,"order");function te(e,n,r){return m(n,function(t){return un(e,t,r)})}s(te,"buildLayerGraphs");function xn(e,n){var r=new y;c(e,function(t){var a=t.graph().root,i=ye(t,a,r,n);c(i.vs,function(o,d){t.node(o).order=d}),sn(t,r,i.vs)})}s(xn,"sweepLayerGraphs");function ae(e,n){c(n,function(r){c(r,function(t,a){e.node(t).order=a})})}s(ae,"assignOrder");function On(e){var n=Nn(e);c(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,i=Ln(e,n,a.v,a.w),o=i.path,d=i.lca,u=0,f=o[u],l=!0;r!==a.w;){if(t=e.node(r),l){for(;(f=o[u])!==d&&e.node(f).maxRank<t.rank;)u++;f===d&&(l=!1)}if(!l){for(;u<o.length-1&&e.node(f=o[u+1]).minRank<=t.rank;)u++;f=o[u]}e.setParent(r,f),r=e.successors(r)[0]}})}s(On,"parentDummyChains");function Ln(e,n,r,t){var a=[],i=[],o=Math.min(n[r].low,n[t].low),d=Math.max(n[r].lim,n[t].lim),u,f;u=r;do u=e.parent(u),a.push(u);while(u&&(n[u].low>o||d>n[u].lim));for(f=u,u=t;(u=e.parent(u))!==f;)i.push(u);return{path:a.concat(i.reverse()),lca:f}}s(Ln,"findPath");function Nn(e){var n={},r=0;function t(a){var i=r;c(e.children(a),t),n[a]={low:i,lim:r++}}return s(t,"dfs"),c(e.children(),t),n}s(Nn,"postorder");function _n(e,n){var r={};function t(a,i){var o=0,d=0,u=a.length,f=Y(i);return c(i,function(l,h){var v=Pn(e,l),p=v?e.node(v).order:u;(v||l===f)&&(c(i.slice(d,h+1),function(w){c(e.predecessors(w),function(b){var C=e.node(b),Ee=C.order;(Ee<o||p<Ee)&&!(C.dummy&&e.node(w).dummy)&&ke(r,b,w)})}),d=h+1,o=p)}),i}return s(t,"visitLayer"),z(n,t),r}s(_n,"findType1Conflicts");function Cn(e,n){var r={};function t(i,o,d,u,f){var l;c(L(o,d),function(h){l=i[h],e.node(l).dummy&&c(e.predecessors(l),function(v){var p=e.node(v);p.dummy&&(p.order<u||p.order>f)&&ke(r,v,l)})})}s(t,"scan");function a(i,o){var d=-1,u,f=0;return c(o,function(l,h){if(e.node(l).dummy==="border"){var v=e.predecessors(l);v.length&&(u=e.node(v[0]).order,t(o,f,h,d,u),f=h,d=u)}t(o,f,o.length,u,i.length)}),o}return s(a,"visitLayer"),z(n,a),r}s(Cn,"findType2Conflicts");function Pn(e,n){if(e.node(n).dummy)return de(e.predecessors(n),function(r){return e.node(r).dummy})}s(Pn,"findOtherInnerSegmentNode");function ke(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}s(ke,"addConflict");function Rn(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}s(Rn,"hasConflict");function In(e,n,r,t){var a={},i={},o={};return c(n,function(d){c(d,function(u,f){a[u]=u,i[u]=u,o[u]=f})}),c(n,function(d){var u=-1;c(d,function(f){var l=t(f);if(l.length){l=T(l,function(b){return o[b]});for(var h=(l.length-1)/2,v=Math.floor(h),p=Math.ceil(h);v<=p;++v){var w=l[v];i[f]===f&&u<o[w]&&!Rn(r,f,w)&&(i[w]=f,i[f]=a[f]=a[w],u=o[w])}}})}),{root:a,align:i}}s(In,"verticalAlignment");function Sn(e,n,r,t,a){var i={},o=Tn(e,n,r,a),d=a?"borderLeft":"borderRight";function u(h,v){for(var p=o.nodes(),w=p.pop(),b={};w;)b[w]?h(w):(b[w]=!0,p.push(w),p=p.concat(v(w))),w=p.pop()}s(u,"iterate");function f(h){i[h]=o.inEdges(h).reduce(function(v,p){return Math.max(v,i[p.v]+o.edge(p))},0)}s(f,"pass1");function l(h){var v=o.outEdges(h).reduce(function(w,b){return Math.min(w,i[b.w]-o.edge(b))},Number.POSITIVE_INFINITY),p=e.node(h);v!==Number.POSITIVE_INFINITY&&p.borderType!==d&&(i[h]=Math.max(i[h],v))}return s(l,"pass2"),u(f,o.predecessors.bind(o)),u(l,o.successors.bind(o)),c(t,function(h){i[h]=i[r[h]]}),i}s(Sn,"horizontalCompaction");function Tn(e,n,r,t){var a=new y,i=e.graph(),o=Bn(i.nodesep,i.edgesep,t);return c(n,function(d){var u;c(d,function(f){var l=r[f];if(a.setNode(l),u){var h=r[u],v=a.edge(h,l);a.setEdge(h,l,Math.max(o(e,f,u),v||0))}u=f})}),a}s(Tn,"buildBlockGraph");function jn(e,n){return oe(N(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return dr(r,function(i,o){var d=An(e,o)/2;t=Math.max(i+d,t),a=Math.min(i-d,a)}),t-a})}s(jn,"findSmallestWidthAlignment");function Mn(e,n){var r=N(n),t=P(r),a=E(r);c(["u","d"],function(i){c(["l","r"],function(o){var d=i+o,u=e[d],f;if(u!==n){var l=N(u);f=o==="l"?t-P(l):a-E(l),f&&(e[d]=W(u,function(h){return h+f}))}})})}s(Mn,"alignCoordinates");function Fn(e,n){return W(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=T(m(e,t));return(a[1]+a[2])/2})}s(Fn,"balance");function Vn(e){var n=j(e),r=U(_n(e,n),Cn(e,n)),t={},a;c(["u","d"],function(o){a=o==="u"?n:N(n).reverse(),c(["l","r"],function(d){d==="r"&&(a=m(a,function(h){return N(h).reverse()}));var u=(o==="u"?e.predecessors:e.successors).bind(e),f=In(e,a,r,u),l=Sn(e,a,f.root,f.align,d==="r");d==="r"&&(l=W(l,function(h){return-h})),t[o+d]=l})});var i=jn(e,t);return Mn(t,i),Fn(t,e.graph().align)}s(Vn,"positionX");function Bn(e,n,r){return function(t,a,i){var o=t.node(a),d=t.node(i),u=0,f;if(u+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":f=-o.width/2;break;case"r":f=o.width/2;break}if(f&&(u+=r?f:-f),f=0,u+=(o.dummy?n:e)/2,u+=(d.dummy?n:e)/2,u+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":f=d.width/2;break;case"r":f=-d.width/2;break}return f&&(u+=r?f:-f),f=0,u}}s(Bn,"sep");function An(e,n){return e.node(n).width}s(An,"width");function Gn(e){e=se(e),Yn(e),sr(Vn(e),function(n,r){e.node(r).x=n})}s(Gn,"position");function Yn(e){var n=j(e),r=e.graph().ranksep,t=0;c(n,function(a){var i=E(m(a,function(o){return e.node(o).height}));c(a,function(o){e.node(o).y=t+i/2}),t+=i+r})}s(Yn,"positionY");function vr(e,n){var r=n&&n.debugTiming?Pe:Re;r("layout",()=>{var t=r(" buildLayoutGraph",()=>zn(e));r(" runLayout",()=>Dn(t,r)),r(" updateInputGraph",()=>Wn(e,t))})}s(vr,"layout");function Dn(e,n){n(" makeSpaceForEdgeLabels",()=>Xn(e)),n(" removeSelfEdges",()=>er(e)),n(" acyclic",()=>Ge(e)),n(" nestingGraph.run",()=>tn(e)),n(" rank",()=>nn(se(e))),n(" injectEdgeLabelProxies",()=>qn(e)),n(" removeEmptyRanks",()=>_e(e)),n(" nestingGraph.cleanup",()=>dn(e)),n(" normalizeRanks",()=>Ne(e)),n(" assignRankMinMax",()=>Hn(e)),n(" removeEdgeLabelProxies",()=>Un(e)),n(" normalize.run",()=>We(e)),n(" parentDummyChains",()=>On(e)),n(" addBorderSegments",()=>Ie(e)),n(" order",()=>En(e)),n(" insertSelfEdges",()=>nr(e)),n(" adjustCoordinateSystem",()=>Se(e)),n(" position",()=>Gn(e)),n(" positionSelfEdges",()=>rr(e)),n(" removeBorderNodes",()=>Zn(e)),n(" normalize.undo",()=>Xe(e)),n(" fixupEdgeLabelCoords",()=>Kn(e)),n(" undoCoordinateSystem",()=>Te(e)),n(" translateGraph",()=>Jn(e)),n(" assignNodeIntersects",()=>$n(e)),n(" reversePoints",()=>Qn(e)),n(" acyclic.undo",()=>De(e))}s(Dn,"runLayout");function Wn(e,n){c(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),c(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}s(Wn,"updateInputGraph");var pr=["nodesep","edgesep","ranksep","marginx","marginy"],wr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},mr=["acyclicer","ranker","rankdir","align"],br=["width","height"],gr={width:0,height:0},yr=["minlen","weight","width","height","labeloffset"],kr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Er=["labelpos"];function zn(e){var n=new y({multigraph:!0,compound:!0}),r=A(e.graph());return n.setGraph(U({},wr,B(r,pr),G(r,mr))),c(e.nodes(),function(t){var a=A(e.node(t));n.setNode(t,tr(B(a,br),gr)),n.setParent(t,e.parent(t))}),c(e.edges(),function(t){var a=A(e.edge(t));n.setEdge(t,U({},kr,B(a,yr),G(a,Er)))}),n}s(zn,"buildLayoutGraph");function Xn(e){var n=e.graph();n.ranksep/=2,c(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}s(Xn,"makeSpaceForEdgeLabels");function qn(e){c(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),i={rank:(a.rank-t.rank)/2+t.rank,e:n};x(e,"edge-proxy",i,"_ep")}})}s(qn,"injectEdgeLabelProxies");function Hn(e){var n=0;c(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=E(n,t.maxRank))}),e.graph().maxRank=n}s(Hn,"assignRankMinMax");function Un(e){c(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}s(Un,"removeEdgeLabelProxies");function Jn(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,i=e.graph(),o=i.marginx||0,d=i.marginy||0;function u(f){var l=f.x,h=f.y,v=f.width,p=f.height;n=Math.min(n,l-v/2),r=Math.max(r,l+v/2),t=Math.min(t,h-p/2),a=Math.max(a,h+p/2)}s(u,"getExtremes"),c(e.nodes(),function(f){u(e.node(f))}),c(e.edges(),function(f){var l=e.edge(f);Object.prototype.hasOwnProperty.call(l,"x")&&u(l)}),n-=o,t-=d,c(e.nodes(),function(f){var l=e.node(f);l.x-=n,l.y-=t}),c(e.edges(),function(f){var l=e.edge(f);c(l.points,function(h){h.x-=n,h.y-=t}),Object.prototype.hasOwnProperty.call(l,"x")&&(l.x-=n),Object.prototype.hasOwnProperty.call(l,"y")&&(l.y-=t)}),i.width=r-n+o,i.height=a-t+d}s(Jn,"translateGraph");function $n(e){c(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=a,o=t),r.points.unshift(J(t,i)),r.points.push(J(a,o))})}s($n,"assignNodeIntersects");function Kn(e){c(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}s(Kn,"fixupEdgeLabelCoords");function Qn(e){c(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}s(Qn,"reversePointsForReversedEdges");function Zn(e){c(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(Y(r.borderLeft)),o=e.node(Y(r.borderRight));r.width=Math.abs(o.x-i.x),r.height=Math.abs(a.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),c(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}s(Zn,"removeBorderNodes");function er(e){c(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}s(er,"removeSelfEdges");function nr(e){var n=j(e);c(n,function(r){var t=0;c(r,function(a,i){var o=e.node(a);o.order=i+t,c(o.selfEdges,function(d){x(e,"selfedge",{width:d.label.width,height:d.label.height,rank:o.rank,order:i+ ++t,e:d.e,label:d.label},"_se")}),delete o.selfEdges})})}s(nr,"insertSelfEdges");function rr(e){c(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,i=t.y,o=r.x-a,d=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*o/3,y:i-d},{x:a+5*o/6,y:i-d},{x:a+o,y:i},{x:a+5*o/6,y:i+d},{x:a+2*o/3,y:i+d}],r.label.x=r.x,r.label.y=r.y}})}s(rr,"positionSelfEdges");function B(e,n){return W(G(e,n),Number)}s(B,"selectNumberAttrs");function A(e){var n={};return c(e,function(r,t){n[t.toLowerCase()]=r}),n}s(A,"canonicalize");export{vr as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as i,m as d,
|
|
1
|
+
import{_ as i,m as d,n as o}from"./mermaid.core-CnNeOEec.js";import{s as l}from"./transform-Bd_a5eGM.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),y=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),m=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),g=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),f=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),w=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),k=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{y as a,h as b,f as c,x as d,g as e,k as f,w as g,m as h};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{g as ee}from"./chunk-XXDRQBXY-
|
|
1
|
+
import{g as ee}from"./chunk-XXDRQBXY-xXPgDheN.js";import{s as se}from"./chunk-POPQ4Y6H-BjpioqkZ.js";import{_ as S,l as b,c as F,x as ie,y as re,a as ae,b as ne,g as oe,s as le,o as ce,p as he,T as ue,j as K,q as de,Q as fe}from"./mermaid.core-CnNeOEec.js";import{f as pe}from"./chunk-F27PBJKO-DQz5Eh8R.js";import{s as Dt}from"./transform-Bd_a5eGM.js";var Ct=(function(){var t=S(function(U,l,u,n){for(u=u||{},n=U.length;n--;u[U[n]]=l);return u},"o"),e=[1,2],s=[1,3],a=[1,4],i=[2,4],o=[1,9],h=[1,11],p=[1,16],d=[1,17],T=[1,18],E=[1,19],m=[1,33],I=[1,20],v=[1,21],x=[1,22],$=[1,23],O=[1,24],f=[1,26],L=[1,27],C=[1,28],V=[1,29],P=[1,30],k=[1,31],B=[1,32],j=[1,35],nt=[1,36],ot=[1,37],lt=[1,38],J=[1,34],y=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ct=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],Lt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],gt={trace:S(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:S(function(l,u,n,g,_,r,Y){var c=r.length-1;switch(_){case 3:return g.setRootDoc(r[c]),r[c];case 4:this.$=[];break;case 5:r[c]!="nl"&&(r[c-1].push(r[c]),this.$=r[c-1]);break;case 6:case 7:this.$=r[c];break;case 8:this.$="nl";break;case 12:this.$=r[c];break;case 13:const et=r[c-1];et.description=g.trimColon(r[c]),this.$=et;break;case 14:this.$={stmt:"relation",state1:r[c-2],state2:r[c]};break;case 15:const Tt=g.trimColon(r[c]);this.$={stmt:"relation",state1:r[c-3],state2:r[c-1],description:Tt};break;case 19:this.$={stmt:"state",id:r[c-3],type:"default",description:"",doc:r[c-1]};break;case 20:var G=r[c],q=r[c-2].trim();if(r[c].match(":")){var ut=r[c].split(":");G=ut[0],q=[q,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:q};break;case 21:this.$={stmt:"state",id:r[c-3],type:"default",description:r[c-5],doc:r[c-1]};break;case 22:this.$={stmt:"state",id:r[c],type:"fork"};break;case 23:this.$={stmt:"state",id:r[c],type:"join"};break;case 24:this.$={stmt:"state",id:r[c],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[c-1].trim(),note:{position:r[c-2].trim(),text:r[c].trim()}};break;case 29:this.$=r[c].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=r[c].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[c-3],url:r[c-2],tooltip:r[c-1]};break;case 33:this.$={stmt:"click",id:r[c-3],url:r[c-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[c-1].trim(),classes:r[c].trim()};break;case 36:this.$={stmt:"style",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 37:this.$={stmt:"applyClass",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[c].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:d,19:T,22:E,24:m,25:I,26:v,27:x,28:$,29:O,32:25,33:f,35:L,37:C,38:V,41:P,45:k,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:p,17:d,19:T,22:E,24:m,25:I,26:v,27:x,28:$,29:O,32:25,33:f,35:L,37:C,38:V,41:P,45:k,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:m,57:J},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ct,[2,44],{58:[1,56]}),t(ct,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:m,57:J},t(y,[2,17]),t(Lt,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(y,[2,14],{14:[1,71]}),{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:d,19:T,21:[1,72],22:E,24:m,25:I,26:v,27:x,28:$,29:O,32:25,33:f,35:L,37:C,38:V,41:P,45:k,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(ct,[2,46]),t(ct,[2,47]),t(y,[2,15]),t(y,[2,19]),t(Lt,i,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:d,19:T,21:[1,81],22:E,24:m,25:I,26:v,27:x,28:$,29:O,32:25,33:f,35:L,37:C,38:V,41:P,45:k,48:B,51:j,52:nt,53:ot,54:lt,57:J},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:S(function(l,u){if(u.recoverable)this.trace(l);else{var n=new Error(l);throw n.hash=u,n}},"parseError"),parse:S(function(l){var u=this,n=[0],g=[],_=[null],r=[],Y=this.table,c="",G=0,q=0,ut=2,et=1,Tt=r.slice.call(arguments,1),D=Object.create(this.lexer),H={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(H.yy[Et]=this.yy[Et]);D.setInput(l,H.yy),H.yy.lexer=D,H.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var _t=D.yylloc;r.push(_t);var Zt=D.options&&D.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(R){n.length=n.length-2*R,_.length=_.length-R,r.length=r.length-R}S(te,"popStack");function wt(){var R;return R=g.pop()||D.lex()||et,typeof R!="number"&&(R instanceof Array&&(g=R,R=g.pop()),R=u.symbols_[R]||R),R}S(wt,"lex");for(var w,z,N,mt,Q={},dt,M,It,ft;;){if(z=n[n.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((w===null||typeof w>"u")&&(w=wt()),N=Y[z]&&Y[z][w]),typeof N>"u"||!N.length||!N[0]){var bt="";ft=[];for(dt in Y[z])this.terminals_[dt]&&dt>ut&&ft.push("'"+this.terminals_[dt]+"'");D.showPosition?bt="Parse error on line "+(G+1)+`:
|
|
2
2
|
`+D.showPosition()+`
|
|
3
|
-
Expecting `+ft.join(", ")+", got '"+(this.terminals_[w]||w)+"'":bt="Parse error on line "+(G+1)+": Unexpected "+(w==et?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(bt,{text:D.match,token:this.terminals_[w]||w,line:D.yylineno,loc:_t,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+w);switch(N[0]){case 1:n.push(w),_.push(D.yytext),r.push(D.yylloc),n.push(N[1]),w=null,q=D.yyleng,c=D.yytext,G=D.yylineno,_t=D.yylloc;break;case 2:if(M=this.productions_[N[1]][1],Q.$=_[_.length-M],Q._$={first_line:r[r.length-(M||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(M||1)].first_column,last_column:r[r.length-1].last_column},Zt&&(Q._$.range=[r[r.length-(M||1)].range[0],r[r.length-1].range[1]]),mt=this.performAction.apply(Q,[c,q,G,H.yy,N[1],_,r].concat(Tt)),typeof mt<"u")return mt;M&&(n=n.slice(0,-1*M*2),_=_.slice(0,-1*M),r=r.slice(0,-1*M)),n.push(this.productions_[N[1]][0]),_.push(Q.$),r.push(Q._$),
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:S(function(l){this.unput(this.match.slice(l))},"less"),pastInput:S(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:S(function(){var l=this.pastInput(),
|
|
5
|
-
`+
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:S(function(){var d=this.next();return d||this.lex()},"lex"),begin:S(function(d){this.conditionStack.push(d)},"begin"),popState:S(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:S(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:S(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:S(function(d){this.begin(d)},"pushState"),stateStackSize:S(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:S(function(d,n,g,_){function r(){const Y=n.yytext.indexOf("%%");if(Y===0)return!1;if(Y>0){const c=n.yytext.slice(0,Y),G=n.yytext.slice(Y);G&&d.lexer.unput(G),n.yytext=c}return!0}switch(S(r,"processId"),g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return r()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+n.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return r()?(this.popState(),"ID"):void 0;case 66:return r()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return r()?24:void 0;case 74:return n.yytext=n.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return U})();gt.lexer=Qt;function ht(){this.yy={}}return S(ht,"Parser"),ht.prototype=gt,gt.Parser=ht,new ht})();Ct.parser=Ct;var je=Ct,Se="TB",Yt="TB",Ot="dir",tt="state",Z="root",At="relation",ye="classDef",ge="style",Te="applyClass",rt="default",Gt="divider",Vt="fill:none",Mt="fill: #333",Ut="c",Wt="markdown",jt="normal",kt="rect",vt="rectWithTitle",Ee="stateStart",_e="stateEnd",It="divider",Nt="roundedWithTitle",me="note",be="noteGroup",at="statediagram",De="state",ke=`${at}-${De}`,Ht="transition",ve="note",Ce="note-edge",Ae=`${Ht} ${Ce}`,xe=`${at}-${ve}`,Le="cluster",we=`${at}-${Le}`,Re="cluster-alt",Oe=`${at}-${Re}`,zt="parent",Kt="note",Ie="state",xt="----",Ne=`${xt}${Kt}`,$t=`${xt}${zt}`,Xt=S((t,e=Yt)=>{if(!t.doc)return e;let s=e;for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir"),$e=S(function(t,e){return e.db.getClasses()},"getClasses"),Fe=S(async function(t,e,s,a){b.info("REF0:"),b.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:o,layout:h}=F();a.db.extract(a.db.getRootDocV2());const p=a.db.getData(),f=ee(e,i);p.type=a.type,p.layoutAlgorithm=h,p.nodeSpacing=(o==null?void 0:o.nodeSpacing)||50,p.rankSpacing=(o==null?void 0:o.rankSpacing)||50,F().look==="neo"?p.markers=["barbNeo"]:p.markers=["barb"],p.diagramId=e,await ie(p,f);const E=8;try{(typeof a.db.getLinks=="function"?a.db.getLinks():new Map).forEach((R,C)=>{var P;const x=typeof C=="string"?C:typeof(C==null?void 0:C.id)=="string"?C.id:"",$=p.nodes.find(v=>v.id===x);if(!x){b.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(C));return}const O=(P=f.node())==null?void 0:P.querySelectorAll("g.node, g.rough-node");let u;if(O==null||O.forEach(v=>{var j;const B=(j=v.textContent)==null?void 0:j.trim();(v.id===($==null?void 0:$.domId)||B===x)&&(u=v)}),!u){b.warn("⚠️ Could not find node matching text:",x);return}const L=u.parentNode;if(!L){b.warn("⚠️ Node has no parent, cannot wrap:",x);return}const k=document.createElementNS("http://www.w3.org/2000/svg","a"),V=R.url.replace(/^"+|"+$/g,"");if(k.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",V),k.setAttribute("target","_blank"),R.tooltip){const v=R.tooltip.replace(/^"+|"+$/g,"");k.setAttribute("title",v),u.setAttribute("title",v)}L.replaceChild(k,u),k.appendChild(u),b.info("🔗 Wrapped node in <a> tag for:",x,R.url)})}catch(m){b.error("❌ Error injecting clickable links:",m)}re.insertTitle(f,"statediagramTitleText",(o==null?void 0:o.titleTopMargin)??25,a.db.getDiagramTitle()),se(f,E,at,(o==null?void 0:o.useMaxWidth)??!0)},"draw"),He={getClasses:$e,draw:Fe,getDir:Xt},St=new Map,W=0;function yt(t="",e=0,s="",a=xt){const i=s!==null&&s.length>0?`${a}${s}`:"";return`${Ie}-${t}${i}-${e}`}S(yt,"stateDomId");var Pe=S((t,e,s,a,i,o,h,p)=>{b.trace("items",e),e.forEach(f=>{switch(f.stmt){case tt:it(t,f,s,a,i,o,h,p);break;case rt:it(t,f,s,a,i,o,h,p);break;case At:{it(t,f.state1,s,a,i,o,h,p),it(t,f.state2,s,a,i,o,h,p);const T=h==="neo",E={id:"edge"+W,start:f.state1.id,end:f.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Vt,labelStyle:"",label:K.sanitizeText(f.description??"",F()),arrowheadStyle:Mt,labelpos:Ut,labelType:Wt,thickness:jt,classes:Ht,look:h};i.push(E),W++}break}})},"setupDoc"),Ft=S((t,e=Yt)=>{let s=e;if(t.doc)for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir");function st(t,e,s){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const o=s.get(i);o&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...o.styles])}));const a=t.find(i=>i.id===e.id);a?Object.assign(a,e):t.push(e)}S(st,"insertOrUpdateNode");function Jt(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}S(Jt,"getClassesFromDbInfo");function qt(t){return(t==null?void 0:t.styles)??[]}S(qt,"getStylesFromDbInfo");var it=S((t,e,s,a,i,o,h,p)=>{var C,x,$;const f=e.id,T=s.get(f),E=Jt(T),m=qt(T),R=F();if(b.info("dataFetcher parsedItem",e,T,m),f!=="root"){let O=kt;e.start===!0?O=Ee:e.start===!1&&(O=_e),e.type!==rt&&(O=e.type),St.get(f)||St.set(f,{id:f,shape:O,description:K.sanitizeText(f,R),cssClasses:`${E} ${ke}`,cssStyles:m});const u=St.get(f);e.description&&(Array.isArray(u.description)?(u.shape=vt,u.description.push(e.description)):(C=u.description)!=null&&C.length&&u.description.length>0?(u.shape=vt,u.description===f?u.description=[e.description]:u.description=[u.description,e.description]):(u.shape=kt,u.description=e.description),u.description=K.sanitizeTextOrArray(u.description,R)),((x=u.description)==null?void 0:x.length)===1&&u.shape===vt&&(u.type==="group"?u.shape=Nt:u.shape=kt),!u.type&&e.doc&&(b.info("Setting cluster for XCX",f,Ft(e)),u.type="group",u.isGroup=!0,u.dir=Ft(e),u.explicitDir=e.doc.some(k=>k.stmt==="dir"),u.shape=e.type===Gt?It:Nt,u.cssClasses=`${u.cssClasses} ${we} ${o?Oe:""}`);const L={labelStyle:"",shape:u.shape,label:u.description,cssClasses:u.cssClasses,cssCompiledStyles:[],cssStyles:u.cssStyles,id:f,dir:u.dir,domId:yt(f,W),type:u.type,isGroup:u.type==="group",padding:8,rx:10,ry:10,look:h,labelType:"markdown"};if(L.shape===It&&(L.label=""),t&&t.id!=="root"&&(b.trace("Setting node ",f," to be child of its parent ",t.id),L.parentId=t.id),L.centerLabel=!0,e.note){const k={labelStyle:"",shape:me,label:e.note.text,labelType:"markdown",cssClasses:xe,cssStyles:[],cssCompiledStyles:[],id:f+Ne+"-"+W,domId:yt(f,W,Kt),type:u.type,isGroup:u.type==="group",padding:($=R.flowchart)==null?void 0:$.padding,look:h,position:e.note.position},V=f+$t,P={labelStyle:"",shape:be,label:e.note.text,cssClasses:u.cssClasses,cssStyles:[],id:f+$t,domId:yt(f,W,zt),type:"group",isGroup:!0,padding:16,look:h,position:e.note.position};W++,P.id=V,k.parentId=V,st(a,P,p),st(a,k,p),st(a,L,p);let v=f,B=k.id;e.note.position==="left of"&&(v=k.id,B=f),i.push({id:v+"-"+B,start:v,end:B,arrowhead:"none",arrowTypeEnd:"",style:Vt,labelStyle:"",classes:Ae,arrowheadStyle:Mt,labelpos:Ut,labelType:Wt,thickness:jt,look:h})}else st(a,L,p)}e.doc&&(b.trace("Adding nodes children "),Pe(e,e.doc,s,a,i,!o,h,p))},"dataFetcher"),Be=S(()=>{St.clear(),W=0},"reset"),A={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Pt=S(()=>new Map,"newClassesList"),Bt=S(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),pt=S(t=>JSON.parse(JSON.stringify(t)),"clone"),X,ze=(X=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Pt(),this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ae,this.setAccTitle=ne,this.getAccDescription=oe,this.setAccDescription=le,this.setDiagramTitle=ce,this.getDiagramTitle=he,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case tt:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case At:this.addRelation(i.state1,i.state2,i.description);break;case ye:this.addStyleClass(i.id.trim(),i.classes);break;case ge:this.handleStyleDef(i);break;case Te:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const s=this.getStates(),a=F();Be(),it(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,a.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const s=e.id.trim().split(","),a=e.styleClass.split(",");for(const i of s){let o=this.getState(i);if(!o){const h=i.trim();this.addState(h),o=this.getState(h)}o&&(o.styles=a.map(h=>{var p;return(p=h.replace(/;/g,""))==null?void 0:p.trim()}))}}setRootDoc(e){b.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,s,a){if(s.stmt===At){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===tt&&(s.id===A.START_NODE?(s.id=e.id+(a?"_start":"_end"),s.start=a):s.id=s.id.trim()),s.stmt!==Z&&s.stmt!==tt||!s.doc)return;const i=[];let o=[];for(const h of s.doc)if(h.type===Gt){const p=pt(h);p.doc=pt(o),i.push(p),o=[]}else o.push(h);if(i.length>0&&o.length>0){const h={stmt:tt,id:ue(),type:"divider",doc:pt(o)};i.push(pt(h)),s.doc=i}s.doc.forEach(h=>this.docTranslator(s,h,!0))}getRootDocV2(){return this.docTranslator({id:Z,stmt:Z},{id:Z,stmt:Z,doc:this.rootDoc},!0),{id:Z,doc:this.rootDoc}}addState(e,s=rt,a=void 0,i=void 0,o=void 0,h=void 0,p=void 0,f=void 0){const T=e==null?void 0:e.trim();if(!this.currentDocument.states.has(T))b.info("Adding state ",T,i),this.currentDocument.states.set(T,{stmt:tt,id:T,descriptions:[],type:s,doc:a,note:o,classes:[],styles:[],textStyles:[]});else{const E=this.currentDocument.states.get(T);if(!E)throw new Error(`State not found: ${T}`);E.doc||(E.doc=a),E.type||(E.type=s)}if(i&&(b.info("Setting state description",T,i),(Array.isArray(i)?i:[i]).forEach(m=>this.addDescription(T,m.trim()))),o){const E=this.currentDocument.states.get(T);if(!E)throw new Error(`State not found: ${T}`);E.note=o,E.note.text=K.sanitizeText(E.note.text,F())}h&&(b.info("Setting state classes",T,h),(Array.isArray(h)?h:[h]).forEach(m=>this.setCssClass(T,m.trim()))),p&&(b.info("Setting state styles",T,p),(Array.isArray(p)?p:[p]).forEach(m=>this.setStyle(T,m.trim()))),f&&(b.info("Setting state styles",T,p),(Array.isArray(f)?f:[f]).forEach(m=>this.setTextStyle(T,m.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Pt(),e||(this.links=new Map,de())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){b.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,a){this.links.set(e,{url:s,tooltip:a}),b.warn("Adding link",e,s,a)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===A.START_NODE?(this.startEndCount++,`${A.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",s=rt){return e===A.START_NODE?A.START_TYPE:s}endIdIfNeeded(e=""){return e===A.END_NODE?(this.startEndCount++,`${A.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",s=rt){return e===A.END_NODE?A.END_TYPE:s}addRelationObjs(e,s,a=""){const i=this.startIdIfNeeded(e.id.trim()),o=this.startTypeIfNeeded(e.id.trim(),e.type),h=this.startIdIfNeeded(s.id.trim()),p=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(i,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(h,p,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:i,id2:h,relationTitle:K.sanitizeText(a,F())})}addRelation(e,s,a){if(typeof e=="object"&&typeof s=="object")this.addRelationObjs(e,s,a);else if(typeof e=="string"&&typeof s=="string"){const i=this.startIdIfNeeded(e.trim()),o=this.startTypeIfNeeded(e),h=this.endIdIfNeeded(s.trim()),p=this.endTypeIfNeeded(s);this.addState(i,o),this.addState(h,p),this.currentDocument.relations.push({id1:i,id2:h,relationTitle:a?K.sanitizeText(a,F()):void 0})}}addDescription(e,s){var o;const a=this.currentDocument.states.get(e),i=s.startsWith(":")?s.replace(":","").trim():s;(o=a==null?void 0:a.descriptions)==null||o.push(K.sanitizeText(i,F()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const a=this.classes.get(e);s&&a&&s.split(A.STYLECLASS_SEP).forEach(i=>{const o=i.replace(/([^;]*);/,"$1").trim();if(RegExp(A.COLOR_KEYWORD).exec(i)){const p=o.replace(A.FILL_KEYWORD,A.BG_FILL).replace(A.COLOR_KEYWORD,A.FILL_KEYWORD);a.textStyles.push(p)}a.styles.push(o)})}getClasses(){return this.classes}setupToolTips(e){const s=pe();Dt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",o=>{var T;const h=Dt(o.currentTarget),p=h.attr("title");if(p===null)return;const f=(T=o.currentTarget)==null?void 0:T.getBoundingClientRect();s.transition().duration(200).style("opacity",".9"),s.style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),s.html(fe.sanitize(p)),h.classed("hover",!0)}).on("mouseout",o=>{s.transition().duration(500).style("opacity",0),Dt(o.currentTarget).classed("hover",!1)})}setCssClass(e,s){e.split(",").forEach(a=>{var o;let i=this.getState(a);if(!i){const h=a.trim();this.addState(h),i=this.getState(h)}(o=i==null?void 0:i.classes)==null||o.push(s)})}setStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.styles)==null||i.push(s)}setTextStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.textStyles)==null||i.push(s)}bindFunctions(e){this.funs.forEach(s=>{s(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Ot)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??Se}setDirection(e){const s=this.getDirectionStatement();s?s.value=e:this.rootDoc.unshift({stmt:Ot,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=F();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Xt(this.getRootDocV2())}}getConfig(){return F().state}},S(X,"StateDB"),X.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},X),Ye=S(t=>`
|
|
3
|
+
Expecting `+ft.join(", ")+", got '"+(this.terminals_[w]||w)+"'":bt="Parse error on line "+(G+1)+": Unexpected "+(w==et?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(bt,{text:D.match,token:this.terminals_[w]||w,line:D.yylineno,loc:_t,expected:ft})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+w);switch(N[0]){case 1:n.push(w),_.push(D.yytext),r.push(D.yylloc),n.push(N[1]),w=null,q=D.yyleng,c=D.yytext,G=D.yylineno,_t=D.yylloc;break;case 2:if(M=this.productions_[N[1]][1],Q.$=_[_.length-M],Q._$={first_line:r[r.length-(M||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(M||1)].first_column,last_column:r[r.length-1].last_column},Zt&&(Q._$.range=[r[r.length-(M||1)].range[0],r[r.length-1].range[1]]),mt=this.performAction.apply(Q,[c,q,G,H.yy,N[1],_,r].concat(Tt)),typeof mt<"u")return mt;M&&(n=n.slice(0,-1*M*2),_=_.slice(0,-1*M),r=r.slice(0,-1*M)),n.push(this.productions_[N[1]][0]),_.push(Q.$),r.push(Q._$),It=Y[n[n.length-2]][n[n.length-1]],n.push(It);break;case 3:return!0}}return!0},"parse")},Qt=(function(){var U={EOF:1,parseError:S(function(u,n){if(this.yy.parser)this.yy.parser.parseError(u,n);else throw new Error(u)},"parseError"),setInput:S(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:S(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:S(function(l){var u=l.length,n=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===g.length?this.yylloc.first_column:0)+g[g.length-n.length].length-n[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:S(function(){return this._more=!0,this},"more"),reject:S(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:S(function(l){this.unput(this.match.slice(l))},"less"),pastInput:S(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:S(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
|
|
5
|
+
`+u+"^"},"showPosition"),test_match:S(function(l,u){var n,g,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),g=l[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],n=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in _)this[r]=_[r];return!1}return!1},"test_match"),next:S(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,u,n,g;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),r=0;r<_.length;r++)if(n=this._input.match(this.rules[_[r]]),n&&(!u||n[0].length>u[0].length)){if(u=n,g=r,this.options.backtrack_lexer){if(l=this.test_match(n,_[r]),l!==!1)return l;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(l=this.test_match(u,_[g]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:S(function(){var u=this.next();return u||this.lex()},"lex"),begin:S(function(u){this.conditionStack.push(u)},"begin"),popState:S(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:S(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:S(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:S(function(u){this.begin(u)},"pushState"),stateStackSize:S(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:S(function(u,n,g,_){function r(){const Y=n.yytext.indexOf("%%");if(Y===0)return!1;if(Y>0){const c=n.yytext.slice(0,Y),G=n.yytext.slice(Y);G&&u.lexer.unput(G),n.yytext=c}return!0}switch(S(r,"processId"),g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState("SCALE"),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 33:return this.pushState("SCALE"),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:return r()?(this.popState(),"ID"):void 0;case 50:this.popState();break;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+n.yytext.trim()+'"');case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 63:break;case 64:return"NOTE_TEXT";case 65:return r()?(this.popState(),"ID"):void 0;case 66:return r()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return r()?24:void 0;case 74:return n.yytext=n.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};return U})();gt.lexer=Qt;function ht(){this.yy={}}return S(ht,"Parser"),ht.prototype=gt,gt.Parser=ht,new ht})();Ct.parser=Ct;var je=Ct,Se="TB",Yt="TB",Ot="dir",tt="state",Z="root",At="relation",ye="classDef",ge="style",Te="applyClass",rt="default",Gt="divider",Vt="fill:none",Mt="fill: #333",Ut="c",Wt="markdown",jt="normal",kt="rect",vt="rectWithTitle",Ee="stateStart",_e="stateEnd",Rt="divider",Nt="roundedWithTitle",me="note",be="noteGroup",at="statediagram",De="state",ke=`${at}-${De}`,Ht="transition",ve="note",Ce="note-edge",Ae=`${Ht} ${Ce}`,xe=`${at}-${ve}`,Le="cluster",we=`${at}-${Le}`,Ie="cluster-alt",Oe=`${at}-${Ie}`,zt="parent",Kt="note",Re="state",xt="----",Ne=`${xt}${Kt}`,$t=`${xt}${zt}`,Xt=S((t,e=Yt)=>{if(!t.doc)return e;let s=e;for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir"),$e=S(function(t,e){return e.db.getClasses()},"getClasses"),Fe=S(async function(t,e,s,a){b.info("REF0:"),b.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:o,layout:h}=F();a.db.extract(a.db.getRootDocV2());const p=a.db.getData(),d=ee(e,i);p.type=a.type,p.layoutAlgorithm=h,p.nodeSpacing=(o==null?void 0:o.nodeSpacing)||50,p.rankSpacing=(o==null?void 0:o.rankSpacing)||50,F().look==="neo"?p.markers=["barbNeo"]:p.markers=["barb"],p.diagramId=e,await ie(p,d);const E=8;try{(typeof a.db.getLinks=="function"?a.db.getLinks():new Map).forEach((I,v)=>{var P;const x=typeof v=="string"?v:typeof(v==null?void 0:v.id)=="string"?v.id:"",$=p.nodes.find(k=>k.id===x);if(!x){b.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(v));return}const O=(P=d.node())==null?void 0:P.querySelectorAll("g.node, g.rough-node");let f;if(O==null||O.forEach(k=>{var j;const B=(j=k.textContent)==null?void 0:j.trim();(k.id===($==null?void 0:$.domId)||B===x)&&(f=k)}),!f){b.warn("⚠️ Could not find node matching text:",x);return}const L=f.parentNode;if(!L){b.warn("⚠️ Node has no parent, cannot wrap:",x);return}const C=document.createElementNS("http://www.w3.org/2000/svg","a"),V=I.url.replace(/^"+|"+$/g,"");if(C.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",V),C.setAttribute("target","_blank"),I.tooltip){const k=I.tooltip.replace(/^"+|"+$/g,"");C.setAttribute("title",k),f.setAttribute("title",k)}L.replaceChild(C,f),C.appendChild(f),b.info("🔗 Wrapped node in <a> tag for:",x,I.url)})}catch(m){b.error("❌ Error injecting clickable links:",m)}re.insertTitle(d,"statediagramTitleText",(o==null?void 0:o.titleTopMargin)??25,a.db.getDiagramTitle()),se(d,E,at,(o==null?void 0:o.useMaxWidth)??!0)},"draw"),He={getClasses:$e,draw:Fe,getDir:Xt},St=new Map,W=0;function yt(t="",e=0,s="",a=xt){const i=s!==null&&s.length>0?`${a}${s}`:"";return`${Re}-${t}${i}-${e}`}S(yt,"stateDomId");var Pe=S((t,e,s,a,i,o,h,p)=>{b.trace("items",e),e.forEach(d=>{switch(d.stmt){case tt:it(t,d,s,a,i,o,h,p);break;case rt:it(t,d,s,a,i,o,h,p);break;case At:{it(t,d.state1,s,a,i,o,h,p),it(t,d.state2,s,a,i,o,h,p);const T=h==="neo",E={id:"edge"+W,start:d.state1.id,end:d.state2.id,arrowhead:"normal",arrowTypeEnd:T?"arrow_barb_neo":"arrow_barb",style:Vt,labelStyle:"",label:K.sanitizeText(d.description??"",F()),arrowheadStyle:Mt,labelpos:Ut,labelType:Wt,thickness:jt,classes:Ht,look:h};i.push(E),W++}break}})},"setupDoc"),Ft=S((t,e=Yt)=>{let s=e;if(t.doc)for(const a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir");function st(t,e,s){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{const o=s.get(i);o&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...o.styles])}));const a=t.find(i=>i.id===e.id);a?Object.assign(a,e):t.push(e)}S(st,"insertOrUpdateNode");function Jt(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}S(Jt,"getClassesFromDbInfo");function qt(t){return(t==null?void 0:t.styles)??[]}S(qt,"getStylesFromDbInfo");var it=S((t,e,s,a,i,o,h,p)=>{var v,x,$;const d=e.id,T=s.get(d),E=Jt(T),m=qt(T),I=F();if(b.info("dataFetcher parsedItem",e,T,m),d!=="root"){let O=kt;e.start===!0?O=Ee:e.start===!1&&(O=_e),e.type!==rt&&(O=e.type),St.get(d)||St.set(d,{id:d,shape:O,description:K.sanitizeText(d,I),cssClasses:`${E} ${ke}`,cssStyles:m});const f=St.get(d);e.description&&(Array.isArray(f.description)?(f.shape=vt,f.description.push(e.description)):(v=f.description)!=null&&v.length&&f.description.length>0?(f.shape=vt,f.description===d?f.description=[e.description]:f.description=[f.description,e.description]):(f.shape=kt,f.description=e.description),f.description=K.sanitizeTextOrArray(f.description,I)),((x=f.description)==null?void 0:x.length)===1&&f.shape===vt&&(f.type==="group"?f.shape=Nt:f.shape=kt),!f.type&&e.doc&&(b.info("Setting cluster for XCX",d,Ft(e)),f.type="group",f.isGroup=!0,f.dir=Ft(e),f.shape=e.type===Gt?Rt:Nt,f.cssClasses=`${f.cssClasses} ${we} ${o?Oe:""}`);const L={labelStyle:"",shape:f.shape,label:f.description,cssClasses:f.cssClasses,cssCompiledStyles:[],cssStyles:f.cssStyles,id:d,dir:f.dir,domId:yt(d,W),type:f.type,isGroup:f.type==="group",padding:8,rx:10,ry:10,look:h,labelType:"markdown"};if(L.shape===Rt&&(L.label=""),t&&t.id!=="root"&&(b.trace("Setting node ",d," to be child of its parent ",t.id),L.parentId=t.id),L.centerLabel=!0,e.note){const C={labelStyle:"",shape:me,label:e.note.text,labelType:"markdown",cssClasses:xe,cssStyles:[],cssCompiledStyles:[],id:d+Ne+"-"+W,domId:yt(d,W,Kt),type:f.type,isGroup:f.type==="group",padding:($=I.flowchart)==null?void 0:$.padding,look:h,position:e.note.position},V=d+$t,P={labelStyle:"",shape:be,label:e.note.text,cssClasses:f.cssClasses,cssStyles:[],id:d+$t,domId:yt(d,W,zt),type:"group",isGroup:!0,padding:16,look:h,position:e.note.position};W++,P.id=V,C.parentId=V,st(a,P,p),st(a,C,p),st(a,L,p);let k=d,B=C.id;e.note.position==="left of"&&(k=C.id,B=d),i.push({id:k+"-"+B,start:k,end:B,arrowhead:"none",arrowTypeEnd:"",style:Vt,labelStyle:"",classes:Ae,arrowheadStyle:Mt,labelpos:Ut,labelType:Wt,thickness:jt,look:h})}else st(a,L,p)}e.doc&&(b.trace("Adding nodes children "),Pe(e,e.doc,s,a,i,!o,h,p))},"dataFetcher"),Be=S(()=>{St.clear(),W=0},"reset"),A={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Pt=S(()=>new Map,"newClassesList"),Bt=S(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),pt=S(t=>JSON.parse(JSON.stringify(t)),"clone"),X,ze=(X=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Pt(),this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=ae,this.setAccTitle=ne,this.getAccDescription=oe,this.setAccDescription=le,this.setDiagramTitle=ce,this.getDiagramTitle=he,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}extract(e){this.clear(!0);for(const i of Array.isArray(e)?e:e.doc)switch(i.stmt){case tt:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case At:this.addRelation(i.state1,i.state2,i.description);break;case ye:this.addStyleClass(i.id.trim(),i.classes);break;case ge:this.handleStyleDef(i);break;case Te:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const s=this.getStates(),a=F();Be(),it(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,a.look,this.classes);for(const i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){const s=e.id.trim().split(","),a=e.styleClass.split(",");for(const i of s){let o=this.getState(i);if(!o){const h=i.trim();this.addState(h),o=this.getState(h)}o&&(o.styles=a.map(h=>{var p;return(p=h.replace(/;/g,""))==null?void 0:p.trim()}))}}setRootDoc(e){b.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,s,a){if(s.stmt===At){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===tt&&(s.id===A.START_NODE?(s.id=e.id+(a?"_start":"_end"),s.start=a):s.id=s.id.trim()),s.stmt!==Z&&s.stmt!==tt||!s.doc)return;const i=[];let o=[];for(const h of s.doc)if(h.type===Gt){const p=pt(h);p.doc=pt(o),i.push(p),o=[]}else o.push(h);if(i.length>0&&o.length>0){const h={stmt:tt,id:ue(),type:"divider",doc:pt(o)};i.push(pt(h)),s.doc=i}s.doc.forEach(h=>this.docTranslator(s,h,!0))}getRootDocV2(){return this.docTranslator({id:Z,stmt:Z},{id:Z,stmt:Z,doc:this.rootDoc},!0),{id:Z,doc:this.rootDoc}}addState(e,s=rt,a=void 0,i=void 0,o=void 0,h=void 0,p=void 0,d=void 0){const T=e==null?void 0:e.trim();if(!this.currentDocument.states.has(T))b.info("Adding state ",T,i),this.currentDocument.states.set(T,{stmt:tt,id:T,descriptions:[],type:s,doc:a,note:o,classes:[],styles:[],textStyles:[]});else{const E=this.currentDocument.states.get(T);if(!E)throw new Error(`State not found: ${T}`);E.doc||(E.doc=a),E.type||(E.type=s)}if(i&&(b.info("Setting state description",T,i),(Array.isArray(i)?i:[i]).forEach(m=>this.addDescription(T,m.trim()))),o){const E=this.currentDocument.states.get(T);if(!E)throw new Error(`State not found: ${T}`);E.note=o,E.note.text=K.sanitizeText(E.note.text,F())}h&&(b.info("Setting state classes",T,h),(Array.isArray(h)?h:[h]).forEach(m=>this.setCssClass(T,m.trim()))),p&&(b.info("Setting state styles",T,p),(Array.isArray(p)?p:[p]).forEach(m=>this.setStyle(T,m.trim()))),d&&(b.info("Setting state styles",T,p),(Array.isArray(d)?d:[d]).forEach(m=>this.setTextStyle(T,m.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Pt(),e||(this.links=new Map,de())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){b.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,a){this.links.set(e,{url:s,tooltip:a}),b.warn("Adding link",e,s,a)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===A.START_NODE?(this.startEndCount++,`${A.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",s=rt){return e===A.START_NODE?A.START_TYPE:s}endIdIfNeeded(e=""){return e===A.END_NODE?(this.startEndCount++,`${A.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",s=rt){return e===A.END_NODE?A.END_TYPE:s}addRelationObjs(e,s,a=""){const i=this.startIdIfNeeded(e.id.trim()),o=this.startTypeIfNeeded(e.id.trim(),e.type),h=this.startIdIfNeeded(s.id.trim()),p=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(i,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(h,p,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:i,id2:h,relationTitle:K.sanitizeText(a,F())})}addRelation(e,s,a){if(typeof e=="object"&&typeof s=="object")this.addRelationObjs(e,s,a);else if(typeof e=="string"&&typeof s=="string"){const i=this.startIdIfNeeded(e.trim()),o=this.startTypeIfNeeded(e),h=this.endIdIfNeeded(s.trim()),p=this.endTypeIfNeeded(s);this.addState(i,o),this.addState(h,p),this.currentDocument.relations.push({id1:i,id2:h,relationTitle:a?K.sanitizeText(a,F()):void 0})}}addDescription(e,s){var o;const a=this.currentDocument.states.get(e),i=s.startsWith(":")?s.replace(":","").trim():s;(o=a==null?void 0:a.descriptions)==null||o.push(K.sanitizeText(i,F()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});const a=this.classes.get(e);s&&a&&s.split(A.STYLECLASS_SEP).forEach(i=>{const o=i.replace(/([^;]*);/,"$1").trim();if(RegExp(A.COLOR_KEYWORD).exec(i)){const p=o.replace(A.FILL_KEYWORD,A.BG_FILL).replace(A.COLOR_KEYWORD,A.FILL_KEYWORD);a.textStyles.push(p)}a.styles.push(o)})}getClasses(){return this.classes}setupToolTips(e){const s=pe();Dt(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",o=>{var T;const h=Dt(o.currentTarget),p=h.attr("title");if(p===null)return;const d=(T=o.currentTarget)==null?void 0:T.getBoundingClientRect();s.transition().duration(200).style("opacity",".9"),s.style("left",window.scrollX+d.left+(d.right-d.left)/2+"px").style("top",window.scrollY+d.bottom+"px"),s.html(fe.sanitize(p)),h.classed("hover",!0)}).on("mouseout",o=>{s.transition().duration(500).style("opacity",0),Dt(o.currentTarget).classed("hover",!1)})}setCssClass(e,s){e.split(",").forEach(a=>{var o;let i=this.getState(a);if(!i){const h=a.trim();this.addState(h),i=this.getState(h)}(o=i==null?void 0:i.classes)==null||o.push(s)})}setStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.styles)==null||i.push(s)}setTextStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.textStyles)==null||i.push(s)}bindFunctions(e){this.funs.forEach(s=>{s(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===Ot)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??Se}setDirection(e){const s=this.getDirectionStatement();s?s.value=e:this.rootDoc.unshift({stmt:Ot,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=F();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Xt(this.getRootDocV2())}}getConfig(){return F().state}},S(X,"StateDB"),X.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},X),Ye=S(t=>`
|
|
7
7
|
defs [id$="-barbEnd"] {
|
|
8
8
|
fill: ${t.transitionColor};
|
|
9
9
|
stroke: ${t.transitionColor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as a,d as w,l as x}from"./render-O7CIS3YK-
|
|
1
|
+
import{_ as a,d as w,l as x}from"./render-O7CIS3YK-DQb_czkx.js";var B=a((e,t,i,o)=>{e.attr("class",i);const{width:r,height:h,x:n,y:c}=u(e,t);w(e,h,r,o);const s=d(n,c,r,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{var o;const i=((o=e.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),d=a((e,t,i,o,r)=>`${e-r} ${t-r} ${i} ${o}`,"createViewBox");export{B as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as l}from"./mermaid.core-
|
|
1
|
+
import{_ as l}from"./mermaid.core-CnNeOEec.js";function m(e,c){var i,t,o;e.accDescr&&((i=c.setAccDescription)==null||i.call(c,e.accDescr)),e.accTitle&&((t=c.setAccTitle)==null||t.call(c,e.accTitle)),e.title&&((o=c.setDiagramTitle)==null||o.call(c,e.title))}l(m,"populateCommonDb");export{m as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as i,m as d,r as p}from"./render-O7CIS3YK-
|
|
1
|
+
import{_ as i,m as d,r as p}from"./render-O7CIS3YK-DQb_czkx.js";import{a as x}from"./mermaid-layout-elk.core-CNNSrMhF.js";import{s as l}from"./transform-Bd_a5eGM.js";var o=x(p()),c=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),f=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};c(r,e).lower()},"drawBackgroundRect"),h=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),w=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=(0,o.sanitizeUrl)(s);a.attr("xlink:href",n)},"drawImage"),k=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=(0,o.sanitizeUrl)(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),v=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),E=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),R=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{f as a,v as b,k as c,c as d,w as e,R as f,E as g,h};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as se}from"./chunk-NDIOYS4C-
|
|
1
|
+
import{g as se}from"./chunk-NDIOYS4C-DkAwrWHj.js";import{_ as S,l as D,c as P,y as ie,z as re,a as ae,b as ne,g as oe,s as le,n as ce,o as he,U as ue,i as J,p as de,R as fe}from"./render-O7CIS3YK-DQb_czkx.js";import{s as pe}from"./chunk-ISA7TJRJ-Cua7d2fi.js";import{f as Se}from"./chunk-LV3HUYFY-BCzMQT8Q.js";import{_ as m}from"./mermaid-layout-elk.core-CNNSrMhF.js";import{s as vt}from"./transform-Bd_a5eGM.js";var xt=(function(){var t=S(function(W,l,u,n){for(u=u||{},n=W.length;n--;u[W[n]]=l);return u},"o"),e=[1,2],s=[1,3],a=[1,4],r=[2,4],o=[1,9],h=[1,11],p=[1,16],d=[1,17],T=[1,18],E=[1,19],b=[1,33],R=[1,20],C=[1,21],L=[1,22],F=[1,23],O=[1,24],f=[1,26],I=[1,27],A=[1,28],M=[1,29],B=[1,30],v=[1,31],Y=[1,32],H=[1,35],ct=[1,36],ht=[1,37],ut=[1,38],q=[1,34],y=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],dt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],Ot=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],Tt={trace:S(m(function(){},"trace"),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:S(m(function(l,u,n,g,_,i,G){var c=i.length-1;switch(_){case 3:return g.setRootDoc(i[c]),i[c];case 4:this.$=[];break;case 5:i[c]!="nl"&&(i[c-1].push(i[c]),this.$=i[c-1]);break;case 6:case 7:this.$=i[c];break;case 8:this.$="nl";break;case 12:this.$=i[c];break;case 13:const rt=i[c-1];rt.description=g.trimColon(i[c]),this.$=rt;break;case 14:this.$={stmt:"relation",state1:i[c-2],state2:i[c]};break;case 15:const Et=g.trimColon(i[c]);this.$={stmt:"relation",state1:i[c-3],state2:i[c-1],description:Et};break;case 19:this.$={stmt:"state",id:i[c-3],type:"default",description:"",doc:i[c-1]};break;case 20:var V=i[c],Q=i[c-2].trim();if(i[c].match(":")){var ft=i[c].split(":");V=ft[0],Q=[Q,ft[1]]}this.$={stmt:"state",id:V,type:"default",description:Q};break;case 21:this.$={stmt:"state",id:i[c-3],type:"default",description:i[c-5],doc:i[c-1]};break;case 22:this.$={stmt:"state",id:i[c],type:"fork"};break;case 23:this.$={stmt:"state",id:i[c],type:"join"};break;case 24:this.$={stmt:"state",id:i[c],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[c-1].trim(),note:{position:i[c-2].trim(),text:i[c].trim()}};break;case 29:this.$=i[c].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[c].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[c-3],url:i[c-2],tooltip:i[c-1]};break;case 33:this.$={stmt:"click",id:i[c-3],url:i[c-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[c-1].trim(),classes:i[c].trim()};break;case 36:this.$={stmt:"style",id:i[c-1].trim(),styleClass:i[c].trim()};break;case 37:this.$={stmt:"applyClass",id:i[c-1].trim(),styleClass:i[c].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[c].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[c-2].trim(),classes:[i[c].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[c-2].trim(),classes:[i[c].trim()],type:"default",description:""};break}},"anonymous"),"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:d,19:T,22:E,24:b,25:R,26:C,27:L,28:F,29:O,32:25,33:f,35:I,37:A,38:M,41:B,45:v,48:Y,51:H,52:ct,53:ht,54:ut,57:q},t(y,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:p,17:d,19:T,22:E,24:b,25:R,26:C,27:L,28:F,29:O,32:25,33:f,35:I,37:A,38:M,41:B,45:v,48:Y,51:H,52:ct,53:ht,54:ut,57:q},t(y,[2,7]),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(y,[2,11]),t(y,[2,12],{14:[1,40],15:[1,41]}),t(y,[2,16]),{18:[1,42]},t(y,[2,18],{20:[1,43]}),{23:[1,44]},t(y,[2,22]),t(y,[2,23]),t(y,[2,24]),t(y,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(y,[2,28]),{34:[1,49]},{36:[1,50]},t(y,[2,31]),{13:51,24:b,57:q},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(dt,[2,44],{58:[1,56]}),t(dt,[2,45],{58:[1,57]}),t(y,[2,38]),t(y,[2,39]),t(y,[2,40]),t(y,[2,41]),t(y,[2,6]),t(y,[2,13]),{13:58,24:b,57:q},t(y,[2,17]),t(Ot,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(y,[2,29]),t(y,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(y,[2,14],{14:[1,71]}),{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:d,19:T,21:[1,72],22:E,24:b,25:R,26:C,27:L,28:F,29:O,32:25,33:f,35:I,37:A,38:M,41:B,45:v,48:Y,51:H,52:ct,53:ht,54:ut,57:q},t(y,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),t(dt,[2,46]),t(dt,[2,47]),t(y,[2,15]),t(y,[2,19]),t(Ot,r,{7:78}),t(y,[2,26]),t(y,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:p,17:d,19:T,21:[1,81],22:E,24:b,25:R,26:C,27:L,28:F,29:O,32:25,33:f,35:I,37:A,38:M,41:B,45:v,48:Y,51:H,52:ct,53:ht,54:ut,57:q},t(y,[2,32]),t(y,[2,33]),t(y,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:S(m(function(l,u){if(u.recoverable)this.trace(l);else{var n=new Error(l);throw n.hash=u,n}},"parseError"),"parseError"),parse:S(m(function(l){var u=this,n=[0],g=[],_=[null],i=[],G=this.table,c="",V=0,Q=0,ft=2,rt=1,Et=i.slice.call(arguments,1),k=Object.create(this.lexer),K={yy:{}};for(var _t in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_t)&&(K.yy[_t]=this.yy[_t]);k.setInput(l,K.yy),K.yy.lexer=k,K.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var mt=k.yylloc;i.push(mt);var ee=k.options&&k.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Nt(N){n.length=n.length-2*N,_.length=_.length-N,i.length=i.length-N}m(Nt,"popStack"),S(Nt,"popStack");function bt(){var N;return N=g.pop()||k.lex()||rt,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=u.symbols_[N]||N),N}m(bt,"lex"),S(bt,"lex");for(var w,X,$,Dt,Z={},pt,U,$t,St;;){if(X=n[n.length-1],this.defaultActions[X]?$=this.defaultActions[X]:((w===null||typeof w>"u")&&(w=bt()),$=G[X]&&G[X][w]),typeof $>"u"||!$.length||!$[0]){var kt="";St=[];for(pt in G[X])this.terminals_[pt]&&pt>ft&&St.push("'"+this.terminals_[pt]+"'");k.showPosition?kt="Parse error on line "+(V+1)+`:
|
|
2
2
|
`+k.showPosition()+`
|
|
3
3
|
Expecting `+St.join(", ")+", got '"+(this.terminals_[w]||w)+"'":kt="Parse error on line "+(V+1)+": Unexpected "+(w==rt?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(kt,{text:k.match,token:this.terminals_[w]||w,line:k.yylineno,loc:mt,expected:St})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+w);switch($[0]){case 1:n.push(w),_.push(k.yytext),i.push(k.yylloc),n.push($[1]),w=null,Q=k.yyleng,c=k.yytext,V=k.yylineno,mt=k.yylloc;break;case 2:if(U=this.productions_[$[1]][1],Z.$=_[_.length-U],Z._$={first_line:i[i.length-(U||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(U||1)].first_column,last_column:i[i.length-1].last_column},ee&&(Z._$.range=[i[i.length-(U||1)].range[0],i[i.length-1].range[1]]),Dt=this.performAction.apply(Z,[c,Q,V,K.yy,$[1],_,i].concat(Et)),typeof Dt<"u")return Dt;U&&(n=n.slice(0,-1*U*2),_=_.slice(0,-1*U),i=i.slice(0,-1*U)),n.push(this.productions_[$[1]][0]),_.push(Z.$),i.push(Z._$),$t=G[n[n.length-2]][n[n.length-1]],n.push($t);break;case 3:return!0}}return!0},"parse"),"parse")},te=(function(){var W={EOF:1,parseError:S(m(function(u,n){if(this.yy.parser)this.yy.parser.parseError(u,n);else throw new Error(u)},"parseError"),"parseError"),setInput:S(function(l,u){return this.yy=u||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:S(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:S(function(l){var u=l.length,n=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===g.length?this.yylloc.first_column:0)+g[g.length-n.length].length-n[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:S(function(){return this._more=!0,this},"more"),reject:S(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:S(function(l){this.unput(this.match.slice(l))},"less"),pastInput:S(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:S(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as s}from"./render-O7CIS3YK-
|
|
1
|
+
import{_ as s}from"./render-O7CIS3YK-DQb_czkx.js";import{s as o}from"./transform-Bd_a5eGM.js";var d=s((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as a,d as w,l as x}from"./mermaid.core-
|
|
1
|
+
import{_ as a,d as w,l as x}from"./mermaid.core-CnNeOEec.js";var B=a((e,t,i,o)=>{e.attr("class",i);const{width:r,height:h,x:n,y:c}=u(e,t);w(e,h,r,o);const s=d(n,c,r,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{var o;const i=((o=e.node())==null?void 0:o.getBBox())||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),d=a((e,t,i,o,r)=>`${e-r} ${t-r} ${i} ${o}`,"createViewBox");export{B as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as s}from"./render-O7CIS3YK-
|
|
1
|
+
import{_ as s}from"./render-O7CIS3YK-DQb_czkx.js";import{_ as e}from"./mermaid-layout-elk.core-CNNSrMhF.js";var t,m=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},e(t,"ImperativeState"),s(t,"ImperativeState"),t);export{m as I};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{_ as p,l as k,
|
|
2
|
-
`),k.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ne=Y,ae=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ne,getDiagramTitle:ae},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:a,theme:n,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return le.test(a)?a:i},"sanitizeColorValue"),
|
|
1
|
+
import{_ as p,l as k,F as X,z as B,q,H as G,d as U,i as j,c as K}from"./mermaid.core-CnNeOEec.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),k.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),k.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};k.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&k.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),k.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,`
|
|
2
|
+
`),k.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ne=Y,ae=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ne,getDiagramTitle:ae},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:a,theme:n,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return le.test(a)?a:i},"sanitizeColorValue"),H=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return se.test(a)?a:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=H(e.fontFamily,f.fontFamily),a=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=B(),a={...G(),...i.themeVariables??{},...me(e)},n=pe(a),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??n.compactMode,padding:F(t.padding,n.padding),verticalSeparation:F(t.verticalSeparation,n.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,n.horizontalSeparation),arcRadius:F(t.arcRadius,n.arcRadius),fontSize:F(t.fontSize,n.fontSize),fontFamily:H(t.fontFamily,n.fontFamily),terminalFill:m(t.terminalFill,n.terminalFill),terminalStroke:m(t.terminalStroke,n.terminalStroke),terminalTextColor:m(t.terminalTextColor,n.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:m(t.lineColor,n.lineColor),strokeWidth:F(t.strokeWidth,n.strokeWidth),markerFill:m(t.markerFill,n.markerFill),commentFill:m(t.commentFill,n.commentFill),commentStroke:m(t.commentStroke,n.commentStroke),commentTextColor:m(t.commentTextColor,n.commentTextColor),specialFill:m(t.specialFill,n.specialFill),specialStroke:m(t.specialStroke,n.specialStroke),ruleNameColor:m(t.ruleNameColor,n.ruleNameColor),showMarkers:t.showMarkers??n.showMarkers,markerRadius:F(t.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:n,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return`
|
|
3
3
|
.railroad-diagram {
|
|
4
4
|
font-family: ${i};
|
|
5
5
|
font-size: ${a}px;
|
|
@@ -84,5 +84,5 @@ import{_ as p,l as k,E as G,y as B,p as H,G as q,d as U,h as j,c as K}from"./mer
|
|
|
84
84
|
.railroad-group {
|
|
85
85
|
/* Grouping container, no specific styles */
|
|
86
86
|
}
|
|
87
|
-
`},"getStyles"),R,x=(R=class{constructor(){this.d=""}moveTo(i,a){return this.d+=`M ${i} ${a} `,this}lineTo(i,a){return this.d+=`L ${i} ${a} `,this}horizontalTo(i){return this.d+=`H ${i} `,this}verticalTo(i){return this.d+=`V ${i} `,this}arcTo(i,a,n,t,r,o,g){return this.d+=`A ${i} ${a} ${n} ${t?1:0} ${r?1:0} ${o} ${g} `,this}build(){return this.d.trim()}},p(R,"PathBuilder"),R),$,ue=($=class{constructor(i,a=E()){this.textCache=new Map,this.svg=i,this.config=a}measureText(i){if(this.textCache.has(i))return this.textCache.get(i);const a=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(i),n=a.node().getBBox(),t={width:n.width,height:n.height};return a.remove(),this.textCache.set(i,t),t}renderTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r).attr("rx",10).attr("ry",10),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderNonTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderSequence(i,a){const n=a.map(s=>this.renderExpression(i,s));let t=0,r=0,o=0;for(const s of n)t+=s.dimensions.width,r=Math.max(r,s.dimensions.up),o=Math.max(o,s.dimensions.down);t+=(n.length-1)*this.config.horizontalSeparation;const g=i.append("g").attr("class","railroad-sequence");let l=0;for(let s=0;s<n.length;s++){const h=n[s],u=r-h.dimensions.up;if(g.node().appendChild(h.element).setAttribute("transform",`translate(${l}, ${u})`),s<n.length-1){const w=l+h.dimensions.width,d=w+this.config.horizontalSeparation,T=r;g.append("path").attr("class","railroad-line").attr("d",new x().moveTo(w,T).lineTo(d,T).build())}l+=h.dimensions.width+this.config.horizontalSeparation}return{element:g.node(),dimensions:{width:t,height:r+o,up:r,down:o}}}renderChoice(i,a){const n=a.map(c=>this.renderExpression(i,c));let t=0,r=0;for(const c of n)t=Math.max(t,c.dimensions.width),r+=c.dimensions.height;r+=(n.length-1)*this.config.verticalSeparation;const o=this.config.arcRadius,g=o*4,l=t+g,s=i.append("g").attr("class","railroad-choice");let h=0;const u=r/2;for(const c of n){const w=h,d=w+c.dimensions.up,T=o*2+(t-c.dimensions.width)/2;s.node().appendChild(c.element).setAttribute("transform",`translate(${T}, ${w})`);const S=new x,C=d>u;d===u?S.moveTo(0,u).lineTo(T,d):S.moveTo(0,u).arcTo(o,o,0,!1,C,o,u+(C?o:-o)).lineTo(o,d-(C?o:-o)).arcTo(o,o,0,!1,!C,o*2,d).lineTo(T,d),s.append("path").attr("class","railroad-line").attr("d",S.build());const N=new x,_=T+c.dimensions.width,
|
|
88
|
-
`+e);try{const n=
|
|
87
|
+
`},"getStyles"),R,x=(R=class{constructor(){this.d=""}moveTo(i,a){return this.d+=`M ${i} ${a} `,this}lineTo(i,a){return this.d+=`L ${i} ${a} `,this}horizontalTo(i){return this.d+=`H ${i} `,this}verticalTo(i){return this.d+=`V ${i} `,this}arcTo(i,a,n,t,r,o,g){return this.d+=`A ${i} ${a} ${n} ${t?1:0} ${r?1:0} ${o} ${g} `,this}build(){return this.d.trim()}},p(R,"PathBuilder"),R),$,ue=($=class{constructor(i,a=E()){this.textCache=new Map,this.svg=i,this.config=a}measureText(i){if(this.textCache.has(i))return this.textCache.get(i);const a=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(i),n=a.node().getBBox(),t={width:n.width,height:n.height};return a.remove(),this.textCache.set(i,t),t}renderTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r).attr("rx",10).attr("ry",10),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderNonTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderSequence(i,a){const n=a.map(s=>this.renderExpression(i,s));let t=0,r=0,o=0;for(const s of n)t+=s.dimensions.width,r=Math.max(r,s.dimensions.up),o=Math.max(o,s.dimensions.down);t+=(n.length-1)*this.config.horizontalSeparation;const g=i.append("g").attr("class","railroad-sequence");let l=0;for(let s=0;s<n.length;s++){const h=n[s],u=r-h.dimensions.up;if(g.node().appendChild(h.element).setAttribute("transform",`translate(${l}, ${u})`),s<n.length-1){const w=l+h.dimensions.width,d=w+this.config.horizontalSeparation,T=r;g.append("path").attr("class","railroad-line").attr("d",new x().moveTo(w,T).lineTo(d,T).build())}l+=h.dimensions.width+this.config.horizontalSeparation}return{element:g.node(),dimensions:{width:t,height:r+o,up:r,down:o}}}renderChoice(i,a){const n=a.map(c=>this.renderExpression(i,c));let t=0,r=0;for(const c of n)t=Math.max(t,c.dimensions.width),r+=c.dimensions.height;r+=(n.length-1)*this.config.verticalSeparation;const o=this.config.arcRadius,g=o*4,l=t+g,s=i.append("g").attr("class","railroad-choice");let h=0;const u=r/2;for(const c of n){const w=h,d=w+c.dimensions.up,T=o*2+(t-c.dimensions.width)/2;s.node().appendChild(c.element).setAttribute("transform",`translate(${T}, ${w})`);const S=new x,C=d>u;d===u?S.moveTo(0,u).lineTo(T,d):S.moveTo(0,u).arcTo(o,o,0,!1,C,o,u+(C?o:-o)).lineTo(o,d-(C?o:-o)).arcTo(o,o,0,!1,!C,o*2,d).lineTo(T,d),s.append("path").attr("class","railroad-line").attr("d",S.build());const N=new x,_=T+c.dimensions.width,I=l-o*2;d===u?N.moveTo(_,d).lineTo(l,u):N.moveTo(_,d).lineTo(I,d).arcTo(o,o,0,!1,!C,l-o,d+(C?-o:o)).lineTo(l-o,u+(C?o:-o)).arcTo(o,o,0,!1,C,l,u),s.append("path").attr("class","railroad-line").attr("d",N.build()),h+=c.dimensions.height+this.config.verticalSeparation}return{element:s.node(),dimensions:{width:l,height:r,up:u,down:r-u}}}renderOptional(i,a){const n=this.renderExpression(i,a),t=this.config.arcRadius,r=t*2,o=n.dimensions.width+t*4,g=n.dimensions.height+r,l=i.append("g").attr("class","railroad-optional"),s=t*2,h=r;l.node().appendChild(n.element).setAttribute("transform",`translate(${s}, ${h})`);const c=h+n.dimensions.up,w=new x().moveTo(0,c).lineTo(t*2,c);l.append("path").attr("class","railroad-line").attr("d",w.build());const d=new x().moveTo(s+n.dimensions.width,c).lineTo(o,c);l.append("path").attr("class","railroad-line").attr("d",d.build());const T=new x().moveTo(0,c).arcTo(t,t,0,!1,!1,t,c-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(o-t*2,0).arcTo(t,t,0,!1,!0,o-t,t).lineTo(o-t,c-t).arcTo(t,t,0,!1,!1,o,c);return l.append("path").attr("class","railroad-line").attr("d",T.build()),{element:l.node(),dimensions:{width:o,height:g,up:c,down:g-c}}}renderRepetition(i,a,n){const t=this.renderExpression(i,a),r=this.config.arcRadius,o=r*2,g=t.dimensions.width+r*4,l=n===0,s=t.dimensions.height+o+(l?o:0),h=i.append("g").attr("class","railroad-repetition"),u=r*2,c=l?o:0;h.node().appendChild(t.element).setAttribute("transform",`translate(${u}, ${c})`);const d=c+t.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(0,d).lineTo(r*2,d).build()),h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(u+t.dimensions.width,d).lineTo(g,d).build());const T=c+t.dimensions.height+r,z=new x().moveTo(u+t.dimensions.width,d).arcTo(r,r,0,!1,!0,u+t.dimensions.width+r,d+r).lineTo(u+t.dimensions.width+r,T).arcTo(r,r,0,!1,!0,u+t.dimensions.width,T+r).lineTo(r*2,T+r).arcTo(r,r,0,!1,!0,r,T).lineTo(r,d+r).arcTo(r,r,0,!1,!0,r*2,d);if(h.append("path").attr("class","railroad-line").attr("d",z.build()),l){const S=new x().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(g-r*2,0).arcTo(r,r,0,!1,!0,g-r,r).lineTo(g-r,d-r).arcTo(r,r,0,!1,!1,g,d);h.append("path").attr("class","railroad-line").attr("d",S.build())}return{element:h.node(),dimensions:{width:g,height:s,up:d,down:s-d}}}renderSpecial(i,a){const n=this.measureText("? "+a+" ?"),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-special");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text("? "+a+" ?"),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderExpression(i,a){switch(a.type){case"terminal":return this.renderTerminal(i,a.value);case"nonterminal":return this.renderNonTerminal(i,a.name);case"sequence":return this.renderSequence(i,a.elements);case"choice":return this.renderChoice(i,a.alternatives);case"optional":return this.renderOptional(i,a.element);case"repetition":return this.renderRepetition(i,a.element,a.min);case"special":return this.renderSpecial(i,a.text);default:throw new Error(`Unknown node type: ${a.type}`)}}renderRule(i,a){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${a})`),t=i.name+" =",r=this.measureText(t).width+20,o=r+20,g=n.append("g"),l=this.renderExpression(g,i.definition),s=Math.max(20,l.dimensions.up),h=s-l.dimensions.up;return g.attr("transform",`translate(${o}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",s).text(t),n.append("g").attr("class","railroad-start").append("circle").attr("cx",r).attr("cy",s).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",o+l.dimensions.width+10).attr("cy",s).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new x().moveTo(r+this.config.markerRadius,s).lineTo(o,s).build()),n.append("path").attr("class","railroad-line").attr("d",new x().moveTo(o+l.dimensions.width,s).lineTo(o+l.dimensions.width+10-this.config.markerRadius,s).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:o+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(i){let a=this.config.padding,n=0;for(const t of i){const r=this.renderRule(t,a);a+=r.height+this.config.verticalSeparation,n=Math.max(n,r.width)}return{width:n+this.config.padding*2,height:a+this.config.padding}}},p($,"RailroadRenderer"),$),W=p((e,i,a)=>{U(e,i.height,i.width,a),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),ge=p((e,i,a)=>{k.debug(`[Railroad] Rendering diagram
|
|
88
|
+
`+e);try{const n=X(i);n.attr("class","railroad-diagram");const t=B().railroad,r=(t==null?void 0:t.useMaxWidth)??!0,o=oe.getRules();if(k.debug(`[Railroad] Rendering ${o.length} rules`),o.length===0){k.warn("[Railroad] No rules to render"),W(n,{height:100,width:200},r);return}const l=new ue(n,E()).renderDiagram(o);W(n,l,r),k.debug("[Railroad] Render complete")}catch(n){throw k.error("[Railroad] Render error:",n),n}},"draw"),xe={draw:ge};export{oe as d,Te as g,xe as r};
|