lookatstudy-mobile 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/package.json +1 -1
  2. package/web/assets/{CanvasStage-u_7YeGk1.js → CanvasStage-sR8T2IFn.js} +1 -1
  3. package/web/assets/{CommandPalette-Q5j7BQf4.js → CommandPalette-xoHRtFTt.js} +1 -1
  4. package/web/assets/{CourseSearchPanel-BYGHjhnk.js → CourseSearchPanel-Blz5uOZo.js} +2 -2
  5. package/web/assets/{ExamView-DU5X7LyZ.js → ExamView-DcD9-XhK.js} +1 -1
  6. package/web/assets/ReviewPanel-DPX_Gbvn.js +1 -0
  7. package/web/assets/{SettingsView-CD9th6O0.js → SettingsView-DpSiGIUo.js} +3 -3
  8. package/web/assets/Tableau10-CvOaoHrI.js +1 -0
  9. package/web/assets/{VoicePanel-Cvl2BLq2.js → VoicePanel-BFuMIduE.js} +1 -1
  10. package/web/assets/abnfDiagram-N423BO3Z-BRYm-LZF.js +1 -0
  11. package/web/assets/abnfDiagram-VCTEODGH-ODA7YWAP-B--kWzEh.js +1 -0
  12. package/web/assets/arc-DIdxrd7q.js +1 -0
  13. package/web/assets/architectureDiagram-5GKGNRK7-C4PU3XN7-DzOQ5fo_.js +36 -0
  14. package/web/assets/architectureDiagram-T3A2C74G-BhljJtMX.js +36 -0
  15. package/web/assets/{arrow-right-B0QrRNSR.js → arrow-right-DtCWRkvj.js} +1 -1
  16. package/web/assets/{blockDiagram-NRAW4CY4-UMJ6PMQQ-BxiaVwV9.js → blockDiagram-NRAW4CY4-UMJ6PMQQ-D3KXfJhJ.js} +2 -2
  17. package/web/assets/{blockDiagram-VBNYF7ZC-BAnlmDNm.js → blockDiagram-VBNYF7ZC-Dr7ZTeLw.js} +3 -3
  18. package/web/assets/{c4Diagram-5PPSVZJV-MUU8xp1X.js → c4Diagram-5PPSVZJV-CPi9fgO4.js} +2 -2
  19. package/web/assets/{c4Diagram-UCG6FXSJ-75X3U2P3-7rpgYEob.js → c4Diagram-UCG6FXSJ-75X3U2P3-Bj0Dw0IT.js} +2 -2
  20. package/web/assets/channel-aqWuF1WT.js +1 -0
  21. package/web/assets/{chunk-2GRJ4B5K-BZ6Sj0-3.js → chunk-2GRJ4B5K-DeZ82qe7.js} +1 -1
  22. package/web/assets/{chunk-2Q5K7J3B-BkOSQBqV.js → chunk-2Q5K7J3B-B1WwbyzY.js} +1 -1
  23. package/web/assets/{chunk-5RXB4S5H-DgXJvWY0.js → chunk-5RXB4S5H-BX9ZzOwO.js} +1 -1
  24. package/web/assets/{chunk-5VM5RSS4-D-BptZQ9.js → chunk-5VM5RSS4-9-QvfnU2.js} +1 -1
  25. package/web/assets/{chunk-6Q2QTUOP-DIJ0lWTD.js → chunk-6Q2QTUOP-Dkt-zdDg.js} +1 -1
  26. package/web/assets/{chunk-7XDTSPCN-vxuDBi1y.js → chunk-7XDTSPCN-DOxJ22Ws.js} +1 -1
  27. package/web/assets/{chunk-CTNIYPP6-F5ZMIO6O.js → chunk-CTNIYPP6-2D6eMEGx.js} +1 -1
  28. package/web/assets/{chunk-CXNFBKHE-CFr1EfBh.js → chunk-CXNFBKHE-BETxgCVr.js} +1 -1
  29. package/web/assets/{chunk-GF5L2VYU-jqePwawx.js → chunk-GF5L2VYU-JBwf_TWs.js} +1 -1
  30. package/web/assets/{chunk-ISA7TJRJ-DiKuu0wz.js → chunk-ISA7TJRJ-DGTMMKAm.js} +1 -1
  31. package/web/assets/{chunk-JWPE2WC7-CLC3hqKr.js → chunk-JWPE2WC7-B_A1as9r.js} +1 -1
  32. package/web/assets/{chunk-KBJHAD2P-DSEKcYpO.js → chunk-KBJHAD2P-bmR9qwSi.js} +1 -1
  33. package/web/assets/{chunk-LV3HUYFY-P2e0-qZ6.js → chunk-LV3HUYFY-D8UFu3pb.js} +1 -1
  34. package/web/assets/{chunk-M3IUQBOH-Bdt4MjFy.js → chunk-M3IUQBOH-r4ZZKIWR.js} +1 -1
  35. package/web/assets/{chunk-NDIOYS4C-7HlPLAGd.js → chunk-NDIOYS4C-BuC155ii.js} +1 -1
  36. package/web/assets/{chunk-RE4WF27V-D4vIv_G3.js → chunk-RE4WF27V-DJoYieaa.js} +1 -1
  37. package/web/assets/{chunk-RYQCIY6F-tTcuHeqw.js → chunk-RYQCIY6F-DNF6lO1-.js} +1 -1
  38. package/web/assets/{chunk-VII2H2IX-BkXECJ1Z.js → chunk-VII2H2IX-DBudi9Y-.js} +1 -1
  39. package/web/assets/{chunk-X5GNSKZ3-D7yjZGWk.js → chunk-X5GNSKZ3-Dzcgoim8.js} +1 -1
  40. package/web/assets/{chunk-XCWWM2C3-C_es6n6S.js → chunk-XCWWM2C3-3YSDgOL-.js} +1 -1
  41. package/web/assets/{chunk-XXDRQBXY-Bsuow-B8.js → chunk-XXDRQBXY-B5LLJm9i.js} +1 -1
  42. package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-DhFaZ76j.js +1 -0
  43. package/web/assets/classDiagram-JCYQIIEL-CNvSQ-RA.js +1 -0
  44. package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-DhFaZ76j.js +1 -0
  45. package/web/assets/classDiagram-v2-OCEON4UE-CNvSQ-RA.js +1 -0
  46. package/web/assets/{core-Bgf5ngI5.js → core-Cf-iwesp.js} +4 -4
  47. package/web/assets/cose-bilkent-JH36ORCC-DweZYTE6.js +1 -0
  48. package/web/assets/cose-bilkent-JH36ORCC-OB24KH3T-D3S0f4LW.js +1 -0
  49. package/web/assets/{cynefin-OW5HDTMX-GVF3BKWE-DY90g1OE.js → cynefin-OW5HDTMX-GVF3BKWE-DrtBkvjj.js} +1 -1
  50. package/web/assets/{cynefin-VYW2F7L2-DjqH_9VW.js → cynefin-VYW2F7L2-lYm8p8qp.js} +1 -1
  51. package/web/assets/cynefinDiagram-5FMLGOSQ-H3WIRU3N-CGurIKbY.js +62 -0
  52. package/web/assets/cynefinDiagram-MW4NZA55-EMZxCSzT.js +62 -0
  53. package/web/assets/{dagre-3AP2YEHR-DCERTXHT-BwLHkvZV.js → dagre-3AP2YEHR-DCERTXHT-B3xLLC4U.js} +2 -2
  54. package/web/assets/{dagre-VZM6K2ZE-0zjstOys.js → dagre-VZM6K2ZE-lqYJ3WXC.js} +2 -2
  55. package/web/assets/{diagram-7IWD3JNH-CoRwcTua.js → diagram-7IWD3JNH-DXSSf7q4.js} +2 -2
  56. package/web/assets/{diagram-B4RE2ZJO-Cau1H7nm.js → diagram-B4RE2ZJO-ak7sOZ19.js} +2 -2
  57. package/web/assets/diagram-LBJQPF4R-XmQxOAH-.js +24 -0
  58. package/web/assets/diagram-Q27KOJAE-D-yQEvjN.js +24 -0
  59. package/web/assets/{diagram-S7CK7UJ4-MULGZGEL-C7lZT5bQ.js → diagram-S7CK7UJ4-MULGZGEL-D5WNGIG9.js} +2 -2
  60. package/web/assets/diagram-UB23O5K3-CRgze-MQ.js +41 -0
  61. package/web/assets/diagram-UQ7AKVKN-YQBY353J-CSvMx1Fm.js +41 -0
  62. package/web/assets/{diagram-VSXAHHWV-WLNH2ELY-BW8LpgQJ.js → diagram-VSXAHHWV-WLNH2ELY-DMVZ0M5s.js} +2 -2
  63. package/web/assets/diagram-VX7I27RA-XW6YQV5G-NONTq7mV.js +24 -0
  64. package/web/assets/diagram-Z3DM3KII-HG7RF65D-D0VfGCJh.js +24 -0
  65. package/web/assets/ebnfDiagram-BXEA7PRR-D0k0RumW.js +1 -0
  66. package/web/assets/ebnfDiagram-PWID7BFC-OKY4VHYD-By7cMb-m.js +1 -0
  67. package/web/assets/{elk.bundled-DP5Rghza.js → elk.bundled-DCJrDGbL.js} +1 -1
  68. package/web/assets/{erDiagram-JOGREHBK-Dz3-stVV.js → erDiagram-JOGREHBK-DxDlKHXu.js} +4 -4
  69. package/web/assets/{erDiagram-SSCWMZ5O-PIPKOIK7-DoltPq2T.js → erDiagram-SSCWMZ5O-PIPKOIK7-DwWrIKUB.js} +2 -2
  70. package/web/assets/{flowDiagram-A5DVABFB-2Z4AVO5R-EXpUdCkE.js → flowDiagram-A5DVABFB-2Z4AVO5R-eqJKcw9W.js} +1 -1
  71. package/web/assets/{flowDiagram-UKHOOZJN--KUxj2rZ.js → flowDiagram-UKHOOZJN-CC84JD3t.js} +1 -1
  72. package/web/assets/{ganttDiagram-EL5Y4UJY-JZNG7GOG-B3_qeHhv.js → ganttDiagram-EL5Y4UJY-JZNG7GOG-CWOtJ46k.js} +6 -6
  73. package/web/assets/{ganttDiagram-PKOTCBZU-DDw97tpG.js → ganttDiagram-PKOTCBZU-Bw78KC7C.js} +3 -3
  74. package/web/assets/gitGraphDiagram-DS77QQ5N-CywKDUgv.js +106 -0
  75. package/web/assets/gitGraphDiagram-WWUBYQGX-DMWMLL3G-DIUZBjRH.js +106 -0
  76. package/web/assets/{index-CrB9w7Gs.js → index-BLO7CDRf.js} +2 -2
  77. package/web/assets/{index-C-4sKCSr.js → index-BNNZmZ7L.js} +13 -13
  78. package/web/assets/{index-CRlVl931.js → index-CAFnQS2L.js} +1 -1
  79. package/web/assets/index-Coa1vpTG.css +1 -0
  80. package/web/assets/index-WF4B6heO.js +21 -0
  81. package/web/assets/infoDiagram-6WML65LV-DFCB1zK_.js +2 -0
  82. package/web/assets/infoDiagram-RXCK75RN-HANS5KVC-CR0XCzL1.js +2 -0
  83. package/web/assets/{ishikawaDiagram-5VMMS53U-7GCIT7WU-DR-PXM0c.js → ishikawaDiagram-5VMMS53U-7GCIT7WU-BQmMapB0.js} +4 -4
  84. package/web/assets/{ishikawaDiagram-WSZJBQD7-Bf-J9Ov1.js → ishikawaDiagram-WSZJBQD7-CDVYsb8F.js} +6 -6
  85. package/web/assets/{journeyDiagram-EYS64GPL-OAPELBT7-jFQUZit6.js → journeyDiagram-EYS64GPL-OAPELBT7-Bv57BEbI.js} +2 -2
  86. package/web/assets/{journeyDiagram-NVQOT4AX-CWed0L5n.js → journeyDiagram-NVQOT4AX-BUhHhw49.js} +2 -2
  87. package/web/assets/{kanban-definition-27J2QSJJ-DhTIozq4.js → kanban-definition-27J2QSJJ-DJWi_jsV.js} +2 -2
  88. package/web/assets/{kanban-definition-3QL26DDD-I7RKWQQY-MOg0W8Vc.js → kanban-definition-3QL26DDD-I7RKWQQY-DeQuTmff.js} +2 -2
  89. package/web/assets/{katex-N6JRN4PM-DUl1EV3T.js → katex-N6JRN4PM-CsmS8bAu.js} +1 -1
  90. package/web/assets/{linear-BHfMepXe.js → linear-DQOfHiUP.js} +1 -1
  91. package/web/assets/main-Bkgg11ZB.js +462 -0
  92. package/web/assets/mermaid-layout-elk.core-DDX9gcIM.js +2 -0
  93. package/web/assets/{mermaid.core-BVbO1Vp8.js → mermaid.core-D0rh4nEj.js} +13 -13
  94. package/web/assets/{mindmap-definition-FAOFIHXS-UC1xDIuF.js → mindmap-definition-FAOFIHXS-nqKMiE2n.js} +2 -2
  95. package/web/assets/{mindmap-definition-FBJOCRG2-KIYZG64Y-DyTkl7Qq.js → mindmap-definition-FBJOCRG2-KIYZG64Y-CgkstHv4.js} +2 -2
  96. package/web/assets/pegDiagram-VL7TDLO6-Cy8v2veR.js +1 -0
  97. package/web/assets/pegDiagram-XKGWAZYB-OIP57N6J-DHOcOx86.js +1 -0
  98. package/web/assets/{pet-BawFRWlx.js → pet-DaccG5xt.js} +1 -1
  99. package/web/assets/pie-5VdQHRMI.js +1 -0
  100. package/web/assets/{pieDiagram-7S7Q4E2Y-Bggk64R7.js → pieDiagram-7S7Q4E2Y-D2e6HI5F.js} +2 -2
  101. package/web/assets/{pieDiagram-E7YTZNPT-2UOTW327-DbtP5dKZ.js → pieDiagram-E7YTZNPT-2UOTW327-9oqFgJEQ.js} +3 -3
  102. package/web/assets/{quadrantDiagram-AXDQQJYC-SN3ASJJK-CbdnLdcx.js → quadrantDiagram-AXDQQJYC-SN3ASJJK-aRI00491.js} +2 -2
  103. package/web/assets/{quadrantDiagram-CIZ2JOQS-D8oWqljf.js → quadrantDiagram-CIZ2JOQS-BxVU5r4V.js} +2 -2
  104. package/web/assets/railroadDiagram-AXF67PYL-CxcdKdyz.js +1 -0
  105. package/web/assets/railroadDiagram-O6MQD6OU-34742W6X-82y7OitY.js +1 -0
  106. package/web/assets/{render-O7CIS3YK-C5zxvpoJ.js → render-O7CIS3YK-0coM2jiE.js} +15 -15
  107. package/web/assets/{requirementDiagram-EFPCY7ZU-NGAFFSMB-vkMFulyy.js → requirementDiagram-EFPCY7ZU-NGAFFSMB-CiCBt9Q_.js} +2 -2
  108. package/web/assets/{requirementDiagram-LRYGKXZP-4uQ-OIOg.js → requirementDiagram-LRYGKXZP-a-jqBbh4.js} +4 -4
  109. package/web/assets/{rotate-ccw-C3k3pTDh.js → rotate-ccw-DPfbZXyQ.js} +1 -1
  110. package/web/assets/sankeyDiagram-P5KCCOFB-3D3M4XPB-vVOpmIBk.js +40 -0
  111. package/web/assets/{sankeyDiagram-W5VNT64P-CdtMmhMM.js → sankeyDiagram-W5VNT64P-CXBDBsJf.js} +2 -2
  112. package/web/assets/{sequenceDiagram-SI44F4Z6-BTa9vGYr.js → sequenceDiagram-SI44F4Z6-BEzEovun.js} +2 -2
  113. package/web/assets/{sequenceDiagram-WJ2MYXX4-Q2IOPB4R-Du5hMpfL.js → sequenceDiagram-WJ2MYXX4-Q2IOPB4R-BAt30Hjd.js} +2 -2
  114. package/web/assets/sizeCapture-X5ZJPWSS-CqVF9LHS.js +1 -0
  115. package/web/assets/sizeCapture-X5ZJPWSS-PSGVOMYM-DPuPQlRM.js +1 -0
  116. package/web/assets/stateDiagram-HBIQ2CUA-4M2S6MAN-DnF-bmgm.js +1 -0
  117. package/web/assets/stateDiagram-OKZ733FA-CKebmBa5.js +1 -0
  118. package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-BLTGkUFQ.js +1 -0
  119. package/web/assets/stateDiagram-v2-UEYNNEHI-BLjk4IRo.js +1 -0
  120. package/web/assets/swimlanes-SLNWSIFB-M10HmJH-.js +2 -0
  121. package/web/assets/swimlanes-XN3QIQJK-N6N2CCQ6-DzcOR4_D.js +1 -0
  122. package/web/assets/swimlanesDiagram-ULZ7WXOC-DCxkAVHU.js +8 -0
  123. package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-JLTPHNIv.js +8 -0
  124. package/web/assets/time-BgujFIZT.js +1 -0
  125. package/web/assets/{timeline-definition-24CTP7MA-KN7RSRVM-Cba_QLsv.js → timeline-definition-24CTP7MA-KN7RSRVM-CMhLQnxM.js} +2 -2
  126. package/web/assets/{timeline-definition-Z64GVDOM-nDvkF_F-.js → timeline-definition-Z64GVDOM-LcGdwXI-.js} +2 -2
  127. package/web/assets/transform-B5_amWNh.js +1 -0
  128. package/web/assets/{vennDiagram-4TSXK5OY-AKJ7LXAN-Bjm0zDVN.js → vennDiagram-4TSXK5OY-AKJ7LXAN-CKicd48A.js} +2 -2
  129. package/web/assets/{vennDiagram-T6HMQDX7-KudBxp6e.js → vennDiagram-T6HMQDX7-D7hxv4W7.js} +2 -2
  130. package/web/assets/{wardleyDiagram-T6FBY63Y-d1R0A5mS.js → wardleyDiagram-T6FBY63Y-DnTzvRkP.js} +2 -2
  131. package/web/assets/{wardleyDiagram-VM6X3IG4-3B6A3BN5-BOTe--eD.js → wardleyDiagram-VM6X3IG4-3B6A3BN5-CBmbko0H.js} +2 -2
  132. package/web/assets/{xychartDiagram-ELKLHX3M-ChfX530c.js → xychartDiagram-ELKLHX3M-B1fLmbSX.js} +3 -3
  133. package/web/assets/{xychartDiagram-S5SC5T6Z-OBDNV6WG-DcSRUgks.js → xychartDiagram-S5SC5T6Z-OBDNV6WG-D1kFCVEP.js} +3 -3
  134. package/web/index.html +3 -3
  135. package/web/pet.html +3 -3
  136. package/web/assets/MindmapView-C61d4ddf.js +0 -4
  137. package/web/assets/ReviewPanel-DoLMdlpR.js +0 -1
  138. package/web/assets/Tableau10-Cz3F1amA.js +0 -1
  139. package/web/assets/abnfDiagram-N423BO3Z-BvTcLUtE.js +0 -1
  140. package/web/assets/abnfDiagram-VCTEODGH-ODA7YWAP-NpbseUTF.js +0 -1
  141. package/web/assets/arc-Bb-hQPAI.js +0 -1
  142. package/web/assets/architectureDiagram-5GKGNRK7-C4PU3XN7-DGtDmisd.js +0 -36
  143. package/web/assets/architectureDiagram-T3A2C74G-huu8moy9.js +0 -36
  144. package/web/assets/channel-BJoUn5Z8.js +0 -1
  145. package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-B3DqqoSe.js +0 -1
  146. package/web/assets/classDiagram-JCYQIIEL-C2n-a_rM.js +0 -1
  147. package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-B3DqqoSe.js +0 -1
  148. package/web/assets/classDiagram-v2-OCEON4UE-C2n-a_rM.js +0 -1
  149. package/web/assets/colors-Cc3OSVma.js +0 -1
  150. package/web/assets/cose-bilkent-JH36ORCC-OB24KH3T-DM0H6Gci.js +0 -1
  151. package/web/assets/cose-bilkent-JH36ORCC-x05QuEnY.js +0 -1
  152. package/web/assets/cynefinDiagram-5FMLGOSQ-H3WIRU3N-DoaOZ7iJ.js +0 -62
  153. package/web/assets/cynefinDiagram-MW4NZA55-DI8ePik6.js +0 -62
  154. package/web/assets/diagram-LBJQPF4R-CZIgxCTB.js +0 -24
  155. package/web/assets/diagram-Q27KOJAE-B_LnuCra.js +0 -24
  156. package/web/assets/diagram-UB23O5K3-qTFCSozX.js +0 -41
  157. package/web/assets/diagram-UQ7AKVKN-YQBY353J-CIootVI_.js +0 -41
  158. package/web/assets/diagram-VX7I27RA-XW6YQV5G-DfhGfGMR.js +0 -24
  159. package/web/assets/diagram-Z3DM3KII-HG7RF65D-seunnnEY.js +0 -24
  160. package/web/assets/ebnfDiagram-BXEA7PRR-ksZAvx5f.js +0 -1
  161. package/web/assets/ebnfDiagram-PWID7BFC-OKY4VHYD-Bvj1acAA.js +0 -1
  162. package/web/assets/gitGraphDiagram-DS77QQ5N-DXUcbzn4.js +0 -106
  163. package/web/assets/gitGraphDiagram-WWUBYQGX-DMWMLL3G-BrLu7NzO.js +0 -106
  164. package/web/assets/index-BUFumkqO.js +0 -21
  165. package/web/assets/index-CODVWHV0.js +0 -416
  166. package/web/assets/index-CU6ublfJ.js +0 -1
  167. package/web/assets/index-DjoBjasB.css +0 -1
  168. package/web/assets/index-H1bePBGl.js +0 -3
  169. package/web/assets/infoDiagram-6WML65LV-rLhQ8DQz.js +0 -2
  170. package/web/assets/infoDiagram-RXCK75RN-HANS5KVC-BhbqgWa_.js +0 -2
  171. package/web/assets/main-D3HpSUyK.js +0 -462
  172. package/web/assets/mermaid-layout-elk.core-KBAfwQxu.js +0 -2
  173. package/web/assets/min-tv6RD-6E.js +0 -1
  174. package/web/assets/pegDiagram-VL7TDLO6-D3DtO4SS.js +0 -1
  175. package/web/assets/pegDiagram-XKGWAZYB-OIP57N6J-D6RFGa8P.js +0 -1
  176. package/web/assets/pie-xhYaZtwS.js +0 -1
  177. package/web/assets/railroadDiagram-AXF67PYL-DqYMsbyG.js +0 -1
  178. package/web/assets/railroadDiagram-O6MQD6OU-34742W6X-BxDZ-lKK.js +0 -1
  179. package/web/assets/sankeyDiagram-P5KCCOFB-3D3M4XPB-Ct2_9lW6.js +0 -40
  180. package/web/assets/sizeCapture-X5ZJPWSS-PSGVOMYM-Dv_CbP4j.js +0 -1
  181. package/web/assets/sizeCapture-X5ZJPWSS-xJHPAAZ7.js +0 -1
  182. package/web/assets/stateDiagram-HBIQ2CUA-4M2S6MAN-BhhZM57P.js +0 -1
  183. package/web/assets/stateDiagram-OKZ733FA-CHCQNs83.js +0 -1
  184. package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-CNwPFEas.js +0 -1
  185. package/web/assets/stateDiagram-v2-UEYNNEHI-uaaN79rE.js +0 -1
  186. package/web/assets/step-SI6FXFD6.js +0 -1
  187. package/web/assets/swimlanes-SLNWSIFB-Bste-JE-.js +0 -2
  188. package/web/assets/swimlanes-XN3QIQJK-N6N2CCQ6-03elMVxe.js +0 -1
  189. package/web/assets/swimlanesDiagram-ULZ7WXOC-CNw-u2S_.js +0 -8
  190. package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-jhFh1EB2.js +0 -8
  191. package/web/assets/time-CLfYygnx.js +0 -1
  192. package/web/assets/transform-CzGDKG_M.js +0 -1
