lookatstudy-mobile 0.37.0 → 0.37.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 +106 -4
- package/web/assets/{CanvasStage-DNJ3CvSQ.js → CanvasStage-By84li0a.js} +1 -1
- package/web/assets/{CommandPalette-0omhbLg3.js → CommandPalette-DJpv5YLk.js} +1 -1
- package/web/assets/{CompanionBotLab-CT_JHmNI.js → CompanionBotLab-BrjON5X5.js} +1 -1
- package/web/assets/{CourseSearchPanel-DVtN9ACi.js → CourseSearchPanel-Dp-83TJq.js} +1 -1
- package/web/assets/{ExamView-DPMDpplK.js → ExamView-BiWyQCTQ.js} +1 -1
- package/web/assets/{MermaidArtifact-BaJ5RvRv.js → MermaidArtifact-C-9JGr1S.js} +3 -3
- package/web/assets/{PersonalProfileModal-IhrruXfg.js → PersonalProfileModal-Bberh-21.js} +1 -1
- package/web/assets/{ReviewPanel-C1ldctfO.js → ReviewPanel-D52vKY80.js} +1 -1
- package/web/assets/SettingsView-BE8J-BR5.js +20 -0
- package/web/assets/{VoicePanel-CcYGhBPb.js → VoicePanel-Df6DgExP.js} +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-ODA7YWAP-CbNOQFqA.js → abnfDiagram-VCTEODGH-ODA7YWAP-GEEhu7or.js} +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-BU9D6UxH.js → abnfDiagram-VCTEODGH-xWn5W_Em.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-C4PU3XN7-T9qCk6kM.js → architectureDiagram-5GKGNRK7-C4PU3XN7-JmOGh5LH.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-CKMhI1Ee.js → architectureDiagram-5GKGNRK7-CvI35bTW.js} +1 -1
- package/web/assets/{blockDiagram-I7D4REHJ-Bik9DaYN.js → blockDiagram-I7D4REHJ-BMKUeuF0.js} +1 -1
- package/web/assets/{blockDiagram-NRAW4CY4-UMJ6PMQQ-Dy4ybhQI.js → blockDiagram-NRAW4CY4-UMJ6PMQQ-Dv4-Yiui.js} +1 -1
- package/web/assets/{c4Diagram-7LVT6UL2-IRtYuDM_.js → c4Diagram-7LVT6UL2-DNalANVV.js} +1 -1
- package/web/assets/{c4Diagram-UCG6FXSJ-75X3U2P3-BCGvMp1I.js → c4Diagram-UCG6FXSJ-75X3U2P3-BMz228D6.js} +1 -1
- package/web/assets/channel-BsRXIHWg.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-DSi_blpC.js → chunk-2Q5K7J3B-M3FYrmxX.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-JiyA-wo9.js → chunk-5VM5RSS4-nbGREPjw.js} +1 -1
- package/web/assets/{chunk-7XDTSPCN-Cvb-oYet.js → chunk-7XDTSPCN-rYhyRTOx.js} +1 -1
- package/web/assets/{chunk-CTNIYPP6-HjnzrVvf.js → chunk-CTNIYPP6-BgXYMFW5.js} +1 -1
- package/web/assets/{chunk-CXNFBKHE-DzkNdxBi.js → chunk-CXNFBKHE-CkmFhBAk.js} +1 -1
- package/web/assets/{chunk-F27PBJKO-DqqFugb1.js → chunk-F27PBJKO-CAqAYmMM.js} +1 -1
- package/web/assets/{chunk-IMKFNOWR-0q0swfWT.js → chunk-IMKFNOWR-pDBbu4GI.js} +1 -1
- package/web/assets/{chunk-ISA7TJRJ-BX1hKFZw.js → chunk-ISA7TJRJ-CHl4BhBt.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-BGDdCd7e.js → chunk-JWPE2WC7-DSVI_4gB.js} +1 -1
- package/web/assets/{chunk-LV3HUYFY-DXfPtXuN.js → chunk-LV3HUYFY-Doco33ZI.js} +1 -1
- package/web/assets/{chunk-M3IUQBOH-BGP9XzSA.js → chunk-M3IUQBOH-RTAJkyza.js} +1 -1
- package/web/assets/{chunk-NDIOYS4C-CzRGOiBm.js → chunk-NDIOYS4C-DcWvuy8G.js} +1 -1
- package/web/assets/{chunk-POPQ4Y6H-CJEN76eb.js → chunk-POPQ4Y6H-yjjWWA8X.js} +1 -1
- package/web/assets/{chunk-RE4WF27V-CwpP9UVY.js → chunk-RE4WF27V-C32wZGPA.js} +1 -1
- package/web/assets/{chunk-SVP7TREG-DKVY1S0P.js → chunk-SVP7TREG-BdekvWAw.js} +1 -1
- package/web/assets/{chunk-TICWLB2K-DnGZt5_T.js → chunk-TICWLB2K-Cz68TTKA.js} +1 -1
- package/web/assets/{chunk-VII2H2IX-DXWnTQhH.js → chunk-VII2H2IX-fTD7U-xL.js} +1 -1
- package/web/assets/{chunk-X5GNSKZ3-EYUWZKOs.js → chunk-X5GNSKZ3-16RMlpb5.js} +1 -1
- package/web/assets/{chunk-XCWWM2C3-DX7b36ww.js → chunk-XCWWM2C3-CO-wuQPY.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-B_w3KgBK.js → chunk-XXDRQBXY-DPkBKESf.js} +1 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-BwnHfZhN.js +1 -0
- package/web/assets/classDiagram-ZZMXUADV-BBeyyi3H.js +1 -0
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-BwnHfZhN.js +1 -0
- package/web/assets/classDiagram-v2-VYDZK3BY-BBeyyi3H.js +1 -0
- package/web/assets/{core-BKUioWC8.js → core-CQhot3Yw.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-BQ05JG_e.js → cose-bilkent-JH36ORCC-NQkKxkmm.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-OB24KH3T-7k2xivYC.js → cose-bilkent-JH36ORCC-OB24KH3T-71WGRXpy.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-GVF3BKWE-CyNo44Ct.js → cynefin-OW5HDTMX-GVF3BKWE-wLMpc-W6.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-DOvceb57.js → cynefin-OW5HDTMX-Ycd8yaFB.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-H3WIRU3N-CLiDmyFZ.js → cynefinDiagram-5FMLGOSQ-H3WIRU3N-BqUnto1I.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-CLzU5hRI.js → cynefinDiagram-5FMLGOSQ-qdatKGJp.js} +1 -1
- package/web/assets/{dagre-3AP2YEHR-DCERTXHT-AZC3Sd7-.js → dagre-3AP2YEHR-DCERTXHT-DU7hl9mL.js} +1 -1
- package/web/assets/{dagre-GXQ25YYZ-XMzOJ88I.js → dagre-GXQ25YYZ-DXBvPLCC.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-BrCtmOAD.js → diagram-S7CK7UJ4-CJndlA9d.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-MULGZGEL-Cm4Xy-pF.js → diagram-S7CK7UJ4-MULGZGEL-ChZOJtIr.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-CCcvTlE_.js → diagram-UQ7AKVKN-ByEgUbMO.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-YQBY353J-CVJLwP7S.js → diagram-UQ7AKVKN-YQBY353J-CBg1xAIv.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-CdYFta9M.js → diagram-VSXAHHWV-DG9QiDXM.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-WLNH2ELY-CaWgm0pD.js → diagram-VSXAHHWV-WLNH2ELY-BmmwN3nm.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-CM05zRwP.js → diagram-VX7I27RA-D5I8_1IH.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-XW6YQV5G-DKYJGziA.js → diagram-VX7I27RA-XW6YQV5G-BpJ1XA39.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-He0OkO1p.js → diagram-Z3DM3KII-BgBYUzLO.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-HG7RF65D-kC8Vko9Q.js → diagram-Z3DM3KII-HG7RF65D-DvYaKe9o.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-D6LQclit.js → ebnfDiagram-PWID7BFC-BvljgvDM.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-OKY4VHYD-BPNXBqdL.js → ebnfDiagram-PWID7BFC-OKY4VHYD-Cnq_rs5C.js} +1 -1
- package/web/assets/{elk.bundled-Oi_dp_Nb.js → elk.bundled-DuC4qO17.js} +1 -1
- package/web/assets/{erDiagram-RLTQ6QDP-BC8Dyxni.js → erDiagram-RLTQ6QDP-CuGCxm27.js} +1 -1
- package/web/assets/{erDiagram-SSCWMZ5O-PIPKOIK7-BM5hP7pq.js → erDiagram-SSCWMZ5O-PIPKOIK7-DWea4HYD.js} +1 -1
- package/web/assets/{flowDiagram-A5DVABFB-2Z4AVO5R-BI_HnDMS.js → flowDiagram-A5DVABFB-2Z4AVO5R-Bt5oLSB0.js} +1 -1
- package/web/assets/{flowDiagram-HODETNUW-CQB-KRdk.js → flowDiagram-HODETNUW-ChwXi3ep.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-DtkBZQfB.js → ganttDiagram-EL5Y4UJY-Cip61aQW.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-JZNG7GOG-CAuwhLrG.js → ganttDiagram-EL5Y4UJY-JZNG7GOG-DIt3-EPi.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-CXMxBD1j.js → gitGraphDiagram-WWUBYQGX-BGE_KKwm.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-DMWMLL3G-CibDMxH5.js → gitGraphDiagram-WWUBYQGX-DMWMLL3G-CsyX4tkZ.js} +1 -1
- package/web/assets/{index-pqxwzTgM.js → index-48coRDBX.js} +3 -3
- package/web/assets/index-C9fscARj.js +53 -0
- package/web/assets/{index-CLC7uJBc.js → index-CatQea2M.js} +1 -1
- package/web/assets/{index-DKUjXJrj.js → index-D3SI1A7X.js} +1 -1
- package/web/assets/index-EInfxfl9.css +1 -0
- package/web/assets/{infoDiagram-27XIBGKW-BxdeKm2M.js → infoDiagram-27XIBGKW-CHFCryER.js} +1 -1
- package/web/assets/{infoDiagram-RXCK75RN-HANS5KVC-XymudzPp.js → infoDiagram-RXCK75RN-HANS5KVC-ocLW6L6_.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-7GCIT7WU-Ca0czL-r.js → ishikawaDiagram-5VMMS53U-7GCIT7WU-BUo_yhnm.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-YiLbdVr3.js → ishikawaDiagram-5VMMS53U-Bhg1TVZJ.js} +1 -1
- package/web/assets/{journeyDiagram-3NMN7TZE-o507o7V3.js → journeyDiagram-3NMN7TZE-C3OfUgiV.js} +1 -1
- package/web/assets/{journeyDiagram-EYS64GPL-OAPELBT7-COjG9fsS.js → journeyDiagram-EYS64GPL-OAPELBT7-DQESZnLZ.js} +1 -1
- package/web/assets/{kanban-definition-3QL26DDD-I7RKWQQY-dIeka5z7.js → kanban-definition-3QL26DDD-I7RKWQQY-BF-ZXqR5.js} +1 -1
- package/web/assets/{kanban-definition-UXKFOSKX-DPIPqDMI.js → kanban-definition-UXKFOSKX-CSI_GcJW.js} +1 -1
- package/web/assets/{katex-N6JRN4PM-C1WPCW7o.js → katex-N6JRN4PM-CxrguQd-.js} +1 -1
- package/web/assets/{layout-CoYqjJku.js → layout-CDbDCQeb.js} +1 -1
- package/web/assets/{main-s-bCU9xp.js → main-jV_OilRs.js} +11 -11
- package/web/assets/{mermaid-layout-elk.core-BDxAYedV.js → mermaid-layout-elk.core-B1-o2tyd.js} +2 -2
- package/web/assets/{mermaid.core-DP9HBKfF.js → mermaid.core-37_hzSNp.js} +5 -5
- package/web/assets/{mindmap-definition-FBJOCRG2-KIYZG64Y-B0M0vSNL.js → mindmap-definition-FBJOCRG2-KIYZG64Y-rppk7mo-.js} +1 -1
- package/web/assets/{mindmap-definition-YA3MSWOX-CZNKLpKf.js → mindmap-definition-YA3MSWOX-BUzaoDCs.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-BABqVbYU.js → pegDiagram-XKGWAZYB-CQPL5MMj.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-OIP57N6J-ChBhHDWi.js → pegDiagram-XKGWAZYB-OIP57N6J-CngQPdjr.js} +1 -1
- package/web/assets/{pet-BILzsmZE.js → pet-xGooCXVY.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-2UOTW327-Dh29Zr3p.js → pieDiagram-E7YTZNPT-2UOTW327-DkHaDPtZ.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-van1IvDV.js → pieDiagram-E7YTZNPT-BDTdqFkm.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-BKgVVqxX.js → quadrantDiagram-AXDQQJYC-CXFhoJ1v.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-SN3ASJJK-CZYkjMJl.js → quadrantDiagram-AXDQQJYC-SN3ASJJK-KFKnY5SQ.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-34742W6X-BpIuTMjt.js → railroadDiagram-O6MQD6OU-34742W6X-BMHll5kZ.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-CAJ_285V.js → railroadDiagram-O6MQD6OU-DdZMZ3P-.js} +1 -1
- package/web/assets/{render-O7CIS3YK-Ca_t2BjR.js → render-O7CIS3YK-BUZqrLRp.js} +7 -7
- package/web/assets/{requirementDiagram-BXWQKSXE-yAxTDLdz.js → requirementDiagram-BXWQKSXE-WrY_I6-V.js} +1 -1
- package/web/assets/{requirementDiagram-EFPCY7ZU-NGAFFSMB-qHev6ewP.js → requirementDiagram-EFPCY7ZU-NGAFFSMB-CmLM20oA.js} +1 -1
- package/web/assets/{rotate-ccw-BcZP2n0D.js → rotate-ccw-DZE_kYZu.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-3D3M4XPB-C0dgNg43.js → sankeyDiagram-P5KCCOFB-3D3M4XPB-RJsf4h9t.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-DzYIq4fM.js → sankeyDiagram-P5KCCOFB-Bjyi_fcC.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-bSfs95J7.js → sequenceDiagram-WJ2MYXX4-Co6SKGyz.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-Q2IOPB4R-CYgHEbKX.js → sequenceDiagram-WJ2MYXX4-Q2IOPB4R-B5nuUy2h.js} +1 -1
- package/web/assets/{sizeCapture-INFHLROL-6sblijow.js → sizeCapture-INFHLROL-CF0_wtm2.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-PSGVOMYM-BmietHRl.js → sizeCapture-X5ZJPWSS-PSGVOMYM-xWY2H6Me.js} +1 -1
- package/web/assets/{stateDiagram-D77RDMKH-BqN2X_4K.js → stateDiagram-D77RDMKH-5V-346Qd.js} +1 -1
- package/web/assets/{stateDiagram-HBIQ2CUA-4M2S6MAN-B7l4qfxn.js → stateDiagram-HBIQ2CUA-4M2S6MAN-B6gqxipM.js} +1 -1
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-DnphY6WO.js +1 -0
- package/web/assets/stateDiagram-v2-MP3YSRHH-DKtXGidN.js +1 -0
- package/web/assets/{swimlanes-42K2YHIH-BdpdGi8U.js → swimlanes-42K2YHIH-D9gzHPsn.js} +1 -1
- package/web/assets/{swimlanes-XN3QIQJK-N6N2CCQ6-DeA0ywq0.js → swimlanes-XN3QIQJK-N6N2CCQ6-rlPeyqTj.js} +1 -1
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-8pA5lT4C.js +8 -0
- package/web/assets/swimlanesDiagram-VR7AAH4N-B7BbPyRn.js +8 -0
- package/web/assets/{timeline-definition-24CTP7MA-C4WRMueq.js → timeline-definition-24CTP7MA-B2GfJfmd.js} +1 -1
- package/web/assets/{timeline-definition-24CTP7MA-KN7RSRVM-DCfXzMAD.js → timeline-definition-24CTP7MA-KN7RSRVM-CKXP2kGU.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-AKJ7LXAN-B22sFTL4.js → vennDiagram-4TSXK5OY-AKJ7LXAN-CybCMyEX.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-Czwyh2Ss.js → vennDiagram-4TSXK5OY-DkP-OS8t.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-3B6A3BN5-DUtEE3hD.js → wardleyDiagram-VM6X3IG4-3B6A3BN5-BdgAi1Gp.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-BaWPp6GW.js → wardleyDiagram-VM6X3IG4-DvRT9ehw.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-BzArL7i2.js → xychartDiagram-S5SC5T6Z-D0gQ0QKw.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-OBDNV6WG-C3eeDBv5.js → xychartDiagram-S5SC5T6Z-OBDNV6WG-23Q1AKCq.js} +1 -1
- package/web/index.html +3 -3
- package/web/pet.html +3 -3
- package/web/assets/SettingsView-B6w445fE.js +0 -20
- package/web/assets/channel-D6qbQnDp.js +0 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-D2p8cYeb.js +0 -1
- package/web/assets/classDiagram-ZZMXUADV-CFJO056W.js +0 -1
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-D2p8cYeb.js +0 -1
- package/web/assets/classDiagram-v2-VYDZK3BY-CFJO056W.js +0 -1
- package/web/assets/index-DNBtAT86.css +0 -1
- package/web/assets/index-DwG4tw4S.js +0 -53
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-DnMNJ_k7.js +0 -1
- package/web/assets/stateDiagram-v2-MP3YSRHH-DjlfW1YP.js +0 -1
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-rqMW1YeU.js +0 -8
- package/web/assets/swimlanesDiagram-VR7AAH4N-SUwVZHzH.js +0 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as r,s as e}from"./flowDiagram-A5DVABFB-2Z4AVO5R-Bt5oLSB0.js";import{_ as a}from"./render-O7CIS3YK-BUZqrLRp.js";import"./transform-Bd_a5eGM.js";import"./chunk-LV3HUYFY-Doco33ZI.js";import"./chunk-CXNFBKHE-CkmFhBAk.js";import"./chunk-NDIOYS4C-DcWvuy8G.js";import"./chunk-ISA7TJRJ-CHl4BhBt.js";import"./mermaid-layout-elk.core-B1-o2tyd.js";import"./main-jV_OilRs.js";import"./index-C9fscARj.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";var o=a(t=>`${e(t)}
|
|
2
|
+
.swimlane.cluster rect {
|
|
3
|
+
stroke: ${t.clusterBorder} !important;
|
|
4
|
+
}
|
|
5
|
+
[data-look="neo"].cluster rect {
|
|
6
|
+
filter: none;
|
|
7
|
+
}
|
|
8
|
+
`,"getStyles"),m=o,g=r({defaultLayout:"swimlane",styles:m});export{g as diagram};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as r,s as e}from"./flowDiagram-HODETNUW-ChwXi3ep.js";import{_ as a}from"./mermaid.core-37_hzSNp.js";import"./transform-Bd_a5eGM.js";import"./chunk-5VM5RSS4-nbGREPjw.js";import"./chunk-XXDRQBXY-DPkBKESf.js";import"./chunk-POPQ4Y6H-yjjWWA8X.js";import"./chunk-F27PBJKO-CAqAYmMM.js";import"./channel-BsRXIHWg.js";import"./main-jV_OilRs.js";import"./index-C9fscARj.js";var o=a(t=>`${e(t)}
|
|
2
|
+
.swimlane.cluster rect {
|
|
3
|
+
stroke: ${t.clusterBorder} !important;
|
|
4
|
+
}
|
|
5
|
+
[data-look="neo"].cluster rect {
|
|
6
|
+
filter: none;
|
|
7
|
+
}
|
|
8
|
+
`,"getStyles"),m=o,_=r({defaultLayout:"swimlane",styles:m});export{_ as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as l,z as pt,V as Wt,W as Pt,X as Bt,c as gt,l as S,F as Vt,G as Ft,Y as ft,u as zt,$ as Gt,q as Ot}from"./mermaid.core-
|
|
1
|
+
import{_ as l,z as pt,V as Wt,W as Pt,X as Bt,c as gt,l as S,F as Vt,G as Ft,Y as ft,u as zt,$ as Gt,q as Ot}from"./mermaid.core-37_hzSNp.js";import{s as J}from"./transform-Bd_a5eGM.js";import{d as ot}from"./arc-D2ssjz3E.js";import"./main-jV_OilRs.js";import"./index-C9fscARj.js";var tt=(function(){var e=l(function(k,s,d,h){for(d=d||{},h=k.length;h--;d[k[h]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],o=[1,15],c=[1,16],a=[1,19],p=[1,20],y={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:l(function(s,d,h,g,m,u,w){var v=u.length-1;switch(m){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:o,20:c,21:17,22:18,23:a,24:p},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:o,20:c,21:17,22:18,23:a,24:p},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:l(function(s,d){if(d.recoverable)this.trace(s);else{var h=new Error(s);throw h.hash=d,h}},"parseError"),parse:l(function(s){var d=this,h=[0],g=[],m=[null],u=[],w=this.table,v="",M=0,C=0,P=2,V=1,L=u.slice.call(arguments,1),_=Object.create(this.lexer),R={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(R.yy[F]=this.yy[F]);_.setInput(s,R.yy),R.yy.lexer=_,R.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;u.push(z);var Z=_.options&&_.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(A){h.length=h.length-2*A,m.length=m.length-A,u.length=u.length-A}l(X,"popStack");function O(){var A;return A=g.pop()||_.lex()||V,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}l(O,"lex");for(var $,N,b,T,E={},H,I,B,D;;){if(N=h[h.length-1],this.defaultActions[N]?b=this.defaultActions[N]:(($===null||typeof $>"u")&&($=O()),b=w[N]&&w[N][$]),typeof b>"u"||!b.length||!b[0]){var q="";D=[];for(H in w[N])this.terminals_[H]&&H>P&&D.push("'"+this.terminals_[H]+"'");_.showPosition?q="Parse error on line "+(M+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+D.join(", ")+", got '"+(this.terminals_[$]||$)+"'":q="Parse error on line "+(M+1)+": Unexpected "+($==V?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(q,{text:_.match,token:this.terminals_[$]||$,line:_.yylineno,loc:z,expected:D})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+$);switch(b[0]){case 1:h.push($),m.push(_.yytext),u.push(_.yylloc),h.push(b[1]),$=null,C=_.yyleng,v=_.yytext,M=_.yylineno,z=_.yylloc;break;case 2:if(I=this.productions_[b[1]][1],E.$=m[m.length-I],E._$={first_line:u[u.length-(I||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(I||1)].first_column,last_column:u[u.length-1].last_column},Z&&(E._$.range=[u[u.length-(I||1)].range[0],u[u.length-1].range[1]]),T=this.performAction.apply(E,[v,C,M,R.yy,b[1],m,u].concat(L)),typeof T<"u")return T;I&&(h=h.slice(0,-1*I*2),m=m.slice(0,-1*I),u=u.slice(0,-1*I)),h.push(this.productions_[b[1]][0]),m.push(E.$),u.push(E._$),B=w[h[h.length-2]][h[h.length-1]],h.push(B);break;case 3:return!0}}return!0},"parse")},x=(function(){var k={EOF:1,parseError:l(function(d,h){if(this.yy.parser)this.yy.parser.parseError(d,h);else throw new Error(d)},"parseError"),setInput:l(function(s,d){return this.yy=d||this.yy||{},this._input=s,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:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var d=s.length,h=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;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),h.length-1&&(this.yylineno-=h.length-1);var m=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:h?(h.length===g.length?this.yylloc.first_column:0)+g[g.length-h.length].length-h[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as c,A as gt,an as Pt,ao as Bt,ap as Vt,c as ft,l as E,G as Ft,H as zt,aq as yt,v as Gt,ar as Ot,p as Dt}from"./render-O7CIS3YK-
|
|
1
|
+
import{_ as c,A as gt,an as Pt,ao as Bt,ap as Vt,c as ft,l as E,G as Ft,H as zt,aq as yt,v as Gt,ar as Ot,p as Dt}from"./render-O7CIS3YK-BUZqrLRp.js";import{_ as k}from"./mermaid-layout-elk.core-B1-o2tyd.js";import{s as Q}from"./transform-Bd_a5eGM.js";import{d as lt}from"./arc-D2ssjz3E.js";import"./main-jV_OilRs.js";import"./index-C9fscARj.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";var nt=(function(){var e=c(function(v,i,h,d){for(h=h||{},d=v.length;d--;h[v[d]]=i);return h},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],s=[1,13],r=[1,14],o=[1,15],l=[1,16],a=[1,19],p=[1,20],y={trace:c(k(function(){},"trace"),"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:c(k(function(i,h,d,g,m,u,S){var b=u.length-1;switch(m){case 1:return u[b-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[b-1].push(u[b]),this.$=u[b-1];break;case 7:case 8:this.$=u[b];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[b].substr(6)),this.$=u[b].substr(6);break;case 12:this.$=u[b].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[b].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[b].substr(8)),this.$=u[b].substr(8);break;case 18:g.addTask(u[b],0,""),this.$=u[b];break;case 19:g.addEvent(u[b].substr(2)),this.$=u[b];break}},"anonymous"),"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:s,17:r,19:o,20:l,21:17,22:18,23:a,24:p},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:s,17:r,19:o,20:l,21:17,22:18,23:a,24:p},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:c(k(function(i,h){if(h.recoverable)this.trace(i);else{var d=new Error(i);throw d.hash=h,d}},"parseError"),"parseError"),parse:c(k(function(i){var h=this,d=[0],g=[],m=[null],u=[],S=this.table,b="",A=0,W=0,B=2,F=1,M=u.slice.call(arguments,1),w=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);w.setInput(i,C.yy),C.yy.lexer=w,C.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var G=w.yylloc;u.push(G);var J=w.options&&w.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function q(R){d.length=d.length-2*R,m.length=m.length-R,u.length=u.length-R}k(q,"popStack"),c(q,"popStack");function O(){var R;return R=g.pop()||w.lex()||F,typeof R!="number"&&(R instanceof Array&&(g=R,R=g.pop()),R=h.symbols_[R]||R),R}k(O,"lex"),c(O,"lex");for(var N,I,_,$,T={},L,H,V,K;;){if(I=d[d.length-1],this.defaultActions[I]?_=this.defaultActions[I]:((N===null||typeof N>"u")&&(N=O()),_=S[I]&&S[I][N]),typeof _>"u"||!_.length||!_[0]){var U="";K=[];for(L in S[I])this.terminals_[L]&&L>B&&K.push("'"+this.terminals_[L]+"'");w.showPosition?U="Parse error on line "+(A+1)+`:
|
|
2
2
|
`+w.showPosition()+`
|
|
3
3
|
Expecting `+K.join(", ")+", got '"+(this.terminals_[N]||N)+"'":U="Parse error on line "+(A+1)+": Unexpected "+(N==F?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(U,{text:w.match,token:this.terminals_[N]||N,line:w.yylineno,loc:G,expected:K})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+N);switch(_[0]){case 1:d.push(N),m.push(w.yytext),u.push(w.yylloc),d.push(_[1]),N=null,W=w.yyleng,b=w.yytext,A=w.yylineno,G=w.yylloc;break;case 2:if(H=this.productions_[_[1]][1],T.$=m[m.length-H],T._$={first_line:u[u.length-(H||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(H||1)].first_column,last_column:u[u.length-1].last_column},J&&(T._$.range=[u[u.length-(H||1)].range[0],u[u.length-1].range[1]]),$=this.performAction.apply(T,[b,W,A,C.yy,_[1],m,u].concat(M)),typeof $<"u")return $;H&&(d=d.slice(0,-1*H*2),m=m.slice(0,-1*H),u=u.slice(0,-1*H)),d.push(this.productions_[_[1]][0]),m.push(T.$),u.push(T._$),V=S[d[d.length-2]][d[d.length-1]],d.push(V);break;case 3:return!0}}return!0},"parse"),"parse")},x=(function(){var v={EOF:1,parseError:c(k(function(h,d){if(this.yy.parser)this.yy.parser.parseError(h,d);else throw new Error(h)},"parseError"),"parseError"),setInput:c(function(i,h){return this.yy=h||this.yy||{},this._input=i,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:c(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var h=i.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:c(function(i){var h=i.length,d=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;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),d.length-1&&(this.yylineno-=d.length-1);var m=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:d?(d.length===g.length?this.yylloc.first_column:0)+g[g.length-d.length].length-d[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(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:c(function(i){this.unput(this.match.slice(i))},"less"),pastInput:c(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var i=this.pastInput(),h=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as ue,g as he,o as fe,n as de,a as ge,b as xe,_,A as qt,G as ye,aI as pe,an as me,aJ as Gt,ao as be,ap as ve,d as Ie,p as Me,C as ke,D as Se}from"./render-O7CIS3YK-Ca_t2BjR.js";import{_ as I}from"./mermaid-layout-elk.core-BDxAYedV.js";import{s as xt}from"./transform-Bd_a5eGM.js";import"./main-s-bCU9xp.js";import"./index-DwG4tw4S.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";var Kt=1e-10;function it(t,n){const s=Wt(t),e=s.filter(l=>Ut(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=vt(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],S=Math.atan2(a.x-y.x,a.y-y.y),z=Math.atan2(h.x-y.x,h.y-y.y);let E=z-S;E<0&&(E+=2*Math.PI);const w=z-E/2;let g=U(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=at(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(U(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-Kt,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}I(it,"intersectionArea");function Ut(t,n){return n.every(s=>U(t,s)<s.radius+Kt)}I(Ut,"containedInCircles");function Wt(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=bt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}I(Wt,"getIntersectionPoints");function at(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}I(at,"circleArea");function U(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}I(U,"distance");function dt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return at(t,e)+at(n,i)}I(dt,"circleOverlap");function bt(t,n){const s=U(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}I(bt,"circleCircleIntersection");function vt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}I(vt,"getCenter");function Ht(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}I(Ht,"bisect");function lt(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}I(lt,"zeros");function yt(t,n){return lt(t).map(()=>lt(n))}I(yt,"zerosM");function et(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}I(et,"dot");function ct(t){return Math.sqrt(et(t,t))}I(ct,"norm2");function ut(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}I(ut,"scale");function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}I(Q,"weightedSum");function It(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function S(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}I(S,"updateSimplex");const z=I((v,c)=>v.fx-c.fx,"sortOrder"),E=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(z),s.history){const x=y.map(f=>{const P=f.slice();return P.fx=f.fx,P.id=f.id,P});x.sort((f,P)=>f.id-P.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){E[x]=0;for(let f=0;f<m;++f)E[x]+=y[f][x];E[x]/=m}const c=y[m];if(Q(w,1+h,E,-h,c),w.fx=t(w),w.fx<y[0].fx)Q(b,1+u,E,-u,c),b.fx=t(b),b.fx<w.fx?S(b):S(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(Q(g,1+a,E,-a,c),g.fx=t(g),g.fx<c.fx?S(g):x=!0):(Q(g,1-a*h,E,a*h,c),g.fx=t(g),g.fx<w.fx?S(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)Q(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else S(w)}return y.sort(z),{fx:y[0].fx,x:y[0]}}I(It,"nelderMead");function Yt(t,n,s,e,i,r,o){const l=s.fx,h=et(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,S,z){for(let E=0;E<16;++E)if(i=(y+S)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=et(e.fxprime,n),u>l+r*i*h||u>=z)S=i;else{if(Math.abs(p)<=-o*h)return i;p*(S-y)>=0&&(S=y),y=i,z=u}return 0}I(m,"zoom");for(let y=0;y<10;++y){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=et(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}I(Yt,"wolfeLineSearch");function Xt(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ut(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=Yt(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ut(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const p=et(e.fxprime,e.fxprime),d=Math.max(0,et(r,i.fxprime)/p);Q(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ct(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}I(Xt,"conjugateGradient");function Mt(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||te,e=n.lossFunction||nt,i=Jt(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=It(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}I(Mt,"venn");var Zt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Zt?Math.abs(t-n):Ht(e=>dt(t,n,e)-s,0,t+n)}I(ht,"distanceFromIntersectArea");function Jt(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(I(i,"toKey"),s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}I(Jt,"addMissingAreas");function Qt(t,n,s){const e=yt(n.length,n.length),i=yt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}I(Qt,"getDistanceMatrices");function $t(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),S=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*S*S,n[2*r]+=4*S*(o-u),n[2*r+1]+=4*S*(l-a),n[2*h]+=4*S*(u-o),n[2*h+1]+=4*S*(a-l))}}return i}I($t,"constrainedMDSGradient");function te(t,n={}){let s=ne(t,n);const e=n.lossFunction||nt;if(t.length>=8){const i=ee(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}I(te,"bestInitialLayout");function ee(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=Qt(t,e,i);const l=ct(r.map(ct))/r.length;r=r.map(d=>d.map(m=>m/l));const h=I((d,m)=>$t(d,m,r,o),"obj");let u=null;for(let d=0;d<s;++d){const m=lt(r.length*2).map(Math.random),y=Xt(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ut(d.x,l);return p}I(ee,"constrainedMDSLayout");function ne(t,n){const s=n&&n.lossFunction?n.lossFunction:nt,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Zt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}I(o,"sortOrder"),r.sort(o);const l={};function h(p){return p.set in l}I(h,"isPositioned");function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}I(u,"positionSet"),u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const S=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ht(y.radius,w.radius,m[a].size);S.push({x:w.x+g,y:w.y}),S.push({x:w.x-g,y:w.y}),S.push({y:w.y+g,x:w.x}),S.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ht(y.radius,v.radius,m[b].size),x=bt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});S.push(...x)}}let z=1e50,E=S[0];for(const w of S){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<z&&(z=g,E=w)}u(E,d)}return e}I(ne,"greedyLayout");function nt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=dt(o.radius,l.radius,U(o,l))}else i=it(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}I(nt,"lossFunction");function kt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=dt(l.radius,h.radius,U(l,h))}else i=it(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}I(kt,"logRatioLossFunction");function se(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&U(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}I(se,"orientateCircles");function ie(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}I(n,"find");function s(i,r){const o=n(i),l=n(r);o.parent=l}I(s,"union");for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;U(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}I(ie,"disjointCluster");function ft(t){const n=I(s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}},"minMax");return{xRange:n("x"),yRange:n("y")}}I(ft,"getBoundingBox");function St(t,n,s){n==null&&(n=Math.PI/2);let e=Tt(t).map(u=>Object.assign({},u));const i=ie(e);for(const u of i){se(u,n,s);const a=ft(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const S=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;S<0&&(m+=S)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const S=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;S<0&&(y+=S)}for(const S of u)S.x+=m,S.y+=y,e.push(S)}I(l,"addCluster");let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=ft(e);return _t(e)}I(St,"normalizeSolution");function wt(t,n,s,e,i){const r=Tt(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=ft(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return _t(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}I(wt,"scaleSolution");function _t(t){const n={};for(const s of t)n[s.setid]=s;return n}I(_t,"toObjectNotation");function Tt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}I(Tt,"fromObjectNotation");function re(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,S=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,z={},E=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=I(function(x){if(x in z)return z[x];var f=z[x]=E[w];return w+=1,w>=E.length&&(w=0),f},"colours"),b=Mt,v=nt;function c(x){let f=x.datum();const P=new Set;f.forEach(M=>{M.size==0&&M.sets.length==1&&P.add(M.sets[0])}),f=f.filter(M=>!M.sets.some(O=>P.has(O)));let k={},D={};if(f.length>0){let M=b(f,{lossFunction:v,distinct:m});l&&(M=St(M,o,d)),k=wt(M,s,e,i,h),D=zt(k,f,S)}const J={};f.forEach(M=>{M.label&&(J[M.sets]=M.label)});function K(M){if(M.sets in J)return J[M.sets];if(M.sets.length==1)return""+M.sets[0]}I(K,"label"),x.selectAll("svg").data([k]).enter().append("svg");const G=x.select("svg");n?G.attr("viewBox",`0 0 ${s} ${e}`):G.attr("width",s).attr("height",e);const q={};let A=!1;G.selectAll(".venn-area path").each(function(M){const O=this.getAttribute("d");M.sets.length==1&&O&&!m&&(A=!0,q[M.sets[0]]=le(O))});function V(M){return O=>{const W=M.sets.map($=>{let H=q[$],Z=k[$];return H||(H={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:H.x*(1-O)+Z.x*O,y:H.y*(1-O)+Z.y*O,radius:H.radius*(1-O)+Z.radius*O}});return pt(W,y)}}I(V,"pathTween");const C=G.selectAll(".venn-area").data(f,M=>M.sets),F=C.enter().append("g").attr("class",M=>`venn-area venn-${M.sets.length==1?"circle":"intersection"}${M.colour||M.color?" venn-coloured":""}`).attr("data-venn-sets",M=>M.sets.join("_")),B=F.append("path"),j=F.append("text").attr("class","label").text(M=>K(M)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(M=>M.sets.length==1).style("fill",M=>M.colour?M.colour:M.color?M.color:g(M.sets)).style("fill-opacity",".25"),j.style("fill",M=>M.colour||M.color?"#FFF":t.textFill?t.textFill:M.sets.length==1?g(M.sets):"#444"));function L(M){return typeof M.transition=="function"?M.transition("venn").duration(r):M}I(L,"asTransition");let T=x;A&&typeof T.transition=="function"?(T=L(x),T.selectAll("path").attrTween("d",V)):T.selectAll("path").attr("d",M=>pt(M.sets.map(O=>k[O])),y);const R=T.selectAll("text").filter(M=>M.sets in D).text(M=>K(M)).attr("x",M=>Math.floor(D[M.sets].x)).attr("y",M=>Math.floor(D[M.sets].y));u&&(A?"on"in R?R.on("end",rt(k,K)):R.each("end",rt(k,K)):R.each(rt(k,K)));const N=L(C.exit()).remove();typeof C.transition=="function"&&N.selectAll("path").attrTween("d",V);const X=N.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(j.style("font-size","0px"),R.style("font-size",p),X.style("font-size","0px")),{circles:k,textCentres:D,nodes:C,enter:F,update:T,exit:N}}return I(c,"chart"),c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?nt:x==="logRatio"?kt:x,c):v},c}I(re,"VennDiagram");function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}I(y,"append");let S=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");S.textContent=g,g.length>h&&S.getComputedTextLength()>i&&(a.pop(),S.textContent=a.join(" "),a=[u],S=y(u),p++)}const z=.35-p*d/2,E=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",E),g.setAttribute("y",w),g.setAttribute("dy",`${z+b*d}em`)})}}I(rt,"wrapText");function ot(t,n,s){let e=n[0].radius-U(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-U(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=U(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}I(ot,"circleMargin");function Et(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=ot(e[0],t,n);for(let a=1;a<e.length;++a){const p=ot(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=It(a=>-1*ot({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(U(l,a)>a.radius){h=!1;break}for(const a of n)if(U(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return it(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Et(t,[]):vt(u.arcs.map(a=>a.p1))}I(Et,"computeTextCentre");function oe(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=U(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}I(oe,"getOverlappingCircles");function zt(t,n,s){const e={},i=oe(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=Et(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}I(zt,"computeTextCentres");function ae(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{s as ue,g as he,o as fe,n as de,a as ge,b as xe,_,A as qt,G as ye,aI as pe,an as me,aJ as Gt,ao as be,ap as ve,d as Ie,p as Me,C as ke,D as Se}from"./render-O7CIS3YK-BUZqrLRp.js";import{_ as I}from"./mermaid-layout-elk.core-B1-o2tyd.js";import{s as xt}from"./transform-Bd_a5eGM.js";import"./main-jV_OilRs.js";import"./index-C9fscARj.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";var Kt=1e-10;function it(t,n){const s=Wt(t),e=s.filter(l=>Ut(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=vt(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],S=Math.atan2(a.x-y.x,a.y-y.y),z=Math.atan2(h.x-y.x,h.y-y.y);let E=z-S;E<0&&(E+=2*Math.PI);const w=z-E/2;let g=U(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=at(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(U(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-Kt,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}I(it,"intersectionArea");function Ut(t,n){return n.every(s=>U(t,s)<s.radius+Kt)}I(Ut,"containedInCircles");function Wt(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=bt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}I(Wt,"getIntersectionPoints");function at(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}I(at,"circleArea");function U(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}I(U,"distance");function dt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return at(t,e)+at(n,i)}I(dt,"circleOverlap");function bt(t,n){const s=U(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}I(bt,"circleCircleIntersection");function vt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}I(vt,"getCenter");function Ht(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}I(Ht,"bisect");function lt(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}I(lt,"zeros");function yt(t,n){return lt(t).map(()=>lt(n))}I(yt,"zerosM");function et(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}I(et,"dot");function ct(t){return Math.sqrt(et(t,t))}I(ct,"norm2");function ut(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}I(ut,"scale");function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}I(Q,"weightedSum");function It(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function S(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}I(S,"updateSimplex");const z=I((v,c)=>v.fx-c.fx,"sortOrder"),E=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(z),s.history){const x=y.map(f=>{const P=f.slice();return P.fx=f.fx,P.id=f.id,P});x.sort((f,P)=>f.id-P.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){E[x]=0;for(let f=0;f<m;++f)E[x]+=y[f][x];E[x]/=m}const c=y[m];if(Q(w,1+h,E,-h,c),w.fx=t(w),w.fx<y[0].fx)Q(b,1+u,E,-u,c),b.fx=t(b),b.fx<w.fx?S(b):S(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(Q(g,1+a,E,-a,c),g.fx=t(g),g.fx<c.fx?S(g):x=!0):(Q(g,1-a*h,E,a*h,c),g.fx=t(g),g.fx<w.fx?S(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)Q(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else S(w)}return y.sort(z),{fx:y[0].fx,x:y[0]}}I(It,"nelderMead");function Yt(t,n,s,e,i,r,o){const l=s.fx,h=et(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,S,z){for(let E=0;E<16;++E)if(i=(y+S)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=et(e.fxprime,n),u>l+r*i*h||u>=z)S=i;else{if(Math.abs(p)<=-o*h)return i;p*(S-y)>=0&&(S=y),y=i,z=u}return 0}I(m,"zoom");for(let y=0;y<10;++y){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=et(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}I(Yt,"wolfeLineSearch");function Xt(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ut(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=Yt(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ut(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const p=et(e.fxprime,e.fxprime),d=Math.max(0,et(r,i.fxprime)/p);Q(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ct(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}I(Xt,"conjugateGradient");function Mt(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||te,e=n.lossFunction||nt,i=Jt(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=It(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}I(Mt,"venn");var Zt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Zt?Math.abs(t-n):Ht(e=>dt(t,n,e)-s,0,t+n)}I(ht,"distanceFromIntersectArea");function Jt(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(I(i,"toKey"),s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}I(Jt,"addMissingAreas");function Qt(t,n,s){const e=yt(n.length,n.length),i=yt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}I(Qt,"getDistanceMatrices");function $t(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),S=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*S*S,n[2*r]+=4*S*(o-u),n[2*r+1]+=4*S*(l-a),n[2*h]+=4*S*(u-o),n[2*h+1]+=4*S*(a-l))}}return i}I($t,"constrainedMDSGradient");function te(t,n={}){let s=ne(t,n);const e=n.lossFunction||nt;if(t.length>=8){const i=ee(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}I(te,"bestInitialLayout");function ee(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=Qt(t,e,i);const l=ct(r.map(ct))/r.length;r=r.map(d=>d.map(m=>m/l));const h=I((d,m)=>$t(d,m,r,o),"obj");let u=null;for(let d=0;d<s;++d){const m=lt(r.length*2).map(Math.random),y=Xt(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ut(d.x,l);return p}I(ee,"constrainedMDSLayout");function ne(t,n){const s=n&&n.lossFunction?n.lossFunction:nt,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Zt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}I(o,"sortOrder"),r.sort(o);const l={};function h(p){return p.set in l}I(h,"isPositioned");function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}I(u,"positionSet"),u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const S=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ht(y.radius,w.radius,m[a].size);S.push({x:w.x+g,y:w.y}),S.push({x:w.x-g,y:w.y}),S.push({y:w.y+g,x:w.x}),S.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ht(y.radius,v.radius,m[b].size),x=bt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});S.push(...x)}}let z=1e50,E=S[0];for(const w of S){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<z&&(z=g,E=w)}u(E,d)}return e}I(ne,"greedyLayout");function nt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=dt(o.radius,l.radius,U(o,l))}else i=it(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}I(nt,"lossFunction");function kt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=dt(l.radius,h.radius,U(l,h))}else i=it(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}I(kt,"logRatioLossFunction");function se(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&U(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}I(se,"orientateCircles");function ie(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}I(n,"find");function s(i,r){const o=n(i),l=n(r);o.parent=l}I(s,"union");for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;U(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}I(ie,"disjointCluster");function ft(t){const n=I(s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}},"minMax");return{xRange:n("x"),yRange:n("y")}}I(ft,"getBoundingBox");function St(t,n,s){n==null&&(n=Math.PI/2);let e=Tt(t).map(u=>Object.assign({},u));const i=ie(e);for(const u of i){se(u,n,s);const a=ft(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const S=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;S<0&&(m+=S)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const S=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;S<0&&(y+=S)}for(const S of u)S.x+=m,S.y+=y,e.push(S)}I(l,"addCluster");let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=ft(e);return _t(e)}I(St,"normalizeSolution");function wt(t,n,s,e,i){const r=Tt(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=ft(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return _t(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}I(wt,"scaleSolution");function _t(t){const n={};for(const s of t)n[s.setid]=s;return n}I(_t,"toObjectNotation");function Tt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}I(Tt,"fromObjectNotation");function re(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,S=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,z={},E=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=I(function(x){if(x in z)return z[x];var f=z[x]=E[w];return w+=1,w>=E.length&&(w=0),f},"colours"),b=Mt,v=nt;function c(x){let f=x.datum();const P=new Set;f.forEach(M=>{M.size==0&&M.sets.length==1&&P.add(M.sets[0])}),f=f.filter(M=>!M.sets.some(O=>P.has(O)));let k={},D={};if(f.length>0){let M=b(f,{lossFunction:v,distinct:m});l&&(M=St(M,o,d)),k=wt(M,s,e,i,h),D=zt(k,f,S)}const J={};f.forEach(M=>{M.label&&(J[M.sets]=M.label)});function K(M){if(M.sets in J)return J[M.sets];if(M.sets.length==1)return""+M.sets[0]}I(K,"label"),x.selectAll("svg").data([k]).enter().append("svg");const G=x.select("svg");n?G.attr("viewBox",`0 0 ${s} ${e}`):G.attr("width",s).attr("height",e);const q={};let A=!1;G.selectAll(".venn-area path").each(function(M){const O=this.getAttribute("d");M.sets.length==1&&O&&!m&&(A=!0,q[M.sets[0]]=le(O))});function V(M){return O=>{const W=M.sets.map($=>{let H=q[$],Z=k[$];return H||(H={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:H.x*(1-O)+Z.x*O,y:H.y*(1-O)+Z.y*O,radius:H.radius*(1-O)+Z.radius*O}});return pt(W,y)}}I(V,"pathTween");const C=G.selectAll(".venn-area").data(f,M=>M.sets),F=C.enter().append("g").attr("class",M=>`venn-area venn-${M.sets.length==1?"circle":"intersection"}${M.colour||M.color?" venn-coloured":""}`).attr("data-venn-sets",M=>M.sets.join("_")),B=F.append("path"),j=F.append("text").attr("class","label").text(M=>K(M)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(M=>M.sets.length==1).style("fill",M=>M.colour?M.colour:M.color?M.color:g(M.sets)).style("fill-opacity",".25"),j.style("fill",M=>M.colour||M.color?"#FFF":t.textFill?t.textFill:M.sets.length==1?g(M.sets):"#444"));function L(M){return typeof M.transition=="function"?M.transition("venn").duration(r):M}I(L,"asTransition");let T=x;A&&typeof T.transition=="function"?(T=L(x),T.selectAll("path").attrTween("d",V)):T.selectAll("path").attr("d",M=>pt(M.sets.map(O=>k[O])),y);const R=T.selectAll("text").filter(M=>M.sets in D).text(M=>K(M)).attr("x",M=>Math.floor(D[M.sets].x)).attr("y",M=>Math.floor(D[M.sets].y));u&&(A?"on"in R?R.on("end",rt(k,K)):R.each("end",rt(k,K)):R.each(rt(k,K)));const N=L(C.exit()).remove();typeof C.transition=="function"&&N.selectAll("path").attrTween("d",V);const X=N.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(j.style("font-size","0px"),R.style("font-size",p),X.style("font-size","0px")),{circles:k,textCentres:D,nodes:C,enter:F,update:T,exit:N}}return I(c,"chart"),c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?nt:x==="logRatio"?kt:x,c):v},c}I(re,"VennDiagram");function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}I(y,"append");let S=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");S.textContent=g,g.length>h&&S.getComputedTextLength()>i&&(a.pop(),S.textContent=a.join(" "),a=[u],S=y(u),p++)}const z=.35-p*d/2,E=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",E),g.setAttribute("y",w),g.setAttribute("dy",`${z+b*d}em`)})}}I(rt,"wrapText");function ot(t,n,s){let e=n[0].radius-U(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-U(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=U(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}I(ot,"circleMargin");function Et(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=ot(e[0],t,n);for(let a=1;a<e.length;++a){const p=ot(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=It(a=>-1*ot({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(U(l,a)>a.radius){h=!1;break}for(const a of n)if(U(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return it(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Et(t,[]):vt(u.arcs.map(a=>a.p1))}I(Et,"computeTextCentre");function oe(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=U(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}I(oe,"getOverlappingCircles");function zt(t,n,s){const e={},i=oe(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=Et(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}I(zt,"computeTextCentres");function ae(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aO as Gt,s as Kt,g as Ht,p as Xt,o as Yt,a as Zt,b as Jt,_ as S,z as St,F as Qt,a6 as $t,V as te,W as ee,X as ne,d as se,q as ie,B as re,D as oe}from"./mermaid.core-DP9HBKfF.js";import{s as rt}from"./transform-Bd_a5eGM.js";import"./main-s-bCU9xp.js";import"./index-DwG4tw4S.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],M=Math.atan2(a.x-y.x,a.y-y.y),E=Math.atan2(h.x-y.x,h.y-y.y);let T=E-M;T<0&&(T+=2*Math.PI);const w=E-T/2;let g=K(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt(tt(t,t))}function ht(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}const E=(v,c)=>v.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(E),s.history){const x=y.map(f=>{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});x.sort((f,N)=>f.id-N.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){T[x]=0;for(let f=0;f<m;++f)T[x]+=y[f][x];T[x]/=m}const c=y[m];if(Q(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)Q(b,1+u,T,-u,c),b.fx=t(b),b.fx<w.fx?M(b):M(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(Q(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Q(g,1-a*h,T,a*h,c),g.fx=t(g),g.fx<w.fx?M(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)Q(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else M(w)}return y.sort(E),{fx:y[0].fx,x:y[0]}}function ue(t,n,s,e,i,r,o){const l=s.fx,h=tt(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,M,E){for(let T=0;T<16;++T)if(i=(y+M)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=ue(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ht(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);Q(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||et,i=fe(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=zt(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}const Rt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),M=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=de(t,e,i);const l=ut(r.map(ut))/r.length;r=r.map(d=>d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;d<s;++d){const m=ct(r.length*2).map(Math.random),y=he(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ht(d.x,l);return p}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}r.sort(o);const l={};function h(p){return p.set in l}function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ft(y.radius,w.radius,m[a].size);M.push({x:w.x+g,y:w.y}),M.push({x:w.x-g,y:w.y}),M.push({y:w.y+g,x:w.x}),M.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ft(y.radius,v.radius,m[b].size),x=Tt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,T=M[0];for(const w of M){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<E&&(E=g,T=w)}u(T,d)}return e}function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=xt(o.radius,l.radius,K(o,l))}else i=st(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;K(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const r=Ft(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=dt(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return Nt(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const N=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&N.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(C=>N.has(C)));let k={},R={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Ct(I,o,d)),k=Ot(I,s,e,i,h),R=Lt(k,f,M)}const Z={};f.forEach(I=>{I.label&&(Z[I.sets]=I.label)});function U(I){if(I.sets in Z)return Z[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!m&&(z=!0,V[I.sets[0]]=Me(C))});function q(I){return C=>{const W=I.sets.map(J=>{let G=V[J],Y=k[J];return G||(G={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:G.x*(1-C)+Y.x*C,y:G.y*(1-C)+Y.y*C,radius:G.radius*(1-C)+Y.radius*C}});return wt(W,y)}}const A=B.selectAll(".venn-area").data(f,I=>I.sets),F=A.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),j=F.append("path"),L=F.append("text").attr("class","label").text(I=>U(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function P(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",I=>wt(I.sets.map(C=>k[C])),y);const D=_.selectAll("text").filter(I=>I.sets in R).text(I=>U(I)).attr("x",I=>Math.floor(R[I.sets].x)).attr("y",I=>Math.floor(R[I.sets].y));u&&(z?"on"in D?D.on("end",ot(k,U)):D.each("end",ot(k,U)):D.each(ot(k,U)));const O=P(A.exit()).remove();typeof A.transition=="function"&&O.selectAll("path").attrTween("d",q);const X=O.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),D.style("font-size",p),X.style("font-size","0px")),{circles:k,textCentres:R,nodes:A,enter:F,update:_,exit:O}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Dt:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-K(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=K(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=at(e[0],t,n);for(let a=1;a<e.length;++a){const p=at(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=K(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=jt(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{aO as Gt,s as Kt,g as Ht,p as Xt,o as Yt,a as Zt,b as Jt,_ as S,z as St,F as Qt,a6 as $t,V as te,W as ee,X as ne,d as se,q as ie,B as re,D as oe}from"./mermaid.core-37_hzSNp.js";import{s as rt}from"./transform-Bd_a5eGM.js";import"./main-jV_OilRs.js";import"./index-C9fscARj.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],M=Math.atan2(a.x-y.x,a.y-y.y),E=Math.atan2(h.x-y.x,h.y-y.y);let T=E-M;T<0&&(T+=2*Math.PI);const w=E-T/2;let g=K(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt(tt(t,t))}function ht(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Q(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}const E=(v,c)=>v.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(E),s.history){const x=y.map(f=>{const N=f.slice();return N.fx=f.fx,N.id=f.id,N});x.sort((f,N)=>f.id-N.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){T[x]=0;for(let f=0;f<m;++f)T[x]+=y[f][x];T[x]/=m}const c=y[m];if(Q(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)Q(b,1+u,T,-u,c),b.fx=t(b),b.fx<w.fx?M(b):M(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(Q(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Q(g,1-a*h,T,a*h,c),g.fx=t(g),g.fx<w.fx?M(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)Q(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else M(w)}return y.sort(E),{fx:y[0].fx,x:y[0]}}function ue(t,n,s,e,i,r,o){const l=s.fx,h=tt(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,M,E){for(let T=0;T<16;++T)if(i=(y+M)/2,Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(Q(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=ue(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ht(o,e.fxprime,-1);else{Q(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);Q(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||et,i=fe(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=zt(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}const Rt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),M=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=de(t,e,i);const l=ut(r.map(ut))/r.length;r=r.map(d=>d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;d<s;++d){const m=ct(r.length*2).map(Math.random),y=he(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ht(d.x,l);return p}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}r.sort(o);const l={};function h(p){return p.set in l}function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ft(y.radius,w.radius,m[a].size);M.push({x:w.x+g,y:w.y}),M.push({x:w.x-g,y:w.y}),M.push({y:w.y+g,x:w.x}),M.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ft(y.radius,v.radius,m[b].size),x=Tt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,T=M[0];for(const w of M){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<E&&(E=g,T=w)}u(T,d)}return e}function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=xt(o.radius,l.radius,K(o,l))}else i=st(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;K(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const r=Ft(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=dt(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return Nt(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const N=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&N.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(C=>N.has(C)));let k={},R={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Ct(I,o,d)),k=Ot(I,s,e,i,h),R=Lt(k,f,M)}const Z={};f.forEach(I=>{I.label&&(Z[I.sets]=I.label)});function U(I){if(I.sets in Z)return Z[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!m&&(z=!0,V[I.sets[0]]=Me(C))});function q(I){return C=>{const W=I.sets.map(J=>{let G=V[J],Y=k[J];return G||(G={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:G.x*(1-C)+Y.x*C,y:G.y*(1-C)+Y.y*C,radius:G.radius*(1-C)+Y.radius*C}});return wt(W,y)}}const A=B.selectAll(".venn-area").data(f,I=>I.sets),F=A.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),j=F.append("path"),L=F.append("text").attr("class","label").text(I=>U(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function P(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",I=>wt(I.sets.map(C=>k[C])),y);const D=_.selectAll("text").filter(I=>I.sets in R).text(I=>U(I)).attr("x",I=>Math.floor(R[I.sets].x)).attr("y",I=>Math.floor(R[I.sets].y));u&&(z?"on"in D?D.on("end",ot(k,U)):D.each("end",ot(k,U)):D.each(ot(k,U)));const O=P(A.exit()).remove();typeof A.transition=="function"&&O.selectAll("path").attrTween("d",q);const X=O.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),D.style("font-size",p),X.style("font-size","0px")),{circles:k,textCentres:R,nodes:A,enter:F,update:_,exit:O}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Dt:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-K(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=K(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=at(e[0],t,n);for(let a=1;a<e.length;++a){const p=at(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=K(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=jt(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as zt}from"./chunk-VII2H2IX-
|
|
1
|
+
import{p as zt}from"./chunk-VII2H2IX-fTD7U-xL.js";import{p as Lt}from"./cynefin-OW5HDTMX-GVF3BKWE-wLMpc-W6.js";import{s as Tt,g as Xt,o as Et,n as Yt,a as It,b as Bt,_ as y,I as Ft,A as Rt,C as yt,l as wt,G as Ot,d as Wt,p as Dt,c as V}from"./render-O7CIS3YK-BUZqrLRp.js";import{_ as b}from"./mermaid-layout-elk.core-B1-o2tyd.js";import"./main-jV_OilRs.js";import"./index-C9fscARj.js";import"./transform-Bd_a5eGM.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";var q=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),Y=y((a,o,e)=>({x:q(o,`${e} evolution`),y:q(a,`${e} visibility`)}),"toCoordinates"),mt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Gt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),qt=y((a,o)=>{if(zt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=Y(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var P;const p=Y(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(P=e.decorator)==null?void 0:P.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=Y(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,P=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,L=q(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,L,r,"pipeline-component",P,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=mt(e.fromPort)??mt(e.toPort);const{flow:d,label:m}=Gt(e.arrow);!r&&d&&(r=d);const P=e.linkLabel,g=m??P;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=q(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=Y(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=Y(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=Y(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=Y(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),kt={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Lt("wardley",a);wt.debug(o);const e=(p=kt.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");qt(o,e)},"parse")},I,Ht=(I=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},b(I,"WardleyBuilder"),y(I,"WardleyBuilder"),I),$=new Ht;function Z(){return V()["wardley-beta"]}b(Z,"getConfig3");y(Z,"getConfig");function U(a,o,e,p,r,d,m,P,g){$.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:P,sourceStrategy:g})}b(U,"addNode");y(U,"addNode");function J(a,o,e=!1,p,r){$.addLink({source:a,target:o,dashed:e,label:p,flow:r})}b(J,"addLink");y(J,"addLink");function K(a,o,e){$.addTrend({nodeId:a,targetX:o,targetY:e})}b(K,"addTrend");y(K,"addTrend");function Q(a,o,e){$.addAnnotation({number:a,coordinates:o,text:e})}b(Q,"addAnnotation");y(Q,"addAnnotation");function tt(a,o,e){$.addNote({text:a,x:o,y:e})}b(tt,"addNote");y(tt,"addNote");function et(a,o,e){$.addAccelerator({name:a,x:o,y:e})}b(et,"addAccelerator");y(et,"addAccelerator");function at(a,o,e){$.addDeaccelerator({name:a,x:o,y:e})}b(at,"addDeaccelerator");y(at,"addDeaccelerator");function rt(a,o){$.setAnnotationsBox(a,o)}b(rt,"setAnnotationsBox");y(rt,"setAnnotationsBox");function ot(a,o){$.setSize(a,o)}b(ot,"setSize");y(ot,"setSize");function st(a){$.startPipeline(a)}b(st,"startPipeline");y(st,"startPipeline");function nt(a,o){$.addPipelineComponent(a,o)}b(nt,"addPipelineComponent");y(nt,"addPipelineComponent");function it(a){$.setAxes(a)}b(it,"updateAxes");y(it,"updateAxes");function dt(a){return $.getNode(a)}b(dt,"getNode");y(dt,"getNode");function lt(a){return $.resolveNodeId(a)}b(lt,"resolveNodeId");y(lt,"resolveNodeId");function ct(){return $.build()}b(ct,"getWardleyData");y(ct,"getWardleyData");function pt(){$.clear(),Dt()}b(pt,"clear2");y(pt,"clear");var _t={getConfig:Z,addNode:U,addLink:J,addTrend:K,addAnnotation:Q,addNote:tt,addAccelerator:et,addDeaccelerator:at,setAnnotationsBox:rt,setSize:ot,startPipeline:st,addPipelineComponent:nt,updateAxes:it,getNode:dt,resolveNodeId:lt,getWardleyData:ct,clear:pt,setAccTitle:Bt,getAccTitle:It,setDiagramTitle:Yt,getDiagramTitle:Et,getAccDescription:Xt,setAccDescription:Tt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,P,g,L,N,k,C;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((P=a.wardley)==null?void 0:P.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((L=a.wardley)==null?void 0:L.evolutionStroke)??"#dc3545",annotationStroke:((N=a.wardley)==null?void 0:N.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((C=a.wardley)==null?void 0:C.annotationFill)??a.background??"#fff"}},"getTheme"),Zt=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Ut=y((a,o,e,p)=>{var gt,ut;wt.debug(`Rendering Wardley map
|
|
2
2
|
`+a);const r=Zt(),d=Vt(),m=r.nodeRadius*1.6,P=p.db,g=P.getWardleyData(),L=P.getDiagramTitle(),N=((gt=g.size)==null?void 0:gt.width)??r.width,k=((ut=g.size)==null?void 0:ut.height)??r.height,C=Ot(o);C.selectAll("*").remove(),Wt(C,k,N,r.useMaxWidth),C.attr("viewBox",`0 0 ${N} ${k}`);const S=C.append("g").attr("class","wardley-map"),H=C.append("defs");H.append("marker").attr("id",`arrow-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-end-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-start-${o}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),S.append("rect").attr("class","wardley-background").attr("width",N).attr("height",k).attr("fill",d.backgroundColor);const F=N-r.padding*2,R=k-r.padding*2;L&&S.append("text").attr("class","wardley-title").attr("x",N/2).attr("y",r.padding/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(L);const T=y(t=>r.padding+t/100*F,"projectX"),X=y(t=>k-r.padding-t/100*R,"projectY"),W=S.append("g").attr("class","wardley-axes");W.append("line").attr("x1",r.padding).attr("x2",N-r.padding).attr("y1",k-r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1),W.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const bt=g.axes.xLabel??"Evolution",$t=g.axes.yLabel??"Visibility";W.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+F/2).attr("y",k-r.padding/4).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(bt),W.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+R/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+R/2})`).text($t);const O=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:jt;if(O.length>0){const t=S.append("g").attr("class","wardley-stages"),n=g.axes.stageBoundaries,s=[];if(n&&n.length===O.length){let i=0;n.forEach(x=>{s.push({start:i,end:x}),i=x})}else{const i=1/O.length;O.forEach((x,l)=>{s.push({start:l*i,end:(l+1)*i})})}O.forEach((i,x)=>{const l=s[x],h=r.padding+l.start*F,f=r.padding+l.end*F,u=(h+f)/2;x>0&&t.append("line").attr("x1",h).attr("x2",h).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",k-r.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(r.showGrid){const t=S.append("g").attr("class","wardley-grid");for(let n=1;n<4;n++){const s=n/4,i=r.padding+F*s;t.append("line").attr("x1",i).attr("x2",i).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",N-r.padding).attr("y1",k-r.padding-R*s).attr("y2",k-r.padding-R*s).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:T(t.x),y:X(t.y),node:t})}),g.pipelines.length>0){const t=S.append("g").attr("class","wardley-pipelines"),n=S.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(s=>{if(s.componentIds.length===0)return;const i=s.componentIds.map(f=>({id:f,pos:c.get(f),node:g.nodes.find(u=>u.id===f)})).filter(f=>f.pos&&f.node).sort((f,u)=>f.node.x-u.node.x);for(let f=0;f<i.length-1;f++){const u=i[f],w=i[f+1];n.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",u.pos.x).attr("y1",u.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let x=1/0,l=-1/0,h=0;if(s.componentIds.forEach(f=>{const u=c.get(f);u&&(x=Math.min(x,u.x),l=Math.max(l,u.x),h=u.y)}),x!==1/0&&l!==-1/0){const u=r.nodeRadius*4,w=h-u/2,M=c.get(s.nodeId);if(M){const z=(x+l)/2;M.x=z,M.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",x-15).attr("y",w).attr("width",l-x+30).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const xt=S.append("g").attr("class","wardley-links"),ht=new Map;g.pipelines.forEach(t=>{ht.set(t.nodeId,new Set(t.componentIds))});const ft=g.links.filter(t=>{if(!c.has(t.source)||!c.has(t.target))return!1;const n=ht.get(t.target);return!(n!=null&&n.has(t.source))});xt.selectAll("line").data(ft).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const n=c.get(t.source),s=c.get(t.target),x=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,h=s.y-n.y,f=Math.sqrt(l*l+h*h);return n.x+l/f*x}).attr("y1",t=>{const n=c.get(t.source),s=c.get(t.target),x=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,h=s.y-n.y,f=Math.sqrt(l*l+h*h);return n.y+h/f*x}).attr("x2",t=>{const n=c.get(t.source),s=c.get(t.target),x=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,h=n.y-s.y,f=Math.sqrt(l*l+h*h);return s.x+l/f*x}).attr("y2",t=>{const n=c.get(t.source),s=c.get(t.target),x=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,h=n.y-s.y,f=Math.sqrt(l*l+h*h);return s.y+h/f*x}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${o})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${o})`:null),xt.selectAll("text").data(ft.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,x=s.y-n.y,l=s.x-n.x,h=Math.sqrt(l*l+x*x),f=8,u=x/h;return i+u*f}).attr("y",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.y+s.y)/2,x=s.x-n.x,l=s.y-n.y,h=Math.sqrt(x*x+l*l),f=8,u=-x/h;return i+u*f}).attr("fill",d.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,x=(n.y+s.y)/2,l=s.x-n.x,h=s.y-n.y,f=Math.sqrt(l*l+h*h),u=8,w=h/f,M=-l/f,z=i+w*u,D=x+M*u;let B=Math.atan2(h,l)*180/Math.PI;return(B>90||B<-90)&&(B+=180),`rotate(${B} ${z} ${D})`}).text(t=>t.label);const vt=S.append("g").attr("class","wardley-trends"),Pt=g.trends.map(t=>{const n=c.get(t.nodeId);if(!n)return null;const s=T(t.targetX),i=X(t.targetY),x=s-n.x,l=i-n.y,h=Math.sqrt(x*x+l*l),f=r.nodeRadius+2,u=h>f?s-x/h*f:s,w=h>f?i-l/h*f:i;return{origin:n,targetX:s,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);vt.selectAll("line").data(Pt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${o})`);const A=S.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));A.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),A.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),A.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const E=A.filter(t=>t.sourceStrategy==="market");E.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),A.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const _=r.nodeRadius*.7,v=r.nodeRadius*1.2;if(E.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-v).attr("x2",t=>c.get(t.id).x-v*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),E.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-v*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+v*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),E.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+v*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-v).attr("stroke",d.componentStroke).attr("stroke-width",1),E.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-v).attr("r",_).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),E.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-v*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("r",_).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),E.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+v*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+v*Math.sin(Math.PI/6)).attr("r",_).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),A.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y1",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y-s/2}).attr("x2",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y2",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y+s/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),A.append("text").attr("x",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?n.x+t.labelOffsetX:n.x;let s=r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(s+=10);const i=t.labelOffsetX??s;return n.x+i}).attr("y",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?n.y+t.labelOffsetY:n.y-3;let s=-r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(s-=10);const i=t.labelOffsetY??s;return n.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",r.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=S.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(n=>{const s=n.coordinates.map(i=>({x:T(i.x),y:X(i.y)}));if(s.length>1)for(let i=0;i<s.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[i].x).attr("y1",s[i].y).attr("x2",s[i+1].x).attr("y2",s[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach(i=>{const x=t.append("g").attr("class","wardley-annotation");x.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),x.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.number)})}),g.annotationsBox){let n=T(g.annotationsBox.x),s=X(g.annotationsBox.y);const i=10,x=16,l=11,h=t.append("g").attr("class","wardley-annotations-box"),f=[...g.annotations].filter(w=>w.text).sort((w,M)=>w.number-M.number),u=[];if(f.forEach((w,M)=>{const z=h.append("text").attr("x",n+i).attr("y",s+i+(M+1)*x).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(z)}),u.length>0){let w=0,M=0;u.forEach(j=>{const G=j.node(),Ct=G.getComputedTextLength();w=Math.max(w,Ct);const At=G.getBBox();M=Math.max(M,At.height)});const z=w+i*2+105,D=f.length*x+i*2+M/2,B=r.padding,St=N-r.padding-z,Mt=r.padding,Nt=k-r.padding-D;n=Math.max(B,Math.min(n,St)),s=Math.max(Mt,Math.min(s,Nt)),u.forEach((j,G)=>{j.attr("x",n+i).attr("y",s+i+(G+1)*x)}),h.insert("rect","text").attr("x",n).attr("y",s).attr("width",z).attr("height",D).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=S.append("g").attr("class","wardley-notes");g.notes.forEach(n=>{const s=T(n.x),i=X(n.y);t.append("text").attr("x",s).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.text)})}if(g.accelerators.length>0){const t=S.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(n=>{const s=T(n.x),i=X(n.y),x=60,l=30,h=20,f=`
|
|
3
3
|
M ${s} ${i-l/2}
|
|
4
4
|
L ${s+x-h} ${i-l/2}
|
package/web/assets/{wardleyDiagram-VM6X3IG4-BaWPp6GW.js → wardleyDiagram-VM6X3IG4-DvRT9ehw.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as zt}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as zt}from"./chunk-JWPE2WC7-DSVI_4gB.js";import{s as Lt,g as Tt,p as At,o as Xt,a as Et,b as Yt,_ as y,H as It,z as Bt,B as Q,l as et,F as Ft,d as Rt,q as Ot,c as V}from"./mermaid.core-37_hzSNp.js";import{p as Wt}from"./cynefin-OW5HDTMX-Ycd8yaFB.js";import"./main-jV_OilRs.js";import"./index-C9fscARj.js";import"./transform-Bd_a5eGM.js";var G=y((a,o)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),E=y((a,o,e)=>({x:G(o,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),tt=y(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Dt=y(a=>{if(!(a!=null&&a.startsWith("+")))return{};const o=/^\+'([^']*)'/.exec(a),e=o==null?void 0:o[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Gt=y((a,o)=>{if(zt(a,o),a.size&&o.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(r=>r.secondName?`${r.name.trim()} / ${r.secondName.trim()}`:r.name.trim()),p=a.evolution.stages.filter(r=>r.boundary!==void 0).map(r=>r.boundary);o.updateAxes({stages:e,stageBoundaries:p})}if(a.anchors.forEach(e=>{const p=E(e.visibility,e.evolution,`Anchor "${e.name}"`);o.addNode(e.name,e.name,p.x,p.y,"anchor")}),a.components.forEach(e=>{var v;const p=E(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=(v=e.decorator)==null?void 0:v.strategy;o.addNode(e.name,e.name,p.x,p.y,"component",r,d,e.inertia,m)}),a.notes.forEach(e=>{const p=E(e.visibility,e.evolution,`Note "${e.text}"`);o.addNote(e.text,p.x,p.y)}),a.pipelines.forEach(e=>{const p=o.getNode(e.parent);if(!p||typeof p.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const r=p.y;o.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,v=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,L=G(d.evolution,`Pipeline component "${d.name}" evolution`);o.addNode(m,d.name,L,r,"pipeline-component",v,g),o.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const p=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let r=tt(e.fromPort)??tt(e.toPort);const{flow:d,label:m}=Dt(e.arrow);!r&&d&&(r=d);const v=e.linkLabel,g=m??v;o.addLink(o.resolveNodeId(e.from),o.resolveNodeId(e.to),p,g,r)}),a.evolves.forEach(e=>{const p=o.getNode(e.component);if((p==null?void 0:p.y)!==void 0){const r=G(e.target,`Evolve target for "${e.component}"`);o.addTrend(e.component,r,p.y)}}),a.annotations.length>0){const e=a.annotations[0],p=E(e.x,e.y,"Annotations box");o.setAnnotationsBox(p.x,p.y)}a.annotation.forEach(e=>{const p=E(e.x,e.y,`Annotation ${e.number}`);o.addAnnotation(e.number,[{x:p.x,y:p.y}],e.text)}),a.accelerators.forEach(e=>{const p=E(e.x,e.y,`Accelerator "${e.name}"`);o.addAccelerator(e.name,p.x,p.y)}),a.deaccelerators.forEach(e=>{const p=E(e.x,e.y,`Deaccelerator "${e.name}"`);o.addDeaccelerator(e.name,p.x,p.y)})},"populateDb"),at={parser:{yy:void 0},parse:y(async a=>{var p;const o=await Wt("wardley",a);et.debug(o);const e=(p=at.parser)==null?void 0:p.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Gt(o,e)},"parse")},I,qt=(I=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(o){const e=this.nodes.get(o.id)??{id:o.id,label:o.label},p={...e,...o,className:o.className??e.className,labelOffsetX:o.labelOffsetX??e.labelOffsetX,labelOffsetY:o.labelOffsetY??e.labelOffsetY};this.nodes.set(o.id,p)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});const e=this.nodes.get(o);e&&(e.isPipelineParent=!0)}addPipelineComponent(o,e){const p=this.pipelines.get(o);p&&p.componentIds.push(e);const r=this.nodes.get(e);r&&(r.inPipeline=!0)}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,e){this.annotationsBox={x:o,y:e}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,e){this.size={width:o,height:e}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(const[e,p]of this.nodes)if(p.label===o)return e;return o}build(){const o=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);o.push(e)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},y(I,"WardleyBuilder"),I),b=new qt;function rt(){return V()["wardley-beta"]}y(rt,"getConfig");function ot(a,o,e,p,r,d,m,v,g){b.addNode({id:a,label:o,x:e,y:p,className:r,labelOffsetX:d,labelOffsetY:m,inertia:v,sourceStrategy:g})}y(ot,"addNode");function st(a,o,e=!1,p,r){b.addLink({source:a,target:o,dashed:e,label:p,flow:r})}y(st,"addLink");function nt(a,o,e){b.addTrend({nodeId:a,targetX:o,targetY:e})}y(nt,"addTrend");function it(a,o,e){b.addAnnotation({number:a,coordinates:o,text:e})}y(it,"addAnnotation");function dt(a,o,e){b.addNote({text:a,x:o,y:e})}y(dt,"addNote");function lt(a,o,e){b.addAccelerator({name:a,x:o,y:e})}y(lt,"addAccelerator");function ct(a,o,e){b.addDeaccelerator({name:a,x:o,y:e})}y(ct,"addDeaccelerator");function pt(a,o){b.setAnnotationsBox(a,o)}y(pt,"setAnnotationsBox");function ht(a,o){b.setSize(a,o)}y(ht,"setSize");function xt(a){b.startPipeline(a)}y(xt,"startPipeline");function ft(a,o){b.addPipelineComponent(a,o)}y(ft,"addPipelineComponent");function gt(a){b.setAxes(a)}y(gt,"updateAxes");function ut(a){return b.getNode(a)}y(ut,"getNode");function yt(a){return b.resolveNodeId(a)}y(yt,"resolveNodeId");function mt(){return b.build()}y(mt,"getWardleyData");function wt(){b.clear(),Ot()}y(wt,"clear");var Ht={getConfig:rt,addNode:ot,addLink:st,addTrend:nt,addAnnotation:it,addNote:dt,addAccelerator:lt,addDeaccelerator:ct,setAnnotationsBox:pt,setSize:ht,startPipeline:xt,addPipelineComponent:ft,updateAxes:gt,getNode:ut,resolveNodeId:yt,getWardleyData:mt,clear:wt,setAccTitle:Yt,getAccTitle:Et,setDiagramTitle:Xt,getDiagramTitle:At,getAccDescription:Tt,setAccDescription:Lt},jt=["Genesis","Custom Built","Product","Commodity"],Vt=y(()=>{var o,e,p,r,d,m,v,g,L,M,k,N;const{themeVariables:a}=V();return{backgroundColor:((o=a.wardley)==null?void 0:o.backgroundColor)??a.background??"#fff",axisColor:((e=a.wardley)==null?void 0:e.axisColor)??"#000",axisTextColor:((p=a.wardley)==null?void 0:p.axisTextColor)??a.primaryTextColor??"#222",gridColor:((r=a.wardley)==null?void 0:r.gridColor)??"rgba(100, 100, 100, 0.2)",componentFill:((d=a.wardley)==null?void 0:d.componentFill)??"#fff",componentStroke:((m=a.wardley)==null?void 0:m.componentStroke)??"#000",componentLabelColor:((v=a.wardley)==null?void 0:v.componentLabelColor)??a.primaryTextColor??"#222",linkStroke:((g=a.wardley)==null?void 0:g.linkStroke)??"#000",evolutionStroke:((L=a.wardley)==null?void 0:L.evolutionStroke)??"#dc3545",annotationStroke:((M=a.wardley)==null?void 0:M.annotationStroke)??"#000",annotationTextColor:((k=a.wardley)==null?void 0:k.annotationTextColor)??a.primaryTextColor??"#222",annotationFill:((N=a.wardley)==null?void 0:N.annotationFill)??a.background??"#fff"}},"getTheme"),_t=y(()=>{const a=V()["wardley-beta"];return{width:(a==null?void 0:a.width)??900,height:(a==null?void 0:a.height)??600,padding:(a==null?void 0:a.padding)??48,nodeRadius:(a==null?void 0:a.nodeRadius)??6,nodeLabelOffset:(a==null?void 0:a.nodeLabelOffset)??8,axisFontSize:(a==null?void 0:a.axisFontSize)??12,labelFontSize:(a==null?void 0:a.labelFontSize)??10,showGrid:(a==null?void 0:a.showGrid)??!1,useMaxWidth:(a==null?void 0:a.useMaxWidth)??!0}},"getConfigValues"),Zt=y((a,o,e,p)=>{var J,K;et.debug(`Rendering Wardley map
|
|
2
2
|
`+a);const r=_t(),d=Vt(),m=r.nodeRadius*1.6,v=p.db,g=v.getWardleyData(),L=v.getDiagramTitle(),M=((J=g.size)==null?void 0:J.width)??r.width,k=((K=g.size)==null?void 0:K.height)??r.height,N=Ft(o);N.selectAll("*").remove(),Rt(N,k,M,r.useMaxWidth),N.attr("viewBox",`0 0 ${M} ${k}`);const P=N.append("g").attr("class","wardley-map"),q=N.append("defs");q.append("marker").attr("id",`arrow-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${o}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${o}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),P.append("rect").attr("class","wardley-background").attr("width",M).attr("height",k).attr("fill",d.backgroundColor);const B=M-r.padding*2,F=k-r.padding*2;L&&P.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",r.padding/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(L);const T=y(t=>r.padding+t/100*B,"projectX"),A=y(t=>k-r.padding-t/100*F,"projectY"),O=P.append("g").attr("class","wardley-axes");O.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",r.padding).attr("x2",r.padding).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const kt=g.axes.xLabel??"Evolution",bt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",r.padding+B/2).attr("y",k-r.padding/4).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(kt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",r.padding/3).attr("y",r.padding+F/2).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${r.padding/3} ${r.padding+F/2})`).text(bt);const R=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:jt;if(R.length>0){const t=P.append("g").attr("class","wardley-stages"),n=g.axes.stageBoundaries,s=[];if(n&&n.length===R.length){let i=0;n.forEach(h=>{s.push({start:i,end:h}),i=h})}else{const i=1/R.length;R.forEach((h,l)=>{s.push({start:l*i,end:(l+1)*i})})}R.forEach((i,h)=>{const l=s[h],x=r.padding+l.start*B,f=r.padding+l.end*B,u=(x+f)/2;h>0&&t.append("line").attr("x1",x).attr("x2",x).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",u).attr("y",k-r.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",r.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(r.showGrid){const t=P.append("g").attr("class","wardley-grid");for(let n=1;n<4;n++){const s=n/4,i=r.padding+B*s;t.append("line").attr("x1",i).attr("x2",i).attr("y1",r.padding).attr("y2",k-r.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",r.padding).attr("x2",M-r.padding).attr("y1",k-r.padding-F*s).attr("y2",k-r.padding-F*s).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:T(t.x),y:A(t.y),node:t})}),g.pipelines.length>0){const t=P.append("g").attr("class","wardley-pipelines"),n=P.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(s=>{if(s.componentIds.length===0)return;const i=s.componentIds.map(f=>({id:f,pos:c.get(f),node:g.nodes.find(u=>u.id===f)})).filter(f=>f.pos&&f.node).sort((f,u)=>f.node.x-u.node.x);for(let f=0;f<i.length-1;f++){const u=i[f],w=i[f+1];n.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",u.pos.x).attr("y1",u.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let h=1/0,l=-1/0,x=0;if(s.componentIds.forEach(f=>{const u=c.get(f);u&&(h=Math.min(h,u.x),l=Math.max(l,u.x),x=u.y)}),h!==1/0&&l!==-1/0){const u=r.nodeRadius*4,w=x-u/2,S=c.get(s.nodeId);if(S){const z=(h+l)/2;S.x=z,S.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",h-15).attr("y",w).attr("width",l-h+30).attr("height",u).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=P.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>{if(!c.has(t.source)||!c.has(t.target))return!1;const n=Z.get(t.target);return!(n!=null&&n.has(t.source))});_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.x+l/f*h}).attr("y1",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.source).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x);return n.y+x/f*h}).attr("x2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.x+l/f*h}).attr("y2",t=>{const n=c.get(t.source),s=c.get(t.target),h=g.nodes.find(u=>u.id===t.target).isPipelineParent?m/Math.sqrt(2):r.nodeRadius,l=n.x-s.x,x=n.y-s.y,f=Math.sqrt(l*l+x*x);return s.y+x/f*h}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${o})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${o})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=s.y-n.y,l=s.x-n.x,x=Math.sqrt(l*l+h*h),f=8,u=h/x;return i+u*f}).attr("y",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.y+s.y)/2,h=s.x-n.x,l=s.y-n.y,x=Math.sqrt(h*h+l*l),f=8,u=-h/x;return i+u*f}).attr("fill",d.axisTextColor).attr("font-size",r.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const n=c.get(t.source),s=c.get(t.target),i=(n.x+s.x)/2,h=(n.y+s.y)/2,l=s.x-n.x,x=s.y-n.y,f=Math.sqrt(l*l+x*x),u=8,w=x/f,S=-l/f,z=i+w*u,W=h+S*u;let Y=Math.atan2(x,l)*180/Math.PI;return(Y>90||Y<-90)&&(Y+=180),`rotate(${Y} ${z} ${W})`}).text(t=>t.label);const $t=P.append("g").attr("class","wardley-trends"),vt=g.trends.map(t=>{const n=c.get(t.nodeId);if(!n)return null;const s=T(t.targetX),i=A(t.targetY),h=s-n.x,l=i-n.y,x=Math.sqrt(h*h+l*l),f=r.nodeRadius+2,u=x>f?s-h/x*f:s,w=x>f?i-l/x*f:i;return{origin:n,targetX:s,targetY:i,adjustedX2:u,adjustedY2:w}}).filter(t=>t!==null);$t.selectAll("line").data(vt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${o})`);const C=P.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));C.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const X=C.filter(t=>t.sourceStrategy==="market");X.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",r.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=r.nodeRadius*.7,$=r.nodeRadius*1.2;if(X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),X.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),C.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),C.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y1",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y-s/2}).attr("x2",t=>{const n=c.get(t.id);let s=t.isPipelineParent?m/2+15:r.nodeRadius+15;return t.sourceStrategy&&(s+=r.nodeRadius+10),n.x+s}).attr("y2",t=>{const n=c.get(t.id),s=t.isPipelineParent?m:r.nodeRadius*2;return n.y+s/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),C.append("text").attr("x",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?n.x+t.labelOffsetX:n.x;let s=r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(s+=10);const i=t.labelOffsetX??s;return n.x+i}).attr("y",t=>{const n=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?n.y+t.labelOffsetY:n.y-3;let s=-r.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(s-=10);const i=t.labelOffsetY??s;return n.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",r.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=P.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(n=>{const s=n.coordinates.map(i=>({x:T(i.x),y:A(i.y)}));if(s.length>1)for(let i=0;i<s.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[i].x).attr("y1",s[i].y).attr("x2",s[i+1].x).attr("y2",s[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach(i=>{const h=t.append("g").attr("class","wardley-annotation");h.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),h.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.number)})}),g.annotationsBox){let n=T(g.annotationsBox.x),s=A(g.annotationsBox.y);const i=10,h=16,l=11,x=t.append("g").attr("class","wardley-annotations-box"),f=[...g.annotations].filter(w=>w.text).sort((w,S)=>w.number-S.number),u=[];if(f.forEach((w,S)=>{const z=x.append("text").attr("x",n+i).attr("y",s+i+(S+1)*h).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);u.push(z)}),u.length>0){let w=0,S=0;u.forEach(j=>{const D=j.node(),Nt=D.getComputedTextLength();w=Math.max(w,Nt);const Ct=D.getBBox();S=Math.max(S,Ct.height)});const z=w+i*2+105,W=f.length*h+i*2+S/2,Y=r.padding,Pt=M-r.padding-z,St=r.padding,Mt=k-r.padding-W;n=Math.max(Y,Math.min(n,Pt)),s=Math.max(St,Math.min(s,Mt)),u.forEach((j,D)=>{j.attr("x",n+i).attr("y",s+i+(D+1)*h)}),x.insert("rect","text").attr("x",n).attr("y",s).attr("width",z).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=P.append("g").attr("class","wardley-notes");g.notes.forEach(n=>{const s=T(n.x),i=A(n.y);t.append("text").attr("x",s).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(n.text)})}if(g.accelerators.length>0){const t=P.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(n=>{const s=T(n.x),i=A(n.y),h=60,l=30,x=20,f=`
|
|
3
3
|
M ${s} ${i-l/2}
|
|
4
4
|
L ${s+h-x} ${i-l/2}
|
package/web/assets/{xychartDiagram-S5SC5T6Z-BzArL7i2.js → xychartDiagram-S5SC5T6Z-D0gQ0QKw.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as fi,g as mi,p as $t,o as yi,a as bi,b as Ai,_ as n,l as Ut,F as wi,d as Ci,q as Si,z as Tt,i as Ri,B as qt,D as _i,H as ki,I as Ti}from"./mermaid.core-
|
|
1
|
+
import{s as fi,g as mi,p as $t,o as yi,a as bi,b as Ai,_ as n,l as Ut,F as wi,d as Ci,q as Si,z as Tt,i as Ri,B as qt,D as _i,H as ki,I as Ti}from"./mermaid.core-37_hzSNp.js";import{l as Wt}from"./transform-Bd_a5eGM.js";import{b as Xt}from"./band-dPffDWoQ.js";import{l as Nt}from"./linear-CZIIlCMp.js";import"./main-jV_OilRs.js";import"./index-C9fscARj.js";import"./init-Gi6I4Gst.js";import"./ordinal-Cboi1Yqb.js";import"./defaultLocale-5voVPcsN.js";var St=(function(){var e=n(function(V,r,g,u){for(g=g||{},u=V.length;u--;g[V[u]]=r);return g},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],h=[1,6],l=[1,7],y=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],f=[1,26],_=[1,28],k=[1,29],P=[1,30],F=[1,31],W=[1,32],v=[1,33],B=[1,34],b=[1,35],T=[1,36],c=[1,37],I=[1,43],O=[1,42],X=[1,47],N=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],M=[26,28],R={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(function(r,g,u,x,C,o,lt){var p=o.length-1;switch(C){case 5:x.setOrientation(o[p]);break;case 9:x.setDiagramTitle(o[p].text.trim());break;case 12:x.setLineData({text:"",type:"text"},o[p]);break;case 13:x.setLineData(o[p-1],o[p]);break;case 14:x.setBarData({text:"",type:"text"},o[p]);break;case 15:x.setBarData(o[p-1],o[p]);break;case 16:this.$=o[p].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=o[p].trim(),x.setAccDescription(this.$);break;case 19:this.$=o[p-1];break;case 20:case 30:this.$=[o[p-2],...o[p]];break;case 21:case 31:this.$=[o[p]];break;case 22:this.$={value:Number(o[p-1]),label:o[p]};break;case 23:this.$={value:Number(o[p]),label:""};break;case 24:x.setXAxisTitle(o[p]);break;case 25:x.setXAxisTitle(o[p-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(o[p]);break;case 28:x.setXAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 29:this.$=o[p-1];break;case 32:x.setYAxisTitle(o[p]);break;case 33:x.setYAxisTitle(o[p-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 39:this.$={text:o[p],type:"text"};break;case 40:this.$={text:o[p],type:"text"};break;case 41:this.$={text:o[p],type:"markdown"};break;case 42:this.$=o[p];break;case 43:this.$=o[p-1]+""+o[p];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:h,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:h,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:h,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(y,[2,36]),e(y,[2,37]),e(y,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:h,38:l}),{1:[2,3]},e(y,[2,5]),e(t,[2,7],{4:22,36:a,37:h,38:l}),{11:23,30:d,39:24,40:f,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:B,49:b,50:T,51:c},{11:39,13:38,24:I,29:O,30:d,31:40,32:41,39:24,40:f,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:B,49:b,50:T,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:f,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:B,49:b,50:T,51:c},{11:49,17:48,24:N,30:d,39:24,40:f,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:B,49:b,50:T,51:c},{11:52,17:51,24:N,30:d,39:24,40:f,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:B,49:b,50:T,51:c},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(H,[2,39],{41:55,42:_,43:k,44:P,45:F,46:W,47:v,48:B,49:b,50:T,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:I,29:O}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:f,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:B,49:b,50:T,51:c},e(S,[2,11]),e(S,[2,32],{35:60,29:X}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:N},{25:63,27:64,29:w},e(S,[2,14]),{17:66,24:N},e(S,[2,16]),e(S,[2,17]),e(A,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(M,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:d,34:74,39:24,40:f,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:B,49:b,50:T,51:c},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:w},e(M,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(function(r,g){if(g.recoverable)this.trace(r);else{var u=new Error(r);throw u.hash=g,u}},"parseError"),parse:n(function(r){var g=this,u=[0],x=[],C=[null],o=[],lt=this.table,p="",xt=0,Bt=0,ui=2,Ot=1,xi=o.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bt)&&($.yy[bt]=this.yy[bt]);D.setInput(r,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var At=D.yylloc;o.push(At);var di=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pi(E){u.length=u.length-2*E,C.length=C.length-E,o.length=o.length-E}n(pi,"popStack");function Vt(){var E;return E=x.pop()||D.lex()||Ot,typeof E!="number"&&(E instanceof Array&&(x=E,E=x.pop()),E=g.symbols_[E]||E),E}n(Vt,"lex");for(var L,U,z,wt,j={},dt,Y,Ft,pt;;){if(U=u[u.length-1],this.defaultActions[U]?z=this.defaultActions[U]:((L===null||typeof L>"u")&&(L=Vt()),z=lt[U]&<[U][L]),typeof z>"u"||!z.length||!z[0]){var Ct="";pt=[];for(dt in lt[U])this.terminals_[dt]&&dt>ui&&pt.push("'"+this.terminals_[dt]+"'");D.showPosition?Ct="Parse error on line "+(xt+1)+`:
|
|
2
2
|
`+D.showPosition()+`
|
|
3
3
|
Expecting `+pt.join(", ")+", got '"+(this.terminals_[L]||L)+"'":Ct="Parse error on line "+(xt+1)+": Unexpected "+(L==Ot?"end of input":"'"+(this.terminals_[L]||L)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[L]||L,line:D.yylineno,loc:At,expected:pt})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+L);switch(z[0]){case 1:u.push(L),C.push(D.yytext),o.push(D.yylloc),u.push(z[1]),L=null,Bt=D.yyleng,p=D.yytext,xt=D.yylineno,At=D.yylloc;break;case 2:if(Y=this.productions_[z[1]][1],j.$=C[C.length-Y],j._$={first_line:o[o.length-(Y||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Y||1)].first_column,last_column:o[o.length-1].last_column},di&&(j._$.range=[o[o.length-(Y||1)].range[0],o[o.length-1].range[1]]),wt=this.performAction.apply(j,[p,Bt,xt,$.yy,z[1],C,o].concat(xi)),typeof wt<"u")return wt;Y&&(u=u.slice(0,-1*Y*2),C=C.slice(0,-1*Y),o=o.slice(0,-1*Y)),u.push(this.productions_[z[1]][0]),C.push(j.$),o.push(j._$),Ft=lt[u[u.length-2]][u[u.length-1]],u.push(Ft);break;case 3:return!0}}return!0},"parse")},rt=(function(){var V={EOF:1,parseError:n(function(g,u){if(this.yy.parser)this.yy.parser.parseError(g,u);else throw new Error(g)},"parseError"),setInput:n(function(r,g){return this.yy=g||this.yy||{},this._input=r,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:n(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var g=r.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:n(function(r){var g=r.length,u=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var x=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),u.length-1&&(this.yylineno-=u.length-1);var C=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:u?(u.length===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(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:n(function(r){this.unput(this.match.slice(r))},"less"),pastInput:n(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var r=this.pastInput(),g=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|