@@ -0,0 +1 @@
1
+ var Gn={value:()=>{}};function un(){for(var t=0,n=arguments.length,i={},e;t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new j(i)}function j(t){this._=t}function Qn(t,n){return t.trim().split(/^|\s+/).map(function(i){var e="",r=i.indexOf(".");if(r>=0&&(e=i.slice(r+1),i=i.slice(0,r)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:e}})}j.prototype=un.prototype={constructor:j,on:function(t,n){var i=this._,e=Qn(t+"",i),r,s=-1,o=e.length;if(arguments.length<2){for(;++s<o;)if((r=(t=e[s]).type)&&(r=Wn(i[r],t.name)))return r;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++s<o;)if(r=(t=e[s]).type)i[r]=Ht(i[r],t.name,n);else if(n==null)for(r in i)i[r]=Ht(i[r],t.name,null);return this},copy:function(){var t={},n=this._;for(var i in n)t[i]=n[i].slice();return new j(t)},call:function(t,n){if((r=arguments.length-2)>0)for(var i=new Array(r),e=0,r,s;e<r;++e)i[e]=arguments[e+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],e=0,r=s.length;e<r;++e)s[e].value.apply(n,i)},apply:function(t,n,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var e=this._[t],r=0,s=e.length;r<s;++r)e[r].value.apply(n,i)}};function Wn(t,n){for(var i=0,e=t.length,r;i<e;++i)if((r=t[i]).name===n)return r.value}function Ht(t,n,i){for(var e=0,r=t.length;e<r;++e)if(t[e].name===n){t[e]=Gn,t=t.slice(0,e).concat(t.slice(e+1));break}return i!=null&&t.push({name:n,value:i}),t}var vt="http://www.w3.org/1999/xhtml";const Bt={svg:"http://www.w3.org/2000/svg",xhtml:vt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ct(t){var n=t+="",i=n.indexOf(":");return i>=0&&(n=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),Bt.hasOwnProperty(n)?{space:Bt[n],local:t}:t}function Zn(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===vt&&n.documentElement.namespaceURI===vt?n.createElement(t):n.createElementNS(i,t)}}function Jn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ln(t){var n=ct(t);return(n.local?Jn:Zn)(n)}function jn(){}function St(t){return t==null?jn:function(){return this.querySelector(t)}}function ti(t){typeof t!="function"&&(t=St(t));for(var n=this._groups,i=n.length,e=new Array(i),r=0;r<i;++r)for(var s=n[r],o=s.length,a=e[r]=new Array(o),h,u,l=0;l<o;++l)(h=s[l])&&(u=t.call(h,h.__data__,l,s))&&("__data__"in h&&(u.__data__=h.__data__),a[l]=u);return new y(e,this._parents)}function ni(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ii(){return[]}function cn(t){return t==null?ii:function(){return this.querySelectorAll(t)}}function ei(t){return function(){return ni(t.apply(this,arguments))}}function ri(t){typeof t=="function"?t=ei(t):t=cn(t);for(var n=this._groups,i=n.length,e=[],r=[],s=0;s<i;++s)for(var o=n[s],a=o.length,h,u=0;u<a;++u)(h=o[u])&&(e.push(t.call(h,h.__data__,u,o)),r.push(h));return new y(e,r)}function fn(t){return function(){return this.matches(t)}}function _n(t){return function(n){return n.matches(t)}}var si=Array.prototype.find;function oi(t){return function(){return si.call(this.children,t)}}function ai(){return this.firstElementChild}function hi(t){return this.select(t==null?ai:oi(typeof t=="function"?t:_n(t)))}var ui=Array.prototype.filter;function li(){return Array.from(this.children)}function ci(t){return function(){return ui.call(this.children,t)}}function fi(t){return this.selectAll(t==null?li:ci(typeof t=="function"?t:_n(t)))}function _i(t){typeof t!="function"&&(t=fn(t));for(var n=this._groups,i=n.length,e=new Array(i),r=0;r<i;++r)for(var s=n[r],o=s.length,a=e[r]=[],h,u=0;u<o;++u)(h=s[u])&&t.call(h,h.__data__,u,s)&&a.push(h);return new y(e,this._parents)}function pn(t){return new Array(t.length)}function pi(){return new y(this._enter||this._groups.map(pn),this._parents)}function it(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}it.prototype={constructor:it,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function xi(t){return function(){return t}}function di(t,n,i,e,r,s){for(var o=0,a,h=n.length,u=s.length;o<u;++o)(a=n[o])?(a.__data__=s[o],e[o]=a):i[o]=new it(t,s[o]);for(;o<h;++o)(a=n[o])&&(r[o]=a)}function yi(t,n,i,e,r,s,o){var a,h,u=new Map,l=n.length,c=s.length,f=new Array(l),_;for(a=0;a<l;++a)(h=n[a])&&(f[a]=_=o.call(h,h.__data__,a,n)+"",u.has(_)?r[a]=h:u.set(_,h));for(a=0;a<c;++a)_=o.call(t,s[a],a,s)+"",(h=u.get(_))?(e[a]=h,h.__data__=s[a],u.delete(_)):i[a]=new it(t,s[a]);for(a=0;a<l;++a)(h=n[a])&&u.get(f[a])===h&&(r[a]=h)}function wi(t){return t.__data__}function vi(t,n){if(!arguments.length)return Array.from(this,wi);var i=n?yi:di,e=this._parents,r=this._groups;typeof t!="function"&&(t=xi(t));for(var s=r.length,o=new Array(s),a=new Array(s),h=new Array(s),u=0;u<s;++u){var l=e[u],c=r[u],f=c.length,_=gi(t.call(l,l&&l.__data__,u,e)),p=_.length,x=a[u]=new Array(p),b=o[u]=new Array(p),Q=h[u]=new Array(f);i(l,c,x,b,Q,_,n);for(var $=0,S=0,P,O;$<p;++$)if(P=x[$]){for($>=S&&(S=$+1);!(O=b[S])&&++S<p;);P._next=O||null}}return o=new y(o,e),o._enter=a,o._exit=h,o}function gi(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function mi(){return new y(this._exit||this._groups.map(pn),this._parents)}function bi(t,n,i){var e=this.enter(),r=this,s=this.exit();return typeof t=="function"?(e=t(e),e&&(e=e.selection())):e=e.append(t+""),n!=null&&(r=n(r),r&&(r=r.selection())),i==null?s.remove():i(s),e&&r?e.merge(r).order():r}function Ni(t){for(var n=t.selection?t.selection():t,i=this._groups,e=n._groups,r=i.length,s=e.length,o=Math.min(r,s),a=new Array(r),h=0;h<o;++h)for(var u=i[h],l=e[h],c=u.length,f=a[h]=new Array(c),_,p=0;p<c;++p)(_=u[p]||l[p])&&(f[p]=_);for(;h<r;++h)a[h]=i[h];return new y(a,this._parents)}function ki(){for(var t=this._groups,n=-1,i=t.length;++n<i;)for(var e=t[n],r=e.length-1,s=e[r],o;--r>=0;)(o=e[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function $i(t){t||(t=Ti);function n(c,f){return c&&f?t(c.__data__,f.__data__):!c-!f}for(var i=this._groups,e=i.length,r=new Array(e),s=0;s<e;++s){for(var o=i[s],a=o.length,h=r[s]=new Array(a),u,l=0;l<a;++l)(u=o[l])&&(h[l]=u);h.sort(n)}return new y(r,this._parents).order()}function Ti(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Ei(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Si(){return Array.from(this)}function Ai(){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var e=t[n],r=0,s=e.length;r<s;++r){var o=e[r];if(o)return o}return null}function Ci(){let t=0;for(const n of this)++t;return t}function Mi(){return!this.node()}function Ri(t){for(var n=this._groups,i=0,e=n.length;i<e;++i)for(var r=n[i],s=0,o=r.length,a;s<o;++s)(a=r[s])&&t.call(a,a.__data__,s,r);return this}function Pi(t){return function(){this.removeAttribute(t)}}function Ii(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qi(t,n){return function(){this.setAttribute(t,n)}}function Fi(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Li(t,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Oi(t,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function Xi(t,n){var i=ct(t);if(arguments.length<2){var e=this.node();return i.local?e.getAttributeNS(i.space,i.local):e.getAttribute(i)}return this.each((n==null?i.local?Ii:Pi:typeof n=="function"?i.local?Oi:Li:i.local?Fi:qi)(i,n))}function xn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Hi(t){return function(){this.style.removeProperty(t)}}function Bi(t,n,i){return function(){this.style.setProperty(t,n,i)}}function Di(t,n,i){return function(){var e=n.apply(this,arguments);e==null?this.style.removeProperty(t):this.style.setProperty(t,e,i)}}function zi(t,n,i){return arguments.length>1?this.each((n==null?Hi:typeof n=="function"?Di:Bi)(t,n,i??"")):F(this.node(),t)}function F(t,n){return t.style.getPropertyValue(n)||xn(t).getComputedStyle(t,null).getPropertyValue(n)}function Yi(t){return function(){delete this[t]}}function Vi(t,n){return function(){this[t]=n}}function Ui(t,n){return function(){var i=n.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Ki(t,n){return arguments.length>1?this.each((n==null?Yi:typeof n=="function"?Ui:Vi)(t,n)):this.node()[t]}function dn(t){return t.trim().split(/^|\s+/)}function At(t){return t.classList||new yn(t)}function yn(t){this._node=t,this._names=dn(t.getAttribute("class")||"")}yn.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function wn(t,n){for(var i=At(t),e=-1,r=n.length;++e<r;)i.add(n[e])}function vn(t,n){for(var i=At(t),e=-1,r=n.length;++e<r;)i.remove(n[e])}function Gi(t){return function(){wn(this,t)}}function Qi(t){return function(){vn(this,t)}}function Wi(t,n){return function(){(n.apply(this,arguments)?wn:vn)(this,t)}}function Zi(t,n){var i=dn(t+"");if(arguments.length<2){for(var e=At(this.node()),r=-1,s=i.length;++r<s;)if(!e.contains(i[r]))return!1;return!0}return this.each((typeof n=="function"?Wi:n?Gi:Qi)(i,n))}function Ji(){this.textContent=""}function ji(t){return function(){this.textContent=t}}function te(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function ne(t){return arguments.length?this.each(t==null?Ji:(typeof t=="function"?te:ji)(t)):this.node().textContent}function ie(){this.innerHTML=""}function ee(t){return function(){this.innerHTML=t}}function re(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function se(t){return arguments.length?this.each(t==null?ie:(typeof t=="function"?re:ee)(t)):this.node().innerHTML}function oe(){this.nextSibling&&this.parentNode.appendChild(this)}function ae(){return this.each(oe)}function he(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ue(){return this.each(he)}function le(t){var n=typeof t=="function"?t:ln(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function ce(){return null}function fe(t,n){var i=typeof t=="function"?t:ln(t),e=n==null?ce:typeof n=="function"?n:St(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),e.apply(this,arguments)||null)})}function _e(){var t=this.parentNode;t&&t.removeChild(this)}function pe(){return this.each(_e)}function xe(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function de(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ye(t){return this.select(t?de:xe)}function we(t){return arguments.length?this.property("__data__",t):this.node().__data__}function ve(t){return function(n){t.call(this,n,this.__data__)}}function ge(t){return t.trim().split(/^|\s+/).map(function(n){var i="",e=n.indexOf(".");return e>=0&&(i=n.slice(e+1),n=n.slice(0,e)),{type:n,name:i}})}function me(t){return function(){var n=this.__on;if(n){for(var i=0,e=-1,r=n.length,s;i<r;++i)s=n[i],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):n[++e]=s;++e?n.length=e:delete this.__on}}}function be(t,n,i){return function(){var e=this.__on,r,s=ve(n);if(e){for(var o=0,a=e.length;o<a;++o)if((r=e[o]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=i),r.value=n;return}}this.addEventListener(t.type,s,i),r={type:t.type,name:t.name,value:n,listener:s,options:i},e?e.push(r):this.__on=[r]}}function Ne(t,n,i){var e=ge(t+""),r,s=e.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var h=0,u=a.length,l;h<u;++h)for(r=0,l=a[h];r<s;++r)if((o=e[r]).type===l.type&&o.name===l.name)return l.value}return}for(a=n?be:me,r=0;r<s;++r)this.each(a(e[r],n,i));return this}function gn(t,n,i){var e=xn(t),r=e.CustomEvent;typeof r=="function"?r=new r(n,i):(r=e.document.createEvent("Event"),i?(r.initEvent(n,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(n,!1,!1)),t.dispatchEvent(r)}function ke(t,n){return function(){return gn(this,t,n)}}function $e(t,n){return function(){return gn(this,t,n.apply(this,arguments))}}function Te(t,n){return this.each((typeof n=="function"?$e:ke)(t,n))}function*Ee(){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var e=t[n],r=0,s=e.length,o;r<s;++r)(o=e[r])&&(yield o)}var mn=[null];function y(t,n){this._groups=t,this._parents=n}function K(){return new y([[document.documentElement]],mn)}function Se(){return this}y.prototype=K.prototype={constructor:y,select:ti,selectAll:ri,selectChild:hi,selectChildren:fi,filter:_i,data:vi,enter:pi,exit:mi,join:bi,merge:Ni,selection:Se,order:ki,sort:$i,call:Ei,nodes:Si,node:Ai,size:Ci,empty:Mi,each:Ri,attr:Xi,style:zi,property:Ki,classed:Zi,text:ne,html:se,raise:ae,lower:ue,append:le,insert:fe,remove:pe,clone:ye,datum:we,on:Ne,dispatch:Te,[Symbol.iterator]:Ee};function ds(t){return typeof t=="string"?new y([[document.querySelector(t)]],[document.documentElement]):new y([[t]],mn)}function Ct(t,n,i){t.prototype=n.prototype=i,i.constructor=t}function bn(t,n){var i=Object.create(t.prototype);for(var e in n)i[e]=n[e];return i}function G(){}var z=.7,et=1/z,q="\\s*([+-]?\\d+)\\s*",Y="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",g="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ae=/^#([0-9a-f]{3,8})$/,Ce=new RegExp(`^rgb\\(${q},${q},${q}\\)$`),Me=new RegExp(`^rgb\\(${g},${g},${g}\\)$`),Re=new RegExp(`^rgba\\(${q},${q},${q},${Y}\\)$`),Pe=new RegExp(`^rgba\\(${g},${g},${g},${Y}\\)$`),Ie=new RegExp(`^hsl\\(${Y},${g},${g}\\)$`),qe=new RegExp(`^hsla\\(${Y},${g},${g},${Y}\\)$`),Dt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ct(G,V,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:zt,formatHex:zt,formatHex8:Fe,formatHsl:Le,formatRgb:Yt,toString:Yt});function zt(){return this.rgb().formatHex()}function Fe(){return this.rgb().formatHex8()}function Le(){return Nn(this).formatHsl()}function Yt(){return this.rgb().formatRgb()}function V(t){var n,i;return t=(t+"").trim().toLowerCase(),(n=Ae.exec(t))?(i=n[1].length,n=parseInt(n[1],16),i===6?Vt(n):i===3?new d(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?W(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?W(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Ce.exec(t))?new d(n[1],n[2],n[3],1):(n=Me.exec(t))?new d(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Re.exec(t))?W(n[1],n[2],n[3],n[4]):(n=Pe.exec(t))?W(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Ie.exec(t))?Gt(n[1],n[2]/100,n[3]/100,1):(n=qe.exec(t))?Gt(n[1],n[2]/100,n[3]/100,n[4]):Dt.hasOwnProperty(t)?Vt(Dt[t]):t==="transparent"?new d(NaN,NaN,NaN,0):null}function Vt(t){return new d(t>>16&255,t>>8&255,t&255,1)}function W(t,n,i,e){return e<=0&&(t=n=i=NaN),new d(t,n,i,e)}function Oe(t){return t instanceof G||(t=V(t)),t?(t=t.rgb(),new d(t.r,t.g,t.b,t.opacity)):new d}function gt(t,n,i,e){return arguments.length===1?Oe(t):new d(t,n,i,e??1)}function d(t,n,i,e){this.r=+t,this.g=+n,this.b=+i,this.opacity=+e}Ct(d,gt,bn(G,{brighter(t){return t=t==null?et:Math.pow(et,t),new d(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?z:Math.pow(z,t),new d(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new d(M(this.r),M(this.g),M(this.b),rt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ut,formatHex:Ut,formatHex8:Xe,formatRgb:Kt,toString:Kt}));function Ut(){return`#${C(this.r)}${C(this.g)}${C(this.b)}`}function Xe(){return`#${C(this.r)}${C(this.g)}${C(this.b)}${C((isNaN(this.opacity)?1:this.opacity)*255)}`}function Kt(){const t=rt(this.opacity);return`${t===1?"rgb(":"rgba("}${M(this.r)}, ${M(this.g)}, ${M(this.b)}${t===1?")":`, ${t})`}`}function rt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function M(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function C(t){return t=M(t),(t<16?"0":"")+t.toString(16)}function Gt(t,n,i,e){return e<=0?t=n=i=NaN:i<=0||i>=1?t=n=NaN:n<=0&&(t=NaN),new w(t,n,i,e)}function Nn(t){if(t instanceof w)return new w(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=V(t)),!t)return new w;if(t instanceof w)return t;t=t.rgb();var n=t.r/255,i=t.g/255,e=t.b/255,r=Math.min(n,i,e),s=Math.max(n,i,e),o=NaN,a=s-r,h=(s+r)/2;return a?(n===s?o=(i-e)/a+(i<e)*6:i===s?o=(e-n)/a+2:o=(n-i)/a+4,a/=h<.5?s+r:2-s-r,o*=60):a=h>0&&h<1?0:o,new w(o,a,h,t.opacity)}function He(t,n,i,e){return arguments.length===1?Nn(t):new w(t,n,i,e??1)}function w(t,n,i,e){this.h=+t,this.s=+n,this.l=+i,this.opacity=+e}Ct(w,He,bn(G,{brighter(t){return t=t==null?et:Math.pow(et,t),new w(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?z:Math.pow(z,t),new w(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,e=i+(i<.5?i:1-i)*n,r=2*i-e;return new d(dt(t>=240?t-240:t+120,r,e),dt(t,r,e),dt(t<120?t+240:t-120,r,e),this.opacity)},clamp(){return new w(Qt(this.h),Z(this.s),Z(this.l),rt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=rt(this.opacity);return`${t===1?"hsl(":"hsla("}${Qt(this.h)}, ${Z(this.s)*100}%, ${Z(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Qt(t){return t=(t||0)%360,t<0?t+360:t}function Z(t){return Math.max(0,Math.min(1,t||0))}function dt(t,n,i){return(t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n)*255}const Mt=t=>()=>t;function kn(t,n){return function(i){return t+i*n}}function Be(t,n,i){return t=Math.pow(t,i),n=Math.pow(n,i)-t,i=1/i,function(e){return Math.pow(t+e*n,i)}}function ys(t,n){var i=n-t;return i?kn(t,i>180||i<-180?i-360*Math.round(i/360):i):Mt(isNaN(t)?n:t)}function De(t){return(t=+t)==1?$n:function(n,i){return i-n?Be(n,i,t):Mt(isNaN(n)?i:n)}}function $n(t,n){var i=n-t;return i?kn(t,i):Mt(isNaN(t)?n:t)}const Wt=(function t(n){var i=De(n);function e(r,s){var o=i((r=gt(r)).r,(s=gt(s)).r),a=i(r.g,s.g),h=i(r.b,s.b),u=$n(r.opacity,s.opacity);return function(l){return r.r=o(l),r.g=a(l),r.b=h(l),r.opacity=u(l),r+""}}return e.gamma=t,e})(1);function T(t,n){return t=+t,n=+n,function(i){return t*(1-i)+n*i}}var mt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yt=new RegExp(mt.source,"g");function ze(t){return function(){return t}}function Ye(t){return function(n){return t(n)+""}}function Ve(t,n){var i=mt.lastIndex=yt.lastIndex=0,e,r,s,o=-1,a=[],h=[];for(t=t+"",n=n+"";(e=mt.exec(t))&&(r=yt.exec(n));)(s=r.index)>i&&(s=n.slice(i,s),a[o]?a[o]+=s:a[++o]=s),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,h.push({i:o,x:T(e,r)})),i=yt.lastIndex;return i<n.length&&(s=n.slice(i),a[o]?a[o]+=s:a[++o]=s),a.length<2?h[0]?Ye(h[0].x):ze(n):(n=h.length,function(u){for(var l=0,c;l<n;++l)a[(c=h[l]).i]=c.x(u);return a.join("")})}var Zt=180/Math.PI,bt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tn(t,n,i,e,r,s){var o,a,h;return(o=Math.sqrt(t*t+n*n))&&(t/=o,n/=o),(h=t*i+n*e)&&(i-=t*h,e-=n*h),(a=Math.sqrt(i*i+e*e))&&(i/=a,e/=a,h/=a),t*e<n*i&&(t=-t,n=-n,h=-h,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(n,t)*Zt,skewX:Math.atan(h)*Zt,scaleX:o,scaleY:a}}var J;function Ue(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?bt:Tn(n.a,n.b,n.c,n.d,n.e,n.f)}function Ke(t){return t==null||(J||(J=document.createElementNS("http://www.w3.org/2000/svg","g")),J.setAttribute("transform",t),!(t=J.transform.baseVal.consolidate()))?bt:(t=t.matrix,Tn(t.a,t.b,t.c,t.d,t.e,t.f))}function En(t,n,i,e){function r(u){return u.length?u.pop()+" ":""}function s(u,l,c,f,_,p){if(u!==c||l!==f){var x=_.push("translate(",null,n,null,i);p.push({i:x-4,x:T(u,c)},{i:x-2,x:T(l,f)})}else(c||f)&&_.push("translate("+c+n+f+i)}function o(u,l,c,f){u!==l?(u-l>180?l+=360:l-u>180&&(u+=360),f.push({i:c.push(r(c)+"rotate(",null,e)-2,x:T(u,l)})):l&&c.push(r(c)+"rotate("+l+e)}function a(u,l,c,f){u!==l?f.push({i:c.push(r(c)+"skewX(",null,e)-2,x:T(u,l)}):l&&c.push(r(c)+"skewX("+l+e)}function h(u,l,c,f,_,p){if(u!==c||l!==f){var x=_.push(r(_)+"scale(",null,",",null,")");p.push({i:x-4,x:T(u,c)},{i:x-2,x:T(l,f)})}else(c!==1||f!==1)&&_.push(r(_)+"scale("+c+","+f+")")}return function(u,l){var c=[],f=[];return u=t(u),l=t(l),s(u.translateX,u.translateY,l.translateX,l.translateY,c,f),o(u.rotate,l.rotate,c,f),a(u.skewX,l.skewX,c,f),h(u.scaleX,u.scaleY,l.scaleX,l.scaleY,c,f),u=l=null,function(_){for(var p=-1,x=f.length,b;++p<x;)c[(b=f[p]).i]=b.x(_);return c.join("")}}}var Ge=En(Ue,"px, ","px)","deg)"),Qe=En(Ke,", ",")",")"),L=0,H=0,X=0,Sn=1e3,st,B,ot=0,R=0,ft=0,U=typeof performance=="object"&&performance.now?performance:Date,An=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Rt(){return R||(An(We),R=U.now()+ft)}function We(){R=0}function at(){this._call=this._time=this._next=null}at.prototype=Cn.prototype={constructor:at,restart:function(t,n,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Rt():+i)+(n==null?0:+n),!this._next&&B!==this&&(B?B._next=this:st=this,B=this),this._call=t,this._time=i,Nt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nt())}};function Cn(t,n,i){var e=new at;return e.restart(t,n,i),e}function Ze(){Rt(),++L;for(var t=st,n;t;)(n=R-t._time)>=0&&t._call.call(void 0,n),t=t._next;--L}function Jt(){R=(ot=U.now())+ft,L=H=0;try{Ze()}finally{L=0,je(),R=0}}function Je(){var t=U.now(),n=t-ot;n>Sn&&(ft-=n,ot=t)}function je(){for(var t,n=st,i,e=1/0;n;)n._call?(e>n._time&&(e=n._time),t=n,n=n._next):(i=n._next,n._next=null,n=t?t._next=i:st=i);B=t,Nt(e)}function Nt(t){if(!L){H&&(H=clearTimeout(H));var n=t-R;n>24?(t<1/0&&(H=setTimeout(Jt,t-U.now()-ft)),X&&(X=clearInterval(X))):(X||(ot=U.now(),X=setInterval(Je,Sn)),L=1,An(Jt))}}function jt(t,n,i){var e=new at;return n=n==null?0:+n,e.restart(r=>{e.stop(),t(r+n)},n,i),e}var tr=un("start","end","cancel","interrupt"),nr=[],Mn=0,tn=1,kt=2,tt=3,nn=4,$t=5,nt=6;function _t(t,n,i,e,r,s){var o=t.__transition;if(!o)t.__transition={};else if(i in o)return;ir(t,i,{name:n,index:e,group:r,on:tr,tween:nr,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Mn})}function Pt(t,n){var i=v(t,n);if(i.state>Mn)throw new Error("too late; already scheduled");return i}function m(t,n){var i=v(t,n);if(i.state>tt)throw new Error("too late; already running");return i}function v(t,n){var i=t.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function ir(t,n,i){var e=t.__transition,r;e[n]=i,i.timer=Cn(s,0,i.time);function s(u){i.state=tn,i.timer.restart(o,i.delay,i.time),i.delay<=u&&o(u-i.delay)}function o(u){var l,c,f,_;if(i.state!==tn)return h();for(l in e)if(_=e[l],_.name===i.name){if(_.state===tt)return jt(o);_.state===nn?(_.state=nt,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete e[l]):+l<n&&(_.state=nt,_.timer.stop(),_.on.call("cancel",t,t.__data__,_.index,_.group),delete e[l])}if(jt(function(){i.state===tt&&(i.state=nn,i.timer.restart(a,i.delay,i.time),a(u))}),i.state=kt,i.on.call("start",t,t.__data__,i.index,i.group),i.state===kt){for(i.state=tt,r=new Array(f=i.tween.length),l=0,c=-1;l<f;++l)(_=i.tween[l].value.call(t,t.__data__,i.index,i.group))&&(r[++c]=_);r.length=c+1}}function a(u){for(var l=u<i.duration?i.ease.call(null,u/i.duration):(i.timer.restart(h),i.state=$t,1),c=-1,f=r.length;++c<f;)r[c].call(t,l);i.state===$t&&(i.on.call("end",t,t.__data__,i.index,i.group),h())}function h(){i.state=nt,i.timer.stop(),delete e[n];for(var u in e)return;delete t.__transition}}function er(t,n){var i=t.__transition,e,r,s=!0,o;if(i){n=n==null?null:n+"";for(o in i){if((e=i[o]).name!==n){s=!1;continue}r=e.state>kt&&e.state<$t,e.state=nt,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete i[o]}s&&delete t.__transition}}function rr(t){return this.each(function(){er(this,t)})}function sr(t,n){var i,e;return function(){var r=m(this,t),s=r.tween;if(s!==i){e=i=s;for(var o=0,a=e.length;o<a;++o)if(e[o].name===n){e=e.slice(),e.splice(o,1);break}}r.tween=e}}function or(t,n,i){var e,r;if(typeof i!="function")throw new Error;return function(){var s=m(this,t),o=s.tween;if(o!==e){r=(e=o).slice();for(var a={name:n,value:i},h=0,u=r.length;h<u;++h)if(r[h].name===n){r[h]=a;break}h===u&&r.push(a)}s.tween=r}}function ar(t,n){var i=this._id;if(t+="",arguments.length<2){for(var e=v(this.node(),i).tween,r=0,s=e.length,o;r<s;++r)if((o=e[r]).name===t)return o.value;return null}return this.each((n==null?sr:or)(i,t,n))}function It(t,n,i){var e=t._id;return t.each(function(){var r=m(this,e);(r.value||(r.value={}))[n]=i.apply(this,arguments)}),function(r){return v(r,e).value[n]}}function Rn(t,n){var i;return(typeof n=="number"?T:n instanceof V?Wt:(i=V(n))?(n=i,Wt):Ve)(t,n)}function hr(t){return function(){this.removeAttribute(t)}}function ur(t){return function(){this.removeAttributeNS(t.space,t.local)}}function lr(t,n,i){var e,r=i+"",s;return function(){var o=this.getAttribute(t);return o===r?null:o===e?s:s=n(e=o,i)}}function cr(t,n,i){var e,r=i+"",s;return function(){var o=this.getAttributeNS(t.space,t.local);return o===r?null:o===e?s:s=n(e=o,i)}}function fr(t,n,i){var e,r,s;return function(){var o,a=i(this),h;return a==null?void this.removeAttribute(t):(o=this.getAttribute(t),h=a+"",o===h?null:o===e&&h===r?s:(r=h,s=n(e=o,a)))}}function _r(t,n,i){var e,r,s;return function(){var o,a=i(this),h;return a==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),h=a+"",o===h?null:o===e&&h===r?s:(r=h,s=n(e=o,a)))}}function pr(t,n){var i=ct(t),e=i==="transform"?Qe:Rn;return this.attrTween(t,typeof n=="function"?(i.local?_r:fr)(i,e,It(this,"attr."+t,n)):n==null?(i.local?ur:hr)(i):(i.local?cr:lr)(i,e,n))}function xr(t,n){return function(i){this.setAttribute(t,n.call(this,i))}}function dr(t,n){return function(i){this.setAttributeNS(t.space,t.local,n.call(this,i))}}function yr(t,n){var i,e;function r(){var s=n.apply(this,arguments);return s!==e&&(i=(e=s)&&dr(t,s)),i}return r._value=n,r}function wr(t,n){var i,e;function r(){var s=n.apply(this,arguments);return s!==e&&(i=(e=s)&&xr(t,s)),i}return r._value=n,r}function vr(t,n){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var e=ct(t);return this.tween(i,(e.local?yr:wr)(e,n))}function gr(t,n){return function(){Pt(this,t).delay=+n.apply(this,arguments)}}function mr(t,n){return n=+n,function(){Pt(this,t).delay=n}}function br(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?gr:mr)(n,t)):v(this.node(),n).delay}function Nr(t,n){return function(){m(this,t).duration=+n.apply(this,arguments)}}function kr(t,n){return n=+n,function(){m(this,t).duration=n}}function $r(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?Nr:kr)(n,t)):v(this.node(),n).duration}function Tr(t,n){if(typeof n!="function")throw new Error;return function(){m(this,t).ease=n}}function Er(t){var n=this._id;return arguments.length?this.each(Tr(n,t)):v(this.node(),n).ease}function Sr(t,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;m(this,t).ease=i}}function Ar(t){if(typeof t!="function")throw new Error;return this.each(Sr(this._id,t))}function Cr(t){typeof t!="function"&&(t=fn(t));for(var n=this._groups,i=n.length,e=new Array(i),r=0;r<i;++r)for(var s=n[r],o=s.length,a=e[r]=[],h,u=0;u<o;++u)(h=s[u])&&t.call(h,h.__data__,u,s)&&a.push(h);return new k(e,this._parents,this._name,this._id)}function Mr(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,i=t._groups,e=n.length,r=i.length,s=Math.min(e,r),o=new Array(e),a=0;a<s;++a)for(var h=n[a],u=i[a],l=h.length,c=o[a]=new Array(l),f,_=0;_<l;++_)(f=h[_]||u[_])&&(c[_]=f);for(;a<e;++a)o[a]=n[a];return new k(o,this._parents,this._name,this._id)}function Rr(t){return(t+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function Pr(t,n,i){var e,r,s=Rr(n)?Pt:m;return function(){var o=s(this,t),a=o.on;a!==e&&(r=(e=a).copy()).on(n,i),o.on=r}}function Ir(t,n){var i=this._id;return arguments.length<2?v(this.node(),i).on.on(t):this.each(Pr(i,t,n))}function qr(t){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==t)return;n&&n.removeChild(this)}}function Fr(){return this.on("end.remove",qr(this._id))}function Lr(t){var n=this._name,i=this._id;typeof t!="function"&&(t=St(t));for(var e=this._groups,r=e.length,s=new Array(r),o=0;o<r;++o)for(var a=e[o],h=a.length,u=s[o]=new Array(h),l,c,f=0;f<h;++f)(l=a[f])&&(c=t.call(l,l.__data__,f,a))&&("__data__"in l&&(c.__data__=l.__data__),u[f]=c,_t(u[f],n,i,f,u,v(l,i)));return new k(s,this._parents,n,i)}function Or(t){var n=this._name,i=this._id;typeof t!="function"&&(t=cn(t));for(var e=this._groups,r=e.length,s=[],o=[],a=0;a<r;++a)for(var h=e[a],u=h.length,l,c=0;c<u;++c)if(l=h[c]){for(var f=t.call(l,l.__data__,c,h),_,p=v(l,i),x=0,b=f.length;x<b;++x)(_=f[x])&&_t(_,n,i,x,f,p);s.push(f),o.push(l)}return new k(s,o,n,i)}var Xr=K.prototype.constructor;function Hr(){return new Xr(this._groups,this._parents)}function Br(t,n){var i,e,r;return function(){var s=F(this,t),o=(this.style.removeProperty(t),F(this,t));return s===o?null:s===i&&o===e?r:r=n(i=s,e=o)}}function Pn(t){return function(){this.style.removeProperty(t)}}function Dr(t,n,i){var e,r=i+"",s;return function(){var o=F(this,t);return o===r?null:o===e?s:s=n(e=o,i)}}function zr(t,n,i){var e,r,s;return function(){var o=F(this,t),a=i(this),h=a+"";return a==null&&(h=a=(this.style.removeProperty(t),F(this,t))),o===h?null:o===e&&h===r?s:(r=h,s=n(e=o,a))}}function Yr(t,n){var i,e,r,s="style."+n,o="end."+s,a;return function(){var h=m(this,t),u=h.on,l=h.value[s]==null?a||(a=Pn(n)):void 0;(u!==i||r!==l)&&(e=(i=u).copy()).on(o,r=l),h.on=e}}function Vr(t,n,i){var e=(t+="")=="transform"?Ge:Rn;return n==null?this.styleTween(t,Br(t,e)).on("end.style."+t,Pn(t)):typeof n=="function"?this.styleTween(t,zr(t,e,It(this,"style."+t,n))).each(Yr(this._id,t)):this.styleTween(t,Dr(t,e,n),i).on("end.style."+t,null)}function Ur(t,n,i){return function(e){this.style.setProperty(t,n.call(this,e),i)}}function Kr(t,n,i){var e,r;function s(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&Ur(t,o,i)),e}return s._value=n,s}function Gr(t,n,i){var e="style."+(t+="");if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;return this.tween(e,Kr(t,n,i??""))}function Qr(t){return function(){this.textContent=t}}function Wr(t){return function(){var n=t(this);this.textContent=n??""}}function Zr(t){return this.tween("text",typeof t=="function"?Wr(It(this,"text",t)):Qr(t==null?"":t+""))}function Jr(t){return function(n){this.textContent=t.call(this,n)}}function jr(t){var n,i;function e(){var r=t.apply(this,arguments);return r!==i&&(n=(i=r)&&Jr(r)),n}return e._value=t,e}function ts(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,jr(t))}function ns(){for(var t=this._name,n=this._id,i=In(),e=this._groups,r=e.length,s=0;s<r;++s)for(var o=e[s],a=o.length,h,u=0;u<a;++u)if(h=o[u]){var l=v(h,n);_t(h,t,i,u,o,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new k(e,this._parents,t,i)}function is(){var t,n,i=this,e=i._id,r=i.size();return new Promise(function(s,o){var a={value:o},h={value:function(){--r===0&&s()}};i.each(function(){var u=m(this,e),l=u.on;l!==t&&(n=(t=l).copy(),n._.cancel.push(a),n._.interrupt.push(a),n._.end.push(h)),u.on=n}),r===0&&s()})}var es=0;function k(t,n,i,e){this._groups=t,this._parents=n,this._name=i,this._id=e}function In(){return++es}var N=K.prototype;k.prototype={constructor:k,select:Lr,selectAll:Or,selectChild:N.selectChild,selectChildren:N.selectChildren,filter:Cr,merge:Mr,selection:Hr,transition:ns,call:N.call,nodes:N.nodes,node:N.node,size:N.size,empty:N.empty,each:N.each,on:Ir,attr:pr,attrTween:vr,style:Vr,styleTween:Gr,text:Zr,textTween:ts,remove:Fr,tween:ar,delay:br,duration:$r,ease:Er,easeVarying:Ar,end:is,[Symbol.iterator]:N[Symbol.iterator]};function rs(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ss={time:null,delay:0,duration:250,ease:rs};function os(t,n){for(var i;!(i=t.__transition)||!(i=i[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return i}function as(t){var n,i;t instanceof k?(n=t._id,t=t._name):(n=In(),(i=ss).time=Rt(),t=t==null?null:t+"");for(var e=this._groups,r=e.length,s=0;s<r;++s)for(var o=e[s],a=o.length,h,u=0;u<a;++u)(h=o[u])&&_t(h,t,n,u,o,i||os(h,n));return new k(e,this._parents,t,n)}K.prototype.interrupt=rr;K.prototype.transition=as;const Tt=Math.PI,Et=2*Tt,A=1e-6,hs=Et-A;function qn(t){this._+=t[0];for(let n=1,i=t.length;n<i;++n)this._+=arguments[n]+t[n]}function us(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return qn;const i=10**n;return function(e){this._+=e[0];for(let r=1,s=e.length;r<s;++r)this._+=Math.round(arguments[r]*i)/i+e[r]}}class ls{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?qn:us(n)}moveTo(n,i){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,i){this._append`L${this._x1=+n},${this._y1=+i}`}quadraticCurveTo(n,i,e,r){this._append`Q${+n},${+i},${this._x1=+e},${this._y1=+r}`}bezierCurveTo(n,i,e,r,s,o){this._append`C${+n},${+i},${+e},${+r},${this._x1=+s},${this._y1=+o}`}arcTo(n,i,e,r,s){if(n=+n,i=+i,e=+e,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,h=e-n,u=r-i,l=o-n,c=a-i,f=l*l+c*c;if(this._x1===null)this._append`M${this._x1=n},${this._y1=i}`;else if(f>A)if(!(Math.abs(c*h-u*l)>A)||!s)this._append`L${this._x1=n},${this._y1=i}`;else{let _=e-o,p=r-a,x=h*h+u*u,b=_*_+p*p,Q=Math.sqrt(x),$=Math.sqrt(f),S=s*Math.tan((Tt-Math.acos((x+f-b)/(2*Q*$)))/2),P=S/$,O=S/Q;Math.abs(P-1)>A&&this._append`L${n+P*l},${i+P*c}`,this._append`A${s},${s},0,0,${+(c*_>l*p)},${this._x1=n+O*h},${this._y1=i+O*u}`}}arc(n,i,e,r,s,o){if(n=+n,i=+i,e=+e,o=!!o,e<0)throw new Error(`negative radius: ${e}`);let a=e*Math.cos(r),h=e*Math.sin(r),u=n+a,l=i+h,c=1^o,f=o?r-s:s-r;this._x1===null?this._append`M${u},${l}`:(Math.abs(this._x1-u)>A||Math.abs(this._y1-l)>A)&&this._append`L${u},${l}`,e&&(f<0&&(f=f%Et+Et),f>hs?this._append`A${e},${e},0,1,${c},${n-a},${i-h}A${e},${e},0,1,${c},${this._x1=u},${this._y1=l}`:f>A&&this._append`A${e},${e},0,${+(f>=Tt)},${c},${this._x1=n+e*Math.cos(s)},${this._y1=i+e*Math.sin(s)}`)}rect(n,i,e,r){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}h${e=+e}v${+r}h${-e}Z`}toString(){return this._}}function I(t){return function(){return t}}const ws=Math.abs,vs=Math.atan2,gs=Math.cos,ms=Math.max,bs=Math.min,Ns=Math.sin,ks=Math.sqrt,en=1e-12,qt=Math.PI,rn=qt/2,$s=2*qt;function Ts(t){return t>1?0:t<-1?qt:Math.acos(t)}function Es(t){return t>=1?rn:t<=-1?-rn:Math.asin(t)}function cs(t){let n=3;return t.digits=function(i){if(!arguments.length)return n;if(i==null)n=null;else{const e=Math.floor(i);if(!(e>=0))throw new RangeError(`invalid digits: ${i}`);n=e}return t},()=>new ls(n)}function fs(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Fn(t){this._context=t}Fn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function _s(t){return new Fn(t)}function ps(t){return t[0]}function xs(t){return t[1]}function Ss(t,n){var i=I(!0),e=null,r=_s,s=null,o=cs(a);t=typeof t=="function"?t:t===void 0?ps:I(t),n=typeof n=="function"?n:n===void 0?xs:I(n);function a(h){var u,l=(h=fs(h)).length,c,f=!1,_;for(e==null&&(s=r(_=o())),u=0;u<=l;++u)!(u<l&&i(c=h[u],u,h))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+t(c,u,h),+n(c,u,h));if(_)return s=null,_+""||null}return a.x=function(h){return arguments.length?(t=typeof h=="function"?h:I(+h),a):t},a.y=function(h){return arguments.length?(n=typeof h=="function"?h:I(+h),a):n},a.defined=function(h){return arguments.length?(i=typeof h=="function"?h:I(!!h),a):i},a.curve=function(h){return arguments.length?(r=h,e!=null&&(s=r(e)),a):r},a.context=function(h){return arguments.length?(h==null?e=s=null:s=r(e=h),a):e},a}class Ln{constructor(n,i){this._context=n,this._x=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(n,i){switch(n=+n,i=+i,this._point){case 0:{this._point=1,this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+n)/2,this._y0,this._x0,i,n,i):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+i)/2,n,this._y0,n,i);break}}this._x0=n,this._y0=i}}function As(t){return new Ln(t,!0)}function Cs(t){return new Ln(t,!1)}function E(){}function ht(t,n,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+i)/6)}function pt(t){this._context=t}pt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ht(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ht(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Ms(t){return new pt(t)}function On(t){this._context=t}On.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:ht(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Rs(t){return new On(t)}function Xn(t){this._context=t}Xn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break;case 3:this._point=4;default:ht(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Ps(t){return new Xn(t)}function Hn(t,n){this._basis=new pt(t),this._beta=n}Hn.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,i=t.length-1;if(i>0)for(var e=t[0],r=n[0],s=t[i]-e,o=n[i]-r,a=-1,h;++a<=i;)h=a/i,this._basis.point(this._beta*t[a]+(1-this._beta)*(e+h*s),this._beta*n[a]+(1-this._beta)*(r+h*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};const Is=(function t(n){function i(e){return n===1?new pt(e):new Hn(e,n)}return i.beta=function(e){return t(+e)},i})(.85);function ut(t,n,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Ft(t,n){this._context=t,this._k=(1-n)/6}Ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ut(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:ut(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const qs=(function t(n){function i(e){return new Ft(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Lt(t,n){this._context=t,this._k=(1-n)/6}Lt.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:ut(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Fs=(function t(n){function i(e){return new Lt(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Ot(t,n){this._context=t,this._k=(1-n)/6}Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ut(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Ls=(function t(n){function i(e){return new Ot(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Xt(t,n,i){var e=t._x1,r=t._y1,s=t._x2,o=t._y2;if(t._l01_a>en){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,h=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/h,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/h}if(t._l23_a>en){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*u+t._x1*t._l23_2a-n*t._l12_2a)/l,o=(o*u+t._y1*t._l23_2a-i*t._l12_2a)/l}t._context.bezierCurveTo(e,r,s,o,t._x2,t._y2)}function Bn(t,n){this._context=t,this._alpha=n}Bn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Xt(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Os=(function t(n){function i(e){return n?new Bn(e,n):new Ft(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Dn(t,n){this._context=t,this._alpha=n}Dn.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Xt(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Xs=(function t(n){function i(e){return n?new Dn(e,n):new Lt(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function zn(t,n){this._context=t,this._alpha=n}zn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xt(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Hs=(function t(n){function i(e){return n?new zn(e,n):new Ot(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Yn(t){this._context=t}Yn.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};function Bs(t){return new Yn(t)}function sn(t){return t<0?-1:1}function on(t,n,i){var e=t._x1-t._x0,r=n-t._x1,s=(t._y1-t._y0)/(e||r<0&&-0),o=(i-t._y1)/(r||e<0&&-0),a=(s*r+o*e)/(e+r);return(sn(s)+sn(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function an(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function wt(t,n,i){var e=t._x0,r=t._y0,s=t._x1,o=t._y1,a=(s-e)/3;t._context.bezierCurveTo(e+a,r+a*n,s-a,o-a*i,s,o)}function lt(t){this._context=t}lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wt(this,this._t0,an(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var i=NaN;if(t=+t,n=+n,!(t===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,wt(this,an(this,i=on(this,t,n)),i);break;default:wt(this,this._t0,i=on(this,t,n));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=i}}};function Vn(t){this._context=new Un(t)}(Vn.prototype=Object.create(lt.prototype)).point=function(t,n){lt.prototype.point.call(this,n,t)};function Un(t){this._context=t}Un.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,i,e,r,s){this._context.bezierCurveTo(n,t,e,i,s,r)}};function Ds(t){return new lt(t)}function zs(t){return new Vn(t)}function Kn(t){this._context=t}Kn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),i===2)this._context.lineTo(t[1],n[1]);else for(var e=hn(t),r=hn(n),s=0,o=1;o<i;++s,++o)this._context.bezierCurveTo(e[0][s],r[0][s],e[1][s],r[1][s],t[o],n[o]);(this._line||this._line!==0&&i===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};function hn(t){var n,i=t.length-1,e,r=new Array(i),s=new Array(i),o=new Array(i);for(r[0]=0,s[0]=2,o[0]=t[0]+2*t[1],n=1;n<i-1;++n)r[n]=1,s[n]=4,o[n]=4*t[n]+2*t[n+1];for(r[i-1]=2,s[i-1]=7,o[i-1]=8*t[i-1]+t[i],n=1;n<i;++n)e=r[n]/s[n-1],s[n]-=e,o[n]-=e*o[n-1];for(r[i-1]=o[i-1]/s[i-1],n=i-2;n>=0;--n)r[n]=(o[n]-r[n+1])/s[n];for(s[i-1]=(t[i]+r[i-1])/2,n=0;n<i-1;++n)s[n]=2*t[n+1]-r[n+1];return[r,s]}function Ys(t){return new Kn(t)}function xt(t,n){this._context=t,this._t=n}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,n)}break}}this._x=t,this._y=n}};function Vs(t){return new xt(t,.5)}function Us(t){return new xt(t,0)}function Ks(t){return new xt(t,1)}function D(t,n,i){this.k=t,this.x=n,this.y=i}D.prototype={constructor:D,scale:function(t){return t===1?this:new D(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new D(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};D.prototype;export{bn as A,$n as B,G as C,ys as D,Us as E,Ks as F,Vs as G,Ys as H,zs as I,Ds as J,Bs as K,_s as L,Os as M,Hs as N,Xs as O,qs as P,Ls as Q,d as R,Fs as S,Is as T,Cs as U,As as V,Ps as W,Rs as X,Ns as a,I as b,gs as c,ks as d,en as e,ws as f,vs as g,rn as h,ms as i,Es as j,Ts as k,Ss as l,bs as m,Ms as n,fs as o,qt as p,Mt as q,T as r,ds as s,$s as t,V as u,Wt as v,cs as w,Ve as x,Oe as y,Ct as z};
@@ -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-C5zxvpoJ.js";import{_ as I}from"./mermaid-layout-elk.core-KBAfwQxu.js";import{s as xt}from"./transform-CzGDKG_M.js";import"./main-D3HpSUyK.js";import"./index-C-4sKCSr.js";import"./step-SI6FXFD6.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-0coM2jiE.js";import{_ as I}from"./mermaid-layout-elk.core-DDX9gcIM.js";import{s as xt}from"./transform-B5_amWNh.js";import"./main-Bkgg11ZB.js";import"./index-BNNZmZ7L.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(`
@@ -31,4 +31,4 @@ Expecting `+H.join(", ")+", got '"+(this.terminals_[T]||T)+"'":Z="Parse error on
31
31
  font-family: ${t.fontFamily};
32
32
  color: ${t.vennSetTextColor};
33
33
  }
34
- `,"getStyles"),Ve=Be;function Lt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}I(Lt,"buildStyleByKey");_(Lt,"buildStyleByKey");var Ge=_((t,n,s,e)=>{var q,A,V;const i=e.db,r=(q=i.getConfig)==null?void 0:q.call(i),{themeVariables:o,look:l,handDrawnSeed:h}=qt(),u=l==="handDrawn",a=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),p=(A=i.getDiagramTitle)==null?void 0:A.call(i),d=i.getSubsetData(),m=i.getTextData(),y=Lt(i.getStyleData()),S=Vt(d),z=(r==null?void 0:r.width)??800,E=(r==null?void 0:r.height)??450,g=z/1600,b=p?48*g:0,v=o.primaryTextColor??o.textColor,c=ye(n);c.attr("viewBox",`0 0 ${z} ${E}`),p&&c.append("text").text(p).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",o.vennTitleTextColor||o.titleColor);const x=xt(document.createElement("div")),f=re().width(z).height(E-b);x.datum(S).call(f);const P=u?pe.svg(x.select("svg").node()):void 0,k=ce(S,{width:z,height:E-b,padding:(r==null?void 0:r.padding)??15}),D=new Map;for(const C of k){const F=tt([...C.data.sets].sort());D.set(F,C)}m.length>0&&Bt(r,D,x,m,g,y);const J=me(o.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(C,F){var W;const B=xt(this),L=tt([...C.sets].sort()),T=y.get(L),R=(T==null?void 0:T.fill)||a[F%a.length]||o.primaryColor;B.classed(`venn-set-${F%8}`,!0);const N=(T==null?void 0:T["fill-opacity"])??.1,X=(T==null?void 0:T.stroke)||R,M=(T==null?void 0:T["stroke-width"])||`${5*g}`;if(u&&P){const $=D.get(L);if($&&$.circles.length>0){const H=$.circles[0],Z=P.circle(H.x,H.y,H.radius*2,{roughness:.7,seed:h,fill:Gt(R,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:X,strokeWidth:parseFloat(String(M))});B.select("path").remove(),(W=B.node())==null||W.insertBefore(Z,B.select("text").node())}}else B.select("path").style("fill",R).style("fill-opacity",N).style("stroke",X).style("stroke-width",M).style("stroke-opacity",.95);const O=(T==null?void 0:T.color)||(J?be(R,30):ve(R,30));B.select("text").style("font-size",`${48*g}px`).style("fill",O)}),u&&P?x.selectAll(".venn-intersection").each(function(C){var R;const F=xt(this),j=tt([...C.sets].sort()),L=y.get(j),T=L==null?void 0:L.fill;if(T){const N=F.select("path"),X=N.attr("d");if(X){const M=P.path(X,{roughness:.7,seed:h,fill:Gt(T,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),O=N.node();(R=O==null?void 0:O.parentNode)==null||R.insertBefore(M,O),N.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*g}px`).style("fill",(L==null?void 0:L.color)??o.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",C=>{var j;const B=tt([...C.sets].sort());return((j=y.get(B))==null?void 0:j.color)??o.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",C=>{var j;const B=tt([...C.sets].sort());return(j=y.get(B))!=null&&j.fill?1:0}).style("fill",C=>{var j;const B=tt([...C.sets].sort());return((j=y.get(B))==null?void 0:j.fill)??"transparent"}));const K=c.append("g").attr("transform",`translate(0, ${b})`),G=x.select("svg").node();if(G&&"childNodes"in G)for(const C of[...G.childNodes])(V=K.node())==null||V.appendChild(C);Ie(c,E,z,(r==null?void 0:r.useMaxWidth)??!0)},"draw");function tt(t){return t.join("|")}I(tt,"stableSetsKey");_(tt,"stableSetsKey");function Bt(t,n,s,e,i,r){var a;const o=(t==null?void 0:t.useDebugLayout)??!1,h=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const p of e){const d=tt(p.sets),m=u.get(d);m?m.push(p):u.set(d,[p])}for(const[p,d]of u.entries()){const m=n.get(p);if(!(m!=null&&m.text))continue;const y=m.text.x,S=m.text.y,z=Math.min(...m.circles.map(q=>q.radius)),E=Math.min(...m.circles.map(q=>q.radius-Math.hypot(y-q.x,S-q.y)));let w=Number.isFinite(E)?Math.max(0,E):0;w===0&&Number.isFinite(z)&&(w=z*.6);const g=h.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);o&&g.append("circle").attr("class","venn-text-debug-circle").attr("cx",y).attr("cy",S).attr("r",w).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const b=Math.max(80*i,w*2*.95),v=Math.max(60*i,w*2*.95),f=(m.data.label&&m.data.label.length>0?Math.min(32*i,w*.25):0)+(d.length<=2?30*i:0),P=y-b/2,k=S-v/2+f,D=Math.max(1,Math.ceil(Math.sqrt(d.length))),J=Math.max(1,Math.ceil(d.length/D)),K=b/D,G=v/J;for(const[q,A]of d.entries()){const V=q%D,C=Math.floor(q/D),F=P+K*(V+.5),B=k+G*(C+.5);o&&g.append("rect").attr("class","venn-text-debug-cell").attr("x",P+K*V).attr("y",k+G*C).attr("width",K).attr("height",G).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const j=K*.9,L=G*.9,T=g.append("foreignObject").attr("class","venn-text-node-fo").attr("width",j).attr("height",L).attr("x",F-j/2).attr("y",B-L/2).attr("overflow","visible"),R=(a=r.get(A.id))==null?void 0:a.color,N=T.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(A.label??A.id);R&&N.style("color",R)}}}I(Bt,"renderTextNodes");_(Bt,"renderTextNodes");function Vt(t){const n=new Set(t.map(i=>[...i.sets].sort().join("|"))),s=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),e=[];for(const i of t){if(i.sets.length<3)continue;const r=[...i.sets].sort();for(let o=0;o<r.length-1;o++)for(let l=o+1;l<r.length;l++){const h=[r[o],r[l]],u=h.join("|");if(!n.has(u)){n.add(u);const a=s.get(h[0]),p=s.get(h[1]),d=a!==void 0&&p!==void 0?Math.min(a,p)/4:2.5;e.push({sets:h,size:d,label:""})}}}return e.length>0?[...t,...e]:t}I(Vt,"ensurePairwiseSubsets");_(Vt,"ensurePairwiseSubsets");var qe={draw:Ge},Je={parser:we,db:Le,renderer:qe,styles:Ve};export{Je as diagram};
34
+ `,"getStyles"),Ve=Be;function Lt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}I(Lt,"buildStyleByKey");_(Lt,"buildStyleByKey");var Ge=_((t,n,s,e)=>{var q,A,V;const i=e.db,r=(q=i.getConfig)==null?void 0:q.call(i),{themeVariables:o,look:l,handDrawnSeed:h}=qt(),u=l==="handDrawn",a=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),p=(A=i.getDiagramTitle)==null?void 0:A.call(i),d=i.getSubsetData(),m=i.getTextData(),y=Lt(i.getStyleData()),S=Vt(d),z=(r==null?void 0:r.width)??800,E=(r==null?void 0:r.height)??450,g=z/1600,b=p?48*g:0,v=o.primaryTextColor??o.textColor,c=ye(n);c.attr("viewBox",`0 0 ${z} ${E}`),p&&c.append("text").text(p).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",o.vennTitleTextColor||o.titleColor);const x=xt(document.createElement("div")),f=re().width(z).height(E-b);x.datum(S).call(f);const P=u?pe.svg(x.select("svg").node()):void 0,k=ce(S,{width:z,height:E-b,padding:(r==null?void 0:r.padding)??15}),D=new Map;for(const C of k){const F=tt([...C.data.sets].sort());D.set(F,C)}m.length>0&&Bt(r,D,x,m,g,y);const J=me(o.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(C,F){var W;const B=xt(this),L=tt([...C.sets].sort()),T=y.get(L),R=(T==null?void 0:T.fill)||a[F%a.length]||o.primaryColor;B.classed(`venn-set-${F%8}`,!0);const N=(T==null?void 0:T["fill-opacity"])??.1,X=(T==null?void 0:T.stroke)||R,M=(T==null?void 0:T["stroke-width"])||`${5*g}`;if(u&&P){const $=D.get(L);if($&&$.circles.length>0){const H=$.circles[0],Z=P.circle(H.x,H.y,H.radius*2,{roughness:.7,seed:h,fill:Gt(R,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:X,strokeWidth:parseFloat(String(M))});B.select("path").remove(),(W=B.node())==null||W.insertBefore(Z,B.select("text").node())}}else B.select("path").style("fill",R).style("fill-opacity",N).style("stroke",X).style("stroke-width",M).style("stroke-opacity",.95);const O=(T==null?void 0:T.color)||(J?be(R,30):ve(R,30));B.select("text").style("font-size",`${48*g}px`).style("fill",O)}),u&&P?x.selectAll(".venn-intersection").each(function(C){var R;const F=xt(this),j=tt([...C.sets].sort()),L=y.get(j),T=L==null?void 0:L.fill;if(T){const N=F.select("path"),X=N.attr("d");if(X){const M=P.path(X,{roughness:.7,seed:h,fill:Gt(T,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),O=N.node();(R=O==null?void 0:O.parentNode)==null||R.insertBefore(M,O),N.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*g}px`).style("fill",(L==null?void 0:L.color)??o.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",C=>{var j;const B=tt([...C.sets].sort());return((j=y.get(B))==null?void 0:j.color)??o.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",C=>{var j;const B=tt([...C.sets].sort());return(j=y.get(B))!=null&&j.fill?1:0}).style("fill",C=>{var j;const B=tt([...C.sets].sort());return((j=y.get(B))==null?void 0:j.fill)??"transparent"}));const K=c.append("g").attr("transform",`translate(0, ${b})`),G=x.select("svg").node();if(G&&"childNodes"in G)for(const C of[...G.childNodes])(V=K.node())==null||V.appendChild(C);Ie(c,E,z,(r==null?void 0:r.useMaxWidth)??!0)},"draw");function tt(t){return t.join("|")}I(tt,"stableSetsKey");_(tt,"stableSetsKey");function Bt(t,n,s,e,i,r){var a;const o=(t==null?void 0:t.useDebugLayout)??!1,h=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const p of e){const d=tt(p.sets),m=u.get(d);m?m.push(p):u.set(d,[p])}for(const[p,d]of u.entries()){const m=n.get(p);if(!(m!=null&&m.text))continue;const y=m.text.x,S=m.text.y,z=Math.min(...m.circles.map(q=>q.radius)),E=Math.min(...m.circles.map(q=>q.radius-Math.hypot(y-q.x,S-q.y)));let w=Number.isFinite(E)?Math.max(0,E):0;w===0&&Number.isFinite(z)&&(w=z*.6);const g=h.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);o&&g.append("circle").attr("class","venn-text-debug-circle").attr("cx",y).attr("cy",S).attr("r",w).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const b=Math.max(80*i,w*2*.95),v=Math.max(60*i,w*2*.95),f=(m.data.label&&m.data.label.length>0?Math.min(32*i,w*.25):0)+(d.length<=2?30*i:0),P=y-b/2,k=S-v/2+f,D=Math.max(1,Math.ceil(Math.sqrt(d.length))),J=Math.max(1,Math.ceil(d.length/D)),K=b/D,G=v/J;for(const[q,A]of d.entries()){const V=q%D,C=Math.floor(q/D),F=P+K*(V+.5),B=k+G*(C+.5);o&&g.append("rect").attr("class","venn-text-debug-cell").attr("x",P+K*V).attr("y",k+G*C).attr("width",K).attr("height",G).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const j=K*.9,L=G*.9,T=g.append("foreignObject").attr("class","venn-text-node-fo").attr("width",j).attr("height",L).attr("x",F-j/2).attr("y",B-L/2).attr("overflow","visible"),R=(a=r.get(A.id))==null?void 0:a.color,N=T.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(A.label??A.id);R&&N.style("color",R)}}}I(Bt,"renderTextNodes");_(Bt,"renderTextNodes");function Vt(t){const n=new Set(t.map(i=>[...i.sets].sort().join("|"))),s=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),e=[];for(const i of t){if(i.sets.length<3)continue;const r=[...i.sets].sort();for(let o=0;o<r.length-1;o++)for(let l=o+1;l<r.length;l++){const h=[r[o],r[l]],u=h.join("|");if(!n.has(u)){n.add(u);const a=s.get(h[0]),p=s.get(h[1]),d=a!==void 0&&p!==void 0?Math.min(a,p)/4:2.5;e.push({sets:h,size:d,label:""})}}}return e.length>0?[...t,...e]:t}I(Vt,"ensurePairwiseSubsets");_(Vt,"ensurePairwiseSubsets");var qe={draw:Ge},Ze={parser:we,db:Le,renderer:qe,styles:Ve};export{Ze as diagram};
@@ -1,4 +1,4 @@
1
- import{aQ as Wt,s as Kt,g as Ht,o as Yt,n as Xt,a as Zt,b as Qt,_ as S,y as St,E as Jt,a4 as $t,S as te,T as ee,V as ne,d as se,p as ie,A as re,B as oe}from"./mermaid.core-BVbO1Vp8.js";import{s as rt}from"./transform-CzGDKG_M.js";import"./main-D3HpSUyK.js";import"./index-C-4sKCSr.js";import"./step-SI6FXFD6.js";const kt=(t,n)=>Wt(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 J(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 O=f.slice();return O.fx=f.fx,O.id=f.id,O});x.sort((f,O)=>f.id-O.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(J(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)J(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?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(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)J(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,J(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(J(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{J(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);J(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 Ct(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 Dt(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 Ot(e)}function Nt(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 Ot(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 Ot(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 O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(D=>O.has(D)));let k={},R={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Dt(I,o,d)),k=Nt(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 D=this.getAttribute("d");I.sets.length==1&&D&&!m&&(z=!0,V[I.sets[0]]=Me(D))});function q(I){return D=>{const G=I.sets.map(Q=>{let W=V[Q],X=k[Q];return W||(W={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:W.x*(1-D)+X.x*D,y:W.y*(1-D)+X.y*D,radius:W.radius*(1-D)+X.radius*D}});return wt(G,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(D=>k[D])),y);const C=_.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 C?C.on("end",ot(k,U)):C.each("end",ot(k,U)):C.each(ot(k,U)));const N=P(A.exit()).remove();typeof A.transition=="function"&&N.selectAll("path").attrTween("d",q);const Y=N.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),C.style("font-size",p),Y.style("font-size","0px")),{circles:k,textCentres:R,nodes:A,enter:F,update:_,exit:N}}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"?Ct: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{aQ as Wt,s as Kt,g as Ht,o as Yt,n as Xt,a as Zt,b as Qt,_ as S,y as St,E as Jt,a4 as $t,S as te,T as ee,V as ne,d as se,p as ie,A as re,B as oe}from"./mermaid.core-D0rh4nEj.js";import{s as rt}from"./transform-B5_amWNh.js";import"./main-Bkgg11ZB.js";import"./index-BNNZmZ7L.js";const kt=(t,n)=>Wt(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 J(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 O=f.slice();return O.fx=f.fx,O.id=f.id,O});x.sort((f,O)=>f.id-O.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(J(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)J(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?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(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)J(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,J(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(J(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{J(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);J(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 Ct(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 Dt(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 Ot(e)}function Nt(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 Ot(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 Ot(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 O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(D=>O.has(D)));let k={},R={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Dt(I,o,d)),k=Nt(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 D=this.getAttribute("d");I.sets.length==1&&D&&!m&&(z=!0,V[I.sets[0]]=Me(D))});function q(I){return D=>{const G=I.sets.map(Q=>{let W=V[Q],X=k[Q];return W||(W={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:W.x*(1-D)+X.x*D,y:W.y*(1-D)+X.y*D,radius:W.radius*(1-D)+X.radius*D}});return wt(G,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(D=>k[D])),y);const C=_.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 C?C.on("end",ot(k,U)):C.each("end",ot(k,U)):C.each(ot(k,U)));const N=P(A.exit()).remove();typeof A.transition=="function"&&N.selectAll("path").attrTween("d",q);const Y=N.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),C.style("font-size",p),Y.style("font-size","0px")),{circles:k,textCentres:R,nodes:A,enter:F,update:_,exit:N}}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"?Ct: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(`
@@ -31,4 +31,4 @@ Expecting `+W.join(", ")+", got '"+(this.terminals_[_]||_)+"'":X="Parse error on
31
31
  font-family: ${t.fontFamily};
32
32
  color: ${t.vennSetTextColor};
33
33
  }
34
- `,"getStyles"),Ve=Be;function qt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}S(qt,"buildStyleByKey");var qe=S((t,n,s,e)=>{var V,z,q;const i=e.db,r=(V=i.getConfig)==null?void 0:V.call(i),{themeVariables:o,look:l,handDrawnSeed:h}=St(),u=l==="handDrawn",a=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),p=(z=i.getDiagramTitle)==null?void 0:z.call(i),d=i.getSubsetData(),m=i.getTextData(),y=qt(i.getStyleData()),M=Gt(d),E=(r==null?void 0:r.width)??800,T=(r==null?void 0:r.height)??450,g=E/1600,b=p?48*g:0,v=o.primaryTextColor??o.textColor,c=Jt(n);c.attr("viewBox",`0 0 ${E} ${T}`),p&&c.append("text").text(p).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",o.vennTitleTextColor||o.titleColor);const x=rt(document.createElement("div")),f=ve().width(E).height(T-b);x.datum(M).call(f);const O=u?$t.svg(x.select("svg").node()):void 0,k=we(M,{width:E,height:T-b,padding:(r==null?void 0:r.padding)??15}),R=new Map;for(const A of k){const F=$([...A.data.sets].sort());R.set(F,A)}m.length>0&&Ut(r,R,x,m,g,y);const Z=te(o.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(A,F){var G;const j=rt(this),P=$([...A.sets].sort()),_=y.get(P),C=(_==null?void 0:_.fill)||a[F%a.length]||o.primaryColor;j.classed(`venn-set-${F%8}`,!0);const N=(_==null?void 0:_["fill-opacity"])??.1,Y=(_==null?void 0:_.stroke)||C,I=(_==null?void 0:_["stroke-width"])||`${5*g}`;if(u&&O){const Q=R.get(P);if(Q&&Q.circles.length>0){const W=Q.circles[0],X=O.circle(W.x,W.y,W.radius*2,{roughness:.7,seed:h,fill:kt(C,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:Y,strokeWidth:parseFloat(String(I))});j.select("path").remove(),(G=j.node())==null||G.insertBefore(X,j.select("text").node())}}else j.select("path").style("fill",C).style("fill-opacity",N).style("stroke",Y).style("stroke-width",I).style("stroke-opacity",.95);const D=(_==null?void 0:_.color)||(Z?ee(C,30):ne(C,30));j.select("text").style("font-size",`${48*g}px`).style("fill",D)}),u&&O?x.selectAll(".venn-intersection").each(function(A){var C;const F=rt(this),L=$([...A.sets].sort()),P=y.get(L),_=P==null?void 0:P.fill;if(_){const N=F.select("path"),Y=N.attr("d");if(Y){const I=O.path(Y,{roughness:.7,seed:h,fill:kt(_,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),D=N.node();(C=D==null?void 0:D.parentNode)==null||C.insertBefore(I,D),N.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*g}px`).style("fill",(P==null?void 0:P.color)??o.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",A=>{var L;const j=$([...A.sets].sort());return((L=y.get(j))==null?void 0:L.color)??o.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",A=>{var L;const j=$([...A.sets].sort());return(L=y.get(j))!=null&&L.fill?1:0}).style("fill",A=>{var L;const j=$([...A.sets].sort());return((L=y.get(j))==null?void 0:L.fill)??"transparent"}));const U=c.append("g").attr("transform",`translate(0, ${b})`),B=x.select("svg").node();if(B&&"childNodes"in B)for(const A of[...B.childNodes])(q=U.node())==null||q.appendChild(A);se(c,T,E,(r==null?void 0:r.useMaxWidth)??!0)},"draw");function $(t){return t.join("|")}S($,"stableSetsKey");function Ut(t,n,s,e,i,r){var a;const o=(t==null?void 0:t.useDebugLayout)??!1,h=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const p of e){const d=$(p.sets),m=u.get(d);m?m.push(p):u.set(d,[p])}for(const[p,d]of u.entries()){const m=n.get(p);if(!(m!=null&&m.text))continue;const y=m.text.x,M=m.text.y,E=Math.min(...m.circles.map(V=>V.radius)),T=Math.min(...m.circles.map(V=>V.radius-Math.hypot(y-V.x,M-V.y)));let w=Number.isFinite(T)?Math.max(0,T):0;w===0&&Number.isFinite(E)&&(w=E*.6);const g=h.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);o&&g.append("circle").attr("class","venn-text-debug-circle").attr("cx",y).attr("cy",M).attr("r",w).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const b=Math.max(80*i,w*2*.95),v=Math.max(60*i,w*2*.95),f=(m.data.label&&m.data.label.length>0?Math.min(32*i,w*.25):0)+(d.length<=2?30*i:0),O=y-b/2,k=M-v/2+f,R=Math.max(1,Math.ceil(Math.sqrt(d.length))),Z=Math.max(1,Math.ceil(d.length/R)),U=b/R,B=v/Z;for(const[V,z]of d.entries()){const q=V%R,A=Math.floor(V/R),F=O+U*(q+.5),j=k+B*(A+.5);o&&g.append("rect").attr("class","venn-text-debug-cell").attr("x",O+U*q).attr("y",k+B*A).attr("width",U).attr("height",B).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const L=U*.9,P=B*.9,_=g.append("foreignObject").attr("class","venn-text-node-fo").attr("width",L).attr("height",P).attr("x",F-L/2).attr("y",j-P/2).attr("overflow","visible"),C=(a=r.get(z.id))==null?void 0:a.color,N=_.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(z.label??z.id);C&&N.style("color",C)}}}S(Ut,"renderTextNodes");function Gt(t){const n=new Set(t.map(i=>[...i.sets].sort().join("|"))),s=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),e=[];for(const i of t){if(i.sets.length<3)continue;const r=[...i.sets].sort();for(let o=0;o<r.length-1;o++)for(let l=o+1;l<r.length;l++){const h=[r[o],r[l]],u=h.join("|");if(!n.has(u)){n.add(u);const a=s.get(h[0]),p=s.get(h[1]),d=a!==void 0&&p!==void 0?Math.min(a,p)/4:2.5;e.push({sets:h,size:d,label:""})}}}return e.length>0?[...t,...e]:t}S(Gt,"ensurePairwiseSubsets");var Ue={draw:qe},Xe={parser:Se,db:Pe,renderer:Ue,styles:Ve};export{Xe as diagram};
34
+ `,"getStyles"),Ve=Be;function qt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}S(qt,"buildStyleByKey");var qe=S((t,n,s,e)=>{var V,z,q;const i=e.db,r=(V=i.getConfig)==null?void 0:V.call(i),{themeVariables:o,look:l,handDrawnSeed:h}=St(),u=l==="handDrawn",a=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),p=(z=i.getDiagramTitle)==null?void 0:z.call(i),d=i.getSubsetData(),m=i.getTextData(),y=qt(i.getStyleData()),M=Gt(d),E=(r==null?void 0:r.width)??800,T=(r==null?void 0:r.height)??450,g=E/1600,b=p?48*g:0,v=o.primaryTextColor??o.textColor,c=Jt(n);c.attr("viewBox",`0 0 ${E} ${T}`),p&&c.append("text").text(p).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",o.vennTitleTextColor||o.titleColor);const x=rt(document.createElement("div")),f=ve().width(E).height(T-b);x.datum(M).call(f);const O=u?$t.svg(x.select("svg").node()):void 0,k=we(M,{width:E,height:T-b,padding:(r==null?void 0:r.padding)??15}),R=new Map;for(const A of k){const F=$([...A.data.sets].sort());R.set(F,A)}m.length>0&&Ut(r,R,x,m,g,y);const Z=te(o.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(A,F){var G;const j=rt(this),P=$([...A.sets].sort()),_=y.get(P),C=(_==null?void 0:_.fill)||a[F%a.length]||o.primaryColor;j.classed(`venn-set-${F%8}`,!0);const N=(_==null?void 0:_["fill-opacity"])??.1,Y=(_==null?void 0:_.stroke)||C,I=(_==null?void 0:_["stroke-width"])||`${5*g}`;if(u&&O){const Q=R.get(P);if(Q&&Q.circles.length>0){const W=Q.circles[0],X=O.circle(W.x,W.y,W.radius*2,{roughness:.7,seed:h,fill:kt(C,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:Y,strokeWidth:parseFloat(String(I))});j.select("path").remove(),(G=j.node())==null||G.insertBefore(X,j.select("text").node())}}else j.select("path").style("fill",C).style("fill-opacity",N).style("stroke",Y).style("stroke-width",I).style("stroke-opacity",.95);const D=(_==null?void 0:_.color)||(Z?ee(C,30):ne(C,30));j.select("text").style("font-size",`${48*g}px`).style("fill",D)}),u&&O?x.selectAll(".venn-intersection").each(function(A){var C;const F=rt(this),L=$([...A.sets].sort()),P=y.get(L),_=P==null?void 0:P.fill;if(_){const N=F.select("path"),Y=N.attr("d");if(Y){const I=O.path(Y,{roughness:.7,seed:h,fill:kt(_,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),D=N.node();(C=D==null?void 0:D.parentNode)==null||C.insertBefore(I,D),N.remove()}}else F.select("path").style("fill-opacity",0);F.select("text").style("font-size",`${48*g}px`).style("fill",(P==null?void 0:P.color)??o.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",A=>{var L;const j=$([...A.sets].sort());return((L=y.get(j))==null?void 0:L.color)??o.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",A=>{var L;const j=$([...A.sets].sort());return(L=y.get(j))!=null&&L.fill?1:0}).style("fill",A=>{var L;const j=$([...A.sets].sort());return((L=y.get(j))==null?void 0:L.fill)??"transparent"}));const U=c.append("g").attr("transform",`translate(0, ${b})`),B=x.select("svg").node();if(B&&"childNodes"in B)for(const A of[...B.childNodes])(q=U.node())==null||q.appendChild(A);se(c,T,E,(r==null?void 0:r.useMaxWidth)??!0)},"draw");function $(t){return t.join("|")}S($,"stableSetsKey");function Ut(t,n,s,e,i,r){var a;const o=(t==null?void 0:t.useDebugLayout)??!1,h=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const p of e){const d=$(p.sets),m=u.get(d);m?m.push(p):u.set(d,[p])}for(const[p,d]of u.entries()){const m=n.get(p);if(!(m!=null&&m.text))continue;const y=m.text.x,M=m.text.y,E=Math.min(...m.circles.map(V=>V.radius)),T=Math.min(...m.circles.map(V=>V.radius-Math.hypot(y-V.x,M-V.y)));let w=Number.isFinite(T)?Math.max(0,T):0;w===0&&Number.isFinite(E)&&(w=E*.6);const g=h.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);o&&g.append("circle").attr("class","venn-text-debug-circle").attr("cx",y).attr("cy",M).attr("r",w).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const b=Math.max(80*i,w*2*.95),v=Math.max(60*i,w*2*.95),f=(m.data.label&&m.data.label.length>0?Math.min(32*i,w*.25):0)+(d.length<=2?30*i:0),O=y-b/2,k=M-v/2+f,R=Math.max(1,Math.ceil(Math.sqrt(d.length))),Z=Math.max(1,Math.ceil(d.length/R)),U=b/R,B=v/Z;for(const[V,z]of d.entries()){const q=V%R,A=Math.floor(V/R),F=O+U*(q+.5),j=k+B*(A+.5);o&&g.append("rect").attr("class","venn-text-debug-cell").attr("x",O+U*q).attr("y",k+B*A).attr("width",U).attr("height",B).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const L=U*.9,P=B*.9,_=g.append("foreignObject").attr("class","venn-text-node-fo").attr("width",L).attr("height",P).attr("x",F-L/2).attr("y",j-P/2).attr("overflow","visible"),C=(a=r.get(z.id))==null?void 0:a.color,N=_.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(z.label??z.id);C&&N.style("color",C)}}}S(Ut,"renderTextNodes");function Gt(t){const n=new Set(t.map(i=>[...i.sets].sort().join("|"))),s=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),e=[];for(const i of t){if(i.sets.length<3)continue;const r=[...i.sets].sort();for(let o=0;o<r.length-1;o++)for(let l=o+1;l<r.length;l++){const h=[r[o],r[l]],u=h.join("|");if(!n.has(u)){n.add(u);const a=s.get(h[0]),p=s.get(h[1]),d=a!==void 0&&p!==void 0?Math.min(a,p)/4:2.5;e.push({sets:h,size:d,label:""})}}}return e.length>0?[...t,...e]:t}S(Gt,"ensurePairwiseSubsets");var Ue={draw:qe},Ye={parser:Se,db:Pe,renderer:Ue,styles:Ve};export{Ye as diagram};
@@ -1,4 +1,4 @@
1
- import{p as zt}from"./chunk-JWPE2WC7-CLC3hqKr.js";import{s as Lt,g as Tt,o as At,n as Xt,a as Et,b as Yt,_ as y,G as It,y as Bt,A as Q,l as et,E as Ft,d as Rt,p as Ot,c as V}from"./mermaid.core-BVbO1Vp8.js";import{p as Wt}from"./cynefin-VYW2F7L2-DjqH_9VW.js";import"./main-D3HpSUyK.js";import"./index-C-4sKCSr.js";import"./transform-CzGDKG_M.js";import"./step-SI6FXFD6.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
1
+ import{p as zt}from"./chunk-JWPE2WC7-B_A1as9r.js";import{s as Lt,g as Tt,o as At,n as Xt,a as Et,b as Yt,_ as y,G as It,y as Bt,A as Q,l as et,E as Ft,d as Rt,p as Ot,c as V}from"./mermaid.core-D0rh4nEj.js";import{p as Wt}from"./cynefin-VYW2F7L2-lYm8p8qp.js";import"./main-Bkgg11ZB.js";import"./index-BNNZmZ7L.js";import"./transform-B5_amWNh.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}
@@ -75,4 +75,4 @@ import{p as zt}from"./chunk-JWPE2WC7-CLC3hqKr.js";import{s as Lt,g as Tt,o as At
75
75
  .wardley-notes text {
76
76
  fill: ${r.axisTextColor};
77
77
  }
78
- `},"styles"),ne={parser:at,db:Ht,renderer:Ut,styles:Jt};export{ne as diagram};
78
+ `},"styles"),se={parser:at,db:Ht,renderer:Ut,styles:Jt};export{se as diagram};