@intent-hq/web 2.310.1 → 2.310.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/assets/{DiagramPresentation.fimBl1wP.css → DiagramPresentation.Bfi3xHm0.css} +1 -1
  3. package/web/app/immutable/chunks/-xK_vQQs.js +1 -0
  4. package/web/app/immutable/chunks/{CQe4IdgR.js → 189zCzpy.js} +1 -1
  5. package/web/app/immutable/chunks/6XLvYn_R.js +4 -0
  6. package/web/app/immutable/chunks/{BIxkRFIj.js → 7LPFBi2V.js} +2 -2
  7. package/web/app/immutable/chunks/{D81gRUjY.js → 9Al7uANH.js} +1 -1
  8. package/web/app/immutable/chunks/{xMirTl3q.js → 9Ax53qRD.js} +2 -2
  9. package/web/app/immutable/chunks/{DQEBW0YT.js → 9U2m-KE4.js} +1 -1
  10. package/web/app/immutable/chunks/{t9id1Dgw.js → B08PB3d6.js} +1 -1
  11. package/web/app/immutable/chunks/B1wLVJWc.js +7 -0
  12. package/web/app/immutable/chunks/B1zCpBoo.js +217 -0
  13. package/web/app/immutable/chunks/{CsYRAdgB.js → B2-LFLJm.js} +1 -1
  14. package/web/app/immutable/chunks/{B4dTn6xv.js → B3NZDdp-.js} +1 -1
  15. package/web/app/immutable/chunks/{r1_PrlQL.js → B3u9yhMd.js} +1 -1
  16. package/web/app/immutable/chunks/{DzvQOT8_.js → B6ACa1PM.js} +1 -1
  17. package/web/app/immutable/chunks/{DXOCO_oS.js → B7VxeONz.js} +1 -1
  18. package/web/app/immutable/chunks/{CEdLQlJ6.js → BGOzArFr.js} +6 -6
  19. package/web/app/immutable/chunks/{Bfkn2BGM.js → BGSgFd0R.js} +1 -1
  20. package/web/app/immutable/chunks/{C7oH1dbI.js → BHMk19Fd.js} +1 -1
  21. package/web/app/immutable/chunks/{DUkegami.js → BRp0P9cF.js} +1 -1
  22. package/web/app/immutable/chunks/{BtHVXttl.js → BS3KKa6i.js} +5 -5
  23. package/web/app/immutable/chunks/{Bhcwd2SW.js → BSN7-Qxa.js} +4 -4
  24. package/web/app/immutable/chunks/{CnmCWFKQ.js → BU1SD4F5.js} +2 -2
  25. package/web/app/immutable/chunks/BUvLOETw.js +8 -0
  26. package/web/app/immutable/chunks/{CwH3s3Sg.js → B_CxKeY9.js} +1 -1
  27. package/web/app/immutable/chunks/{CsASRGy9.js → B_F8B07u.js} +5 -5
  28. package/web/app/immutable/chunks/{D-9LH0ah.js → B_u6ph9g.js} +1 -1
  29. package/web/app/immutable/chunks/{CHH2PtZ7.js → BbajLcMi.js} +1 -1
  30. package/web/app/immutable/chunks/{TQIai6Ne.js → BcGA_XKM.js} +79 -79
  31. package/web/app/immutable/chunks/Bdj20t_M.js +200 -0
  32. package/web/app/immutable/chunks/{Si43_nYW.js → BfVF2I5Q.js} +3 -3
  33. package/web/app/immutable/chunks/{B20hJMKp.js → BgjzIHmr.js} +2 -2
  34. package/web/app/immutable/chunks/BhFdeIZl.js +1 -0
  35. package/web/app/immutable/chunks/{CeEeQIAV.js → BjS3bCVA.js} +1 -1
  36. package/web/app/immutable/chunks/Bl1SUWQK.js +1 -0
  37. package/web/app/immutable/chunks/BtFywNMt.js +40 -0
  38. package/web/app/immutable/chunks/{B_D0NLtg.js → BwThkZnv.js} +1 -1
  39. package/web/app/immutable/chunks/ByGoYv9M.js +1 -0
  40. package/web/app/immutable/chunks/Bz2AaX7v.js +38 -0
  41. package/web/app/immutable/chunks/{j0ThtFJc.js → BzqKIdEP.js} +1 -1
  42. package/web/app/immutable/chunks/{BV9p4X5I.js → C-27EQSK.js} +6 -6
  43. package/web/app/immutable/chunks/C2FKcF8a.js +99 -0
  44. package/web/app/immutable/chunks/{D04E4MVv.js → C2ypXh8V.js} +4 -4
  45. package/web/app/immutable/chunks/{DaEQgqyy.js → C5bjHjx4.js} +1 -1
  46. package/web/app/immutable/chunks/{C-Mmob1s.js → C64YVcCh.js} +1 -1
  47. package/web/app/immutable/chunks/{BV7dztYI.js → C7-VQsLR.js} +1 -1
  48. package/web/app/immutable/chunks/C7ldC6zu.js +41 -0
  49. package/web/app/immutable/chunks/{CgAIOmc3.js → C7xfOFNZ.js} +4 -4
  50. package/web/app/immutable/chunks/{phowbgF-.js → CAt8c0ls.js} +1 -1
  51. package/web/app/immutable/chunks/CC-vc0Sh.js +2 -0
  52. package/web/app/immutable/chunks/{DjEB6QMF.js → CDmxeAFz.js} +1 -1
  53. package/web/app/immutable/chunks/{DevHtnbn.js → CLUug_7o.js} +1 -1
  54. package/web/app/immutable/chunks/{CPvhRhlk.js → CLyqqizl.js} +11 -11
  55. package/web/app/immutable/chunks/{DQulsXJ7.js → CO5Qz17e.js} +1 -1
  56. package/web/app/immutable/chunks/{B9r0JXjW.js → COBtdbv4.js} +1 -1
  57. package/web/app/immutable/chunks/COZ8XMYr.js +2 -0
  58. package/web/app/immutable/chunks/{qMHHnffV.js → CQK97B3l.js} +1 -1
  59. package/web/app/immutable/chunks/{CQf-fH5v.js → CYTBw0CY.js} +1 -1
  60. package/web/app/immutable/chunks/{CUvX4uDB.js → CZLMJ41d.js} +3 -3
  61. package/web/app/immutable/chunks/{Cuozo7M1.js → CZqaUHhn.js} +1 -1
  62. package/web/app/immutable/chunks/CeVWos-t.js +1 -0
  63. package/web/app/immutable/chunks/CepoDpYW.js +1 -0
  64. package/web/app/immutable/chunks/{DdAxykhC.js → CiBABzvX.js} +1 -1
  65. package/web/app/immutable/chunks/{D8SVxzqF.js → CjcP6chv.js} +1 -1
  66. package/web/app/immutable/chunks/{EZw3rvya.js → CkactGV1.js} +30 -30
  67. package/web/app/immutable/chunks/ClebXGIM.js +141 -0
  68. package/web/app/immutable/chunks/{BCm8Gasf.js → CnfDI0G9.js} +1 -1
  69. package/web/app/immutable/chunks/{BEhoKnQT.js → CoiqgZqV.js} +1 -1
  70. package/web/app/immutable/chunks/{DRMT9vvq.js → CpQksukT.js} +1 -1
  71. package/web/app/immutable/chunks/CrX2GQl1.js +1 -0
  72. package/web/app/immutable/chunks/{DCeW9_0X.js → CtDXgUYh.js} +2 -2
  73. package/web/app/immutable/chunks/CvEzUeZj.js +39 -0
  74. package/web/app/immutable/chunks/{CCIGQjYf.js → CxP8jrn2.js} +1 -1
  75. package/web/app/immutable/chunks/{D411lQkp.js → D2XAsGw-.js} +1 -1
  76. package/web/app/immutable/chunks/D3in5AGo.js +34 -0
  77. package/web/app/immutable/chunks/D3ma4MWK.js +84 -0
  78. package/web/app/immutable/chunks/{_F3xl3RI.js → D3p4HGPq.js} +1 -1
  79. package/web/app/immutable/chunks/D57k4GEE.js +344 -0
  80. package/web/app/immutable/chunks/{BUSwtV99.js → D5mZ2XGM.js} +1 -1
  81. package/web/app/immutable/chunks/{D_9AVJm5.js → DE1vhlzN.js} +1 -1
  82. package/web/app/immutable/chunks/{CWyh7Yhz.js → DI-WSiIl.js} +1 -1
  83. package/web/app/immutable/chunks/DMfS3QUv.js +213 -0
  84. package/web/app/immutable/chunks/DMmGJ3th.js +140 -0
  85. package/web/app/immutable/chunks/DPADHNob.js +3 -0
  86. package/web/app/immutable/chunks/DPcySxOl.js +24 -0
  87. package/web/app/immutable/chunks/{ejL3HmTG.js → DQNwUygY.js} +3 -3
  88. package/web/app/immutable/chunks/{BGLkcG6I.js → DR3ukAe9.js} +2 -2
  89. package/web/app/immutable/chunks/{BmDskjjc.js → DRKyy5zo.js} +1 -1
  90. package/web/app/immutable/chunks/DTpCNXVX.js +62 -0
  91. package/web/app/immutable/chunks/DW02E8JU.js +291 -0
  92. package/web/app/immutable/chunks/{BKY64haD.js → DbnaPZDp.js} +6 -6
  93. package/web/app/immutable/chunks/Dhhgf7-r.js +36 -0
  94. package/web/app/immutable/chunks/{C8CCN24q.js → DjaKy3j_.js} +1 -1
  95. package/web/app/immutable/chunks/{C0DDaBnV.js → Dk4znOdW.js} +1 -1
  96. package/web/app/immutable/chunks/{R7gFhaG_.js → Dl1xcl6N.js} +1 -1
  97. package/web/app/immutable/chunks/Dmv_LV6R.js +106 -0
  98. package/web/app/immutable/chunks/{BNg3GOxL.js → Dr28se2A.js} +2 -2
  99. package/web/app/immutable/chunks/Dr_BXnmT.js +169 -0
  100. package/web/app/immutable/chunks/{ByGsJxdn.js → Dvt2xumc.js} +1 -1
  101. package/web/app/immutable/chunks/DxHqMweQ.js +27 -0
  102. package/web/app/immutable/chunks/Dyv7eW7r.js +1 -0
  103. package/web/app/immutable/chunks/{CBHPIqXg.js → DzDnAGVP.js} +1 -1
  104. package/web/app/immutable/chunks/{C0Yks_oS.js → IIWxUL8F.js} +1 -1
  105. package/web/app/immutable/chunks/IjQ_akx8.js +24 -0
  106. package/web/app/immutable/chunks/{DeopB2f-.js → JFNcUgqI.js} +3 -3
  107. package/web/app/immutable/chunks/{dtB9lR1B.js → JvGvDA7z.js} +1 -1
  108. package/web/app/immutable/chunks/{BsP5G0Fo.js → LXPDKlyI.js} +1 -1
  109. package/web/app/immutable/chunks/{zXW6V5sa.js → M5rEGvXZ.js} +1 -1
  110. package/web/app/immutable/chunks/{DOVnLHFz.js → O55LMojB.js} +1 -1
  111. package/web/app/immutable/chunks/{t3bi-ExW.js → O86272iX.js} +2 -2
  112. package/web/app/immutable/chunks/{D-o9b0Cd.js → PW60rHG1.js} +2 -2
  113. package/web/app/immutable/chunks/{fULl8IO9.js → UzQ5fjmd.js} +7 -7
  114. package/web/app/immutable/chunks/VmPClZ6P.js +98 -0
  115. package/web/app/immutable/chunks/WKN7DEK1.js +292 -0
  116. package/web/app/immutable/chunks/{7KTbkf4W.js → YuniekLU.js} +2 -2
  117. package/web/app/immutable/chunks/{DxlwMmI8.js → _Q4NEhG2.js} +1 -1
  118. package/web/app/immutable/chunks/{DMGAuSgb.js → _sFm91KN.js} +4 -4
  119. package/web/app/immutable/chunks/{Drg52kVf.js → cF0DaKkd.js} +1 -1
  120. package/web/app/immutable/chunks/{DOHtPCK9.js → d9OF_ecy.js} +1 -1
  121. package/web/app/immutable/chunks/eHLf0w_s.js +1 -0
  122. package/web/app/immutable/chunks/ey5Fwige.js +1 -0
  123. package/web/app/immutable/chunks/gq2RHuUM.js +120 -0
  124. package/web/app/immutable/chunks/{BKGPkCRs.js → hJG5qV93.js} +1 -1
  125. package/web/app/immutable/chunks/jfltPaLX.js +370 -0
  126. package/web/app/immutable/chunks/{BBTS8ZOM.js → l0v05b1J.js} +3 -3
  127. package/web/app/immutable/chunks/{CnszEr0a.js → le8iLKoG.js} +1 -1
  128. package/web/app/immutable/chunks/{CoeuT-m3.js → mCGfnSaU.js} +1 -1
  129. package/web/app/immutable/chunks/{B0X6Qy4e.js → mNrkfPcL.js} +1 -1
  130. package/web/app/immutable/chunks/{DLm51UIm.js → tzNFwvLY.js} +1 -1
  131. package/web/app/immutable/chunks/{Coy9jSf1.js → xL2Hl8pt.js} +1 -1
  132. package/web/app/immutable/chunks/{qOCErwrn.js → yEkT96At.js} +1 -1
  133. package/web/app/immutable/chunks/{DhdMM_zt.js → yGxUPrAb.js} +14 -14
  134. package/web/app/immutable/entry/{app.DlF41taB.js → app.CWgSMPHo.js} +2 -2
  135. package/web/app/immutable/entry/start.DRM4Ek1S.js +1 -0
  136. package/web/app/immutable/nodes/{0.BLjNhnkb.js → 0.DsHcmAxw.js} +1 -1
  137. package/web/app/immutable/nodes/{1.DaghOy3j.js → 1.CkY-7ake.js} +1 -1
  138. package/web/app/immutable/nodes/{10.CbV_flkh.js → 10.CdTsXOpX.js} +1 -1
  139. package/web/app/immutable/nodes/{14.N_oC1pv5.js → 14.juvATfIp.js} +1 -1
  140. package/web/app/immutable/nodes/{16.Cn0uYbJe.js → 16.DuXLhJX1.js} +2 -2
  141. package/web/app/immutable/nodes/{2.CMERPJYK.js → 2.DL0H4Ehj.js} +8 -8
  142. package/web/app/immutable/nodes/{3.Dk5w9XeG.js → 3.CsarMzm8.js} +1 -1
  143. package/web/app/immutable/nodes/{4.CvLiKH0B.js → 4.DOKXGcKD.js} +1 -1
  144. package/web/app/immutable/nodes/{5.BL5oLCOi.js → 5.5nmYhZgy.js} +1 -1
  145. package/web/app/immutable/nodes/{6.DiKzgiKt.js → 6.BMO8vjvw.js} +1 -1
  146. package/web/app/immutable/nodes/{7.CM-hNW3A.js → 7.Rmoc-ypk.js} +1 -1
  147. package/web/app/immutable/nodes/{8.BThIGSQR.js → 8.Dy5AT1iw.js} +2 -2
  148. package/web/app/immutable/nodes/{9.D70tN3NX.js → 9.Dtv2dSUT.js} +18 -18
  149. package/web/app/version.json +1 -1
  150. package/web/index.html +9 -9
  151. package/web/app/immutable/chunks/-SL67XKV.js +0 -1
  152. package/web/app/immutable/chunks/351KaJp_.js +0 -24
  153. package/web/app/immutable/chunks/7Iuyw4Ow.js +0 -106
  154. package/web/app/immutable/chunks/9ySBq1wF.js +0 -36
  155. package/web/app/immutable/chunks/B2safKX4.js +0 -1
  156. package/web/app/immutable/chunks/B8QrskMI.js +0 -139
  157. package/web/app/immutable/chunks/BCO4VeSA.js +0 -1
  158. package/web/app/immutable/chunks/BCaDoF8Y.js +0 -1
  159. package/web/app/immutable/chunks/BEdJCn-8.js +0 -1
  160. package/web/app/immutable/chunks/BGBb6fI-.js +0 -120
  161. package/web/app/immutable/chunks/BGQ3htf5.js +0 -1
  162. package/web/app/immutable/chunks/BKLEAopb.js +0 -7
  163. package/web/app/immutable/chunks/BKSgn5w-.js +0 -1
  164. package/web/app/immutable/chunks/BOXqfDS_.js +0 -40
  165. package/web/app/immutable/chunks/BP_ooGOd.js +0 -24
  166. package/web/app/immutable/chunks/BQApP15C.js +0 -99
  167. package/web/app/immutable/chunks/BS6cE8e9.js +0 -231
  168. package/web/app/immutable/chunks/BTXk2yGf.js +0 -96
  169. package/web/app/immutable/chunks/BVrOGXf1.js +0 -78
  170. package/web/app/immutable/chunks/BZoKWA-r.js +0 -96
  171. package/web/app/immutable/chunks/BbiXTFqz.js +0 -1
  172. package/web/app/immutable/chunks/BgmKjqUX.js +0 -1
  173. package/web/app/immutable/chunks/Bk7xBWHf.js +0 -34
  174. package/web/app/immutable/chunks/BoiNnj2h.js +0 -1
  175. package/web/app/immutable/chunks/BrVvVCxw.js +0 -1
  176. package/web/app/immutable/chunks/ByM2DIOs.js +0 -1
  177. package/web/app/immutable/chunks/ByzYvvQp.js +0 -70
  178. package/web/app/immutable/chunks/Bz0SnIMO.js +0 -1
  179. package/web/app/immutable/chunks/C1IwSyrV.js +0 -99
  180. package/web/app/immutable/chunks/C9gL5x04.js +0 -39
  181. package/web/app/immutable/chunks/C9nyJoiB.js +0 -41
  182. package/web/app/immutable/chunks/CBV2Z_QZ.js +0 -89
  183. package/web/app/immutable/chunks/CDHds8o_.js +0 -3
  184. package/web/app/immutable/chunks/CHIHAnR-.js +0 -1
  185. package/web/app/immutable/chunks/CHj2oCmD.js +0 -39
  186. package/web/app/immutable/chunks/CIXNMjfT.js +0 -206
  187. package/web/app/immutable/chunks/CKFDW9cI.js +0 -24
  188. package/web/app/immutable/chunks/CKQlE_M1.js +0 -88
  189. package/web/app/immutable/chunks/CSBhPNbN.js +0 -206
  190. package/web/app/immutable/chunks/CSLTsum9.js +0 -38
  191. package/web/app/immutable/chunks/CSbiiZpm.js +0 -354
  192. package/web/app/immutable/chunks/CToDhNW4.js +0 -1
  193. package/web/app/immutable/chunks/CYFK9YEX.js +0 -168
  194. package/web/app/immutable/chunks/CcGF51wP.js +0 -1
  195. package/web/app/immutable/chunks/Cd5vVJw4.js +0 -292
  196. package/web/app/immutable/chunks/CgjSMAIJ.js +0 -120
  197. package/web/app/immutable/chunks/Ck7B90Kr.js +0 -38
  198. package/web/app/immutable/chunks/CkAILno9.js +0 -62
  199. package/web/app/immutable/chunks/CkawHIFZ.js +0 -1
  200. package/web/app/immutable/chunks/ClXr1b-t.js +0 -8
  201. package/web/app/immutable/chunks/CmWBRPmR.js +0 -24
  202. package/web/app/immutable/chunks/Cmo-9vFV.js +0 -1
  203. package/web/app/immutable/chunks/CoFCa7Mb.js +0 -231
  204. package/web/app/immutable/chunks/CrcLvVto.js +0 -84
  205. package/web/app/immutable/chunks/Cs_Q6mos.js +0 -1
  206. package/web/app/immutable/chunks/CsnLwu9F.js +0 -2
  207. package/web/app/immutable/chunks/CuYeKLE8.js +0 -8
  208. package/web/app/immutable/chunks/CvOaoHrI.js +0 -1
  209. package/web/app/immutable/chunks/CvYzv8kf.js +0 -1
  210. package/web/app/immutable/chunks/CxRm1vYn.js +0 -342
  211. package/web/app/immutable/chunks/CyfBUrNA.js +0 -1
  212. package/web/app/immutable/chunks/D1QKDDLH.js +0 -1
  213. package/web/app/immutable/chunks/D61DwhDw.js +0 -3
  214. package/web/app/immutable/chunks/DBAJPVI_.js +0 -1
  215. package/web/app/immutable/chunks/DBt8jmEX.js +0 -40
  216. package/web/app/immutable/chunks/DD-T_Om0.js +0 -178
  217. package/web/app/immutable/chunks/DEOiJZFa.js +0 -168
  218. package/web/app/immutable/chunks/DHW4IXFj.js +0 -36
  219. package/web/app/immutable/chunks/DJ0w8Oax.js +0 -129
  220. package/web/app/immutable/chunks/DJ52BT20.js +0 -1
  221. package/web/app/immutable/chunks/DK1048Bw.js +0 -129
  222. package/web/app/immutable/chunks/DZ0nrC9W.js +0 -162
  223. package/web/app/immutable/chunks/DeRneTJF.js +0 -106
  224. package/web/app/immutable/chunks/Df6EnPla.js +0 -4
  225. package/web/app/immutable/chunks/DfMKUxMU.js +0 -30
  226. package/web/app/immutable/chunks/DkH3yb1j.js +0 -34
  227. package/web/app/immutable/chunks/Doxgswr3.js +0 -4
  228. package/web/app/immutable/chunks/Dt53cexP.js +0 -1
  229. package/web/app/immutable/chunks/Dx6eBL0x.js +0 -1
  230. package/web/app/immutable/chunks/HP7Asd0t.js +0 -2
  231. package/web/app/immutable/chunks/HP8lGamR.js +0 -257
  232. package/web/app/immutable/chunks/HzpfURmp.js +0 -84
  233. package/web/app/immutable/chunks/PJfe_iA1.js +0 -1
  234. package/web/app/immutable/chunks/PXMyYXQv.js +0 -1
  235. package/web/app/immutable/chunks/Qi3HrsAm.js +0 -1
  236. package/web/app/immutable/chunks/S1FanOB0.js +0 -162
  237. package/web/app/immutable/chunks/SuMU9B9i.js +0 -1
  238. package/web/app/immutable/chunks/UaGv-ChR.js +0 -257
  239. package/web/app/immutable/chunks/YqyEOqRv.js +0 -178
  240. package/web/app/immutable/chunks/_MGNV7ZN.js +0 -338
  241. package/web/app/immutable/chunks/_lZu5Dth.js +0 -292
  242. package/web/app/immutable/chunks/gzjZWAx8.js +0 -62
  243. package/web/app/immutable/chunks/hqSEunOk.js +0 -15
  244. package/web/app/immutable/chunks/nGCCQCpO.js +0 -1
  245. package/web/app/immutable/chunks/o-kBqlaj.js +0 -7
  246. package/web/app/immutable/chunks/opO2fBQB.js +0 -1
  247. package/web/app/immutable/chunks/pdFamTTi.js +0 -7
  248. package/web/app/immutable/chunks/rEI8JpP3.js +0 -1
  249. package/web/app/immutable/chunks/s5P9UVzf.js +0 -1
  250. package/web/app/immutable/chunks/sIHUXgeh.js +0 -41
  251. package/web/app/immutable/entry/start.CCtO40vu.js +0 -1
@@ -0,0 +1,344 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BcGA_XKM.js","/app/immutable/chunks/KQTrHxko.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/chunks/7rNOGHzs.js","/app/immutable/chunks/B8o4lNgr.js","/app/immutable/chunks/CRwmdgt6.js","/app/immutable/chunks/CjSUqH7t.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/CQ4a5a4v.js","/app/immutable/chunks/DCaHy20k.js","/app/immutable/chunks/CFejQM6t.js","/app/immutable/chunks/CiENRH6A.js","/app/immutable/chunks/DmsDslNo.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/Bgegixo2.js","/app/immutable/chunks/D2g8BuR1.js","/app/immutable/chunks/CzrrO9Ap.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/C_n9DeKj.js","/app/immutable/chunks/DzMmhJrp.js","/app/immutable/chunks/BRp0P9cF.js","/app/immutable/chunks/BkBdyRjM.js","/app/immutable/chunks/D4jXWSLn.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/CtDXgUYh.js","/app/immutable/chunks/CB-g50lR.js","/app/immutable/chunks/CPQdU3ZA.js","/app/immutable/chunks/DNen9YXB.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/D-cnPaTJ.js","/app/immutable/assets/pending-agent-deletions.UE5obH5A.css","/app/immutable/chunks/yAjP_kdp.js","/app/immutable/chunks/DxHqMweQ.js","/app/immutable/chunks/CeVWos-t.js","/app/immutable/chunks/CC-vc0Sh.js","/app/immutable/chunks/-xK_vQQs.js","/app/immutable/chunks/6XLvYn_R.js","/app/immutable/chunks/BhFdeIZl.js","/app/immutable/chunks/9Al7uANH.js","/app/immutable/chunks/lAmQKSWr.js","/app/immutable/chunks/Bz2AaX7v.js","/app/immutable/chunks/CepoDpYW.js","/app/immutable/chunks/DMfS3QUv.js","/app/immutable/chunks/O55LMojB.js","/app/immutable/chunks/BzqKIdEP.js","/app/immutable/chunks/Dyv7eW7r.js","/app/immutable/chunks/Bdj20t_M.js","/app/immutable/chunks/BUvLOETw.js","/app/immutable/chunks/C2FKcF8a.js","/app/immutable/chunks/Dmv_LV6R.js","/app/immutable/chunks/CiBABzvX.js","/app/immutable/chunks/CoiqgZqV.js","/app/immutable/chunks/ClebXGIM.js","/app/immutable/chunks/WKN7DEK1.js","/app/immutable/chunks/ey5Fwige.js","/app/immutable/chunks/Gi6I4Gst.js","/app/immutable/chunks/CrowFXzY.js","/app/immutable/chunks/COZ8XMYr.js","/app/immutable/chunks/CvEzUeZj.js","/app/immutable/chunks/Bl1SUWQK.js","/app/immutable/chunks/CmKTTxBW.js","/app/immutable/chunks/B_F8B07u.js","/app/immutable/chunks/B1wLVJWc.js","/app/immutable/chunks/D3ma4MWK.js","/app/immutable/chunks/Dr_BXnmT.js","/app/immutable/chunks/B1zCpBoo.js","/app/immutable/chunks/DW02E8JU.js","/app/immutable/chunks/CZLMJ41d.js","/app/immutable/chunks/gq2RHuUM.js","/app/immutable/chunks/VmPClZ6P.js","/app/immutable/chunks/UzQ5fjmd.js","/app/immutable/chunks/BtFywNMt.js","/app/immutable/chunks/IjQ_akx8.js","/app/immutable/chunks/C7ldC6zu.js","/app/immutable/chunks/DMmGJ3th.js","/app/immutable/chunks/BS3KKa6i.js","/app/immutable/chunks/Dhhgf7-r.js","/app/immutable/chunks/DPADHNob.js","/app/immutable/chunks/DPcySxOl.js","/app/immutable/chunks/jfltPaLX.js","/app/immutable/chunks/C7xfOFNZ.js","/app/immutable/chunks/DTpCNXVX.js","/app/immutable/chunks/DE1vhlzN.js","/app/immutable/chunks/BfVF2I5Q.js","/app/immutable/chunks/189zCzpy.js","/app/immutable/chunks/CrX2GQl1.js","/app/immutable/chunks/DzDnAGVP.js"])))=>i.map(i=>d[i]);
2
+ var rC=Object.defineProperty;var iC=(e,t,r)=>t in e?rC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gr=(e,t,r)=>iC(e,typeof t!="symbol"?t+"":t,r);import{_ as je,t as _o,bq as ze,bo as Ye,by as Bo,b as Lo,a_ as ur,br as oC}from"./7rNOGHzs.js";import{g as aC}from"./BJzHxIyr.js";import{aP as os}from"./BcGA_XKM.js";import{b7 as sC,cc as nC,bs as Ao,a7 as zo,ay as Qr,aD as S,bS as qe,be as zs,b$ as zn,b_ as ar,bO as pr,W as ge,c9 as Et,bn as Fo,aA as Me,aB as er,bk as td,bH as ft,ca as xo,c5 as il,a5 as Ne,bA as Fe,bV as ce,bl as kr,c0 as hh,aC as ei,aw as ol,a as Iu,bj as Pp,br as hi,cb as lC,bf as cC}from"./B8o4lNgr.js";import{N as Ou}from"./O86272iX.js";import{k as Ji,s as fe,j as Hs,c as Ip,a as hC,h as aa,i as Du,d as Op,l as Ea}from"./DmsDslNo.js";import{b as Ki}from"./D2g8BuR1.js";import{c as dC}from"./ChTqQfQN.js";import{d0 as uC,cR as fC,F as Ks,aK as gC,b9 as Dp,c$ as pC,l as mC,m as yC,f as xC,i as bC,y as CC,v as Ru,s as Nu,g as wC,G as kC,P as SC,q as vC,z as TC,p as MC,j as _C,O as BC,D as qu,H as LC,U as AC,aw as FC,ax as $C,aW as EC}from"./CFejQM6t.js";import{f as Na,am as PC}from"./Bgegixo2.js";import{r as IC,a4 as OC}from"./CkactGV1.js";import{e as DC,H as RC}from"./BSN7-Qxa.js";import{E as Rp}from"./DCaHy20k.js";import{H as yo,h as Wu,G as ws,d as zu}from"./DzMmhJrp.js";import{c as ea}from"./CiENRH6A.js";import{f as NC}from"./DsNWmyox.js";import{t as qC}from"./Ck-Ax5yG.js";import{s as Hn}from"./CQ4a5a4v.js";import{s as Hu,j as WC}from"./DZX-XWnb.js";import{s as zC,K as HC,k as YC,l as dc,M as XC}from"./DSjRkndX.js";import{t as uo}from"./lfJ8pseq.js";import"./D-cnPaTJ.js";import"./CRwmdgt6.js";import{ce as GC}from"./BRp0P9cF.js";function jC(e,t){sC(window,["resize"],()=>nC(()=>t(window[e])))}var Np=Object.defineProperty,b=(e,t)=>Np(e,"name",{value:t,configurable:!0}),UC=(e,t)=>{for(var r in t)Np(e,r,{get:t[r],enumerable:!0})};function qp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}b(qp,"getDefaultExportFromCjs");var Yr={},kn={},Oo={},Yu;function fs(){if(Yu)return Oo;Yu=1;function e(s){return typeof s>"u"||s===null}b(e,"isNothing");function t(s){return typeof s=="object"&&s!==null}b(t,"isObject");function r(s){return Array.isArray(s)?s:e(s)?[]:[s]}b(r,"toArray");function i(s,n){if(n){const l=Object.keys(n);for(let c=0,h=l.length;c<h;c+=1){const d=l[c];s[d]=n[d]}}return s}b(i,"extend");function o(s,n){let l="";for(let c=0;c<n;c+=1)l+=s;return l}b(o,"repeat");function a(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return b(a,"isNegativeZero"),Oo.isNothing=e,Oo.isObject=t,Oo.toArray=r,Oo.repeat=o,Oo.isNegativeZero=a,Oo.extend=i,Oo}b(fs,"requireCommon");var uc,Xu;function gs(){if(Xu)return uc;Xu=1;function e(r,i){let o="";const a=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(o+='in "'+r.mark.name+'" '),o+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!i&&r.mark.snippet&&(o+=`
3
+
4
+ `+r.mark.snippet),a+" "+o):a}b(e,"formatError");function t(r,i){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=i,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return b(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=b(function(i){return this.name+": "+e(this,i)},"toString"),uc=t,uc}b(gs,"requireException");var fc,Gu;function Wp(){if(Gu)return fc;Gu=1;const e=fs();function t(o,a,s,n,l){let c="",h="";const d=Math.floor(l/2)-1;return n-a>d&&(c=" ... ",a=n-d+c.length),s-n>d&&(h=" ...",s=n+d-h.length),{str:c+o.slice(a,s).replace(/\t/g,"→")+h,pos:n-a+c.length}}b(t,"getLine");function r(o,a){return e.repeat(" ",a-o.length)+o}b(r,"padStart");function i(o,a){if(a=Object.create(a||null),!o.buffer)return null;a.maxLength||(a.maxLength=79),typeof a.indent!="number"&&(a.indent=1),typeof a.linesBefore!="number"&&(a.linesBefore=3),typeof a.linesAfter!="number"&&(a.linesAfter=2);const s=/\r?\n|\r|\0/g,n=[0],l=[];let c,h=-1;for(;c=s.exec(o.buffer);)l.push(c.index),n.push(c.index+c[0].length),o.position<=c.index&&h<0&&(h=n.length-2);h<0&&(h=n.length-1);let d="";const u=Math.min(o.line+a.linesAfter,l.length).toString().length,f=a.maxLength-(a.indent+u+3);for(let g=1;g<=a.linesBefore&&!(h-g<0);g++){const m=t(o.buffer,n[h-g],l[h-g],o.position-(n[h]-n[h-g]),f);d=e.repeat(" ",a.indent)+r((o.line-g+1).toString(),u)+" | "+m.str+`
5
+ `+d}const p=t(o.buffer,n[h],l[h],o.position,f);d+=e.repeat(" ",a.indent)+r((o.line+1).toString(),u)+" | "+p.str+`
6
+ `,d+=e.repeat("-",a.indent+u+3+p.pos)+`^
7
+ `;for(let g=1;g<=a.linesAfter&&!(h+g>=l.length);g++){const m=t(o.buffer,n[h+g],l[h+g],o.position-(n[h]-n[h+g]),f);d+=e.repeat(" ",a.indent)+r((o.line+g+1).toString(),u)+" | "+m.str+`
8
+ `}return d.replace(/\n$/,"")}return b(i,"makeSnippet"),fc=i,fc}b(Wp,"requireSnippet");var gc,ju;function jr(){if(ju)return gc;ju=1;const e=gs(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function i(a){const s={};return a!==null&&Object.keys(a).forEach(function(n){a[n].forEach(function(l){s[String(l)]=n})}),s}b(i,"compileStyleAliases");function o(a,s){if(s=s||{},Object.keys(s).forEach(function(n){if(t.indexOf(n)===-1)throw new e('Unknown option "'+n+'" is met in definition of "'+a+'" YAML type.')}),this.options=s,this.tag=a,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(n){return n},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=i(s.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+a+'" YAML type.')}return b(o,"Type2"),gc=o,gc}b(jr,"requireType");var pc,Uu;function ed(){if(Uu)return pc;Uu=1;const e=gs(),t=jr();function r(a,s){const n=[];return a[s].forEach(function(l){let c=n.length;n.forEach(function(h,d){h.tag===l.tag&&h.kind===l.kind&&h.multi===l.multi&&(c=d)}),n[c]=l}),n}b(r,"compileList");function i(){const a={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(n){n.multi?(a.multi[n.kind].push(n),a.multi.fallback.push(n)):a[n.kind][n.tag]=a.fallback[n.tag]=n}b(s,"collectType");for(let n=0,l=arguments.length;n<l;n+=1)arguments[n].forEach(s);return a}b(i,"compileMap");function o(a){return this.extend(a)}return b(o,"Schema2"),o.prototype.extend=b(function(s){let n=[],l=[];if(s instanceof t)l.push(s);else if(Array.isArray(s))l=l.concat(s);else if(s&&(Array.isArray(s.implicit)||Array.isArray(s.explicit)))s.implicit&&(n=n.concat(s.implicit)),s.explicit&&(l=l.concat(s.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(h){if(!(h instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(h.loadKind&&h.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(h.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(h){if(!(h instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const c=Object.create(o.prototype);return c.implicit=(this.implicit||[]).concat(n),c.explicit=(this.explicit||[]).concat(l),c.compiledImplicit=r(c,"implicit"),c.compiledExplicit=r(c,"explicit"),c.compiledTypeMap=i(c.compiledImplicit,c.compiledExplicit),c},"extend"),pc=o,pc}b(ed,"requireSchema");var mc,Vu;function rd(){if(Vu)return mc;Vu=1;const e=jr();return mc=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:b(function(t){return t!==null?t:""},"construct")}),mc}b(rd,"requireStr");var yc,Zu;function id(){if(Zu)return yc;Zu=1;const e=jr();return yc=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:b(function(t){return t!==null?t:[]},"construct")}),yc}b(id,"requireSeq");var xc,Ku;function od(){if(Ku)return xc;Ku=1;const e=jr();return xc=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:b(function(t){return t!==null?t:{}},"construct")}),xc}b(od,"requireMap");var bc,Qu;function ad(){if(Qu)return bc;Qu=1;const e=ed();return bc=new e({explicit:[rd(),id(),od()]}),bc}b(ad,"requireFailsafe");var Cc,Ju;function sd(){if(Ju)return Cc;Ju=1;const e=jr();function t(o){if(o===null)return!0;const a=o.length;return a===1&&o==="~"||a===4&&(o==="null"||o==="Null"||o==="NULL")}b(t,"resolveYamlNull");function r(){return null}b(r,"constructYamlNull");function i(o){return o===null}return b(i,"isNull"),Cc=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{canonical:b(function(){return"~"},"canonical"),lowercase:b(function(){return"null"},"lowercase"),uppercase:b(function(){return"NULL"},"uppercase"),camelcase:b(function(){return"Null"},"camelcase"),empty:b(function(){return""},"empty")},defaultStyle:"lowercase"}),Cc}b(sd,"require_null");var wc,tf;function nd(){if(tf)return wc;tf=1;const e=jr();function t(o){if(o===null)return!1;const a=o.length;return a===4&&(o==="true"||o==="True"||o==="TRUE")||a===5&&(o==="false"||o==="False"||o==="FALSE")}b(t,"resolveYamlBoolean");function r(o){return o==="true"||o==="True"||o==="TRUE"}b(r,"constructYamlBoolean");function i(o){return Object.prototype.toString.call(o)==="[object Boolean]"}return b(i,"isBoolean"),wc=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{lowercase:b(function(o){return o?"true":"false"},"lowercase"),uppercase:b(function(o){return o?"TRUE":"FALSE"},"uppercase"),camelcase:b(function(o){return o?"True":"False"},"camelcase")},defaultStyle:"lowercase"}),wc}b(nd,"requireBool");var kc,ef;function ld(){if(ef)return kc;ef=1;const e=fs(),t=jr();function r(c){return c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102}b(r,"isHexCode");function i(c){return c>=48&&c<=55}b(i,"isOctCode");function o(c){return c>=48&&c<=57}b(o,"isDecCode");function a(c){if(c===null)return!1;const h=c.length;let d=0,u=!1;if(!h)return!1;let f=c[d];if((f==="-"||f==="+")&&(f=c[++d]),f==="0"){if(d+1===h)return!0;if(f=c[++d],f==="b"){for(d++;d<h;d++){if(f=c[d],f!=="0"&&f!=="1")return!1;u=!0}return u&&isFinite(s(c))}if(f==="x"){for(d++;d<h;d++){if(!r(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(s(c))}if(f==="o"){for(d++;d<h;d++){if(!i(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(s(c))}}for(;d<h;d++){if(!o(c.charCodeAt(d)))return!1;u=!0}return u?isFinite(s(c)):!1}b(a,"resolveYamlInteger");function s(c){let h=c,d=1,u=h[0];if((u==="-"||u==="+")&&(u==="-"&&(d=-1),h=h.slice(1),u=h[0]),h==="0")return 0;if(u==="0"){if(h[1]==="b")return d*parseInt(h.slice(2),2);if(h[1]==="x")return d*parseInt(h.slice(2),16);if(h[1]==="o")return d*parseInt(h.slice(2),8)}return d*parseInt(h,10)}b(s,"parseYamlInteger");function n(c){return s(c)}b(n,"constructYamlInteger");function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&c%1===0&&!e.isNegativeZero(c)}return b(l,"isInteger"),kc=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:n,predicate:l,represent:{binary:b(function(c){return c>=0?"0b"+c.toString(2):"-0b"+c.toString(2).slice(1)},"binary"),octal:b(function(c){return c>=0?"0o"+c.toString(8):"-0o"+c.toString(8).slice(1)},"octal"),decimal:b(function(c){return c.toString(10)},"decimal"),hexadecimal:b(function(c){return c>=0?"0x"+c.toString(16).toUpperCase():"-0x"+c.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),kc}b(ld,"requireInt");var Sc,rf;function cd(){if(rf)return Sc;rf=1;const e=fs(),t=jr(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),i=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function o(c){return c===null||!r.test(c)?!1:isFinite(parseFloat(c,10))?!0:i.test(c)}b(o,"resolveYamlFloat");function a(c){let h=c.toLowerCase();const d=h[0]==="-"?-1:1;return"+-".indexOf(h[0])>=0&&(h=h.slice(1)),h===".inf"?d===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:h===".nan"?NaN:d*parseFloat(h,10)}b(a,"constructYamlFloat");const s=/^[-+]?[0-9]+e/;function n(c,h){if(isNaN(c))switch(h){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===c)switch(h){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===c)switch(h){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(c))return"-0.0";const d=c.toString(10);return s.test(d)?d.replace("e",".e"):d}b(n,"representYamlFloat");function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&(c%1!==0||e.isNegativeZero(c))}return b(l,"isFloat"),Sc=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:a,predicate:l,represent:n,defaultStyle:"lowercase"}),Sc}b(cd,"requireFloat");var vc,of;function hd(){return of||(of=1,vc=ad().extend({implicit:[sd(),nd(),ld(),cd()]})),vc}b(hd,"requireJson");var Tc,af;function dd(){return af||(af=1,Tc=hd()),Tc}b(dd,"requireCore");var Mc,sf;function ud(){if(sf)return Mc;sf=1;const e=jr(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function i(s){return s===null?!1:t.exec(s)!==null||r.exec(s)!==null}b(i,"resolveYamlTimestamp");function o(s){let n=0,l=null,c=t.exec(s);if(c===null&&(c=r.exec(s)),c===null)throw new Error("Date resolve error");const h=+c[1],d=+c[2]-1,u=+c[3];if(!c[4])return new Date(Date.UTC(h,d,u));const f=+c[4],p=+c[5],g=+c[6];if(c[7]){for(n=c[7].slice(0,3);n.length<3;)n+="0";n=+n}if(c[9]){const y=+c[10],x=+(c[11]||0);l=(y*60+x)*6e4,c[9]==="-"&&(l=-l)}const m=new Date(Date.UTC(h,d,u,f,p,g,n));return l&&m.setTime(m.getTime()-l),m}b(o,"constructYamlTimestamp");function a(s){return s.toISOString()}return b(a,"representYamlTimestamp"),Mc=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:i,construct:o,instanceOf:Date,represent:a}),Mc}b(ud,"requireTimestamp");var _c,nf;function fd(){if(nf)return _c;nf=1;const e=jr();function t(r){return r==="<<"||r===null}return b(t,"resolveYamlMerge"),_c=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),_c}b(fd,"requireMerge");var Bc,lf;function gd(){if(lf)return Bc;lf=1;const e=jr(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
+ \r`;function r(s){if(s===null)return!1;let n=0;const l=s.length,c=t;for(let h=0;h<l;h++){const d=c.indexOf(s.charAt(h));if(!(d>64)){if(d<0)return!1;n+=6}}return n%8===0}b(r,"resolveYamlBinary");function i(s){const n=s.replace(/[\r\n=]/g,""),l=n.length,c=t;let h=0;const d=[];for(let f=0;f<l;f++)f%4===0&&f&&(d.push(h>>16&255),d.push(h>>8&255),d.push(h&255)),h=h<<6|c.indexOf(n.charAt(f));const u=l%4*6;return u===0?(d.push(h>>16&255),d.push(h>>8&255),d.push(h&255)):u===18?(d.push(h>>10&255),d.push(h>>2&255)):u===12&&d.push(h>>4&255),new Uint8Array(d)}b(i,"constructYamlBinary");function o(s){let n="",l=0;const c=s.length,h=t;for(let u=0;u<c;u++)u%3===0&&u&&(n+=h[l>>18&63],n+=h[l>>12&63],n+=h[l>>6&63],n+=h[l&63]),l=(l<<8)+s[u];const d=c%3;return d===0?(n+=h[l>>18&63],n+=h[l>>12&63],n+=h[l>>6&63],n+=h[l&63]):d===2?(n+=h[l>>10&63],n+=h[l>>4&63],n+=h[l<<2&63],n+=h[64]):d===1&&(n+=h[l>>2&63],n+=h[l<<4&63],n+=h[64],n+=h[64]),n}b(o,"representYamlBinary");function a(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}return b(a,"isBinary"),Bc=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:a,represent:o}),Bc}b(gd,"requireBinary");var Lc,cf;function pd(){if(cf)return Lc;cf=1;const e=jr(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function i(a){if(a===null)return!0;const s={},n=a;for(let l=0,c=n.length;l<c;l+=1){const h=n[l];let d=!1;if(r.call(h)!=="[object Object]")return!1;let u;for(u in h)if(t.call(h,u))if(!d)d=!0;else return!1;if(!d||t.call(s,u))return!1;Object.defineProperty(s,u,{value:!0})}return!0}b(i,"resolveYamlOmap");function o(a){return a!==null?a:[]}return b(o,"constructYamlOmap"),Lc=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:o}),Lc}b(pd,"requireOmap");var Ac,hf;function md(){if(hf)return Ac;hf=1;const e=jr(),t=Object.prototype.toString;function r(o){if(o===null)return!0;const a=o,s=new Array(a.length);for(let n=0,l=a.length;n<l;n+=1){const c=a[n];if(t.call(c)!=="[object Object]")return!1;const h=Object.keys(c);if(h.length!==1)return!1;s[n]=[h[0],c[h[0]]]}return!0}b(r,"resolveYamlPairs");function i(o){if(o===null)return[];const a=o,s=new Array(a.length);for(let n=0,l=a.length;n<l;n+=1){const c=a[n],h=Object.keys(c);s[n]=[h[0],c[h[0]]]}return s}return b(i,"constructYamlPairs"),Ac=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i}),Ac}b(md,"requirePairs");var Fc,df;function yd(){if(df)return Fc;df=1;const e=jr(),t=Object.prototype.hasOwnProperty;function r(o){if(o===null)return!0;const a=o;for(const s in a)if(t.call(a,s)&&a[s]!==null)return!1;return!0}b(r,"resolveYamlSet");function i(o){return o!==null?o:{}}return b(i,"constructYamlSet"),Fc=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i}),Fc}b(yd,"requireSet");var $c,uf;function Rl(){return uf||(uf=1,$c=dd().extend({implicit:[ud(),fd()],explicit:[gd(),pd(),md(),yd()]})),$c}b(Rl,"require_default");var ff;function zp(){if(ff)return kn;ff=1;const e=fs(),t=gs(),r=Wp(),i=Rl(),o=Object.prototype.hasOwnProperty,a=1,s=2,n=3,l=4,c=1,h=2,d=3,u=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f=/[\x85\u2028\u2029]/,p=/[,\[\]{}]/,g=/^(?:!|!!|![0-9A-Za-z-]+!)$/,m=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function y(w){return Object.prototype.toString.call(w)}b(y,"_class");function x(w){return w===10||w===13}b(x,"isEol");function C(w){return w===9||w===32}b(C,"isWhiteSpace");function k(w){return w===9||w===32||w===10||w===13}b(k,"isWsOrEol");function v(w){return w===44||w===91||w===93||w===123||w===125}b(v,"isFlowIndicator");function M(w){if(w>=48&&w<=57)return w-48;const G=w|32;return G>=97&&G<=102?G-97+10:-1}b(M,"fromHexCode");function A(w){return w===120?2:w===117?4:w===85?8:0}b(A,"escapedHexLen");function L(w){return w>=48&&w<=57?w-48:-1}b(L,"fromDecimalCode");function T(w){switch(w){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
10
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}b(T,"simpleEscapeSequence");function _(w){return w<=65535?String.fromCharCode(w):String.fromCharCode((w-65536>>10)+55296,(w-65536&1023)+56320)}b(_,"charFromCodepoint");function $(w,G,ht){G==="__proto__"?Object.defineProperty(w,G,{configurable:!0,enumerable:!0,writable:!0,value:ht}):w[G]=ht}b($,"setProperty");const P=new Array(256),D=new Array(256);for(let w=0;w<256;w++)P[w]=T(w)?1:0,D[w]=T(w);function F(w,G){this.input=w,this.filename=G.filename||null,this.schema=G.schema||i,this.onWarning=G.onWarning||null,this.legacy=G.legacy||!1,this.json=G.json||!1,this.listener=G.listener||null,this.maxDepth=typeof G.maxDepth=="number"?G.maxDepth:100,this.maxTotalMergeKeys=typeof G.maxTotalMergeKeys=="number"?G.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=w.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}b(F,"State");function E(w,G){const ht={name:w.filename,buffer:w.input.slice(0,-1),position:w.position,line:w.line,column:w.position-w.lineStart};return ht.snippet=r(ht),new t(G,ht)}b(E,"generateError");function B(w,G){throw E(w,G)}b(B,"throwError");function q(w,G){w.onWarning&&w.onWarning.call(null,E(w,G))}b(q,"throwWarning");function W(w,G,ht){const pt=w.anchorMapTransactions;if(pt.length!==0){const ut=pt[pt.length-1];o.call(ut,G)||(ut[G]={existed:o.call(w.anchorMap,G),value:w.anchorMap[G]})}w.anchorMap[G]=ht}b(W,"storeAnchor");function O(w){w.anchorMapTransactions.push(Object.create(null))}b(O,"beginAnchorTransaction");function R(w){const G=w.anchorMapTransactions.pop(),ht=w.anchorMapTransactions;if(ht.length===0)return;const pt=ht[ht.length-1],ut=Object.keys(G);for(let I=0,U=ut.length;I<U;I+=1){const K=ut[I];o.call(pt,K)||(pt[K]=G[K])}}b(R,"commitAnchorTransaction");function V(w){const G=w.anchorMapTransactions.pop(),ht=Object.keys(G);for(let pt=ht.length-1;pt>=0;pt-=1){const ut=G[ht[pt]];ut.existed?w.anchorMap[ht[pt]]=ut.value:delete w.anchorMap[ht[pt]]}}b(V,"rollbackAnchorTransaction");function j(w){return{position:w.position,line:w.line,lineStart:w.lineStart,lineIndent:w.lineIndent,firstTabInLine:w.firstTabInLine,tag:w.tag,anchor:w.anchor,kind:w.kind,result:w.result}}b(j,"snapshotState");function z(w,G){w.position=G.position,w.line=G.line,w.lineStart=G.lineStart,w.lineIndent=G.lineIndent,w.firstTabInLine=G.firstTabInLine,w.tag=G.tag,w.anchor=G.anchor,w.kind=G.kind,w.result=G.result}b(z,"restoreState");const Q={YAML:b(function(G,ht,pt){G.version!==null&&B(G,"duplication of %YAML directive"),pt.length!==1&&B(G,"YAML directive accepts exactly one argument");const ut=/^([0-9]+)\.([0-9]+)$/.exec(pt[0]);ut===null&&B(G,"ill-formed argument of the YAML directive");const I=parseInt(ut[1],10),U=parseInt(ut[2],10);I!==1&&B(G,"unacceptable YAML version of the document"),G.version=pt[0],G.checkLineBreaks=U<2,U!==1&&U!==2&&q(G,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:b(function(G,ht,pt){let ut;pt.length!==2&&B(G,"TAG directive accepts exactly two arguments");const I=pt[0];ut=pt[1],g.test(I)||B(G,"ill-formed tag handle (first argument) of the TAG directive"),o.call(G.tagMap,I)&&B(G,'there is a previously declared suffix for "'+I+'" tag handle'),m.test(ut)||B(G,"ill-formed tag prefix (second argument) of the TAG directive");try{ut=decodeURIComponent(ut)}catch{B(G,"tag prefix is malformed: "+ut)}G.tagMap[I]=ut},"handleTagDirective")};function rt(w,G,ht,pt){if(G<ht){const ut=w.input.slice(G,ht);if(pt)for(let I=0,U=ut.length;I<U;I+=1){const K=ut.charCodeAt(I);K===9||K>=32&&K<=1114111||B(w,"expected valid JSON character")}else u.test(ut)&&B(w,"the stream contains non-printable characters");w.result+=ut}}b(rt,"captureSegment");function et(w){w.totalMergeKeys++,w.maxTotalMergeKeys!==-1&&w.totalMergeKeys>w.maxTotalMergeKeys&&B(w,"merge keys exceeded maxTotalMergeKeys ("+w.maxTotalMergeKeys+")")}b(et,"chargeMergeWork");function J(w,G,ht,pt){e.isObject(ht)||B(w,"cannot merge mappings; the provided source object is unacceptable"),et(w);const ut=Object.keys(ht);for(let I=0,U=ut.length;I<U;I+=1){const K=ut[I];et(w),o.call(G,K)||($(G,K,ht[K]),pt[K]=!0)}}b(J,"mergeMappings");function at(w,G,ht,pt,ut,I,U,K,ct){if(Array.isArray(ut)){ut=Array.prototype.slice.call(ut);for(let yt=0,vt=ut.length;yt<vt;yt+=1)Array.isArray(ut[yt])&&B(w,"nested arrays are not supported inside keys"),typeof ut=="object"&&y(ut[yt])==="[object Object]"&&(ut[yt]="[object Object]")}if(typeof ut=="object"&&y(ut)==="[object Object]"&&(ut="[object Object]"),ut=String(ut),G===null&&(G={}),pt==="tag:yaml.org,2002:merge")if(Array.isArray(I)){I.length>100&&B(w,"abnormal merge sequence size");for(let yt=0,vt=I.length;yt<vt;yt+=1)J(w,G,I[yt],ht)}else J(w,G,I,ht);else!w.json&&!o.call(ht,ut)&&o.call(G,ut)&&(w.line=U||w.line,w.lineStart=K||w.lineStart,w.position=ct||w.position,B(w,"duplicated mapping key")),$(G,ut,I),delete ht[ut];return G}b(at,"storeMappingPair");function xt(w){const G=w.input.charCodeAt(w.position);G===10?w.position++:G===13?(w.position++,w.input.charCodeAt(w.position)===10&&w.position++):B(w,"a line break is expected"),w.line+=1,w.lineStart=w.position,w.firstTabInLine=-1}b(xt,"readLineBreak");function H(w,G,ht){let pt=0,ut=w.input.charCodeAt(w.position);for(;ut!==0;){for(;C(ut);)ut===9&&w.firstTabInLine===-1&&(w.firstTabInLine=w.position),ut=w.input.charCodeAt(++w.position);if(G&&ut===35)do ut=w.input.charCodeAt(++w.position);while(ut!==10&&ut!==13&&ut!==0);if(x(ut))for(xt(w),ut=w.input.charCodeAt(w.position),pt++,w.lineIndent=0;ut===32;)w.lineIndent++,ut=w.input.charCodeAt(++w.position);else break}return ht!==-1&&pt!==0&&w.lineIndent<ht&&q(w,"deficient indentation"),pt}b(H,"skipSeparationSpace");function Y(w){let G=w.position,ht=w.input.charCodeAt(G);return!!((ht===45||ht===46)&&ht===w.input.charCodeAt(G+1)&&ht===w.input.charCodeAt(G+2)&&(G+=3,ht=w.input.charCodeAt(G),ht===0||k(ht)))}b(Y,"testDocumentSeparator");function Z(w,G){G===1?w.result+=" ":G>1&&(w.result+=e.repeat(`
11
+ `,G-1))}b(Z,"writeFoldedLines");function tt(w,G,ht){let pt,ut,I,U,K,ct;const yt=w.kind,vt=w.result;let ot=w.input.charCodeAt(w.position);if(k(ot)||v(ot)||ot===35||ot===38||ot===42||ot===33||ot===124||ot===62||ot===39||ot===34||ot===37||ot===64||ot===96)return!1;if(ot===63||ot===45){const kt=w.input.charCodeAt(w.position+1);if(k(kt)||ht&&v(kt))return!1}for(w.kind="scalar",w.result="",pt=ut=w.position,I=!1;ot!==0;){if(ot===58){const kt=w.input.charCodeAt(w.position+1);if(k(kt)||ht&&v(kt))break}else if(ot===35){const kt=w.input.charCodeAt(w.position-1);if(k(kt))break}else{if(w.position===w.lineStart&&Y(w)||ht&&v(ot))break;if(x(ot))if(U=w.line,K=w.lineStart,ct=w.lineIndent,H(w,!1,-1),w.lineIndent>=G){I=!0,ot=w.input.charCodeAt(w.position);continue}else{w.position=ut,w.line=U,w.lineStart=K,w.lineIndent=ct;break}}I&&(rt(w,pt,ut,!1),Z(w,w.line-U),pt=ut=w.position,I=!1),C(ot)||(ut=w.position+1),ot=w.input.charCodeAt(++w.position)}return rt(w,pt,ut,!1),w.result?!0:(w.kind=yt,w.result=vt,!1)}b(tt,"readPlainScalar");function st(w,G){let ht,pt,ut=w.input.charCodeAt(w.position);if(ut!==39)return!1;for(w.kind="scalar",w.result="",w.position++,ht=pt=w.position;(ut=w.input.charCodeAt(w.position))!==0;)if(ut===39)if(rt(w,ht,w.position,!0),ut=w.input.charCodeAt(++w.position),ut===39)ht=w.position,w.position++,pt=w.position;else return!0;else x(ut)?(rt(w,ht,pt,!0),Z(w,H(w,!1,G)),ht=pt=w.position):w.position===w.lineStart&&Y(w)?B(w,"unexpected end of the document within a single quoted scalar"):(w.position++,C(ut)||(pt=w.position));B(w,"unexpected end of the stream within a single quoted scalar")}b(st,"readSingleQuotedScalar");function It(w,G){let ht,pt,ut,I=w.input.charCodeAt(w.position);if(I!==34)return!1;for(w.kind="scalar",w.result="",w.position++,ht=pt=w.position;(I=w.input.charCodeAt(w.position))!==0;){if(I===34)return rt(w,ht,w.position,!0),w.position++,!0;if(I===92){if(rt(w,ht,w.position,!0),I=w.input.charCodeAt(++w.position),x(I))H(w,!1,G);else if(I<256&&P[I])w.result+=D[I],w.position++;else if((ut=A(I))>0){let U=ut,K=0;for(;U>0;U--)I=w.input.charCodeAt(++w.position),(ut=M(I))>=0?K=(K<<4)+ut:B(w,"expected hexadecimal character");w.result+=_(K),w.position++}else B(w,"unknown escape sequence");ht=pt=w.position}else x(I)?(rt(w,ht,pt,!0),Z(w,H(w,!1,G)),ht=pt=w.position):w.position===w.lineStart&&Y(w)?B(w,"unexpected end of the document within a double quoted scalar"):(w.position++,C(I)||(pt=w.position))}B(w,"unexpected end of the stream within a double quoted scalar")}b(It,"readDoubleQuotedScalar");function zt(w,G){let ht=!0,pt,ut,I;const U=w.tag;let K;const ct=w.anchor;let yt,vt,ot,kt;const Xt=Object.create(null);let re,Kt,xe,Ee=w.input.charCodeAt(w.position);if(Ee===91)yt=93,kt=!1,K=[];else if(Ee===123)yt=125,kt=!0,K={};else return!1;for(w.anchor!==null&&W(w,w.anchor,K),Ee=w.input.charCodeAt(++w.position);Ee!==0;){if(H(w,!0,G),Ee=w.input.charCodeAt(w.position),Ee===yt)return w.position++,w.tag=U,w.anchor=ct,w.kind=kt?"mapping":"sequence",w.result=K,!0;if(ht?Ee===44&&B(w,"expected the node content, but found ','"):B(w,"missed comma between flow collection entries"),Kt=re=xe=null,vt=ot=!1,Ee===63){const ri=w.input.charCodeAt(w.position+1);k(ri)&&(vt=ot=!0,w.position++,H(w,!0,G))}pt=w.line,ut=w.lineStart,I=w.position,$e(w,G,a,!1,!0),Kt=w.tag,re=w.result,H(w,!0,G),Ee=w.input.charCodeAt(w.position),(ot||w.line===pt)&&Ee===58&&(vt=!0,Ee=w.input.charCodeAt(++w.position),H(w,!0,G),$e(w,G,a,!1,!0),xe=w.result),kt?at(w,K,Xt,Kt,re,xe,pt,ut,I):vt?K.push(at(w,null,Xt,Kt,re,xe,pt,ut,I)):K.push(re),H(w,!0,G),Ee=w.input.charCodeAt(w.position),Ee===44?(ht=!0,Ee=w.input.charCodeAt(++w.position)):ht=!1}B(w,"unexpected end of the stream within a flow collection")}b(zt,"readFlowCollection");function Wt(w,G){let ht,pt=c,ut=!1,I=!1,U=G,K=0,ct=!1,yt,vt=w.input.charCodeAt(w.position);if(vt===124)ht=!1;else if(vt===62)ht=!0;else return!1;for(w.kind="scalar",w.result="";vt!==0;)if(vt=w.input.charCodeAt(++w.position),vt===43||vt===45)c===pt?pt=vt===43?d:h:B(w,"repeat of a chomping mode identifier");else if((yt=L(vt))>=0)yt===0?B(w,"bad explicit indentation width of a block scalar; it cannot be less than one"):I?B(w,"repeat of an indentation width identifier"):(U=G+yt-1,I=!0);else break;if(C(vt)){do vt=w.input.charCodeAt(++w.position);while(C(vt));if(vt===35)do vt=w.input.charCodeAt(++w.position);while(!x(vt)&&vt!==0)}for(;vt!==0;){for(xt(w),w.lineIndent=0,vt=w.input.charCodeAt(w.position);(!I||w.lineIndent<U)&&vt===32;)w.lineIndent++,vt=w.input.charCodeAt(++w.position);if(!I&&w.lineIndent>U&&(U=w.lineIndent),x(vt)){K++;continue}if(!I&&U===0&&B(w,"missing indentation for block scalar"),w.lineIndent<U){pt===d?w.result+=e.repeat(`
12
+ `,ut?1+K:K):pt===c&&ut&&(w.result+=`
13
+ `);break}ht?C(vt)?(ct=!0,w.result+=e.repeat(`
14
+ `,ut?1+K:K)):ct?(ct=!1,w.result+=e.repeat(`
15
+ `,K+1)):K===0?ut&&(w.result+=" "):w.result+=e.repeat(`
16
+ `,K):w.result+=e.repeat(`
17
+ `,ut?1+K:K),ut=!0,I=!0,K=0;const ot=w.position;for(;!x(vt)&&vt!==0;)vt=w.input.charCodeAt(++w.position);rt(w,ot,w.position,!1)}return!0}b(Wt,"readBlockScalar");function Zt(w,G){const ht=w.tag,pt=w.anchor,ut=[];let I=!1;if(w.firstTabInLine!==-1)return!1;w.anchor!==null&&W(w,w.anchor,ut);let U=w.input.charCodeAt(w.position);for(;U!==0&&(w.firstTabInLine!==-1&&(w.position=w.firstTabInLine,B(w,"tab characters must not be used in indentation")),U===45);){const K=w.input.charCodeAt(w.position+1);if(!k(K))break;if(I=!0,w.position++,H(w,!0,-1)&&w.lineIndent<=G){ut.push(null),U=w.input.charCodeAt(w.position);continue}const ct=w.line;if($e(w,G,n,!1,!0),ut.push(w.result),H(w,!0,-1),U=w.input.charCodeAt(w.position),(w.line===ct||w.lineIndent>G)&&U!==0)B(w,"bad indentation of a sequence entry");else if(w.lineIndent<G)break}return I?(w.tag=ht,w.anchor=pt,w.kind="sequence",w.result=ut,!0):!1}b(Zt,"readBlockSequence");function $t(w,G,ht){let pt,ut,I,U;const K=w.tag,ct=w.anchor,yt={},vt=Object.create(null);let ot=null,kt=null,Xt=null,re=!1,Kt=!1;if(w.firstTabInLine!==-1)return!1;w.anchor!==null&&W(w,w.anchor,yt);let xe=w.input.charCodeAt(w.position);for(;xe!==0;){!re&&w.firstTabInLine!==-1&&(w.position=w.firstTabInLine,B(w,"tab characters must not be used in indentation"));const Ee=w.input.charCodeAt(w.position+1),ri=w.line;if((xe===63||xe===58)&&k(Ee))xe===63?(re&&(at(w,yt,vt,ot,kt,null,ut,I,U),ot=kt=Xt=null),Kt=!0,re=!0,pt=!0):re?(re=!1,pt=!0):B(w,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),w.position+=1,xe=Ee;else{if(ut=w.line,I=w.lineStart,U=w.position,!$e(w,ht,s,!1,!0))break;if(w.line===ri){for(xe=w.input.charCodeAt(w.position);C(xe);)xe=w.input.charCodeAt(++w.position);if(xe===58)xe=w.input.charCodeAt(++w.position),k(xe)||B(w,"a whitespace character is expected after the key-value separator within a block mapping"),re&&(at(w,yt,vt,ot,kt,null,ut,I,U),ot=kt=Xt=null),Kt=!0,re=!1,pt=!1,ot=w.tag,kt=w.result;else if(Kt)B(w,"can not read an implicit mapping pair; a colon is missed");else return w.tag=K,w.anchor=ct,!0}else if(Kt)B(w,"can not read a block mapping entry; a multiline key may not be an implicit key");else return w.tag=K,w.anchor=ct,!0}if((w.line===ri||w.lineIndent>G)&&(re&&(ut=w.line,I=w.lineStart,U=w.position),$e(w,G,l,!0,pt)&&(re?kt=w.result:Xt=w.result),re||(at(w,yt,vt,ot,kt,Xt,ut,I,U),ot=kt=Xt=null),H(w,!0,-1),xe=w.input.charCodeAt(w.position)),(w.line===ri||w.lineIndent>G)&&xe!==0)B(w,"bad indentation of a mapping entry");else if(w.lineIndent<G)break}return re&&at(w,yt,vt,ot,kt,null,ut,I,U),Kt&&(w.tag=K,w.anchor=ct,w.kind="mapping",w.result=yt),Kt}b($t,"readBlockMapping");function Nt(w){let G=!1,ht=!1,pt,ut,I=w.input.charCodeAt(w.position);if(I!==33)return!1;w.tag!==null&&B(w,"duplication of a tag property"),I=w.input.charCodeAt(++w.position),I===60?(G=!0,I=w.input.charCodeAt(++w.position)):I===33?(ht=!0,pt="!!",I=w.input.charCodeAt(++w.position)):pt="!";let U=w.position;if(G){do I=w.input.charCodeAt(++w.position);while(I!==0&&I!==62);w.position<w.length?(ut=w.input.slice(U,w.position),I=w.input.charCodeAt(++w.position)):B(w,"unexpected end of the stream within a verbatim tag")}else{for(;I!==0&&!k(I);)I===33&&(ht?B(w,"tag suffix cannot contain exclamation marks"):(pt=w.input.slice(U-1,w.position+1),g.test(pt)||B(w,"named tag handle cannot contain such characters"),ht=!0,U=w.position+1)),I=w.input.charCodeAt(++w.position);ut=w.input.slice(U,w.position),p.test(ut)&&B(w,"tag suffix cannot contain flow indicator characters")}ut&&!m.test(ut)&&B(w,"tag name cannot contain such characters: "+ut);try{ut=decodeURIComponent(ut)}catch{B(w,"tag name is malformed: "+ut)}return G?w.tag=ut:o.call(w.tagMap,pt)?w.tag=w.tagMap[pt]+ut:pt==="!"?w.tag="!"+ut:pt==="!!"?w.tag="tag:yaml.org,2002:"+ut:B(w,'undeclared tag handle "'+pt+'"'),!0}b(Nt,"readTagProperty");function _e(w){let G=w.input.charCodeAt(w.position);if(G!==38)return!1;w.anchor!==null&&B(w,"duplication of an anchor property"),G=w.input.charCodeAt(++w.position);const ht=w.position;for(;G!==0&&!k(G)&&!v(G);)G=w.input.charCodeAt(++w.position);return w.position===ht&&B(w,"name of an anchor node must contain at least one character"),w.anchor=w.input.slice(ht,w.position),!0}b(_e,"readAnchorProperty");function Ot(w){let G=w.input.charCodeAt(w.position);if(G!==42)return!1;G=w.input.charCodeAt(++w.position);const ht=w.position;for(;G!==0&&!k(G)&&!v(G);)G=w.input.charCodeAt(++w.position);w.position===ht&&B(w,"name of an alias node must contain at least one character");const pt=w.input.slice(ht,w.position);return o.call(w.anchorMap,pt)||B(w,'unidentified alias "'+pt+'"'),w.result=w.anchorMap[pt],H(w,!0,-1),!0}b(Ot,"readAlias");function ue(w,G,ht,pt){const ut=j(w);return O(w),z(w,G),w.tag=null,w.anchor=null,w.kind=null,w.result=null,$t(w,ht,pt)&&w.kind==="mapping"?(R(w),!0):(V(w),z(w,ut),!1)}b(ue,"tryReadBlockMappingFromProperty");function $e(w,G,ht,pt,ut){let I,U,K=1,ct=!1,yt=!1,vt=null,ot,kt,Xt;w.depth>=w.maxDepth&&B(w,"nesting exceeded maxDepth ("+w.maxDepth+")"),w.depth+=1,w.listener!==null&&w.listener("open",w),w.tag=null,w.anchor=null,w.kind=null,w.result=null;const re=I=U=l===ht||n===ht;if(pt&&H(w,!0,-1)&&(ct=!0,w.lineIndent>G?K=1:w.lineIndent===G?K=0:w.lineIndent<G&&(K=-1)),K===1)for(;;){const Kt=w.input.charCodeAt(w.position),xe=j(w);if(ct&&(Kt===33&&w.tag!==null||Kt===38&&w.anchor!==null)||!Nt(w)&&!_e(w))break;vt===null&&(vt=xe),H(w,!0,-1)?(ct=!0,U=re,w.lineIndent>G?K=1:w.lineIndent===G?K=0:w.lineIndent<G&&(K=-1)):U=!1}if(U&&(U=ct||ut),K===1||l===ht)if(a===ht||s===ht?kt=G:kt=G+1,Xt=w.position-w.lineStart,K===1)if(U&&(Zt(w,Xt)||$t(w,Xt,kt))||zt(w,kt))yt=!0;else{const Kt=w.input.charCodeAt(w.position);vt!==null&&re&&!U&&Kt!==124&&Kt!==62&&ue(w,vt,vt.position-vt.lineStart,kt)||I&&Wt(w,kt)||st(w,kt)||It(w,kt)?yt=!0:Ot(w)?(yt=!0,(w.tag!==null||w.anchor!==null)&&B(w,"alias node should not have any properties")):tt(w,kt,a===ht)&&(yt=!0,w.tag===null&&(w.tag="?")),w.anchor!==null&&W(w,w.anchor,w.result)}else K===0&&(yt=U&&Zt(w,Xt));if(w.tag===null)w.anchor!==null&&W(w,w.anchor,w.result);else if(w.tag==="?"){w.result!==null&&w.kind!=="scalar"&&B(w,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+w.kind+'"');for(let Kt=0,xe=w.implicitTypes.length;Kt<xe;Kt+=1)if(ot=w.implicitTypes[Kt],ot.resolve(w.result)){w.result=ot.construct(w.result),w.tag=ot.tag,w.anchor!==null&&W(w,w.anchor,w.result);break}}else if(w.tag!=="!"){if(o.call(w.typeMap[w.kind||"fallback"],w.tag))ot=w.typeMap[w.kind||"fallback"][w.tag];else{ot=null;const Kt=w.typeMap.multi[w.kind||"fallback"];for(let xe=0,Ee=Kt.length;xe<Ee;xe+=1)if(w.tag.slice(0,Kt[xe].tag.length)===Kt[xe].tag){ot=Kt[xe];break}}ot||B(w,"unknown tag !<"+w.tag+">"),w.result!==null&&ot.kind!==w.kind&&B(w,"unacceptable node kind for !<"+w.tag+'> tag; it should be "'+ot.kind+'", not "'+w.kind+'"'),ot.resolve(w.result,w.tag)?(w.result=ot.construct(w.result,w.tag),w.anchor!==null&&W(w,w.anchor,w.result)):B(w,"cannot resolve a node with !<"+w.tag+"> explicit tag")}return w.listener!==null&&w.listener("close",w),w.depth-=1,w.tag!==null||w.anchor!==null||yt}b($e,"composeNode");function Ce(w){const G=w.position;let ht=!1,pt;for(w.version=null,w.checkLineBreaks=w.legacy,w.tagMap=Object.create(null),w.anchorMap=Object.create(null);(pt=w.input.charCodeAt(w.position))!==0&&(H(w,!0,-1),pt=w.input.charCodeAt(w.position),!(w.lineIndent>0||pt!==37));){ht=!0,pt=w.input.charCodeAt(++w.position);let ut=w.position;for(;pt!==0&&!k(pt);)pt=w.input.charCodeAt(++w.position);const I=w.input.slice(ut,w.position),U=[];for(I.length<1&&B(w,"directive name must not be less than one character in length");pt!==0;){for(;C(pt);)pt=w.input.charCodeAt(++w.position);if(pt===35){do pt=w.input.charCodeAt(++w.position);while(pt!==0&&!x(pt));break}if(x(pt))break;for(ut=w.position;pt!==0&&!k(pt);)pt=w.input.charCodeAt(++w.position);U.push(w.input.slice(ut,w.position))}pt!==0&&xt(w),o.call(Q,I)?Q[I](w,I,U):q(w,'unknown document directive "'+I+'"')}if(H(w,!0,-1),w.lineIndent===0&&w.input.charCodeAt(w.position)===45&&w.input.charCodeAt(w.position+1)===45&&w.input.charCodeAt(w.position+2)===45?(w.position+=3,H(w,!0,-1)):ht&&B(w,"directives end mark is expected"),$e(w,w.lineIndent-1,l,!1,!0),H(w,!0,-1),w.checkLineBreaks&&f.test(w.input.slice(G,w.position))&&q(w,"non-ASCII line breaks are interpreted as content"),w.documents.push(w.result),w.position===w.lineStart&&Y(w)){w.input.charCodeAt(w.position)===46&&(w.position+=3,H(w,!0,-1));return}w.position<w.length-1&&B(w,"end of the stream or a document separator is expected")}b(Ce,"readDocument");function we(w,G){w=String(w),G=G||{},w.length!==0&&(w.charCodeAt(w.length-1)!==10&&w.charCodeAt(w.length-1)!==13&&(w+=`
18
+ `),w.charCodeAt(0)===65279&&(w=w.slice(1)));const ht=new F(w,G),pt=w.indexOf("\0");for(pt!==-1&&(ht.position=pt,B(ht,"null byte is not allowed in input")),ht.input+="\0";ht.input.charCodeAt(ht.position)===32;)ht.lineIndent+=1,ht.position+=1;for(;ht.position<ht.length-1;)Ce(ht);return ht.documents}b(we,"loadDocuments");function Tt(w,G,ht){G!==null&&typeof G=="object"&&typeof ht>"u"&&(ht=G,G=null);const pt=we(w,ht);if(typeof G!="function")return pt;for(let ut=0,I=pt.length;ut<I;ut+=1)G(pt[ut])}b(Tt,"loadAll2");function Yt(w,G){const ht=we(w,G);if(ht.length!==0){if(ht.length===1)return ht[0];throw new t("expected a single document in the stream, but found more")}}return b(Yt,"load2"),kn.loadAll=Tt,kn.load=Yt,kn}b(zp,"requireLoader");var Ec={},gf;function Hp(){if(gf)return Ec;gf=1;const e=fs(),t=gs(),r=Rl(),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=65279,s=9,n=10,l=13,c=32,h=33,d=34,u=35,f=37,p=38,g=39,m=42,y=44,x=45,C=58,k=61,v=62,M=63,A=64,L=91,T=93,_=96,$=123,P=124,D=125,F={};F[0]="\\0",F[7]="\\a",F[8]="\\b",F[9]="\\t",F[10]="\\n",F[11]="\\v",F[12]="\\f",F[13]="\\r",F[27]="\\e",F[34]='\\"',F[92]="\\\\",F[133]="\\N",F[160]="\\_",F[8232]="\\L",F[8233]="\\P";const E=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],B=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function q(I,U){if(U===null)return{};const K={},ct=Object.keys(U);for(let yt=0,vt=ct.length;yt<vt;yt+=1){let ot=ct[yt],kt=String(U[ot]);ot.slice(0,2)==="!!"&&(ot="tag:yaml.org,2002:"+ot.slice(2));const Xt=I.compiledTypeMap.fallback[ot];Xt&&o.call(Xt.styleAliases,kt)&&(kt=Xt.styleAliases[kt]),K[ot]=kt}return K}b(q,"compileStyleMap");function W(I){let U,K;const ct=I.toString(16).toUpperCase();if(I<=255)U="x",K=2;else if(I<=65535)U="u",K=4;else if(I<=4294967295)U="U",K=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+U+e.repeat("0",K-ct.length)+ct}b(W,"encodeHex");const O=1,R=2;function V(I){this.schema=I.schema||r,this.indent=Math.max(1,I.indent||2),this.noArrayIndent=I.noArrayIndent||!1,this.skipInvalid=I.skipInvalid||!1,this.flowLevel=e.isNothing(I.flowLevel)?-1:I.flowLevel,this.styleMap=q(this.schema,I.styles||null),this.sortKeys=I.sortKeys||!1,this.lineWidth=I.lineWidth||80,this.noRefs=I.noRefs||!1,this.noCompatMode=I.noCompatMode||!1,this.condenseFlow=I.condenseFlow||!1,this.quotingType=I.quotingType==='"'?R:O,this.forceQuotes=I.forceQuotes||!1,this.replacer=typeof I.replacer=="function"?I.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}b(V,"State");function j(I,U){const K=e.repeat(" ",U);let ct=0,yt="";const vt=I.length;for(;ct<vt;){let ot;const kt=I.indexOf(`
19
+ `,ct);kt===-1?(ot=I.slice(ct),ct=vt):(ot=I.slice(ct,kt+1),ct=kt+1),ot.length&&ot!==`
20
+ `&&(yt+=K),yt+=ot}return yt}b(j,"indentString");function z(I,U){return`
21
+ `+e.repeat(" ",I.indent*U)}b(z,"generateNextLine");function Q(I,U){for(let K=0,ct=I.implicitTypes.length;K<ct;K+=1)if(I.implicitTypes[K].resolve(U))return!0;return!1}b(Q,"testImplicitResolving");function rt(I){return I===c||I===s}b(rt,"isWhitespace");function et(I){return I>=32&&I<=126||I>=161&&I<=55295&&I!==8232&&I!==8233||I>=57344&&I<=65533&&I!==a||I>=65536&&I<=1114111}b(et,"isPrintable");function J(I){return et(I)&&I!==a&&I!==l&&I!==n}b(J,"isNsCharOrWhitespace");function at(I,U,K){const ct=J(I),yt=ct&&!rt(I);return(K?ct:ct&&I!==y&&I!==L&&I!==T&&I!==$&&I!==D)&&I!==u&&!(U===C&&!yt)||J(U)&&!rt(U)&&I===u||U===C&&yt}b(at,"isPlainSafe");function xt(I){return et(I)&&I!==a&&!rt(I)&&I!==x&&I!==M&&I!==C&&I!==y&&I!==L&&I!==T&&I!==$&&I!==D&&I!==u&&I!==p&&I!==m&&I!==h&&I!==P&&I!==k&&I!==v&&I!==g&&I!==d&&I!==f&&I!==A&&I!==_}b(xt,"isPlainSafeFirst");function H(I){return!rt(I)&&I!==C}b(H,"isPlainSafeLast");function Y(I,U){const K=I.charCodeAt(U);let ct;return K>=55296&&K<=56319&&U+1<I.length&&(ct=I.charCodeAt(U+1),ct>=56320&&ct<=57343)?(K-55296)*1024+ct-56320+65536:K}b(Y,"codePointAt");function Z(I){return/^\n* /.test(I)}b(Z,"needIndentIndicator");const tt=1,st=2,It=3,zt=4,Wt=5;function Zt(I,U,K,ct,yt,vt,ot,kt){let Xt,re=0,Kt=null,xe=!1,Ee=!1;const ri=ct!==-1;let lo=-1,co=xt(Y(I,0))&&H(Y(I,I.length-1));if(U||ot)for(Xt=0;Xt<I.length;re>=65536?Xt+=2:Xt++){if(re=Y(I,Xt),!et(re))return Wt;co=co&&at(re,Kt,kt),Kt=re}else{for(Xt=0;Xt<I.length;re>=65536?Xt+=2:Xt++){if(re=Y(I,Xt),re===n)xe=!0,ri&&(Ee=Ee||Xt-lo-1>ct&&I[lo+1]!==" ",lo=Xt);else if(!et(re))return Wt;co=co&&at(re,Kt,kt),Kt=re}Ee=Ee||ri&&Xt-lo-1>ct&&I[lo+1]!==" "}return!xe&&!Ee?co&&!ot&&!yt(I)?tt:vt===R?Wt:st:K>9&&Z(I)?Wt:ot?vt===R?Wt:st:Ee?zt:It}b(Zt,"chooseScalarStyle");function $t(I,U,K,ct,yt){I.dump=(function(){if(U.length===0)return I.quotingType===R?'""':"''";if(!I.noCompatMode&&(E.indexOf(U)!==-1||B.test(U)))return I.quotingType===R?'"'+U+'"':"'"+U+"'";const vt=I.indent*Math.max(1,K),ot=I.lineWidth===-1?-1:Math.max(Math.min(I.lineWidth,40),I.lineWidth-vt),kt=ct||I.flowLevel>-1&&K>=I.flowLevel;function Xt(re){return Q(I,re)}switch(b(Xt,"testAmbiguity"),Zt(U,kt,I.indent,ot,Xt,I.quotingType,I.forceQuotes&&!ct,yt)){case tt:return U;case st:return"'"+U.replace(/'/g,"''")+"'";case It:return"|"+Nt(U,I.indent)+_e(j(U,vt));case zt:return">"+Nt(U,I.indent)+_e(j(Ot(U,ot),vt));case Wt:return'"'+$e(U)+'"';default:throw new t("impossible error: invalid scalar style")}})()}b($t,"writeScalar");function Nt(I,U){const K=Z(I)?String(U):"",ct=I[I.length-1]===`
22
+ `,vt=ct&&(I[I.length-2]===`
23
+ `||I===`
24
+ `)?"+":ct?"":"-";return K+vt+`
25
+ `}b(Nt,"blockHeader");function _e(I){return I[I.length-1]===`
26
+ `?I.slice(0,-1):I}b(_e,"dropEndingNewline");function Ot(I,U){const K=/(\n+)([^\n]*)/g;let ct=(function(){let kt=I.indexOf(`
27
+ `);return kt=kt!==-1?kt:I.length,K.lastIndex=kt,ue(I.slice(0,kt),U)})(),yt=I[0]===`
28
+ `||I[0]===" ",vt,ot;for(;ot=K.exec(I);){const kt=ot[1],Xt=ot[2];vt=Xt[0]===" ",ct+=kt+(!yt&&!vt&&Xt!==""?`
29
+ `:"")+ue(Xt,U),yt=vt}return ct}b(Ot,"foldString");function ue(I,U){if(I===""||I[0]===" ")return I;const K=/ [^ ]/g;let ct,yt=0,vt,ot=0,kt=0,Xt="";for(;ct=K.exec(I);)kt=ct.index,kt-yt>U&&(vt=ot>yt?ot:kt,Xt+=`
30
+ `+I.slice(yt,vt),yt=vt+1),ot=kt;return Xt+=`
31
+ `,I.length-yt>U&&ot>yt?Xt+=I.slice(yt,ot)+`
32
+ `+I.slice(ot+1):Xt+=I.slice(yt),Xt.slice(1)}b(ue,"foldLine");function $e(I){let U="",K=0;for(let ct=0;ct<I.length;K>=65536?ct+=2:ct++){K=Y(I,ct);const yt=F[K];!yt&&et(K)?(U+=I[ct],K>=65536&&(U+=I[ct+1])):U+=yt||W(K)}return U}b($e,"escapeString");function Ce(I,U,K){let ct="";const yt=I.tag;for(let vt=0,ot=K.length;vt<ot;vt+=1){let kt=K[vt];I.replacer&&(kt=I.replacer.call(K,String(vt),kt)),(G(I,U,kt,!1,!1)||typeof kt>"u"&&G(I,U,null,!1,!1))&&(ct!==""&&(ct+=","+(I.condenseFlow?"":" ")),ct+=I.dump)}I.tag=yt,I.dump="["+ct+"]"}b(Ce,"writeFlowSequence");function we(I,U,K,ct){let yt="";const vt=I.tag;for(let ot=0,kt=K.length;ot<kt;ot+=1){let Xt=K[ot];I.replacer&&(Xt=I.replacer.call(K,String(ot),Xt)),(G(I,U+1,Xt,!0,!0,!1,!0)||typeof Xt>"u"&&G(I,U+1,null,!0,!0,!1,!0))&&((!ct||yt!=="")&&(yt+=z(I,U)),I.dump&&n===I.dump.charCodeAt(0)?yt+="-":yt+="- ",yt+=I.dump)}I.tag=vt,I.dump=yt||"[]"}b(we,"writeBlockSequence");function Tt(I,U,K){let ct="";const yt=I.tag,vt=Object.keys(K);for(let ot=0,kt=vt.length;ot<kt;ot+=1){let Xt="";ct!==""&&(Xt+=", "),I.condenseFlow&&(Xt+='"');const re=vt[ot];let Kt=K[re];I.replacer&&(Kt=I.replacer.call(K,re,Kt)),G(I,U,re,!1,!1)&&(I.dump.length>1024&&(Xt+="? "),Xt+=I.dump+(I.condenseFlow?'"':"")+":"+(I.condenseFlow?"":" "),G(I,U,Kt,!1,!1)&&(Xt+=I.dump,ct+=Xt))}I.tag=yt,I.dump="{"+ct+"}"}b(Tt,"writeFlowMapping");function Yt(I,U,K,ct){let yt="";const vt=I.tag,ot=Object.keys(K);if(I.sortKeys===!0)ot.sort();else if(typeof I.sortKeys=="function")ot.sort(I.sortKeys);else if(I.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let kt=0,Xt=ot.length;kt<Xt;kt+=1){let re="";(!ct||yt!=="")&&(re+=z(I,U));const Kt=ot[kt];let xe=K[Kt];if(I.replacer&&(xe=I.replacer.call(K,Kt,xe)),!G(I,U+1,Kt,!0,!0,!0))continue;const Ee=I.tag!==null&&I.tag!=="?"||I.dump&&I.dump.length>1024;Ee&&(I.dump&&n===I.dump.charCodeAt(0)?re+="?":re+="? "),re+=I.dump,Ee&&(re+=z(I,U)),G(I,U+1,xe,!0,Ee)&&(I.dump&&n===I.dump.charCodeAt(0)?re+=":":re+=": ",re+=I.dump,yt+=re)}I.tag=vt,I.dump=yt||"{}"}b(Yt,"writeBlockMapping");function w(I,U,K){const ct=K?I.explicitTypes:I.implicitTypes;for(let yt=0,vt=ct.length;yt<vt;yt+=1){const ot=ct[yt];if((ot.instanceOf||ot.predicate)&&(!ot.instanceOf||typeof U=="object"&&U instanceof ot.instanceOf)&&(!ot.predicate||ot.predicate(U))){if(K?ot.multi&&ot.representName?I.tag=ot.representName(U):I.tag=ot.tag:I.tag="?",ot.represent){const kt=I.styleMap[ot.tag]||ot.defaultStyle;let Xt;if(i.call(ot.represent)==="[object Function]")Xt=ot.represent(U,kt);else if(o.call(ot.represent,kt))Xt=ot.represent[kt](U,kt);else throw new t("!<"+ot.tag+'> tag resolver accepts not "'+kt+'" style');I.dump=Xt}return!0}}return!1}b(w,"detectType");function G(I,U,K,ct,yt,vt,ot){I.tag=null,I.dump=K,w(I,K,!1)||w(I,K,!0);const kt=i.call(I.dump),Xt=ct;ct&&(ct=I.flowLevel<0||I.flowLevel>U);const re=kt==="[object Object]"||kt==="[object Array]";let Kt,xe;if(re&&(Kt=I.duplicates.indexOf(K),xe=Kt!==-1),(I.tag!==null&&I.tag!=="?"||xe||I.indent!==2&&U>0)&&(yt=!1),xe&&I.usedDuplicates[Kt])I.dump="*ref_"+Kt;else{if(re&&xe&&!I.usedDuplicates[Kt]&&(I.usedDuplicates[Kt]=!0),kt==="[object Object]")ct&&Object.keys(I.dump).length!==0?(Yt(I,U,I.dump,yt),xe&&(I.dump="&ref_"+Kt+I.dump)):(Tt(I,U,I.dump),xe&&(I.dump="&ref_"+Kt+" "+I.dump));else if(kt==="[object Array]")ct&&I.dump.length!==0?(I.noArrayIndent&&!ot&&U>0?we(I,U-1,I.dump,yt):we(I,U,I.dump,yt),xe&&(I.dump="&ref_"+Kt+I.dump)):(Ce(I,U,I.dump),xe&&(I.dump="&ref_"+Kt+" "+I.dump));else if(kt==="[object String]")I.tag!=="?"&&$t(I,I.dump,U,vt,Xt);else{if(kt==="[object Undefined]")return!1;if(I.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+kt)}if(I.tag!==null&&I.tag!=="?"){let Ee=encodeURI(I.tag[0]==="!"?I.tag.slice(1):I.tag).replace(/!/g,"%21");I.tag[0]==="!"?Ee="!"+Ee:Ee.slice(0,18)==="tag:yaml.org,2002:"?Ee="!!"+Ee.slice(18):Ee="!<"+Ee+">",I.dump=Ee+" "+I.dump}}return!0}b(G,"writeNode");function ht(I,U){const K=[],ct=[];pt(I,K,ct);const yt=ct.length;for(let vt=0;vt<yt;vt+=1)U.duplicates.push(K[ct[vt]]);U.usedDuplicates=new Array(yt)}b(ht,"getDuplicateReferences");function pt(I,U,K){if(I!==null&&typeof I=="object"){const ct=U.indexOf(I);if(ct!==-1)K.indexOf(ct)===-1&&K.push(ct);else if(U.push(I),Array.isArray(I))for(let yt=0,vt=I.length;yt<vt;yt+=1)pt(I[yt],U,K);else{const yt=Object.keys(I);for(let vt=0,ot=yt.length;vt<ot;vt+=1)pt(I[yt[vt]],U,K)}}}b(pt,"inspectNode");function ut(I,U){U=U||{};const K=new V(U);K.noRefs||ht(I,K);let ct=I;return K.replacer&&(ct=K.replacer.call({"":ct},"",ct)),G(K,0,ct,!0,!0)?K.dump+`
33
+ `:""}return b(ut,"dump2"),Ec.dump=ut,Ec}b(Hp,"requireDumper");var pf;function Yp(){if(pf)return Yr;pf=1;const e=zp(),t=Hp();function r(i,o){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+o+" instead, which is now safe by default.")}}return b(r,"renamed"),Yr.Type=jr(),Yr.Schema=ed(),Yr.FAILSAFE_SCHEMA=ad(),Yr.JSON_SCHEMA=hd(),Yr.CORE_SCHEMA=dd(),Yr.DEFAULT_SCHEMA=Rl(),Yr.load=e.load,Yr.loadAll=e.loadAll,Yr.dump=t.dump,Yr.YAMLException=gs(),Yr.types={binary:gd(),float:cd(),map:od(),null:sd(),pairs:md(),set:yd(),timestamp:ud(),bool:nd(),int:ld(),merge:fd(),omap:pd(),seq:id(),str:rd()},Yr.safeLoad=r("safeLoad","load"),Yr.safeLoadAll=r("safeLoadAll","loadAll"),Yr.safeDump=r("safeDump","dump"),Yr}b(Yp,"requireJsYaml");var VC=Yp(),ZC=qp(VC),{Type:DP,Schema:RP,FAILSAFE_SCHEMA:NP,JSON_SCHEMA:KC,CORE_SCHEMA:qP,DEFAULT_SCHEMA:WP,load:QC,loadAll:zP,dump:HP,YAMLException:YP,types:XP,safeLoad:GP,safeLoadAll:jP,safeDump:UP}=ZC,JC=b((e,t)=>{const{theme:r,themeVariables:i}=t,{useGradient:o,gradientStart:a,gradientStop:s}=i??{},n=e.attr("id"),l=r?.includes("dark")?"#FFFFFF":"#000000",c=b((d,u,f)=>e.append("defs").append("filter").attr("id",d).attr("height",u).attr("width",u).append("feDropShadow").attr("dx",f).attr("dy",f).attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",l),"dropShadow");if(c(`${n}-drop-shadow`,"130%","4"),c(`${n}-drop-shadow-small`,"150%","2"),!o)return;const h=e.append("linearGradient").attr("id",`${n}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",a).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",s).attr("stop-opacity",1)},"insertLookDefs"),Yn={exports:{}},t2=Yn.exports,mf;function e2(){return mf||(mf=1,(function(e,t){(function(r,i){e.exports=i()})(t2,(function(){var r=1e3,i=6e4,o=36e5,a="millisecond",s="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",f="year",p="date",g="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var E=["th","st","nd","rd"],B=F%100;return"["+F+(E[(B-20)%10]||E[B]||E[0])+"]"}},C=function(F,E,B){var q=String(F);return!q||q.length>=E?F:""+Array(E+1-q.length).join(B)+F},k={s:C,z:function(F){var E=-F.utcOffset(),B=Math.abs(E),q=Math.floor(B/60),W=B%60;return(E<=0?"+":"-")+C(q,2,"0")+":"+C(W,2,"0")},m:function F(E,B){if(E.date()<B.date())return-F(B,E);var q=12*(B.year()-E.year())+(B.month()-E.month()),W=E.clone().add(q,d),O=B-W<0,R=E.clone().add(q+(O?-1:1),d);return+(-(q+(B-W)/(O?W-R:R-W))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:d,y:f,w:h,d:c,D:p,h:l,m:n,s,ms:a,Q:u}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},v="en",M={};M[v]=x;var A="$isDayjsObject",L=function(F){return F instanceof P||!(!F||!F[A])},T=function F(E,B,q){var W;if(!E)return v;if(typeof E=="string"){var O=E.toLowerCase();M[O]&&(W=O),B&&(M[O]=B,W=O);var R=E.split("-");if(!W&&R.length>1)return F(R[0])}else{var V=E.name;M[V]=E,W=V}return!q&&W&&(v=W),W||!q&&v},_=function(F,E){if(L(F))return F.clone();var B=typeof E=="object"?E:{};return B.date=F,B.args=arguments,new P(B)},$=k;$.l=T,$.i=L,$.w=function(F,E){return _(F,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var P=(function(){function F(B){this.$L=T(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[A]=!0}var E=F.prototype;return E.parse=function(B){this.$d=(function(q){var W=q.date,O=q.utc;if(W===null)return new Date(NaN);if($.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var R=W.match(m);if(R){var V=R[2]-1||0,j=(R[7]||"0").substring(0,3);return O?new Date(Date.UTC(R[1],V,R[3]||1,R[4]||0,R[5]||0,R[6]||0,j)):new Date(R[1],V,R[3]||1,R[4]||0,R[5]||0,R[6]||0,j)}}return new Date(W)})(B),this.init()},E.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},E.$utils=function(){return $},E.isValid=function(){return this.$d.toString()!==g},E.isSame=function(B,q){var W=_(B);return this.startOf(q)<=W&&W<=this.endOf(q)},E.isAfter=function(B,q){return _(B)<this.startOf(q)},E.isBefore=function(B,q){return this.endOf(q)<_(B)},E.$g=function(B,q,W){return $.u(B)?this[q]:this.set(W,B)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(B,q){var W=this,O=!!$.u(q)||q,R=$.p(B),V=function(xt,H){var Y=$.w(W.$u?Date.UTC(W.$y,H,xt):new Date(W.$y,H,xt),W);return O?Y:Y.endOf(c)},j=function(xt,H){return $.w(W.toDate()[xt].apply(W.toDate("s"),(O?[0,0,0,0]:[23,59,59,999]).slice(H)),W)},z=this.$W,Q=this.$M,rt=this.$D,et="set"+(this.$u?"UTC":"");switch(R){case f:return O?V(1,0):V(31,11);case d:return O?V(1,Q):V(0,Q+1);case h:var J=this.$locale().weekStart||0,at=(z<J?z+7:z)-J;return V(O?rt-at:rt+(6-at),Q);case c:case p:return j(et+"Hours",0);case l:return j(et+"Minutes",1);case n:return j(et+"Seconds",2);case s:return j(et+"Milliseconds",3);default:return this.clone()}},E.endOf=function(B){return this.startOf(B,!1)},E.$set=function(B,q){var W,O=$.p(B),R="set"+(this.$u?"UTC":""),V=(W={},W[c]=R+"Date",W[p]=R+"Date",W[d]=R+"Month",W[f]=R+"FullYear",W[l]=R+"Hours",W[n]=R+"Minutes",W[s]=R+"Seconds",W[a]=R+"Milliseconds",W)[O],j=O===c?this.$D+(q-this.$W):q;if(O===d||O===f){var z=this.clone().set(p,1);z.$d[V](j),z.init(),this.$d=z.set(p,Math.min(this.$D,z.daysInMonth())).$d}else V&&this.$d[V](j);return this.init(),this},E.set=function(B,q){return this.clone().$set(B,q)},E.get=function(B){return this[$.p(B)]()},E.add=function(B,q){var W,O=this;B=Number(B);var R=$.p(q),V=function(Q){var rt=_(O);return $.w(rt.date(rt.date()+Math.round(Q*B)),O)};if(R===d)return this.set(d,this.$M+B);if(R===f)return this.set(f,this.$y+B);if(R===c)return V(1);if(R===h)return V(7);var j=(W={},W[n]=i,W[l]=o,W[s]=r,W)[R]||1,z=this.$d.getTime()+B*j;return $.w(z,this)},E.subtract=function(B,q){return this.add(-1*B,q)},E.format=function(B){var q=this,W=this.$locale();if(!this.isValid())return W.invalidDate||g;var O=B||"YYYY-MM-DDTHH:mm:ssZ",R=$.z(this),V=this.$H,j=this.$m,z=this.$M,Q=W.weekdays,rt=W.months,et=W.meridiem,J=function(H,Y,Z,tt){return H&&(H[Y]||H(q,O))||Z[Y].slice(0,tt)},at=function(H){return $.s(V%12||12,H,"0")},xt=et||function(H,Y,Z){var tt=H<12?"AM":"PM";return Z?tt.toLowerCase():tt};return O.replace(y,(function(H,Y){return Y||(function(Z){switch(Z){case"YY":return String(q.$y).slice(-2);case"YYYY":return $.s(q.$y,4,"0");case"M":return z+1;case"MM":return $.s(z+1,2,"0");case"MMM":return J(W.monthsShort,z,rt,3);case"MMMM":return J(rt,z);case"D":return q.$D;case"DD":return $.s(q.$D,2,"0");case"d":return String(q.$W);case"dd":return J(W.weekdaysMin,q.$W,Q,2);case"ddd":return J(W.weekdaysShort,q.$W,Q,3);case"dddd":return Q[q.$W];case"H":return String(V);case"HH":return $.s(V,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return xt(V,j,!0);case"A":return xt(V,j,!1);case"m":return String(j);case"mm":return $.s(j,2,"0");case"s":return String(q.$s);case"ss":return $.s(q.$s,2,"0");case"SSS":return $.s(q.$ms,3,"0");case"Z":return R}return null})(H)||R.replace(":","")}))},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(B,q,W){var O,R=this,V=$.p(q),j=_(B),z=(j.utcOffset()-this.utcOffset())*i,Q=this-j,rt=function(){return $.m(R,j)};switch(V){case f:O=rt()/12;break;case d:O=rt();break;case u:O=rt()/3;break;case h:O=(Q-z)/6048e5;break;case c:O=(Q-z)/864e5;break;case l:O=Q/o;break;case n:O=Q/i;break;case s:O=Q/r;break;default:O=Q}return W?O:$.a(O)},E.daysInMonth=function(){return this.endOf(d).$D},E.$locale=function(){return M[this.$L]},E.locale=function(B,q){if(!B)return this.$L;var W=this.clone(),O=T(B,q,!0);return O&&(W.$L=O),W},E.clone=function(){return $.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},F})(),D=P.prototype;return _.prototype=D,[["$ms",a],["$s",s],["$m",n],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach((function(F){D[F[1]]=function(E){return this.$g(E,F[0],F[1])}})),_.extend=function(F,E){return F.$i||(F(E,P,_),F.$i=!0),_},_.locale=T,_.isDayjs=L,_.unix=function(F){return _(1e3*F)},_.en=M[v],_.Ls=M,_.p={},_}))})(Yn)),Yn.exports}var r2=e2();const i2=aC(r2);var fo={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Mt={trace:b((...e)=>{},"trace"),debug:b((...e)=>{},"debug"),info:b((...e)=>{},"info"),warn:b((...e)=>{},"warn"),error:b((...e)=>{},"error"),fatal:b((...e)=>{},"fatal")},xd=b(function(e="fatal"){let t=fo.fatal;typeof e=="string"?e.toLowerCase()in fo&&(t=fo[e]):typeof e=="number"&&(t=e),Mt.trace=()=>{},Mt.debug=()=>{},Mt.info=()=>{},Mt.warn=()=>{},Mt.error=()=>{},Mt.fatal=()=>{},t<=fo.fatal&&(Mt.fatal=console.error?console.error.bind(console,Ci("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Ci("FATAL"))),t<=fo.error&&(Mt.error=console.error?console.error.bind(console,Ci("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Ci("ERROR"))),t<=fo.warn&&(Mt.warn=console.warn?console.warn.bind(console,Ci("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Ci("WARN"))),t<=fo.info&&(Mt.info=console.info?console.info.bind(console,Ci("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Ci("INFO"))),t<=fo.debug&&(Mt.debug=console.debug?console.debug.bind(console,Ci("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Ci("DEBUG"))),t<=fo.trace&&(Mt.trace=console.debug?console.debug.bind(console,Ci("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Ci("TRACE")))},"setLogLevel"),Ci=b(e=>`%c${i2().format("ss.SSS")} : ${e} : `,"format");const Xn={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,a=2*r-o;switch(i){case"r":return Xn.hue2rgb(a,o,e+1/3)*255;case"g":return Xn.hue2rgb(a,o,e)*255;case"b":return Xn.hue2rgb(a,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),a=Math.min(e,t,r),s=(o+a)/2;if(i==="l")return s*100;if(o===a)return 0;const n=o-a,l=s>.5?n/(2-o-a):n/(o+a);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},o2={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},a2={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},We={channel:Xn,lang:o2,unit:a2},Do={};for(let e=0;e<=255;e++)Do[e]=We.unit.dec2hex(e);const Xr={ALL:0,RGB:1,HSL:2};class s2{constructor(){this.type=Xr.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Xr.ALL}is(t){return this.type===t}}class n2{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new s2}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Xr.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=We.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=We.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=We.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=We.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=We.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=We.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Xr.HSL)&&r!==void 0?r:(this._ensureHSL(),We.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Xr.HSL)&&r!==void 0?r:(this._ensureHSL(),We.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Xr.HSL)&&r!==void 0?r:(this._ensureHSL(),We.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Xr.RGB)&&r!==void 0?r:(this._ensureRGB(),We.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Xr.RGB)&&r!==void 0?r:(this._ensureRGB(),We.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Xr.RGB)&&r!==void 0?r:(this._ensureRGB(),We.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Xr.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Xr.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Xr.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Xr.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Xr.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Xr.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Nl=new n2({r:0,g:0,b:0,a:0},"transparent"),qa={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(qa.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,a=o%4===0,s=o>4,n=s?1:17,l=s?8:4,c=a?0:-1,h=s?255:15;return Nl.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:a?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${Do[Math.round(t)]}${Do[Math.round(r)]}${Do[Math.round(i)]}${Do[Math.round(o*255)]}`:`#${Do[Math.round(t)]}${Do[Math.round(r)]}${Do[Math.round(i)]}`}},sa={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(sa.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return We.channel.clamp.h(parseFloat(r)*.9);case"rad":return We.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return We.channel.clamp.h(parseFloat(r)*360)}}return We.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(sa.re);if(!r)return;const[,i,o,a,s,n]=r;return Nl.set({h:sa._hue2deg(i),s:We.channel.clamp.s(parseFloat(o)),l:We.channel.clamp.l(parseFloat(a)),a:s?We.channel.clamp.a(n?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${We.lang.round(t)}, ${We.lang.round(r)}%, ${We.lang.round(i)}%, ${o})`:`hsl(${We.lang.round(t)}, ${We.lang.round(r)}%, ${We.lang.round(i)}%)`}},Ys={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=Ys.colors[e];if(t)return qa.parse(t)},stringify:e=>{const t=qa.stringify(e);for(const r in Ys.colors)if(Ys.colors[r]===t)return r}},$s={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match($s.re);if(!r)return;const[,i,o,a,s,n,l,c,h]=r;return Nl.set({r:We.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:We.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:We.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?We.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${We.lang.round(t)}, ${We.lang.round(r)}, ${We.lang.round(i)}, ${We.lang.round(o)})`:`rgb(${We.lang.round(t)}, ${We.lang.round(r)}, ${We.lang.round(i)})`}},Ri={format:{keyword:Ys,hex:qa,rgb:$s,rgba:$s,hsl:sa,hsla:sa},parse:e=>{if(typeof e!="string")return e;const t=qa.parse(e)||$s.parse(e)||sa.parse(e)||Ys.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Xr.HSL)||e.data.r===void 0?sa.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?$s.stringify(e):qa.stringify(e)},Xp=(e,t)=>{const r=Ri.parse(e);for(const i in t)r[i]=We.channel.clamp[i](t[i]);return Ri.stringify(r)},Ho=(e,t,r=0,i=1)=>{if(typeof e!="number")return Xp(e,{a:t});const o=Nl.set({r:We.channel.clamp.r(e),g:We.channel.clamp.g(t),b:We.channel.clamp.b(r),a:We.channel.clamp.a(i)});return Ri.stringify(o)},l2=(e,t)=>We.lang.round(Ri.parse(e)[t]),c2=e=>{const{r:t,g:r,b:i}=Ri.parse(e),o=.2126*We.channel.toLinear(t)+.7152*We.channel.toLinear(r)+.0722*We.channel.toLinear(i);return We.lang.round(o)},h2=e=>c2(e)>=.5,ni=e=>!h2(e),Gp=(e,t,r)=>{const i=Ri.parse(e),o=i[t],a=We.channel.clamp[t](o+r);return o!==a&&(i[t]=a),Ri.stringify(i)},gt=(e,t)=>Gp(e,"l",t),mt=(e,t)=>Gp(e,"l",-t),N=(e,t)=>{const r=Ri.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return Xp(e,i)},d2=(e,t,r=50)=>{const{r:i,g:o,b:a,a:s}=Ri.parse(e),{r:n,g:l,b:c,a:h}=Ri.parse(t),d=r/100,u=d*2-1,f=s-h,g=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,m=1-g,y=i*g+n*m,x=o*g+l*m,C=a*g+c*m,k=s*d+h*(1-d);return Ho(y,x,C,k)},lt=(e,t=100)=>{const r=Ri.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,d2(r,e,t)};var Xs=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,al=/\s/,u2=b(e=>{let t="",r=0,i=0;for(;i<e.length;){const o=e.indexOf("%%",i);if(o===-1)break;const a=e.indexOf(`
34
+ `,o);if(a===-1)break;let s=o;for(;s>r&&al.test(e[s-1]);)s--;t+=e.slice(r,s)+`
35
+ `,r=a+1,i=r}return t+e.slice(r)},"stripAnyComments"),Gn=b(e=>e===`
36
+ `||e==="\r","isLineBreak"),f2=b((e,t)=>{let r=-1;for(let i=t;i<e.length&&al.test(e[i]);i++)Gn(e[i])&&(r=i);return r},"lastLineBreakInWhitespaceRun"),jp=b(e=>{let t=0;for(;t<e.length&&al.test(e[t])&&!Gn(e[t]);)t++;const r=e.slice(0,t);if(!e.startsWith("---",t))return;const i=[];for(let h=t+3;h<e.length&&al.test(e[h]);h++)Gn(e[h])&&i.push(h);if(i.length===0)return;const o=`${r}---`,a=b(h=>Gn(e[h])&&e.startsWith(o,h+1)?f2(e,h+1+o.length):-1,"closingEnd"),s=i[0]+1;let n=-1;for(let h=s;h<e.length;h++)a(h)!==-1&&(n=h);if(n===-1)return;let l=i[0];for(const h of i)h<n&&(l=h);const c=l+1;for(let h=c;h<=n;h++){const d=a(h);if(d!==-1)return{indent:r,body:e.slice(c,h),length:d+1}}},"matchFrontMatter"),Ha,Up=(Ha=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},b(Ha,"UnknownDiagramError"),Ha),fa={},ql=b(function(e,t){const r=jp(e);e=u2((r?e.slice(r.length):e).replace(Xs,""));for(const[i,{detector:o}]of Object.entries(fa))if(o(e,t))return i;throw new Up(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),dh=b((...e)=>{for(const{id:t,detector:r,loader:i}of e)Vp(t,r,i)},"registerLazyLoadedDiagrams"),Vp=b((e,t,r)=>{fa[e]&&Mt.warn(`Detector with key ${e} already exists. Overwriting.`),fa[e]={detector:t,loader:r},Mt.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),g2=b(e=>fa[e].loader,"getDiagramLoader"),uh=b((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(o=>uh(e,o,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(o=>{e.includes(o)||e.push(o)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const o=e;Object.entries(t).forEach(([a,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(e,a)||Object.defineProperty(e,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),o[a]===void 0&&(o[a]=Array.isArray(s)?[]:{}),typeof o[a]=="object"&&(o[a]=uh(o[a],s,{depth:r-1}))}else typeof o[a]!="object"&&(Object.hasOwn(e,a)?o[a]=s:Object.defineProperty(e,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Pr=uh,io="#ffffff",oo="#f2f2f2",Re=b((e,t)=>t?N(e,{s:-40,l:10}):N(e,{s:-40,l:-10}),"mkBorder"),yf=b(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Ni=b((e,t)=>yf(e)&&yf(t)?{...e,...t}:t,"applyOverride"),Ya,p2=(Ya=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Re(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Re(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||mt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||mt(this.mainBkg,10)):(this.rowOdd=this.rowOdd||gt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||gt(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||gt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||mt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||N(this.primaryColor,{h:64}),this.fillType3=this.fillType3||N(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||N(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||N(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||N(this.primaryColor,{h:128}),this.fillType7=this.fillType7||N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||N(this.primaryColor,{l:-10}),this.pie5=this.pie5||N(this.secondaryColor,{l:-10}),this.pie6=this.pie6||N(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||N(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??N(this.primaryColor,{l:-30}),this.venn2=this.venn2??N(this.secondaryColor,{l:-30}),this.venn3=this.venn3??N(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??N(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??N(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??N(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??N(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??N(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])}),Object.hasOwn(t,"nodeBorder")&&!Object.hasOwn(t,"useGradient")&&(this.useGradient=!1)}},b(Ya,"Theme"),Ya),m2=b(e=>{const t=new p2;return t.calculate(e),t},"getThemeVariables"),Xa,y2=(Xa=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=gt(this.primaryColor,16),this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Re(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=gt(lt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ho(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=mt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=mt(this.sectionBkgColor,10),this.taskBorderColor=Ho(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ho(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||gt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||mt(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=gt(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=gt(this.labelBackground,25),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=gt(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=lt(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=N(this.primaryColor,{h:64}),this.fillType3=N(this.secondaryColor,{h:64}),this.fillType4=N(this.primaryColor,{h:-64}),this.fillType5=N(this.secondaryColor,{h:-64}),this.fillType6=N(this.primaryColor,{h:128}),this.fillType7=N(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||gt(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||N(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||N(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??gt(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=gt(this.secondaryColor,20),this.git1=gt(this.pie2||this.secondaryColor,20),this.git2=gt(this.pie3||this.tertiaryColor,20),this.git3=gt(this.pie4||N(this.primaryColor,{h:-30}),20),this.git4=gt(this.pie5||N(this.primaryColor,{h:-60}),20),this.git5=gt(this.pie6||N(this.primaryColor,{h:-90}),10),this.git6=gt(this.pie7||N(this.primaryColor,{h:60}),10),this.git7=gt(this.pie8||N(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||gt("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||gt("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||gt("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||gt("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||gt(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||gt(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||gt(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||gt(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(Xa,"Theme"),Xa),x2=b(e=>{const t=new y2;return t.calculate(e),t},"getThemeVariables"),Ga,b2=(Ga=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=N(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Re(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Re(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Ho(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||mt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||mt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=mt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||mt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||N(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||N(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||N(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||lt(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||lt(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||gt(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||gt(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=N(this.primaryColor,{h:64}),this.fillType3=N(this.secondaryColor,{h:64}),this.fillType4=N(this.primaryColor,{h:-64}),this.fillType5=N(this.secondaryColor,{h:-64}),this.fillType6=N(this.primaryColor,{h:128}),this.fillType7=N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||N(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||N(this.primaryColor,{l:-10}),this.pie5=this.pie5||N(this.secondaryColor,{l:-30}),this.pie6=this.pie6||N(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||N(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??N(this.primaryColor,{l:-30}),this.venn2=this.venn2??N(this.secondaryColor,{l:-30}),this.venn3=this.venn3??N(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??N(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??N(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??N(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??N(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??N(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||mt(lt(this.git0),25),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(Ga,"Theme"),Ga),C2=b(e=>{const t=new b2;return t.calculate(e),t},"getThemeVariables"),ja,w2=(ja=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=gt("#cde498",10),this.primaryBorderColor=Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Re(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.primaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=mt(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||mt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||mt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=mt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||mt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||N(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||N(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||N(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||gt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||gt(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=N(this.primaryColor,{h:64}),this.fillType3=N(this.secondaryColor,{h:64}),this.fillType4=N(this.primaryColor,{h:-64}),this.fillType5=N(this.secondaryColor,{h:-64}),this.fillType6=N(this.primaryColor,{h:128}),this.fillType7=N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||N(this.primaryColor,{l:-30}),this.pie5=this.pie5||N(this.secondaryColor,{l:-30}),this.pie6=this.pie6||N(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||N(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??N(this.primaryColor,{l:-30}),this.venn2=this.venn2??N(this.secondaryColor,{l:-30}),this.venn3=this.venn3??N(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??N(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??N(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??N(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??N(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??N(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(ja,"Theme"),ja),k2=b(e=>{const t=new w2;return t.calculate(e),t},"getThemeVariables"),Ua,S2=(Ua=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=gt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Re(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||gt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=gt(this.contrast,55),this.border2=this.contrast,this.actorBorder=gt(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||gt(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||mt(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||N(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||N(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.sectionBkgColor=gt(this.contrast,30),this.sectionBkgColor2=gt(this.contrast,30),this.taskBorderColor=mt(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=gt(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=mt(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=N(this.primaryColor,{h:64}),this.fillType3=N(this.secondaryColor,{h:64}),this.fillType4=N(this.primaryColor,{h:-64}),this.fillType5=N(this.secondaryColor,{h:-64}),this.fillType6=N(this.primaryColor,{h:128}),this.fillType7=N(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=mt(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||N(this.primaryColor,{h:-30}),this.git4=this.pie5||N(this.primaryColor,{h:-60}),this.git5=this.pie6||N(this.primaryColor,{h:-90}),this.git6=this.pie7||N(this.primaryColor,{h:60}),this.git7=this.pie8||N(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(Ua,"Theme"),Ua),v2=b(e=>{const t=new S2;return t.calculate(e),t},"getThemeVariables"),Va,T2=(Va=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Re(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Re(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Re(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(ni(this.background)?gt(this.background,4):mt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=N(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||N(t,{h:30}),this.cScale4=this.cScale4||N(t,{h:60}),this.cScale5=this.cScale5||N(t,{h:90}),this.cScale6=this.cScale6||N(t,{h:120}),this.cScale7=this.cScale7||N(t,{h:150}),this.cScale8=this.cScale8||N(t,{h:210,l:150}),this.cScale9=this.cScale9||N(t,{h:270}),this.cScale10=this.cScale10||N(t,{h:300}),this.cScale11=this.cScale11||N(t,{h:330}),this.darkMode)for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=mt(this["cScale"+a],75);else for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=mt(this["cScale"+a],25);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleInv"+a]=this["cScaleInv"+a]||lt(this["cScale"+a]);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this.darkMode?this["cScalePeer"+a]=this["cScalePeer"+a]||gt(this["cScale"+a],10):this["cScalePeer"+a]=this["cScalePeer"+a]||mt(this["cScale"+a],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleLabel"+a]=this["cScaleLabel"+a]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let a=0;a<5;a++)this["surface"+a]=this["surface"+a]||N(this.mainBkg,{h:180,s:-15,l:o*(5+a*3)}),this["surfacePeer"+a]=this["surfacePeer"+a]||N(this.mainBkg,{h:180,s:-15,l:o*(8+a*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||N(t,{h:64}),this.fillType3=this.fillType3||N(r,{h:64}),this.fillType4=this.fillType4||N(t,{h:-64}),this.fillType5=this.fillType5||N(r,{h:-64}),this.fillType6=this.fillType6||N(t,{h:128}),this.fillType7=this.fillType7||N(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||N(t,{l:-10}),this.pie5=this.pie5||N(r,{l:-10}),this.pie6=this.pie6||N(i,{l:-10}),this.pie7=this.pie7||N(t,{h:60,l:-10}),this.pie8=this.pie8||N(t,{h:-60,l:-10}),this.pie9=this.pie9||N(t,{h:120,l:0}),this.pie10=this.pie10||N(t,{h:60,l:-20}),this.pie11=this.pie11||N(t,{h:-60,l:-20}),this.pie12=this.pie12||N(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||N(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||N(t,{h:-30}),this.git4=this.git4||N(t,{h:-60}),this.git5=this.git5||N(t,{h:-90}),this.git6=this.git6||N(t,{h:60}),this.git7=this.git7||N(t,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(Va,"Theme"),Va),M2=b(e=>{const t=new T2;return t.calculate(e),t},"getThemeVariables"),Za,_2=(Za=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=gt(this.primaryColor,16),this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Re(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=gt(lt("#323D47"),10),this.border1="#ccc",this.border2=Ho(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Re(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Re(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?gt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||gt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||mt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||N(this.primaryColor,{h:64}),this.fillType3=this.fillType3||N(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||N(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||N(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||N(this.primaryColor,{h:128}),this.fillType7=this.fillType7||N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||N(this.primaryColor,{l:-10}),this.pie5=this.pie5||N(this.secondaryColor,{l:-10}),this.pie6=this.pie6||N(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||N(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(Za,"Theme"),Za),B2=b(e=>{const t=new _2;return t.calculate(e),t},"getThemeVariables"),Ka,L2=(Ka=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Re("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Re(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Re(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(ni(this.background)?gt(this.background,4):mt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=N(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=this.mainBkg;if(this.darkMode)for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=mt(this["cScale"+a],75);else for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=mt(this["cScale"+a],25);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleInv"+a]=this["cScaleInv"+a]||lt(this["cScale"+a]);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this.darkMode?this["cScalePeer"+a]=this["cScalePeer"+a]||gt(this["cScale"+a],10):this["cScalePeer"+a]=this["cScalePeer"+a]||mt(this["cScale"+a],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleLabel"+a]=this["cScaleLabel"+a]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let a=0;a<5;a++)this["surface"+a]=this["surface"+a]||N(this.mainBkg,{h:180,s:-15,l:o*(5+a*3)}),this["surfacePeer"+a]=this["surfacePeer"+a]||N(this.mainBkg,{h:180,s:-15,l:o*(8+a*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||N(t,{h:64}),this.fillType3=this.fillType3||N(r,{h:64}),this.fillType4=this.fillType4||N(t,{h:-64}),this.fillType5=this.fillType5||N(r,{h:-64}),this.fillType6=this.fillType6||N(t,{h:128}),this.fillType7=this.fillType7||N(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||N(t,{l:-10}),this.pie5=this.pie5||N(r,{l:-10}),this.pie6=this.pie6||N(i,{l:-10}),this.pie7=this.pie7||N(t,{h:60,l:-10}),this.pie8=this.pie8||N(t,{h:-60,l:-10}),this.pie9=this.pie9||N(t,{h:120,l:0}),this.pie10=this.pie10||N(t,{h:60,l:-20}),this.pie11=this.pie11||N(t,{h:-60,l:-20}),this.pie12=this.pie12||N(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||N(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||N(t,{h:-30}),this.git4=this.git4||N(t,{h:-60}),this.git5=this.git5||N(t,{h:-90}),this.git6=this.git6||N(t,{h:60}),this.git7=this.git7||N(t,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(Ka,"Theme"),Ka),A2=b(e=>{const t=new L2;return t.calculate(e),t},"getThemeVariables"),Qa,F2=(Qa=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=gt(this.primaryColor,16),this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Re(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=gt(lt("#323D47"),10),this.border1="#ccc",this.border2=Ho(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Re(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Re(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?gt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||N(this.primaryColor,{h:30}),this.cScale4=this.cScale4||N(this.primaryColor,{h:60}),this.cScale5=this.cScale5||N(this.primaryColor,{h:90}),this.cScale6=this.cScale6||N(this.primaryColor,{h:120}),this.cScale7=this.cScale7||N(this.primaryColor,{h:150}),this.cScale8=this.cScale8||N(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||N(this.primaryColor,{h:270}),this.cScale10=this.cScale10||N(this.primaryColor,{h:300}),this.cScale11=this.cScale11||N(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=mt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||gt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||mt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||N(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||N(this.primaryColor,{h:64}),this.fillType3=this.fillType3||N(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||N(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||N(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||N(this.primaryColor,{h:128}),this.fillType7=this.fillType7||N(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||N(this.primaryColor,{l:-10}),this.pie5=this.pie5||N(this.secondaryColor,{l:-10}),this.pie6=this.pie6||N(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||N(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||N(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||N(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||N(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||N(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||N(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(Qa,"Theme"),Qa),$2=b(e=>{const t=new F2;return t.calculate(e),t},"getThemeVariables"),Ja,E2=(Ja=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Re("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.usecaseActorBorder="#A78BFA",this.usecaseActorBkg="#F5F3FF",this.usecaseBorder="#2DD4BF",this.usecaseBkg="#F0FDFA",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseBoundaryBkg="#FAFAFC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Re(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Re(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(ni(this.background)?gt(this.background,4):mt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=N(t,{h:180,l:5});this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#FFFFFF",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#F9F9FB",this.compositeTitleBackground=this.compositeTitleBackground||"#F9F9FB",this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||"white";for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleInv"+a]=this["cScaleInv"+a]||lt(this["cScale"+a]);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this.darkMode?this["cScalePeer"+a]=this["cScalePeer"+a]||gt(this["cScale"+a],10):this["cScalePeer"+a]=this["cScalePeer"+a]||mt(this["cScale"+a],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleLabel"+a]=this["cScaleLabel"+a]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let a=0;a<5;a++)this["surface"+a]=this["surface"+a]||N(this.mainBkg,{h:180,s:-15,l:o*(5+a*3)}),this["surfacePeer"+a]=this["surfacePeer"+a]||N(this.mainBkg,{h:180,s:-15,l:o*(8+a*3)});this.classText=this.classText||this.textColor;for(let a=0;a<8;a++)this["fillType"+a]=this["fillType"+a]||this.bkgColorArray[a];for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["pie"+(a+1)]=this["pie"+(a+1)]||this["cScale"+a];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let a=0;a<8;a++)this["venn"+(a+1)]=this["venn"+(a+1)]??this.borderColorArray[a%this.borderColorArray.length];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||N(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||N(t,{h:-30}),this.git4=this.git4||N(t,{h:-60}),this.git5=this.git5||N(t,{h:-90}),this.git6=this.git6||N(t,{h:60}),this.git7=this.git7||N(t,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(Ja,"Theme"),Ja),P2=b(e=>{const t=new E2;return t.calculate(e),t},"getThemeVariables"),ts,I2=(ts=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=gt(this.primaryColor,16),this.tertiaryColor=N(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Re(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=gt(lt("#323D47"),10),this.border1="#ccc",this.border2=Ho(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.usecaseActorBorder="#A78BFA",this.usecaseBorder="#2DD4BF",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||N(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||N(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Re(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Re(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Re(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Re(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?gt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||mt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||gt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#16141F",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||"#16141F",this.altBackground=this.altBackground||"#16141F",this.compositeTitleBackground=this.compositeTitleBackground||"#16141F",this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||this.background;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||lt(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||gt(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||mt(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=mt(this["cScale"+i],75);const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||N(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||N(this.mainBkg,{h:180,s:-15,l:t*(8+i*3)});this.classText=this.classText||this.textColor,["#701a75","#134e4a","#7c2d12","#581c87","#14532d","#4c1d95","#7f1d1d","#713f12"].forEach((i,o)=>{this["fillType"+o]=this["fillType"+o]||i});for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["pie"+(i+1)]=this["pie"+(i+1)]||this["cScale"+i];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||"#28253D",this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let i=0;i<8;i++)this["venn"+(i+1)]=this["venn"+(i+1)]??this.borderColorArray[i%this.borderColorArray.length];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||N(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||N(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||N(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||N(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||N(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||N(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ni(this.quadrant1Fill)?gt(this.quadrant1Fill):mt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?mt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||N(this.primaryColor,{h:-30}),this.git4=this.git4||N(this.primaryColor,{h:-60}),this.git5=this.git5||N(this.primaryColor,{h:-90}),this.git6=this.git6||N(this.primaryColor,{h:60}),this.git7=this.git7||N(this.primaryColor,{h:120}),this.darkMode?(this.git0=gt(this.git0,25),this.git1=gt(this.git1,25),this.git2=gt(this.git2,25),this.git3=gt(this.git3,25),this.git4=gt(this.git4,25),this.git5=gt(this.git5,25),this.git6=gt(this.git6,25),this.git7=gt(this.git7,25)):(this.git0=mt(this.git0,25),this.git1=mt(this.git1,25),this.git2=mt(this.git2,25),this.git3=mt(this.git3,25),this.git4=mt(this.git4,25),this.git5=mt(this.git5,25),this.git6=mt(this.git6,25),this.git7=mt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||io,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||oo}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Ni(this[i],t[i])})}},b(ts,"Theme"),ts),O2=b(e=>{const t=new I2;return t.calculate(e),t},"getThemeVariables"),ko={base:{getThemeVariables:m2},dark:{getThemeVariables:x2},default:{getThemeVariables:C2},forest:{getThemeVariables:k2},neutral:{getThemeVariables:v2},neo:{getThemeVariables:M2},"neo-dark":{getThemeVariables:B2},redux:{getThemeVariables:A2},"redux-dark":{getThemeVariables:$2},"redux-color":{getThemeVariables:P2},"redux-dark-color":{getThemeVariables:O2}},Ar={flowchart:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,wrappingWidth:120,minNodeWidth:120,stepDuration:1,stepNumbers:!1,inheritDir:!1},swimlane:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"swimlane",lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},agentflow:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:8,nodeSpacing:50,rankSpacing:50,wrappingWidth:120,minNodeWidth:120},sequence:{useMaxWidth:!0,theme:"redux-color",look:"neo",hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"elk",wrappingWidth:120,minNodeWidth:120,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5},er:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,theme:"redux-color",look:"neo",rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,colorBy:"branch",padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,bitOrder:"ascending",paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},usecase:{useMaxWidth:!0,theme:"redux-color",look:"neo",wrappingWidth:120,minNodeWidth:120,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:"normal",usecaseFontSize:12,usecaseFontFamily:'"Open Sans", sans-serif',usecaseFontWeight:"normal",nodeSpacing:50,rankSpacing:50,diagramPadding:20,colorScheme:"role"},venn:{useMaxWidth:!0,theme:"redux-color",look:"neo",width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"elk",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Zp={...Ar,deterministicIDSeed:void 0,elk:{mergeEdges:!1,straightenEdges:!0,lineHops:!0,preset:"default",nodePlacementStrategy:void 0,layeringStrategy:void 0,cycleBreakingStrategy:void 0,layeringLayerBound:4,nodePlacementAlignment:void 0,forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1,orientFeedbackEdges:!0},themeCSS:void 0,themeVariables:ko.default.getThemeVariables(),sequence:{...Ar.sequence,messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:b(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:b(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{theme:Ar.class?.theme,look:Ar.class?.look,layout:Ar.class?.layout,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Ar.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ar.c4,useWidth:void 0,personFont:b(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Ar.flowchart,inheritDir:!1},external_personFont:b(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:b(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:b(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:b(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:b(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:b(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:b(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:b(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:b(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:b(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:b(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:b(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:b(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:b(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:b(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:b(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:b(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:b(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:b(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:b(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Ar.pie,useWidth:984},xyChart:{...Ar.xyChart,useWidth:void 0},requirement:{...Ar.requirement,useWidth:void 0},packet:{...Ar.packet},eventmodeling:{...Ar.eventmodeling},treeView:{...Ar.treeView,useWidth:void 0},radar:{...Ar.radar},usecase:{...Ar.usecase},railroad:{...Ar.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Ar.ishikawa},sankey:{...Ar.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Ar.venn},cynefin:{...Ar.cynefin}},Kp=b((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Kp(e[i],"")]:[...r,t+i],[]),"keyify"),D2=new Set(Kp(Zp,"")),bd=Zp,R2={"flowchart-v2":"flowchart","flowchart-elk":"flowchart",classDiagram:"class",stateDiagram:"state",xychart:"xyChart",railroadAbnf:"railroad",railroadEbnf:"railroad",railroadPeg:"railroad"},N2=b(e=>R2[e]??e,"getDiagramConfigKey"),q2={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},W2=b((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(Mt.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),sl=b(e=>{if(Mt.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>sl(t));return}for(const t of Object.keys(e)){if(Mt.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!D2.has(t)||e[t]==null){Mt.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=q2[t];i?W2(e[t],i):(Mt.debug("sanitizing object",t),sl(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(Mt.debug("sanitizing css option",t),e[t]=Qp(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}Mt.debug("After sanitization",e)}},"sanitizeDirective"),Qp=b(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),Yo=Object.freeze(bd),z2=["theme","look","layout"],H2=new Set(["classic","handDrawn","neo"]),Y2=b((e,t)=>e==="theme"?t==="null"||Object.hasOwn(ko,t):e!=="look"||H2.has(t),"isUsableAppearance"),X2=b((e,t,r)=>e?[e[t]?.[r],e[r]].find(o=>o!==void 0&&Y2(r,o)):void 0,"readAppearance"),ao=b(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),Zr=Pr({},Yo),nl,ll={},So=[],Gs=Pr({},Yo),js,G2=b((e,t)=>{if(!js)return;const r=[t,...[...So].reverse(),ll,Yo],i=e[js];for(const o of z2)for(const a of r){const s=X2(a,js,o);if(s!==void 0){e[o]=s,i?.[o]!==void 0&&(i[o]=s);break}}},"resolveAppearance"),ps=b((e,t)=>{let r=Pr({},e),i={};for(const a of t)em(a),i=Pr(i,a);if(r=Pr(r,i),G2(r,i),(!!i.theme||r.theme!==e.theme)&&r.theme&&Object.hasOwn(ko,r.theme)){const a=Pr({},nl),s=Pr(a.themeVariables||{},i.themeVariables);r.themeVariables=ko[r.theme].getThemeVariables(s)}return Gs=r,Q2(Gs),Gs},"updateCurrentConfig"),Cd=b(e=>{js=e===void 0?void 0:N2(e),ps(Zr,So)},"setDiagramConfigScope"),j2=b(e=>(Zr=Pr({},Yo),Zr=Pr(Zr,e),ll=Pr({},e),e.theme&&Object.hasOwn(ko,e.theme)&&(Zr.themeVariables=ko[e.theme].getThemeVariables(e.themeVariables)),ps(Zr,So),Zr),"setSiteConfig"),U2=b(e=>{nl=Pr({},e)},"saveConfigFromInitialize"),V2=b(e=>(Zr=Pr(Zr,e),ll=Pr(ll,e),ps(Zr,So),Zr),"updateSiteConfig"),Jp=b(()=>Pr({},Zr),"getSiteConfig"),tm=b(e=>(ps(Gs,[e]),Mr()),"setConfig"),Mr=b(()=>Pr({},Gs),"getConfig"),em=b(e=>{e&&(["secure",...Zr.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(Mt.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&em(e[t])}))},"sanitize"),Z2=b(e=>{sl(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),So.push(e),ps(Zr,So)},"addDirective"),cl=b((e=Zr)=>{So=[],js=void 0,ps(e,So)},"reset"),K2={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},xf={},rm=b(e=>{xf[e]||(Mt.warn(K2[e]),xf[e]=!0)},"issueWarning"),Q2=b(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&rm("LAZY_LOAD_DEPRECATED")},"checkConfig"),VP=b(()=>{let e={};nl&&(e=Pr(e,nl));for(const t of So)e=Pr(e,t);return e},"getUserDefinedConfig"),qr=b(e=>(e.flowchart?.htmlLabels!=null&&rm("FLOWCHART_HTML_LABELS_DEPRECATED"),ao(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),ln=/<\/?br\s*\/?>/gi,J2=new RegExp(ln.source,"i"),tw=b(e=>e?am(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),ew=(()=>{let e=!1;return()=>{e||(im(),e=!0)}})();function im(){const e="data-temp-href-target";os.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),os.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}b(im,"setupDompurifyHooks");var om=b(e=>(ew(),os.sanitize(e)),"removeScript"),bf=b((e,t)=>{if(qr(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=om(e):r!=="loose"&&(e=am(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=aw(e))}return e},"sanitizeMore"),Ti=b((e,t)=>e&&(t.dompurifyConfig?e=os.sanitize(bf(e,t),t.dompurifyConfig).toString():e=os.sanitize(bf(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),rw=b((e,t)=>typeof e=="string"?Ti(e,t):e.flat().map(r=>Ti(r,t)),"sanitizeTextOrArray"),iw=b(e=>J2.test(e),"hasBreaks"),ow=b(e=>e.split(ln),"splitBreaks"),aw=b(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),am=b(e=>e.replace(ln,"#br#"),"breakToPlaceholder"),sw=b(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),nw=b(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),lw=b(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Cf=b(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const a=t[i-1],s=t[i+1];cw(a,s)&&(o=a+","+s,i++,r.pop())}r.push(hw(o))}return r.join("")},"parseGenericTypes"),fh=b((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),cw=b((e,t)=>{const r=fh(e,"~"),i=fh(t,"~");return r===1&&i===1},"shouldCombineSets"),hw=b(e=>{const t=fh(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),a=i.lastIndexOf("~");for(;o!==-1&&a!==-1&&o!==a;)i[o]="<",i[a]=">",o=i.indexOf("~"),a=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),wf=b(()=>window.MathMLElement!==void 0,"isMathMLSupported"),gh=/\$\$(.*?)\$\$/g,Qs=b(e=>(e.match(gh)?.length??0)>0,"hasKatex"),ZP=b(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await sm(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),dw=b(async(e,t)=>{if(!Qs(e))return e;if(!(wf()||t.legacyMathML||t.forceLegacyMathML))return e.replace(gh,"MathML is unsupported in this environment.");{const{default:r}=await je(async()=>{const{default:o}=await import("./BcGA_XKM.js").then(a=>a.ap);return{default:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url),i=t.forceLegacyMathML||!wf()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(ln).map(o=>Qs(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(gh,(o,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),sm=b(async(e,t)=>Ti(await dw(e,t),t),"renderKatexSanitized"),cn={getRows:tw,sanitizeText:Ti,sanitizeTextOrArray:rw,hasBreaks:iw,splitBreaks:ow,lineBreakRegex:ln,removeScript:om,getUrl:sw,evaluate:ao,getMax:nw,getMin:lw},uw=b(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),fw=b(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),nm=b(function(e,t,r,i){const o=fw(t,r,i);uw(e,o)},"configureSvgSize"),gw=b(function(e,t,r,i){const o=t.node().getBBox(),a=o.width,s=o.height;Mt.info(`SVG bounds: ${a}x${s}`,o);let n=0,l=0;Mt.info(`Graph bounds: ${n}x${l}`,e),n=a+r*2,l=s+r*2,Mt.info(`Calculated bounds: ${n}x${l}`),nm(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),jn={};function ph(e){return[...e.cssRules].map(t=>t.cssText).join(`
37
+ `)}b(ph,"cssStyleSheetToString");var pw=b((e,t,r,i)=>{let o="";return e in jn&&jn[e]?o=jn[e]({...r,svgId:i}):Mt.warn(`No theme found for ${e}`),`& {
38
+ font-family: ${r.fontFamily};
39
+ font-size: ${r.fontSize};
40
+ fill: ${r.textColor}
41
+ }
42
+ @keyframes edge-animation-frame {
43
+ from {
44
+ stroke-dashoffset: 0;
45
+ }
46
+ }
47
+ @keyframes dash {
48
+ to {
49
+ stroke-dashoffset: 0;
50
+ }
51
+ }
52
+ & .edge-animation-slow {
53
+ stroke-dasharray: 9,5 !important;
54
+ stroke-dashoffset: 900;
55
+ animation: dash 50s linear infinite;
56
+ stroke-linecap: round;
57
+ }
58
+ & .edge-animation-fast {
59
+ stroke-dasharray: 9,5 !important;
60
+ stroke-dashoffset: 900;
61
+ animation: dash 20s linear infinite;
62
+ stroke-linecap: round;
63
+ }
64
+ /* Classes common for multiple diagrams */
65
+
66
+ & .error-icon {
67
+ fill: ${r.errorBkgColor};
68
+ }
69
+ & .error-text {
70
+ fill: ${r.errorTextColor};
71
+ stroke: ${r.errorTextColor};
72
+ }
73
+
74
+ & .edge-thickness-normal {
75
+ stroke-width: ${r.strokeWidth??1}px;
76
+ }
77
+ & .edge-thickness-thick {
78
+ stroke-width: 3.5px
79
+ }
80
+ & .edge-pattern-solid {
81
+ stroke-dasharray: 0;
82
+ }
83
+ & .edge-thickness-invisible {
84
+ stroke-width: 0;
85
+ fill: none;
86
+ }
87
+ & .edge-pattern-dashed{
88
+ stroke-dasharray: 3;
89
+ }
90
+ .edge-pattern-dotted {
91
+ stroke-dasharray: 2;
92
+ }
93
+
94
+ & .marker {
95
+ fill: ${r.lineColor};
96
+ stroke: ${r.lineColor};
97
+ }
98
+ & .marker.cross {
99
+ stroke: ${r.lineColor};
100
+ }
101
+
102
+ & svg {
103
+ font-family: ${r.fontFamily};
104
+ font-size: ${r.fontSize};
105
+ }
106
+ & p {
107
+ margin: 0
108
+ }
109
+
110
+ ${o}
111
+ .node .neo-node {
112
+ stroke: ${r.nodeBorder};
113
+ }
114
+
115
+ [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
116
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
117
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
118
+ }
119
+ [data-look="neo"].swimlane.cluster rect {
120
+ filter: none;
121
+ }
122
+
123
+
124
+ [data-look="neo"].node path {
125
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
126
+ stroke-width: ${r.strokeWidth??1}px;
127
+ }
128
+
129
+ [data-look="neo"].node .outer-path {
130
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
131
+ }
132
+
133
+ [data-look="neo"].node .neo-line path {
134
+ stroke: ${r.nodeBorder};
135
+ filter: none;
136
+ }
137
+
138
+ [data-look="neo"].node circle{
139
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
140
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
141
+ }
142
+
143
+ [data-look="neo"].node circle .state-start{
144
+ fill: #000000;
145
+ }
146
+
147
+ [data-look="neo"].icon-shape .icon {
148
+ fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
149
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
150
+ }
151
+
152
+ [data-look="neo"].icon-shape .icon-neo path {
153
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
154
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
155
+ }
156
+
157
+ ${t}
158
+ `},"getStyles"),mw=b((e,t)=>{t!==void 0&&(jn[e]=t)},"addStylesForDiagram"),yw=pw,lm={};UC(lm,{clear:()=>xw,getAccDescription:()=>kw,getAccTitle:()=>Cw,getDiagramTitle:()=>vw,setAccDescription:()=>ww,setAccTitle:()=>bw,setDiagramTitle:()=>Sw});var wd="",kd="",Sd="",vd=b(e=>Ti(e,Mr()),"sanitizeText"),xw=b(()=>{wd="",Sd="",kd=""},"clear"),bw=b(e=>{wd=vd(e).replace(/^\s+/g,"")},"setAccTitle"),Cw=b(()=>wd,"getAccTitle"),ww=b(e=>{Sd=vd(e).replace(/\n\s+/g,`
159
+ `)},"setAccDescription"),kw=b(()=>Sd,"getAccDescription"),Sw=b(e=>{kd=vd(e)},"setDiagramTitle"),vw=b(()=>kd,"getDiagramTitle"),kf=Mt,Tw=xd,Xe=Mr,KP=tm,QP=Yo,Td=b(e=>Ti(e,Xe()),"sanitizeText"),Mw=gw,_w=b(()=>lm,"getCommonDb"),hl={},dl=b((e,t,r)=>{hl[e]&&kf.warn(`Diagram with id ${e} already registered. Overwriting.`),hl[e]=t,r&&Vp(e,r),mw(e,t.styles),t.injectUtils?.(kf,Tw,Xe,Td,Mw,_w(),()=>{})},"registerDiagram"),mh=b(e=>{if(e in hl)return hl[e];throw new Bw(e)},"getDiagram"),es,Bw=(es=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},b(es,"DiagramNotFoundError"),es),Lw=b(e=>{const{handDrawnSeed:t}=Xe();return{fill:e,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Aw=b(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),Zo=b(e=>{const t=Fw([...e.cssCompiledStyles||[],...e.cssStyles||[],...Aw(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Fw=b(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),cm=b(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),jt=b(e=>{const{stylesArray:t}=Zo(e),r=[],i=[],o=[],a=[];return t.forEach(s=>{const n=s[0];cm(n)?r.push(s.join(":")+" !important"):(i.push(s.join(":")+" !important"),n.includes("stroke")&&o.push(s.join(":")+" !important"),n==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:a}},"styles2String"),Gt=b((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=Xe(),{nodeBorder:o,mainBkg:a}=r,{stylesMap:s}=Zo(e);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:1.5,hachureGap:1.5,stroke:s.get("stroke")||o,seed:i,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:$w(s.get("stroke-dasharray"))},t)},"userNodeOverrides"),$w=b(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray");const Ew=Object.freeze({left:0,top:0,width:16,height:16}),ul=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),hm=Object.freeze({...Ew,...ul}),Pw=Object.freeze({...hm,body:"",hidden:!1}),Iw=Object.freeze({width:null,height:null}),Ow=Object.freeze({...Iw,...ul}),Dw=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return Pc(c)?c:null}const a=o[0],s=a.split("-");if(s.length>1){const n={provider:i,prefix:s.shift(),name:s.join("-")};return Pc(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:a};return Pc(n,r)?n:null}return null},Pc=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function Rw(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function Sf(e,t){const r=Rw(e,t);for(const i in Pw)i in ul?i in e&&!(i in r)&&(r[i]=ul[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function Nw(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function a(s){if(r[s])return o[s]=[];if(!(s in o)){o[s]=null;const n=i[s]&&i[s].parent,l=n&&a(n);l&&(o[s]=[n].concat(l))}return o[s]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(a),o}function vf(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let a={};function s(n){a=Sf(i[n]||o[n],a)}return s(t),r.forEach(s),Sf(e,a)}function qw(e,t){if(e.icons[t])return vf(e,t,[]);const r=Nw(e,[t])[t];return r?vf(e,t,r):null}const Ww=/(-?[0-9.]*[0-9]+[0-9.]*)/g,zw=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Tf(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(Ww);if(i===null||!i.length)return e;const o=[];let a=i.shift(),s=zw.test(a);for(;;){if(s){const n=parseFloat(a);isNaN(n)?o.push(a):o.push(Math.ceil(n*t*r)/r)}else o.push(a);if(a=i.shift(),a===void 0)return o.join("");s=!s}}function Hw(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),a=e.indexOf("</"+t);if(o===-1||a===-1)break;const s=e.indexOf(">",a);if(s===-1)break;r+=e.slice(o+1,a).trim(),e=e.slice(0,i).trim()+e.slice(s+1)}return{defs:r,content:e}}function Yw(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Xw(e,t,r){const i=Hw(e);return Yw(i.defs,t+i.content+r)}const Gw=e=>e==="unset"||e==="undefined"||e==="none";function jw(e,t){const r={...hm,...e},i={...Ow,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,i].forEach(g=>{const m=[],y=g.hFlip,x=g.vFlip;let C=g.rotate;y?x?C+=2:(m.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),m.push("scale(-1 1)"),o.top=o.left=0):x&&(m.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),m.push("scale(1 -1)"),o.top=o.left=0);let k;switch(C<0&&(C-=Math.floor(C/4)*4),C=C%4,C){case 1:k=o.height/2+o.top,m.unshift("rotate(90 "+k.toString()+" "+k.toString()+")");break;case 2:m.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:k=o.width/2+o.left,m.unshift("rotate(-90 "+k.toString()+" "+k.toString()+")");break}C%2===1&&(o.left!==o.top&&(k=o.left,o.left=o.top,o.top=k),o.width!==o.height&&(k=o.width,o.width=o.height,o.height=k)),m.length&&(a=Xw(a,'<g transform="'+m.join(" ")+'">',"</g>"))});const s=i.width,n=i.height,l=o.width,c=o.height;let h,d;s===null?(d=n===null?"1em":n==="auto"?c:n,h=Tf(d,l/c)):(h=s==="auto"?l:s,d=n===null?Tf(h,c/l):n==="auto"?c:n);const u={},f=(g,m)=>{Gw(m)||(u[g]=m.toString())};f("width",h),f("height",d);const p=[o.left,o.top,l,c];return u.viewBox=p.join(" "),{attributes:u,viewBox:p,body:a}}const Uw=/\sid="(\S+)"/g,Mf=new Map;function Vw(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Mf.get(e)||0;return Mf.set(e,t+1),t?`${e}${t}`:e}function Zw(e){const t=[];let r;for(;r=Uw.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const a=Vw(o),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function Kw(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}var Qw={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},fl=new Map,Md=new Map,dm=b(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(Mt.debug("Registering icon pack:",t.name),"loader"in t)Md.set(t.name,t.loader);else if("icons"in t)fl.set(t.name,t.icons);else throw Mt.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Jw=b(e=>fl.has(e)||Md.has(e),"isIconPackRegistered"),um=b(async(e,t)=>{const r=Dw(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=fl.get(i);if(!o){const s=Md.get(i);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await s(),prefix:i},fl.set(i,o)}catch(n){throw Mt.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=qw(o,r.name);if(!a)throw new Error(`Icon not found: ${e}`);return a},"getRegisteredIconData"),fm=b(async e=>{try{return await um(e),!0}catch{return!1}},"isIconAvailable"),ba=b(async(e,t,r)=>{let i;try{i=await um(e,t?.fallbackPrefix)}catch(s){Mt.error(s),i=Qw}const o=jw(i,t),a=Kw(Zw(o.body),{...o.attributes,...r});return Ti(a,Mr())},"getIconSVG"),Sn={},Dr={},_f;function tk(){return _f||(_f=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.BLANK_URL=Dr.relativeFirstCharacters=Dr.whitespaceEscapeCharsRegex=Dr.urlSchemeRegex=Dr.ctrlCharactersRegex=Dr.htmlCtrlEntityRegex=Dr.htmlEntitiesRegex=Dr.invalidProtocolRegex=void 0,Dr.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Dr.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Dr.htmlCtrlEntityRegex=/&(newline|tab);/gi,Dr.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Dr.urlSchemeRegex=/^.+(:|&colon;)/gim,Dr.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Dr.relativeFirstCharacters=[".","/"],Dr.BLANK_URL="about:blank"),Dr}var Bf;function ek(){if(Bf)return Sn;Bf=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.sanitizeUrl=a;var e=tk();function t(s){return e.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var n=s.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(s){return URL.canParse(s)}function o(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return e.BLANK_URL;var n,l=o(s.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var f=h.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return f;if(u==="http:"||u==="https:"){if(!i(f))return e.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}return Sn}var rk=ek(),ik={value:()=>{}};function gm(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new Un(r)}function Un(e){this._=e}function ok(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Un.prototype=gm.prototype={constructor:Un,on:function(e,t){var r=this._,i=ok(e+"",r),o,a=-1,s=i.length;if(arguments.length<2){for(;++a<s;)if((o=(e=i[a]).type)&&(o=ak(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(o=(e=i[a]).type)r[o]=Lf(r[o],e.name,t);else if(t==null)for(o in r)r[o]=Lf(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Un(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,a;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,o=a.length;i<o;++i)a[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,a=i.length;o<a;++o)i[o].value.apply(t,r)}};function ak(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function Lf(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=ik,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var yh="http://www.w3.org/1999/xhtml";const Af={svg:"http://www.w3.org/2000/svg",xhtml:yh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wl(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Af.hasOwnProperty(t)?{space:Af[t],local:e}:e}function sk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===yh&&t.documentElement.namespaceURI===yh?t.createElement(e):t.createElementNS(r,e)}}function nk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pm(e){var t=Wl(e);return(t.local?nk:sk)(t)}function lk(){}function _d(e){return e==null?lk:function(){return this.querySelector(e)}}function ck(e){typeof e!="function"&&(e=_d(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var a=t[o],s=a.length,n=i[o]=new Array(s),l,c,h=0;h<s;++h)(l=a[h])&&(c=e.call(l,l.__data__,h,a))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new fi(i,this._parents)}function hk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function dk(){return[]}function mm(e){return e==null?dk:function(){return this.querySelectorAll(e)}}function uk(e){return function(){return hk(e.apply(this,arguments))}}function fk(e){typeof e=="function"?e=uk(e):e=mm(e);for(var t=this._groups,r=t.length,i=[],o=[],a=0;a<r;++a)for(var s=t[a],n=s.length,l,c=0;c<n;++c)(l=s[c])&&(i.push(e.call(l,l.__data__,c,s)),o.push(l));return new fi(i,o)}function ym(e){return function(){return this.matches(e)}}function xm(e){return function(t){return t.matches(e)}}var gk=Array.prototype.find;function pk(e){return function(){return gk.call(this.children,e)}}function mk(){return this.firstElementChild}function yk(e){return this.select(e==null?mk:pk(typeof e=="function"?e:xm(e)))}var xk=Array.prototype.filter;function bk(){return Array.from(this.children)}function Ck(e){return function(){return xk.call(this.children,e)}}function wk(e){return this.selectAll(e==null?bk:Ck(typeof e=="function"?e:xm(e)))}function kk(e){typeof e!="function"&&(e=ym(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var a=t[o],s=a.length,n=i[o]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&n.push(l);return new fi(i,this._parents)}function bm(e){return new Array(e.length)}function Sk(){return new fi(this._enter||this._groups.map(bm),this._parents)}function gl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}gl.prototype={constructor:gl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function vk(e){return function(){return e}}function Tk(e,t,r,i,o,a){for(var s=0,n,l=t.length,c=a.length;s<c;++s)(n=t[s])?(n.__data__=a[s],i[s]=n):r[s]=new gl(e,a[s]);for(;s<l;++s)(n=t[s])&&(o[s]=n)}function Mk(e,t,r,i,o,a,s){var n,l,c=new Map,h=t.length,d=a.length,u=new Array(h),f;for(n=0;n<h;++n)(l=t[n])&&(u[n]=f=s.call(l,l.__data__,n,t)+"",c.has(f)?o[n]=l:c.set(f,l));for(n=0;n<d;++n)f=s.call(e,a[n],n,a)+"",(l=c.get(f))?(i[n]=l,l.__data__=a[n],c.delete(f)):r[n]=new gl(e,a[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(u[n])===l&&(o[n]=l)}function _k(e){return e.__data__}function Bk(e,t){if(!arguments.length)return Array.from(this,_k);var r=t?Mk:Tk,i=this._parents,o=this._groups;typeof e!="function"&&(e=vk(e));for(var a=o.length,s=new Array(a),n=new Array(a),l=new Array(a),c=0;c<a;++c){var h=i[c],d=o[c],u=d.length,f=Lk(e.call(h,h&&h.__data__,c,i)),p=f.length,g=n[c]=new Array(p),m=s[c]=new Array(p),y=l[c]=new Array(u);r(h,d,g,m,y,f,t);for(var x=0,C=0,k,v;x<p;++x)if(k=g[x]){for(x>=C&&(C=x+1);!(v=m[C])&&++C<p;);k._next=v||null}}return s=new fi(s,i),s._enter=n,s._exit=l,s}function Lk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ak(){return new fi(this._exit||this._groups.map(bm),this._parents)}function Fk(e,t,r){var i=this.enter(),o=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?a.remove():r(a),i&&o?i.merge(o).order():o}function $k(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,a=i.length,s=Math.min(o,a),n=new Array(o),l=0;l<s;++l)for(var c=r[l],h=i[l],d=c.length,u=n[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||h[p])&&(u[p]=f);for(;l<o;++l)n[l]=r[l];return new fi(n,this._parents)}function Ek(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,a=i[o],s;--o>=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function Pk(e){e||(e=Ik);function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a){for(var s=r[a],n=s.length,l=o[a]=new Array(n),c,h=0;h<n;++h)(c=s[h])&&(l[h]=c);l.sort(t)}return new fi(o,this._parents).order()}function Ik(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ok(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Dk(){return Array.from(this)}function Rk(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,a=i.length;o<a;++o){var s=i[o];if(s)return s}return null}function Nk(){let e=0;for(const t of this)++e;return e}function qk(){return!this.node()}function Wk(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],a=0,s=o.length,n;a<s;++a)(n=o[a])&&e.call(n,n.__data__,a,o);return this}function zk(e){return function(){this.removeAttribute(e)}}function Hk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Yk(e,t){return function(){this.setAttribute(e,t)}}function Xk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Gk(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function jk(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function Uk(e,t){var r=Wl(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?Hk:zk:typeof t=="function"?r.local?jk:Gk:r.local?Xk:Yk)(r,t))}function Cm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Vk(e){return function(){this.style.removeProperty(e)}}function Zk(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Kk(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Qk(e,t,r){return arguments.length>1?this.each((t==null?Vk:typeof t=="function"?Kk:Zk)(e,t,r??"")):as(this.node(),e)}function as(e,t){return e.style.getPropertyValue(t)||Cm(e).getComputedStyle(e,null).getPropertyValue(t)}function Jk(e){return function(){delete this[e]}}function tS(e,t){return function(){this[e]=t}}function eS(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function rS(e,t){return arguments.length>1?this.each((t==null?Jk:typeof t=="function"?eS:tS)(e,t)):this.node()[e]}function wm(e){return e.trim().split(/^|\s+/)}function Bd(e){return e.classList||new km(e)}function km(e){this._node=e,this._names=wm(e.getAttribute("class")||"")}km.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Sm(e,t){for(var r=Bd(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function vm(e,t){for(var r=Bd(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function iS(e){return function(){Sm(this,e)}}function oS(e){return function(){vm(this,e)}}function aS(e,t){return function(){(t.apply(this,arguments)?Sm:vm)(this,e)}}function sS(e,t){var r=wm(e+"");if(arguments.length<2){for(var i=Bd(this.node()),o=-1,a=r.length;++o<a;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?aS:t?iS:oS)(r,t))}function nS(){this.textContent=""}function lS(e){return function(){this.textContent=e}}function cS(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function hS(e){return arguments.length?this.each(e==null?nS:(typeof e=="function"?cS:lS)(e)):this.node().textContent}function dS(){this.innerHTML=""}function uS(e){return function(){this.innerHTML=e}}function fS(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function gS(e){return arguments.length?this.each(e==null?dS:(typeof e=="function"?fS:uS)(e)):this.node().innerHTML}function pS(){this.nextSibling&&this.parentNode.appendChild(this)}function mS(){return this.each(pS)}function yS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xS(){return this.each(yS)}function bS(e){var t=typeof e=="function"?e:pm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function CS(){return null}function wS(e,t){var r=typeof e=="function"?e:pm(e),i=t==null?CS:typeof t=="function"?t:_d(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function kS(){var e=this.parentNode;e&&e.removeChild(this)}function SS(){return this.each(kS)}function vS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function TS(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function MS(e){return this.select(e?TS:vS)}function _S(e){return arguments.length?this.property("__data__",e):this.node().__data__}function BS(e){return function(t){e.call(this,t,this.__data__)}}function LS(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function AS(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,a;r<o;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++i]=a;++i?t.length=i:delete this.__on}}}function FS(e,t,r){return function(){var i=this.__on,o,a=BS(t);if(i){for(var s=0,n=i.length;s<n;++s)if((o=i[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=t;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:t,listener:a,options:r},i?i.push(o):this.__on=[o]}}function $S(e,t,r){var i=LS(e+""),o,a=i.length,s;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(o=0,h=n[l];o<a;++o)if((s=i[o]).type===h.type&&s.name===h.name)return h.value}return}for(n=t?FS:AS,o=0;o<a;++o)this.each(n(i[o],t,r));return this}function Tm(e,t,r){var i=Cm(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function ES(e,t){return function(){return Tm(this,e,t)}}function PS(e,t){return function(){return Tm(this,e,t.apply(this,arguments))}}function IS(e,t){return this.each((typeof t=="function"?PS:ES)(e,t))}function*OS(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,a=i.length,s;o<a;++o)(s=i[o])&&(yield s)}var Mm=[null];function fi(e,t){this._groups=e,this._parents=t}function hn(){return new fi([[document.documentElement]],Mm)}function DS(){return this}fi.prototype=hn.prototype={constructor:fi,select:ck,selectAll:fk,selectChild:yk,selectChildren:wk,filter:kk,data:Bk,enter:Sk,exit:Ak,join:Fk,merge:$k,selection:DS,order:Ek,sort:Pk,call:Ok,nodes:Dk,node:Rk,size:Nk,empty:qk,each:Wk,attr:Uk,style:Qk,property:rS,classed:sS,text:hS,html:gS,raise:mS,lower:xS,append:bS,insert:wS,remove:SS,clone:MS,datum:_S,on:$S,dispatch:IS,[Symbol.iterator]:OS};function He(e){return typeof e=="string"?new fi([[document.querySelector(e)]],[document.documentElement]):new fi([[e]],Mm)}function Ld(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function _m(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function dn(){}var Js=.7,pl=1/Js,Wa="\\s*([+-]?\\d+)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",to="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",RS=/^#([0-9a-f]{3,8})$/,NS=new RegExp(`^rgb\\(${Wa},${Wa},${Wa}\\)$`),qS=new RegExp(`^rgb\\(${to},${to},${to}\\)$`),WS=new RegExp(`^rgba\\(${Wa},${Wa},${Wa},${tn}\\)$`),zS=new RegExp(`^rgba\\(${to},${to},${to},${tn}\\)$`),HS=new RegExp(`^hsl\\(${tn},${to},${to}\\)$`),YS=new RegExp(`^hsla\\(${tn},${to},${to},${tn}\\)$`),Ff={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};Ld(dn,ss,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$f,formatHex:$f,formatHex8:XS,formatHsl:GS,formatRgb:Ef,toString:Ef});function $f(){return this.rgb().formatHex()}function XS(){return this.rgb().formatHex8()}function GS(){return Bm(this).formatHsl()}function Ef(){return this.rgb().formatRgb()}function ss(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=RS.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Pf(t):r===3?new si(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?vn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?vn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=NS.exec(e))?new si(t[1],t[2],t[3],1):(t=qS.exec(e))?new si(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=WS.exec(e))?vn(t[1],t[2],t[3],t[4]):(t=zS.exec(e))?vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=HS.exec(e))?Df(t[1],t[2]/100,t[3]/100,1):(t=YS.exec(e))?Df(t[1],t[2]/100,t[3]/100,t[4]):Ff.hasOwnProperty(e)?Pf(Ff[e]):e==="transparent"?new si(NaN,NaN,NaN,0):null}function Pf(e){return new si(e>>16&255,e>>8&255,e&255,1)}function vn(e,t,r,i){return i<=0&&(e=t=r=NaN),new si(e,t,r,i)}function jS(e){return e instanceof dn||(e=ss(e)),e?(e=e.rgb(),new si(e.r,e.g,e.b,e.opacity)):new si}function wi(e,t,r,i){return arguments.length===1?jS(e):new si(e,t,r,i??1)}function si(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}Ld(si,wi,_m(dn,{brighter(e){return e=e==null?pl:Math.pow(pl,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Js:Math.pow(Js,e),new si(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new si(la(this.r),la(this.g),la(this.b),ml(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:If,formatHex:If,formatHex8:US,formatRgb:Of,toString:Of}));function If(){return`#${na(this.r)}${na(this.g)}${na(this.b)}`}function US(){return`#${na(this.r)}${na(this.g)}${na(this.b)}${na((isNaN(this.opacity)?1:this.opacity)*255)}`}function Of(){const e=ml(this.opacity);return`${e===1?"rgb(":"rgba("}${la(this.r)}, ${la(this.g)}, ${la(this.b)}${e===1?")":`, ${e})`}`}function ml(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function la(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function na(e){return e=la(e),(e<16?"0":"")+e.toString(16)}function Df(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ii(e,t,r,i)}function Bm(e){if(e instanceof Ii)return new Ii(e.h,e.s,e.l,e.opacity);if(e instanceof dn||(e=ss(e)),!e)return new Ii;if(e instanceof Ii)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),a=Math.max(t,r,i),s=NaN,n=a-o,l=(a+o)/2;return n?(t===a?s=(r-i)/n+(r<i)*6:r===a?s=(i-t)/n+2:s=(t-r)/n+4,n/=l<.5?a+o:2-a-o,s*=60):n=l>0&&l<1?0:s,new Ii(s,n,l,e.opacity)}function VS(e,t,r,i){return arguments.length===1?Bm(e):new Ii(e,t,r,i??1)}function Ii(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}Ld(Ii,VS,_m(dn,{brighter(e){return e=e==null?pl:Math.pow(pl,e),new Ii(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Js:Math.pow(Js,e),new Ii(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new si(Ic(e>=240?e-240:e+120,o,i),Ic(e,o,i),Ic(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Ii(Rf(this.h),Tn(this.s),Tn(this.l),ml(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ml(this.opacity);return`${e===1?"hsl(":"hsla("}${Rf(this.h)}, ${Tn(this.s)*100}%, ${Tn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Rf(e){return e=(e||0)%360,e<0?e+360:e}function Tn(e){return Math.max(0,Math.min(1,e||0))}function Ic(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Ad=e=>()=>e;function Lm(e,t){return function(r){return e+r*t}}function ZS(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function JP(e,t){var r=t-e;return r?Lm(e,r>180||r<-180?r-360*Math.round(r/360):r):Ad(isNaN(e)?t:e)}function KS(e){return(e=+e)==1?Am:function(t,r){return r-t?ZS(t,r,e):Ad(isNaN(t)?r:t)}}function Am(e,t){var r=t-e;return r?Lm(e,r):Ad(isNaN(e)?t:e)}const Nf=(function e(t){var r=KS(t);function i(o,a){var s=r((o=wi(o)).r,(a=wi(a)).r),n=r(o.g,a.g),l=r(o.b,a.b),c=Am(o.opacity,a.opacity);return function(h){return o.r=s(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function Ro(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var xh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Oc=new RegExp(xh.source,"g");function QS(e){return function(){return e}}function JS(e){return function(t){return e(t)+""}}function tv(e,t){var r=xh.lastIndex=Oc.lastIndex=0,i,o,a,s=-1,n=[],l=[];for(e=e+"",t=t+"";(i=xh.exec(e))&&(o=Oc.exec(t));)(a=o.index)>r&&(a=t.slice(r,a),n[s]?n[s]+=a:n[++s]=a),(i=i[0])===(o=o[0])?n[s]?n[s]+=o:n[++s]=o:(n[++s]=null,l.push({i:s,x:Ro(i,o)})),r=Oc.lastIndex;return r<t.length&&(a=t.slice(r),n[s]?n[s]+=a:n[++s]=a),n.length<2?l[0]?JS(l[0].x):QS(t):(t=l.length,function(c){for(var h=0,d;h<t;++h)n[(d=l[h]).i]=d.x(c);return n.join("")})}var qf=180/Math.PI,bh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Fm(e,t,r,i,o,a){var s,n,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(n=Math.sqrt(r*r+i*i))&&(r/=n,i/=n,l/=n),e*i<t*r&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*qf,skewX:Math.atan(l)*qf,scaleX:s,scaleY:n}}var Mn;function ev(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?bh:Fm(t.a,t.b,t.c,t.d,t.e,t.f)}function rv(e){return e==null||(Mn||(Mn=document.createElementNS("http://www.w3.org/2000/svg","g")),Mn.setAttribute("transform",e),!(e=Mn.transform.baseVal.consolidate()))?bh:(e=e.matrix,Fm(e.a,e.b,e.c,e.d,e.e,e.f))}function $m(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function a(c,h,d,u,f,p){if(c!==d||h!==u){var g=f.push("translate(",null,t,null,r);p.push({i:g-4,x:Ro(c,d)},{i:g-2,x:Ro(h,u)})}else(d||u)&&f.push("translate("+d+t+u+r)}function s(c,h,d,u){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),u.push({i:d.push(o(d)+"rotate(",null,i)-2,x:Ro(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,u){c!==h?u.push({i:d.push(o(d)+"skewX(",null,i)-2,x:Ro(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,u,f,p){if(c!==d||h!==u){var g=f.push(o(f)+"scale(",null,",",null,")");p.push({i:g-4,x:Ro(c,d)},{i:g-2,x:Ro(h,u)})}else(d!==1||u!==1)&&f.push(o(f)+"scale("+d+","+u+")")}return function(c,h){var d=[],u=[];return c=e(c),h=e(h),a(c.translateX,c.translateY,h.translateX,h.translateY,d,u),s(c.rotate,h.rotate,d,u),n(c.skewX,h.skewX,d,u),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,u),c=h=null,function(f){for(var p=-1,g=u.length,m;++p<g;)d[(m=u[p]).i]=m.x(f);return d.join("")}}}var iv=$m(ev,"px, ","px)","deg)"),ov=$m(rv,", ",")",")"),ns=0,Es=0,ks=0,Em=1e3,yl,Ps,xl=0,ga=0,zl=0,en=typeof performance=="object"&&performance.now?performance:Date,Pm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fd(){return ga||(Pm(av),ga=en.now()+zl)}function av(){ga=0}function bl(){this._call=this._time=this._next=null}bl.prototype=Im.prototype={constructor:bl,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Fd():+r)+(t==null?0:+t),!this._next&&Ps!==this&&(Ps?Ps._next=this:yl=this,Ps=this),this._call=e,this._time=r,Ch()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ch())}};function Im(e,t,r){var i=new bl;return i.restart(e,t,r),i}function sv(){Fd(),++ns;for(var e=yl,t;e;)(t=ga-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ns}function Wf(){ga=(xl=en.now())+zl,ns=Es=0;try{sv()}finally{ns=0,lv(),ga=0}}function nv(){var e=en.now(),t=e-xl;t>Em&&(zl-=t,xl=e)}function lv(){for(var e,t=yl,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:yl=r);Ps=e,Ch(i)}function Ch(e){if(!ns){Es&&(Es=clearTimeout(Es));var t=e-ga;t>24?(e<1/0&&(Es=setTimeout(Wf,e-en.now()-zl)),ks&&(ks=clearInterval(ks))):(ks||(xl=en.now(),ks=setInterval(nv,Em)),ns=1,Pm(Wf))}}function zf(e,t,r){var i=new bl;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var cv=gm("start","end","cancel","interrupt"),hv=[],Om=0,Hf=1,wh=2,Vn=3,Yf=4,kh=5,Zn=6;function Hl(e,t,r,i,o,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;dv(e,r,{name:t,index:i,group:o,on:cv,tween:hv,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Om})}function $d(e,t){var r=qi(e,t);if(r.state>Om)throw new Error("too late; already scheduled");return r}function so(e,t){var r=qi(e,t);if(r.state>Vn)throw new Error("too late; already running");return r}function qi(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function dv(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=Im(a,0,r.time);function a(c){r.state=Hf,r.timer.restart(s,r.delay,r.time),r.delay<=c&&s(c-r.delay)}function s(c){var h,d,u,f;if(r.state!==Hf)return l();for(h in i)if(f=i[h],f.name===r.name){if(f.state===Vn)return zf(s);f.state===Yf?(f.state=Zn,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[h]):+h<t&&(f.state=Zn,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[h])}if(zf(function(){r.state===Vn&&(r.state=Yf,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=wh,r.on.call("start",e,e.__data__,r.index,r.group),r.state===wh){for(r.state=Vn,o=new Array(u=r.tween.length),h=0,d=-1;h<u;++h)(f=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++d]=f);o.length=d+1}}function n(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=kh,1),d=-1,u=o.length;++d<u;)o[d].call(e,h);r.state===kh&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=Zn,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function uv(e,t){var r=e.__transition,i,o,a=!0,s;if(r){t=t==null?null:t+"";for(s in r){if((i=r[s]).name!==t){a=!1;continue}o=i.state>wh&&i.state<kh,i.state=Zn,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]}a&&delete e.__transition}}function fv(e){return this.each(function(){uv(this,e)})}function gv(e,t){var r,i;return function(){var o=so(this,e),a=o.tween;if(a!==r){i=r=a;for(var s=0,n=i.length;s<n;++s)if(i[s].name===t){i=i.slice(),i.splice(s,1);break}}o.tween=i}}function pv(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var a=so(this,e),s=a.tween;if(s!==i){o=(i=s).slice();for(var n={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=n;break}l===c&&o.push(n)}a.tween=o}}function mv(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=qi(this.node(),r).tween,o=0,a=i.length,s;o<a;++o)if((s=i[o]).name===e)return s.value;return null}return this.each((t==null?gv:pv)(r,e,t))}function Ed(e,t,r){var i=e._id;return e.each(function(){var o=so(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return qi(o,i).value[t]}}function Dm(e,t){var r;return(typeof t=="number"?Ro:t instanceof ss?Nf:(r=ss(t))?(t=r,Nf):tv)(e,t)}function yv(e){return function(){this.removeAttribute(e)}}function xv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bv(e,t,r){var i,o=r+"",a;return function(){var s=this.getAttribute(e);return s===o?null:s===i?a:a=t(i=s,r)}}function Cv(e,t,r){var i,o=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===i?a:a=t(i=s,r)}}function wv(e,t,r){var i,o,a;return function(){var s,n=r(this),l;return n==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=n+"",s===l?null:s===i&&l===o?a:(o=l,a=t(i=s,n)))}}function kv(e,t,r){var i,o,a;return function(){var s,n=r(this),l;return n==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=n+"",s===l?null:s===i&&l===o?a:(o=l,a=t(i=s,n)))}}function Sv(e,t){var r=Wl(e),i=r==="transform"?ov:Dm;return this.attrTween(e,typeof t=="function"?(r.local?kv:wv)(r,i,Ed(this,"attr."+e,t)):t==null?(r.local?xv:yv)(r):(r.local?Cv:bv)(r,i,t))}function vv(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Tv(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Mv(e,t){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Tv(e,a)),r}return o._value=t,o}function _v(e,t){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&vv(e,a)),r}return o._value=t,o}function Bv(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=Wl(e);return this.tween(r,(i.local?Mv:_v)(i,t))}function Lv(e,t){return function(){$d(this,e).delay=+t.apply(this,arguments)}}function Av(e,t){return t=+t,function(){$d(this,e).delay=t}}function Fv(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Lv:Av)(t,e)):qi(this.node(),t).delay}function $v(e,t){return function(){so(this,e).duration=+t.apply(this,arguments)}}function Ev(e,t){return t=+t,function(){so(this,e).duration=t}}function Pv(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$v:Ev)(t,e)):qi(this.node(),t).duration}function Iv(e,t){if(typeof t!="function")throw new Error;return function(){so(this,e).ease=t}}function Ov(e){var t=this._id;return arguments.length?this.each(Iv(t,e)):qi(this.node(),t).ease}function Dv(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;so(this,e).ease=r}}function Rv(e){if(typeof e!="function")throw new Error;return this.each(Dv(this._id,e))}function Nv(e){typeof e!="function"&&(e=ym(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var a=t[o],s=a.length,n=i[o]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&n.push(l);return new vo(i,this._parents,this._name,this._id)}function qv(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,o=r.length,a=Math.min(i,o),s=new Array(i),n=0;n<a;++n)for(var l=t[n],c=r[n],h=l.length,d=s[n]=new Array(h),u,f=0;f<h;++f)(u=l[f]||c[f])&&(d[f]=u);for(;n<i;++n)s[n]=t[n];return new vo(s,this._parents,this._name,this._id)}function Wv(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function zv(e,t,r){var i,o,a=Wv(t)?$d:so;return function(){var s=a(this,e),n=s.on;n!==i&&(o=(i=n).copy()).on(t,r),s.on=o}}function Hv(e,t){var r=this._id;return arguments.length<2?qi(this.node(),r).on.on(e):this.each(zv(r,e,t))}function Yv(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Xv(){return this.on("end.remove",Yv(this._id))}function Gv(e){var t=this._name,r=this._id;typeof e!="function"&&(e=_d(e));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s<o;++s)for(var n=i[s],l=n.length,c=a[s]=new Array(l),h,d,u=0;u<l;++u)(h=n[u])&&(d=e.call(h,h.__data__,u,n))&&("__data__"in h&&(d.__data__=h.__data__),c[u]=d,Hl(c[u],t,r,u,c,qi(h,r)));return new vo(a,this._parents,t,r)}function jv(e){var t=this._name,r=this._id;typeof e!="function"&&(e=mm(e));for(var i=this._groups,o=i.length,a=[],s=[],n=0;n<o;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var u=e.call(h,h.__data__,d,l),f,p=qi(h,r),g=0,m=u.length;g<m;++g)(f=u[g])&&Hl(f,t,r,g,u,p);a.push(u),s.push(h)}return new vo(a,s,t,r)}var Uv=hn.prototype.constructor;function Vv(){return new Uv(this._groups,this._parents)}function Zv(e,t){var r,i,o;return function(){var a=as(this,e),s=(this.style.removeProperty(e),as(this,e));return a===s?null:a===r&&s===i?o:o=t(r=a,i=s)}}function Rm(e){return function(){this.style.removeProperty(e)}}function Kv(e,t,r){var i,o=r+"",a;return function(){var s=as(this,e);return s===o?null:s===i?a:a=t(i=s,r)}}function Qv(e,t,r){var i,o,a;return function(){var s=as(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),as(this,e))),s===l?null:s===i&&l===o?a:(o=l,a=t(i=s,n))}}function Jv(e,t){var r,i,o,a="style."+t,s="end."+a,n;return function(){var l=so(this,e),c=l.on,h=l.value[a]==null?n||(n=Rm(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(s,o=h),l.on=i}}function tT(e,t,r){var i=(e+="")=="transform"?iv:Dm;return t==null?this.styleTween(e,Zv(e,i)).on("end.style."+e,Rm(e)):typeof t=="function"?this.styleTween(e,Qv(e,i,Ed(this,"style."+e,t))).each(Jv(this._id,e)):this.styleTween(e,Kv(e,i,t),r).on("end.style."+e,null)}function eT(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function rT(e,t,r){var i,o;function a(){var s=t.apply(this,arguments);return s!==o&&(i=(o=s)&&eT(e,s,r)),i}return a._value=t,a}function iT(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,rT(e,t,r??""))}function oT(e){return function(){this.textContent=e}}function aT(e){return function(){var t=e(this);this.textContent=t??""}}function sT(e){return this.tween("text",typeof e=="function"?aT(Ed(this,"text",e)):oT(e==null?"":e+""))}function nT(e){return function(t){this.textContent=e.call(this,t)}}function lT(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&nT(o)),t}return i._value=e,i}function cT(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,lT(e))}function hT(){for(var e=this._name,t=this._id,r=Nm(),i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],n=s.length,l,c=0;c<n;++c)if(l=s[c]){var h=qi(l,t);Hl(l,e,r,c,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new vo(i,this._parents,e,r)}function dT(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(a,s){var n={value:s},l={value:function(){--o===0&&a()}};r.each(function(){var c=so(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),o===0&&a()})}var uT=0;function vo(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function Nm(){return++uT}var go=hn.prototype;vo.prototype={constructor:vo,select:Gv,selectAll:jv,selectChild:go.selectChild,selectChildren:go.selectChildren,filter:Nv,merge:qv,selection:Vv,transition:hT,call:go.call,nodes:go.nodes,node:go.node,size:go.size,empty:go.empty,each:go.each,on:Hv,attr:Sv,attrTween:Bv,style:tT,styleTween:iT,text:sT,textTween:cT,remove:Xv,tween:mv,delay:Fv,duration:Pv,ease:Ov,easeVarying:Rv,end:dT,[Symbol.iterator]:go[Symbol.iterator]};function fT(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var gT={time:null,delay:0,duration:250,ease:fT};function pT(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function mT(e){var t,r;e instanceof vo?(t=e._id,e=e._name):(t=Nm(),(r=gT).time=Fd(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],n=s.length,l,c=0;c<n;++c)(l=s[c])&&Hl(l,e,t,c,s,r||pT(l,t));return new vo(i,this._parents,e,t)}hn.prototype.interrupt=fv;hn.prototype.transition=mT;const Sh=Math.PI,vh=2*Sh,ra=1e-6,yT=vh-ra;function qm(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function xT(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return qm;const r=10**t;return function(i){this._+=i[0];for(let o=1,a=i.length;o<a;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}class bT{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?qm:xT(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,a,s){this._append`C${+t},${+r},${+i},${+o},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,i,o,a){if(t=+t,r=+r,i=+i,o=+o,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,n=this._y1,l=i-t,c=o-r,h=s-t,d=n-r,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(u>ra)if(!(Math.abs(d*l-c*h)>ra)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-s,p=o-n,g=l*l+c*c,m=f*f+p*p,y=Math.sqrt(g),x=Math.sqrt(u),C=a*Math.tan((Sh-Math.acos((g+u-m)/(2*y*x)))/2),k=C/x,v=C/y;Math.abs(k-1)>ra&&this._append`L${t+k*h},${r+k*d}`,this._append`A${a},${a},0,0,${+(d*f>h*p)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,o,a,s){if(t=+t,r=+r,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^s,u=s?o-a:a-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>ra||Math.abs(this._y1-h)>ra)&&this._append`L${c},${h}`,i&&(u<0&&(u=u%vh+vh),u>yT?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:u>ra&&this._append`A${i},${i},0,${+(u>=Sh)},${d},${this._x1=t+i*Math.cos(a)},${this._y1=r+i*Math.sin(a)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function va(e){return function(){return e}}const tI=Math.abs,eI=Math.atan2,rI=Math.cos,iI=Math.max,oI=Math.min,aI=Math.sin,sI=Math.sqrt,Xf=1e-12,Pd=Math.PI,Gf=Pd/2,nI=2*Pd;function lI(e){return e>1?0:e<-1?Pd:Math.acos(e)}function cI(e){return e>=1?Gf:e<=-1?-Gf:Math.asin(e)}function CT(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new bT(t)}function wT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Wm(e){this._context=e}Wm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Us(e){return new Wm(e)}function kT(e){return e[0]}function ST(e){return e[1]}function vT(e,t){var r=va(!0),i=null,o=Us,a=null,s=CT(n);e=typeof e=="function"?e:e===void 0?kT:va(e),t=typeof t=="function"?t:t===void 0?ST:va(t);function n(l){var c,h=(l=wT(l)).length,d,u=!1,f;for(i==null&&(a=o(f=s())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(d,c,l),+t(d,c,l));if(f)return a=null,f+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:va(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:va(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:va(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(a=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=a=null:a=o(i=l),n):i},n}class zm{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Hm(e){return new zm(e,!0)}function Ym(e){return new zm(e,!1)}function Xo(){}function Cl(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Yl(e){this._context=e}Yl.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:Cl(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Cl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Th(e){return new Yl(e)}function Xm(e){this._context=e}Xm.prototype={areaStart:Xo,areaEnd:Xo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Cl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TT(e){return new Xm(e)}function Gm(e){this._context=e}Gm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:Cl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MT(e){return new Gm(e)}function jm(e,t){this._basis=new Yl(e),this._beta=t}jm.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],o=t[0],a=e[r]-i,s=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*a),this._beta*t[n]+(1-this._beta)*(o+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const _T=(function e(t){function r(i){return t===1?new Yl(i):new jm(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function wl(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Id(e,t){this._context=e,this._k=(1-t)/6}Id.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:wl(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:wl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Um=(function e(t){function r(i){return new Id(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Od(e,t){this._context=e,this._k=(1-t)/6}Od.prototype={areaStart:Xo,areaEnd:Xo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:wl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const BT=(function e(t){function r(i){return new Od(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Dd(e,t){this._context=e,this._k=(1-t)/6}Dd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const LT=(function e(t){function r(i){return new Dd(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Rd(e,t,r){var i=e._x1,o=e._y1,a=e._x2,s=e._y2;if(e._l01_a>Xf){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Xf){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/h,s=(s*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,a,s,e._x2,e._y2)}function Vm(e,t){this._context=e,this._alpha=t}Vm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Rd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Zm=(function e(t){function r(i){return t?new Vm(i,t):new Id(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Km(e,t){this._context=e,this._alpha=t}Km.prototype={areaStart:Xo,areaEnd:Xo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Rd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const AT=(function e(t){function r(i){return t?new Km(i,t):new Od(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Qm(e,t){this._context=e,this._alpha=t}Qm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Rd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const FT=(function e(t){function r(i){return t?new Qm(i,t):new Dd(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Jm(e){this._context=e}Jm.prototype={areaStart:Xo,areaEnd:Xo,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function $T(e){return new Jm(e)}function jf(e){return e<0?-1:1}function Uf(e,t,r){var i=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(i||o<0&&-0),s=(r-e._y1)/(o||i<0&&-0),n=(a*o+s*i)/(i+o);return(jf(a)+jf(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(n))||0}function Vf(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Dc(e,t,r){var i=e._x0,o=e._y0,a=e._x1,s=e._y1,n=(a-i)/3;e._context.bezierCurveTo(i+n,o+n*t,a-n,s-n*r,a,s)}function kl(e){this._context=e}kl.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:Dc(this,this._t0,Vf(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Dc(this,Vf(this,r=Uf(this,e,t)),r);break;default:Dc(this,this._t0,r=Uf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function ty(e){this._context=new ey(e)}(ty.prototype=Object.create(kl.prototype)).point=function(e,t){kl.prototype.point.call(this,t,e)};function ey(e){this._context=e}ey.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,a){this._context.bezierCurveTo(t,e,i,r,a,o)}};function ry(e){return new kl(e)}function iy(e){return new ty(e)}function oy(e){this._context=e}oy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=Zf(e),o=Zf(t),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(i[0][a],o[0][a],i[1][a],o[1][a],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Zf(e){var t,r=e.length-1,i,o=new Array(r),a=new Array(r),s=new Array(r);for(o[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,a[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/a[t-1],a[t]-=i,s[t]-=i*s[t-1];for(o[r-1]=s[r-1]/a[r-1],t=r-2;t>=0;--t)o[t]=(s[t]-o[t+1])/a[t];for(a[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function ay(e){return new oy(e)}function Xl(e,t){this._context=e,this._t=t}Xl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function sy(e){return new Xl(e,.5)}function ny(e){return new Xl(e,0)}function ly(e){return new Xl(e,1)}function Is(e,t,r){this.k=e,this.x=t,this.y=r}Is.prototype={constructor:Is,scale:function(e){return e===1?this:new Is(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Is(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Is.prototype;function Rc(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ET(){}function cy(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Nd(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const PT="[object RegExp]",hy="[object String]",dy="[object Number]",uy="[object Boolean]",fy="[object Arguments]",IT="[object Symbol]",OT="[object Date]",DT="[object Map]",RT="[object Set]",NT="[object Array]",qT="[object ArrayBuffer]",WT="[object Object]",zT="[object DataView]",HT="[object Uint8Array]",YT="[object Uint8ClampedArray]",XT="[object Uint16Array]",GT="[object Uint32Array]",jT="[object Int8Array]",UT="[object Int16Array]",VT="[object Int32Array]",ZT="[object Float32Array]",KT="[object Float64Array]",Kf=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function qd(e){return typeof Kf.Buffer<"u"&&Kf.Buffer.isBuffer(e)}function QT(e){return Number.isSafeInteger(e)&&e>=0}function gy(e){return e!=null&&typeof e!="function"&&QT(e.length)}function JT(e){return e==="__proto__"}function Wd(e){return e==null||typeof e!="object"&&typeof e!="function"}function zd(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function tM(e,t){return Oa(e,void 0,e,new Map,t)}function Oa(e,t,r,i=new Map,o=void 0){const a=o?.(e,t,r,i);if(a!==void 0)return a;if(Wd(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const s=new Array(e.length);i.set(e,s);for(let n=0;n<e.length;n++)s[n]=Oa(e[n],n,r,i,o);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;i.set(e,s);for(const[n,l]of e)s.set(n,Oa(l,n,r,i,o));return s}if(e instanceof Set){const s=new Set;i.set(e,s);for(const n of e)s.add(Oa(n,void 0,r,i,o));return s}if(qd(e))return e.subarray();if(zd(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,s);for(let n=0;n<e.length;n++)s[n]=Oa(e[n],n,r,i,o);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,s),Fi(s,e,r,i,o),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return i.set(e,s),Fi(s,e,r,i,o),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return i.set(e,s),Fi(s,e,r,i,o),s}if(e instanceof Error){const s=structuredClone(e);return i.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,Fi(s,e,r,i,o),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return i.set(e,s),Fi(s,e,r,i,o),s}if(e instanceof Number){const s=new Number(e.valueOf());return i.set(e,s),Fi(s,e,r,i,o),s}if(e instanceof String){const s=new String(e.valueOf());return i.set(e,s),Fi(s,e,r,i,o),s}if(typeof e=="object"&&eM(e)){const s=Object.create(Object.getPrototypeOf(e));return i.set(e,s),Fi(s,e,r,i,o),s}return e}function Fi(e,t,r=e,i,o){const a=[...Object.keys(t),...cy(t)];for(let s=0;s<a.length;s++){const n=a[s],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=Oa(t[n],n,r,i,o))}}function eM(e){switch(Nd(e)){case fy:case NT:case qT:case zT:case uy:case OT:case ZT:case KT:case jT:case UT:case VT:case DT:case dy:case WT:case PT:case RT:case hy:case IT:case HT:case YT:case XT:case GT:return!0;default:return!1}}function rM(e,t){return tM(e,(r,i,o,a)=>{if(typeof e=="object"){if(Nd(e)==="[object Object]"&&typeof e.constructor!="function"){const s={};return a.set(e,s),Fi(s,e,o,a),s}switch(Object.prototype.toString.call(e)){case dy:case hy:case uy:{const s=new e.constructor(e?.valueOf());return Fi(s,e),s}case fy:{const s={};return Fi(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}function Qf(e){return rM(e)}function Mh(e){return e!==null&&typeof e=="object"&&Nd(e)==="[object Arguments]"}function _h(e){return typeof e=="object"&&e!==null}function iM(e){return _h(e)&&gy(e)}function Kn(e){return zd(e)}function oM(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function un(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],a=r.cache;if(a.has(o))return a.get(o);const s=e.apply(this,i);return r.cache=a.set(o,s)||a,s};return r.cache=new(un.Cache||Map),r}un.Cache=Map;function aM(e){if(Wd(e))return e;if(Array.isArray(e)||zd(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function sM(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let a=0;a<r.length;a++){const s=r[a];o=Qn(o,s,i,new Map)}return o}function Qn(e,t,r,i){if(Wd(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return aM(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let a=0;a<t.length;a++)a in t||(t[a]=void 0)}const o=[...Object.keys(t),...cy(t)];for(let a=0;a<o.length;a++){const s=o[a];if(JT(s))continue;let n=t[s],l=e[s];if(Mh(n)&&(n={...n}),Mh(l)&&(l={...l}),qd(n)&&(n=Qf(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let u=0;u<d.length;u++){const f=d[u];h[f]=l[f]}l=h}else if(iM(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,n,s,e,t,i);c!==void 0?e[s]=c:Array.isArray(n)||_h(l)&&_h(n)&&(Rc(l)||Rc(n)||Kn(l)||Kn(n))?e[s]=Qn(l,n,r,i):l==null&&Rc(n)?e[s]=Qn({},n,r,i):l==null&&Kn(n)?e[s]=Qf(n):(l===void 0||n!==void 0)&&(e[s]=n)}return e}function nM(e,...t){return sM(e,...t,ET)}function Jf(e){if(e==null)return!0;if(gy(e))return typeof e.splice!="function"&&typeof e!="string"&&!qd(e)&&!Kn(e)&&!Mh(e)?!1:e.length===0;if(typeof e=="object"||typeof e=="function"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return oM(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var lM="​",cM={curveBasis:Th,curveBasisClosed:TT,curveBasisOpen:MT,curveBumpX:Hm,curveBumpY:Ym,curveBundle:_T,curveCardinalClosed:BT,curveCardinalOpen:LT,curveCardinal:Um,curveCatmullRomClosed:AT,curveCatmullRomOpen:FT,curveCatmullRom:Zm,curveLinear:Us,curveLinearClosed:$T,curveMonotoneX:ry,curveMonotoneY:iy,curveNatural:ay,curveStep:sy,curveStepAfter:ly,curveStepBefore:ny},hM=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,dM=b(function(e,t){const r=py(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const s=r.map(n=>n.args);sl(s),i=Pr(i,[...s])}else i=r.args;if(!i)return;let o=ql(e,t);const a="config";return i[a]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[a],delete i[a]),i},"detectInit"),py=b(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${hM.source})(?=[}][%]{2}).*
160
+ `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),Mt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=Xs.exec(e))!==null;)if(i.index===Xs.lastIndex&&Xs.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const a=i[1]?i[1]:i[2],s=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:a,args:s})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return Mt.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),uM=b(function(e){return e.replace(Xs,"")},"removeDirectives"),fM=b(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Hd(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return cM[r]??t}b(Hd,"interpolateToCurve");function my(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?rk.sanitizeUrl(r):r}b(my,"formatUrl");var gM=b((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let a=window;for(let s=0;s<i;s++)if(a=a[r[s]],!a){Mt.error(`Function name: ${e} not found in window`);return}a[o](...t)},"runFunc");function Yd(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}b(Yd,"distance");function yy(e){let t,r=0;e.forEach(o=>{r+=Yd(o,t),t=o});const i=r/2;return Xd(e,i)}b(yy,"traverseEdge");function xy(e){return e.length===1?e[0]:yy(e)}b(xy,"calcLabelPosition");var tg=b((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Xd=b((e,t)=>{let r,i=t;for(const o of e){if(r){const a=Yd(o,r);if(a===0)return r;if(a<i)i-=a;else{const s=i/a;if(s<=0)return r;if(s>=1)return{x:o.x,y:o.y};if(s>0&&s<1)return{x:tg((1-s)*r.x+s*o.x,5),y:tg((1-s)*r.y+s*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),pM=b((e,t,r)=>{Mt.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=Xd(t,25),a=e?10:5,s=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(s)*a+(t[0].x+o.x)/2,n.y=-Math.cos(s)*a+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function by(e,t,r){const i=structuredClone(r);Mt.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,a=Xd(i,o),s=10+e*.5,n=Math.atan2(i[0].y-a.y,i[0].x-a.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*s+(i[0].x+a.x)/2,l.y=-Math.cos(n+Math.PI)*s+(i[0].y+a.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*s+(i[0].x+a.x)/2,l.y=-Math.cos(n-Math.PI)*s+(i[0].y+a.y)/2):(l.x=Math.sin(n)*s+(i[0].x+a.x)/2,l.y=-Math.cos(n)*s+(i[0].y+a.y)/2),l}b(by,"calcTerminalLabelPosition");function Cy(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}b(Cy,"getStylesFromArray");var eg=0,mM=b(()=>(eg++,"id-"+Math.random().toString(36).substr(2,12)+"-"+eg),"generateId");function wy(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}b(wy,"makeRandomHex");var yM=b(e=>wy(e.length),"random"),xM=b(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),bM=b(function(e,t){const r=t.text.replace(cn.lineBreakRegex," "),[,i]=Gl(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const a=o.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.attr("fill",t.fill),a.text(r),o},"drawSimpleText"),CM=un((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),cn.hasBreaks(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let a="";return i.forEach((s,n)=>{const l=To(`${s} `,r),c=To(a,r);if(l>t){const{hyphenatedStrings:u,remainingWord:f}=wM(s,t,"-",r);o.push(a,...u),a=f}else c+l>=t?(o.push(a),a=s):a=[a,s].filter(Boolean).join(" ");n+1===i.length&&o.push(a)}),o.filter(s=>s!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),wM=un((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],a=[];let s="";return o.forEach((n,l)=>{const c=`${s}${n}`;if(To(c,i)>=t){const d=l+1,u=o.length===d,f=`${c}${r}`;a.push(u?c:f),s=""}else s=c}),{hyphenatedStrings:a,remainingWord:s}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function ky(e,t){return Gd(e,t).height}b(ky,"calculateTextHeight");function To(e,t){return Gd(e,t).width}b(To,"calculateTextWidth");var Gd=un((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,a]=Gl(r),s=["sans-serif",i],n=e.split(cn.lineBreakRegex),l=[],c=He("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of s){let f=0;const p={width:0,height:0,lineHeight:0};for(const g of n){const m=xM();m.text=g||lM;const y=bM(h,m).style("font-size",a).style("font-weight",o).style("font-family",u),x=(y._groups||y)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");p.width=Math.round(Math.max(p.width,x.width)),f=Math.round(x.height),p.height+=f,p.lineHeight=Math.round(Math.max(p.lineHeight,f))}l.push(p)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),rs,kM=(rs=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},b(rs,"InitIDGenerator"),rs),_n,SM=b(function(e){return _n=_n||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),_n.innerHTML=e,unescape(_n.textContent)},"entityDecode");function jd(e){return"str"in e}b(jd,"isDetailedError");function Sy(e){return e instanceof Error?e.message:String(e)}b(Sy,"getErrorMessage");var vM=b((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Gl=b(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function Ud(e,t){return nM({},e,t)}b(Ud,"cleanAndMerge");var ui={assignWithDepth:Pr,wrapLabel:CM,calculateTextHeight:ky,calculateTextWidth:To,calculateTextDimensions:Gd,cleanAndMerge:Ud,detectInit:dM,detectDirective:py,isSubstringInArray:fM,interpolateToCurve:Hd,calcLabelPosition:xy,calcCardinalityPosition:pM,calcTerminalLabelPosition:by,formatUrl:my,getStylesFromArray:Cy,generateId:mM,random:yM,runFunc:gM,entityDecode:SM,insertTitle:vM,isLabelCoordinateInPath:vy,parseFontSize:Gl,InitIDGenerator:kM},TM=b(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),Go=b(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),hI=b((e,t,{counter:r=0,prefix:i,suffix:o},a)=>a||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Or(e){return e??null}b(Or,"handleUndefinedAttr");function vy(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return o.includes(r.toString())||o.includes(i.toString())}b(vy,"isLabelCoordinateInPath");function Vd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ca=Vd();function Ty(e){Ca=e}var Vs={exec:()=>null};function lr(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(Jr.caret,"$1"),r=r.replace(o,s),i},getRegex:()=>new RegExp(r,t)};return i}var MM=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Jr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},_M=/^(?:[ \t]*(?:\n|$))+/,BM=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,LM=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,AM=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Zd=/(?:[*+-]|\d{1,9}[.)])/,My=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_y=lr(My).replace(/bull/g,Zd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),FM=lr(My).replace(/bull/g,Zd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Kd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$M=/^[^\n]+/,Qd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,EM=lr(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Qd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),PM=lr(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Zd).getRegex(),jl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Jd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,IM=lr("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Jd).replace("tag",jl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),By=lr(Kd).replace("hr",fn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jl).getRegex(),OM=lr(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",By).getRegex(),tu={blockquote:OM,code:BM,def:EM,fences:LM,heading:AM,hr:fn,html:IM,lheading:_y,list:PM,newline:_M,paragraph:By,table:Vs,text:$M},rg=lr("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jl).getRegex(),DM={...tu,lheading:FM,table:rg,paragraph:lr(Kd).replace("hr",fn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",rg).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jl).getRegex()},RM={...tu,html:lr(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Jd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Vs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lr(Kd).replace("hr",fn).replace("heading",` *#{1,6} *[^
161
+ ]`).replace("lheading",_y).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},NM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ly=/^( {2,}|\\)\n(?!\s*$)/,WM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ul=/[\p{P}\p{S}]/u,eu=/[\s\p{P}\p{S}]/u,Ay=/[^\s\p{P}\p{S}]/u,zM=lr(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,eu).getRegex(),Fy=/(?!~)[\p{P}\p{S}]/u,HM=/(?!~)[\s\p{P}\p{S}]/u,YM=/(?:[^\s\p{P}\p{S}]|~)/u,XM=lr(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",MM?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),$y=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,GM=lr($y,"u").replace(/punct/g,Ul).getRegex(),jM=lr($y,"u").replace(/punct/g,Fy).getRegex(),Ey="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",UM=lr(Ey,"gu").replace(/notPunctSpace/g,Ay).replace(/punctSpace/g,eu).replace(/punct/g,Ul).getRegex(),VM=lr(Ey,"gu").replace(/notPunctSpace/g,YM).replace(/punctSpace/g,HM).replace(/punct/g,Fy).getRegex(),ZM=lr("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ay).replace(/punctSpace/g,eu).replace(/punct/g,Ul).getRegex(),KM=lr(/\\(punct)/,"gu").replace(/punct/g,Ul).getRegex(),QM=lr(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),JM=lr(Jd).replace("(?:-->|$)","-->").getRegex(),t_=lr("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",JM).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Sl=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,e_=lr(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Sl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Py=lr(/^!?\[(label)\]\[(ref)\]/).replace("label",Sl).replace("ref",Qd).getRegex(),Iy=lr(/^!?\[(ref)\](?:\[\])?/).replace("ref",Qd).getRegex(),r_=lr("reflink|nolink(?!\\()","g").replace("reflink",Py).replace("nolink",Iy).getRegex(),ig=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ru={_backpedal:Vs,anyPunctuation:KM,autolink:QM,blockSkip:XM,br:Ly,code:qM,del:Vs,emStrongLDelim:GM,emStrongRDelimAst:UM,emStrongRDelimUnd:ZM,escape:NM,link:e_,nolink:Iy,punctuation:zM,reflink:Py,reflinkSearch:r_,tag:t_,text:WM,url:Vs},i_={...ru,link:lr(/^!?\[(label)\]\((.*?)\)/).replace("label",Sl).getRegex(),reflink:lr(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Sl).getRegex()},Bh={...ru,emStrongRDelimAst:VM,emStrongLDelim:jM,url:lr(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ig).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:lr(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ig).getRegex()},o_={...Bh,br:lr(Ly).replace("{2,}","*").getRegex(),text:lr(Bh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bn={normal:tu,gfm:DM,pedantic:RM},Ss={normal:ru,gfm:Bh,breaks:o_,pedantic:i_},a_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},og=e=>a_[e];function ji(e,t){if(t){if(Jr.escapeTest.test(e))return e.replace(Jr.escapeReplace,og)}else if(Jr.escapeTestNoEncode.test(e))return e.replace(Jr.escapeReplaceNoEncode,og);return e}function ag(e){try{e=encodeURI(e).replace(Jr.percentDecode,"%")}catch{return null}return e}function sg(e,t){let r=e.replace(Jr.findPipe,(a,s,n)=>{let l=!1,c=s;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(Jr.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(Jr.slashPipe,"|");return i}function vs(e,t,r){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function s_(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function ng(e,t,r,i,o){let a=t.href,s=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function n_(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
162
+ `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[n]=s;return n.length>=o.length?a.slice(o.length):a}).join(`
163
+ `)}var vl=class{constructor(t){gr(this,"options");gr(this,"rules");gr(this,"lexer");this.options=t||Ca}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:vs(i,`
164
+ `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=n_(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=vs(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:vs(r[0],`
165
+ `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=vs(r[0],`
166
+ `).split(`
167
+ `),o="",a="",s=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),n=!0;else if(!n)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
168
+ `),d=h.replace(this.rules.other.blockquoteSetextReplace,`
169
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
170
+ ${h}`:h,a=a?`${a}
171
+ ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=u,i.length===0)break;let f=s.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let p=f,g=p.raw+`
172
+ `+i.join(`
173
+ `),m=this.blockquote(g);s[s.length-1]=m,o=o.substring(0,o.length-p.raw.length)+m.raw,a=a.substring(0,a.length-p.text.length)+m.text;break}else if(f?.type==="list"){let p=f,g=p.raw+`
174
+ `+i.join(`
175
+ `),m=this.list(g);s[s.length-1]=m,o=o.substring(0,o.length-f.raw.length)+m.raw,a=a.substring(0,a.length-p.raw.length)+m.raw,i=g.substring(s.at(-1).raw.length).split(`
176
+ `);continue}}return{type:"blockquote",raw:o,tokens:s,text:a}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),o=i.length>1,a={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let s=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=s.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let u=r[2].split(`
177
+ `,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),f=t.split(`
178
+ `,1)[0],p=!u.trim(),g=0;if(this.options.pedantic?(g=2,d=u.trimStart()):p?g=r[1].length+1:(g=r[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,d=u.slice(g),g+=r[1].length),p&&this.rules.other.blankLine.test(f)&&(h+=f+`
179
+ `,t=t.substring(f.length+1),c=!0),!c){let x=this.rules.other.nextBulletRegex(g),C=this.rules.other.hrRegex(g),k=this.rules.other.fencesBeginRegex(g),v=this.rules.other.headingBeginRegex(g),M=this.rules.other.htmlBeginRegex(g);for(;t;){let A=t.split(`
180
+ `,1)[0],L;if(f=A,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),L=f):L=f.replace(this.rules.other.tabCharGlobal," "),k.test(f)||v.test(f)||M.test(f)||x.test(f)||C.test(f))break;if(L.search(this.rules.other.nonSpaceChar)>=g||!f.trim())d+=`
181
+ `+L.slice(g);else{if(p||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(u)||v.test(u)||C.test(u))break;d+=`
182
+ `+f}!p&&!f.trim()&&(p=!0),h+=A+`
183
+ `,t=t.substring(A.length+1),u=L.slice(g)}}a.loose||(n?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let m=null,y;this.options.gfm&&(m=this.rules.other.listIsTask.exec(d),m&&(y=m[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:h,task:!!m,checked:y,loose:!1,text:d,tokens:[]}),a.raw+=h}let l=a.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let c=0;c<a.items.length;c++)if(this.lexer.state.top=!1,a.items[c].tokens=this.lexer.blockTokens(a.items[c].text,[]),!a.loose){let h=a.items[c].tokens.filter(u=>u.type==="space"),d=h.length>0&&h.some(u=>this.rules.other.anyLine.test(u.raw));a.loose=d}if(a.loose)for(let c=0;c<a.items.length;c++)a.items[c].loose=!0;return a}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:o,title:a}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=sg(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
184
+ `):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let n of o)this.rules.other.tableAlignRight.test(n)?s.align.push("right"):this.rules.other.tableAlignCenter.test(n)?s.align.push("center"):this.rules.other.tableAlignLeft.test(n)?s.align.push("left"):s.align.push(null);for(let n=0;n<i.length;n++)s.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:s.align[n]});for(let n of a)s.rows.push(sg(n,s.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
185
+ `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let s=vs(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=s_(r[2],"()");if(s===-2)return;if(s>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let o=r[2],a="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(o);s&&(o=s[1],a=s[3])}else a=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),ng(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[o.toLowerCase()];if(!a){let s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return ng(i,a,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let a=[...o[0]].length-1,s,n,l=a,c=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+a);(o=h.exec(r))!=null;){if(s=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!s)continue;if(n=[...s].length,o[3]||o[4]){l+=n;continue}else if((o[5]||o[6])&&a%3&&!((a+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...o[0]][0].length,u=t.slice(0,a+o.index+d+n);if(Math.min(a,n)%2){let p=u.slice(1,-1);return{type:"em",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),a=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&a&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let a;do a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(a!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},$i=class Lh{constructor(t){gr(this,"tokens");gr(this,"options");gr(this,"state");gr(this,"tokenizer");gr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ca,this.options.tokenizer=this.options.tokenizer||new vl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Jr,block:Bn.normal,inline:Ss.normal};this.options.pedantic?(r.block=Bn.pedantic,r.inline=Ss.pedantic):this.options.gfm&&(r.block=Bn.gfm,this.options.breaks?r.inline=Ss.breaks:r.inline=Ss.gfm),this.tokenizer.rules=r}static get rules(){return{block:Bn,inline:Ss}}static lex(t,r){return new Lh(r).lex(t)}static lexInline(t,r){return new Lh(r).inlineTokens(t)}lex(t){t=t.replace(Jr.carriageReturn,`
186
+ `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(Jr.tabCharGlobal," ").replace(Jr.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(s=>(o=s.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let s=r.at(-1);o.raw.length===1&&s!==void 0?s.raw+=`
187
+ `:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
188
+ `)?"":`
189
+ `)+o.raw,s.text+=`
190
+ `+o.text,this.inlineQueue.at(-1).src=s.text):r.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
191
+ `)?"":`
192
+ `)+o.raw,s.text+=`
193
+ `+o.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),r.push(o);continue}let a=t;if(this.options.extensions?.startBlock){let s=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(s=Math.min(s,l))}),s<1/0&&s>=0&&(a=t.substring(0,s+1))}if(this.state.top&&(o=this.tokenizer.paragraph(a))){let s=r.at(-1);i&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(`
194
+ `)?"":`
195
+ `)+o.raw,s.text+=`
196
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(o),i=a.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let s=r.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(`
197
+ `)?"":`
198
+ `)+o.raw,s.text+=`
199
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(o);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,o=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)a=o[2]?o[2].length:0,i=i.slice(0,o.index+a)+"["+"a".repeat(o[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let s=!1,n="";for(;t;){s||(n=""),s=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},d),typeof u=="number"&&u>=0&&(h=Math.min(h,u))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),s=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},Tl=class{constructor(t){gr(this,"options");gr(this,"parser");this.options=t||Ca}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(Jr.notSpaceStart)?.[0],a=t.replace(Jr.endingNewline,"")+`
200
+ `;return o?'<pre><code class="language-'+ji(o)+'">'+(i?a:ji(a,!0))+`</code></pre>
201
+ `:"<pre><code>"+(i?a:ji(a,!0))+`</code></pre>
202
+ `}blockquote({tokens:t}){return`<blockquote>
203
+ ${this.parser.parse(t)}</blockquote>
204
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
205
+ `}hr(t){return`<hr>
206
+ `}list(t){let r=t.ordered,i=t.start,o="";for(let n=0;n<t.items.length;n++){let l=t.items[n];o+=this.listitem(l)}let a=r?"ol":"ul",s=r&&i!==1?' start="'+i+'"':"";return"<"+a+s+`>
207
+ `+o+"</"+a+`>
208
+ `}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+ji(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
209
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
210
+ `}table(t){let r="",i="";for(let a=0;a<t.header.length;a++)i+=this.tablecell(t.header[a]);r+=this.tablerow({text:i});let o="";for(let a=0;a<t.rows.length;a++){let s=t.rows[a];i="";for(let n=0;n<s.length;n++)i+=this.tablecell(s[n]);o+=this.tablerow({text:i})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
211
+ <thead>
212
+ `+r+`</thead>
213
+ `+o+`</table>
214
+ `}tablerow({text:t}){return`<tr>
215
+ ${t}</tr>
216
+ `}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
217
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ji(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),a=ag(t);if(a===null)return o;t=a;let s='<a href="'+t+'"';return r&&(s+=' title="'+ji(r)+'"'),s+=">"+o+"</a>",s}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let a=ag(t);if(a===null)return ji(i);t=a;let s=`<img src="${t}" alt="${i}"`;return r&&(s+=` title="${ji(r)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ji(t.text)}},iu=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ei=class Ah{constructor(t){gr(this,"options");gr(this,"renderer");gr(this,"textRenderer");this.options=t||Ca,this.options.renderer=this.options.renderer||new Tl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new iu}static parse(t,r){return new Ah(r).parse(t)}static parseInline(t,r){return new Ah(r).parseInline(t)}parse(t,r=!0){let i="";for(let o=0;o<t.length;o++){let a=t[o];if(this.options.extensions?.renderers?.[a.type]){let n=a,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let s=a;switch(s.type){case"space":{i+=this.renderer.space(s);continue}case"hr":{i+=this.renderer.hr(s);continue}case"heading":{i+=this.renderer.heading(s);continue}case"code":{i+=this.renderer.code(s);continue}case"table":{i+=this.renderer.table(s);continue}case"blockquote":{i+=this.renderer.blockquote(s);continue}case"list":{i+=this.renderer.list(s);continue}case"html":{i+=this.renderer.html(s);continue}case"def":{i+=this.renderer.def(s);continue}case"paragraph":{i+=this.renderer.paragraph(s);continue}case"text":{let n=s,l=this.renderer.text(n);for(;o+1<t.length&&t[o+1].type==="text";)n=t[++o],l+=`
218
+ `+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let o=0;o<t.length;o++){let a=t[o];if(this.options.extensions?.renderers?.[a.type]){let n=this.options.extensions.renderers[a.type].call({parser:this},a);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=n||"";continue}}let s=a;switch(s.type){case"escape":{i+=r.text(s);break}case"html":{i+=r.html(s);break}case"link":{i+=r.link(s);break}case"image":{i+=r.image(s);break}case"strong":{i+=r.strong(s);break}case"em":{i+=r.em(s);break}case"codespan":{i+=r.codespan(s);break}case"br":{i+=r.br(s);break}case"del":{i+=r.del(s);break}case"text":{i+=r.text(s);break}default:{let n='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},Wn,Os=(Wn=class{constructor(t){gr(this,"options");gr(this,"block");this.options=t||Ca}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?$i.lex:$i.lexInline}provideParser(){return this.block?Ei.parse:Ei.parseInline}},gr(Wn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),gr(Wn,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Wn),l_=class{constructor(...t){gr(this,"defaults",Vd());gr(this,"options",this.setOptions);gr(this,"parse",this.parseMarkdown(!0));gr(this,"parseInline",this.parseMarkdown(!1));gr(this,"Parser",Ei);gr(this,"Renderer",Tl);gr(this,"TextRenderer",iu);gr(this,"Lexer",$i);gr(this,"Tokenizer",vl);gr(this,"Hooks",Os);this.use(...t)}walkTokens(t,r){let i=[];for(let o of t)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let a=o;for(let s of a.header)i=i.concat(this.walkTokens(s.tokens,r));for(let s of a.rows)for(let n of s)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let a=o;i=i.concat(this.walkTokens(a.items,r));break}default:{let a=o;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(s=>{let n=a[s].flat(1/0);i=i.concat(this.walkTokens(n,r))}):a.tokens&&(i=i.concat(this.walkTokens(a.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let s=r.renderers[a.name];s?r.renderers[a.name]=function(...n){let l=a.renderer.apply(this,n);return l===!1&&(l=s.apply(this,n)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[a.level];s?s.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),o.extensions=r),i.renderer){let a=this.defaults.renderer||new Tl(this.defaults);for(let s in i.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let n=s,l=i.renderer[n],c=a[n];a[n]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=c.apply(a,h)),d||""}}o.renderer=a}if(i.tokenizer){let a=this.defaults.tokenizer||new vl(this.defaults);for(let s in i.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let n=s,l=i.tokenizer[n],c=a[n];a[n]=(...h)=>{let d=l.apply(a,h);return d===!1&&(d=c.apply(a,h)),d}}o.tokenizer=a}if(i.hooks){let a=this.defaults.hooks||new Os;for(let s in i.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let n=s,l=i.hooks[n],c=a[n];Os.passThroughHooks.has(s)?a[n]=h=>{if(this.defaults.async&&Os.passThroughHooksRespectAsync.has(s))return(async()=>{let u=await l.call(a,h);return c.call(a,u)})();let d=l.call(a,h);return c.call(a,d)}:a[n]=(...h)=>{if(this.defaults.async)return(async()=>{let u=await l.apply(a,h);return u===!1&&(u=await c.apply(a,h)),u})();let d=l.apply(a,h);return d===!1&&(d=c.apply(a,h)),d}}o.hooks=a}if(i.walkTokens){let a=this.defaults.walkTokens,s=i.walkTokens;o.walkTokens=function(n){let l=[];return l.push(s.call(this,n)),a&&(l=l.concat(a.call(this,n))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return $i.lex(t,r??this.defaults)}parser(t,r){return Ei.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},a={...this.defaults,...o},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&o.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let n=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():t?$i.lex:$i.lexInline)(n,a),c=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(c,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():t?Ei.parse:Ei.parseInline)(c,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(s);try{a.hooks&&(r=a.hooks.preprocess(r));let n=(a.hooks?a.hooks.provideLexer():t?$i.lex:$i.lexInline)(r,a);a.hooks&&(n=a.hooks.processAllTokens(n)),a.walkTokens&&this.walkTokens(n,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():t?Ei.parse:Ei.parseInline)(n,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(n){return s(n)}}}onError(t,r){return i=>{if(i.message+=`
219
+ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+ji(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},pa=new l_;function cr(e,t){return pa.parse(e,t)}cr.options=cr.setOptions=function(e){return pa.setOptions(e),cr.defaults=pa.defaults,Ty(cr.defaults),cr};cr.getDefaults=Vd;cr.defaults=Ca;cr.use=function(...e){return pa.use(...e),cr.defaults=pa.defaults,Ty(cr.defaults),cr};cr.walkTokens=function(e,t){return pa.walkTokens(e,t)};cr.parseInline=pa.parseInline;cr.Parser=Ei;cr.parser=Ei.parse;cr.Renderer=Tl;cr.TextRenderer=iu;cr.Lexer=$i;cr.lexer=$i.lex;cr.Tokenizer=vl;cr.Hooks=Os;cr.parse=cr;cr.options;cr.setOptions;cr.use;cr.walkTokens;cr.parseInline;Ei.parse;$i.lex;function Oy(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var o=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var d,u;return(u=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&u!==void 0?u:0})):n},[]);if(o.length){var a=new RegExp(`
220
+ [ ]{`.concat(Math.min.apply(Math,o),"}"),"g");i=i.map(function(n){return n.replace(a,`
221
+ `)})}i[0]=i[0].replace(/^\r?\n/,"");var s=i[0];return t.forEach(function(n,l){var c=s.match(/(?:^|\n)( *)$/),h=c?c[1]:"",d=n;typeof n=="string"&&n.includes(`
222
+ `)&&(d=String(n).split(`
223
+ `).map(function(u,f){return f===0?u:"".concat(h).concat(u)}).join(`
224
+ `)),s+=d+i[l+1]}),s}var Fh=typeof performance<"u"&&typeof performance.now=="function",Ta=b(()=>Fh?performance.now():0,"now"),Nc="🧜 ",c_="Mermaid render",h_="Mermaid",d_={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"},is;is=class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(t){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(t))}tickSync(t,r){if(!this.enabled)return r();const i=Ta();try{return r()}finally{this.buckets[t]=(this.buckets[t]??0)+(Ta()-i)}}async tick(t,r){if(!this.enabled)return r();const i=Ta();try{return await r()}finally{this.buckets[t]=(this.buckets[t]??0)+(Ta()-i)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();const t=this.roots.at(-1),r=this.runLabel??t?.name;return t&&(this.records.push({label:r??t.name,tree:t,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(t,r)),this.runLabel=void 0,t}begin(t){if(!this.enabled)return;const r={name:t,start:Ta(),duration:-1,children:[]},i=this.stack.at(-1);if(i?i.children.push(r):this.roots.push(r),this.stack.push(r),Fh&&typeof performance.mark=="function")try{performance.mark(`${Nc}${t} ▶`)}catch{}}end(){if(!this.enabled)return;const t=this.stack.pop();if(!t)return;const r=Ta();if(t.duration=r-t.start,Fh&&typeof performance.measure=="function")try{performance.measure(`${Nc}${t.name}`,{start:t.start,end:r,detail:{devtools:{dataType:"track-entry",track:c_,trackGroup:h_,color:d_[t.name]??"primary",tooltipText:`${t.name} — ${t.duration.toFixed(1)} ms`}}})}catch{}}async span(t,r){if(!this.enabled)return r();this.begin(t);try{return await r()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(t=this.report(),r){if(!t)return;const i=t.duration,o=r&&r!==t.name?`${t.name} [${r}]`:t.name,a=["ms % phase"],s=b((l,c)=>{const h=" ".repeat(c),d=l.duration.toFixed(1).padStart(8),u=i>0?`${(l.duration/i*100).toFixed(0).padStart(3)}%`:" -";a.push(`${d} ${u} ${h}${l.name}`);for(const f of l.children)s(f,c+1);if(l.children.length>0){const f=l.children.reduce((g,m)=>g+m.duration,0),p=l.duration-f;if(p>.5){const g=p.toFixed(1).padStart(8);a.push(`${g} ${h} (self)`)}}},"walk");s(t,0);const n=Object.keys(this.buckets);if(n.length>0){a.push("—— buckets (summed) ——");for(const l of n)a.push(`${this.buckets[l].toFixed(1).padStart(8)} ${l}`)}console.log(`${Nc}mermaid render profile · ${o}
225
+ ${a.join(`
226
+ `)}`)}},b(is,"Profiler");globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};function Dy(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
227
+ `).replace(/\n{2,}/g,`
228
+ `);return Oy(i)}b(Dy,"preprocessMarkdown");function Ry(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}b(Ry,"nonMarkdownToLines");function Ny(e,t={}){const r=Dy(e,t),i=cr.lexer(r),o=[[]];let a=0;function s(n,l="normal"){n.type==="text"?n.text.split(`
229
+ `).forEach((h,d)=>{d!==0&&(a++,o.push([])),h.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&o[a].push({content:u,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{s(c,n.type)}):n.type==="html"&&o[a].push({content:n.text,type:"normal"})}return b(s,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{s(l)}):n.type==="html"?o[a].push({content:n.text,type:"normal"}):o[a].push({content:n.raw,type:"normal"})}),o}b(Ny,"markdownToLines");function qy(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}b(qy,"nonMarkdownToHTML");function Wy(e,{markdownAutoWrap:t}={}){const r=cr.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(Mt.warn(`Unsupported markdown: ${o.type}`),o.raw)}return b(i,"output"),r.map(i).join("")}b(Wy,"markdownToHTML");var u_=(function(e){var t=function(){},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function i(){var c=this;c.reads=[],c.writes=[],c.raf=r.bind(e)}b(i,"FastDom"),i.prototype={constructor:i,runTasks:b(function(c){for(var h;h=c.shift();)h()},"runTasks"),measure:b(function(c,h){var d=h?c.bind(h):c;return this.reads.push(d),o(this),d},"measure"),mutate:b(function(c,h){var d=h?c.bind(h):c;return this.writes.push(d),o(this),d},"mutate"),clear:b(function(c){return s(this.reads,c)||s(this.writes,c)},"clear"),extend:b(function(c){if(typeof c!="object")throw new Error("expected object");var h=Object.create(this);return n(h,c),h.fastdom=this,h.initialize&&h.initialize(),h},"extend"),catch:null};function o(c){c.scheduled||(c.scheduled=!0,c.raf(a.bind(null,c)))}b(o,"scheduleFlush");function a(c){var h=c.writes,d=c.reads,u;try{t("flushing reads",d.length),c.runTasks(d),t("flushing writes",h.length),c.runTasks(h)}catch(f){u=f}if(c.scheduled=!1,(d.length||h.length)&&o(c),u)if(t("task errored",u.message),c.catch)c.catch(u);else throw u}b(a,"flush");function s(c,h){var d=c.indexOf(h);return!!~d&&!!c.splice(d,1)}b(s,"remove");function n(c,h){for(var d in h)h.hasOwnProperty(d)&&(c[d]=h[d])}b(n,"mixin");var l=e.fastdom=e.fastdom||new i;return l})(typeof window<"u"?window:globalThis),zy={initialize:b(function(){this._tasks=new Map},"initialize"),mutate:b(function(e,t){return $h(this,"mutate",e,t)},"mutate"),measure:b(function(e,t){return $h(this,"measure",e,t)},"measure"),clear:b(function(e){var t=this._tasks,r=t.get(e);this.fastdom.clear(r),t.delete(e)},"clear")};function $h(e,t,r,i){var o=e._tasks,a=e.fastdom,s,n=new Promise(function(l,c){s=a[t](function(){o.delete(n);try{l(i?r.call(i):r())}catch(h){c(h)}},i)});return o.set(n,s),n}b($h,"create");var{initialize:mI,mutate:yI,measure:xI,clear:bI}=zy,f_=zy,g_=u_.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(f_),ma=g_;function Hy(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}b(Hy,"splitTextToChars");function Yy(e,t){const r=Hy(t.content);return ou(e,[],r,t.type)}b(Yy,"splitWordToFitWidth");function ou(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...a]=r,s=[...t,o];return e([{content:s.join(""),type:i}])?ou(e,s,a,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}b(ou,"splitWordToFitWidthRecursion");function Xy(e,t){if(e.some(({content:r})=>r.includes(`
230
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Ml(e,t)}b(Xy,"splitLineToFitWidth");function Ml(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const a=e.shift()??{content:" ",type:"normal"},s=[...i];if(o!==""&&s.push({content:o,type:"normal"}),s.push(a),t(s))return Ml(e,t,r,s);if(i.length>0)r.push(i),e.unshift(a);else if(a.content){const[n,l]=Yy(t,a);r.push([n]),l.content&&e.unshift(l)}return Ml(e,t,r)}b(Ml,"splitLineToFitWidthRecursion");function Eh(e,t){t&&e.attr("style",t)}b(Eh,"applyStyle");var lg=16384;async function Gy(e,t,r,i,o=!1,a=Mr(),s=0){const n=e.append("foreignObject");n.attr("width",`${Math.min(10*r,lg)}px`),n.attr("height",`${Math.min(10*r,lg)}px`);const l=n.append("xhtml:div"),c=Qs(t.label)?await sm(t.label.replace(cn.lineBreakRegex,`
231
+ `),a):Ti(t.label,a),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");d.html(c),Eh(d,t.labelStyle),d.attr("class",`${h} ${i}`),Eh(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(l.style("max-width",r+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&l.attr("class","labelBkg");const u=await ma.measure(()=>l.node().getBoundingClientRect());return u.width===r?(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px")):u.width<s&&(l.style("display","table"),l.style("width",s+"px"),l.style("text-align","center")),n.node()}b(Gy,"addHtmlSpan");function Vl(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}b(Vl,"createTspan");function jy(e,t,r){const i=e.append("text"),o=Vl(i,1,t);Zl(o,r);const a=o.node().getComputedTextLength();return i.remove(),a}b(jy,"computeWidthOfText");function p_(e,t,r){const i=e.append("text"),o=Vl(i,1,t);Zl(o,[{content:r,type:"normal"}]);const a=o.node()?.getBoundingClientRect();return a&&i.remove(),a}b(p_,"computeDimensionOfText");function Uy(e,t,r,i=!1,o=!1){const s=t.append("g"),n=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=b(f=>jy(s,1.1,f)<=e,"checkWidth"),u=d(h)?[h]:Xy(h,d);for(const f of u){const p=Vl(l,c,1.1,o);Zl(p,f),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}b(Uy,"createFormattedText");function Ph(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}b(Ph,"decodeHTMLEntities");function Zl(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(Ph(r.content)):o.text(" "+Ph(r.content))})}b(Zl,"updateTextContentAndStyles");async function Vy(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,a,s)=>(r.push((async()=>{const n=`${a}:${s}`;return await fm(n)?await ba(n,void 0,{class:"label-icon"}):`<i class='${Ti(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}b(Vy,"replaceIconSubstring");var gi=b(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:a=!0,markdown:s=!0,isNode:n=!0,width:l=200,minWidth:c=0,addSvgBackground:h=!1}={},d)=>{if(Mt.debug("XYZ createText",t,r,i,o,a,n,"addSvgBackground: ",h),a){const u=s?Wy(t,d):qy(t),f=await Vy(Go(u),d),p=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Qs(t)?p:f,labelStyle:r.replace("fill:","color:")};return await Gy(e,g,l,o,h,d,c)}else{const u=Go(t.replace(/<br\s*\/?>/g,"<br/>")),f=s?Ny(u.replace("<br>","<br/>"),d):Ry(u),p=Uy(l,e,f,t?h:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");He(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");He(p).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");He(p).select("text").attr("style",m)}return i?He(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):He(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText"),m_=new Set(["redux-color","redux-dark-color"]),y_=12,x_=64,au=b(e=>Array.isArray(e)&&e.length>0,"hasPalette"),b_=b((e,t)=>e!=null&&m_.has(e)&&au(t),"isColorTheme"),C_=/^[\w-]+$/,CI=b(e=>{const t=typeof e=="string"||typeof e=="number"?String(e):"";return C_.test(t)?t:"classic"},"safeLook"),Zy=b(e=>au(e)?e.length:0,"paletteSlotCount"),wI=b((e,t)=>au(t)?Zy(t):typeof e=="number"&&Number.isInteger(e)&&e>0&&e<=x_?e:y_,"colorSlotCount"),_i=b((e,t,r,i)=>{if(t===void 0||!b_(r,i))return;const o=t%Zy(i);e.attr("data-color-id",`color-${o}`)},"stampColorSlot");function qc(e,t,r){if(e&&e.length){const[i,o]=t,a=Math.PI/180*r,s=Math.cos(a),n=Math.sin(a);for(const l of e){const[c,h]=l;l[0]=(c-i)*s-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*s+o}}}function w_(e,t){return e[0]===t[0]&&e[1]===t[1]}function k_(e,t,r,i=1){const o=r,a=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of s)qc(c,n,o);const l=(function(c,h,d){const u=[];for(const x of c){const C=[...x];w_(C[0],C[C.length-1])||C.push([C[0][0],C[0][1]]),C.length>2&&u.push(C)}const f=[];h=Math.max(h,.1);const p=[];for(const x of u)for(let C=0;C<x.length-1;C++){const k=x[C],v=x[C+1];if(k[1]!==v[1]){const M=Math.min(k[1],v[1]);p.push({ymin:M,ymax:Math.max(k[1],v[1]),x:M===k[1]?k[0]:v[0],islope:(v[0]-k[0])/(v[1]-k[1])})}}if(p.sort(((x,C)=>x.ymin<C.ymin?-1:x.ymin>C.ymin?1:x.x<C.x?-1:x.x>C.x?1:x.ymax===C.ymax?0:(x.ymax-C.ymax)/Math.abs(x.ymax-C.ymax))),!p.length)return f;let g=[],m=p[0].ymin,y=0;for(;g.length||p.length;){if(p.length){let x=-1;for(let C=0;C<p.length&&!(p[C].ymin>m);C++)x=C;p.splice(0,x+1).forEach((C=>{g.push({s:m,edge:C})}))}if(g=g.filter((x=>!(x.edge.ymax<=m))),g.sort(((x,C)=>x.edge.x===C.edge.x?0:(x.edge.x-C.edge.x)/Math.abs(x.edge.x-C.edge.x))),(d!==1||y%h==0)&&g.length>1)for(let x=0;x<g.length;x+=2){const C=x+1;if(C>=g.length)break;const k=g[x].edge,v=g[C].edge;f.push([[Math.round(k.x),m],[Math.round(v.x),m]])}m+=d,g.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),y++}return f})(s,a,i);if(o){for(const c of s)qc(c,n,-o);(function(c,h,d){const u=[];c.forEach((f=>u.push(...f))),qc(u,h,d)})(l,n,-o)}return l}function gn(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=o),k_(e,o,i,a||1)}class su{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=gn(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function Kl(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class S_ extends su{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=gn(t,Object.assign({},r,{hachureGap:i})),a=Math.PI/180*r.hachureAngle,s=[],n=.5*i*Math.cos(a),l=.5*i*Math.sin(a);for(const[c,h]of o)Kl([c,h])&&s.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class v_ extends su{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,o);return i.ops=i.ops.concat(a.ops),i}}class T_{constructor(t){this.helper=t}fillPolygons(t,r){const i=gn(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=o/4;for(const n of t){const l=Kl(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,u=(n[0][0]+n[1][0])/2-o/4,f=Math.min(n[0][1],n[1][1]);for(let p=0;p<h;p++){const g=f+d+p*o,m=u-s+2*Math.random()*s,y=g-s+2*Math.random()*s,x=this.helper.ellipse(m,y,a,a,r);i.push(...x.ops)}}return{type:"fillSketch",ops:i}}}class M_{constructor(t){this.helper=t}fillPolygons(t,r){const i=gn(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return t.forEach((s=>{const n=Kl(s),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const u=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let f=0;f<l;f++){const p=f*(i+o),g=p+i,m=[h[0]+p*Math.cos(u)+c*Math.cos(u),h[1]+p*Math.sin(u)+c*Math.sin(u)],y=[h[0]+g*Math.cos(u)+c*Math.cos(u),h[1]+g*Math.sin(u)+c*Math.sin(u)];a.push(...this.helper.doubleLineOps(m[0],m[1],y[0],y[1],r))}})),a}}class __{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,a=gn(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(a,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((a=>{const s=Kl(a),n=Math.round(s/(2*r));let l=a[0],c=a[1];l[0]>c[0]&&(l=a[1],c=a[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const u=2*d*r,f=2*(d+1)*r,p=Math.sqrt(2*Math.pow(r,2)),g=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[g[0]+p*Math.cos(h+Math.PI/4),g[1]+p*Math.sin(h+Math.PI/4)];o.push(...this.helper.doubleLineOps(g[0],g[1],y[0],y[1],i),...this.helper.doubleLineOps(y[0],y[1],m[0],m[1],i))}})),o}}const ai={};class B_{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const L_=0,Wc=1,cg=2,Ln={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function zc(e,t){return e.type===t}function nu(e){const t=[],r=(function(s){const n=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:L_,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:Wc,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return n[n.length]={type:cg,text:""},n})(e);let i="BOD",o=0,a=r[o];for(;!zc(a,cg);){let s=0;const n=[];if(i==="BOD"){if(a.text!=="M"&&a.text!=="m")return nu("M0,0"+e);o++,s=Ln[a.text],i=a.text}else zc(a,Wc)?s=Ln[i]:(o++,s=Ln[a.text],i=a.text);if(!(o+s<r.length))throw new Error("Path data ended short");for(let l=o;l<o+s;l++){const c=r[l];if(!zc(c,Wc))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Ln[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=s,a=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function Ky(e){let t=0,r=0,i=0,o=0;const a=[];for(const{key:s,data:n}of e)switch(s){case"M":a.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],a.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":a.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],a.push({key:"L",data:[t,r]});break;case"C":a.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));a.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));a.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],a.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":a.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));a.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=i,r=o}return a}function Qy(e){const t=[];let r="",i=0,o=0,a=0,s=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[a,s]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-n),u=o+(o-l)):(d=i,u=o),t.push({key:"C",data:[d,u,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,u]=h;let f=0,p=0;r==="Q"||r==="T"?(f=i+(i-n),p=o+(o-l)):(f=i,p=o);const g=i+2*(f-i)/3,m=o+2*(p-o)/3,y=d+2*(f-d)/3,x=u+2*(p-u)/3;t.push({key:"C",data:[g,m,y,x,d,u]}),n=f,l=p,i=d,o=u;break}case"Q":{const[d,u,f,p]=h,g=i+2*(d-i)/3,m=o+2*(u-o)/3,y=f+2*(d-f)/3,x=p+2*(u-p)/3;t.push({key:"C",data:[g,m,y,x,f,p]}),n=d,l=u,i=f,o=p;break}case"A":{const d=Math.abs(h[0]),u=Math.abs(h[1]),f=h[2],p=h[3],g=h[4],m=h[5],y=h[6];d===0||u===0?(t.push({key:"C",data:[i,o,m,y,m,y]}),i=m,o=y):(i!==m||o!==y)&&(Jy(i,o,m,y,d,u,f,p,g).forEach((function(x){t.push({key:"C",data:x})})),i=m,o=y);break}case"Z":t.push({key:"Z",data:[]}),i=a,o=s}r=c}return t}function Ts(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Jy(e,t,r,i,o,a,s,n,l,c){const h=(d=s,Math.PI*d/180);var d;let u=[],f=0,p=0,g=0,m=0;if(c)[f,p,g,m]=c;else{[e,t]=Ts(e,t,-h),[r,i]=Ts(r,i,-h);const D=(e-r)/2,F=(t-i)/2;let E=D*D/(o*o)+F*F/(a*a);E>1&&(E=Math.sqrt(E),o*=E,a*=E);const B=o*o,q=a*a,W=B*q-B*F*F-q*D*D,O=B*F*F+q*D*D,R=(n===l?-1:1)*Math.sqrt(Math.abs(W/O));g=R*o*F/a+(e+r)/2,m=R*-a*D/o+(t+i)/2,f=Math.asin(parseFloat(((t-m)/a).toFixed(9))),p=Math.asin(parseFloat(((i-m)/a).toFixed(9))),e<g&&(f=Math.PI-f),r<g&&(p=Math.PI-p),f<0&&(f=2*Math.PI+f),p<0&&(p=2*Math.PI+p),l&&f>p&&(f-=2*Math.PI),!l&&p>f&&(p-=2*Math.PI)}let y=p-f;if(Math.abs(y)>120*Math.PI/180){const D=p,F=r,E=i;p=l&&p>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=Jy(r=g+o*Math.cos(p),i=m+a*Math.sin(p),F,E,o,a,s,0,l,[p,D,g,m])}y=p-f;const x=Math.cos(f),C=Math.sin(f),k=Math.cos(p),v=Math.sin(p),M=Math.tan(y/4),A=4/3*o*M,L=4/3*a*M,T=[e,t],_=[e+A*C,t-L*x],$=[r+A*v,i-L*k],P=[r,i];if(_[0]=2*T[0]-_[0],_[1]=2*T[1]-_[1],c)return[_,$,P].concat(u);{u=[_,$,P].concat(u);const D=[];for(let F=0;F<u.length;F+=3){const E=Ts(u[F][0],u[F][1],h),B=Ts(u[F+1][0],u[F+1][1],h),q=Ts(u[F+2][0],u[F+2][1],h);D.push([E[0],E[1],B[0],B[1],q[0],q[1]])}return D}}const A_={randOffset:function(e,t){return De(e,t)},randOffsetWithRange:function(e,t,r){return _l(e,t,r)},ellipse:function(e,t,r,i,o){const a=ex(r,i,o);return Ih(e,t,o,a).opset},doubleLineOps:function(e,t,r,i,o){return jo(e,t,r,i,o,!0)}};function tx(e,t,r,i,o){return{type:"path",ops:jo(e,t,r,i,o)}}function Jn(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let a=0;a<i-1;a++)o.push(...jo(e[a][0],e[a][1],e[a+1][0],e[a+1][1],r));return t&&o.push(...jo(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?tx(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function F_(e,t,r,i,o){return(function(a,s){return Jn(a,!0,s)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function hg(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=An(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:An(r[0],1.5*(1+.22*t.roughness),fg(t));for(let a=1;a<r.length;a++){const s=r[a];if(s.length){const n=An(s,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:An(s,1.5*(1+.22*t.roughness),fg(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function ex(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),a=2*Math.PI/o;let s=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return s+=De(s*l,r),n+=De(n*l,r),{increment:a,rx:s,ry:n}}function Ih(e,t,r,i){const[o,a]=gg(i.increment,e,t,i.rx,i.ry,1,i.increment*_l(.1,_l(.4,1,r),r),r);let s=Bl(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=gg(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=Bl(n,null,r);s=s.concat(l)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function dg(e,t,r,i,o,a,s,n,l){const c=e,h=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=De(.01*d,l),u+=De(.01*u,l);let f=o,p=a;for(;f<0;)f+=2*Math.PI,p+=2*Math.PI;p-f>2*Math.PI&&(f=0,p=2*Math.PI);const g=2*Math.PI/l.curveStepCount,m=Math.min(g/2,(p-f)/2),y=pg(m,c,h,d,u,f,p,1,l);if(!l.disableMultiStroke){const x=pg(m,c,h,d,u,f,p,1.5,l);y.push(...x)}return s&&(n?y.push(...jo(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l),...jo(c,h,c+d*Math.cos(p),h+u*Math.sin(p),l)):y.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(f),h+u*Math.sin(f)]})),{type:"path",ops:y}}function ug(e,t){const r=Qy(Ky(nu(e))),i=[];let o=[0,0],a=[0,0];for(const{key:s,data:n}of r)switch(s){case"M":a=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...jo(a[0],a[1],n[0],n[1],t)),a=[n[0],n[1]];break;case"C":{const[l,c,h,d,u,f]=n;i.push(...$_(l,c,h,d,u,f,a,t)),a=[u,f];break}case"Z":i.push(...jo(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]]}return{type:"path",ops:i}}function Hc(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,a=i.length;if(a>2){r.push({op:"move",data:[i[0][0]+De(o,t),i[0][1]+De(o,t)]});for(let s=1;s<a;s++)r.push({op:"lineTo",data:[i[s][0]+De(o,t),i[s][1]+De(o,t)]})}}return{type:"fillPath",ops:r}}function Ma(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!ai[o])switch(o){case"zigzag":ai[o]||(ai[o]=new S_(i));break;case"cross-hatch":ai[o]||(ai[o]=new v_(i));break;case"dots":ai[o]||(ai[o]=new T_(i));break;case"dashed":ai[o]||(ai[o]=new M_(i));break;case"zigzag-line":ai[o]||(ai[o]=new __(i));break;default:o="hachure",ai[o]||(ai[o]=new su(i))}return ai[o]})(t,A_).fillPolygons(e,t)}function fg(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function rx(e){return e.randomizer||(e.randomizer=new B_(e.seed||0)),e.randomizer.next()}function _l(e,t,r,i=1){return r.roughness*i*(rx(r)*(t-e)+e)}function De(e,t,r=1){return _l(-e,e,t,r)}function jo(e,t,r,i,o,a=!1){const s=a?o.disableMultiStrokeFill:o.disableMultiStroke,n=Oh(e,t,r,i,o,!0,!1);if(s)return n;const l=Oh(e,t,r,i,o,!0,!0);return n.concat(l)}function Oh(e,t,r,i,o,a,s){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,u=.2+.2*rx(o);let f=o.bowing*o.maxRandomnessOffset*(i-t)/200,p=o.bowing*o.maxRandomnessOffset*(e-r)/200;f=De(f,o,c),p=De(p,o,c);const g=[],m=()=>De(d,o,c),y=()=>De(h,o,c),x=o.preserveVertices;return s?g.push({op:"move",data:[e+(x?0:m()),t+(x?0:m())]}):g.push({op:"move",data:[e+(x?0:De(h,o,c)),t+(x?0:De(h,o,c))]}),s?g.push({op:"bcurveTo",data:[f+e+(r-e)*u+m(),p+t+(i-t)*u+m(),f+e+2*(r-e)*u+m(),p+t+2*(i-t)*u+m(),r+(x?0:m()),i+(x?0:m())]}):g.push({op:"bcurveTo",data:[f+e+(r-e)*u+y(),p+t+(i-t)*u+y(),f+e+2*(r-e)*u+y(),p+t+2*(i-t)*u+y(),r+(x?0:y()),i+(x?0:y())]}),g}function An(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+De(t,r),e[0][1]+De(t,r)]),i.push([e[0][0]+De(t,r),e[0][1]+De(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+De(t,r),e[o][1]+De(t,r)]),o===e.length-1&&i.push([e[o][0]+De(t,r),e[o][1]+De(t,r)]);return Bl(i,null,r)}function Bl(e,t,r){const i=e.length,o=[];if(i>3){const a=[],s=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*e[n+1][0]-s*e[n-1][0])/6,l[1]+(s*e[n+1][1]-s*e[n-1][1])/6],a[2]=[e[n+1][0]+(s*e[n][0]-s*e[n+2][0])/6,e[n+1][1]+(s*e[n][1]-s*e[n+2][1])/6],a[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...Oh(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function gg(e,t,r,i,o,a,s,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=De(.5,n)-Math.PI/2;c.push([De(a,n)+t+.9*i*Math.cos(h-e),De(a,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const f=[De(a,n)+t+i*Math.cos(u),De(a,n)+r+o*Math.sin(u)];l.push(f),c.push(f)}c.push([De(a,n)+t+i*Math.cos(h+2*Math.PI+.5*s),De(a,n)+r+o*Math.sin(h+2*Math.PI+.5*s)]),c.push([De(a,n)+t+.98*i*Math.cos(h+s),De(a,n)+r+.98*o*Math.sin(h+s)]),c.push([De(a,n)+t+.9*i*Math.cos(h+.5*s),De(a,n)+r+.9*o*Math.sin(h+.5*s)])}return[c,l]}function pg(e,t,r,i,o,a,s,n,l){const c=a+De(.1,l),h=[];h.push([De(n,l)+t+.9*i*Math.cos(c-e),De(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=s;d+=e)h.push([De(n,l)+t+i*Math.cos(d),De(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(s),r+o*Math.sin(s)]),h.push([t+i*Math.cos(s),r+o*Math.sin(s)]),Bl(h,null,l)}function $_(e,t,r,i,o,a,s,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let f=0;f<d;f++)f===0?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(u?0:De(c[0],n)),s[1]+(u?0:De(c[0],n))]}),h=u?[o,a]:[o+De(c[f],n),a+De(c[f],n)],l.push({op:"bcurveTo",data:[e+De(c[f],n),t+De(c[f],n),r+De(c[f],n),i+De(c[f],n),h[0],h[1]]});return l}function Ms(e){return[...e]}function mg(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Ms(e[0]),Ms(e[1]),Ms(e[2]),Ms(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const a=[],s=1-t;i.push(Ms(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*o[n+1][0]-s*o[n-1][0])/6,l[1]+(s*o[n+1][1]-s*o[n-1][1])/6],a[2]=[o[n+1][0]+(s*o[n][0]-s*o[n+2][0])/6,o[n+1][1]+(s*o[n][1]-s*o[n+2][1])/6],a[3]=[o[n+1][0],o[n+1][1]],i.push(a[1],a[2],a[3])}}return i}function tl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function E_(e,t,r){const i=tl(t,r);if(i===0)return tl(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),tl(e,ia(t,r,o))}function ia(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Dh(e,t,r,i){const o=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],u=n[l+3];let f=3*h[0]-2*c[0]-u[0];f*=f;let p=3*h[1]-2*c[1]-u[1];p*=p;let g=3*d[0]-2*u[0]-c[0];g*=g;let m=3*d[1]-2*u[1]-c[1];return m*=m,f<g&&(f=g),p<m&&(p=m),f+p})(e,t)<r){const n=e[t+0];o.length?(a=o[o.length-1],s=n,Math.sqrt(tl(a,s))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=ia(l,c,.5),f=ia(c,h,.5),p=ia(h,d,.5),g=ia(u,f,.5),m=ia(f,p,.5),y=ia(g,m,.5);Dh([l,u,g,y],0,r,o),Dh([y,m,p,d],0,r,o)}var a,s;return o}function P_(e,t){return Ll(e,0,e.length,t)}function Ll(e,t,r,i,o){const a=o||[],s=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=E_(e[h],s,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Ll(e,t,c+1,i,a),Ll(e,c,r,i,a)):(a.length||a.push(s),a.push(n)),a}function Yc(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let a=0;a<o;a++)Dh(e,3*a,t,i);return r&&r>0?Ll(i,0,i.length,r):i}const di="none";class Al{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,a){const s=this._o(a);return this._d("line",[tx(t,r,i,o,s)],s)}rectangle(t,r,i,o,a){const s=this._o(a),n=[],l=F_(t,r,i,o,s);if(s.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];s.fillStyle==="solid"?n.push(Hc([c],s)):n.push(Ma([c],s))}return s.stroke!==di&&n.push(l),this._d("rectangle",n,s)}ellipse(t,r,i,o,a){const s=this._o(a),n=[],l=ex(i,o,s),c=Ih(t,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=Ih(t,r,s,l).opset;h.type="fillPath",n.push(h)}else n.push(Ma([c.estimatedPoints],s));return s.stroke!==di&&n.push(c.opset),this._d("ellipse",n,s)}circle(t,r,i,o){const a=this.ellipse(t,r,i,i,o);return a.shape="circle",a}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[Jn(t,!1,i)],i)}arc(t,r,i,o,a,s,n=!1,l){const c=this._o(l),h=[],d=dg(t,r,i,o,a,s,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=dg(t,r,i,o,a,s,!0,!1,u);f.type="fillPath",h.push(f)}else h.push((function(u,f,p,g,m,y,x){const C=u,k=f;let v=Math.abs(p/2),M=Math.abs(g/2);v+=De(.01*v,x),M+=De(.01*M,x);let A=m,L=y;for(;A<0;)A+=2*Math.PI,L+=2*Math.PI;L-A>2*Math.PI&&(A=0,L=2*Math.PI);const T=(L-A)/x.curveStepCount,_=[];for(let $=A;$<=L;$+=T)_.push([C+v*Math.cos($),k+M*Math.sin($)]);return _.push([C+v*Math.cos(L),k+M*Math.sin(L)]),_.push([C,k]),Ma([_],x)})(t,r,i,o,a,s,c));return c.stroke!==di&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],a=hg(t,i);if(i.fill&&i.fill!==di)if(i.fillStyle==="solid"){const s=hg(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?s.push(...c):c.length===3?s.push(...Yc(mg([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):s.push(...Yc(mg(c),10,(1+i.roughness)/2))}s.length&&o.push(Ma([s],i))}return i.stroke!==di&&o.push(a),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],a=Jn(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(Hc([t],i)):o.push(Ma([t],i))),i.stroke!==di&&o.push(a),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=i.fill&&i.fill!=="transparent"&&i.fill!==di,s=i.stroke!==di,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,u){const f=Qy(Ky(nu(h))),p=[];let g=[],m=[0,0],y=[];const x=()=>{y.length>=4&&g.push(...Yc(y,d)),y=[]},C=()=>{x(),g.length&&(p.push(g),g=[])};for(const{key:v,data:M}of f)switch(v){case"M":C(),m=[M[0],M[1]],g.push(m);break;case"L":x(),g.push([M[0],M[1]]);break;case"C":if(!y.length){const A=g.length?g[g.length-1]:m;y.push([A[0],A[1]])}y.push([M[0],M[1]]),y.push([M[2],M[3]]),y.push([M[4],M[5]]);break;case"Z":x(),g.push([m[0],m[1]])}if(C(),!u)return p;const k=[];for(const v of p){const M=P_(v,u);M.length&&k.push(M)}return k})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=ug(t,i);if(a)if(i.fillStyle==="solid")if(l.length===1){const h=ug(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(Hc(l,i));else o.push(Ma(l,i));return s&&(n?l.forEach((h=>{o.push(Jn(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const a=typeof r=="number"&&r>=0?o.data.map((s=>+s.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":i+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":i+=`L${a[0]} ${a[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:di};break;case"fillPath":s={d:this.opsToPath(a),stroke:di,strokeWidth:0,fill:i.fill||di};break;case"fillSketch":s=this.fillSketch(a,i)}s&&o.push(s)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||di,strokeWidth:i,fill:di}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class I_{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Al(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,s,a),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,s,a,n),o.restore();break}case"fillSketch":this.fillSketch(o,s,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const a of r.ops){const s=typeof i=="number"&&i>=0?a.data.map((n=>+n.toFixed(i))):a.data;switch(a.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,a){const s=this.gen.line(t,r,i,o,a);return this.draw(s),s}rectangle(t,r,i,o,a){const s=this.gen.rectangle(t,r,i,o,a);return this.draw(s),s}ellipse(t,r,i,o,a){const s=this.gen.ellipse(t,r,i,o,a);return this.draw(s),s}circle(t,r,i,o){const a=this.gen.circle(t,r,i,o);return this.draw(a),a}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,a,s,n=!1,l){const c=this.gen.arc(t,r,i,o,a,s,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Fn="http://www.w3.org/2000/svg";class O_{constructor(t,r){this.svg=t,this.gen=new Al(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,a=o.createElementNS(Fn,"g"),s=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(Fn,"path"),l.setAttribute("d",this.opsToPath(n,s)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(Fn,"path"),l.setAttribute("d",this.opsToPath(n,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&a.appendChild(l)}return a}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const a=t.createElementNS(Fn,"path");return a.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),a.setAttribute("stroke",i.fill||""),a.setAttribute("stroke-width",o+""),a.setAttribute("fill","none"),i.fillLineDash&&a.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,a){const s=this.gen.line(t,r,i,o,a);return this.draw(s)}rectangle(t,r,i,o,a){const s=this.gen.rectangle(t,r,i,o,a);return this.draw(s)}ellipse(t,r,i,o,a){const s=this.gen.ellipse(t,r,i,o,a);return this.draw(s)}circle(t,r,i,o){const a=this.gen.circle(t,r,i,o);return this.draw(a)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,a,s,n=!1,l){const c=this.gen.arc(t,r,i,o,a,s,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var Vt={canvas:(e,t)=>new I_(e,t),svg:(e,t)=>new O_(e,t),generator:e=>new Al(e),newSeed:()=>Al.newSeed()},D_=1,R_=3;async function lu(e){const t=e.getElementsByTagName("img");if(!t||t.length===0)return;const r=!cu(e);await Promise.all([...t].map(i=>new Promise(o=>{function a(){if(i.style.display="flex",i.style.flexDirection="column",r){const s=Xe().fontSize?Xe().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[l=bd.fontSize]=Gl(s),c=l*n+"px";i.style.minWidth=c,i.style.maxWidth=c}else i.style.width="100%";o(i)}b(a,"setupImage"),setTimeout(()=>{i.complete&&a()}),i.addEventListener("error",a),i.addEventListener("load",a)})))}b(lu,"configureLabelImages");function cu(e){return e.nodeType===R_?e.textContent?.trim()!=="":e.nodeType!==D_||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(cu)}b(cu,"hasTextBesidesImages");var yg=3,N_=32,q_=b(async(e,t,r)=>{const i=Xe(),o=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),a=o.insert("g").attr("class","label").attr("style",Or(t.labelStyle)),n=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(y=>({text:y,cssClass:"c4-descr"}))].filter(y=>y.text),l=t.width?Math.max(t.width-2*(t.padding??0),N_):Xe().flowchart?.wrappingWidth??200,h=i.c4?.wrap??!0?l:Number.POSITIVE_INFINITY,d=await Promise.all(n.map(async y=>{const x=a.append("g").attr("class",y.cssClass),C=await gi(x,Ti(Go(y.text??""),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:h,style:t.labelStyle},i);return He(C).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),He(C).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:x,box:x.node().getBBox()}})),u=Math.max(...d.map(({box:y})=>y.width),0);let f=0;for(const{el:y,box:x}of d)y.attr("transform",`translate(${u/2-x.x-x.width/2}, ${f-x.y})`),f+=x.height+yg;const p=d.length>0?f-yg:0;a.insert("rect",":first-child"),a.attr("transform",`translate(${-u/2}, ${-p/2})`);const g=a.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:o,bbox:g,halfPadding:m,label:a}},"c4LabelHelper"),xg=b((e,t)=>{const{x:r,y:i,width:o,height:a}=e;return o>=t?e:"left"in e?{x:r,y:i,width:t,height:a,top:i,left:r,bottom:i+a,right:r+t,toJSON:b(()=>({}),"toJSON")}:{x:r-(t-o)/2,y:i,width:t,height:a}},"withMinWidth"),he=b(async(e,t,r,{ignoreMinWidth:i=!1}={})=>{if(t.stereotype!==void 0)return q_(e,t,r);let o;const a=t.useHtmlLabels||ao(Xe()?.htmlLabels);r?o=r:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),n=s.insert("g").attr("class","label").attr("style",Or(t.labelStyle));let l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];const c=!!t.icon||!!t.img,h=t.labelType==="markdown",d=l&&!t.width&&!i?t.minWidth??0:0,u=await gi(n,Ti(Go(l),Xe()),{useHtmlLabels:a,width:t.width||t.wrappingWidth||Xe().flowchart?.wrappingWidth,minWidth:d,classes:h?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:c,markdown:h},Xe()),f=(t?.padding??0)/2;let p;if(a){const g=u.children[0],m=He(u);await lu(g),p=await ma.measure(()=>g.getBoundingClientRect()),p=xg(p,d),m.attr("width",p.width),m.attr("height",p.height)}else p=await ma.measure(()=>u.getBBox()),p=xg(p,d);return a?n.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):n.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&n.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:s,bbox:p,halfPadding:f,label:n}},"labelHelper"),ca=b(async(e,t,r)=>{const i=r.useHtmlLabels??qr(Xe()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await gi(o,Ti(Go(t),Xe()),{useHtmlLabels:i,width:r.width||Xe()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),s=r.padding/2;let n;if(qr(Xe())){const l=a.children[0],c=He(a);n=await ma.measure(()=>l.getBoundingClientRect()),c.attr("width",n.width),c.attr("height",n.height)}else n=await ma.measure(()=>a.getBBox());return i?o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"):o.attr("transform","translate(0, "+-n.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:n,halfPadding:s,label:o}},"insertLabel"),ee=b((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}const i=t.node().getBBox();e.width=i.width,e.height=i.height},"updateNodeBounds"),se=b((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function rr(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}b(rr,"createPathFromPoints");function Uo(e,t,r,i,o,a){const s=[],l=r-e,c=i-t,h=l/a,d=2*Math.PI/h,u=t+c/2;for(let f=0;f<=50;f++){const p=f/50,g=e+p*l,m=u+o*Math.sin(d*(g-e));s.push({x:g,y:m})}return s}b(Uo,"generateFullSineWavePoints");function Zi(e,t,r,i,o,a){const s=[],n=o*Math.PI/180,h=(a*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);s.push({x:-f,y:-p})}return s}b(Zi,"generateCirclePoints");function Rh(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),a=t.find(l=>l.getAttribute("stroke")!=="none"),s=b((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:s(o,"fill"),"fill-opacity":s(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}b(Rh,"mergePaths");var W_=b((e,t)=>{var r=e.x,i=e.y,o=t.x-r,a=t.y-i,s=e.width/2,n=e.height/2,l,c;return Math.abs(a)*s>Math.abs(o)*n?(a<0&&(n=-n),l=a===0?0:n*o/a,c=n):(o<0&&(s=-s),l=s,c=o===0?0:s*a/o),{x:r+l,y:i+c}},"intersectRect"),$o=W_;function ix(e,t){return e.intersect(t)}b(ix,"intersectNode");var z_=ix;function ox(e,t,r,i){var o=e.x,a=e.y,s=o-i.x,n=a-i.y,l=Math.sqrt(t*t*n*n+r*r*s*s),c=Math.abs(t*r*s/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<a&&(h=-h),{x:o+c,y:a+h}}b(ox,"intersectEllipse");var ax=ox;function sx(e,t,r){return ax(e,t,t,r)}b(sx,"intersectCircle");var H_=sx;function nx(e,t,r,i){{const o=t.y-e.y,a=e.x-t.x,s=t.x*e.y-e.x*t.y,n=o*r.x+a*r.y+s,l=o*i.x+a*i.y+s,c=1e-6;if(n!==0&&l!==0&&Nh(n,l))return;const h=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,f=h*e.x+d*e.y+u,p=h*t.x+d*t.y+u;if(Math.abs(f)<c&&Math.abs(p)<c&&Nh(f,p))return;const g=o*d-h*a;if(g===0)return;const m=(a*u-d*s)/g,y=(h*s-o*u)/g;return{x:m,y}}}b(nx,"intersectLine");function Nh(e,t){return e*t>0}b(Nh,"sameSign");var Y_=nx;function lx(e,t,r){let i=e.x,o=e.y,a=[],s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){s=Math.min(s,h.x),n=Math.min(n,h.y)}):(s=Math.min(s,t.x),n=Math.min(n,t.y));let l=i-e.width/2-s,c=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],f=Y_(e,r,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});f&&a.push(f)}return a.length?(a.length>1&&a.sort(function(h,d){let u=h.x-r.x,f=h.y-r.y,p=Math.sqrt(u*u+f*f),g=d.x-r.x,m=d.y-r.y,y=Math.sqrt(g*g+m*m);return p<y?-1:p===y?0:1}),a[0]):e}b(lx,"intersectPolygon");var X_=lx,Ht={node:z_,circle:H_,ellipse:ax,polygon:X_,rect:$o},pi=b((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),G_=b(async(e,t,r,i=!1,o=!1)=>{let a=t||"";typeof a=="object"&&(a=a[0]);const s=Xe(),n=qr(s);return await gi(e,a,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},s)},"createLabel"),bo=G_;function cx(e,t){const{labelStyles:r}=jt(t);t.labelStyle=r;const i=se(t);let o=i;i||(o="anchor");const a=e.insert("g").attr("class",o).attr("id",t.domId||t.id),s=1,{cssStyles:n}=t,l=Vt.svg(a),c=Gt(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,s*2,c),d=a.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Or(n)),ee(t,d),t.intersect=function(u){return Mt.info("Circle intersect",t,s,u),Ht.circle(t,s,u)},a}b(cx,"anchor");function qh(e,t,r,i,o,a,s){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,u=(i-t)/2,f=d/o,p=u/a,g=Math.sqrt(f**2+p**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");const m=Math.sqrt(1-g**2),y=l+m*a*Math.sin(h)*(s?-1:1),x=c-m*o*Math.cos(h)*(s?-1:1),C=Math.atan2((t-x)/a,(e-y)/o);let v=Math.atan2((i-x)/a,(r-y)/o)-C;s&&v<0&&(v+=2*Math.PI),!s&&v>0&&(v-=2*Math.PI);const M=[];for(let A=0;A<20;A++){const L=A/19,T=C+L*v,_=y+o*Math.cos(T),$=x+a*Math.sin(T);M.push({x:_,y:$})}return M}b(qh,"generateArcPoints");function hx(e,t,r){const[i,o]=[t,r].sort((a,s)=>s-a);return o*(1-Math.sqrt(1-(e/i/2)**2))}b(hx,"calculateArcSagitta");async function dx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o,n=b(T=>T+s,"calcTotalHeight"),l=b(T=>{const _=T/2;return[_/(2.5+T/50),_]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await he(e,t,se(t)),d=n(t?.height?t?.height:h.height),[u,f]=l(d),p=hx(d,u,f),m=(t?.width?t?.width:h.width)+a*2+p-p,y=d,{cssStyles:x}=t,C=[{x:m/2,y:-y/2},{x:-m/2,y:-y/2},...qh(-m/2,-y/2,-m/2,y/2,u,f,!1),{x:m/2,y:y/2},...qh(m/2,y/2,m/2,-y/2,u,f,!0)],k=Vt.svg(c),v=Gt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const M=rr(C),A=k.path(M,v),L=c.insert(()=>A,":first-child");return L.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${u/2}, 0)`),ee(t,L),t.intersect=function(T){return Ht.polygon(t,C,T)},c}b(dx,"bowTieRect");async function ux(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=Math.max(s.width+c*2,t.width??0,80),d=Math.max(Math.min(h*.08,12),5),u=Math.max(s.height+c*2+d,t.height??0),f=-u/2+d,p=u/2,g=h*.72,m=[`M${-h/2},${f}`,`L${-g/2},${p}`,`A${g/2},${d} 0 0 0 ${g/2},${p}`,`L${h/2},${f}`,`A${h/2},${d} 0 0 0 ${-h/2},${f}`,"Z"].join(" "),{cssStyles:y}=t,x=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const L=Vt.svg(a).path(m,Gt(t,{}));x.node()?.appendChild(L),y&&x.attr("style",y)}else x.append("path").attr("d",m).attr("style",o);x.append("ellipse").attr("cx",0).attr("cy",f).attr("rx",h/2).attr("ry",d).attr("style",`fill:none;stroke:${l};stroke-width:1px`),ee(t,x);const C=f+(p-f)/2;n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${C-s.height/2-(s.y-(s.top??0))})`);const k=12,v=b((A,L,T)=>Array.from({length:k+1},(_,$)=>{const P=Math.PI-$*Math.PI/k;return{x:A*Math.cos(P),y:L+T*d*Math.sin(P)}}),"arc"),M=[...v(h/2,f,-1),...v(g/2,p,1).reverse()];return t.intersect=function(A){return Ht.polygon(t,M,A)},a}b(ux,"bucket");var bg=20,Cg=8,j_=80,U_=8;function fx(e){const{themeVariables:t}=Xe(),r=t.clusterBkg,i=t.clusterBorder;switch(e){case"flow":return{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"};default:return{rx:U_,fill:r,stroke:i,cssClass:"collapsed-group"}}}b(fx,"getCollapsedStyle");async function gx(e,t){const r=fx(t.metadata?.containerType),{fill:i,stroke:o}=r,{nodeStyles:a}=jt(t),{shapeSvg:s,bbox:n}=await he(e,t,se(t)),{theme:l,themeVariables:c}=Xe();_i(s,t.colorIndex,l,c.borderColorArray);const h=t.padding??8,d=n.height,u=Math.max(n.width+h*2,j_,t?.width??0),f=Math.max(d+Cg+bg+h*2,t?.height??0),p=-u/2,g=-f/2,m=-28/2,y=s.select(".label");y&&(t.useHtmlLabels??qr(Xe())?y.attr("transform",`translate(${-n.width/2}, ${-n.height/2+m})`):y.attr("transform",`translate(0, ${-n.height/2+m})`));let x;if(t.look==="handDrawn"){const A=Vt.svg(s),L=Gt(t,{fill:i,stroke:o,...r.strokeWidth===void 0?{}:{strokeWidth:r.strokeWidth},...i==="none"?{fillWeight:0}:{fillStyle:"solid"}}),T=A.path(pi(p,g,u,f,r.rx),L);x=s.insert(()=>T,":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",Or(t.cssStyles))}else x=s.insert("rect",":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",a).attr("rx",r.rx).attr("ry",r.rx).attr("x",p).attr("y",g).attr("width",u).attr("height",f).attr("fill",i).attr("stroke",o),r.strokeWidth!==void 0&&x.attr("stroke-width",r.strokeWidth+"px");const C=g+h+d+Cg;s.append("line").attr("class","collapsed-separator").attr("x1",p+8).attr("y1",C).attr("x2",p+u-8).attr("y2",C).attr("stroke",o).attr("stroke-dasharray","3, 3");const k=C+bg/2,v=2.5,M=10;for(let A=-1;A<=1;A++)s.append("circle").attr("class","collapsed-indicator").attr("cx",A*M).attr("cy",k).attr("r",v).attr("fill",o);return ee(t,x),t.calcIntersect=function(A,L){return Ht.rect(A,L)},t.intersect=function(A){return Ht.rect(t,A)},s}b(gx,"collapsedGroup");function no(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}b(no,"insertPolygonShape");var V_=["right","left","up","down"],hu="point",Z_=b(e=>{const t=new Set;for(const r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),K_=b(e=>V_.filter(t=>e.has(t)).join("|")||hu,"getDirectionKey"),wg={"right|left|up|down":b(({height:e,midpoint:t,padding:r,width:i})=>[{x:0,y:0},{x:t,y:0},{x:i/2,y:2*r},{x:i-t,y:0},{x:i,y:0},{x:i,y:-e/3},{x:i+2*r,y:-e/2},{x:i,y:-2*e/3},{x:i,y:-e},{x:i-t,y:-e},{x:i/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":b(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":b(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":b(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":b(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":b(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":b(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"up|down"),"right|up":b(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":b(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":b(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":b(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:b(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:b(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:b(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r}],"up"),down:b(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"down"),[hu]:()=>[{x:0,y:0}]},Q_=b((e,t,r,i)=>{const o=Z_(e),a=(r.padding??0)/2,s=t.height+4*a,n=s/2,l=i??t.width+2*n+2*a,c=K_(o);return(wg[c]??wg[hu])({height:s,midpoint:n,padding:a,width:l})},"getArrowPoints");async function px(e,t){const r=t,{shapeSvg:i,bbox:o}=await he(e,r,se(r)),a=r.padding??0,s=o.height+2*a,n=s/2,l=o.width+2*n+a,c=r.width??0,d=r.positioned&&(r.widthInColumns??1)>1&&c>l?c:l,u=Q_(r.directions??[],o,r,d),f=no(i,d,s,u);return f.attr("style",r.style??null),ee(r,f),r.intersect=function(p){return Ht.polygon(r,u,p)},i}b(px,"block_arrow");async function mx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=18,d=12,u=Math.max(s.width+c*2,t.width??0,90),f=Math.max(s.height+c*2+h,t.height??0),p=-f/2,{cssStyles:g}=t,m=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const C=Vt.svg(a).path(pi(-u/2,p,u,f,d),Gt(t,{}));m.node()?.appendChild(C),g&&m.attr("style",g)}else m.append("rect").attr("x",-u/2).attr("y",p).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);m.append("line").attr("x1",-u/2).attr("y1",p+h).attr("x2",u/2).attr("y2",p+h).attr("style",`stroke:${l};stroke-width:1px`);for(let x=0;x<3;x++)m.append("circle").attr("cx",-u/2+12+x*9).attr("cy",p+h/2).attr("r",2.5).attr("style",`fill:${l};stroke:none`);m.append("rect").attr("class","browser-address-bar").attr("x",-u/2+44).attr("y",p+4).attr("width",Math.max(u-56,10)).attr("height",h-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${l};stroke-width:1px;opacity:0.6`),ee(t,m);const y=p+h+(f-h)/2;return n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${y-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(x){return Ht.rect(t,x)},a}b(mx,"browser");var $n=12;async function yx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?28:o,s=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=(t?.width??l.width)+(t.look==="neo"?a*2:a+$n),h=(t?.height??l.height)+(t.look==="neo"?s*2:s),d=0,u=c,f=-h,p=0,g=[{x:d+$n,y:f},{x:u,y:f},{x:u,y:p},{x:d,y:p},{x:d,y:f+$n},{x:d+$n,y:f}];let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=Vt.svg(n),C=Gt(t,{}),k=rr(g),v=x.path(k,C);m=n.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),y&&m.attr("style",y)}else m=no(n,c,h,g);return i&&m.attr("style",i),ee(t,m),t.intersect=function(x){return Ht.polygon(t,g,x)},n}b(yx,"card");function xx(e,t){const{nodeStyles:r}=jt(t);t.label="";const i=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,a=Math.max(28,t.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],n=Vt.svg(i),l=Gt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=rr(s),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(u){return Ht.polygon(t,s,u)},i}b(xx,"choice");async function du(e,t,r){const{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,halfPadding:n}=await he(e,t,se(t),{ignoreMinWidth:!0}),l=16,c=r?.padding??n,h=Math.sqrt(s.width**2+s.height**2)/2,d=t.look==="neo"?h+l:h+c;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(a),g=Gt(t,{}),m=p.circle(0,0,d*2,g);u=a.insert(()=>m,":first-child"),u.attr("class","basic label-container").attr("style",Or(f))}else u=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",d).attr("cx",0).attr("cy",0);return ee(t,u),t.calcIntersect=function(p,g){const m=p.width/2;return Ht.circle(p,m,g)},t.intersect=function(p){return Mt.info("Circle intersect",t,d,p),Ht.circle(t,d,p)},a}b(du,"circle");async function bx(e,t){const r=t,i=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:o,bbox:a,halfPadding:s}=await he(e,r,i),n=o.insert("rect",":first-child"),l=r.padding??0,c=r.positioned?r.width??0:a.width+l,h=r.positioned?r.height??0:a.height+l,d=r.positioned?-c/2:-a.width/2-s,u=r.positioned?-h/2:-a.height/2-s;return n.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",d).attr("y",u).attr("width",c).attr("height",h),ee(r,n),r.intersect=function(f){return Ht.rect(r,f)},o}b(bx,"composite");async function Cx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=20,d=12,u=Math.max(s.width+c*2,t.width??0,90),f=Math.max(s.height+c*2+h,t.height??0),p=-f/2,{cssStyles:g}=t,m=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const C=Vt.svg(a).path(pi(-u/2,p,u,f,d),Gt(t,{}));m.node()?.appendChild(C),g&&m.attr("style",g)}else m.append("rect").attr("x",-u/2).attr("y",p).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);m.append("text").attr("x",-u/2+12).attr("y",p+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${l}`).text(">_"),ee(t,m);const y=p+h+(f-h)/2;return n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${y-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(x){return Ht.rect(t,x)},a}b(Cx,"consoleWindow");function wx(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},a={x:-(i/2)*t,y:i/2*r},s={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${a.x},${a.y} L ${n.x},${n.y}
232
+ M ${o.x},${o.y} L ${s.x},${s.y}`}b(wx,"createLine");function kx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:s}=t,n=Vt.svg(o),l=Gt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,a*2,l),h=wx(a),d=n.path(h,l),u=o.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),s&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),ee(t,u),t.intersect=function(f){return Mt.info("crossedCircle intersect",t,{radius:a,point:f}),Ht.circle(t,a,f)},o}b(kx,"crossedCircle");function po(e,t,r,i=100,o=0,a=180){const s=[],n=o*Math.PI/180,h=(a*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);s.push({x:-f,y:-p})}return s}b(po,"generateCirclePoints");async function Sx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=a.width+n,h=a.height+l,d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...po(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...po(c/2+d*2,-d,d,20,-180,-270),...po(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...po(c/2,h/2,d,20,0,90)],p=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...po(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...po(c/2+c*.1,-d,d,20,-180,-270),...po(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...po(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2,y:h/2+d}],g=Vt.svg(o),m=Gt(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=rr(f).replace("Z",""),C=g.path(x,m),k=rr(p),v=g.path(k,{...m}),M=o.insert("g",":first-child");return M.insert(()=>v,":first-child").attr("stroke-opacity",0),M.insert(()=>C,":first-child"),M.attr("class","text"),u&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),M.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-c/2+d-(a.x-(a.left??0))},${-h/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ee(t,M),t.intersect=function(A){return Ht.polygon(t,p,A)},o}b(Sx,"curlyBraceLeft");function mo(e,t,r,i=100,o=0,a=180){const s=[],n=o*Math.PI/180,h=(a*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);s.push({x:f,y:p})}return s}b(mo,"generateCirclePoints");async function vx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=a.width+(t.look==="neo"?n*2:n),h=a.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...mo(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...mo(c/2+d*2,-d,d,20,-180,-270),...mo(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...mo(c/2,h/2,d,20,0,90)],p=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...mo(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...mo(c/2+d*2,-d,d,20,-180,-270),...mo(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...mo(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],g=Vt.svg(o),m=Gt(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=rr(f).replace("Z",""),C=g.path(x,m),k=rr(p),v=g.path(k,{...m}),M=o.insert("g",":first-child");return M.insert(()=>v,":first-child").attr("stroke-opacity",0),M.insert(()=>C,":first-child"),M.attr("class","text"),u&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),M.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-c/2+(t.padding??0)/2-(a.x-(a.left??0))},${-h/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ee(t,M),t.intersect=function(A){return Ht.polygon(t,p,A)},o}b(vx,"curlyBraceRight");function Wr(e,t,r,i=100,o=0,a=180){const s=[],n=o*Math.PI/180,h=(a*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);s.push({x:-f,y:-p})}return s}b(Wr,"generateCirclePoints");async function Tx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=a.width+(t.look==="neo"?n*2:n),h=a.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Wr(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Wr(c/2+d*2,-d,d,20,-180,-270),...Wr(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Wr(c/2,h/2,d,20,0,90)],p=[...Wr(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Wr(-c/2-d/2,-d,d,20,0,90),...Wr(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Wr(-c/2+d+d/2,h/2,d,30,-180,-270)],g=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Wr(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Wr(c/2+d*2,-d,d,20,-180,-270),...Wr(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Wr(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2-d-d/2,y:h/2+d},...Wr(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Wr(-c/2-d/2,-d,d,20,0,90),...Wr(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Wr(-c/2+d+d/2,h/2,d,30,-180,-270)],m=Vt.svg(o),y=Gt(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=rr(f).replace("Z",""),k=m.path(C,y),M=rr(p).replace("Z",""),A=m.path(M,y),L=rr(g),T=m.path(L,{...y}),_=o.insert("g",":first-child");return _.insert(()=>T,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.insert(()=>A,":first-child"),_.attr("class","text"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-c/2+(t.padding??0)/2-(a.x-(a.left??0))},${-h/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ee(t,_),t.intersect=function($){return Ht.polygon(t,g,$)},o}b(Tx,"curlyBraces");async function Mx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await he(e,t,se(t)),d=Math.max(l,h.height+s*2,t?.height??0),u=d/2,f=u-Math.sqrt(Math.max(0,u**2-(h.height/2)**2)),p=Math.max(d/4,f),g=Math.max(n,h.width+a*2+p*2,(h.width+a*2)*1.25,t?.width??0),{cssStyles:m}=t,y=Vt.svg(c),x=Gt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=g,k=d,v=C-u,M=k/4,A=[{x:v,y:0},{x:M,y:0},{x:0,y:k/2},{x:M,y:k},{x:v,y:k},...Zi(-v,-k/2,u,50,270,90)],L=rr(A),T=y.path(L,x),_=c.insert(()=>T,":first-child");return _.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(${-g/2}, ${-d/2})`),ee(t,_),t.intersect=function($){return Ht.polygon(t,A,$)},c}b(Mx,"curvedTrapezoid");async function _x(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.padding??20,l=Math.max(a.width+n*2,t.width??0,100),c=Math.min(Math.max(l*.23,16),56),h=c*.27,d=Math.max(a.height+n*2,t.height?t.height-(2*c-h):0),u=Math.min(l*.177,d*.45),f=d+2*c-h,p=-f/2,g=p+2*c-h,m=o.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:y}=t;if(t.look==="handDrawn"){const L=Vt.svg(o),T=Gt(t,{}),_=L.path(pi(-l/2,g,l,d,u),T),$=L.circle(0,p+c,c*2,T);m.insert(()=>$,":first-child"),m.insert(()=>_,":first-child"),y&&m.attr("style",y)}else m.append("rect").attr("x",-l/2).attr("y",g).attr("width",l).attr("height",d).attr("rx",u).attr("ry",u).attr("style",i),m.append("circle").attr("cx",0).attr("cy",p+c).attr("r",c).attr("style",i);ee(t,m);const x=g+d/2;s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`);const C=p+c,k=Math.asin(Math.min(1,(g-C)/c))*180/Math.PI,A=[...Zi(0,-C,c,24,180+k,-k),...Zi(-(-l/2+u),-(g+u),u,12,90,0),...Zi(-(-l/2+u),-(f/2-u),u,12,360,270),...Zi(-(l/2-u),-(f/2-u),u,12,270,180),...Zi(-(l/2-u),-(g+u),u,12,180,90)];return t.intersect=function(L){return Ht.polygon(t,A,L)},o}b(_x,"person");var J_=b((e,t,r,i,o,a)=>[`M${e},${t+a}`,`a${o},${a} 0,0,0 ${r},0`,`a${o},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),tB=b((e,t,r,i,o,a)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${o},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),eB=b((e,t,r,i,o,a)=>[`M${e-r/2},${-i/2}`,`a${o},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),kg=8,Sg=8;async function Bx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?24:o,s=t.look==="neo"?24:o,n=t.width??0;if(t.width&&(t.width=t.width-s,t.width<Sg&&(t.width=Sg)),t.height){const x=n/2/(2.5+n/50);t.height=t.height-a-x*3,t.height<kg&&(t.height=kg)}const{shapeSvg:l,bbox:c,label:h}=await he(e,t,se(t)),d=Math.max(t.width??0,c.width)+s,u=d/2,f=u/(2.5+d/50),p=Math.max(t.height??0,c.height)+a+f;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=Vt.svg(l),x=tB(0,0,d,p,u,f),C=eB(0,f,d,p,u,f),k=Gt(t,{}),v=y.path(x,k),M=y.path(C,Gt(t,{fill:"none"}));g=l.insert(()=>M,":first-child"),g=l.insert(()=>v,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=J_(0,0,d,p,u,f);g=l.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Or(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-d/2}, ${-(p/2+f)})`),ee(t,g),h.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(y){const x=Ht.rect(t,y),C=x.x-(t.x??0);if(u!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-f)){let k=f*f*(1-C*C/(u*u));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},l}b(Bx,"cylinder");async function ms(e,t,r){const{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i;const{shapeSvg:a,bbox:s}=await he(e,t,se(t)),n=Math.max(s.width+r.labelPaddingX*2,t?.width||0),l=Math.max(s.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:u,ry:f}=t;const{cssStyles:p}=t;if(r?.rx&&r.ry&&(u=r.rx,f=r.ry),t.look==="handDrawn"){const g=Vt.svg(a),m=Gt(t,{}),y=u||f?g.path(pi(c,h,n,l,u||0),m):g.rectangle(c,h,n,l,m);d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",Or(p))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Or(u)).attr("ry",Or(f)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return ee(t,d,t.look==="handDrawn"?void 0:{width:n,height:l}),t.calcIntersect=function(g,m){return Ht.rect(g,m)},t.intersect=function(g){return Ht.rect(t,g)},a}b(ms,"drawRect");async function Lx(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:a,width:s,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(a??0)*2,labelPaddingY:o??a??0},c=await ms(e,t,l);if(t.look==="handDrawn"){const f=Vt.svg(c),p=Gt(t,{}),g=c.select(".basic.label-container > path:nth-child(2)"),m=g.node();if(!m)return c;let y=null;if(m instanceof SVGGraphicsElement)y=m.getBBox();else return c;return c.insert(()=>f.line(y.x,y.y,y.x+y.width,y.y,p),".basic.label-container g.label"),c.insert(()=>f.line(y.x,y.y+y.height,y.x+y.width,y.y+y.height,p),".basic.label-container g.label"),g.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,u=(Number(h.attr("height"))||n)??0;return d>0&&u>0&&h.attr("stroke-dasharray",`${d} ${u}`),c}b(Lx,"datastore");async function Ax(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?16:t.padding??0,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=n.width+o,h=n.height+a,d=h*.2,u=-c/2,f=-h/2-d/2,{cssStyles:p}=t,g=Vt.svg(s),m=Gt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:u,y:f+d},{x:-u,y:f+d},{x:-u,y:-f},{x:u,y:-f},{x:u,y:f},{x:-u,y:f},{x:-u,y:f+d}],x=g.polygon(y.map(k=>[k.x,k.y]),m),C=s.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),l.attr("transform",`translate(${u+(t.padding??0)/2-(n.x-(n.left??0))}, ${f+d+(t.padding??0)/2-(n.y-(n.top??0))})`),ee(t,C),t.intersect=function(k){return Ht.rect(t,k)},s}b(Ax,"dividedRectangle");async function Fx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t),o=t.look==="neo"?12:5;t.labelStyle=r;const a=t.padding??0,s=t.look==="neo"?16:a,{shapeSvg:n,bbox:l}=await he(e,t,se(t),{ignoreMinWidth:!0}),c=Math.sqrt(l.width**2+l.height**2)/2,h=(t?.width?t?.width/2:c)+(s??0),d=h+o;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=Gt(t,{roughness:.2,strokeWidth:2.5}),m=Gt(t,{roughness:.2,strokeWidth:1.5}),y=p.circle(0,0,d*2,g),x=p.circle(0,0,h*2,m);u=n.insert("g",":first-child"),u.attr("class",Or(t.cssClasses)).attr("style",Or(f)),u.node()?.appendChild(y),u.node()?.appendChild(x)}else{u=n.insert("g",":first-child");const p=u.insert("circle",":first-child"),g=u.insert("circle");u.attr("class","basic label-container").attr("style",i),p.attr("class","outer-circle").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return ee(t,u),t.intersect=function(p){return Mt.info("DoubleCircle intersect",t,d,p),Ht.circle(t,d,p)},n}b(Fx,"doublecircle");async function $x(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,halfPadding:s}=await he(e,t,se(t)),{theme:n,themeVariables:l}=Xe();_i(o,t.colorIndex,n,l.borderColorArray);const c=s??10,h=a.width/2+c*2,d=a.height/2+c*2;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(o),g=Gt(t,{}),m=p.ellipse(0,0,h*2,d*2,g);u=o.insert(()=>m,":first-child"),u.attr("class","basic label-container"),f&&u.attr("style",f)}else u=o.insert("ellipse",":first-child").attr("class","basic label-container").attr("style",i).attr("rx",h).attr("ry",d).attr("cx",0).attr("cy",0);return t.width=h*2,t.height=d*2,ee(t,u),t.calcIntersect=function(p,g){const m=p.width/2,y=p.height/2;return Ht.ellipse(p,m,y,g)},t.intersect=function(p){return Ht.ellipse(t,h,d,p)},o}b($x,"usecaseEllipse");function Ex(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=jt(t);t.label="",t.labelStyle=i;const a=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),s=7,{cssStyles:n}=t,l=Vt.svg(a),{nodeBorder:c}=r,h=Gt(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),u=a.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",o),ee(t,u),t.intersect=function(f){return Mt.info("filledCircle intersect",t,{radius:s,point:f}),Ht.circle(t,s,f)},a}b(Ex,"filledCircle");var vg=10,Tg=10;async function Px(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<vg&&(t.height=vg),t.width=(t?.width??0)-a-a/2,t.width<Tg&&(t.width=Tg));const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=(t?.width?t?.width:n.width)+(a??0),h=t?.height?t?.height:c+n.height,d=h,u=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:f}=t,p=Vt.svg(s),g=Gt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=rr(u),y=p.path(m,g),x=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),t.width=c,t.height=h,ee(t,x),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(C){return Mt.info("Triangle intersect",t,u,C),Ht.polygon(t,u,C)},s}b(Px,"flippedTriangle");async function Ix(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.padding??12,l=Math.max(a.width+n*2,t.width??0,90),c=a.height+n*2,h=Math.max(Math.min(c*.16,14),8),d=Math.max(c+h,t.height??0),u=d-h,f=Math.max(l*.38,28),p=-d/2,g=[{x:-l/2,y:p},{x:-l/2+f,y:p},{x:-l/2+f,y:p+h},{x:l/2,y:p+h},{x:l/2,y:d/2},{x:-l/2,y:d/2}],m=[`M${g[0].x},${g[0].y}`,...g.slice(1).map(k=>`L${k.x},${k.y}`),"Z"].join(" "),{cssStyles:y}=t;let x;if(t.look==="handDrawn"){const v=Vt.svg(o).path(m,Gt(t,{}));x=o.insert(()=>v,":first-child").attr("class","basic label-container"),y&&x.attr("style",y)}else x=o.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",i);t.look==="handDrawn"?ee(t,x):ee(t,x,{width:l,height:d});const C=p+h+u/2;return s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${C-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(k){return Ht.polygon(t,g,k)},o}b(Ix,"folder");function Ox(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:a}=jt(t);t.label="";const s=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);(r==="LR"||r==="RL")&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,u=Vt.svg(s),f=Gt(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=u.rectangle(h,d,l,c,f),g=s.insert(()=>p,":first-child");n&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",n),a&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",a),ee(t,g);const m=i?.padding??0;return t.width&&t.height&&(t.width+=m/2||0,t.height+=m/2||0),t.intersect=function(y){return Ht.rect(t,y)},s}b(Ox,"forkJoin");async function Dx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=15,a=10,s=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<a&&(t.height=a),t.width=(t?.width??0)-s*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await he(e,t,se(t)),h=(t?.height?t?.height:Math.max(a,c.height))+n*2,d=h/2,u=d-Math.sqrt(Math.max(0,d**2-(c.height/2)**2)),f=(t?.width?t?.width:Math.max(o,c.width)+u*2)+s*2,{cssStyles:p}=t,g=Vt.svg(l),m=Gt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-f/2,y:-h/2},{x:f/2-d,y:-h/2},...Zi(-f/2+d,0,d,50,90,270),{x:f/2-d,y:h/2},{x:-f/2,y:h/2}],x=rr(y),C=g.path(x,m),k=l.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),ee(t,k),t.intersect=function(v){return Mt.info("Pill intersect",t,{radius:d,point:v}),Ht.polygon(t,y,v)},l}b(Dx,"halfRoundedRectangle");var rB=b((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function Rx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const a=t.padding??0,s=70,n=32,l=t.look==="neo"?s:a,c=t.look==="neo"?n:a;if(t.width||t.height){const C=(t.height??0)/o;t.width=(t?.width??0)-2*C-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await he(e,t,se(t)),u=(t?.height?t?.height:d.height)+l,f=u/o,p=(t?.width?t?.width:d.width)+2*f+c,g=[{x:f,y:0},{x:p-f,y:0},{x:p,y:-u/2},{x:p-f,y:-u},{x:f,y:-u},{x:0,y:-u/2}];let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=Vt.svg(h),C=Gt(t,{}),k=rB(0,0,p,u,f),v=x.path(k,C);m=h.insert(()=>v,":first-child").attr("transform",`translate(${-p/2}, ${u/2})`),y&&m.attr("style",y)}else m=no(h,p,u,g);return i&&m.attr("style",i),t.width=p,t.height=u,ee(t,m),t.intersect=function(x){return Ht.polygon(t,g,x)},h}b(Rx,"hexagon");async function Nx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await he(e,t,se(t)),a=Math.max(30,t?.width??0),s=Math.max(30,t?.height??0),{cssStyles:n}=t,l=Vt.svg(o),c=Gt(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=rr(h),u=l.path(d,c),f=o.insert(()=>u,":first-child");return f.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-a/2}, ${-s/2})`),ee(t,f),t.intersect=function(p){return Mt.info("Pill intersect",t,{points:h}),Ht.polygon(t,h,p)},o}b(Nx,"hourglass");async function qx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=jt(t);t.labelStyle=o;const a=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(a,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await he(e,t,"icon-shape default"),u=t.pos==="t",f=n,p=n,{nodeBorder:g}=r,{stylesMap:m}=Zo(t),y=-p/2,x=-f/2,C=t.label?8:0,k=Vt.svg(c),v=Gt(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const M=k.rectangle(y,x,p,f,v),A=Math.max(p,h.width),L=f+h.height+C,T=k.rectangle(-A/2,-L/2,A,L,{...v,fill:"transparent",stroke:"none"}),_=c.insert(()=>M,":first-child"),$=c.insert(()=>T);if(t.icon){const P=c.append("g");P.html(`<g>${await ba(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const D=P.node().getBBox(),F=D.width,E=D.height,B=D.x,q=D.y;P.attr("transform",`translate(${-F/2-B},${u?h.height/2+C/2-E/2-q:-h.height/2-C/2-E/2-q})`),P.attr("style",`color: ${m.get("stroke")??g};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-L/2:L/2-h.height})`),_.attr("transform",`translate(0,${u?h.height/2+C/2:-h.height/2-C/2})`),ee(t,$),t.intersect=function(P){if(Mt.info("iconSquare intersect",t,P),!t.label)return Ht.rect(t,P);const D=t.x??0,F=t.y??0,E=t.height??0;let B=[];return u?B=[{x:D-h.width/2,y:F-E/2},{x:D+h.width/2,y:F-E/2},{x:D+h.width/2,y:F-E/2+h.height+C},{x:D+p/2,y:F-E/2+h.height+C},{x:D+p/2,y:F+E/2},{x:D-p/2,y:F+E/2},{x:D-p/2,y:F-E/2+h.height+C},{x:D-h.width/2,y:F-E/2+h.height+C}]:B=[{x:D-p/2,y:F-E/2},{x:D+p/2,y:F-E/2},{x:D+p/2,y:F-E/2+f},{x:D+h.width/2,y:F-E/2+f},{x:D+h.width/2/2,y:F+E/2},{x:D-h.width/2,y:F+E/2},{x:D-h.width/2,y:F-E/2+f},{x:D-p/2,y:F-E/2+f}],Ht.polygon(t,B,P)},c}b(qx,"icon");async function Wx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=jt(t);t.labelStyle=o;const a=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(a,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await he(e,t,"icon-shape default"),u=20,f=t.label?8:0,p=t.pos==="t",{nodeBorder:g,mainBkg:m}=r,{stylesMap:y}=Zo(t),x=Vt.svg(c),C=Gt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=y.get("fill");C.stroke=k??m;const v=c.append("g");t.icon&&v.html(`<g>${await ba(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const M=v.node().getBBox(),A=M.width,L=M.height,T=M.x,_=M.y,$=Math.max(A,L)*Math.SQRT2+u*2,P=x.circle(0,0,$,C),D=Math.max($,h.width),F=$+h.height+f,E=x.rectangle(-D/2,-F/2,D,F,{...C,fill:"transparent",stroke:"none"}),B=c.insert(()=>P,":first-child"),q=c.insert(()=>E);return v.attr("transform",`translate(${-A/2-T},${p?h.height/2+f/2-L/2-_:-h.height/2-f/2-L/2-_})`),v.attr("style",`color: ${y.get("stroke")??g};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-F/2:F/2-h.height})`),B.attr("transform",`translate(0,${p?h.height/2+f/2:-h.height/2-f/2})`),ee(t,q),t.intersect=function(W){return Mt.info("iconSquare intersect",t,W),Ht.rect(t,W)},c}b(Wx,"iconCircle");async function zx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=jt(t);t.labelStyle=o;const a=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(a,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await he(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,g=n+d*2,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Zo(t),C=-g/2,k=-p/2,v=t.label?8:0,M=Vt.svg(c),A=Gt(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const L=x.get("fill");A.stroke=L??y;const T=M.path(pi(C,k,g,p,5),A),_=Math.max(g,h.width),$=p+h.height+v,P=M.rectangle(-_/2,-$/2,_,$,{...A,fill:"transparent",stroke:"none"}),D=c.insert(()=>T,":first-child").attr("class","icon-shape2"),F=c.insert(()=>P);if(t.icon){const E=c.append("g");E.html(`<g>${await ba(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const B=E.node().getBBox(),q=B.width,W=B.height,O=B.x,R=B.y;E.attr("transform",`translate(${-q/2-O},${f?h.height/2+v/2-W/2-R:-h.height/2-v/2-W/2-R})`),E.attr("style",`color: ${x.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-$/2:$/2-h.height})`),D.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),ee(t,F),t.intersect=function(E){if(Mt.info("iconSquare intersect",t,E),!t.label)return Ht.rect(t,E);const B=t.x??0,q=t.y??0,W=t.height??0;let O=[];return f?O=[{x:B-h.width/2,y:q-W/2},{x:B+h.width/2,y:q-W/2},{x:B+h.width/2,y:q-W/2+h.height+v},{x:B+g/2,y:q-W/2+h.height+v},{x:B+g/2,y:q+W/2},{x:B-g/2,y:q+W/2},{x:B-g/2,y:q-W/2+h.height+v},{x:B-h.width/2,y:q-W/2+h.height+v}]:O=[{x:B-g/2,y:q-W/2},{x:B+g/2,y:q-W/2},{x:B+g/2,y:q-W/2+p},{x:B+h.width/2,y:q-W/2+p},{x:B+h.width/2/2,y:q+W/2},{x:B-h.width/2,y:q+W/2},{x:B-h.width/2,y:q-W/2+p},{x:B-g/2,y:q-W/2+p}],Ht.polygon(t,O,E)},c}b(zx,"iconRounded");async function Hx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=jt(t);t.labelStyle=o;const a=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(a,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await he(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,g=n+d*2,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Zo(t),C=-g/2,k=-p/2,v=t.label?8:0,M=Vt.svg(c),A=Gt(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const L=x.get("fill");A.stroke=L??y;const T=M.path(pi(C,k,g,p,.1),A),_=Math.max(g,h.width),$=p+h.height+v,P=M.rectangle(-_/2,-$/2,_,$,{...A,fill:"transparent",stroke:"none"}),D=c.insert(()=>T,":first-child"),F=c.insert(()=>P);if(t.icon){const E=c.append("g");E.html(`<g>${await ba(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const B=E.node().getBBox(),q=B.width,W=B.height,O=B.x,R=B.y;E.attr("transform",`translate(${-q/2-O},${f?h.height/2+v/2-W/2-R:-h.height/2-v/2-W/2-R})`),E.attr("style",`color: ${x.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-$/2:$/2-h.height})`),D.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),ee(t,F),t.intersect=function(E){if(Mt.info("iconSquare intersect",t,E),!t.label)return Ht.rect(t,E);const B=t.x??0,q=t.y??0,W=t.height??0;let O=[];return f?O=[{x:B-h.width/2,y:q-W/2},{x:B+h.width/2,y:q-W/2},{x:B+h.width/2,y:q-W/2+h.height+v},{x:B+g/2,y:q-W/2+h.height+v},{x:B+g/2,y:q+W/2},{x:B-g/2,y:q+W/2},{x:B-g/2,y:q-W/2+h.height+v},{x:B-h.width/2,y:q-W/2+h.height+v}]:O=[{x:B-g/2,y:q-W/2},{x:B+g/2,y:q-W/2},{x:B+g/2,y:q-W/2+p},{x:B+h.width/2,y:q-W/2+p},{x:B+h.width/2/2,y:q+W/2},{x:B-h.width/2,y:q+W/2},{x:B-h.width/2,y:q-W/2+p},{x:B-g/2,y:q-W/2+p}],Ht.polygon(t,O,E)},c}b(Hx,"iconSquare");async function Yx(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),a=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/a;const{labelStyles:s}=jt(t);t.labelStyle=s;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:u,label:f}=await he(e,t,"image-shape default"),p=t.pos==="t",g=-c/2,m=-h/2,y=t.label?8:0,x=Vt.svg(d),C=Gt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=x.rectangle(g,m,c,h,C),v=Math.max(c,u.width),M=h+u.height+y,A=x.rectangle(-v/2,-M/2,v,M,{...C,fill:"none",stroke:"none"}),L=d.insert(()=>k,":first-child"),T=d.insert(()=>A);if(t.img){const _=d.append("image");_.attr("href",t.img),_.attr("width",c),_.attr("height",h),_.attr("preserveAspectRatio","none"),_.attr("transform",`translate(${-c/2},${p?M/2-h:-M/2})`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-h/2-u.height/2-y/2:h/2-u.height/2+y/2})`),L.attr("transform",`translate(0,${p?u.height/2+y/2:-u.height/2-y/2})`),ee(t,T),t.intersect=function(_){if(Mt.info("iconSquare intersect",t,_),!t.label)return Ht.rect(t,_);const $=t.x??0,P=t.y??0,D=t.height??0;let F=[];return p?F=[{x:$-u.width/2,y:P-D/2},{x:$+u.width/2,y:P-D/2},{x:$+u.width/2,y:P-D/2+u.height+y},{x:$+c/2,y:P-D/2+u.height+y},{x:$+c/2,y:P+D/2},{x:$-c/2,y:P+D/2},{x:$-c/2,y:P-D/2+u.height+y},{x:$-u.width/2,y:P-D/2+u.height+y}]:F=[{x:$-c/2,y:P-D/2},{x:$+c/2,y:P-D/2},{x:$+c/2,y:P-D/2+h},{x:$+u.width/2,y:P-D/2+h},{x:$+u.width/2/2,y:P+D/2},{x:$-u.width/2,y:P+D/2},{x:$-u.width/2,y:P-D/2+h},{x:$-c/2,y:P-D/2+h}],Ht.polygon(t,F,_)},d}b(Yx,"imageSquare");async function Xx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=o,s=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+a*2,t.height??0),h=Math.max(l.width+s*2,(t.width??0)-c),d=[{x:0,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:-3*c/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=Gt(t,{}),m=rr(d),y=p.path(m,g);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=no(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(p){return Ht.polygon(t,d,p)},n}b(Xx,"inv_trapezoid");async function Gx(e,t){const{shapeSvg:r,bbox:i,label:o}=await he(e,t,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ee(t,a),t.intersect=function(l){return Ht.rect(t,l)},r}b(Gx,"labelRect");async function jx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=o,s=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+a,t.height??0),h=Math.max(l.width+s,(t.width??0)-c),d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=Gt(t,{}),m=rr(d),y=p.path(m,g);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=no(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(p){return Ht.polygon(t,d,p)},n}b(jx,"lean_left");async function Ux(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=o,s=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+a,t.height??0),h=Math.max(l.width+s,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=Gt(t,{}),m=rr(d),y=p.path(m,g);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=no(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(p){return Ht.polygon(t,d,p)},n}b(Ux,"lean_right");function Vx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,s=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:s,y:0},{x:0,y:n+l/2},{x:s-2*l,y:n+l/2},{x:0,y:2*n},{x:s,y:n-l/2},{x:2*l,y:n-l/2}],h=Vt.svg(o),d=Gt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=rr(c),f=h.path(u,d),p=o.insert(()=>f,":first-child");return p.attr("class","outer-path"),a&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${s/2},${-n})`),ee(t,p),t.intersect=function(g){return Mt.info("lightningBolt intersect",t,g),Ht.polygon(t,c,g)},o}b(Vx,"lightningBolt");var iB=b((e,t,r,i,o,a,s)=>[`M${e},${t+a}`,`a${o},${a} 0,0,0 ${r},0`,`a${o},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+s}`,`a${o},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),oB=b((e,t,r,i,o,a,s)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${o},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+s}`,`a${o},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),aB=b((e,t,r,i,o,a)=>[`M${e-r/2},${-i/2}`,`a${o},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Mg=10,_g=10;async function Zx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<_g&&(t.width=_g);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<Mg&&(t.height=Mg)}const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=(t?.width?t?.width:l.width)+a*2,d=h/2,u=d/(2.5+h/50),f=(t?.height?t?.height:l.height)+u+s*2,p=f*.1;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=Vt.svg(n),x=oB(0,0,h,f,d,u,p),C=aB(0,u,h,f,d,u),k=Gt(t,{}),v=y.path(x,k),M=y.path(C,k);n.insert(()=>M,":first-child").attr("class","line"),g=n.insert(()=>v,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=iB(0,0,h,f,d,u,p);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Or(m)).attr("style",i)}return g.attr("label-offset-y",u),g.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),ee(t,g),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+u-(l.y-(l.top??0))})`),t.intersect=function(y){const x=Ht.rect(t,y),C=x.x-(t.x??0);if(d!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-u)){let k=u*u*(1-C*C/(d*d));k>0&&(k=Math.sqrt(k)),k=u-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},n}b(Zx,"linedCylinder");async function Kx(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o;if(t.width||t.height){const k=t.width;t.width=(k??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-s*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=(t?.width?t?.width:l.width)+(a??0)*2,d=(t?.height?t?.height:l.height)+(s??0)*2,u=t.look==="neo"?d/4:d/8,f=d+u,{cssStyles:p}=t,g=Vt.svg(n),m=Gt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2-h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:f/2},...Uo(-h/2-h/2*.1,f/2,h/2+h/2*.1,f/2,u,.8),{x:h/2+h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:-f/2},{x:-h/2,y:-f/2},{x:-h/2,y:f/2*1.1},{x:-h/2,y:-f/2}],x=g.polygon(y.map(k=>[k.x,k.y]),m),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),C.attr("transform",`translate(0,${-u/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-u-(l.y-(l.top??0))})`),ee(t,C),t.intersect=function(k){return Ht.polygon(t,y,k)},n}b(Kx,"linedWaveEdgedRect");var sB=56,Xc=72,Bg=8,Lg=2,nB=8,lB={normal:"usecase-actor-shape usecase-actor-normal",hollow:"usecase-actor-hollow",awesome:"usecase-actor-awesome",icon:"usecase-actor-icon"},Ag=Math.PI/3,Fg=.6,Gc=b((e,t)=>{const r=t*Fg,i=t*Math.sqrt(1-Fg**2),o=Math.cos(Ag),a=-Math.sin(Ag),s=r*-a,n=e+r*o,l=i*o,c=i*a;return`M ${s-l} ${n-c} L ${s+l} ${n+c}`},"businessMarkerPathForCircle"),cB={normal:Gc(-24,12),hollow:Gc(-23,9),awesome:Gc(-21,13),icon:"M 12 -8 L 26 -26"},$g=b((e,t,r)=>{const i=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-o})`)},"positionLabel"),uu=b((e,t,r,i,o=!1)=>{if(t.look==="handDrawn"){const n=Vt.svg(e).path(r,Gt(t,o?{fill:"none"}:{}));return e.insert(()=>n,":first-child").attr("class",i)}const a=e.append("path").attr("class",i).attr("d",r);return o&&a.attr("fill","none"),a},"appendActorPath"),hB=b((e,t,r,i,o,a,s=!1)=>{if(t.look==="handDrawn"){const c=Vt.svg(e).circle(r,i,o*2,Gt(t,s?{fill:"none"}:{}));return e.insert(()=>c,":first-child").attr("class",a)}const n=e.append("circle").attr("class",a).attr("cx",r).attr("cy",i).attr("r",o);return s&&n.attr("fill","none"),n},"appendActorCircle"),dB=b((e,t,r)=>{t.business&&e.append("path").attr("class","usecase-business-marker usecase-actor-business-marker").attr("d",cB[r]).attr("fill","none").attr("style","stroke: inherit !important; stroke-width: inherit !important")},"appendBusinessActorMarker");async function pn(e,t,r,i){const{labelStyles:o,nodeStyles:a}=jt(t);t.labelStyle=o;const s=r==="icon"||t.stereotype!==void 0?{...t,icon:r==="icon"?void 0:t.icon,stereotype:void 0}:t,{shapeSvg:n,bbox:l,label:c}=await he(e,s,se(t,`usecase-actor-variant usecase-actor-${r}`)),h=t.accessibleName??t.label;h&&n.attr("role","img").attr("aria-label",h),c.attr("class","label actor-label usecase-actor-label");const{theme:d,themeVariables:u}=Xe();_i(n,t.colorIndex,d,u.borderColorArray);let f,p;if(t.stereotype){const L=await ca(n,`«${t.stereotype}»`,{labelStyle:o,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=L.label.attr("class","label usecase-stereotype"),p=L.bbox}const g=n.append("g").attr("class",`usecase-actor-glyph ${lB[r]}`).attr("style",a||null);await i(g,t),dB(g,t,r);const m=t.padding??nB,y=p?.height??0,x=Xc+Bg+l.height+(p?y+Lg:0),C=Math.max(sB,l.width,p?.width??0)+m*2,k=x+m*2,v=-x/2;g.attr("transform",`translate(0,${v+Xc/2})`);let M=v+Xc+Bg;f&&p&&(M+=y/2,$g(f,p,M),M+=y/2+Lg),$g(c,l,M+l.height/2);const A=n.insert("rect",":first-child").attr("class","usecase-actor-outline").attr("x",-C/2).attr("y",-k/2).attr("width",C).attr("height",k).attr("opacity",0).attr("aria-hidden","true");return ee(t,A),t.intersect=L=>Ht.rect(t,L),n}b(pn,"renderUsecaseActor");var uB=["M 0 -12","C 6.627 -12 12 -17.373 12 -24","C 12 -30.627 6.627 -36 0 -36","C -6.627 -36 -12 -30.627 -12 -24","C -12 -17.373 -6.627 -12 0 -12 Z","M 0 -12 V 8","M -17 -5 H 17","M 0 8 L -15 28","M 0 8 L 15 28"].join(" ");async function Qx(e,t){return pn(e,t,"normal",(r,i)=>{uu(r,i,uB,"usecase-actor-stick")})}b(Qx,"usecaseActor");var fB=["M 0 -34","C 7.18 -34 13 -28.18 13 -21","C 13 -13.82 7.18 -8 0 -8","C -7.18 -8 -13 -13.82 -13 -21","C -13 -28.18 -7.18 -34 0 -34 Z","M -24 25","C -24 7 -14 -3 0 -3","C 14 -3 24 7 24 25","C 24 28 21 30 18 30","H -18","C -21 30 -24 28 -24 25 Z"].join(" ");async function Jx(e,t){return pn(e,t,"awesome",(r,i)=>{uu(r,i,fB,"usecase-actor-awesome-silhouette")})}b(Jx,"usecaseActorAwesome");var gB=["M -22 -10","H 22","V 0","H 6","L 22 17","L 13 28","L 0 13","L -13 28","L -22 17","L -6 0","H -22","Z"].join(" ");async function t0(e,t){return pn(e,t,"hollow",(r,i)=>{hB(r,i,0,-23,9,"usecase-actor-hollow-head",!0),uu(r,i,gB,"usecase-actor-hollow-body",!0)})}b(t0,"usecaseActorHollow");var _a=52,Eg=42,Pg=-2,pB=b(async(e,t)=>{const r=-_a/2,i=Pg-_a/2;if(t.look==="handDrawn"){const h=Vt.svg(e).rectangle(r,i,_a,_a,Gt(t,{}));e.insert(()=>h,":first-child").attr("class","usecase-actor-icon-frame")}else e.append("rect").attr("class","usecase-actor-icon-frame").attr("x",r).attr("y",i).attr("width",_a).attr("height",_a).attr("rx",4).attr("ry",4);const o=t.icon??"",a=await fm(o.includes(":")?o:`fa:${o}`),s=await ba(o,{height:Eg,width:Eg,fallbackPrefix:"fa"}),n=e.append("g").attr("class",`usecase-actor-icon-symbol${a?"":" usecase-actor-icon-fallback"}`).attr("aria-hidden","true").html(`<g>${s}</g>`),l=n.node()?.getBBox();l&&n.attr("transform",`translate(${-l.width/2-l.x},${Pg-l.height/2-l.y})`)},"drawIconActor");async function e0(e,t){return pn(e,t,"icon",pB)}b(e0,"usecaseActorIcon");var Ig=b((e,t,r)=>{const i=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-o})`)},"positionLabel");async function r0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i;const a=r.stereotype?{...t,stereotype:void 0}:t,{shapeSvg:s,bbox:n,halfPadding:l,label:c}=await he(e,a,se(t,"usecase-business-shape"));c.attr("class","label usecase-label");const{theme:h,themeVariables:d}=Xe();_i(s,t.colorIndex,h,d.borderColorArray);let u,f;if(r.stereotype){const D=await ca(s,`«${r.stereotype}»`,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});u=D.label.attr("class","label usecase-stereotype"),f=D.bbox}const p=f?2:0,g=n.height+(f?.height??0)+p,m=Math.max(n.width,f?.width??0),y=l??10,x=m/2+y*2,C=g/2+y*2,k=Math.min(Math.max(y/5,1),y/2),v=m/2+k,M=x-k,A=v/x,L=M/x,T=C*Math.sqrt(Math.max(0,1-A*A)),_=-C*Math.sqrt(Math.max(0,1-L*L));u&&f&&Ig(u,f,-g/2+f.height/2),Ig(c,n,g/2-n.height/2);let $;if(t.look==="handDrawn"){const F=Vt.svg(s).ellipse(0,0,x*2,C*2,Gt(t,{}));$=s.insert(()=>F,":first-child").attr("class","basic label-container usecase-business-ellipse")}else $=s.insert("ellipse",":first-child").attr("class","basic label-container usecase-business-ellipse").attr("style",o).attr("rx",x).attr("ry",C).attr("cx",0).attr("cy",0);s.append("path").attr("class","usecase-business-marker").attr("d",`M ${v} ${T} L ${M} ${_}`).attr("fill","none").attr("style",o||null);const P=r.accessibleName??r.label;return P&&s.attr("role","img").attr("aria-label",P),ee(t,$),t.calcIntersect=(D,F)=>Ht.ellipse(D,D.width/2,D.height/2,F),t.intersect=D=>Ht.ellipse(t,x,C,D),s}b(r0,"usecaseBusiness");var jc=8,Og=4,mB=1,Uc=b((e,t,r,i)=>{const o=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr("transform",`translate(${r-t.width/2-o},${i-t.height/2-a})`)},"positionLabel"),yB=b(e=>{const t=Number.parseFloat(e??"");return Number.isFinite(t)&&t>=0?t:mB},"numericStrokeWidth");async function i0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=jt(t),{stylesMap:a}=Zo(t);t.labelStyle=i;const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t,"usecase-json-table"));s.attr("role","img"),r.accessibleName&&s.attr("aria-label",r.accessibleName),l.attr("class","label usecase-json-title");const c=s.append("g").attr("class","usecase-json-table-grid"),h=[];for(const D of r.jsonRows??[]){const F=await ca(c,D.key,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0}),E=await ca(c,D.value,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0});h.push({key:{label:F.label.attr("class","label usecase-json-key"),bbox:F.bbox},value:{label:E.label.attr("class","label usecase-json-value"),bbox:E.bbox}})}const d=Math.max(0,...h.map(({key:D})=>D.bbox.width))+jc*2,u=Math.max(0,...h.map(({value:D})=>D.bbox.width))+jc*2,f=n.width+jc*2,p=Math.max(f,d+u),g=u+Math.max(0,p-d-u),m=n.height+Og*2,y=h.map(({key:D,value:F})=>Math.max(D.bbox.height,F.bbox.height)+Og*2),x=m+y.reduce((D,F)=>D+F,0),C=yB(a.get("stroke-width")),k=p+C*2,v=x+C*2,M=-p/2,A=-x/2,L=t.look==="handDrawn"?Vt.svg(s):void 0,T=L?Gt(t,{}):void 0,_=b((D,F,E,B,q,W)=>{if(L&&T){const O=L.rectangle(E,B,q,W,T);return D.insert(()=>O,":first-child").attr("class",F)}return D.insert("rect",":first-child").attr("class",F).attr("x",E).attr("y",B).attr("width",q).attr("height",W).attr("style",o)},"insertCell"),$=_(s,"label-container usecase-json-border",-k/2,-v/2,k,v);_(c,"usecase-json-cell usecase-json-title-cell",M,A,p,m),c.node()?.append(l.node()),Uc(l,n,0,A+m/2);let P=A+m;return h.forEach(({key:D,value:F},E)=>{const B=y[E],q=c.append("g").attr("class","usecase-json-row").attr("data-row-index",E).attr("transform",`translate(0,${P})`);_(q,"usecase-json-cell usecase-json-key-cell",M,0,d,B),_(q,"usecase-json-cell usecase-json-value-cell",M+d,0,g,B),q.node()?.append(D.label.node(),F.label.node()),Uc(D.label,D.bbox,M+d/2,B/2),Uc(F.label,F.bbox,M+d+g/2,B/2),P+=B}),ee(t,$),t.intersect=D=>Ht.rect(t,D),s}b(i0,"usecaseJsonTable");async function o0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*n,10),t.height=Math.max((t?.height??0)-s*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await he(e,t,se(t)),d=(t?.width?t?.width:c.width)+a*2+2*n,u=(t?.height?t?.height:c.height)+s*2+2*n,f=d-2*n,p=u-2*n,g=-f/2,m=-p/2,{cssStyles:y}=t,x=Vt.svg(l),C=Gt(t,{}),k=[{x:g-n,y:m+n},{x:g-n,y:m+p+n},{x:g+f-n,y:m+p+n},{x:g+f-n,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m+p-n},{x:g+f+n,y:m+p-n},{x:g+f+n,y:m-n},{x:g+n,y:m-n},{x:g+n,y:m},{x:g,y:m},{x:g,y:m+n}],v=[{x:g,y:m+n},{x:g+f-n,y:m+n},{x:g+f-n,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m},{x:g,y:m}];t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const M=rr(k);let A=x.path(M,C);const L=rr(v);let T=x.path(L,C);t.look!=="handDrawn"&&(A=Rh(A),T=Rh(T));const _=l.insert("g",":first-child");return _.insert(()=>A),_.insert(()=>T),_.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),ee(t,_),t.intersect=function($){return Ht.polygon(t,k,$)},l}b(o0,"multiRect");async function a0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(a.width,t?.width??0)+l*2,u=Math.max(a.height,t?.height??0)+c*3,f=t.look==="neo"?u/4:u/8,p=u+(h?f/2:-f/2),g=-d/2,m=-p/2,y=10,{cssStyles:x}=t,C=Uo(g-y,m+p+y,g+d-y,m+p+y,f,.8),k=C?.[C.length-1],v=[{x:g-y,y:m+y},{x:g-y,y:m+p+y},...C,{x:g+d-y,y:k.y-y},{x:g+d,y:k.y-y},{x:g+d,y:k.y-2*y},{x:g+d+y,y:k.y-2*y},{x:g+d+y,y:m-y},{x:g+y,y:m-y},{x:g+y,y:m},{x:g,y:m},{x:g,y:m+y}],M=[{x:g,y:m+y},{x:g+d-y,y:m+y},{x:g+d-y,y:k.y-y},{x:g+d,y:k.y-y},{x:g+d,y:m},{x:g,y:m}],A=Vt.svg(o),L=Gt(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const T=rr(v),_=A.path(T,L),$=rr(M),P=A.path($,L),D=o.insert(()=>_,":first-child");return D.insert(()=>P),D.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",i),D.attr("transform",`translate(0,${-f/2})`),s.attr("transform",`translate(${-(a.width/2)-y-(a.x-(a.left??0))}, ${-(a.height/2)+y-f-(a.y-(a.top??0))})`),ee(t,D),t.intersect=function(F){return Ht.polygon(t,v,F)},o}b(a0,"multiWaveEdgedRectangle");async function s0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i,t.useHtmlLabels||qr(Mr())||(t.centerLabel=!0);const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,u=-h/2,{cssStyles:f}=t,p=Vt.svg(s),g=Gt(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=p.rectangle(d,u,c,h,g),y=s.insert(()=>m,":first-child");return y.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),f&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",f),o&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ee(t,y),t.intersect=function(x){return Ht.rect(t,x)},s}b(s0,"note");var xB=b((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function n0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a}=await he(e,t,se(t)),s=a.width+(t.padding??0),n=a.height+(t.padding??0),l=s+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=Vt.svg(o),p=Gt(t,{}),g=xB(0,0,l),m=f.path(g,p);d=o.insert(()=>m,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),u&&d.attr("style",u)}else d=no(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),ee(t,d),t.calcIntersect=function(f,p){const g=f.width,m=[{x:g/2,y:0},{x:g,y:-g/2},{x:g/2,y:-g},{x:0,y:-g/2}];return Ht.polygon(f,m,p)},t.intersect=function(f){return this.calcIntersect(t,f)},o}b(n0,"question");async function l0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?21:o??0,s=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=l.width+(t.look==="neo"?a*2:a),d=Math.max(l.height+(t.look==="neo"?s*2:s),t.height??0),u=d/4,p=-Math.max(h,(t.width??0)-u)/2,g=-d/2,m=g/2,y=[{x:p+m,y:g},{x:p,y:0},{x:p+m,y:-g},{x:-p,y:-g},{x:-p,y:g}],{cssStyles:x}=t,C=Vt.svg(n),k=Gt(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=rr(y),M=C.path(v,k),A=n.insert(()=>M,":first-child");return A.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(${-m/2},0)`),c.attr("transform",`translate(${-m/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ee(t,A),t.intersect=function(L){return Ht.polygon(t,y,L)},n}b(l0,"rect_left_inv_arrow");async function c0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const a=e.insert("g").attr("class",o).attr("id",t.domId||t.id),s=a.insert("g"),n=a.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await bo(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(qr(Xe())){const L=h.children[0],T=He(h);d=L.getBoundingClientRect(),T.attr("width",d.width),T.attr("height",d.height)}Mt.info("Text 2",l);const u=l||[],f=h.getBBox(),p=await bo(n,Array.isArray(u)?u.join("<br/>"):u,t.labelStyle,!0,!0),g=p.children[0],m=He(p);d=g.getBoundingClientRect(),m.attr("width",d.width),m.attr("height",d.height);const y=(t.padding||0)/2;He(p).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+y+5)+")"),He(h).attr("transform","translate( "+(d.width<f.width?0:-(f.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")");const x=d.width+(t.padding||0),C=d.height+(t.padding||0),k=-d.width/2-y,v=-d.height/2-y;let M,A;if(t.look==="handDrawn"){const L=Vt.svg(a),T=Gt(t,{}),_=L.path(pi(k,v,x,C,t.rx||0),T),$=L.line(-d.width/2-y,-d.height/2-y+f.height+y,d.width/2+y,-d.height/2-y+f.height+y,T);A=a.insert(()=>(Mt.debug("Rough node insert CXC",_),$),":first-child"),M=a.insert(()=>(Mt.debug("Rough node insert CXC",_),_),":first-child")}else M=s.insert("rect",":first-child"),A=s.insert("line"),M.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),A.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+f.height+y).attr("y2",-d.height/2-y+f.height+y);return ee(t,M),t.intersect=function(L){return Ht.rect(t,L)},a}b(c0,"rectWithTitle");async function h0(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return ms(e,t,o)}b(h0,"roundedRect");var Qo=8;async function d0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?Qo:Qo*2),h=(t?.height??n.height)+a*2,d=c-Qo,u=h,f=Qo-c/2,p=-h/2,{cssStyles:g}=t,m=Vt.svg(s),y=Gt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:f,y:p},{x:f+d,y:p},{x:f+d,y:p+u},{x:f-Qo,y:p+u},{x:f-Qo,y:p},{x:f,y:p},{x:f,y:p+u}],C=m.polygon(x.map(v=>[v.x,v.y]),y),k=s.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path").attr("style",Or(g)),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${Qo/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ee(t,k),t.intersect=function(v){return Ht.rect(t,v)},s}b(d0,"shadedProcess");async function u0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-s*2,10));const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=(t?.width?t?.width:l.width)+a*2,d=((t?.height?t?.height:l.height)+s*2)*1.5,u=h,f=d/1.5,p=-u/2,g=-f/2,{cssStyles:m}=t,y=Vt.svg(n),x=Gt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:p,y:g},{x:p,y:g+f},{x:p+u,y:g+f},{x:p+u,y:g-f/2}],k=rr(C),v=y.path(k,x),M=n.insert(()=>v,":first-child");return M.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",i),M.attr("transform",`translate(0, ${f/4})`),c.attr("transform",`translate(${-u/2+(t.padding??0)-(l.x-(l.left??0))}, ${-f/4+(t.padding??0)-(l.y-(l.top??0))})`),ee(t,M),t.intersect=function(A){return Ht.polygon(t,C,A)},n}b(u0,"slopedRect");async function f0(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o},s=await ms(e,t,a);if(t.colorIndex!==void 0){const{theme:n,themeVariables:l}=Xe();_i(s,t.colorIndex,n,l.borderColorArray)}return s}b(f0,"squareRect");var Wh=50,bB=b((e,t,r)=>{const i=e.height+r,o=i*Math.cos(Math.PI/(2*(Wh-1))),a=Math.sqrt(Math.max(0,o**2-e.height**2));return{w:Math.max(e.width+i/4+t,1.5*i+(i-o),e.width+t+i-a),h:i}},"stadiumDimensions");async function g0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?40:o,s=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),{w:c,h}=bB(l,a,s),d=h/2,{cssStyles:u}=t,f=Vt.svg(n),p=Gt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-c/2+d,y:-h/2},{x:c/2-d,y:-h/2},...Zi(-c/2+d,0,d,Wh,90,270),{x:c/2-d,y:h/2},...Zi(c/2-d,0,d,Wh,270,450)],m=rr(g),y=f.path(m,p),x=n.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),ee(t,x),t.intersect=function(C){return Ht.polygon(t,g,C)},n}b(g0,"stadium");async function p0(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return ms(e,t,r)}b(p0,"state");function m0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i;const{cssStyles:a}=t,{lineColor:s,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=Vt.svg(h),u=Gt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=d.circle(0,0,t.width,{...u,stroke:s,strokeWidth:2}),p=n??l,g=(t.width??0)*5/14,m=d.circle(0,0,g,{...u,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),y=h.insert(()=>f,":first-child");if(y.insert(()=>m),t.look!=="handDrawn"&&y.attr("class","outer-path"),a&&y.selectAll("path").attr("style",a),o&&y.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const x=e.node()?.ownerSVGElement?.id??"",C=x?`${x}-drop-shadow-small`:"drop-shadow-small";y.attr("style",`filter:url(#${C})`)}return ee(t,y),t.intersect=function(x){return Ht.circle(t,(t.width??0)/2,x)},h}b(m0,"stateEnd");function y0(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let s;if(t.look==="handDrawn"){const l=Vt.svg(a).circle(0,0,t.width,Lw(i));s=a.insert(()=>l),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${l})`)}return ee(t,s),t.intersect=function(n){return Ht.circle(t,(t.width??7)/2,n)},a}b(y0,"stateStart");var Ba=8;async function x0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t?.padding??8,a=t.look==="neo"?28:o,s=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.width+2*Ba+a,t.width??0),h=Math.max(l.height+s,t.height??0),d=c-2*Ba,u=h,f=-c/2,p=-h/2,g=[{x:0,y:0},{x:d,y:0},{x:d,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const m=Vt.svg(n),y=Gt(t,{}),x=m.rectangle(f,p,d+16,u,y),C=m.line(f+Ba,p,f+Ba,p+u,y),k=m.line(f+Ba+d,p,f+Ba+d,p+u,y);n.insert(()=>C,":first-child"),n.insert(()=>k,":first-child");const v=n.insert(()=>x,":first-child"),{cssStyles:M}=t;v.attr("class","basic label-container").attr("style",Or(M)),ee(t,v)}else{const m=no(n,d,u,g);i&&m.attr("style",i),ee(t,m)}return t.intersect=function(m){return Ht.polygon(t,g,m)},n}b(x0,"subroutine");var Vc=.2;async function b0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-s*2,10),t.width=Math.max((t?.width??0)-a*2-Vc*(t.height+s*2),10));const{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=(t?.height?t?.height:l.height)+s*2,h=Vc*c,d=Vc*c,f=(t?.width?t?.width:l.width)+a*2+h-h,p=c,g=-f/2,m=-p/2,{cssStyles:y}=t,x=Vt.svg(n),C=Gt(t,{}),k=[{x:g-h/2,y:m},{x:g+f+h/2,y:m},{x:g+f+h/2,y:m+p},{x:g-h/2,y:m+p}],v=[{x:g+f-h/2,y:m+p},{x:g+f+h/2,y:m+p},{x:g+f+h/2,y:m+p-d}];t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const M=rr(k),A=x.path(M,C),L=rr(v),T=x.path(L,{...C,fillStyle:"solid"}),_=n.insert(()=>T,":first-child");return _.insert(()=>A,":first-child"),_.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),ee(t,_),t.intersect=function($){return Ht.polygon(t,k,$)},n}b(b0,"taggedRect");async function C0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=Math.max(a.width+(t.padding??0)*2,t?.width??0),l=Math.max(a.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,u=l+c,{cssStyles:f}=t,p=Vt.svg(o),g=Gt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-n/2-n/2*.1,y:u/2},...Uo(-n/2-n/2*.1,u/2,n/2+n/2*.1,u/2,c,.8),{x:n/2+n/2*.1,y:-u/2},{x:-n/2-n/2*.1,y:-u/2}],y=-n/2+n/2*.1,x=-u/2-d*.4,C=[{x:y+n-h,y:(x+l)*1.3},{x:y+n,y:x+l-d},{x:y+n,y:(x+l)*.9},...Uo(y+n,(x+l)*1.25,y+n-h,(x+l)*1.3,-l*.02,.5)],k=rr(m),v=p.path(k,g),M=rr(C),A=p.path(M,{...g,fillStyle:"solid"}),L=o.insert(()=>A,":first-child");return L.insert(()=>v,":first-child"),L.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-n/2+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-c/2-(a.y-(a.top??0))})`),ee(t,L),t.intersect=function(T){return Ht.polygon(t,m,T)},o}b(C0,"taggedWaveEdgedRectangle");async function w0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a}=await he(e,t,se(t)),s=Math.max(a.width+(t.padding??0),t?.width||0),n=Math.max(a.height+(t.padding??0),t?.height||0),l=-s/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",s).attr("height",n),ee(t,h),t.intersect=function(d){return Ht.rect(t,d)},o}b(w0,"text");var CB=b((e,t,r,i,o,a)=>`M${e},${t}
233
+ a${o},${a} 0,0,1 0,${-i}
234
+ l${r},0
235
+ a${o},${a} 0,0,1 0,${i}
236
+ M${r},${-i}
237
+ a${o},${a} 0,0,0 0,${i}
238
+ l${-r},0`,"createCylinderPathD"),wB=b((e,t,r,i,o,a)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${a} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${a} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),kB=b((e,t,r,i,o,a)=>[`M${e+r/2},${-i/2}`,`a${o},${a} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Dg=5,Rg=10;async function k0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?12:o/2,s=t.height??0;if(t.height&&(t.height=t.height-a,t.height<Dg&&(t.height=Dg)),t.width){const y=s/2/(2.5+s/50);t.width=t.width-a-y*3,t.width<Rg&&(t.width=Rg)}const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=Math.max(t.height??0,l.height)+a,d=h/2,u=d/(2.5+h/50),f=Math.max(t.width??0,l.width)+u+a,{cssStyles:p}=t;let g;if(t.look==="handDrawn"){const m=Vt.svg(n),y=wB(0,0,f,h,u,d),x=kB(0,0,f,h,u,d),C=m.path(y,Gt(t,{})),k=m.path(x,Gt(t,{fill:"none"}));g=n.insert(()=>k,":first-child"),g=n.insert(()=>C,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=CB(0,0,f,h,u,d);g=n.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Or(p)).attr("style",i),g.attr("class","basic label-container outer-path"),p&&g.selectAll("path").attr("style",p),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",u),g.attr("transform",`translate(${-f/2}, ${h/2} )`),c.attr("transform",`translate(${-(l.width/2)-u-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ee(t,g),t.intersect=function(m){const y=Ht.rect(t,m),x=y.y-(t.y??0);if(d!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-u)){let C=u*u*(1-x*x/(d*d));C!=0&&(C=Math.sqrt(Math.abs(C))),C=u-C,m.x-(t.x??0)>0&&(C=-C),y.x+=C}return y},n}b(k0,"tiltedCylinder");async function S0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=(t.look==="neo",o),s=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+a,t.height??0),h=Math.max(l.width+s,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=Vt.svg(n),g=Gt(t,{}),m=rr(d),y=p.path(m,g);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=no(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(p){return Ht.polygon(t,d,p)},n}b(S0,"trapezoid");async function v0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-s*2,t.height<l&&(t.height=l),t.width=(t.width??0)-a*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await he(e,t,se(t)),d=(t?.width?t?.width:h.width)+a*2,u=(t?.height?t?.height:h.height)+s*2,{cssStyles:f}=t,p=Vt.svg(c),g=Gt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-d/2*.8,y:-u/2},{x:d/2*.8,y:-u/2},{x:d/2,y:-u/2*.6},{x:d/2,y:u/2},{x:-d/2,y:u/2},{x:-d/2,y:-u/2*.6}],y=rr(m),x=p.path(y,g),C=c.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),ee(t,C),t.intersect=function(k){return Ht.polygon(t,m,k)},c}b(v0,"trapezoidalPentagon");var Ng=10,qg=10;async function T0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-a)/2,t.width<qg&&(t.width=qg),t.height=t?.height??0,t.height<Ng&&(t.height=Ng));const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=ao(Xe().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+a,d=t?.height?t?.height:h+n.height,u=d,f=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-d}],{cssStyles:p}=t,g=Vt.svg(s),m=Gt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=rr(f),x=g.path(y,m),C=s.insert(()=>x,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return p&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=h,t.height=d,ee(t,C),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(k){return Mt.info("Triangle intersect",t,f,k),Ht.polygon(t,f,k)},s}b(T0,"triangle");async function M0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-s*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await he(e,t,se(t)),d=(t?.width?t?.width:c.width)+(a??0)*2,u=(t?.height?t?.height:c.height)+(s??0)*2,f=t.look==="neo"?u/4:u/8,p=u+(n?f:-f),{cssStyles:g}=t,y=14-d,x=y>0?y/2:0,C=Vt.svg(l),k=Gt(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=[{x:-d/2-x,y:p/2},...Uo(-d/2-x,p/2,d/2+x,p/2,f,.8),{x:d/2+x,y:-p/2},{x:-d/2-x,y:-p/2}],M=rr(v),A=C.path(M,k),L=l.insert(()=>A,":first-child");return L.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(0,${-f/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-u/2+(t.padding??0)-f-(c.y-(c.top??0))})`),ee(t,L),t.intersect=function(T){return Ht.polygon(t,v,T)},l}b(M0,"waveEdgedRectangle");async function _0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const k=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-s-k*(20/9)),t.width=t.width-a*2}const{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=(t?.width?t?.width:l.width)+a*2,h=(t?.height?t?.height:l.height)+s,d=h/8,u=h+d*2,{cssStyles:f}=t,p=Vt.svg(n),g=Gt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-c/2,y:u/2},...Uo(-c/2,u/2,c/2,u/2,d,1),{x:c/2,y:-u/2},...Uo(c/2,-u/2,-c/2,-u/2,d,-1)],y=rr(m),x=p.path(y,g),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",i),ee(t,C),t.intersect=function(k){return Ht.polygon(t,m,k)},n}b(_0,"waveRectangle");var Br=10;async function B0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Br,10),t.height=Math.max((t?.height??0)-a*2-Br,10));const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=(t?.width?t?.width:n.width)+o*2+Br,h=(t?.height?t?.height:n.height)+a*2+Br,d=c-Br,u=h-Br,f=-d/2,p=-u/2,{cssStyles:g}=t,m=Vt.svg(s),y=Gt(t,{}),x=[{x:f-Br,y:p-Br},{x:f-Br,y:p+u},{x:f+d,y:p+u},{x:f+d,y:p-Br}],C=`M${f-Br},${p-Br} L${f+d},${p-Br} L${f+d},${p+u} L${f-Br},${p+u} L${f-Br},${p-Br}
239
+ M${f-Br},${p} L${f+d},${p}
240
+ M${f},${p-Br} L${f},${p+u}`;t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const k=m.path(C,y),v=s.insert(()=>k,":first-child");return v.attr("transform",`translate(${Br/2}, ${Br/2})`),v.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Br/2-(n.x-(n.left??0))}, ${-(n.height/2)+Br/2-(n.y-(n.top??0))})`),ee(t,v),t.intersect=function(M){return Ht.polygon(t,x,M)},s}b(B0,"windowPane");var Wg=new Set(["redux-color","redux-dark-color"]),SB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function fu(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Mr(),{rowEven:a,rowOdd:s,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:et}=Mr(),{background:J}=et,at={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${J}`]};await fu(e,at)}const c=Mr();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:u}=t,{labelStyles:f,nodeStyles:p}=jt(t);if(r.attributes.length===0&&t.label){const et={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};To(t.label,c)+et.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const J=await ms(e,t,et);if(i!=null&&Wg.has(i)){const at=r.colorIndex??0;J.attr("data-color-id",`color-${at%l.length}`)}if(!ao(c.htmlLabels)){const at=J.select("text"),xt=at.node()?.getBBox();at.attr("transform",`translate(${-xt.width/2}, 0)`)}return J}c.htmlLabels||(h*=1.25,d*=1.25);let g=se(t);g||(g="node default");const m=e.insert("g").attr("class",g).attr("id",t.domId||t.id),y=await Pa(m,t.label??"",c,0,0,["name"],f);y.height+=d;let x=0;const C=[],k=[];let v=0,M=0,A=0,L=0,T=!0,_=!0;for(const et of r.attributes){const J=await Pa(m,et.type,c,0,x,["attribute-type"],f);v=Math.max(v,J.width+h);const at=await Pa(m,et.name,c,0,x,["attribute-name"],f);M=Math.max(M,at.width+h);const xt=await Pa(m,et.keys.join(),c,0,x,["attribute-keys"],f);A=Math.max(A,xt.width+h);const H=await Pa(m,et.comment,c,0,x,["attribute-comment"],f);L=Math.max(L,H.width+h);const Y=Math.max(J.height,at.height,xt.height,H.height)+d;k.push({yOffset:x,rowHeight:Y}),x+=Y}let $=4;A<=h&&(T=!1,A=0,$--),L<=h&&(_=!1,L=0,$--);const P=m.node().getBBox();if(y.width+h*2-(v+M+A+L)>0){const et=y.width+h*2-(v+M+A+L);v+=et/$,M+=et/$,A>0&&(A+=et/$),L>0&&(L+=et/$)}const D=v+M+A+L,F=Vt.svg(m),E=Gt(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let B=0;k.length>0&&(B=k.reduce((et,J)=>et+(J?.rowHeight??0),0));const q=Math.max(P.width+h*2,t?.width||0,D),W=Math.max((B??0)+y.height,t?.height||0),O=-q/2,R=-W/2;if(m.selectAll("g:not(:first-child)").each((et,J,at)=>{const xt=He(at[J]),H=xt.attr("transform");let Y=0,Z=0;if(H){const st=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(H);st&&(Y=parseFloat(st[1]),Z=parseFloat(st[2]),xt.attr("class").includes("attribute-name")?Y+=v:xt.attr("class").includes("attribute-keys")?Y+=v+M:xt.attr("class").includes("attribute-comment")&&(Y+=v+M+A))}xt.attr("transform",`translate(${O+h/2+Y}, ${Z+R+y.height+d/2})`)}),m.select(".name").attr("transform","translate("+-y.width/2+", "+(R+d/2)+")"),i!=null&&Wg.has(i)){const et=r.colorIndex??0;m.attr("data-color-id",`color-${et%l.length}`)}const V=F.rectangle(O,R,q,W,E),j=m.insert(()=>V,":first-child").attr("class","outer-path").attr("style",u.join(""));C.push(0);for(const[et,J]of k.entries()){const xt=(et+1)%2===0&&J.yOffset!==0,H=F.rectangle(O,y.height+R+J?.yOffset,q,J?.rowHeight,{...E,fill:xt?a:s,stroke:n});m.insert(()=>H,"g.label").attr("style",u.join("")).attr("class",`row-rect-${xt?"even":"odd"}`)}const z=1e-4;let Q=Ia(O,y.height+R,q+O,y.height+R,z),rt=F.polygon(Q.map(et=>[et.x,et.y]),E);if(m.insert(()=>rt).attr("class","divider"),Q=Ia(v+O,y.height+R,v+O,W+R,z),rt=F.polygon(Q.map(et=>[et.x,et.y]),E),m.insert(()=>rt).attr("class","divider"),T){const et=v+M+O;Q=Ia(et,y.height+R,et,W+R,z),rt=F.polygon(Q.map(J=>[J.x,J.y]),E),m.insert(()=>rt).attr("class","divider")}if(_){const et=v+M+A+O;Q=Ia(et,y.height+R,et,W+R,z),rt=F.polygon(Q.map(J=>[J.x,J.y]),E),m.insert(()=>rt).attr("class","divider")}for(const et of C){const J=y.height+R+et;Q=Ia(O,J,q+O,J,z),rt=F.polygon(Q.map(at=>[at.x,at.y]),E),m.insert(()=>rt).attr("class","divider")}if(ee(t,j),p&&t.look!=="handDrawn")if(i!=null&&SB.has(i))m.selectAll("path").attr("style",p);else{const J=p.split(";")?.filter(at=>at.includes("stroke"))?.map(at=>`${at}`).join("; ");m.selectAll("path").attr("style",J??""),m.selectAll(".row-rect-even path").attr("style",p)}return t.intersect=function(et){return Ht.rect(t,et)},m}b(fu,"erBox");async function Pa(e,t,r,i=0,o=0,a=[],s=""){const n=e.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",s);t!==Cf(t)&&(t=Cf(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=n.node().appendChild(await gi(n,t,{width:To(t,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=l.getBBox();if(ao(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=He(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}b(Pa,"addText");function Ia(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}b(Ia,"lineToPolygon");async function L0(e,t,r,i,o=r.class.padding??12){const a=i?0:3,s=e.insert("g").attr("class",se(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,u=0,f=0;if(n=s.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const x=t.annotations[0];await Ds(n,{text:`«${x}»`},0),d=n.node().getBBox().height}l=s.insert("g").attr("class","label-group text"),await Ds(l,t,0,["font-weight: bolder"]);const p=l.node().getBBox();u=p.height,c=s.insert("g").attr("class","members-group text");let g=0;for(const x of t.members){const C=await Ds(c,x,g,[x.parseClassifier()]);g+=C+a}f=c.node().getBBox().height,f<=0&&(f=o/2),h=s.insert("g").attr("class","methods-group text");let m=0;for(const x of t.methods){const C=await Ds(h,x,m,[x.parseClassifier()]);m+=C+a}let y=s.node().getBBox();if(n!==null){const x=n.node().getBBox();n.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-p.width/2}, ${d})`),y=s.node().getBBox(),c.attr("transform",`translate(0, ${d+u+o*2})`),y=s.node().getBBox(),h.attr("transform",`translate(0, ${d+u+(f?f+o*4:o*2)})`),y=s.node().getBBox(),{shapeSvg:s,bbox:y}}b(L0,"textHelper");async function Ds(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),a=Mr();let s="useHtmlLabels"in t?t.useHtmlLabels:ao(a.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!s&&n.startsWith("\\")&&(n=n.substring(1)),Qs(n)&&(s=!0);const l=await gi(o,Td(Go(n)),{width:To(n,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a);let c,h=1;if(s){const d=l.children[0],u=He(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1),await lu(d),c=d.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}else{i.includes("font-weight: bolder")&&He(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes("&gt"))&&(d.textContent=n[0]+n.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}b(Ds,"addText");async function A0(e,t){const r=Xe(),{theme:i,themeVariables:o}=r,{useGradient:a,borderColorArray:s}=o,n=r.class.padding??12,l=n,c=t.useHtmlLabels??ao(r.htmlLabels)??!0,h=t;h.annotations=h.annotations??[],h.members=h.members??[],h.methods=h.methods??[];const{shapeSvg:d,bbox:u}=await L0(e,t,r,c,l);_i(d,t.colorIndex,i,s);const{labelStyles:f,nodeStyles:p}=jt(t);t.labelStyle=f,t.cssStyles=h.styles||"";const g=h.styles?.join(";")||p||"";t.cssStyles||(t.cssStyles=g.replaceAll("!important","").split(";"));const m=h.members.length===0&&h.methods.length===0&&!r.class?.hideEmptyMembersBox,y=Vt.svg(d),x=Gt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=Math.max(t.width??0,u.width);let k=Math.max(t.height??0,u.height);const v=(t.height??0)>u.height;h.members.length===0&&h.methods.length===0?k+=l:h.members.length>0&&h.methods.length===0&&(k+=l*2);const M=-C/2,A=-k/2;let L=m?n*2:h.members.length===0&&h.methods.length===0?-n:0;v&&(L=n*2);const T=y.rectangle(M-n,A-n-(m?n:h.members.length===0&&h.methods.length===0?-n/2:0),C+2*n,k+2*n+L,x),_=d.insert(()=>T,":first-child");_.attr("class","basic label-container outer-path");const $=_.node().getBBox(),P=d.select(".annotation-group").node().getBBox().height-(m?n/2:0)||0,D=d.select(".label-group").node().getBBox().height-(m?n/2:0)||0,F=d.select(".members-group").node().getBBox().height-(m?n/2:0)||0,E=(P+D+A+n-(A-n-(m?n:h.members.length===0&&h.methods.length===0?-n/2:0)))/2;if(d.selectAll(".text").each((B,q,W)=>{const O=He(W[q]),R=O.attr("transform");let V=0;if(R){const rt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);rt&&(V=parseFloat(rt[2]))}let j=V+A+n-(m?n:h.members.length===0&&h.methods.length===0?-n/2:0);if(O.attr("class").includes("methods-group")){const Q=Math.max(F,l/2);v?j=Math.max(E,P+D+Q+A+l*2+n)+l*2:j=P+D+Q+A+l*4+n}h.members.length===0&&h.methods.length===0&&r.class?.hideEmptyMembersBox&&(h.annotations.length>0?j=V-l:j=V),c||(j-=4);let z=M;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(z=-O.node()?.getBBox().width/2||0,d.selectAll("text").each(function(Q,rt,et){window.getComputedStyle(et[rt]).textAnchor==="middle"&&(z=0)})),O.attr("transform",`translate(${z}, ${j})`)}),h.members.length>0||h.methods.length>0||m){const B=P+D+A+n,q=y.line($.x,B,$.x+$.width,B+.001,x);d.insert(()=>q).attr("class",`divider${t.look==="neo"&&!a?" neo-line":""}`).attr("style",g)}if(m||h.members.length>0||h.methods.length>0){const B=P+D+F+A+l*2+n,q=y.line($.x,v?Math.max(E,B):B,$.x+$.width,(v?Math.max(E,B):B)+.001,x);d.insert(()=>q).attr("class",`divider${t.look==="neo"&&!a?" neo-line":""}`).attr("style",g)}if(h.look!=="handDrawn"&&d.selectAll("path").attr("style",g),_.select(":nth-child(2)").attr("style",g),d.selectAll(".divider").select("path").attr("style",g),t.labelStyle?d.selectAll("span").attr("style",t.labelStyle):d.selectAll("span").attr("style",g),!c){const B=RegExp(/color\s*:\s*([^;]*)/),q=B.exec(g);if(q){const W=q[0].replace("color","fill");d.selectAll("tspan").attr("style",W)}else if(f){const W=B.exec(f);if(W){const O=W[0].replace("color","fill");d.selectAll("tspan").attr("style",O)}}}return ee(t,_),t.intersect=function(B){return Ht.rect(t,B)},d}b(A0,"classBox");async function F0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const o=t,a=t,s=20,n=20,l="verifyMethod"in t,c=se(t),h=Xe(),{themeVariables:d}=h,{borderColorArray:u,requirementEdgeLabelBackground:f}=d,p=h.layout==="elk"?"start":"center",g=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let m;l?m=await Ui(g,`&lt;&lt;${o.type}&gt;&gt;`,0,t.labelStyle):m=await Ui(g,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let y=m;const x=await Ui(g,o.name,y,t.labelStyle+"; font-weight: bold;");if(y+=x+n,l){const $=await Ui(g,`${o.requirementId?`ID: ${o.requirementId}`:""}`,y,t.labelStyle,p);y+=$;const P=await Ui(g,`${o.text?`Text: ${o.text}`:""}`,y,t.labelStyle,p);y+=P;const D=await Ui(g,`${o.risk?`Risk: ${o.risk}`:""}`,y,t.labelStyle,p);y+=D,await Ui(g,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,y,t.labelStyle,p)}else{const $=await Ui(g,`${a.type?`Type: ${a.type}`:""}`,y,t.labelStyle,p);y+=$,await Ui(g,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,y,t.labelStyle,p)}const C=(g.node()?.getBBox().width??200)+s,k=(g.node()?.getBBox().height??200)+s,v=-C/2,M=-k/2,A=Vt.svg(g),L=Gt(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const T=A.rectangle(v,M,C,k,L),_=g.insert(()=>T,":first-child");if(_.attr("class","basic label-container outer-path").attr("style",i),u?.length){const $=t.colorIndex??0;g.attr("data-color-id",`color-${$%u.length}`)}if(g.selectAll(".label").each(($,P,D)=>{const F=He(D[P]),E=F.attr("transform");let B=0,q=0;if(E){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(E);V&&(B=parseFloat(V[1]),q=parseFloat(V[2]))}const W=q-k/2;let O=v+s/2;(P===0||P===1)&&(O=B),F.attr("transform",`translate(${O}, ${W+s})`)}),y>m+x+n){const $=M+m+x+n;let P;if(t.look==="neo"){const E=[[v,$],[v+C,$],[v+C,$+.001],[v,$+.001]];P=A.polygon(E,L)}else P=A.line(v,$,v+C,$,L);g.insert(()=>P).attr("class","divider")}return ee(t,_),t.intersect=function($){return Ht.rect(t,$)},i&&t.look!=="handDrawn"&&(f||u?.length)&&g.selectAll("path").attr("style",i),g}b(F0,"requirementBox");async function Ui(e,t,r,i="",o="center"){if(t==="")return 0;const a=e.insert("g").attr("class","label").attr("style",i),s=Xe(),n=s.htmlLabels??!0,l=await gi(a,Td(Go(t)),{width:To(t,s)+50,classes:"markdown-node-label",useHtmlLabels:n,style:i},s);let c;if(n){const h=l.children[0],d=He(l);o==="start"&&He(h).style("text-align","left"),c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}else{const h=l.children[0];for(const d of h.children)i&&d.setAttribute("style",i);if(o==="start"){h.setAttribute("text-anchor","start");for(const d of h.children)d.setAttribute("text-anchor","start")}c=l.getBBox(),c.height+=6}return a.attr("transform",`translate(${-c.width/2},${-c.height/2+r})`),c.height}b(Ui,"addText");var vB=b(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function $0(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i||"";const a=10,s=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=t.padding||10;let d="",u;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,g;u?{label:p,bbox:g}=await ca(u,"ticket"in t&&t.ticket||"",f):{label:p,bbox:g}=await ca(n,"ticket"in t&&t.ticket||"",f);const{label:m,bbox:y}=await ca(n,"assigned"in t&&t.assigned||"",f);t.width=s;const x=10,C=t?.width||0,k=Math.max(g.height,y.height)/2,v=Math.max(l.height+x*2,t?.height||0)+k,M=-C/2,A=-v/2;c.attr("transform","translate("+(h-C/2)+", "+(-k-l.height/2)+")"),p.attr("transform","translate("+(h-C/2)+", "+(-k+l.height/2)+")"),m.attr("transform","translate("+(h+C/2-y.width-2*a)+", "+(-k+l.height/2)+")");let L;const{rx:T,ry:_}=t,{cssStyles:$}=t;if(t.look==="handDrawn"){const P=Vt.svg(n),D=Gt(t,{}),F=T||_?P.path(pi(M,A,C,v,T||0),D):P.rectangle(M,A,C,v,D);L=n.insert(()=>F,":first-child"),L.attr("class","basic label-container").attr("style",$||null)}else{L=n.insert("rect",":first-child"),L.attr("class","basic label-container __APA__").attr("style",o).attr("rx",T??5).attr("ry",_??5).attr("x",M).attr("y",A).attr("width",C).attr("height",v);const P="priority"in t&&t.priority;if(P){const D=n.append("line"),F=M+2,E=A+Math.floor((T??0)/2),B=A+v-Math.floor((T??0)/2);D.attr("x1",F).attr("y1",E).attr("x2",F).attr("y2",B).attr("stroke-width","4").attr("stroke",vB(P))}}return ee(t,L),t.height=v,t.intersect=function(P){return Ht.rect(t,P)},n}b($0,"kanbanItem");async function E0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,halfPadding:s,label:n}=await he(e,t,se(t)),l=a.width+10*s,c=a.height+8*s,h=.15*l,{cssStyles:d}=t,u=a.width+20,f=a.height+20,p=Math.max(l,u),g=Math.max(c,f);n.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let m;const y=`M0 0
241
+ a${h},${h} 1 0,0 ${p*.25},${-1*g*.1}
242
+ a${h},${h} 1 0,0 ${p*.25},0
243
+ a${h},${h} 1 0,0 ${p*.25},0
244
+ a${h},${h} 1 0,0 ${p*.25},${g*.1}
245
+
246
+ a${h},${h} 1 0,0 ${p*.15},${g*.33}
247
+ a${h*.8},${h*.8} 1 0,0 0,${g*.34}
248
+ a${h},${h} 1 0,0 ${-1*p*.15},${g*.33}
249
+
250
+ a${h},${h} 1 0,0 ${-1*p*.25},${g*.15}
251
+ a${h},${h} 1 0,0 ${-1*p*.25},0
252
+ a${h},${h} 1 0,0 ${-1*p*.25},0
253
+ a${h},${h} 1 0,0 ${-1*p*.25},${-1*g*.15}
254
+
255
+ a${h},${h} 1 0,0 ${-1*p*.1},${-1*g*.33}
256
+ a${h*.8},${h*.8} 1 0,0 0,${-1*g*.34}
257
+ a${h},${h} 1 0,0 ${p*.1},${-1*g*.33}
258
+ H0 V0 Z`;if(t.look==="handDrawn"){const x=Vt.svg(o),C=Gt(t,{}),k=x.path(y,C);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Or(d))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return m.attr("transform",`translate(${-p/2}, ${-g/2})`),ee(t,m),t.calcIntersect=function(x,C){return Ht.rect(x,C)},t.intersect=function(x){return Mt.info("Bang intersect",t,x),Ht.rect(t,x)},o}b(E0,"bang");async function P0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,halfPadding:s,label:n}=await he(e,t,se(t)),l=a.width+2*s,c=a.height+2*s,h=.15*l,d=.25*l,u=.35*l,f=.2*l,{cssStyles:p}=t;let g;const m=`M0 0
259
+ a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
260
+ a${u},${u} 1 0,1 ${l*.4},${-1*l*.1}
261
+ a${d},${d} 1 0,1 ${l*.35},${l*.2}
262
+
263
+ a${h},${h} 1 0,1 ${l*.15},${c*.35}
264
+ a${f},${f} 1 0,1 ${-1*l*.15},${c*.65}
265
+
266
+ a${d},${h} 1 0,1 ${-1*l*.25},${l*.15}
267
+ a${u},${u} 1 0,1 ${-1*l*.5},0
268
+ a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
269
+
270
+ a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
271
+ a${f},${f} 1 0,1 ${l*.1},${-1*c*.65}
272
+ H0 V0 Z`;if(t.look==="handDrawn"){const y=Vt.svg(o),x=Gt(t,{}),C=y.path(m,x);g=o.insert(()=>C,":first-child"),g.attr("class","basic label-container").attr("style",Or(p))}else g=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",m);return n.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),g.attr("transform",`translate(${-l/2}, ${-c/2})`),ee(t,g),t.calcIntersect=function(y,x){return Ht.rect(y,x)},t.intersect=function(y){return Mt.info("Cloud intersect",t,y),Ht.rect(t,y)},o}b(P0,"cloud");async function I0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,halfPadding:s,label:n}=await he(e,t,se(t)),l=a.width+8*s,c=a.height+2*s,h=5,d=t.look==="neo"?`
273
+ M${-l/2} ${c/2-h}
274
+ v${-c+2*h}
275
+ q0,-${h} ${h},-${h}
276
+ h${l-2*h}
277
+ q${h},0 ${h},${h}
278
+ v${c-h}
279
+ H${-l/2}
280
+ Z
281
+ `:`
282
+ M${-l/2} ${c/2-h}
283
+ v${-c+2*h}
284
+ q0,-${h} ${h},-${h}
285
+ h${l-2*h}
286
+ q${h},0 ${h},${h}
287
+ v${c-2*h}
288
+ q0,${h} ${-h},${h}
289
+ h${-(l-2*h)}
290
+ q${-h},0 ${-h},${-h}
291
+ Z
292
+ `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),o.append(()=>n.node()),ee(t,u),t.calcIntersect=function(f,p){return Ht.rect(f,p)},t.intersect=function(f){return Ht.rect(t,f)},o}b(I0,"defaultMindmapNode");async function O0(e,t){const r={padding:t.padding??0};return du(e,t,r)}b(O0,"mindmapCircle");var La=36,Jo=50,TB=100,MB=80,Vo=6,Da=16,_B="bpmn",BB={start:{rings:1,strokeWidth:1.6},intermediate:{rings:2,strokeWidth:1.4},boundary:{rings:2,strokeWidth:1.4},end:{rings:1,strokeWidth:3.4}},zg;async function D0(){return zg??=je(async()=>{const{bpmnIcons:e}=await import("./ByGoYv9M.js");return{bpmnIcons:e}},[],import.meta.url).then(({bpmnIcons:e})=>{Jw(e.prefix)||dm([{name:e.prefix,icons:e}])}),zg}b(D0,"ensureBpmnIcons");function R0(e){const t=e.metadata?.dataDirection;return t==="input"||t==="output"?t:void 0}b(R0,"dataDirectionOf");function N0(e){return e.metadata?.isCollection===!0}b(N0,"isCollectionData");async function Fl(e,t){return await D0(),ba(e,{height:t,width:t,fallbackPrefix:_B})}b(Fl,"glyphSvg");var mn=b((e,t,r)=>{const i=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-o})`)},"positionLabelBelow"),q0=b(async(e,t,r)=>{if(!t)return;const i=e.append("g").attr("class","bpmn-glyph");i.html(`<g>${await Fl(t,r)}</g>`),i.attr("transform",`translate(${-r/2}, ${-r/2})`)},"appendGlyph"),yn=b((e,t,r,i,o)=>{o&&(t.metadata={...t.metadata??{},drawnExtent:o});const a=e.insert("rect",":first-child").attr("class","bpmn-bounds").attr("x",-r/2).attr("y",-i/2).attr("width",r).attr("height",i).attr("opacity",0).attr("aria-hidden","true");return ee(t,a),a},"reserveBounds"),LB=8,$l=b((e,t,r)=>Math.min(Math.max(e,t),r),"clamp"),Ql=b((e,t,r,i,o)=>{const a=e.x??0,s=e.y??0,n=t/2,l=r/2,c=i.x-a,h=i.y-s,d=o??(Math.abs(c)*l>Math.abs(h)*n?c>=0?"right":"left":h>=0?"bottom":"top"),u=b(f=>Math.max(0,f-Math.min(LB,f/2)),"reach");return d==="left"||d==="right"?{x:a+(d==="right"?n:-n),y:$l(i.y,s-u(l),s+u(l))}:{x:$l(i.x,a-u(n),a+u(n)),y:s+(d==="bottom"?l:-l)}},"faceProjectIntersect"),AB=b((e,t,r)=>{const i=e.x??0,o=e.y??0,a=t/2,s=r.x-i,n=r.y-o,l=a*.85;if(Math.abs(n)>=Math.abs(s)){const h=$l(s,-l,l);return{x:i+h,y:o+Math.sign(n||1)*Math.sqrt(a*a-h*h)}}const c=$l(n,-l,l);return{x:i+Math.sign(s||1)*Math.sqrt(a*a-c*c),y:o+c}},"ringIntersect"),FB=b((e,t,r,i)=>{const o=e.x??0,a=e.y??0,s=t/2,n=r/2,l=i.x-o,c=i.y-a;return Math.abs(l)*n>Math.abs(c)*s?{x:o+Math.sign(l)*s,y:a}:{x:o,y:a+Math.sign(c||1)*n}},"faceCentreIntersect");async function xn(e,t,r){const i=t,{labelStyles:o,nodeStyles:a}=jt(t);t.labelStyle=o;const{rings:s,strokeWidth:n}=BB[r],l=La/2,{shapeSvg:c,bbox:h,label:d}=await he(e,t,se(t,`bpmn-event bpmn-event-${r}`)),u=c.insert("g",":first-child").attr("class","bpmn-event-body");u.attr("style",a);for(let y=0;y<s;y++)u.append("circle").attr("class",y===0?"bpmn-event-ring":"bpmn-event-ring bpmn-event-ring-inner").attr("r",l-y*3).style("stroke-width",`${n}px`);await q0(u,i.icon,Da);const f=h.height>0&&!!t.label,p=f?Vo+h.height:0,g=La+2*p,m=Math.max(La,f?h.width:0);return f&&mn(d,h,l+Vo+h.height/2),yn(c,t,m,g,{width:La,height:La}),t.intersect=function(y){return AB(t,La,y)},c}b(xn,"renderBpmnEvent");async function W0(e,t){return xn(e,t,"start")}b(W0,"bpmnStart");async function z0(e,t){return xn(e,t,"intermediate")}b(z0,"bpmnIntermediate");async function H0(e,t){return xn(e,t,"boundary")}b(H0,"bpmnBoundary");async function Y0(e,t){return xn(e,t,"end")}b(Y0,"bpmnEnd");async function X0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i;const a=Jo/2,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t,"bpmn-gateway")),c=s.insert("g",":first-child").attr("class","bpmn-gateway-body");c.append("polygon").attr("class","bpmn-gateway-diamond").attr("points",`0,${-a} ${a},0 0,${a} ${-a},0`).attr("style",o),await q0(c,r.icon,Da+2);const h=n.height>0&&!!t.label,d=h?Vo+n.height:0,u=Jo+2*d,f=Math.max(Jo,h?n.width:0);return h&&mn(l,n,a+Vo+n.height/2),yn(s,t,f,u,{width:Jo,height:Jo}),t.intersect=function(p){return FB(t,Jo,Jo,p)},s}b(X0,"bpmnGateway");async function G0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=jt(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t,"bpmn-activity")),l=r.markers??[],c=r.icon,h=c?Da+6:10,d=l.length>0?Da+4:10,u=Math.max(TB,s.width+16),f=Math.max(MB,s.height+h+d),p=a.insert("g",":first-child").attr("class","bpmn-activity-body");if(p.append("rect").attr("class","bpmn-activity-rect").attr("x",-u/2).attr("y",-f/2).attr("width",u).attr("height",f).attr("rx",10).attr("ry",10).attr("style",o),c){const g=p.append("g").attr("class","bpmn-activity-icon");g.html(`<g>${await Fl(c,Da)}</g>`),g.attr("transform",`translate(${-u/2+6}, ${-f/2+6})`)}if(l.length>0){const g=p.append("g").attr("class","bpmn-activity-markers"),m=Da-2,y=l.length*m;for(const[x,C]of l.entries()){const k=g.append("g");k.html(`<g>${await Fl(C,m)}</g>`),k.attr("transform",`translate(${-y/2+x*m}, 0)`)}g.attr("transform",`translate(0, ${f/2-m-3})`)}if(s.height>0){const g=-f/2+h,m=f/2-d;mn(n,s,(g+m)/2)}return ee(t,p),t.intersect=function(g){return Ql(t,u,f,g)},a}b(G0,"bpmnActivity");var _s=36,Aa=50,En=10;async function j0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t,"bpmn-data-object")),n=o.insert("g",":first-child").attr("class","bpmn-data-body"),l=-_s/2,c=-Aa/2,h=_s/2,d=Aa/2;n.append("path").attr("class","bpmn-data-page").attr("d",`M${l},${c} H${h-En} L${h},${c+En} V${d} H${l} Z`).attr("style",i),n.append("path").attr("class","bpmn-data-fold").attr("d",`M${h-En},${c} V${c+En} H${h}`);const u=R0(t);u&&n.append("path").attr("class",`bpmn-data-arrow bpmn-data-arrow-${u}`).attr("d",`M${l+4},${c+9} h7 v-3 l5,4.5 -5,4.5 v-3 h-7 Z`),N0(t)&&n.append("path").attr("class","bpmn-data-collection").attr("d",`M-4,${d-11} v9 M0,${d-11} v9 M4,${d-11} v9`);const f=a.height>0&&!!t.label,p=f?Vo+a.height:0,g=Aa+2*p,m=Math.max(_s,f?a.width:0);return f&&mn(s,a,Aa/2+Vo+a.height/2),yn(o,t,m,g,{width:_s,height:Aa}),t.intersect=function(y){return Ql(t,_s,Aa,y)},o}b(j0,"bpmnDataObject");var Xi=50;async function U0(e,t){const{labelStyles:r,nodeStyles:i}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t,"bpmn-data-store")),n=o.insert("g",":first-child").attr("class","bpmn-data-body"),l=Xi/2,c=6;n.append("path").attr("class","bpmn-store-body").attr("d",`M${-l},${-l+c} a${l},${c} 0 0 1 ${Xi},0 V${l-c} a${l},${c} 0 0 1 ${-Xi},0 Z`).attr("style",i);for(const p of[0,5,10])n.append("path").attr("class","bpmn-store-rings").attr("d",`M${-l},${-l+c+p} a${l},${c} 0 0 0 ${Xi},0`);const h=a.height>0&&!!t.label,d=h?Vo+a.height:0,u=Xi+2*d,f=Math.max(Xi,h?a.width:0);return h&&mn(s,a,l+Vo+a.height/2),yn(o,t,f,u,{width:Xi,height:Xi}),t.intersect=function(p){return Ql(t,Xi,Xi,p)},o}b(U0,"bpmnDataStore");async function V0(e,t){const{labelStyles:r}=jt(t);t.labelStyle=r,t.wrappingWidth=160;const{shapeSvg:i,bbox:o,label:a}=await he(e,t,se(t,"bpmn-annotation")),s=8,n=Math.max(28,o.height+s*2),l=o.width+s*2+6,c=t.metadata?.attachFace==="right"?"right":"left";i.insert("g",":first-child").attr("class","bpmn-annotation-body").append("path").attr("class","bpmn-annotation-bracket").attr("d",c==="right"?`M${l/2-6},${-n/2} h6 V${n/2} h-6`:`M${-l/2+6},${-n/2} h-6 V${n/2} h6`);const d=c==="right"?-l/2+s:-l/2+s+6;return a.attr("transform",`translate(${d-(o.x??0)+(o.left??0)},${-o.height/2-((o.y??0)-(o.top??0))})`),yn(i,t,l,n),t.intersect=function(u){return Ql(t,l,n,u,c)},i}b(V0,"bpmnAnnotation");var $B=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:f0},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:h0},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:g0},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:x0},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Bx},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Lx},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:Ix},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:ux},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Cx},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:mx},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:_x},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:du},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:E0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:P0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:n0},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Rx},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Ux},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:jx},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:S0},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Xx},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Fx},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:w0},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:yx},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:d0},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:y0},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:m0},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Ox},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Nx},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Sx},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:vx},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Tx},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Vx},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:M0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Dx},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:k0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Zx},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Mx},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Ax},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:T0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:B0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Ex},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:v0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Px},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:u0},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:a0},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:o0},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:dx},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:kx},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:C0},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:b0},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:_0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:l0},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Kx}],EB=b(()=>{const t=[...Object.entries({state:p0,choice:xx,note:s0,composite:bx,rectWithTitle:c0,labelRect:Gx,block_arrow:px,collapsedGroup:gx,iconSquare:Hx,iconCircle:Wx,icon:qx,iconRounded:zx,imageSquare:Yx,anchor:cx,kanbanItem:$0,mindmapCircle:O0,defaultMindmapNode:I0,classBox:A0,erBox:fu,requirementBox:F0,usecaseActor:Qx,usecaseActorHollow:t0,usecaseActorAwesome:Jx,usecaseActorIcon:e0,usecaseBusiness:r0,usecaseEllipse:$x,usecaseJsonTable:i0,"bpmn-start":W0,"bpmn-intermediate":z0,"bpmn-boundary":H0,"bpmn-end":Y0,"bpmn-gateway":X0,"bpmn-activity":G0,"bpmn-data":j0,"bpmn-data-store":U0,"bpmn-annotation":V0}),...$B.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Z0=EB();function PB(e){return e in Z0}b(PB,"isValidShape");var bn=b(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),Jl=new Map;async function K0(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const a=t.shape?Z0[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let s;r.config.securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s??null),o=await a(i,t,r)}else o=await a(e,t,r),i=o;return i.attr("data-look",Or(t.look)),t.tooltip&&o.attr("title",t.tooltip),Jl.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}b(K0,"insertNode");var kI=b((e,t)=>{Jl.set(t.id,e)},"setNodeElem"),SI=b(()=>{Jl.clear()},"clear"),vI=b(e=>{const t=Jl.get(e.id);Mt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),Q0=b(async(e,t,{variant:r="swimlane"}={})=>{const i=r==="pool",o=i?"pool swimlane":"swimlane",a=i?"pool-label swimlane-label":"swimlane-label",s=i?"pool-title swimlane-title":"swimlane-title",n=i?"pool-body swimlane-body":"swimlane-body",l=Xe(),{theme:c,themeVariables:h,handDrawnSeed:d}=l,{clusterBkg:u,clusterBorder:f,borderColorArray:p}=h,g=f,{labelStyles:m,nodeStyles:y,borderStyles:x,backgroundStyles:C}=jt(t),k=e.insert("g").attr("class","cluster "+o+" "+(t.cssClasses||"")).attr("id",t.domId??t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look);_i(k,t.colorIndex,c,p);const v=ao(l.flowchart.htmlLabels),M=t.direction==="LR",A=k.insert("g").attr("class","cluster-label "+a),L=await gi(A,t.label,{style:t.labelStyle,useHtmlLabels:v,isNode:!0,width:t.width});let T=L.getBBox();if(v){const V=L.children[0],j=He(L);T=V.getBoundingClientRect(),j.attr("width",T.width),j.attr("height",T.height)}const _=t.padding??0,$=t.width<=T.width+_?T.width+_:t.width;t.width<=T.width+_?t.diff=($-t.width)/2-_:t.diff=-_;const P=t.height,D=t.y-P/2,F=t.y+P/2,E=t.x-$/2,B=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:D+P/3,q=M?4:0,W=T.height+2*q;let O,R;if(M){const V=Math.max(W,T.height+2*q),j=E+V,z=Math.max(0,$-V);if(t.look==="handDrawn"){const et=Vt.svg(k),J=Gt(t,{roughness:.7,fill:u,stroke:g,seed:d}),at=Gt(t,{roughness:.7,fill:"none",stroke:g,seed:d}),xt=et.rectangle(E,D,V,P,J);O=k.insert(()=>xt,":first-child").attr("class",s);const H=et.rectangle(j,D,z,P,at);R=k.insert(()=>H,":first-child").attr("class",n),O.select("path:nth-child(2)").attr("style",x.join(";")),O.select("path").attr("style",C.join(";").replace("fill","stroke"))}else O=k.insert("rect",":first-child"),R=k.insert("rect",":first-child"),O.attr("class",s).attr("style",y).attr("x",E).attr("y",D).attr("width",V).attr("height",P).attr("fill",u).attr("stroke",g),R.attr("class",n).attr("style",y).attr("x",j).attr("y",D).attr("width",z).attr("height",P).attr("fill","none").attr("stroke",g);const Q=E+V/2,rt=t.y;A.attr("transform",`translate(${Q}, ${rt}) rotate(-90) translate(${-T.width/2}, ${-T.height/2})`)}else{const V=Math.max(0,B-D),j=Math.min(W,V),z=D+j,Q=Math.max(0,F-z),rt=t.x-$/2;if(t.look==="handDrawn"){const at=Vt.svg(k),xt=Gt(t,{roughness:.7,fill:u,stroke:g,fillWeight:3,seed:d}),H=Gt(t,{roughness:.7,fill:"none",stroke:g,seed:d}),Y=at.rectangle(rt,D,$,j,xt);O=k.insert(()=>Y,":first-child").attr("class",s);const Z=at.rectangle(rt,z,$,Q,H);R=k.insert(()=>Z,":first-child").attr("class",n),O.select("path:nth-child(2)").attr("style",x.join(";")),O.select("path").attr("style",C.join(";").replace("fill","stroke"))}else O=k.insert("rect",":first-child"),R=k.insert("rect",":first-child"),O.attr("class",s).attr("style",y).attr("x",rt).attr("y",D).attr("width",$).attr("height",j).attr("fill",u).attr("stroke",g),R.attr("class",n).attr("style",y).attr("x",rt).attr("y",z).attr("width",$).attr("height",Q).attr("fill","none").attr("stroke",g);const et=t.x-T.width/2,J=D+(j-T.height)/2;A.attr("transform",`translate(${et}, ${J})`)}if(Mt.trace("Swimlane data ",t,JSON.stringify(t)),m){const V=A.select("span");V&&V.attr("style",m)}return t.offsetX=0,t.width=$,t.height=P,t.offsetY=T.height-_/2,t.intersect=function(V){return $o(t,V)},{cluster:k,labelBBox:T}},"swimlane"),J0=b(async(e,t)=>{Mt.info("Creating subgraph rect for ",t.id,t);const r=Xe(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{clusterBkg:s,clusterBorder:n,borderColorArray:l}=o,{labelStyles:c,nodeStyles:h,borderStyles:d,backgroundStyles:u}=jt(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);_i(f,t.colorIndex,i,l);const p=qr(r),g=f.insert("g").attr("class","cluster-label ");let m;t.labelType==="markdown"?m=await gi(g,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}):m=await bo(g,t.label,t.labelStyle||"",!1,!0);let y=m.getBBox();if(qr(r)){const T=m.children[0],_=He(m);y=T.getBoundingClientRect(),_.attr("width",y.width),_.attr("height",y.height)}const x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height,k=t.x-x/2,v=t.y-C/2;Mt.trace("Data ",t,JSON.stringify(t));let M;if(t.look==="handDrawn"){const T=Vt.svg(f),_=Gt(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:a}),$=T.path(pi(k,v,x,C,0),_);M=f.insert(()=>(Mt.debug("Rough node insert CXC",$),$),":first-child"),M.select("path:nth-child(2)").attr("style",d.join(";")),M.select("path").attr("style",u.join(";").replace("fill","stroke"))}else M=f.insert("rect",":first-child"),M.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",k).attr("y",v).attr("width",x).attr("height",C);const{subGraphTitleTopMargin:A}=bn(r);if(g.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+A})`),c){const T=g.select("span");T&&T.attr("style",c)}const L=M.node().getBBox();return t.offsetX=0,t.width=L.width,t.height=L.height,t.offsetY=y.height-t.padding/2,t.intersect=function(T){return $o(t,T)},{cluster:f,labelBBox:y}},"rect"),IB=b((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,a=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const s=i.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(n){return $o(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),OB=b(async(e,t)=>{const r=Xe(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{altBackground:s,borderColorArray:n,compositeBackground:l,compositeTitleBackground:c,nodeBorder:h}=o,d=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look);_i(d,t.colorIndex,i,n);const u=d.insert("g",":first-child"),f=d.insert("g").attr("class","cluster-label");let p=d.append("rect");const g=await bo(f,t.label,t.labelStyle,void 0,!0);let m=g.getBBox();if(qr(r)){const $=g.children[0],P=He(g);m=$.getBoundingClientRect(),P.attr("width",m.width),P.attr("height",m.height)}const y=0*t.padding,x=y/2,C=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+y;t.width<=m.width+t.padding?t.diff=(C-t.width)/2-t.padding:t.diff=-t.padding;const k=t.height+y,v=t.height+y-m.height-6,M=t.x-C/2,A=t.y-k/2;t.width=C;const L=t.y-t.height/2-x+m.height+2;let T;if(t.look==="handDrawn"){const $=t.cssClasses.includes("statediagram-cluster-alt"),P=Vt.svg(d),D=t.rx||t.ry?P.path(pi(M,A,C,k,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:h,seed:a}):P.rectangle(M,A,C,k,{seed:a});T=d.insert(()=>D,":first-child");const F=P.rectangle(M,L,C,v,{fill:$?s:l,fillStyle:$?"hachure":"solid",stroke:h,seed:a});T=d.insert(()=>D,":first-child"),p=d.insert(()=>F),T.attr("class","outer"),p.attr("class","inner")}else T=u.insert("rect",":first-child"),T.attr("class","outer").attr("x",M).attr("y",A).attr("width",C).attr("height",k).attr("data-look",t.look),p.attr("class","inner").attr("x",M).attr("y",L).attr("width",C).attr("height",v);f.attr("transform",`translate(${t.x-m.width/2}, ${A+1-(qr(r)?0:3)})`);const _=T.node().getBBox();return t.height=_.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function($){return $o(t,$)},{cluster:d,labelBBox:m}},"roundedWithTitle"),DB=b(async(e,t)=>{Mt.info("Creating subgraph rect for ",t.id,t);const r=Xe(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:a,clusterBorder:s}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=jt(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=qr(r),f=d.insert("g").attr("class","cluster-label "),p=await gi(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let g=p.getBBox();if(qr(r)){const A=p.children[0],L=He(p);g=A.getBoundingClientRect(),L.attr("width",g.width),L.attr("height",g.height)}const m=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,x=t.x-m/2,C=t.y-y/2;Mt.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){const A=Vt.svg(d),L=Gt(t,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:o}),T=A.path(pi(x,C,m,y,t.rx),L);k=d.insert(()=>(Mt.debug("Rough node insert CXC",T),T),":first-child"),k.select("path:nth-child(2)").attr("style",c.join(";")),k.select("path").attr("style",h.join(";").replace("fill","stroke"))}else k=d.insert("rect",":first-child"),k.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",x).attr("y",C).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:v}=bn(r);if(f.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+v})`),n){const A=f.select("span");A&&A.attr("style",n)}const M=k.node().getBBox();return t.offsetX=0,t.width=M.width,t.height=M.height,t.offsetY=g.height-t.padding/2,t.intersect=function(A){return $o(t,A)},{cluster:d,labelBBox:g}},"kanbanSection"),RB=b((e,t)=>{const r=Xe(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{altBackground:s,nodeBorder:n,borderColorArray:l}=o,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look);_i(c,t.colorIndex,i,l);const h=c.insert("g",":first-child"),d=0*t.padding,u=t.width+d;t.diff=-t.padding;const f=t.height+d,p=t.x-u/2,g=t.y-f/2;t.width=u;let m;if(t.look==="handDrawn"){const C=Vt.svg(c).rectangle(p,g,u,f,{fill:s??"#efefef",fillStyle:"solid",roughness:.5,strokeLineDash:[5],stroke:n,seed:a});m=c.insert(()=>C,":first-child").attr("class","divider")}else{m=h.insert("rect",":first-child");let x="outer";t.look,x="divider",m.attr("class",x).attr("x",p).attr("y",g).attr("width",u).attr("height",f).attr("data-look",t.look)}const y=m.node().getBBox();return t.height=y.height,t.offsetX=0,t.offsetY=0,t.intersect=function(x){return $o(t,x)},{cluster:c,labelBBox:{}}},"divider"),NB=b(async(e,t,r)=>{Mt.info(`Creating ${r.cssClass} for `,t.id,t);const i=Xe(),{theme:o,themeVariables:a,handDrawnSeed:s}=i,{borderColorArray:n}=a,{labelStyles:l,borderStyles:c}=jt(t),h=e.insert("g").attr("class","cluster "+r.cssClass+" "+t.cssClasses).attr("id",t.domId??t.id).attr("data-look",t.look);_i(h,t.colorIndex,o,n);const d=qr(i),u=h.insert("g").attr("class","cluster-label");let f={width:0,height:0};const p=t.label?.trim();if(p){let v;if(t.labelType==="markdown"?v=await gi(u,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width}):v=await bo(u,t.label,t.labelStyle||"",!1,!0),f=v.getBBox(),d){const M=v.children[0],A=He(v);f=M.getBoundingClientRect(),A.attr("width",f.width),A.attr("height",f.height)}}const g=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(g-t.width)/2-t.padding:t.diff=-t.padding;const m=t.height,y=t.x-g/2,x=t.y-m/2;let C;if(t.look==="handDrawn"){const v=Vt.svg(h),M=Gt(t,{roughness:r.roughness,fill:r.fill,stroke:r.stroke,strokeWidth:r.strokeWidth,seed:s,...r.fill==="none"?{fillWeight:0}:{fillStyle:"solid"},...r.strokeDash?{strokeLineDash:r.strokeDash}:{}}),A=v.path(pi(y,x,g,m,r.rx),M);C=h.insert(()=>A,":first-child"),C.select("path:nth-child(2)").attr("style",c.join(";"))}else C=h.insert("rect",":first-child"),C.attr("rx",r.rx).attr("ry",r.rx).attr("x",y).attr("y",x).attr("width",g).attr("height",m).attr("fill",r.fill).attr("stroke",r.stroke).attr("stroke-width",r.strokeWidth+"px"),r.strokeDash&&C.attr("stroke-dasharray",r.strokeDash.join(", "));if(p){const{subGraphTitleTopMargin:v}=bn(i);if(u.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+v})`),l){const M=u.select("span");M&&M.attr("style",l)}}const k=C.node().getBBox();return t.offsetX=0,t.width=k.width,t.height=k.height,t.offsetY=f.height-t.padding/2,t.intersect=function(v){return $o(t,v)},{cluster:h,labelBBox:f}},"createContainerGroup"),qB=b(async(e,t)=>{const{themeVariables:r}=Xe(),i=r.flowContainerStroke||r.secondaryBorderColor;return NB(e,t,{cssClass:"flow-cluster",rx:10,fill:"none",stroke:i,strokeWidth:.75,roughness:.7})},"flowGroup"),WB=b((e,t)=>{const r=e.boundaryType||"rect",i=r==="package"?20:e.padding,o=r==="package"?t.height+10:0,a=Math.max(e.width,t.width+i),s=r==="package"?Math.max(e.height,o+e.padding*2):e.height,n=e.x-a/2,l=e.y-s/2;return{boundaryType:r,width:a,height:s,x:n,y:l,bodyY:l+o,bodyHeight:s-o,tabHeight:o,tabWidth:r==="package"?Math.min(a,Math.max(80,t.width+20)):0}},"getUsecaseSystemBoundaryGeometry"),zB=b(async(e,t)=>{Mt.info("Creating usecase system boundary for ",t.id,t);const r=Xe(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{clusterBkg:s,clusterBorder:n,borderColorArray:l}=o,{labelStyles:c,nodeStyles:h}=jt(t),{stylesMap:d}=Zo(t),u=t.boundaryType||"rect",f=e.insert("g").attr("class",`cluster usecase-system-boundary usecase-system-boundary-${u} ${t.cssClasses}`).attr("id",typeof t.domId=="string"?t.domId:t.id).attr("data-boundary-type",u).attr("data-look",t.look);_i(f,t.colorIndex,i,l);const p=qr(r),g=f.insert("g").attr("class","cluster-label system-boundary-title"),m=await gi(g,t.label,{style:c,useHtmlLabels:p,isNode:!0});let y=m.getBBox();if(p){const D=m.children[0],F=He(m);y=D.getBoundingClientRect(),F.attr("width",y.width),F.attr("height",y.height)}const x=WB(t,y),{width:C,height:k,x:v,y:M,bodyY:A,bodyHeight:L,tabHeight:T,tabWidth:_}=x;t.diff=t.width<=y.width+t.padding?(C-t.width)/2-t.padding:-t.padding;const $=Gt(t,{fill:d.get("fill")||s,stroke:d.get("stroke")||n,strokeWidth:d.get("stroke-width")?.replace("px","")||1,seed:a});if(t.look==="handDrawn"){const D=Vt.svg(f),F=D.rectangle(v,A,C,L,$);if(f.insert(()=>F,":first-child").attr("class","boundary-body label-container"),u==="package"){const E=D.rectangle(v,M,_,T,$);f.insert(()=>E,":first-child").attr("class","boundary-tab system-boundary-package-tab label-container")}}else f.insert("rect",":first-child").attr("class","boundary-body label-container").attr("style",h).attr("x",v).attr("y",A).attr("width",C).attr("height",L),u==="package"&&f.insert("rect",":first-child").attr("class","boundary-tab system-boundary-package-tab label-container").attr("style",h).attr("x",v).attr("y",M).attr("width",_).attr("height",T);const{subGraphTitleTopMargin:P}=bn(r);return u==="package"?g.attr("transform",`translate(${v+(_-y.width)/2}, ${M+(T-y.height)/2})`):g.attr("transform",`translate(${t.x-y.width/2}, ${M+P})`),c&&(g.attr("style",c),g.select("span").attr("style",c)),t.offsetX=0,t.width=C,t.height=k,t.offsetY=y.height-t.padding/2,t.labelBBox=y,t.intersect=function(D){return $o(t,D)},{cluster:f,labelBBox:y}},"usecaseSystemBoundary"),HB=J0,YB=b((e,t)=>Q0(e,t,{variant:"pool"}),"pool"),XB={rect:J0,squareRect:HB,roundedWithTitle:OB,noteGroup:IB,divider:RB,kanbanSection:DB,flowGroup:qB,usecaseSystemBoundary:zB,swimlane:Q0,pool:YB},GB=new Set(["noteGroup","divider"]),TI=b(e=>!GB.has(e??"rect"),"clusterPaintsTitle"),tb=new Map,jB=b(async(e,t)=>{const r=t.shape||"rect",i=await XB[r](e,t);return tb.set(t.id,i),i},"insertCluster"),MI=b(()=>{tb=new Map},"clear"),Bs=b((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Nr={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},Hg={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5,arrow_open_head:4,arrow_hollow_circle:8};function Rs(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Tr(e),t=Tr(t);const[r,i]=[e.x,e.y],[o,a]=[t.x,t.y],s=o-r,n=a-i;return{angle:Math.atan(n/s),deltaX:s,deltaY:n}}b(Rs,"calculateDeltaAndAngle");var Tr=b(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),UB=b(e=>({x:b(function(t,r,i){let o=0;const a=Tr(i[0]).x<Tr(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Nr,e.arrowTypeStart)){const{angle:f,deltaX:p}=Rs(i[0],i[1]);o=Nr[e.arrowTypeStart]*Math.cos(f)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Nr,e.arrowTypeEnd)){const{angle:f,deltaX:p}=Rs(i[i.length-1],i[i.length-2]);o=Nr[e.arrowTypeEnd]*Math.cos(f)*(p>=0?1:-1)}const s=Math.abs(Tr(t).x-Tr(i[i.length-1]).x),n=Math.abs(Tr(t).y-Tr(i[i.length-1]).y),l=Math.abs(Tr(t).x-Tr(i[0]).x),c=Math.abs(Tr(t).y-Tr(i[0]).y),h=Nr[e.arrowTypeStart],d=Nr[e.arrowTypeEnd],u=1;if(s<d&&s>0&&n<d){let f=d+u-s;f*=a==="right"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=a==="right"?-1:1,o+=f}return Tr(t).x+o},"x"),y:b(function(t,r,i){let o=0;const a=Tr(i[0]).y<Tr(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Nr,e.arrowTypeStart)){const{angle:f,deltaY:p}=Rs(i[0],i[1]);o=Nr[e.arrowTypeStart]*Math.abs(Math.sin(f))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Nr,e.arrowTypeEnd)){const{angle:f,deltaY:p}=Rs(i[i.length-1],i[i.length-2]);o=Nr[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(p>=0?1:-1)}const s=Math.abs(Tr(t).y-Tr(i[i.length-1]).y),n=Math.abs(Tr(t).x-Tr(i[i.length-1]).x),l=Math.abs(Tr(t).y-Tr(i[0]).y),c=Math.abs(Tr(t).x-Tr(i[0]).x),h=Nr[e.arrowTypeStart],d=Nr[e.arrowTypeEnd],u=1;if(s<d&&s>0&&n<d){let f=d+u-s;f*=a==="up"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=a==="up"?-1:1,o+=f}return Tr(t).y+o},"y")}),"getLineFunctionsWithOffset"),eb=1,VB=b(e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:eb,"getStepDuration"),gu=b(e=>typeof e.step=="number"&&Number.isInteger(e.step)&&e.step>0,"isStepEdge"),Yg=[.25,.35,.15,.65,.75,.5,.85,.1,.9],zh=9,ZB=11,KB=2,QB="#333333",Xg=12,Gg=6,jg=14,Ug=.01,JB=4.5,rb=/translate\(\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i,tL=4,eL=.6,rL=4,iL=b((e,t,r=eb)=>{const i=Math.max(t,e);return{begin:(e-1)*r,dur:r,gap:(i-1)*r}},"getEdgeStepTiming"),oL=b(e=>`step_${Array.from(e,t=>/[\dA-Za-z]/.test(t)?t:`_${(t.codePointAt(0)??0).toString(16)}_`).join("")}`,"toAnimationId"),aL=b(e=>{const t=/^m\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i.exec(e.trim());return t?`translate(${t[1]},${t[2]}) `:""},"pathStartTranslate"),sL=b(e=>Array.from(e,(t,r)=>{const i=t.codePointAt(0)??0;if(i===0)return"�";const o=i<=31||i===127,a=/\d/.test(t)&&(r===0||r===1&&e.startsWith("-"));return o||a?`\\${i.toString(16)} `:e==="-"?"\\-":i>=128||/[\w-]/.test(t)?t:`\\${t}`}).join(""),"escapeCssIdentifierFallback"),nL=b(e=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):sL(e),"escapeCssIdentifier"),lL=b((e,t)=>{const r=e.node(),i=r?.ownerSVGElement??r?.closest?.("svg")??r,o=t||i?.getAttribute("id");if(!i||!o||i.querySelector("style.edge-step-style"))return;const a=`#${nL(o)} `,s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","style");s.setAttribute("class","edge-step-style"),s.textContent=`@media (prefers-reduced-motion: reduce) { ${a}.edge-step-dot, ${a}.edge-step-highlight { display: none; } }`,i.appendChild(s)},"ensureReducedMotionStyle"),cL=b((e,t)=>{const r=e.filter(a=>Number.isFinite(a.x)&&Number.isFinite(a.y));if(r.length===0)return;const i=r.slice(1).map((a,s)=>Math.hypot(a.x-r[s].x,a.y-r[s].y));let o=i.reduce((a,s)=>a+s,0)*t;for(const[a,s]of i.entries()){if(o<=s&&s>0){const n=o/s,l=r[a],c=r[a+1];return{x:l.x+(c.x-l.x)*n,y:l.y+(c.y-l.y)*n}}o-=s}return r[r.length-1]},"pointAlongPolyline"),hL=b((e,t)=>{const r=typeof t?.getTotalLength=="function"?t.getTotalLength():0,i=t?.getPointAtLength?.bind(t);return r>0&&i?o=>{const{x:a,y:s}=i(r*o);return{x:a,y:s}}:o=>cL(e,o)},"createPathSampler"),dL=b((e,t)=>Math.min(Number.POSITIVE_INFINITY,...t.map(r=>{const i=Math.max(Math.abs(e.x-r.x)-r.halfWidth,0),o=Math.max(Math.abs(e.y-r.y)-r.halfHeight,0);return Math.hypot(i,o)-zh})),"roomAround"),uL=b((e,t)=>{const r=e(t),i=e(Math.max(t-Ug,0)),o=e(Math.min(t+Ug,1));if(!r||!i||!o)return[];const a=Math.hypot(o.x-i.x,o.y-i.y);if(a===0)return[];const s={x:-(o.y-i.y)/a,y:(o.x-i.x)/a};return[1,-1].map(n=>({x:r.x+s.x*jg*n,y:r.y+s.y*jg*n}))},"besideThePath"),fL=b((e,t)=>{const r=[...Yg.map(e),...Yg.flatMap(a=>uL(e,a))];let i,o=Number.NEGATIVE_INFINITY;for(const a of r){if(!a||!Number.isFinite(a.x)||!Number.isFinite(a.y))continue;const s=dL(a,t);if(s>=KB)return a;s>o&&(i=a,o=s)}return i},"chooseBadgePosition"),ib=b((e,t)=>({...e,halfWidth:t,halfHeight:t}),"square"),gL=b(e=>{const t=rb.exec(e.getAttribute("transform")??"");return t?{x:Number(t[1]),y:Number(t[2])}:{x:0,y:0}},"translationOf"),pu=b(e=>{const t={x:0,y:0};for(let r=e;r&&r.localName!=="svg";r=r.parentElement){const{x:i,y:o}=gL(r);t.x+=i,t.y+=o}return t},"offsetInSvg"),pL=b((e,t)=>{if(!rb.test(e.getAttribute("transform")??""))return;const r=pu(e),i=r.x-t.x,o=r.y-t.y,a=e.getBBox?.();if(a)return{x:i+a.x+a.width/2,y:o+a.y+a.height/2,halfWidth:a.width/2,halfHeight:a.height/2}},"boxedObstacle"),mL=b(e=>{try{const t=JSON.parse(atob(e.getAttribute("data-points")??""));return Array.isArray(t)?t:[]}catch{return[]}},"readPoints"),Vg=b((e,t)=>{const r=Math.hypot(e.x-t.x,e.y-t.y);if(r===0)return ib(e,Xg);const i={x:(e.x-t.x)/r,y:(e.y-t.y)/r},o=Xg/2;return{x:e.x-i.x*o,y:e.y-i.y*o,halfWidth:Math.abs(i.x)*o+Math.abs(i.y)*Gg,halfHeight:Math.abs(i.y)*o+Math.abs(i.x)*Gg}},"arrowheadObstacle"),Zg=b((e,t)=>{const r=e.getAttribute(t);return!!r&&r!=="none"},"hasMarker"),yL=b((e,t)=>{const r=mL(e).filter(n=>Number.isFinite(n?.x)&&Number.isFinite(n?.y));if(r.length===0)return[];const i=pu(e),o=b(n=>({x:n.x+i.x-t.x,y:n.y+i.y-t.y}),"toSvg"),a=r.length-1,s=[];return Zg(e,"marker-start")&&s.push(Vg(o(r[0]),o(r[Math.min(1,a)]))),Zg(e,"marker-end")&&s.push(Vg(o(r[a]),o(r[Math.max(a-1,0)]))),s},"arrowheadObstacles"),ob=b(e=>{const t={x:0,y:0},r=[...e?.querySelectorAll(".edgeLabel, .node")??[]].map(o=>pL(o,t)).filter(o=>o!==void 0),i=[...e?.querySelectorAll('path[data-edge="true"]')??[]].flatMap(o=>yL(o,t));return[...r,...i]},"collectBadgeObstacles"),xL=b((e,t)=>{if(!e.label||t.length===0)return[];const{x:r,y:i}=ui.calcLabelPosition(t);return[{x:r,y:i,halfWidth:(e.width??0)/2,halfHeight:(e.height??0)/2}]},"edgeLabelObstacles"),bL=b(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},"linearChannel"),Kg=b(e=>{try{const[t,r,i]=["r","g","b"].map(o=>bL(l2(e,o)));return .2126*t+.7152*r+.0722*i}catch{return}},"relativeLuminance"),CL=b((e,t)=>{const r=Kg(e),i=Kg(t);return r===void 0||i===void 0?0:(Math.max(r,i)+.05)/(Math.min(r,i)+.05)},"contrastRatio"),wL=b((e,t)=>{const i=[...t.filter(a=>!!a),"#ffffff","#000000"].map(a=>({color:a,ratio:CL(e,a)}));return(i.find(({ratio:a})=>a>=JB)??i.reduce((a,s)=>s.ratio>a.ratio?s:a)).color},"pickBadgeTextColor"),kL=b(e=>{const t=e?.replace(/^stroke:\s*/,"").trim();return t===""?void 0:t},"bareColor"),SL=b((e,t,r,i=ob(e.node()?.closest("svg")))=>{if(!gu(t)||!t.showStepNumber)return;const o=pu(e.node()),a=i.map(c=>({...c,x:c.x-o.x,y:c.y-o.y})),s=fL(hL(r.points,r.pathNode),[...a,...xL(t,r.points)]);if(!s)return;const n=kL(r.color)??QB,l=e.append("g").attr("class","edge-step-badge").attr("transform",`translate(${s.x},${s.y})`).attr("pointer-events","none").attr("data-step",t.step);return l.append("circle").attr("r",zh).attr("fill",n),l.append("text").attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",ZB).attr("fill",wL(n,r.textColors??[])).text(String(t.step)),ib({x:s.x+o.x,y:s.y+o.y},zh)},"insertEdgeStepBadge"),Qg=b((e,t,r)=>{e.append("animateTransform").attr("attributeName","transform").attr("type","scale").attr("values","1;1").attr("dur",`${r}s`).attr("begin",`${t}.begin`).attr("fill","remove")},"showWhileStepPlays"),vL=b((e,t,r,i,o)=>{if(!gu(t)||!r)return;const{begin:a,dur:s,gap:n}=iL(t.step,t.stepCount??t.step,VB(t.stepDuration)),l=oL(`${i}-${t.id}-step`),c=`${aL(r)}scale(0)`,h=o?.replace(/^stroke:\s*/,""),d=e.append("path").attr("class","edge-step-highlight").attr("aria-hidden","true").attr("d",r).attr("fill","none").attr("stroke",h??"currentColor").attr("stroke-width",tL).attr("stroke-linecap","round").attr("stroke-opacity",eL).attr("pointer-events","none").attr("transform",c).attr("data-step",t.step);Qg(d,l,s);const u=e.append("circle").attr("class","edge-step-dot").attr("r",rL).attr("aria-hidden","true").attr("transform",c).attr("data-step",t.step);h&&u.attr("fill",h).attr("stroke","none"),u.append("animateMotion").attr("id",l).attr("path",r).attr("dur",`${s}s`).attr("begin",`${a}s;${l}.end+${n}s`).attr("fill","remove"),Qg(u,l,s),lL(e,i)},"insertEdgeStepDot"),El=new WeakMap,TL=b(e=>{const t=e.querySelector(":scope > g.edge-step-badges");if(t)return t;const r=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");return r.setAttribute("class","edge-step-badges"),e.appendChild(r)},"badgeLayer"),ML=b(e=>{const t=e?El.get(e):void 0;if(!e||!t)return;El.delete(e);const r=ob(e);for(const{elem:i,edge:o,options:a}of t){const s=i.node()?.parentElement;if(!s)continue;const n=He(TL(s)),l=SL(n,o,a,r);l&&r.push(l)}},"placeQueuedStepBadges"),_L=b((e,t,r,i,o)=>{vL(e,t,r,i,o.color);const a=e.node(),s=a?.ownerSVGElement??a;!s||!gu(t)||!t.showStepNumber||El.set(s,[...El.get(s)??[],{elem:e,edge:t,options:o}])},"insertEdgeStepMarks"),BL=b((e,t,r,i,o,a=!1,s)=>{t.arrowTypeStart&&Jg(e,"start",t.arrowTypeStart,r,i,o,a,s),t.arrowTypeEnd&&Jg(e,"end",t.arrowTypeEnd,r,i,o,a,s)},"addEdgeMarkers"),LL={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},arrow_open_head:{type:"openArrow",fill:!1},arrow_hollow_circle:{type:"hollowCircle",fill:!1},arrow_hierarchy:{type:"hierarchy",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},AL=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Jg=b((e,t,r,i,o,a,s=!1,n)=>{if(!r||r==="none")return;const l=LL[r],c=l&&AL.includes(l.type);if(!l){Mt.warn(`Unknown arrow type: ${r}`);return}const h=l.type,f=`${o}_${a}-${h}${t==="start"?"Start":"End"}${s&&c?"-margin":""}`;if(n&&n.trim()!==""){const p=n.replace(/[^\dA-Za-z]/g,"_"),g=`${f}_${p}`;if(!document.getElementById(g)){const m=document.getElementById(f);if(m){const y=m.cloneNode(!0);y.id=g,y.querySelectorAll("path, circle, line").forEach(C=>{C.setAttribute("stroke",n),l.fill&&C.setAttribute("fill",n)}),m.parentNode?.appendChild(y)}}e.attr(`marker-${t}`,`url(${i}#${g})`)}else e.attr(`marker-${t}`,`url(${i}#${f})`)},"addEdgeMarker"),FL=b(e=>typeof e=="string"?e:Xe()?.flowchart?.curve,"resolveEdgeCurveType"),Pl=new Map,Hr=new Map,_I=b(()=>{Pl.clear(),Hr.clear()},"clear"),BI=b(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),Ls=b(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),$L=b(async(e,t)=>{const r=Xe();let i=qr(r);const{labelStyles:o}=jt(t);t.labelStyle=o;const a=e.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await gi(e,t.label,{style:Ls(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);s.node().appendChild(c),Mt.info("abc82",t,t.labelType);let h,d;if(i){const f=c.children[0],p=He(c);h=await ma.measure(()=>f.getBoundingClientRect()),d=h,p.attr("width",h.width),p.attr("height",h.height)}else{const f=He(c).select("text").node();await ma.measure(()=>{h=c.getBBox(),f&&typeof f.getBBox=="function"?d=f.getBBox():d=h})}s.attr("transform",Bs(d,i)),Pl.set(t.id,a),t.width=h.width,t.height=h.height;let u;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await bo(p,t.startLabelLeft,Ls(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(i){const y=g.children[0],x=He(g);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}p.attr("transform",Bs(m,i)),Hr.get(t.id)||Hr.set(t.id,{}),Hr.get(t.id).startLeft=f,qs(u,t.startLabelLeft,m),Ns(t,"startLeft",m)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await bo(p,t.startLabelRight,Ls(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(i){const y=g.children[0],x=He(g);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}p.attr("transform",Bs(m,i)),Hr.get(t.id)||Hr.set(t.id,{}),Hr.get(t.id).startRight=f,qs(u,t.startLabelRight,m),Ns(t,"startRight",m)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await bo(p,t.endLabelLeft,Ls(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(i){const y=g.children[0],x=He(g);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}p.attr("transform",Bs(m,i)),Hr.get(t.id)||Hr.set(t.id,{}),Hr.get(t.id).endLeft=f,qs(u,t.endLabelLeft,m),Ns(t,"endLeft",m)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await bo(p,t.endLabelRight,Ls(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(i){const y=g.children[0],x=He(g);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}p.attr("transform",Bs(m,i)),Hr.get(t.id)||Hr.set(t.id,{}),Hr.get(t.id).endRight=f,qs(u,t.endLabelRight,m),Ns(t,"endRight",m)}return c},"insertEdgeLabel");function Ns(e,t,r){e.terminalLabelSizes??={},e.terminalLabelSizes[t]={width:r.width,height:r.height}}b(Ns,"recordTerminalLabelSize");function qs(e,t,r){qr(Xe())&&e&&(e.style.width=Math.max(t.length*9,r.width)+"px",e.style.height=r.height+"px")}b(qs,"setTerminalWidth");var EL=b((e,t)=>{let r=e.x,i=e.y;if(t?.updatedPath){const o=ui.calcLabelPosition(t.updatedPath);if(t.originalPath){const a=ui.calcLabelPosition(t.originalPath);r=e.x+(o.x-a.x),i=e.y+(o.y-a.y)}else r=o.x,i=o.y}return{x:r,y:i}},"resolveEdgeLabelPosition"),PL=b((e,t)=>{Mt.debug("Moving label abc88 ",e.id,e.label,Pl.get(e.id),t);const r=Xe(),{subGraphTitleTotalMargin:i}=bn(r);if(e.label){const a=Pl.get(e.id),{x:s,y:n}=EL(e,t);Mt.debug("Moving label "+e.label+" from (",e.x,",",e.y,") to (",s,",",n,") abc88"),a.attr("transform",`translate(${s}, ${n+i/2})`)}const o=t.updatedPath?t.updatedPath:t.originalPath;if(e.startLabelLeft){const a=Hr.get(e.id).startLeft;let s=e.x,n=e.y;if(o){const l=ui.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}if(e.startLabelRight){const a=Hr.get(e.id).startRight;let s=e.x,n=e.y;if(o){const l=ui.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelLeft){const a=Hr.get(e.id).endLeft;let s=e.x,n=e.y;if(o){const l=ui.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelRight){const a=Hr.get(e.id).endRight;let s=e.x,n=e.y;if(o){const l=ui.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}},"positionEdgeLabel"),ls=.5,Co=b((e,t)=>Math.abs(e.x-t.x)<ls,"sharesColumn"),wo=b((e,t)=>Math.abs(e.y-t.y)<ls,"sharesRow"),ab=b((e,t)=>Co(e,t)&&wo(e,t),"coincides");function sb(e,t,r){return Co(e,t)&&!wo(e,t)?Co(r,t):wo(e,t)&&!Co(e,t)?wo(r,t):Co(r,t)||wo(r,t)}b(sb,"keepsArrivalAxis");function nb(e,t,r){return ab(e,t)?{heading:t,from:r}:{heading:e,from:t}}b(nb,"arrivalSegment");function lb({heading:e,from:t},r,i){return(e.x-t.x)*(i.x-r.x)+(e.y-t.y)*(i.y-r.y)<0}b(lb,"runsAgainstHeading");function cb({heading:e,from:t},r,i){return wo(e,t)&&!Co(e,t)?{x:i.x,y:r.y}:Co(e,t)&&!wo(e,t)?{x:r.x,y:i.y}:i}b(cb,"snapToArrivalAxis");function hb(e,t,r,i){if((Co(e,t)||wo(e,t))&&!sb(e,t,i))return e;const a=nb(e,t,r);return lb(a,t,i)?t:cb(a,t,i)}b(hb,"dockFinalPoint");function db(e){const t=Object.hasOwn(Nr,e)?Nr[e]:0;return Number.isFinite(t)?t:0}b(db,"markerPullBack");function ub({originalLast:e,lastInner:t,newLast:r,minLength:i}){const o=!ab(e,t),a=Math.hypot(r.x-t.x,r.y-t.y);return a>=Math.max(ls,i)?r:o&&a>=ls?e:void 0}b(ub,"finalDockPoint");var IL=b((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),a=Math.abs(i.y-r.y);return o<.001||a<.001?t:a>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),OL=b((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),a=Math.abs(t.y-i),s=e.width/2,n=e.height/2;return o>=s||a>=n},"outsideNode"),DL=b((e,t,r)=>{Mt.debug(`intersection calc abc89:
293
+ outsidePoint: ${JSON.stringify(t)}
294
+ insidePoint : ${JSON.stringify(r)}
295
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,a=Math.abs(i-r.x),s=e.width/2;let n=r.x<t.x?s-a:s+a;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*s>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;n=h*d/c;const u={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(u.x=t.x,u.y=t.y),h===0&&(u.x=t.x),c===0&&(u.y=t.y),Mt.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,u),u}else{r.x<t.x?n=t.x-s-i:n=i-s-t.x;let d=c*n/h,u=r.x<t.x?r.x+h-n:r.x-h+n,f=r.y<t.y?r.y+d:r.y-d;return Mt.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${n}`,{_x:u,_y:f}),n===0&&(u=t.x,f=t.y),h===0&&(u=t.x),c===0&&(f=t.y),{x:u,y:f}}},"intersection"),tp=b((e,t)=>{Mt.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(a=>{if(Mt.info("abc88 checking point",a,t),!OL(t,a)&&!o){const s=DL(t,i,a);Mt.debug("abc88 inside",a,i,s),Mt.debug("abc88 intersection",s,t);let n=!1;r.forEach(l=>{n=n||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?Mt.warn("abc88 no intersect",s,r):r.push(s),o=!0}else Mt.warn("abc88 outside",a,i),i=a,o||r.push(a)}),Mt.debug("returning points",r),r},"cutPathAtIntersect");function fb(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],a=e[i],s=e[i+1];(o.x===a.x&&a.y===s.y&&Math.abs(a.x-s.x)>5&&Math.abs(a.y-o.y)>5||o.y===a.y&&a.x===s.x&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-s.y)>5)&&(t.push(a),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}b(fb,"extractCornerPoints");var ep=b(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,a=Math.sqrt(i*i+o*o),s=r/a;return{x:t.x-s*i,y:t.y-s*o}},"findAdjacentPoint"),RL=b(function(e){const{cornerPointPositions:t}=fb(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],a=e[i+1],s=e[i],n=ep(o,s,5),l=ep(a,s,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let u={x:s.x,y:s.y};if(Math.abs(a.x-o.x)>10&&Math.abs(a.y-o.y)>=10){Mt.debug("Corner point fixing",Math.abs(a.x-o.x),Math.abs(a.y-o.y));const f=5;s.x===n.x?u={x:c<0?n.x-f+d:n.x+f-d,y:h<0?n.y-d:n.y+d}:u={x:c<0?n.x-d:n.x+d,y:h<0?n.y-f+d:n.y+f-d}}else Mt.debug("Corner point skipping fixing",Math.abs(a.x-o.x),Math.abs(a.y-o.y));r.push(u,l)}else r.push(e[i]);return r},"fixCorners"),NL=b((e,t,r)=>{const i=e-t-r,o=2,a=2,s=o+a,n=Math.floor(i/s),l=Number.isFinite(n)?Math.max(0,n):0,c=Array(l).fill(`${o} ${a}`).join(" ");return`0 ${t} ${c} ${r}`},"generateDashArray"),qL=b(function(e,t,r,i,o,a,s,n=!1,l=void 0){if(!s)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:c,layout:h}=Xe(),d=l??h;let u=t.points,f=!1;const p=o;var g=a;const m=[];for(const R in t.cssCompiledStyles)cm(R)||m.push(t.cssCompiledStyles[R]);if(d==="swimlane"){if(!n&&g.intersect&&p.intersect&&Array.isArray(u)&&u.length>=2)if(u.length===2){const[R,V]=u;u=Co(R,V)||wo(R,V)?[p.intersect(R),g.intersect(V)]:[p.intersect(V),g.intersect(R)]}else{const R=u.slice(1,-1),V=R[0],j=R[R.length-1],z=p.intersect(V),Q=u[u.length-1],rt=g.intersect(j),et=R.at(-2)??u[0],J=hb(Q,j,et,rt),at=ub({originalLast:Q,lastInner:j,newLast:J,minLength:db(t.arrowTypeEnd)}),H=Math.abs(z.x-V.x)<ls&&Math.abs(z.y-V.y)<ls?[]:[z],Y=at?[at]:[];u=[...H,...R,...Y]}u=IL(t,u)}else g.intersect&&p.intersect&&!n&&(u=u.slice(1,t.points.length-1),u.unshift(p.intersect(u[0])),u.push(g.intersect(u[u.length-1])));const y=btoa(JSON.stringify(u));t.toCluster&&(Mt.info("to cluster abc88",r.get(t.toCluster)),u=tp(t.points,r.get(t.toCluster).node),f=!0),t.fromCluster&&(Mt.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(u,null,2)),u=tp(u.reverse(),r.get(t.fromCluster).node).reverse(),f=!0);let x=u.filter(R=>!Number.isNaN(R.y));const C=FL(t.curve);C!=="rounded"&&(x=RL(x));let k=Us;switch(C){case"linear":k=Us;break;case"basis":k=Th;break;case"cardinal":k=Um;break;case"bumpX":k=Hm;break;case"bumpY":k=Ym;break;case"catmullRom":k=Zm;break;case"monotoneX":k=ry;break;case"monotoneY":k=iy;break;case"natural":k=ay;break;case"step":k=sy;break;case"stepAfter":k=ly;break;case"stepBefore":k=ny;break;case"rounded":k=Us;break;default:k=Th}const{x:v,y:M}=UB(t),A=vT().x(v).y(M).curve(k);let L;switch(t.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-invisible";break;default:L="edge-thickness-normal"}switch(t.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break;default:L+=" edge-pattern-solid"}let T,_=C==="rounded"?gb(pb(x,t),5):A(x);const $=Array.isArray(t.style)?t.style:[t.style];let P=$.find(R=>R?.startsWith("stroke:")),D="";t.animate&&(D="edge-animation-fast"),t.animation&&(D="edge-animation-"+t.animation);let F=!1;if(t.look==="handDrawn"){const R=Vt.svg(e);Object.assign([],x);const V=R.path(_,{roughness:.3,seed:c});L+=" transition",T=He(V).select("path").attr("id",`${s}-${t.id}`).attr("class"," "+L+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",$?$.reduce((z,Q)=>z+";"+Q,""):"");let j=T.attr("d");T.attr("d",j),e.node().appendChild(T.node())}else{const R=m.join(";"),V=$?$.reduce((J,at)=>J+at+";",""):"",j=(R?R+";"+V+";":V)+";"+($?$.reduce((J,at)=>J+";"+at,""):"");T=e.append("path").attr("d",_).attr("id",`${s}-${t.id}`).attr("class"," "+L+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",j),P=j.match(/stroke:([^;]+)/)?.[1],F=t.animate===!0||!!t.animation||R.includes("animation");const z=T.node(),Q=typeof z.getTotalLength=="function"?z.getTotalLength():0,rt=Hg[t.arrowTypeStart]||0,et=Hg[t.arrowTypeEnd]||0;if(t.look==="neo"&&!F){const at=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?NL(Q,rt,et):`0 ${rt} ${Q-rt-et} ${et}`}; stroke-dashoffset: 0;`;T.attr("style",at+T.attr("style"))}}if(T.attr("data-edge",!0),T.attr("data-et","edge"),T.attr("data-id",t.id),T.attr("data-points",y),T.attr("data-look",Or(t.look)),t.step!==void 0){const{themeVariables:R}=Xe(),V=P??R?.lineColor;_L(e,t,_,s,{points:x,pathNode:T.node(),color:V,textColors:[R?.background,R?.primaryTextColor]})}t.showPoints&&x.forEach(R=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",R.x).attr("cy",R.y)});let E="";(Xe().flowchart.arrowMarkerAbsolute||Xe().state.arrowMarkerAbsolute)&&(E=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,E=E.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Mt.info("arrowTypeStart",t.arrowTypeStart),Mt.info("arrowTypeEnd",t.arrowTypeEnd);const B=!F&&t?.look==="neo";BL(T,t,E,s,i,B,P);const q=Math.floor(u.length/2),W=u[q];ui.isLabelCoordinateInPath(W,T.attr("d"))||(f=!0);let O={};return f&&(O.updatedPath=u),O.originalPath=t.points,O},"insertEdge");function gb(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let a=0;a<i;a++){const s=e[a],n=e[a-1],l=e[a+1];if(a===0)r+=`M${s.x},${s.y}`;else if(a===i-1)r+=`L${s.x},${s.y}`;else{const c=s.x-n.x,h=s.y-n.y,d=l.x-s.x,u=l.y-s.y,f=Math.hypot(c,h),p=Math.hypot(d,u);if(f<o||p<o){r+=`L${s.x},${s.y}`;continue}const g=c/f,m=h/f,y=d/p,x=u/p,C=g*y+m*x,k=Math.max(-1,Math.min(1,C)),v=Math.acos(k);if(v<o||Math.abs(Math.PI-v)<o){r+=`L${s.x},${s.y}`;continue}const M=Math.min(t/Math.sin(v/2),f/2,p/2),A=s.x-g*M,L=s.y-m*M,T=s.x+y*M,_=s.y+x*M;r+=`L${A},${L}`,r+=`Q${s.x},${s.y} ${T},${_}`}}return r}b(gb,"generateRoundedPath");function Hh(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}b(Hh,"calculateDeltaAndAngle");function pb(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Nr[t.arrowTypeStart]){const o=Nr[t.arrowTypeStart],a=e[0],s=e[1],{angle:n}=Hh(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=a.x+l,r[0].y=a.y+c}const i=e.length;if(i>=2&&Nr[t.arrowTypeEnd]){const o=Nr[t.arrowTypeEnd],a=e[i-1],s=e[i-2],{angle:n}=Hh(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=a.x-l,r[i-1].y=a.y-c}return r}b(pb,"applyMarkerOffsetsToPoints");var WL=b((e,t,r,i)=>{t.forEach(o=>{fA[o](e,r,i)})},"insertMarkers"),zL=b((e,t,r)=>{Mt.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),HL=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),YL=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),XL=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),GL=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),jL=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),UL=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),VL=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),ZL=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),KL=b((e,t,r)=>{const i=Mr(),{themeVariables:o}=i,{transitionColor:a}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),QL=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),JL=b((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),tA=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),eA=b((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),rA=b((e,t,r)=>{const i=Mr(),{themeVariables:o}=i,{strokeWidth:a}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),iA=b((e,t,r)=>{const i=Mr(),{themeVariables:o}=i,{strokeWidth:a,mainBkg:s}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),oA=b((e,t,r)=>{const i=Mr(),{themeVariables:o}=i,{strokeWidth:a}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),aA=b((e,t,r)=>{const i=Mr(),{themeVariables:o}=i,{strokeWidth:a,mainBkg:s}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),sA=b((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
296
+ L20,10
297
+ M20,10
298
+ L0,20`)},"requirement_arrow"),nA=b((e,t,r)=>{const i=Mr(),{themeVariables:o}=i,{strokeWidth:a}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
299
+ L20,10
300
+ M20,10
301
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),lA=b((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),cA=b((e,t,r)=>{const i=Mr(),{themeVariables:o}=i,{strokeWidth:a}=o,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),hA=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),dA=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-openArrowEnd").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",11).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1 1 L 11 6 L 1 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-openArrowStart").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",1).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 11 1 L 1 6 L 11 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none")},"openArrow"),uA=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hollowCircleStart").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hollowCircleEnd").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none")},"hollowCircle"),fA={extension:zL,composition:HL,aggregation:YL,dependency:XL,lollipop:GL,point:jL,circle:UL,cross:VL,barb:ZL,barbNeo:KL,hierarchy:hA,only_one:QL,zero_or_one:JL,one_or_more:tA,zero_or_more:eA,only_one_neo:rA,zero_or_one_neo:iA,one_or_more_neo:oA,zero_or_more_neo:aA,requirement_arrow:sA,requirement_contains:lA,requirement_arrow_neo:nA,requirement_contains_neo:cA,openArrow:dA,hollowCircle:uA},gA=WL,pA={common:cn,getConfig:Mr,insertCluster:jB,insertEdge:qL,insertEdgeLabel:$L,insertMarkers:gA,insertNode:K0,interpolateToCurve:Hd,labelHelper:he,log:Mt,positionEdgeLabel:PL},mA=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap","elk.box","elk.rectpacking"],rn=Object.create(null),mb=b(e=>{for(const t of e)rn[t.name]=t},"registerLayoutLoaders"),yA=b(()=>{const e=b(async()=>await je(()=>import("./DxHqMweQ.js"),__vite__mapDeps([35,36,37,4,5,38,26]),import.meta.url),"loader");return[{name:"elk",loader:e,algorithm:"elk.layered"},...mA.map(t=>({name:t,loader:e,algorithm:t}))]},"elkLayoutLoaders"),xA=b(()=>{mb([{name:"dagre",loader:b(async()=>await je(()=>import("./6XLvYn_R.js"),__vite__mapDeps([39,37,4,5,38]),import.meta.url),"loader")},{name:"swimlane",loader:b(async()=>await je(()=>import("./BhFdeIZl.js"),__vite__mapDeps([40,36,37,4,5,38]),import.meta.url),"loader")},{name:"cose-bilkent",loader:b(async()=>await je(()=>import("./9Al7uANH.js"),__vite__mapDeps([41,42,26]),import.meta.url),"loader")},...yA()])},"registerDefaultLayoutLoaders");xA();var LI=b(async(e,t)=>{if(!Object.hasOwn(rn,e.layoutAlgorithm))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const a of e.nodes){const s=a.domId||a.id;a.domId=`${e.diagramId}-${s}`}const r=rn[e.layoutAlgorithm],i=await r.loader();JC(t,e.config);const o=await i.render(e,t,pA,{algorithm:r.algorithm});return ML(t.node()),o},"render"),Zc="dagre",AI=b((e="",{fallback:t=Zc}={})=>{if(Object.hasOwn(rn,e))return e;for(const r of[t,Zc])if(Object.hasOwn(rn,r))return Mt.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Neither layout algorithm ${e}, ${t}, nor ${Zc} is registered.`)},"getRegisteredLayoutAlgorithm"),bA=b(e=>{const{securityLevel:t}=Xe();let r=He("body");if(t==="sandbox"){const a=He(`#i${e}`).node()?.contentDocument??document;r=He(a.body)}return r.select(`#${e}`)},"selectSvgElement"),mu="comm",yb="rule",xb="decl",CA="@media",wA="@import",kA="@supports",SA="@namespace",Yh="@keyframes",bb="@layer",vA="@scope",TA=Math.abs,Zs=String.fromCharCode;function Cb(e){return e.trim()}function Xh(e,t,r){return e.replace(t,r)}function za(e,t){return e.charCodeAt(t)|0}function cs(e,t,r){return e.slice(t,r)}function Vi(e){return e.length}function wb(e){return e.length}function Pn(e,t){return t.push(e),e}var tc=1,hs=1,kb=0,Mi=0,Er=0,ys="";function yu(e,t,r,i,o,a,s,n){return{value:e,root:t,parent:r,type:i,props:o,children:a,line:tc,column:hs,length:s,return:"",siblings:n}}function MA(){return Er}function _A(){return Er=Mi>0?za(ys,--Mi):0,hs--,Er===10&&(hs=1,tc--),Er}function Oi(){return Er=Mi<kb?za(ys,Mi++):0,hs++,Er===10&&(hs=1,tc++),Er}function qo(){return za(ys,Mi)}function el(){return Mi}function ec(e,t){return cs(ys,e,t)}function on(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function BA(e){return tc=hs=1,kb=Vi(ys=e),Mi=0,[]}function LA(e){return ys="",e}function Kc(e){return Cb(ec(Mi-1,Gh(e===91?e+2:e===40?e+1:e)))}function AA(e){for(;(Er=qo())&&Er<33;)Oi();return on(e)>2||on(Er)>3?"":" "}function FA(e,t){for(;--t&&Oi()&&!(Er<48||Er>102||Er>57&&Er<65||Er>70&&Er<97););return ec(e,el()+(t<6&&qo()==32&&Oi()==32))}function Gh(e){for(;Oi();)switch(Er){case e:return Mi;case 34:case 39:e!==34&&e!==39&&Gh(Er);break;case 40:e===41&&Gh(e);break;case 92:Oi();break}return Mi}function $A(e,t){for(;Oi()&&e+Er!==57;)if(e+Er===84&&qo()===47)break;return"/*"+ec(t,Mi-1)+"*"+Zs(e===47?e:Oi())}function EA(e){for(;!on(qo());)Oi();return ec(e,Mi)}function PA(e){return LA(rl("",null,null,null,[""],e=BA(e),0,[0],e))}function rl(e,t,r,i,o,a,s,n,l){for(var c=0,h=0,d=s,u=0,f=0,p=0,g=1,m=1,y=1,x=0,C=0,k="",v=o,M=a,A=i,L=k;m;)switch(p=C,C=Oi()){case 40:p!=108&&za(L,d-1)==58?(x++,L+="("):L+=Kc(C);break;case 41:x--,L+=")";break;case 34:case 39:case 91:L+=Kc(C);break;case 9:case 10:case 13:case 32:if(x>0){L+=Zs(C);break}L+=AA(p);break;case 92:L+=FA(el()-1,7);continue;case 47:switch(qo()){case 42:case 47:Pn(IA($A(Oi(),el()),t,r,l),l),(on(p||1)==5||on(qo()||1)==5)&&Vi(L)&&cs(L,-1,void 0)!==" "&&(L+=" ");break;default:L+="/"}break;case 123*g:n[c++]=Vi(L)*y;case 125*g:case 59:case 0:if(x>0&&C){L+=Zs(C);break}switch(C){case 0:case 125:m=0;case 59+h:y==-1&&(L=Xh(L,/\f/g,"")),f>0&&(Vi(L)-d||g===0)&&Pn(f>32?ip(L+";",i,r,d-1,l):ip(Xh(L," ","")+";",i,r,d-2,l),l);break;case 59:L+=";";default:if(Pn(A=rp(L,t,r,c,h,o,n,k,v=[],M=[],d,a),a),C===123)if(h===0)rl(L,t,A,A,v,a,d,n,M);else{switch(u){case 99:if(za(L,3)===110)break;case 108:if(za(L,2)===97)break;default:h=0;case 100:case 109:case 115:}h?rl(e,A,A,i&&Pn(rp(e,A,A,0,0,o,n,k,o,v=[],d,M),M),o,M,d,n,i?v:M):rl(L,A,A,A,[""],M,0,n,M)}}c=h=f=0,g=y=1,k=L="",d=s;break;case 58:d=1+Vi(L),f=p;default:if(g<1){if(C==123)--g;else if(C==125&&g++==0&&_A()==125)continue}switch(L+=Zs(C),C*g){case 38:y=h>0?1:(L+="\f",-1);break;case 44:if(x>0)break;n[c++]=(Vi(L)-1)*y,y=1;break;case 64:qo()===45&&(L+=Kc(Oi())),u=qo(),h=d=Vi(k=L+=EA(el())),C++;break;case 45:p===45&&Vi(L)==2&&(g=0)}}return a}function rp(e,t,r,i,o,a,s,n,l,c,h,d){for(var u=o-1,f=o===0?a:[""],p=wb(f),g=0,m=0,y=0;g<i;++g)for(var x=0,C=cs(e,u+1,u=TA(m=s[g])),k=e;x<p;++x)(k=Cb(m>0?f[x]+" "+C:Xh(C,/&\f/g,f[x])))&&(l[y++]=k);return yu(e,t,r,o===0?yb:n,l,c,h,d)}function IA(e,t,r,i){return yu(e,t,r,mu,Zs(MA()),cs(e,2,-2),0,i)}function ip(e,t,r,i,o){return yu(e,t,r,xb,cs(e,0,i),cs(e,i+1,-1),i,o)}function jh(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function OA(e,t,r,i){switch(e.type){case bb:if(e.children.length)break;case wA:case SA:case xb:return e.return=e.return||e.value;case mu:return"";case Yh:return e.return=e.value+"{"+jh(e.children,i)+"}";case yb:if(!Vi(e.value=e.props.join(",")))return""}return Vi(r=jh(e.children,i))?e.return=e.value+"{"+r+"}":""}function DA(e){var t=wb(e);return function(r,i,o,a){for(var s="",n=0;n<t;n++)s+=e[n](r,i,o,a)||"";return s}}var Sb="c4",RA=b(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),NA=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./Bz2AaX7v.js");return{diagram:t}},__vite__mapDeps([43,44]),import.meta.url);return{id:Sb,diagram:e}},"loader"),qA={id:Sb,detector:RA,loader:NA},WA=qA,vb="flowchart-v2",zA=b(e=>/^\s*(graph|flowchart)/.test(e),"detector"),HA=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./DMfS3QUv.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([45,46,47,48,44,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);return{id:vb,diagram:e}},"loader"),YA={id:vb,detector:zA,loader:HA},XA=YA,Tb="agentflow",GA=b(e=>/^\s*agentflow-beta\b/.test(e),"detector"),jA=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./Bdj20t_M.js");return{diagram:t}},__vite__mapDeps([49,46,47,48,44,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);return{id:Tb,diagram:e}},"loader"),UA={id:Tb,detector:GA,loader:jA},VA=UA,Mb="swimlane",ZA=b(e=>/^\s*swimlane-beta\b/.test(e),"detector"),KA=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./BUvLOETw.js");return{diagram:t}},__vite__mapDeps([50,45,46,47,48,44,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);return{id:Mb,diagram:e}},"loader"),QA={id:Mb,detector:ZA,loader:KA},JA=QA,_b="er",t5=b(e=>/^\s*erDiagram/.test(e),"detector"),e5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./C2FKcF8a.js");return{diagram:t}},__vite__mapDeps([51,47,48]),import.meta.url);return{id:_b,diagram:e}},"loader"),r5={id:_b,detector:t5,loader:e5},i5=r5,Bb="gitGraph",o5=b(e=>/^\s*gitGraph/.test(e),"detector"),a5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./Dmv_LV6R.js");return{diagram:t}},__vite__mapDeps([52,53,54,55,4,5]),import.meta.url);return{id:Bb,diagram:e}},"loader"),s5={id:Bb,detector:o5,loader:a5},n5=s5,Lb="gantt",l5=b(e=>/^\s*gantt/.test(e),"detector"),c5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./WKN7DEK1.js");return{diagram:t}},__vite__mapDeps([56,26,57,58,59]),import.meta.url);return{id:Lb,diagram:e}},"loader"),h5={id:Lb,detector:l5,loader:c5},d5=h5,Ab="info",u5=b(e=>/^\s*info/.test(e),"detector"),f5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./COZ8XMYr.js");return{diagram:t}},__vite__mapDeps([60,55,4,5]),import.meta.url);return{id:Ab,diagram:e}},"loader"),g5={id:Ab,detector:u5,loader:f5},Fb="pie",p5=b(e=>/^\s*pie/.test(e),"detector"),m5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./CvEzUeZj.js");return{diagram:t}},__vite__mapDeps([61,54,55,4,5,62,63,58]),import.meta.url);return{id:Fb,diagram:e}},"loader"),y5={id:Fb,detector:p5,loader:m5},$b="quadrantChart",x5=b(e=>/^\s*quadrantChart/.test(e),"detector"),b5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./B_F8B07u.js");return{diagram:t}},__vite__mapDeps([64,57,58,59]),import.meta.url);return{id:$b,diagram:e}},"loader"),C5={id:$b,detector:x5,loader:b5},w5=C5,Eb="xychart",k5=b(e=>/^\s*xychart(-beta)?/.test(e),"detector"),S5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./B1wLVJWc.js");return{diagram:t}},__vite__mapDeps([65,58,63,57,59]),import.meta.url);return{id:Eb,diagram:e}},"loader"),v5={id:Eb,detector:k5,loader:S5},T5=v5,Pb="requirement",M5=b(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),_5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./D3ma4MWK.js");return{diagram:t}},__vite__mapDeps([66,47,48]),import.meta.url);return{id:Pb,diagram:e}},"loader"),B5={id:Pb,detector:M5,loader:_5},L5=B5,Ib="sequence",A5=b(e=>/^\s*sequenceDiagram/.test(e),"detector"),F5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./Dr_BXnmT.js");return{diagram:t}},__vite__mapDeps([67,53,44]),import.meta.url);return{id:Ib,diagram:e}},"loader"),$5={id:Ib,detector:A5,loader:F5},E5=$5,Ob="classDiagram",P5=b(e=>/^\s*classDiagram/.test(e),"detector"),I5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./B1zCpBoo.js");return{diagram:t}},__vite__mapDeps([68,46,47,48,44,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);return{id:Ob,diagram:e}},"loader"),O5={id:Ob,detector:P5,loader:I5},D5=O5,Db="stateDiagram",R5=b(e=>/^\s*stateDiagram/.test(e),"detector"),N5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./DW02E8JU.js");return{diagram:t}},__vite__mapDeps([69,47,48,44,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);return{id:Db,diagram:e}},"loader"),q5={id:Db,detector:R5,loader:N5},W5=q5,Rb="journey",z5=b(e=>/^\s*journey/.test(e),"detector"),H5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./CZLMJ41d.js");return{diagram:t}},__vite__mapDeps([70,46,44,62]),import.meta.url);return{id:Rb,diagram:e}},"loader"),Y5={id:Rb,detector:z5,loader:H5},X5=Y5,In=4,As=75,G5=b(e=>{const t=[];for(const o of e.split(/\s+/)){let a=[...o];for(;a.length>As;)t.push(a.slice(0,As).join("")),a=a.slice(As);a.length>0&&t.push(a.join(""))}const r=[];let i="";for(const o of t){const a=i?`${i} ${o}`:o;[...a].length>As?(r.push(i),i=o):i=a}if(i&&r.push(i),r.length>In){r.length=In;const o=r[In-1]??"";r[In-1]=`${[...o].slice(0,As-3).join("")}...`}return r},"wrapErrorMessage"),j5=b((e,t,r,i)=>{Mt.debug(`rendering svg for syntax error
302
+ `);const o=bA(t),a=o.append("g"),s=G5(i?.db.getErrorMessage?.()??""),n=s.length>0?500+s.length*56:512;o.attr("viewBox",`0 0 2412 ${n}`),nm(o,100,n,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`),s.forEach((l,c)=>{a.append("text").attr("class","error-text").attr("x",1440).attr("y",510+c*56).attr("font-size","42px").style("text-anchor","middle").text(l)})},"draw"),Nb={draw:j5},U5=Nb,Qc,V5={clear(){Qc=void 0},setErrorMessage(e){Qc=e},getErrorMessage(){return Qc}},Z5={db:V5,renderer:Nb,parser:{parse:b(()=>{},"parse")}},K5=Z5,qb="flowchart-elk",Q5=b((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout="elk",!0):!1,"detector"),J5=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./DMfS3QUv.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([45,46,47,48,44,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);return{id:qb,diagram:e}},"loader"),tF={id:qb,detector:Q5,loader:J5},eF=tF,Wb="timeline",rF=b(e=>/^\s*timeline/.test(e),"detector"),iF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./gq2RHuUM.js");return{diagram:t}},__vite__mapDeps([71,62]),import.meta.url);return{id:Wb,diagram:e}},"loader"),oF={id:Wb,detector:rF,loader:iF},aF=oF,zb="mindmap",sF=b(e=>/^\s*mindmap/.test(e),"detector"),nF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./VmPClZ6P.js");return{diagram:t}},__vite__mapDeps([72,47,48]),import.meta.url);return{id:zb,diagram:e}},"loader"),lF={id:zb,detector:sF,loader:nF},cF=lF,Hb="kanban",hF=b(e=>/^\s*kanban/.test(e),"detector"),dF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./UzQ5fjmd.js");return{diagram:t}},__vite__mapDeps([73,46]),import.meta.url);return{id:Hb,diagram:e}},"loader"),uF={id:Hb,detector:hF,loader:dF},fF=uF,Yb="sankey",gF=b(e=>/^\s*sankey(-beta)?/.test(e),"detector"),pF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./BtFywNMt.js");return{diagram:t}},__vite__mapDeps([74,63,58]),import.meta.url);return{id:Yb,diagram:e}},"loader"),mF={id:Yb,detector:gF,loader:pF},yF=mF,Xb="packet",xF=b(e=>/^\s*packet(-beta)?/.test(e),"detector"),bF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./IjQ_akx8.js");return{diagram:t}},__vite__mapDeps([75,54,55,4,5]),import.meta.url);return{id:Xb,diagram:e}},"loader"),CF={id:Xb,detector:xF,loader:bF},Gb="radar",wF=b(e=>/^\s*radar-beta/.test(e),"detector"),kF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./C7ldC6zu.js");return{diagram:t}},__vite__mapDeps([76,54,55,4,5]),import.meta.url);return{id:Gb,diagram:e}},"loader"),SF={id:Gb,detector:wF,loader:kF},jb="block",vF=b(e=>/^\s*block(-beta)?/.test(e),"detector"),TF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./DMmGJ3th.js");return{diagram:t}},__vite__mapDeps([77,46,38]),import.meta.url);return{id:jb,diagram:e}},"loader"),MF={id:jb,detector:vF,loader:TF},_F=MF,Ub="treeView",BF=b(e=>/^\s*treeView-beta/.test(e),"detector"),LF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./BS3KKa6i.js");return{diagram:t}},__vite__mapDeps([78,53,54,55,4,5]),import.meta.url);return{id:Ub,diagram:e}},"loader"),AF={id:Ub,detector:BF,loader:LF},FF=AF,Vb="architecture",$F=b(e=>/^\s*architecture/.test(e),"detector"),EF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./Dhhgf7-r.js");return{diagram:t}},__vite__mapDeps([79,54,55,4,5,42,26]),import.meta.url);return{id:Vb,diagram:e}},"loader"),PF={id:Vb,detector:$F,loader:EF},IF=PF,Zb="eventmodeling",OF=b(e=>/^\s*eventmodeling/.test(e),"detector"),DF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./DPADHNob.js");return{diagram:t}},__vite__mapDeps([80,54,55,4,5]),import.meta.url);return{id:Zb,diagram:e}},"loader"),RF={id:Zb,detector:OF,loader:DF},NF=RF,Kb="ishikawa",qF=b(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),WF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./C2ypXh8V.js");return{diagram:t}},[],import.meta.url);return{id:Kb,diagram:e}},"loader"),zF={id:Kb,detector:qF,loader:WF},Qb="venn",HF=b(e=>/^\s*venn-beta/.test(e),"detector"),YF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./D3in5AGo.js");return{diagram:t}},[],import.meta.url);return{id:Qb,diagram:e}},"loader"),XF={id:Qb,detector:HF,loader:YF},GF=XF,Jb="treemap",jF=b(e=>/^\s*treemap/.test(e),"detector"),UF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./DPcySxOl.js");return{diagram:t}},__vite__mapDeps([81,48,54,55,4,5,59,63,58]),import.meta.url);return{id:Jb,diagram:e}},"loader"),VF={id:Jb,detector:jF,loader:UF},t1="usecase",ZF=b(e=>/^\s*usecase-beta(?:\s|$)/.test(e),"detector"),KF=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./jfltPaLX.js");return{diagram:t}},__vite__mapDeps([82,47,48]),import.meta.url);return{id:t1,diagram:e}},"loader"),QF={id:t1,detector:ZF,loader:KF},e1="wardley",JF=b(e=>/^\s*wardley-beta/i.test(e),"detector"),t3=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./C7xfOFNZ.js");return{diagram:t}},__vite__mapDeps([83,54,55,4,5]),import.meta.url);return{id:e1,diagram:e}},"loader"),e3={id:e1,detector:JF,loader:t3},r3=e3,r1="cynefin",i3=b(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),o3=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./DTpCNXVX.js");return{diagram:t}},__vite__mapDeps([84,54,55,4,5]),import.meta.url);return{id:r1,diagram:e}},"loader"),a3={id:r1,detector:i3,loader:o3},i1="railroad",s3=b(e=>/^\s*railroad-beta/i.test(e),"detector"),n3=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./DE1vhlzN.js");return{diagram:t}},__vite__mapDeps([85,86,54,55,4,5]),import.meta.url);return{id:i1,diagram:e}},"loader"),l3={id:i1,detector:s3,loader:n3},o1="railroadEbnf",c3=b(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),h3=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./189zCzpy.js");return{diagram:t}},__vite__mapDeps([87,86,54,55,4,5]),import.meta.url);return{id:o1,diagram:e}},"loader"),d3={id:o1,detector:c3,loader:h3},a1="railroadAbnf",u3=b(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),f3=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./CrX2GQl1.js");return{diagram:t}},__vite__mapDeps([88,86,54,55,4,5]),import.meta.url);return{id:a1,diagram:e}},"loader"),g3={id:a1,detector:u3,loader:f3},s1="railroadPeg",p3=b(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),m3=b(async()=>{const{diagram:e}=await je(async()=>{const{diagram:t}=await import("./DzDnAGVP.js");return{diagram:t}},__vite__mapDeps([89,86,54,55,4,5]),import.meta.url);return{id:s1,diagram:e}},"loader"),y3={id:s1,detector:p3,loader:m3},op=!1,rc=b(()=>{op||(op=!0,dl("error",K5,e=>e.toLowerCase().trim()==="error"),dl("---",{db:{clear:b(()=>{},"clear")},styles:{},renderer:{draw:b(()=>{},"draw")},parser:{parse:b(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:b(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),dh(eF,cF,IF),dh(VA,WA,fF,D5,i5,d5,g5,y5,L5,E5,JA,XA,aF,n5,W5,X5,w5,yF,CF,T5,_F,NF,FF,SF,zF,VF,l3,d3,g3,y3,GF,r3,a3,QF))},"addDiagrams"),x3=b(async()=>{Mt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(fa).map(async([r,{detector:i,loader:o}])=>{if(o)try{mh(r)}catch{try{const{diagram:a,id:s}=await o();dl(s,a,i)}catch(a){throw Mt.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete fa[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){Mt.error(`Failed to load ${t.length} external diagrams`);for(const r of t)Mt.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),b3="graphics-document document";function n1(e,t){e.attr("role",b3),t!==""&&e.attr("aria-roledescription",t)}b(n1,"setA11yDiagramInfo");function l1(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}b(l1,"addSVGa11yTitleDescription");var ua,Il=(ua=class{constructor(t,r,i,o,a){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=a}static async fromText(t,r={}){const i=typeof t=="string"?{cleaned:t}:t,o=Mr(),a=ql(i.cleaned,o);try{mh(a)}catch{const u=g2(a);if(!u)throw new Up(`Diagram ${a} not found.`);const{id:f,diagram:p}=await u();dl(f,p)}const{db:s,parser:n,renderer:l,init:c}=mh(a);n.parser&&(n.parser.yy=s),s.clear?.(),c?.(o),r.title&&s.setDiagramTitle?.(r.title);let h=i.cleaned;if(s.preserveCommentsWhenParsing&&i.withComments){const u=o.maxTextSize??bd.maxTextSize;i.withComments.length>u?Mt.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):h=i.withComments}const d=TM(h)+`
303
+ `;return i.frontmatterLineOffset&&s.setFrontmatterLineOffset?.(i.frontmatterLineOffset),await n.parse(d),new ua(a,d,s,n,l)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},b(ua,"Diagram"),ua),ap=[],C3=b(()=>{ap.forEach(e=>{e()}),ap=[]},"attachFunctions"),w3=b(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function c1(e){const t=jp(e);if(!t)return{text:e,metadata:{}};const r=t.indent,i=r?t.body.split(`
304
+ `).map(s=>s.startsWith(r)?s.slice(r.length):s).join(`
305
+ `):t.body;let o=QC(i,{schema:KC})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const a={};return o.displayMode&&(a.displayMode=o.displayMode.toString()),o.title&&(a.title=o.title.toString()),o.config&&(a.config=o.config),{text:e.slice(t.length),metadata:a}}b(c1,"extractFrontMatter");var k3=b(e=>e.replace(/\r\n?/g,`
306
+ `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),S3=b(e=>{const{text:t,metadata:r}=c1(e),{displayMode:i,title:o,config:a={}}=r;return i&&(a.gantt||(a.gantt={}),a.gantt.displayMode=i),{title:o,config:a,text:t}},"processFrontmatter"),v3=b(e=>{const t=ui.detectInit(e)??{},r=ui.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:uM(e),directive:t}},"processDirectives");function xu(e){const t=e,r=k3(e),i=S3(r),o=v3(i.text),a=Ud(i.config,o.directive),s=o.text,n=w3(s),l=r.length>i.text.length?(r.substring(0,r.length-i.text.length).match(/\n/g)??[]).length:0;return{code:{raw:t,cleaned:n,withComments:s,frontmatterLineOffset:l},title:i.title,config:a}}b(xu,"preprocessDiagram");function h1(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}b(h1,"toBase64");var T3=5e4,M3="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",_3="sandbox",B3="loose",L3="http://www.w3.org/2000/svg",A3="http://www.w3.org/1999/xlink",F3="http://www.w3.org/1999/xhtml",$3="100%",E3="100%",P3="border:0;margin:0;",I3="margin:0",O3="allow-top-navigation-by-user-activation allow-popups",D3='The "iframe" tag is not supported by your browser.',R3=["foreignobject"],N3=["dominant-baseline"];function bu(e){const t=xu(e);cl();let r;try{r=ql(t.code.cleaned,Mr())}catch{r=void 0}return Cd(r),Z2(t.config??{}),t}b(bu,"processAndSetConfigs");async function d1(e,t){rc();try{const{code:r,config:i}=bu(e);return{diagramType:(await Il.fromText(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}finally{Cd(void 0)}}b(d1,"parse");var sp=b((e,t,r=[])=>{const i=Qp(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),q3=b((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=qr(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Jf(l.styles)||n.forEach(c=>{r.insertRule(sp(l.id,c,l.styles),r.cssRules.length)}),Jf(l.textStyles)||r.insertRule(sp(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=ph(o)+`
307
+ `}else i+=`${e.themeCSS}
308
+ `;return i+ph(r)},"createCssStyles"),W3=b((e,t)=>jh(PA(`${e}{${t}}`),DA([b(function(i,o,a,s){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===Yh)return;i.props=i.props.map(n=>n===e&&Array.isArray(i.children)&&i.children.every(c=>c.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(c.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[CA,kA,bb,vA,"@container","@starting-style"],Yh].includes(i.type)||(Mt.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=mu))},"addNamespace"),OA])),"compileCSS"),z3=b((e,t,r,i)=>{const o=q3(e,r),a=yw(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return W3(i,a)},"createUserStyles"),H3=b((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Go(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),Y3=b((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":E3,i=h1(`<body style="${I3}">${e}</body>`);return`<iframe style="width:${$3};height:${r};${P3}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${O3}">
309
+ ${D3}
310
+ </iframe>`},"putIntoIFrame"),np=b((e,t,r,i,o)=>{const a=e.append("div");a.attr("id",r),i&&a.attr("style",i);const s=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",L3);return o&&s.attr("xmlns:xlink",o),s.append("g"),e},"appendDivSvgG");function Uh(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}b(Uh,"sandboxedIframe");var X3=b((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),G3=b(async function(e,t,r){rc();const i=bu(t);let o=i.code;t=o.cleaned;const a=Mr();Mt.debug(a),t.length>(a?.maxTextSize??T3)&&(t=M3,o={raw:t,cleaned:t});const s=`#${e}`,n="i"+e,l="#"+n,c="d"+e,h="#"+c,d=b(()=>{const E=He(f?l:h).node();E&&"remove"in E&&E.remove()},"removeTempElements");let u=He(document.body);const f=a.securityLevel===_3,p=a.securityLevel===B3,g=a.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const F=Uh(He(r),n);u=He(F.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=He(r);np(u,e,c,`font-family: ${g}`,A3)}else{if(X3(document,e,c,n),f){const F=Uh(He(document.body),n);u=He(F.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=He("body");np(u,e,c)}let m,y;try{m=await Il.fromText(o,{title:i.title})}catch(F){if(a.suppressErrorRendering)throw d(),F;m=await Il.fromText("error"),y=F,m.db.setErrorMessage?.(Sy(F))}const x=u.select(h).node(),C=m.type,k=x.firstChild,v=k.firstChild,M=m.renderer.getClasses?.(t,m),A=z3(a,C,M,s),L=document.createElement("style");L.innerHTML=A,k.insertBefore(L,v);try{await m.renderer.draw(t,e,"12.3.0",m)}catch(F){throw a.suppressErrorRendering?d():U5.draw(t,e,"12.3.0"),F}const T=u.select(`${h} svg`),_=m.db.getAccTitle?.(),$=m.db.getAccDescription?.();f1(C,T,_,$);const D=b(()=>{u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",F3);let F=u.select(h).node().innerHTML;if(Mt.debug("config.arrowMarkerAbsolute",a.arrowMarkerAbsolute),F=H3(F,f,ao(a.arrowMarkerAbsolute)),f){const E=u.select(h+" svg").node();F=Y3(F,E)}else p||(F=os.sanitize(F,{ADD_TAGS:R3,ADD_ATTR:N3,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return C3(),F},"serializeSvg")();if(y)throw y;return d(),{diagramType:C,svg:D,bindFunctions:m.db.bindFunctions}},"renderDiagram"),j3=b(async function(e,t,r){try{return await G3(e,t,r)}finally{Cd(void 0)}},"render");function u1(e={}){const t=Pr({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),U2(t);const r=Yo.theme;t?.theme&&Object.hasOwn(ko,t.theme)?t.themeVariables=ko[t.theme].getThemeVariables(t.themeVariables):t&&(t.theme!=null&&t.theme!=="null"&&(t.theme=r),t.themeVariables=ko[r].getThemeVariables(t.themeVariables));const i=typeof t=="object"?j2(t):Jp();xd(i.logLevel),rc()}b(u1,"initialize");var U3=b((e,t={})=>{const{code:r}=xu(e);return Il.fromText(r,t)},"getDiagramFromText");function f1(e,t,r,i){n1(t,e),l1(t,r,i,t.attr("id"))}b(f1,"addA11yInfo");var ya=Object.freeze({render:j3,parse:d1,getDiagramFromText:U3,initialize:u1,getConfig:Mr,setConfig:tm,getSiteConfig:Jp,updateSiteConfig:V2,reset:b(()=>{cl()},"reset"),globalReset:b(()=>{cl(Yo)},"globalReset"),defaultConfig:Yo});xd(Mr().logLevel);cl(Mr());var V3=b((e,t,r)=>{Mt.warn(e),jd(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),g1=b(async function(e={querySelector:".mermaid"}){try{await Z3(e)}catch(t){if(jd(t)&&Mt.error(t.str),Mo.parseError&&Mo.parseError(t),!e.suppressErrors)throw Mt.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Z3=b(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=ya.getConfig();Mt.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");Mt.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(Mt.debug("Start On Load: "+i?.startOnLoad),ya.updateSiteConfig({startOnLoad:i?.startOnLoad}));const a=new ui.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let s;const n=[];for(const l of Array.from(o)){if(Mt.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${a.next()}`;s=l.innerHTML,s=Oy(ui.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=ui.detectInit(s);h&&Mt.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:u}=await x1(c,s,l);l.innerHTML=d,e&&await e(c),u&&u(l)}catch(d){V3(d,n,Mo.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),p1=b(function(e){ya.initialize(e)},"initialize"),K3=b(async function(e,t,r){Mt.warn("mermaid.init is deprecated. Please use run instead."),e&&p1(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await g1(i)},"init"),Q3=b(async(e,{lazyLoad:t=!0}={})=>{rc(),dh(...e),t===!1&&await x3()},"registerExternalDiagrams"),m1=b(function(){if(Mo.startOnLoad){const{startOnLoad:e}=ya.getConfig();e&&Mo.run().catch(t=>Mt.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",m1,!1);var J3=b(function(e){Mo.parseError=e},"setParseErrorHandler"),Ol=[],Jc=!1,y1=b(async()=>{if(!Jc){for(Jc=!0;Ol.length>0;){const e=Ol.shift();if(e)try{await e()}catch(t){Mt.error("Error executing queue",t)}}Jc=!1}},"executeQueue"),t$=b(async(e,t)=>new Promise((r,i)=>{const o=b(()=>new Promise((a,s)=>{ya.parse(e,t).then(n=>{a(n),r(n)},n=>{Mt.error("Error parsing",n),Mo.parseError?.(n),s(n),i(n)})}),"performCall");Ol.push(o),y1().catch(i)}),"parse"),x1=b((e,t,r)=>new Promise((i,o)=>{const a=b(()=>new Promise((s,n)=>{ya.render(e,t,r).then(l=>{s(l),i(l)},l=>{Mt.error("Error parsing",l),Mo.parseError?.(l),n(l),o(l)})}),"performCall");Ol.push(a),y1().catch(o)}),"render"),e$=b(()=>Object.keys(fa).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Mo={startOnLoad:!0,mermaidAPI:ya,parse:t$,render:x1,init:K3,run:g1,registerExternalDiagrams:Q3,registerLayoutLoaders:mb,initialize:p1,parseError:void 0,contentLoaded:m1,setParseErrorHandler:J3,detectType:ql,registerIconPacks:dm,getRegisteredDiagramsMetadata:e$},th=Mo;/*! Check if previously processed *//*!
311
+ * Wait for document loaded before starting the execution
312
+ */function r$(e,t=80){let r,i,o=!1,a=!1,s=0,n;async function l(){if(n=void 0,a||o||!i)return;const c=i,h=s;i=void 0,o=!0;try{await e(c,()=>!a&&h===s)}finally{o=!1,!a&&i&&(n=setTimeout(()=>void l(),t))}}return{update(c){a||r?.source===c.source&&r.isStreaming===c.isStreaming&&r.revision===c.revision||(r&&(!c.isStreaming||!r.isStreaming||c.revision!==r.revision||!c.source.startsWith(r.source))&&(s+=1),r=c,i=c,!o&&n===void 0&&l())},dispose(){a=!0,s+=1,i=void 0,n!==void 0&&clearTimeout(n)}}}const b1="http://www.w3.org/2000/svg",C1="http://www.w3.org/1999/xhtml",w1=["align-items","background","background-color","border","border-color","border-radius","border-style","border-width","box-sizing","color","display","fill","fill-opacity","flex","flex-direction","font-family","font-feature-settings","font-kerning","font-size","font-style","font-variant","font-variation-settings","font-weight","gap","height","justify-content","letter-spacing","line-height","margin","opacity","overflow","overflow-wrap","padding","rx","ry","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-width","text-align","text-anchor","text-transform","transform","transform-origin","vector-effect","white-space","-webkit-box-orient","-webkit-line-clamp","width","word-break"];function i$(e,t){const r=getComputedStyle(e);for(const i of w1){const o=r.getPropertyValue(i);o&&(t instanceof SVGElement||t instanceof HTMLElement)&&t.style.setProperty(i,o,"important")}}function o$(e,t){if(!(e instanceof HTMLElement)||e.dataset.storeNode!=="true"&&!e.matches("foreignObject.edge-label-surface > .labelBkg, .edge-label-html"))return;const r=getComputedStyle(e,"::before"),i=document.createElementNS(C1,"span");i.setAttribute("aria-hidden","true"),i.setAttribute("data-diagram-export-pseudo","before");for(const o of w1){const a=r.getPropertyValue(o);a&&i.style.setProperty(o,a)}for(const o of["position","z-index","top","right","bottom","left","pointer-events","mask-image","mask-composite","mask-size","mask-repeat"]){const a=r.getPropertyValue(o);a&&i.style.setProperty(o,a)}t.prepend(i)}function k1(e){const t=e.getAttribute("viewBox")?.trim().split(/[ ,]+/).map(Number),r=e.getBoundingClientRect(),i=t?.length===4?t[2]:0,o=t?.length===4?t[3]:0,a=e.getAttribute("width")??"",s=e.getAttribute("height")??"",n=/^\d+(?:\.\d+)?(?:px)?$/.test(a)?Number.parseFloat(a):0,l=/^\d+(?:\.\d+)?(?:px)?$/.test(s)?Number.parseFloat(s):0,c=e.classList.contains("diagram-svg-layer"),h=(c?n:0)||r.width||n||i||1,d=(c?l:0)||r.height||l||o||1;return{width:h,height:d}}function a$(e){let t=e;for(;t;){const r=getComputedStyle(t).backgroundColor;if(r&&r!=="transparent"&&r!=="rgba(0, 0, 0, 0)")return r;t=t.parentElement}return"transparent"}function ic(e){const t=e.querySelectorAll(".mermaid-svg > svg, svg.diagram-svg-layer"),r=t.length===1?t[0]:void 0,i=r?.closest(".mermaid-renderer, .diagram-renderer");if(!r||r.closest('[data-diagram-presentation-settled="false"]')||i?.getAttribute("data-render-settled")==="false"||i?.getAttribute("data-diagram-settled")==="false")throw new Error("Diagram SVG is unavailable");return r}function oc(e){const t=e.cloneNode(!0);t.setAttribute("xmlns",b1),t.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");const r=[e,...e.querySelectorAll("*")],i=[t,...t.querySelectorAll("*")];r.forEach((s,n)=>{const l=i[n];if(l){if(i$(s,l),s.parentElement?.localName==="foreignObject"&&s instanceof HTMLElement&&l.setAttribute("xmlns",C1),s instanceof HTMLElement&&l instanceof HTMLElement)for(const c of["position","isolation","z-index"])l.style.setProperty(c,getComputedStyle(s).getPropertyValue(c));o$(s,l)}});const{width:o,height:a}=k1(e);return t.hasAttribute("viewBox")||t.setAttribute("viewBox",`0 0 ${o} ${a}`),t.setAttribute("width",String(o)),t.setAttribute("height",String(a)),t.style.setProperty("width",`${o}px`,"important"),t.style.setProperty("height",`${a}px`,"important"),t.style.setProperty("overflow","hidden","important"),t.style.removeProperty("position"),t.style.removeProperty("left"),t.style.removeProperty("top"),t.style.removeProperty("max-width"),t.style.removeProperty("min-width"),t.style.removeProperty("transform"),t}function FI(e){return new XMLSerializer().serializeToString(oc(ic(e)))}async function Cu(e){const t=n=>n.trim().replace(/^["']|["']$/g,"").toLowerCase(),r=new Set([e,...e.querySelectorAll("[style]")].flatMap(n=>n.style.fontFamily.split(",").map(t))),i=[],o=n=>{let l;try{l=n.cssRules}catch(c){if(c instanceof DOMException&&c.name==="SecurityError")return;throw c}for(const c of Array.from(l))c instanceof CSSFontFaceRule&&r.has(t(c.style.getPropertyValue("font-family")))?i.push(c):c instanceof CSSImportRule&&c.styleSheet?o(c.styleSheet):"cssRules"in c&&o(c)};for(const n of Array.from(e.ownerDocument.styleSheets))o(n);if(!i.length)return;const a=await Promise.all(i.map(async n=>{const l=[...n.cssText.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/g)];let c=n.cssText;for(const[h,,d]of l){if(d.startsWith("data:"))continue;const u=await fetch(new URL(d,n.parentStyleSheet?.href??e.ownerDocument.baseURI));if(!u.ok)throw new Error("Diagram font is unavailable");const f=await u.blob(),p=await new Promise((g,m)=>{const y=new FileReader;y.onload=()=>g(String(y.result)),y.onerror=()=>m(y.error??new Error("Diagram font encoding failed")),y.readAsDataURL(f)});c=c.replace(h,`url("${p}")`)}return c})),s=document.createElementNS(b1,"style");s.textContent=a.join(`
313
+ `),e.prepend(s)}async function s$(e){const t=oc(ic(e));await Cu(t),await GC(new XMLSerializer().serializeToString(t))}async function n$(e){const t=ic(e),r=oc(t),{width:i,height:o}=k1(t);await Cu(r);const a=2,s=new Image;try{s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`,await s.decode();const n=document.createElement("canvas");n.width=Math.round(i*a),n.height=Math.round(o*a);const l=n.getContext("2d");if(!l)throw new Error("Canvas context is unavailable");l.fillStyle=a$(t),l.fillRect(0,0,n.width,n.height),l.drawImage(s,0,0,n.width,n.height);const c=await new Promise((h,d)=>{n.toBlob(u=>u?h(u):d(new Error("PNG encoding failed")),"image/png")});await navigator.clipboard.write([new ClipboardItem({"image/png":c})])}finally{s.src=""}}async function l$(e,t="diagram"){const r=oc(ic(e));await Cu(r);const i=new Blob([new XMLSerializer().serializeToString(r)],{type:"image/svg+xml"}),o=URL.createObjectURL(i),a=document.createElement("a");a.href=o,a.download=`${t.replace(/[^a-z0-9._-]+/gi,"-").replace(/^-|-$/g,"")||"diagram"}.svg`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(o)}var c$=er("<!> <!> <!>",1),h$=er("<!> <!>",1);function wu(e,t){if(new.target)return _o({component:wu,...e});Ao(t,!0);let r=ze(t,"container",7),i=ze(t,"fileName",7,"diagram"),o=ze(t,"compactTrigger",7,!1);async function a(){if(!r())return uo.error(Ye.diagram_actions_copyFailed_error());try{await n$(r()),uo.success(Ye.diagram_actions_imageCopied_label())}catch{uo.error(Ye.diagram_actions_copyFailed_error())}}async function s(){if(!r())return uo.error(Ye.diagram_actions_copyFailed_error());try{await s$(r()),uo.success(Ye.diagram_actions_svgCopied_label())}catch{uo.error(Ye.diagram_actions_copyFailed_error())}}async function n(){if(!r())return uo.error(Ye.diagram_actions_downloadFailed_error());try{await l$(r(),i()),uo.success(Ye.diagram_actions_svgDownloaded_label())}catch{uo.error(Ye.diagram_actions_downloadFailed_error())}}var l={get container(){return r()},set container(d){r(d),Me()},get fileName(){return i()},set fileName(d="diagram"){i(d),Me()},get compactTrigger(){return o()},set compactTrigger(d=!1){o(d),Me()},$set:Bo,$on:(d,u)=>Lo(t,d,u)},c=zo(),h=Qr(c);return ea(h,()=>XC,(d,u)=>{u(d,{children:(f,p)=>{var g=h$(),m=Qr(g);{let x=Et(()=>Ye.diagram_actions_menu_ariaLabel()),C=Et(()=>o()?"size-(--control-height-compact) p-0":void 0);ea(m,()=>zC,(k,v)=>{v(k,{get"aria-label"(){return S(x)},get class(){return S(C)},children:(M,A)=>{HC(M,{class:"size-3.5"})},$$slots:{default:!0}})})}var y=qe(m,2);ea(y,()=>YC,(x,C)=>{C(x,{align:"end",children:(k,v)=>{var M=c$(),A=Qr(M);ea(A,()=>dc,(_,$)=>{$(_,{onSelect:()=>void a(),children:(P,D)=>{zs();var F=zn();ar(E=>pr(F,E),[()=>Ye.diagram_actions_copyImage_label()]),ge(P,F)},$$slots:{default:!0}})});var L=qe(A,2);ea(L,()=>dc,(_,$)=>{$(_,{onSelect:()=>void s(),children:(P,D)=>{zs();var F=zn();ar(E=>pr(F,E),[()=>Ye.diagram_actions_copySvg_label()]),ge(P,F)},$$slots:{default:!0}})});var T=qe(L,2);ea(T,()=>dc,(_,$)=>{$(_,{onSelect:()=>void n(),children:(P,D)=>{zs();var F=zn();ar(E=>pr(F,E),[()=>Ye.diagram_actions_downloadSvg_label()]),ge(P,F)},$$slots:{default:!0}})}),ge(k,M)},$$slots:{default:!0}})}),ge(f,g)},$$slots:{default:!0}})}),ge(e,c),Fo(l)}const d$="Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",u$="Inter";function ac(e,t,r){const i=e.getPropertyValue(t).trim();if(!i&&r)return ac(e,r);if(!i)throw new Error(`Missing Mermaid design token: ${t}`);return i}function Gi(e,t,r){const i=ac(e,t,r);if(i.startsWith("color-mix(")&&typeof document<"u"){const o=document.createElement("canvas");o.width=1,o.height=1;const a=o.getContext("2d");if(a){a.fillStyle=i,a.fillRect(0,0,1,1);const[s,n,l,c]=a.getImageData(0,0,1,1).data;return c===255?`rgb(${s}, ${n}, ${l})`:`rgba(${s}, ${n}, ${l}, ${c/255})`}}return/^(#|rgb|hsl|oklch|color(?:-mix)?\()/.test(i)?i:`hsl(${i})`}function f$(e,t,r){const i=ac(e,t,r);if(!i.endsWith("rem"))return i;const o=Number.parseFloat(e.fontSize);if(!Number.isFinite(o))throw new Error("Missing root font size for Mermaid");return`${Number.parseFloat(i)*o}px`}function g$(e,t=!0){const r=Gi(e,"--foreground"),i=Gi(e,"--card-foreground"),o=Gi(e,"--muted"),a=Gi(e,"--border"),s=Gi(e,"--accent"),n=Gi(e,"--accent-foreground"),l=Gi(e,"--diagram-canvas","--background"),c=Gi(e,"--diagram-node-surface","--card"),h=Gi(e,"--diagram-connector","--muted-foreground"),d=Gi(e,"--muted-foreground"),u=e.getPropertyValue("--font-ui").trim()||d$,f=f$(e,"--text-caption-size");return ac(e,"--radius-small"),{startOnLoad:!1,theme:"base",look:"classic",elk:{preset:"legacy",lineHops:!1,straightenEdges:!1,orientFeedbackEdges:!1},securityLevel:"loose",fontFamily:u,fontSize:Number.parseFloat(f),htmlLabels:t,themeCSS:[".label, foreignObject { transition-property: opacity, color, background-color !important; }",`.cluster-label text { fill: ${d}; }`,`.cluster-label span { color: ${d}; }`].join(`
314
+ `),flowchart:{useMaxWidth:!1,curve:"stepAfter",diagramPadding:8,nodeSpacing:32,rankSpacing:40,wrappingWidth:200,minNodeWidth:0},sequence:{useMaxWidth:!1,wrap:!0,mirrorActors:!1,actorMargin:40,boxMargin:8,boxTextMargin:6,noteMargin:8,messageMargin:24,width:140,wrapPadding:6},class:{htmlLabels:!1},state:{minNodeWidth:0,wrappingWidth:200,nodeSpacing:48,rankSpacing:48,padding:8},themeVariables:{background:l,primaryColor:c,primaryTextColor:r,primaryBorderColor:c,secondaryColor:o,secondaryTextColor:r,secondaryBorderColor:o,tertiaryColor:l,tertiaryTextColor:r,tertiaryBorderColor:a,lineColor:h,arrowheadColor:h,textColor:r,mainBkg:c,nodeBkg:c,nodeBorder:c,nodeTextColor:i,clusterBkg:l,clusterBorder:a,defaultLinkColor:h,edgeLabelBackground:l,titleColor:r,actorBkg:c,actorBorder:c,actorTextColor:i,actorLineColor:a,signalColor:h,signalTextColor:r,labelBoxBkgColor:o,labelBoxBorderColor:a,labelTextColor:r,loopTextColor:r,activationBkgColor:s,activationBorderColor:a,noteBkgColor:s,noteBorderColor:a,noteTextColor:n,transitionColor:h,transitionLabelColor:d,stateBkg:c,stateLabelColor:i,labelBackgroundColor:l,compositeBackground:l,compositeTitleBackground:l,compositeBorder:a,classText:i,fillType0:c,fillType1:o,fontFamily:u}}}let lp=Promise.resolve();function p$(e,t=()=>!0){const r=async()=>{if(t()&&(await new Promise(o=>setTimeout(o,0)),!!t()))return e()},i=lp.then(r,r);return lp=i.then(()=>{},()=>{}),i}const m$=/[./\\:_-]/;function sc(e){const t=[];let r="";const i=(o,a=!1)=>{r&&t.push({text:r,breakAfter:o,hardBreak:a}),r=""};for(let o=0;o<e.length;o+=1){const a=e[o],s=e[o-1]??"";if(r&&/[A-Z]/.test(a)&&/[a-z0-9]/.test(s)&&i(!0),a===`
315
+ `){i(!0,!0);continue}r+=a,(/\s/.test(a)||m$.test(a))&&i(!0)}return i(!1),t}function cp(e){return sc(e).map(t=>t.text.trim()).filter(Boolean)}function ku(e){if(/\s/.test(e)||!/\.[A-Za-z][A-Za-z0-9]*$/.test(e))return null;const t=e.split(".");return t.length<=2?e.length<=21?[e]:[t[0],`.${t[1]}`]:[`${t.slice(0,-2).join(".")}.`,t.slice(-2).join(".")]}function y$(e){const t=ku(e);return t||e.split(/\s+/).flatMap(r=>r.match(/[^./\\]+[./\\]?/g)??[]).filter(Boolean)}const x$=new Intl.Segmenter(void 0,{granularity:"grapheme"});function Vh(e){return Array.from(x$.segment(e),({segment:t})=>t)}function hp(e,t,r,i=!1){const o=Math.max(1,t);let a=1,s="";for(const[n,l]of e.entries()){const c=l.replace(/[\t\r\f ]+/g," "),h=`${s}${c}`.trimStart();if(r(h.trimEnd())<=o){s=h;continue}s.trim()&&(a+=1),s="";for(const d of Vh(c.trimStart()))s&&r(`${s}${d}`.trimEnd())>o&&(a+=1,s=""),s+=d;i&&r(c.trim())>o&&n<e.length-1&&(a+=1,s="")}return a}function b$(e){const t=new Map(e.map(({id:i,nodes:o})=>[i,[...o]])),r=new Map;for(const i of t.keys()){const o=new Set,a=s=>{if(!(s===i||o.has(s))){o.add(s);for(const n of t.get(s)??[])a(n)}};for(const s of t.get(i)??[])a(s);r.set(i,o)}return r}function Su(e,t){return t.has(e.id)?e.id:[...t.keys()].filter(r=>e.id.endsWith(`-${r}`)).toSorted((r,i)=>i.length-r.length)[0]}function S1(e,t,r){const i=document.createElementNS("http://www.w3.org/2000/svg","rect");i.classList.add("edge-label-knockout"),i.setAttribute("x",String(r.x-6)),i.setAttribute("y",String(r.y-4)),i.setAttribute("width",String(r.width+12)),i.setAttribute("height",String(r.height+8)),i.setAttribute("rx","2"),i.dataset.labelPaddingX="6",i.dataset.labelPaddingY="4",e.insertBefore(i,t)}function dp(e){const t=[];for(const r of e.querySelectorAll("g.edgeLabel")){if(r.querySelector(".edge-label-knockout, rect.background, foreignObject"))continue;const i=r.querySelector("text");i&&t.push({parent:r,before:r.firstElementChild,bounds:i.getBBox()})}for(const r of e.querySelectorAll("text.messageText, text.loopText")){if(r.dataset.labelKnockout==="true"||!r.textContent?.trim())continue;const i=r.parentElement;i&&t.push({parent:i,before:r,bounds:r.getBBox(),text:r})}for(const{parent:r,before:i,bounds:o,text:a}of t)S1(r,i,o),a&&(a.dataset.labelKnockout="true")}function C$(e){const t=getComputedStyle(e),r=t.font||`${t.fontStyle} ${t.fontWeight} ${t.fontSize} ${t.fontFamily}`;return document.fonts?.load(r,e.textContent??"")}const up="rect, circle, ellipse, polygon, path",fp=new WeakMap;function w$(){const e=new Map;let t;return r=>{if(e.has(r))return e.get(r);let i=r==="none"?wi(0,0,0,0):ss(r)?.rgb()??null;if(!i&&typeof CSS<"u"&&CSS.supports("color",r)){if(t===void 0){const o=document.createElement("canvas");o.width=o.height=1,t=o.getContext("2d")}if(t){t.clearRect(0,0,1,1),t.fillStyle=r,t.fillRect(0,0,1,1);const[o,a,s,n]=t.getImageData(0,0,1,1).data;i=wi(o,a,s,n/255)}}return i=i?.clamp()??null,e.set(r,i),i}}function On(e,t){const r=e.opacity+t.opacity*(1-e.opacity);if(!r)return wi(0,0,0,0);const i=(o,a)=>(o*e.opacity+a*t.opacity*(1-e.opacity))/r;return wi(i(e.r,t.r),i(e.g,t.g),i(e.b,t.b),r)}function Dn(e){return e?e.endsWith("%")?Number.parseFloat(e)/100:Number(e):1}function k$(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;for(const d of fp.get(e)??[])d();const r=[];fp.set(e,r);const i=w$();let o=wi(0,0,0,0);for(let d=e;d;d=d.parentElement){const u=getComputedStyle(d);if(u.backgroundImage&&u.backgroundImage!=="none")return;const f=i(u.backgroundColor);if(!f)return;if(o=On(o,f),o.opacity===1)break}if(o.opacity!==1)return;const a=[...e.querySelectorAll("g.cluster")],s=new Map(a.map(d=>[d,t?Su(d,t):d.id])),n=d=>{const u=s.get(d)??d.id.match(/flowchart-(.+?)-\d+$/)?.[1]??d.id,f=a.filter(p=>{const g=s.get(p);return p!==d&&g&&t?.get(g)?.has(u)});return f.length?f.sort((p,g)=>t.get(s.get(p)).size-t.get(s.get(g)).size)[0]:d.parentElement?.closest("g.cluster")??void 0},l=new Map,c=(d,u=new Set)=>{if(l.has(d))return l.get(d);if(u.has(d))return null;u.add(d);const f=n(d),p=f?c(f,u):o;if(!p)return null;const g=d.querySelector(":scope > .label-container"),m=g?.matches(up)?g:g?.querySelector(up)??d.querySelector(":scope > rect, :scope > circle, :scope > ellipse, :scope > polygon, :scope > path");if(!m)return null;const y=getComputedStyle(m),x=i(y.fill),C=x?On(wi(x.r,x.g,x.b,x.opacity*Dn(y.fillOpacity)*Dn(y.opacity)),p):null;return l.set(d,C),C},h=[];for(const d of e.querySelectorAll("g.node, g.cluster")){const u=c(d);if(!u)continue;const f=d.querySelector(":scope > .label, :scope > .cluster-label");if(f)for(const p of f.querySelectorAll("text, tspan, foreignObject *")){if(p.closest("svg")!==e||![...p.childNodes].some(T=>T.nodeType===3&&T.textContent?.trim()))continue;let g=!1,m=u;const y=[];for(let T=p;T&&T!==e;T=T.parentElement){const _=getComputedStyle(T);(_.display==="none"||_.visibility==="hidden"||Dn(_.opacity)!==1)&&(g=!0),T.namespaceURI==="http://www.w3.org/1999/xhtml"&&y.unshift(T)}if(g)continue;for(const T of y){const _=getComputedStyle(T),$=i(_.backgroundColor);if(!$||_.backgroundImage&&_.backgroundImage!=="none"){g=!0;break}m=On($,m)}if(g)continue;const x=getComputedStyle(p),C=p.namespaceURI==="http://www.w3.org/1999/xhtml"?"color":"fill",k=i(x.getPropertyValue(C)),v=C==="fill"?Dn(x.fillOpacity):1;if(!k||!k.opacity||!v)continue;const M=T=>DC(On(wi(T.r,T.g,T.b,T.opacity*v),m).formatHex(),m.formatHex()).ratio;if(M(k)>=4.5)continue;const L=[i(getComputedStyle(e).color),wi(0,0,0),wi(255,255,255)].filter(T=>T!==null).filter(T=>M(T)>=4.55)[0];L&&h.push({element:p,property:C,value:L.formatRgb()})}}for(const{element:d,property:u,value:f}of h){const p=d.style.getPropertyValue(u),g=d.style.getPropertyPriority(u);r.push(()=>{p?d.style.setProperty(u,p,g):d.style.removeProperty(u)}),d.style.setProperty(u,f,"important")}}const v1=6,ti=16,S$=18,v$=4,Rn=7,T1=8,vu=8;function Pi(e,t){return t==="top"?Lt(e,.5,0):t==="right"?Lt(e,1,.5):t==="bottom"?Lt(e,.5,1):Lt(e,0,.5)}function T$(e,t){const r=e.x+e.width/2,i=t.filter(Number.isFinite).toSorted((s,n)=>s-n);if(!i.some(s=>Math.abs(s-r)<=1))return r;const o=i.length+1,a=Math.min(ti,e.width*.6/(o-1));return r-a*(o-1)/2}function M$(e,t){const r=e.x+e.width/2;if(!t.some(a=>a<r)||!t.some(a=>a>r)||t.every(a=>Math.abs(a-r)>=ti))return;const i=Math.min(...t)-ti,o=Math.min(e.width/2,e.corner?.x??0);return i>=e.x+o&&i<=e.x+e.width-o?i:void 0}function Tu(e,t,r){const i=e.getScreenCTM(),o=Math.hypot(r.x-t.x,r.y-t.y);if(!i||o<=0)return 1;const a=new DOMPoint(t.x,t.y).matrixTransform(i),s=new DOMPoint(r.x,r.y).matrixTransform(i);return Math.hypot(s.x-a.x,s.y-a.y)/o||1}const Gr=24,_$=32;function an(e){return Math.ceil(Math.max(e,18))+Gr+_$}function B$(e,t,r,i,o=!1){if((!o||r==="upper")&&t.y>=e.y+e.height+16){const u=Pi(e,"bottom"),f=Pi(t,"top"),p=(u.y+f.y)/2,g=vr([u,{x:u.x,y:p},{x:f.x,y:p},f]),m=i.filter(y=>![e,t].some(x=>Math.abs(y.x-x.x)<.001&&Math.abs(y.y-x.y)<.001&&Math.abs(y.width-x.width)<.001&&Math.abs(y.height-x.height)<.001));if(or(g).every(y=>!m.some(x=>Sr(y,x,8))))return g}const a=r==="upper"&&t.y>=e.y+e.height,s=r==="upper"&&!a?"top":"right";if(o&&a){const u=Pi(e,"bottom"),f=Pi(t,"top"),p={x:Math.max(t.x,Math.min(u.x,t.x+t.width)),y:f.y},g=(x,C)=>Math.abs(x.x-C.x)<.001&&Math.abs(x.y-C.y)<.001&&Math.abs(x.width-C.width)<.001&&Math.abs(x.height-C.height)<.001,m={start:u,end:p};if(Math.abs(u.x-p.x)<.001&&!i.some(x=>!g(x,e)&&!g(x,t)&&Sr(m,x,vu)))return[u,p]}const n=a?"right":r==="upper"?"top":t.x>=e.x+e.width?"left":"right",l=Pi(e,s),c=Pi(t,n),h=o?16:32;if(s==="top"){const u=Math.min(...i.map(f=>f.y),t.y,e.y)-h;if(Math.abs(l.x-c.x)<.001){const f=Math.max(e.x+e.width,t.x+t.width,...i.map(p=>p.x+p.width))+h;return vr([l,{x:l.x,y:u},{x:f,y:u},{x:f,y:c.y},c])}return vr([l,{x:l.x,y:u},{x:c.x,y:u},c])}if(n==="left"&&l.y>=t.y&&l.y<=t.y+t.height)return[l,{x:t.x,y:l.y}];if(n==="left"){if(Math.abs(l.y-c.y)<.001)return[l,c];const u=(l.x+c.x)/2;return[l,{x:u,y:l.y},{x:u,y:c.y},c]}const d=Math.max(...i.map(u=>u.x+u.width))+h*2;return vr([l,{x:d,y:l.y},{x:d,y:c.y},c])}function L$(e,t,r,i=!1){const o=Pi(e,"bottom"),a=Pi(t,i?"left":"bottom"),s=i?16:32,n=Math.max(...r.map(l=>l.y+l.height))+s;if(i){const l=Math.min(e.x,t.x,...r.map(h=>h.x))-s-12,c=o.y+12;return vr([o,{x:o.x,y:c},{x:l,y:c},{x:l,y:a.y},a])}return vr([o,{x:o.x,y:n},{x:a.x,y:n},a])}function A$(e,t,r,i=!1){const o=i?e.x+e.width+28:Math.max(...r.map(c=>c.x+c.width))+28,a=Math.min(...r.map(c=>c.x))-(i?12:28),s=Math.max(...r.map(c=>c.y+c.height))+(i?12:28),n=e.y+e.height/2,l=t.x+t.width/2;return[{x:e.x+e.width,y:n},{x:o,y:n},{x:o,y:s},{x:a,y:s},{x:a,y:t.y+t.height+12},{x:l,y:t.y+t.height+12},{x:l,y:t.y+t.height+.25}]}function F$(e,t,r,i=!1){const o=Math.max(...r.map(n=>n.x+n.width))+(i?18:28),a=e.y+e.height/2,s=t.y+t.height/2;return[{x:e.x+e.width,y:a},{x:o,y:a},{x:o,y:s},{x:t.x+t.width,y:s}]}function $$(e,t){if(e.length!==7||e[3].x!==e[4].x||e[3].y<=e[4].y)return e;const r=Math.min(e[3].x,...t.filter(i=>i.y<e[3].y&&i.y+i.height>e[4].y).map(i=>i.x-20));return r===e[3].x?e:e.map((i,o)=>o===3||o===4?{...i,x:r}:i)}function ki(e,t,r=4){return e.x<t.x+t.width+r&&e.x+e.width+r>t.x&&e.y<t.y+t.height+r&&e.y+e.height+r>t.y}function Sr(e,t,r=0){const i=t.x-r,o=t.x+t.width+r,a=t.y-r,s=t.y+t.height+r;return Math.abs(e.start.x-e.end.x)<.001?e.start.x>i&&e.start.x<o&&Math.max(e.start.y,e.end.y)>a&&Math.min(e.start.y,e.end.y)<s:Math.abs(e.start.y-e.end.y)>=.001?!1:e.start.y>a&&e.start.y<s&&Math.max(e.start.x,e.end.x)>i&&Math.min(e.start.x,e.end.x)<o}function E$(e,t,r=vu,i=[]){let o=vr(e);for(let a=0;a<t.length*2+1;a+=1){let s;for(let n=0;n<o.length-1&&!s;n+=1){const l={start:o[n],end:o[n+1]},c=t.find(m=>Sr(l,m,r));if(!c)continue;const h=Math.abs(l.start.x-l.end.x)<.001,d=h?l.end.y>=l.start.y:l.end.x>=l.start.x,u=h?d?c.y-r:c.y+c.height+r:d?c.x-r:c.x+c.width+r,f=h?d?c.y+c.height+r:c.y-r:d?c.x+c.width+r:c.x-r,g=(h?[c.x-r,c.x+c.width+r]:[c.y-r,c.y+c.height+r]).map(m=>{const y=h?[l.start,{x:l.start.x,y:u},{x:m,y:u},{x:m,y:f},{x:l.end.x,y:f},l.end]:[l.start,{x:u,y:l.start.y},{x:u,y:m},{x:f,y:m},{x:f,y:l.end.y},l.end],x=or(vr(y)),C=x.reduce((M,A)=>M+t.filter(L=>L!==c&&Sr(A,L,r)).length,0),k=x.filter(M=>i.some(A=>ds(M,A))).length,v=x.reduce((M,A)=>M+Math.hypot(A.end.x-A.start.x,A.end.y-A.start.y),0);return{detour:y,score:C*1e6+k*1e4+v}});s={index:n,points:g.toSorted((m,y)=>m.score-y.score)[0].detour}}if(!s)break;o=vr([...o.slice(0,s.index),...s.points,...o.slice(s.index+2)])}return o}const Te={userSendsMessage:"User sends message",agentResponds:"Agent responds",toolStarts:"Tool starts",toolCompletes:"Tool completes",agentAsksUser:"Agent asks user",userReplies:"User replies",agentFinishes:"Agent finishes",requestFails:"Request fails",streamFails:"Stream fails",userRetries:"User retries"},gp={[Te.userSendsMessage]:["Idle","Starting"],[Te.agentResponds]:["Starting","Streaming"],[Te.toolStarts]:["Streaming","RunningTool"],[Te.toolCompletes]:["RunningTool","Streaming"],[Te.agentAsksUser]:["Streaming","NeedsInput"],[Te.userReplies]:["NeedsInput","Streaming"],[Te.agentFinishes]:["Streaming","Complete"],[Te.requestFails]:["Starting","Failed"],[Te.streamFails]:["Streaming","Failed"],[Te.userRetries]:["Failed","Starting"]};function P$(e){return{direction:e.direction,nodes:e.nodes.map(({id:t,domId:r,shape:i,isGroup:o,parentId:a})=>({id:t,domId:r,shape:i,isGroup:o,parentId:a})),edges:e.edges.map(({id:t,start:r,end:i,label:o})=>({id:t,start:r,end:i,label:o}))}}function Zh(e,t){const r="-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[-+]?\\d+)?",i=e.match(new RegExp(`(${r})([\\s,]+)(${r})\\s*$`,"i"));if(!i||i.index===void 0)return null;const o=`${e.slice(0,i.index)}${t.x}${i[2]}${t.y}`,a=o.match(new RegExp(`L\\s*(${r})[\\s,]+(${r})\\s*$`,"i"));if(!a||a.index===void 0)return o;const s=o.slice(0,a.index).match(new RegExp(`(${r})[\\s,]+(${r})\\s*$`,"i"));return s&&Math.hypot(Number(s[1])-t.x,Number(s[2])-t.y)<.001?o.slice(0,a.index).trimEnd():o}function I$(e,t,r){const i=e.match(/[a-zA-Z]|-?(?:\d*\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/gi);if(!i)return null;const o={M:2,L:2,Q:4,C:6},a=[];let s={x:0,y:0};for(let p=0;p<i.length;){const g=i[p++],m=o[g];if(!m)return Zh(e,t);const y=i.slice(p,p+m).map(Number);if(y.length!==m||!y.every(Number.isFinite))return null;p+=m;const x=Array.from({length:m/2},(C,k)=>({x:y[k*2],y:y[k*2+1]}));a.push({command:g,points:x,start:s}),s=x.at(-1)}const n=p=>(p.x-t.x)*r.x+(p.y-t.y)*r.y;let l=a.length-1;for(;l>0&&n(a[l].start)>=0;)l-=1;const c=a[l];if(!c||c.command==="M"||n(c.points.at(-1))<0)return Zh(e,t);const h=p=>{let g=[c.start,...c.points];const m=[g[0]];for(;g.length>1;)g=g.slice(1).map((y,x)=>({x:g[x].x+(y.x-g[x].x)*p,y:g[x].y+(y.y-g[x].y)*p})),m.push(g[0]);return m.slice(1)};let d=0,u=1;for(let p=0;p<32;p++){const g=(d+u)/2;n(h(g).at(-1))<0?d=g:u=g}return[...a.slice(0,l),{...c,points:h((d+u)/2)}].map(({command:p,points:g})=>`${p} ${g.map(m=>`${m.x} ${m.y}`).join(" ")}`).join(" ")}function Qe(e,t){const r=e.getScreenCTM(),i=t.getScreenCTM();if(!r||!i)return null;const o=i.inverse(),a=e.getBBox(),s=[new DOMPoint(a.x,a.y),new DOMPoint(a.x+a.width,a.y),new DOMPoint(a.x+a.width,a.y+a.height),new DOMPoint(a.x,a.y+a.height)].map(d=>d.matrixTransform(r).matrixTransform(o)),n=Math.min(...s.map(d=>d.x)),l=Math.min(...s.map(d=>d.y)),c=Math.max(...s.map(d=>d.x)),h=Math.max(...s.map(d=>d.y));return{x:n,y:l,width:c-n,height:h-l}}function xr(e,t){const r=t.getScreenCTM();if(!r)return Qe(e,t);const i=r.inverse(),o=e.getBoundingClientRect(),a=[new DOMPoint(o.left,o.top),new DOMPoint(o.right,o.top),new DOMPoint(o.right,o.bottom),new DOMPoint(o.left,o.bottom)].map(h=>h.matrixTransform(i)),s=Math.min(...a.map(h=>h.x)),n=Math.min(...a.map(h=>h.y)),l=Math.max(...a.map(h=>h.x)),c=Math.max(...a.map(h=>h.y));return{x:s,y:n,width:l-s,height:c-n}}function M1(e,t,r,i=0){let o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const[s,n,l,c]of[[e.x,t.x,r.x,r.x+r.width],[e.y,t.y,r.y,r.y+r.height]]){if(Math.abs(n)<1e-4){if(s<l-i||s>c+i)return null;continue}const h=(l-s)/n,d=(c-s)/n;o=Math.max(o,Math.min(h,d)),a=Math.min(a,Math.max(h,d))}return o<0||o>a?null:{x:e.x+t.x*o,y:e.y+t.y*o}}function Qi(e,t){return Math.hypot(Math.max(t.x-e.x,0,e.x-t.x-t.width),Math.max(t.y-e.y,0,e.y-t.y-t.height))}function O$(e,t,r){const i=r.x-t.x,o=r.y-t.y,a=i*i+o*o,s=a?Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/a)):0;return Math.hypot(e.x-t.x-i*s,e.y-t.y-o*s)}function D$(e,t){const r=Number.parseFloat(t.dataset.cylinderRimRatio??"0.14"),i=Math.max(1,Math.min(e.height/2,e.height*r)),o=e.x+e.width/2,a=e.width/2,s=[];for(let n=0;n<=32;n+=1){const l=Math.PI+Math.PI*n/32;s.push({x:o+Math.cos(l)*a,y:e.y+i+Math.sin(l)*i})}s.push({x:e.x+e.width,y:e.y+e.height-i});for(let n=0;n<=32;n+=1){const l=Math.PI*n/32;s.push({x:o+Math.cos(l)*a,y:e.y+e.height-i+Math.sin(l)*i})}return s.push({x:e.x,y:e.y+i}),s}function eo(e){return e.tagName.toLowerCase()!=="polygon"?!1:e.getAttribute("points")?.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number)?.length===8}function _1(e){const t=Lt(e,.5,.5);return[{x:t.x,y:e.y},{x:e.x+e.width,y:t.y},{x:t.x,y:e.y+e.height},{x:e.x,y:t.y}]}function R$(e,t,r){const i=(a,s)=>a.x*s.y-a.y*s.x,o=_1(r);return o.map((a,s)=>({start:a,end:o[(s+1)%o.length]})).flatMap(({start:a,end:s})=>{const n={x:s.x-a.x,y:s.y-a.y},l=i(t,n);if(Math.abs(l)<1e-4)return[];const c={x:a.x-e.x,y:a.y-e.y},h=i(c,n)/l,d=i(c,t)/l;return h>=0&&d>=0&&d<=1?[{point:{x:e.x+t.x*h,y:e.y+t.y*h},rayProgress:h}]:[]}).toSorted((a,s)=>a.rayProgress-s.rayProgress)[0]?.point}function pp(e,t,r){if(r.tagName.toLowerCase()==="rect"&&r.closest("svg")?.classList.contains("statediagram")){const o=r.getScreenCTM(),a=getComputedStyle(r),s=r.getBBox(),n=h=>/^\d+(?:\.\d+)?(?:px)?$/.test(h)?Number.parseFloat(h):NaN,l=n(a.rx==="auto"?a.ry:a.rx),c=n(a.ry==="auto"?a.rx:a.ry);if(o&&Math.abs(o.b)<1e-8&&Math.abs(o.c)<1e-8){const h=Math.min(s.width/2,l)*Math.abs(o.a),d=Math.min(s.height/2,c)*Math.abs(o.d);if(h>0&&Math.abs(h-d)<1e-6){const u=Math.abs(e.x-t.x-t.width/2)-(t.width/2-h),f=Math.abs(e.y-t.y-t.height/2)-(t.height/2-h);return Math.max(0,Math.hypot(Math.max(0,u),Math.max(0,f))-h)}}}const i=eo(r)?_1(t):r.dataset.diagramCylinder==="true"?D$(t,r):null;return i?Math.min(...i.map((o,a)=>O$(e,o,i[(a+1)%i.length]))):Qi(e,t)}function N$(e,t,r,i,o=0){const a=M1(e,t,r,o);if(!a)return null;if(eo(i))return R$(e,t,r)??a;if(i.dataset.diagramCylinder!=="true")return a;const s={x:r.x+r.width/2,y:r.y+r.height/2};let n=Math.hypot(a.x-e.x,a.y-e.y),l=(s.x-e.x)*t.x+(s.y-e.y)*t.y;const c=Number.parseFloat(i.dataset.cylinderRimRatio??"0.14"),h=Math.max(1,Math.min(r.height/2,r.height*c)),d=u=>{const f={x:e.x+t.x*u,y:e.y+t.y*u};if(f.y>=r.y+h&&f.y<=r.y+r.height-h)return f.x>=r.x&&f.x<=r.x+r.width;const p=f.y<r.y+h?r.y+h:r.y+r.height-h,g=(f.x-s.x)/(r.width/2),m=(f.y-p)/h;return g*g+m*m<=1};for(let u=0;u<24;u+=1){const f=(n+l)/2;d(f)?l=f:n=f}return{x:e.x+t.x*l,y:e.y+t.y*l}}function mp(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll("g.node")].flatMap(r=>{const i=r.querySelector(":scope > .label-container, :scope > rect, :scope > circle, :scope > ellipse, :scope > polygon");return i?[{node:r,shape:i}]:[]});for(const r of e.querySelectorAll('.edgePaths path[marker-end], path.transition[data-edge="true"][marker-end]')){const i=r.getTotalLength();if(i<.25)continue;const o=r.getPointAtLength(i),a=r.getPointAtLength(Math.max(0,i-.1)),s=(r.dataset.terminalDirection??"").split(",").map(Number),n=s.length===2&&s.every(Number.isFinite)?{x:s[0],y:s[1]}:{x:o.x-a.x,y:o.y-a.y},l=Math.hypot(n.x,n.y);if(l<1e-4)continue;const c={x:n.x/l,y:n.y/l},h={x:o.x-c.x*256,y:o.y-c.y*256},d=r.dataset.terminalTarget,f=t.flatMap(({node:g,shape:m})=>{const y=xr(m,r);if(!y)return[];const x=y,C=M1(h,c,x,.5);if(!C)return[];const k=Math.hypot(C.x-o.x,C.y-o.y),v={x:x.x+x.width/2,y:x.y+x.height/2};return c.x*(v.x-C.x)+c.y*(v.y-C.y)>0&&(g.id===d||k<=v$)?[{node:g,intersection:C,correction:k}]:[]}).sort((g,m)=>g.correction-m.correction)[0];if(!f)continue;const p=Zh(r.getAttribute("d")??"",f.intersection);p&&(r.setAttribute("d",p),r.dataset.terminalTarget=f.node.id,r.dataset.terminalDirection=`${c.x},${c.y}`)}}function yp(e,t){const i=(t.getAttribute("marker-end")??"").match(/#([^)'"]+)/)?.[1];return i?e.querySelector(`marker[id="${CSS.escape(i)}"]`):null}function Fs(e,t=5){const r=[...e.querySelectorAll("g.node")].flatMap(i=>{const o=Ke(i);return o?[{node:i,shape:o}]:[]});for(const i of e.querySelectorAll(".edgePaths path[marker-end], .edges.edgePath path[marker-end]")){if(yp(e,i)?.dataset.diagramChevron!=="true")continue;const o=i.dataset.terminalGapBasePath??i.getAttribute("d");if(!o)continue;i.dataset.terminalGapBasePath=o,i.setAttribute("d",o);const a=i.getTotalLength();if(a<.25)continue;const s=i.getPointAtLength(a),n=i.getPointAtLength(Math.max(0,a-.1)),l=i.getScreenCTM();if(!l)continue;const c=new DOMPoint(s.x,s.y).matrixTransform(l),h=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(O=>O.split(",").map(Number)).filter(O=>O.length===2&&O.every(Number.isFinite)).map(([O,R])=>({x:O,y:R})),d=h.at(-2)??n,u=h.at(-1)??s,f=(i.dataset.terminalDirection??"").split(",").map(Number),p=h.length>=2?{x:u.x-d.x,y:u.y-d.y}:f.length===2&&f.every(Number.isFinite)?{x:f[0],y:f[1]}:{x:s.x-n.x,y:s.y-n.y},g=new DOMPoint(0,0).matrixTransform(l),m=new DOMPoint(p.x,p.y).matrixTransform(l),y=Math.hypot(m.x-g.x,m.y-g.y);if(y<=0)continue;const x={x:(m.x-g.x)/y,y:(m.y-g.y)/y},C=Cr(i),k=i.dataset.terminalTarget??C?.target,v={x:c.x-x.x*256,y:c.y-x.y*256},A=r.flatMap(({node:O,shape:R})=>{if(k&&O.id!==k&&Ir(O)!==k)return[];const V=R.getBoundingClientRect(),j={x:V.left,y:V.top,width:V.width,height:V.height},z=N$(v,x,j,R,e.classList.contains("statediagram")?.5:0);if(!z)return[];const Q={x:j.x+j.width/2,y:j.y+j.height/2},rt=x.x*(Q.x-z.x)+x.y*(Q.y-z.y)>0,et=Math.hypot(z.x-c.x,z.y-c.y);return rt&&(k||et<=12)?[{node:O,shape:R,bounds:j,intersection:z,correction:et}]:[]}).sort((O,R)=>O.correction-R.correction)[0];if(!A)continue;const L=yp(e,i)?.querySelector("path"),T=Number.parseFloat(L?getComputedStyle(L).strokeWidth:"0"),_=t+(Number.isFinite(T)?T/2:0);let $=0,P=_;const D=O=>({x:A.intersection.x-x.x*O,y:A.intersection.y-x.y*O});for(;pp(D(P),A.bounds,A.shape)<_&&P<256;)P*=2;for(let O=0;O<24;O+=1){const R=($+P)/2;pp(D(R),A.bounds,A.shape)<_?$=R:P=R}const F=D(P),E=new DOMPoint(F.x,F.y).matrixTransform(l.inverse()),B=D(P+1),q=new DOMPoint(B.x,B.y).matrixTransform(l.inverse()),W=I$(i.getAttribute("d")??"",q,p);W&&(i.setAttribute("d",`${W} L ${E.x} ${E.y}`),i.dataset.terminalTarget=A.node.id,i.dataset.terminalGapCss=String(t))}}function Mu(e,t=3){const r="-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[-+]?\\d+)?",i=e.match(new RegExp(`[ML]|${r}`,"gi")),o=e.replace(new RegExp(`[ML]|${r}|[\\s,]`,"gi"),"").trim();if(!i||o)return null;const a=[];let s="";for(let n=0;n<i.length;n+=1){const l=i[n];if(/^[ML]$/i.test(l)){s=l.toUpperCase();continue}const c=i[n+1];if(!s||!c||/^[ML]$/i.test(c))return null;a.push({x:Number(l),y:Number(c)}),n+=1,s="L"}return a.length<t?null:a.slice(1).every((n,l)=>{const c=a[l];return Math.abs(n.x-c.x)<.001||Math.abs(n.y-c.y)<.001})?a:null}function vr(e){const t=e.filter((i,o)=>!o||Math.hypot(i.x-e[o-1].x,i.y-e[o-1].y)>=.001),r=[];for(const i of t){const o=r.at(-1),a=r.at(-2);o&&a&&(Math.abs(a.x-o.x)<.001&&Math.abs(o.x-i.x)<.001||Math.abs(a.y-o.y)<.001&&Math.abs(o.y-i.y)<.001)?r[r.length-1]=i:r.push(i)}return r}function _u(e,t=v1){const r=[`M ${e[0].x} ${e[0].y}`];for(let o=1;o<e.length-1;o+=1){const a=e[o-1],s=e[o],n=e[o+1],l=Math.hypot(s.x-a.x,s.y-a.y),c=Math.hypot(n.x-s.x,n.y-s.y),h=(s.x-a.x)*(n.y-s.y)-(s.y-a.y)*(n.x-s.x),d=Math.min(t,l/2,c/2);if(d<=0||Math.abs(h)<.001){r.push(`L ${s.x} ${s.y}`);continue}const u=s.x-(s.x-a.x)/l*d,f=s.y-(s.y-a.y)/l*d,p=s.x+(n.x-s.x)/c*d,g=s.y+(n.y-s.y)/c*d;r.push(`L ${u} ${f}`,`Q ${s.x} ${s.y} ${p} ${g}`)}const i=e[e.length-1];return r.push(`L ${i.x} ${i.y}`),r.join(" ")}function eh(e){for(const t of e.querySelectorAll('.flowchart-link, .edgePaths path, path.relation, path.transition[data-edge="true"]')){const r=Mu(t.getAttribute("d")??"");if(!r)continue;const i=vr(r);t.dataset.manhattanPoints??=i.map(a=>`${a.x},${a.y}`).join(" ");const o=_u(i);t.dataset.feedbackLane||(t.dataset.manhattanSegments=String(Math.max(0,i.length-1))),o.includes(" Q ")&&(t.setAttribute("d",o),t.dataset.cornerRadius=String(v1))}}function Ke(e){return e.querySelector(":scope > .label-container, :scope > rect, :scope > circle, :scope > ellipse, :scope > .outer-path, :scope > .basic.label-container, :scope > polygon")}function q$(e){for(const t of e.querySelectorAll("g.node")){const r=t.querySelector(":scope > path.basic.label-container.outer-path[label-offset-y]");if(!r||r.dataset.diagramCylinder==="true")continue;const i=r.getBBox(),o=i.height,s=i.width/2,n=Math.min(8,o*.14),l=-o/2,c=o/2;r.setAttribute("d",`M ${-s} ${l+n} A ${s} ${n} 0 0 1 ${s} ${l+n} L ${s} ${c-n} A ${s} ${n} 0 0 1 ${-s} ${c-n} Z`),r.removeAttribute("transform"),r.dataset.diagramCylinder="true",r.dataset.cylinderRimRatio=String(n/o);const h=document.createElementNS("http://www.w3.org/2000/svg","path");h.setAttribute("d",`M ${-s} ${l+n} A ${s} ${n} 0 0 1 ${s} ${l+n} A ${s} ${n} 0 0 1 ${-s} ${l+n} Z`),h.setAttribute("class","diagram-cylinder-rim"),h.setAttribute("aria-hidden","true"),h.setAttribute("focusable","false"),r.after(h)}}function W$(e){if(e.getAttribute("aria-roledescription")==="flowchart-v2")for(const t of e.querySelectorAll("g.node")){t.querySelector(":scope > .flowchart-node-outline")?.remove();const r=Ke(t);if(!r)continue;const i=r.cloneNode(!1);i.removeAttribute("id"),i.classList.add("flowchart-node-outline"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false"),i.style.setProperty("fill","none","important"),t.append(i)}}function z$(e){if(e.getAttribute("aria-roledescription")==="er")for(const t of e.querySelectorAll("g.node")){t.querySelectorAll(":scope > .er-negative-space-divider").forEach(d=>d.remove());const r=[...t.querySelectorAll(":scope > .row-rect-odd, :scope > .row-rect-even")].map(d=>d.getBBox());if(!r.length)continue;const i=[...t.querySelectorAll(":scope > .divider")],o=i.map(d=>d.getBBox()).filter(d=>d.height>d.width).toSorted((d,u)=>u.x-d.x);i.forEach(d=>d.remove());const a=Math.min(...r.map(d=>d.x)),s=Math.max(...r.map(d=>d.x+d.width)),n=Math.max(...r.map(d=>d.y+d.height)),l=(d,u,f)=>{const p=document.createElementNS("http://www.w3.org/2000/svg","line");p.classList.add("er-negative-space-divider"),p.dataset.dividerKind=d,p.setAttribute("x1",String(u.x)),p.setAttribute("y1",String(u.y)),p.setAttribute("x2",String(f.x)),p.setAttribute("y2",String(f.y)),p.setAttribute("aria-hidden","true"),t.insertBefore(p,t.querySelector(":scope > .label"))};for(const d of r.map(u=>u.y))l("row",{x:a,y:d},{x:s,y:d});const c=[...t.querySelectorAll(":scope > .label.attribute-keys")].some(d=>!!d.textContent?.trim()),h=o[0];if(c&&h){const d=h.x+h.width/2;l("key",{x:d,y:r[0].y},{x:d,y:n})}}}function Fa(e){for(const t of e.querySelectorAll("marker")){const r=t.querySelector("path"),i=t.id.endsWith("-arrowhead"),o=t.id.includes("pointEnd")||t.id.includes("barbEnd")||i,a=t.id.includes("pointStart");!r||!o&&!a||(t.setAttribute("viewBox",`0 0 ${Rn} ${Rn}`),t.setAttribute("markerWidth",String(Rn)),t.setAttribute("markerHeight",String(Rn)),t.setAttribute("refX",o?"6.5":"0.5"),t.setAttribute("refY","3.5"),t.setAttribute("orient",i?"auto-start-reverse":"auto"),t.setAttribute("markerUnits","userSpaceOnUse"),t.dataset.diagramChevron="true",r.setAttribute("d",o?"M 3.5 0.5 L 6.5 3.5 L 3.5 6.5":"M 3.5 0.5 L 0.5 3.5 L 3.5 6.5"),r.setAttribute("fill","none"),r.setAttribute("stroke","context-stroke"),r.setAttribute("stroke-width","1"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("vector-effect","non-scaling-stroke"))}}function Cr(e){const t=e.id.match(/-L_([^_]+)_([^_]+)_\d+$/);return t?{source:t[1],target:t[2]}:null}function vi(e,t){const r=t.id.match(/-(L_.+)$/)?.[1];if(r)return[...e.querySelectorAll(".edgeLabels > .edgeLabel")].find(i=>i.querySelector(":scope > .label")?.getAttribute("data-id")===r)}function Je(e,t){return[...e.querySelectorAll("g.node")].find(r=>Ir(r)===t)}function H$(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return!1;const t=[...e.querySelectorAll(".edgePaths path")].find(A=>{const L=Cr(A);return L?.source==="Client"&&L.target==="Gateway"}),r=Je(e,"Client"),i=Je(e,"Gateway"),o=Je(e,"Queue"),a=[...e.querySelectorAll(".edgePaths path")].find(A=>{const L=Cr(A);return L?.source==="Gateway"&&L.target==="Queue"}),s=t&&vi(e,t);let n=r&&br(r);const l=i&&br(i),c=o&&br(o),h=t&&s&&xr(s,t);if(!t||!r||!n||!l||!s||!h)return!1;const d=Lt(l,.5,.5),u=[...e.querySelectorAll("g.cluster > rect")].flatMap(A=>{const L=xr(A,t);return L?[L]:[]}).filter(A=>d.x>A.x&&d.x<A.x+A.width&&d.y>A.y&&d.y<A.y+A.height).toSorted((A,L)=>L.width*L.height-A.width*A.height)[0];if(!u)return!1;const f=Math.max(52,h.height+24),p=u.y-(n.y+n.height),g=Math.max(0,f-p),m=r.transform.baseVal.consolidate()?.matrix;m&&g>0&&(r.setAttribute("transform",`translate(${m.e}, ${m.f-g})`),r.dataset.requestLaneRaised="true",r.dataset.requestLaneShift=String(Number(r.dataset.requestLaneShift??0)+g),n={...n,y:n.y-g});const y=Lt(n,.5,1),x=Lt(l,0,.35),C=(y.y+u.y)/2,k=u.x-Math.max(20,h.height/2+4),v=[y,{x:y.x,y:C},{x:k,y:C},{x:k,y:x.y},x];t.setAttribute("d",v.map((A,L)=>`${L?"L":"M"}${A.x},${A.y}`).join("")),t.dataset.clientRequestLane="downward",t.dataset.manhattanPoints=v.map(A=>`${A.x},${A.y}`).join(" "),ro(s,t,v,1);const M=a&&vi(e,a);if(a&&M&&c){const A=Lt(l,0,.65),L=Lt(c,0,.5),T=u.x+12,_=[A,{x:T,y:A.y},{x:T,y:L.y},L];a.setAttribute("d",_.map(($,P)=>`${P?"L":"M"}${$.x},${$.y}`).join("")),a.dataset.clientRequestLane="enqueue",a.dataset.manhattanPoints=_.map($=>`${$.x},${$.y}`).join(" "),ro(M,a,_,1)}return B1(e,"Client",n),!0}function Y$(e,t,r){if(!ki(e,r,12))return{x:0,y:0};const i=[{x:e.x-r.x-r.width-12,y:0,clear:r.x+r.width<=t.x},{x:e.x+e.width-r.x+12,y:0,clear:r.x>=t.x+t.width},{x:0,y:e.y-r.y-r.height-12,clear:r.y+r.height<=t.y},{x:0,y:e.y+e.height-r.y+12,clear:r.y>=t.y+t.height}],{x:o,y:a}=i.toSorted((s,n)=>Number(n.clear)-Number(s.clear)||Math.hypot(s.x,s.y)-Math.hypot(n.x,n.y))[0];return{x:o,y:a}}function xp(e){const t=Math.min(...e.map(i=>i.x)),r=Math.min(...e.map(i=>i.y));return{x:t,y:r,width:Math.max(...e.map(i=>i.x+i.width))-t,height:Math.max(...e.map(i=>i.y+i.height))-r}}function X$(e,t,r){const i=e.parentElement?.getScreenCTM(),o=t.getScreenCTM();if(!i||!o)return;const a=new DOMPoint(0,0).matrixTransform(o).matrixTransform(i.inverse()),s=new DOMPoint(r.x,r.y).matrixTransform(o).matrixTransform(i.inverse()),n=e.getAttribute("transform")??"";e.setAttribute("transform",`translate(${s.x-a.x}, ${s.y-a.y}) ${n}`)}function G$(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=[...e.querySelectorAll("g.node")],i=[...e.querySelectorAll("g.cluster")].flatMap(s=>{const n=s.querySelector(":scope > rect"),l=s.querySelector(":scope > g.cluster-label");if(!n||!l)return[];const c=t&&Su(s,t),h=c?t?.get(c):void 0;if(t&&!h)return[];const d=n.getBBox(),u=r.filter(f=>{if(h)return h.has(Ir(f));const p=br(f);if(!p)return!1;const g=Lt(p,.5,.5);return g.x>=d.x&&g.x<=d.x+d.width&&g.y>=d.y&&g.y<=d.y+d.height});return[{cluster:s,rect:n,label:l,frame:d,members:u,id:c,memberIds:h}]}),o=t?[...e.querySelectorAll(".edgePaths path")].flatMap(s=>{const n=Cr(s),l=Mu(s.getAttribute("d")??"",2);if(!n||!l)return[];const c=h=>{const d=Je(e,h),u=(d&&Ke(d))??i.find(p=>p.id===h)?.rect,f=u&&Qe(u,s);return u&&f?{shape:u,bounds:f}:null};return[{path:s,points:l,source:c(n.source),target:c(n.target)}]}):[],a=new Map;for(const s of i.toSorted((n,l)=>(n.memberIds?.size??0)-(l.memberIds?.size??0)||n.frame.width*n.frame.height-l.frame.width*l.frame.height)){const n=i.filter(P=>P!==s&&(s.memberIds?!!(P.id&&s.memberIds.has(P.id)):P.frame.x>=s.frame.x&&P.frame.y>=s.frame.y&&P.frame.x+P.frame.width<=s.frame.x+s.frame.width&&P.frame.y+P.frame.height<=s.frame.y+s.frame.height)).flatMap(({cluster:P,rect:D})=>{const F=t?Qe(D,s.cluster):a.get(P);return F?[F]:[]}),c=[...s.members.flatMap(P=>{const D=Ke(P),F=t&&D?Qe(D,s.cluster):br(P);return F?[F]:[]}),...n];if(!c.length)continue;const h=s.label.querySelector("foreignObject"),d=h?.querySelector("div"),u=xp(c),f=t?r.filter(P=>!s.members.includes(P)).flatMap(P=>{const D=Ke(P),F=D&&Qe(D,s.cluster);return F?[F]:[]}):[];let p=Math.ceil(Math.max(d?.getBoundingClientRect().height??0,d?.scrollHeight??0,s.label.getBBox().height,18)),g=an(p);const m=Math.min(...c.map(({x:P})=>P)),y=Math.max(...c.map(({x:P,width:D})=>P+D)),x=Math.min(...c.map(({y:P})=>P)),C=Math.max(...c.map(({y:P,height:D})=>P+D));let k=Math.min(s.frame.x,m-Gr),v=Math.min(s.frame.y,x-g),M=Math.max(s.frame.x+s.frame.width,y+Gr),A=Math.max(s.frame.y+s.frame.height,C+20);if(t&&f.some(P=>ki({x:k,y:v,width:M-k,height:A-v},P,12))){if(k=m-Gr,M=y+Gr,A=C+20,h&&d){const P=h.cloneNode(!0),D=P.querySelector("div");P.style.visibility="hidden",P.setAttribute("height","1"),P.setAttribute("width",String(M-k-Gr*2)),D.style.setProperty("height","auto","important"),D.style.setProperty("width","100%","important"),s.label.append(P);try{const F=Math.max(u.width,D.scrollWidth);M=k+F+Gr*2,P.setAttribute("width",String(F)),p=Math.ceil(Math.max(18,D.scrollHeight))}finally{P.remove()}}else M=Math.max(M,k+s.label.getBBox().width+Gr*2);g=an(p),v=x-g}const L={x:k,y:v,width:M-k,height:A-v};if(s.rect.setAttribute("x",String(L.x)),s.rect.setAttribute("y",String(L.y)),s.rect.setAttribute("width",String(L.width)),s.rect.setAttribute("height",String(L.height)),s.cluster.dataset.headerHeight=String(g),h)h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("width",String(Math.max(24,L.width-Gr*2))),h.setAttribute("height",String(p)),s.label.setAttribute("transform",`translate(${L.x+Gr}, ${L.y+Gr})`);else{const P=s.label.getBBox();s.label.setAttribute("transform",`translate(${L.x+L.width/2-P.x-P.width/2}, ${L.y+Gr-P.y})`)}if(a.set(s.cluster,L),!t)continue;const T=i.filter(P=>P!==s&&P.id&&s.id&&!s.memberIds?.has(P.id)&&!P.memberIds?.has(s.id)),_=T.filter(P=>!T.some(D=>D!==P&&P.id&&D.memberIds?.has(P.id))),$=_.map(P=>[P.cluster,...P.members,...i.filter(D=>D.id&&P.memberIds?.has(D.id)).map(D=>D.cluster)]);$.push(...r.filter(P=>!s.members.includes(P)&&!_.some(D=>D.members.includes(P))).map(P=>[P]));for(const P of $){const D=O=>{const R=O.flatMap(V=>{const j=V.matches("g.node")?Ke(V):V.querySelector(":scope > rect"),z=j&&Qe(j,s.cluster);return z?[z]:[]});return R.length?xp(R):null},F=D(P);if(!F)continue;const E=Y$(L,u,F);if(!E.x&&!E.y)continue;const B=E.x?"x":"y",q=E.x?"width":"height",W=$.filter(O=>{const R=D(O);return R&&(E[B]>0?R[B]+R[q]>F[B]:R[B]<F[B]+F[q])}).flat();for(const O of new Set(W))W.some(R=>R!==O&&R.contains(O))||X$(O,s.cluster,E)}}for(const{path:s,points:n,source:l,target:c}of o){let h=!1;const d=(g,m)=>{const y=g&&Qe(g.shape,s);if(!g||!y)return m;const x=g.bounds;return["x","y","width","height"].every(C=>Math.abs(y[C]-x[C])<.001)?m:(h=!0,{x:y.x+(m.x-x.x)*y.width/(x.width||1),y:y.y+(m.y-x.y)*y.height/(x.height||1)})},u=d(l,n[0]),f=d(c,n[n.length-1]);if(!h)continue;const p=nc(n,u,f,Math.abs(n[1].x-n[0].x)<.001);s.setAttribute("d",p.map((g,m)=>`${m?"L":"M"}${g.x},${g.y}`).join("")),s.dataset.manhattanPoints=p.map(g=>`${g.x},${g.y}`).join(" ")}}function rh(e,t=!1){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const i=[...e.querySelectorAll(".edgePaths path")].flatMap(y=>{const x=Cr(y);return x?[{path:y,...x}]:[]}),o=new Map,a=new Map;for(const y of i.filter(({source:x,target:C})=>x!==C))o.set(y.target,(o.get(y.target)??0)+1),a.set(y.source,(a.get(y.source)??0)+1);const s=i.find(y=>y.source!==y.target&&(o.get(y.source)??0)>=2&&(a.get(y.source)??0)===1&&(a.get(y.target)??0)>=2);if(!s)return;if(!t&&s.path.dataset.feedbackLane==="outer")return s.path.getBBox();const n=Je(e,s.source),l=Je(e,s.target),c=n&&Ke(n),h=l&&Ke(l);if(!c||!h)return;const d=n&&br(n),u=l&&br(l),f=[...e.querySelectorAll("g.node")].flatMap(y=>{const x=br(y);return x?[x]:[]});if(!d||!u||!f.length)return;const p=[...e.querySelectorAll(".edgePaths path")].filter(y=>y!==s.path).map(y=>y.getBBox()),g=s.path.dataset.compactFlowchart==="true",m=A$(d,u,g?f:[...f,...p],g);s.path.setAttribute("d",m.map((y,x)=>`${x?"L":"M"}${y.x},${y.y}`).join("")),s.path.dataset.feedbackLane="outer",s.path.dataset.feedbackSource=s.source,s.path.dataset.feedbackTarget=s.target,s.path.dataset.manhattanSegments="4",s.path.dataset.manhattanPoints=m.map(y=>`${y.x},${y.y}`).join(" ")}function B1(e,t,r){if(e.getAttribute("aria-roledescription")!=="flowchart-v2"||!e.querySelector("g.cluster"))return;const i=[...e.querySelectorAll(".edgePaths path")],o=[...e.querySelectorAll(".edgeLabels > .edgeLabel")];i.forEach((a,s)=>{if(a.dataset.nestedDecisionRoute)return;const n=Cr(a),l=n?i.filter(v=>Cr(v)?.source===n.source).length:0,c=n&&Je(e,n.source),h=n&&Je(e,n.target),d=c&&Qe(c,a),u=n?.target===t?r:h&&xr(h,a);if(!n||!d||!u||l>1||u.y>=d.y)return;const f=[...[...e.querySelectorAll("g.node")].flatMap(v=>{const M=Qe(v,a);return M?[M]:[]}),...[...e.querySelectorAll("g.cluster > rect")].flatMap(v=>{const M=Qe(v,a);return M?[M]:[]})],p=F$(d,u,f,a.dataset.compactFlowchart==="true");a.setAttribute("d",p.map((v,M)=>`${M?"L":"M"}${v.x},${v.y}`).join("")),a.dataset.groupedReturnLane="right",a.dataset.manhattanPoints=p.map(v=>`${v.x},${v.y}`).join(" ");const g=o[s];if(!g)return;const m={x:p[1].x,y:(p[1].y+p[2].y)/2},y=g.getBBox(),x=a.getCTM(),C=g.parentElement?.getCTM(),k=x&&C?new DOMPoint(m.x,m.y).matrixTransform(x).matrixTransform(C.inverse()):m;g.setAttribute("transform",`translate(${k.x-y.x-y.width/2}, ${k.y-y.y-y.height/2})`),g.dataset.finalPathCenter=`${m.x},${m.y}`})}function j$(e){B1(e)}function bp(e){const t=e.querySelector('path[data-feedback-lane="outer"]'),r=t?.dataset.feedbackSource&&Je(e,t.dataset.feedbackSource),i=t?.dataset.feedbackTarget&&Je(e,t.dataset.feedbackTarget),o=t?.getScreenCTM(),a=(t?.dataset.manhattanPoints??"").split(" ").map(P=>P.split(",").map(Number)).filter(P=>P.length===2&&P.every(Number.isFinite)).map(([P,D])=>({x:P,y:D}));if(!t||!r||!i||!o||a.length<4)return;const s=o.inverse(),n=r.getBoundingClientRect(),l=i.getBoundingClientRect(),c=t.dataset.feedbackTarget,h=[...e.querySelectorAll(".edgePaths path")].flatMap(P=>{if(P===t)return[];const D=Cr(P),F=(P.dataset.manhattanPoints??"").trim().split(/\s+/).map(V=>V.split(",").map(Number)).filter(V=>V.length===2&&V.every(Number.isFinite)).map(([V,j])=>({x:V,y:j})),E=P.getScreenCTM();if(!D||!E||F.length<2)return[];const B=D.source===c?0:D.target===c?-1:null;if(B===null)return[];const q=F[B===0?0:F.length-1],W=F[B===0?1:F.length-2],O=new DOMPoint(q.x,q.y).matrixTransform(E),R=new DOMPoint(W.x,W.y).matrixTransform(E);return Math.abs(O.y-l.bottom)>1||Math.abs(O.x-R.x)>1?[]:[O.matrixTransform(s).x]}),d=new DOMPoint(l.left,l.bottom).matrixTransform(s).x,u=new DOMPoint(l.right,l.bottom).matrixTransform(s).x;let f=T$({x:Math.min(d,u),width:Math.abs(u-d)},h);const p=(d+u)/2,g=new DOMPoint(n.right,n.top+n.height/2).matrixTransform(s),m=Ke(i),y=m&&Qe(m,t),x=m?getComputedStyle(m).rx:"0",C=m?.getBBox().width??0,k=y&&C&&a.at(-2).y>y.y+y.height?M$({...y,corner:{x:(Number.parseFloat(x)||0)*(x.endsWith("%")?y.width/100:y.width/C),y:0}},h):void 0,v=k===void 0?[]:[{...a[a.length-3]},{x:k,y:a[a.length-2].y},{x:k,y:new DOMPoint(l.left,l.bottom).matrixTransform(s).y}],M=[...e.querySelectorAll("g.node")].filter(P=>P!==i).flatMap(P=>{const D=Qe(P,t);return D?[D]:[]}),A=vi(e,t),L=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(P=>P!==A&&P.textContent?.trim()).flatMap(P=>{const D=xr(P,t);return D?[D]:[]}),T=Bu(e).filter(P=>P.path!==t).flatMap(P=>{const D=P.path.getScreenCTM();return D?or(P.points.map(({x:F,y:E})=>new DOMPoint(F,E).matrixTransform(D).matrixTransform(s))):[]}),_=v.length>0&&or(v).every(P=>!M.some(D=>Sr(P,D,8))&&!L.some(D=>Sr(P,D,4))&&!T.some(({start:D,end:F})=>Sr(P,{x:Math.min(D.x,F.x),y:Math.min(D.y,F.y),width:Math.abs(F.x-D.x),height:Math.abs(F.y-D.y)},6)));if(_&&(f=k),!_&&Math.abs(f-p)>1&&a.length>=7){const P=new DOMPoint(l.left+l.width/2,l.top-.25).matrixTransform(s),D=new DOMPoint(l.left+l.width/2,l.top-12).matrixTransform(s);a[0]={x:g.x,y:g.y},a[1].y=g.y,a[4]={x:a[3].x,y:D.y},a[5]={x:D.x,y:D.y},a[6]={x:P.x,y:P.y},t.dataset.feedbackTargetSide="top",t.dataset.manhattanPoints=a.map(({x:F,y:E})=>`${F},${E}`).join(" "),t.setAttribute("d",a.map(({x:F,y:E},B)=>`${B===0?"M":"L"}${F},${E}`).join("")),ro(vi(e,t),t,a);return}const $=new DOMPoint(l.left+l.width/2,l.bottom+.25).matrixTransform(s);$.x=f,a[0]={x:g.x,y:g.y},a[1].y=g.y,a[a.length-2].x=$.x,a[a.length-1]={x:$.x,y:$.y},t.dataset.feedbackTargetSide="bottom",t.dataset.manhattanPoints=a.map(({x:P,y:D})=>`${P},${D}`).join(" "),t.setAttribute("d",a.map(({x:P,y:D},F)=>`${F===0?"M":"L"}${P},${D}`).join("")),ro(vi(e,t),t,a)}function Cp(e){const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{if(i.dataset.clusterHeaderClearance||i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)return[];const o=Cr(i),a=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(s=>s.split(",").map(Number)).filter(s=>s.length===2&&s.every(Number.isFinite)).map(([s,n])=>({x:s,y:n}));return o&&a.length>=2?[{path:i,points:a,...o}]:[]}),r=new Map;for(const i of t)r.set(i.source,[...r.get(i.source)??[],i]);for(const[i,o]of r){const a=o.length>=2&&Je(e,i),s=a&&br(a);if(!s)continue;const n=o.filter(({points:u})=>Math.abs(u[0].x-u[1].x)<.001);if(n.length<2)continue;const l=n.toSorted((u,f)=>{const p=Je(e,u.target),g=Je(e,f.target),m=p&&br(p),y=g&&br(g);return(m?.x??0)+(m?.width??0)/2-((y?.x??0)+(y?.width??0)/2)||(m?.y??0)+(m?.height??0)/2-((y?.y??0)+(y?.height??0)/2)||u.path.id.localeCompare(f.path.id)}),c=Math.min(S$,s.width*.4/(l.length-1)),d=s.x+s.width/2-c*(l.length-1)/2;l.forEach(({path:u,points:f},p)=>{const g={x:d+c*p,y:f[0].y},m=f.at(-1),y=nc(f,g,m,!0);u.dataset.fanoutPort=`${g.x},${g.y}`,u.dataset.manhattanPoints=y.map(({x,y:C})=>`${x},${C}`).join(" "),u.setAttribute("d",y.map(({x,y:C},k)=>`${k===0?"M":"L"}${x},${C}`).join(""))})}}function nc(e,t,r,i){if(e.length<2)return e;if(e.length===2){if(i&&Math.abs(t.x-r.x)>=.001){const s=(t.y+r.y)/2;return[t,{x:t.x,y:s},{x:r.x,y:s},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const s=(t.x+r.x)/2;return[t,{x:s,y:t.y},{x:s,y:r.y},r]}return[t,r]}if(e.length===3){if(i&&Math.abs(t.x-r.x)>=.001){const s=(t.y+r.y)/2;return[t,{x:t.x,y:s},{x:r.x,y:s},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const s=(t.x+r.x)/2;return[t,{x:s,y:t.y},{x:s,y:r.y},r]}return[t,r]}const o=e.map(s=>({...s}));return o[0]=t,o[o.length-1]=r,i?(o[1].x=t.x,o[o.length-2].x=r.x):(o[1].y=t.y,o[o.length-2].y=r.y),o.slice(1).some((s,n)=>{const l=o[n];return Math.abs(s.x-l.x)>=.001&&Math.abs(s.y-l.y)>=.001})?nc([t,r],t,r,i):o}function ro(e,t,r,i,o){if(!e?.textContent?.trim())return!0;if(r.length<2)return!1;const a=t.getScreenCTM(),s=e.parentElement?.getScreenCTM();if(!a||!s)return!1;const n=e.getBoundingClientRect(),l=xr(e,t);if(o&&!l)return!1;const c=new DOMPoint(n.left+n.width/2,n.top+n.height/2).matrixTransform(a.inverse()),h=e.getAttribute("transform");e.removeAttribute("transform");const d=e.getBBox();h&&e.setAttribute("transform",h);const u=[...t.ownerSVGElement?.querySelectorAll("g.edgeLabel")??[]].filter(x=>x!==e&&x.textContent?.trim()).map(x=>x.getBoundingClientRect()),f=[...t.ownerSVGElement?.querySelectorAll("g.node")??[]].map(x=>x.getBoundingClientRect()),p=(x,C)=>x.left<C.right+4&&x.right+4>C.left&&x.top<C.bottom+4&&x.bottom+4>C.top,m=r.slice(1).flatMap((x,C)=>{const k=r[C],v=Math.abs(k.y-x.y)<.001,M=Math.hypot(x.x-k.x,x.y-k.y),A=(v?d.width:d.height)+12;return M<A?[]:[.5,.35,.65,.2,.8].flatMap(L=>{if(M*Math.min(L,1-L)<A/2)return[];const T={x:k.x+(x.x-k.x)*L,y:k.y+(x.y-k.y)*L};if(o&&l){const D={x:T.x-l.width/2,y:T.y-l.height/2,width:l.width,height:l.height};if(o.obstacles.some(F=>ki(D,F,4))||o.occupied.some(F=>Sr(F,D,4)))return[]}const _=new DOMPoint(T.x,T.y).matrixTransform(a),$=DOMRect.fromRect({x:_.x-n.width/2,y:_.y-n.height/2,width:n.width,height:n.height}),P=u.filter(D=>p($,D)).length+f.filter(D=>p($,D)).length;return[{start:k,end:x,center:T,preferred:C===i,collisions:P,distance:Math.hypot(T.x-c.x,T.y-c.y)}]})}).toSorted((x,C)=>Number(C.preferred)-Number(x.preferred)||x.collisions-C.collisions||x.distance-C.distance)[0];if(!m)return!1;const y=new DOMPoint(m.center.x,m.center.y).matrixTransform(a).matrixTransform(s.inverse());return e.setAttribute("transform",`translate(${y.x-d.x-d.width/2}, ${y.y-d.y-d.height/2})`),e.dataset.routePathId=t.id,e.dataset.finalPathCenter=`${m.center.x},${m.center.y}`,t.dataset.labelSegment=`${m.start.x},${m.start.y} ${m.end.x},${m.end.y}`,!0}function wp(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll("g.node")].flatMap(o=>{const a=Ke(o);return a?[{node:o,bounds:a.getBoundingClientRect()}]:[]}),i=new Map;for(const o of t){const a=Cr(o);if(!a||a.source===a.target)continue;const s=[a.source,a.target].toSorted().join("\0");i.set(s,[...i.get(s)??[],o])}for(const o of t){if(o.dataset.feedbackLane||o.dataset.fanoutSource||o.dataset.groupedReturnLane||o.dataset.decisionBranch||o.dataset.decisionReturn||o.dataset.clientRequestLane||o.dataset.clusterHeaderClearance||o.dataset.compactGroupedRoute||o.dataset.decisionCycleRoute||o.dataset.nestedDecisionRoute)continue;const a=Cr(o),s=a&&Je(e,a.source),n=a&&Je(e,a.target),l=s&&Ke(s),c=n&&Ke(n),h=o.getScreenCTM(),d=(o.dataset.manhattanPoints??"").trim().split(/\s+/).map(Q=>Q.split(",").map(Number)).filter(Q=>Q.length===2&&Q.every(Number.isFinite)).map(([Q,rt])=>({x:Q,y:rt}));if(!l||!c||!h)continue;const u=l.getBoundingClientRect(),f=c.getBoundingClientRect(),p={x:u.x+u.width/2,y:u.y+u.height/2},g={x:f.x+f.width/2,y:f.y+f.height/2},m=f.top>=u.bottom||u.top>=f.bottom,y=f.left>=u.right||u.left>=f.right,x=m||!y&&Math.abs(g.y-p.y)>=Math.abs(g.x-p.x),C=g.y>=p.y,k=g.x>=p.x,v=Math.max(u.left,f.left),M=Math.min(u.right,f.right),A=Math.max(u.top,f.top),L=Math.min(u.bottom,f.bottom),T=v<=M?(v+M)/2:p.x,_=v<=M?T:g.x,$=A<=L?(A+L)/2:p.y,P=A<=L?$:g.y,D=x?{x:T,y:C?u.bottom:u.top}:{x:k?u.right:u.left,y:$},F=x?{x:_,y:C?f.top:f.bottom}:{x:k?f.left:f.right,y:P},E=h.inverse(),B=(Q,rt)=>{const et=new DOMPoint(Q,rt).matrixTransform(E);return{x:et.x,y:et.y}};let q=B(D.x,D.y),W=B(F.x,F.y),O=null;if(a?.source===a?.target){const Q=u.right+48;O=[B(u.right,u.top+u.height*.2),B(Q,u.top+u.height*.2),B(Q,u.top+u.height*.8),B(u.right,u.top+u.height*.8)],o.dataset.selfLoop="right"}else if(!o.dataset.compactFlowchart&&a){const Q=[a.source,a.target].toSorted().join("\0"),rt=i.get(Q)??[],et=rt.indexOf(o)-(rt.length-1)/2;if(rt.length>1){if(et===0&&x){const J=(p.x+g.x)/2;O=[B(J,C?u.bottom:u.top),B(J,C?f.top:f.bottom)]}else if(et===0){const J=(p.y+g.y)/2;O=[B(k?u.right:u.left,J),B(k?f.left:f.right,J)]}else if(x){const J=24+(Math.ceil(Math.abs(et))-1)*16,at=et<0,xt=Math.min(p.y,g.y),H=Math.max(p.y,g.y),Y=r.filter(({node:It,bounds:zt})=>It!==s&&It!==n&&zt.bottom>xt&&zt.top<H),Z=at?Math.min(u.left,f.left,...Y.map(({bounds:It})=>It.left))-J:Math.max(u.right,f.right,...Y.map(({bounds:It})=>It.right))+J,tt=at?u.left:u.right,st=at?f.left:f.right;O=[B(tt,p.y),B(Z,p.y),B(Z,g.y),B(st,g.y)]}else{const J=24+(Math.ceil(Math.abs(et))-1)*16,at=et<0,xt=Math.min(p.x,g.x),H=Math.max(p.x,g.x),Y=r.filter(({node:It,bounds:zt})=>It!==s&&It!==n&&zt.right>xt&&zt.left<H),Z=at?Math.min(u.top,f.top,...Y.map(({bounds:It})=>It.top))-J:Math.max(u.bottom,f.bottom,...Y.map(({bounds:It})=>It.bottom))+J,tt=at?u.top:u.bottom,st=at?f.top:f.bottom;O=[B(p.x,tt),B(p.x,Z),B(g.x,Z),B(g.x,st)]}o.dataset.parallelLane=et<0?"before":et>0?"after":"center"}}O&&(q=O[0],W=O[O.length-1]);const R=O??(d.length>=2?d:[q,W]),V=R.slice(1).some((Q,rt)=>{const et=R[rt];return Math.abs(Q.x-et.x)>=.001&&Math.abs(Q.y-et.y)>=.001}),j=O??nc(R,q,W,x),z=vr(j);V&&(o.dataset.cardinalRepaired="true"),o.dataset.manhattanPoints=z.map(({x:Q,y:rt})=>`${Q},${rt}`).join(" "),o.setAttribute("d",z.map(({x:Q,y:rt},et)=>`${et===0?"M":"L"}${Q},${rt}`).join("")),o.dataset.compactFlowchart||ro(vi(e,o),o,z)}}function Cn(e,t,r,i){const o=Lt(t,.5,.5),a=n=>!r.some(l=>ki(n,l,4))&&!i.some(l=>Sr(l,n,4));return or(e).flatMap(({start:n,end:l})=>{const c=Math.abs(n.y-l.y)<.001,h=c?"x":"y",d=c?"y":"x",u=(c?t.width:t.height)/2,f=Math.min(n[h],l[h])+u+6,p=Math.max(n[h],l[h])-u-6;return f>p?[]:[o[h],(f+p)/2,f,p,f*.75+p*.25,f*.25+p*.75].flatMap(g=>{const m={[h]:Math.max(f,Math.min(p,g)),[d]:n[d]},y={...t,x:m.x-t.width/2,y:m.y-t.height/2};return a(y)?[{center:m,bounds:y,start:n,end:l,distance:Math.hypot(m.x-o.x,m.y-o.y)}]:[]})}).toSorted((n,l)=>n.distance-l.distance)[0]}function L1(e,t,r,i,o,a=[],s=[],n,l=!1,c=!1){if(e.length<2)return e;const h=T=>or(T).some(_=>i.some($=>Sr(_,$,8))),d=T=>or(T).some(_=>o.some($=>ds(_,$))),u=T=>!n||Cn(T,n.bounds,[t,r,...i,...n.obstacles],n.occupied);if(!c&&!h(e)&&!d(e)&&u(e))return e;const f=(T,_,$,P,D=!1)=>{const F=xa(_,$),E=[{point:_,side:F}];for(const B of D?[]:["top","right","bottom","left"])for(const q of c?[.5,.25,.75,0,1]:[.5,.25,.75]){const W=B==="top"||B==="bottom"?Lt(T,q,B==="top"?0:1):Lt(T,B==="left"?0:1,q);if(B==="top"||B==="bottom"){const O=Math.min(T.width/2,T.corner?.x??0);W.x=Math.max(T.x+O,Math.min(T.x+T.width-O,W.x))}else{const O=Math.min(T.height/2,T.corner?.y??0);W.y=Math.max(T.y+O,Math.min(T.y+T.height-O,W.y))}P.every(O=>Math.hypot(O.x-W.x,O.y-W.y)>=(c?8:ti))&&E.push({point:W,side:B})}return E.map(B=>{const q={...B.point},W=Math.max(16,(n?.bounds.height??0)/2+(c?4:8)),O=Math.max(16,(n?.bounds.width??0)/2+(c?4:8));return B.side==="top"&&(q.y-=W),B.side==="bottom"&&(q.y+=W),B.side==="left"&&(q.x-=O),B.side==="right"&&(q.x+=O),{...B,lead:q}})},p=f(t,e[0],e[1],a,l),g=f(r,e.at(-1),e.at(-2),s),m=[t,r,...i,...o.map(({start:T,end:_})=>({x:Math.min(T.x,_.x),y:Math.min(T.y,_.y),width:Math.abs(T.x-_.x),height:Math.abs(T.y-_.y)}))],y=Math.max(16,(n?.bounds.width??0)/2+8),x=Math.max(16,(n?.bounds.height??0)/2+8),C=[Math.min(...m.map(T=>T.x))-y,Math.max(...m.map(T=>T.x+T.width))+y],k=[Math.min(...m.map(T=>T.y))-x,Math.max(...m.map(T=>T.y+T.height))+x];if(c){const T=(_,$)=>[...new Set(i.flatMap(P=>[P[_]-16,P[_]+P[$]+16]))].toSorted((P,D)=>Math.abs(P-t[_])-Math.abs(D-t[_])).slice(0,12);C.push(...T("x","width")),k.push(...T("y","height"))}const v=p.flatMap(T=>g.flatMap(_=>[[T.point,T.lead,{x:T.lead.x,y:_.lead.y},_.lead,_.point],[T.point,T.lead,{x:_.lead.x,y:T.lead.y},_.lead,_.point],...C.map($=>[T.point,T.lead,{x:$,y:T.lead.y},{x:$,y:_.lead.y},_.lead,_.point]),...k.map($=>[T.point,T.lead,{x:T.lead.x,y:$},{x:_.lead.x,y:$},_.lead,_.point])].map(vr))),M=T=>or(T).reduce((_,$)=>_+Math.hypot($.end.x-$.start.x,$.end.y-$.start.y),0);let A,L=1/0;for(const{candidate:T,length:_}of v.map($=>({candidate:$,length:M($)})).toSorted(($,P)=>$.length-P.length)){if(c&&(_>=M(e)-1||T.some(P=>P.y<Math.min(t.y,r.y)-x))||h(T)||!u(T)||or(T).some(P=>Sr(P,t)||Sr(P,r)))continue;const $=or(T).reduce((P,D)=>P+o.reduce((F,E)=>{const B={x:Math.min(E.start.x,E.end.x),y:Math.min(E.start.y,E.end.y),width:Math.abs(E.end.x-E.start.x),height:Math.abs(E.end.y-E.start.y)};return F+(ds(D,E)?100:Sr(D,B,6)?1:0)},0),0);if($<L&&(!c||$===0)&&(A=T,L=$),L===0)break}return A??e}function Bu(e){return[...e.querySelectorAll(".edgePaths path")].flatMap(t=>{const r=Cr(t),i=(t.dataset.manhattanPoints??"").trim().split(/\s+/).map(o=>{const[a,s]=o.split(",").map(Number);return{x:a,y:s}});return r&&i.length>=2&&i.every(o=>Number.isFinite(o.x)&&Number.isFinite(o.y))?[{path:t,...r,points:i,label:vi(e,t)}]:[]})}function U$(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=Bu(e),r=t[0]?.path;if(!r)return;const i=new Map([...e.querySelectorAll("g.node")].flatMap(l=>{const c=Ke(l),h=c&&Qe(c,r);if(!c||!h)return[];const d=getComputedStyle(c),u=c.getBBox(),f=(g,m)=>(Number.parseFloat(g)||0)*(g.endsWith("%")?m/100:1),p={x:f(d.rx,u.width)*h.width/u.width,y:f(d.ry,u.height)*h.height/u.height};return[[Ir(l),{bounds:{...h,corner:p},shape:c}]]})),o=new Map(t.flatMap(l=>{const c=l.label?.textContent?.trim()&&xr(l.label,r);return c?[[l,c]]:[]})),a=[...e.querySelectorAll("g.cluster > .cluster-label")].flatMap(l=>{const c=xr(l,r);return c?[c]:[]}),s=new Map,n=t.map(l=>{const c=i.get(l.source),h=i.get(l.target),d=!!(l.source===l.target||l.path.dataset.fanoutSource||l.path.dataset.feedbackLane||l.path.dataset.groupedReturnLane||l.path.dataset.decisionCycleRoute||l.path.dataset.nestedDecisionRoute||c?.shape.tagName.toLowerCase()!=="rect"||h?.shape.tagName.toLowerCase()!=="rect");return{route:l,source:c,target:h,fixed:d}}).sort((l,c)=>Number(c.fixed)-Number(l.fixed));for(const{route:l,source:c,target:h,fixed:d}of n){const u=t.filter(v=>v!==l),f=v=>u.flatMap(M=>[...M.source===v?[M.points[0]]:[],...M.target===v?[M.points.at(-1)]:[]]),p=u.filter(v=>v.source!==l.source||v.target===l.target).flatMap(v=>or(v.points)),g=[...i].filter(([v])=>v!==l.source&&v!==l.target).map(([,v])=>v.bounds).concat(a,[...o].filter(([v])=>v!==l).map(([,v])=>v)),m=o.get(l),y=(v,M=!1)=>!d&&c&&h?L1(v,c.bounds,h.bounds,g,p,f(l.source),f(l.target),m?{bounds:m,obstacles:[...o].filter(([A])=>A!==l).map(([,A])=>A),occupied:u.flatMap(A=>or(A.points))}:void 0,!!l.path.dataset.fanoutPort&&u.some(A=>A.source===l.source&&A.target!==l.target),M):v,x=Z$(e,l.path,c?.bounds,h?.bounds),C=x?[Lt(c.bounds,1,.5),{x:x.x,y:c.bounds.y+c.bounds.height/2},{x:x.x,y:h.bounds.y+h.bounds.height/2},Lt(h.bounds,1,.5)]:l.points;let k=y(C);if(!d&&!x&&k.length>4&&(k=y(k,!0)),!d&&!x&&!e.querySelector("g.cluster")&&(k=V$(k,u.filter(v=>v.path.dataset.feedbackLane).flatMap(v=>or(v.points)),g)),!d&&c&&h&&h.bounds.y>c.bounds.y&&u.some(v=>v.path.dataset.feedbackLane&&v.target===l.source&&or(k).some(M=>or(v.points).some(({start:A,end:L})=>Sr(M,{x:Math.min(A.x,L.x),y:Math.min(A.y,L.y),width:Math.abs(L.x-A.x),height:Math.abs(L.y-A.y)}))))&&(k=y(k,!0)),m){const v=Cn(k,m,[...[c,h].flatMap(M=>M?[M.bounds]:[]),...g],u.flatMap(M=>or(M.points)));v&&(o.set(l,v.bounds),s.set(l.path.id,v.center))}k!==l.points&&(l.points=k,l.path.dataset.manhattanPoints=k.map(({x:v,y:M})=>`${v},${M}`).join(" "),l.path.setAttribute("d",k.map(({x:v,y:M},A)=>`${A?"L":"M"}${v},${M}`).join("")))}for(const l of t.filter(c=>c.path.dataset.feedbackLane==="outer")){const h=t.filter(u=>u!==l).flatMap(u=>or(u.points).map(({start:f,end:p})=>({x:Math.min(f.x,p.x),y:Math.min(f.y,p.y),width:Math.abs(p.x-f.x),height:Math.abs(p.y-f.y)})));h.push(...[...o].filter(([u])=>u!==l).map(([,u])=>u));const d=$$(l.points,h);d!==l.points&&(l.path.dataset.manhattanPoints=d.map(({x:u,y:f})=>`${u},${f}`).join(" "),l.path.setAttribute("d",d.map(({x:u,y:f},p)=>`${p?"L":"M"}${u},${f}`).join("")),s.delete(l.path.id))}return s}function V$(e,t,r){for(let i=1;i<e.length-2;i++){const o=e[i],a=e[i+1];if(Math.abs(o.x-a.x)>.001||Math.abs(o.y-a.y)<32)continue;const s=t.filter(l=>Math.abs(l.start.x-l.end.x)<.001&&Math.abs(l.start.x-o.x)<20&&Math.abs(l.start.x-o.x)>.001&&Math.min(Math.max(o.y,a.y),Math.max(l.start.y,l.end.y))-Math.max(Math.min(o.y,a.y),Math.min(l.start.y,l.end.y))>20);if(!s.length)continue;const n=s.flatMap(l=>[l.start.x-20,l.start.x+20]).filter(l=>Math.abs(l-o.x)<=20).toSorted((l,c)=>Math.abs(l-o.x)-Math.abs(c-o.x));for(const l of n){const c=e.map((d,u)=>u===i||u===i+1?{...d,x:l}:d),h=or(c).slice(i-1,i+2);if(!(s.some(d=>Math.abs(d.start.x-l)<19.99)||h.some(d=>r.some(u=>Sr(d,u,4)))))return c}}return e}function Z$(e,t,r,i){if(!r||!i||t.dataset.nestedDecisionRoute)return null;const o=(l,c)=>c.x>=l.x-.5&&c.x+c.width<=l.x+l.width+.5&&c.y>=l.y-.5&&c.y+c.height<=l.y+l.height+.5,a=[...e.querySelectorAll("g.cluster > rect")].flatMap(l=>{const c=Qe(l,t);return c?[c]:[]}),s=a.filter(l=>o(l,i)&&!o(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0],n=s&&a.filter(l=>l!==s&&o(l,s)&&o(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0];return!s||!n||r.y+r.height>s.y?null:{x:(s.x+s.width+n.x+n.width)/2}}function K$(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=Bu(e),i=r[0]?.path;if(!i)return;const o=[...e.querySelectorAll("g.node, g.cluster > .cluster-label")].flatMap(s=>{const n=xr(s,i);return n?[n]:[]}),a=r.flatMap(s=>{const n=s.label;if(!n?.textContent?.trim())return[];const l=xr(n,i),c=t?.get(s.path.id);l&&c&&(l.x=c.x-l.width/2,l.y=c.y-l.height/2);const h=i.getScreenCTM(),d=n.parentElement?.getScreenCTM(),u=n.getBBox();return l&&h&&d?[{route:s,label:n,current:l,matrix:h,inverse:d.inverse(),local:u}]:[]});for(const s of a){const{route:n,label:l,current:c,matrix:h,inverse:d,local:u}=s,f=r.filter(m=>m!==n).flatMap(m=>or(m.points)),p=Cn(n.points,c,[...o,...a.filter(m=>m!==s).map(m=>m.current)],f);if(!p)continue;const g=new DOMPoint(p.center.x,p.center.y).matrixTransform(h).matrixTransform(d);l.setAttribute("transform",`translate(${g.x-u.x-u.width/2},${g.y-u.y-u.height/2})`),l.dataset.labelSegmentStart=`${p.start.x},${p.start.y}`,l.dataset.labelSegmentEnd=`${p.end.x},${p.end.y}`,s.current=p.bounds}}function Q$(e,t,r,i,o=[],a=[],s=[],n=8){if({top:"bottom",right:"left",bottom:"top",left:"right"}[t.side]!==r.side)return e;const c=t.side==="left"||t.side==="right",h=c?"y":"x",d=c?"x":"y",u=t.side==="right"||t.side==="bottom"?1:-1;if((r.point[d]-t.point[d])*u<=0)return e;const f=t.range??[t.point[h],t.point[h]],p=r.range??[r.point[h],r.point[h]],g=Math.max(f[0],p[0]),m=Math.min(f[1],p[1]);if(g>m)return e;const y=C=>Math.max(g,Math.min(m,C)),x=[...new Set([y(t.point[h]),y(r.point[h]),g,m,(g+m)/2,...[...a,...s].flatMap(C=>[C[h]-ti,C[h]+ti]),...i.flatMap(C=>[C[h]-n,C[h]+(c?C.height:C.width)+n]),...o.flatMap(C=>[Math.min(C.start[h],C.end[h])-n,Math.max(C.start[h],C.end[h])+n])])].filter(C=>C>=g&&C<=m).toSorted((C,k)=>Math.abs(C-t.point[h])+Math.abs(C-r.point[h])-Math.abs(k-t.point[h])-Math.abs(k-r.point[h]));for(const C of x){const k={...t.point,[h]:C},v={...r.point,[h]:C};if(a.some(A=>Math.hypot(k.x-A.x,k.y-A.y)<ti-.001)||s.some(A=>Math.hypot(v.x-A.x,v.y-A.y)<ti-.001))continue;const M={start:k,end:v};if(!i.some(A=>Sr(M,A,n))&&!o.some(A=>Sr(M,{x:Math.min(A.start.x,A.end.x),y:Math.min(A.start.y,A.end.y),width:Math.abs(A.start.x-A.end.x),height:Math.abs(A.start.y-A.end.y)},n)))return[k,v]}return e}function xa(e,t){const r=t.x-e.x,i=t.y-e.y;return Math.abs(r)>=Math.abs(i)?r>=0?"right":"left":i>=0?"bottom":"top"}function J$(e,t,r,i,o){const a=s=>or(s).reduce((n,{start:l,end:c})=>n+Math.hypot(c.x-l.x,c.y-l.y),0);return t.map(vr).filter(s=>s.length<=e.length&&a(s)<a(e)-1).filter(s=>or(s).every(n=>!r.some(l=>Sr(n,l,8))&&!i.some(({start:l,end:c})=>Sr(n,{x:Math.min(l.x,c.x),y:Math.min(l.y,c.y),width:Math.abs(c.x-l.x),height:Math.abs(c.y-l.y)},8)))).filter(s=>!o||Cn(s,o.bounds,[...r,...o.obstacles],i)).sort((s,n)=>a(s)-a(n))[0]??e}function tE(e,t){const r=t.map(i=>({...i,points:(i.path.dataset.manhattanPoints??"").split(" ").map(o=>{const[a,s]=o.split(",").map(Number);return{x:a,y:s}})})).filter(({points:i})=>i.length>=2&&i.every(({x:o,y:a})=>Number.isFinite(o)&&Number.isFinite(a)));for(const i of r){if(i.source===i.target||i.points.length===2)continue;const{path:o,points:a}=i,s=y=>{const x=Je(e,i[y]),C=x&&Ke(x),k=C&&Qe(C,o);if(!C||!k)return;const v=y==="source"?a[0]:a[a.length-1],M=y==="source"?a[1]:a[a.length-2],A=xa(v,M),L=A==="left"||A==="right",T=Math.max(8,Number(C.getAttribute(L?"ry":"rx"))||0),_=C.tagName.toLowerCase()==="rect"?L?[k.y+T,k.y+k.height-T]:[k.x+T,k.x+k.width-T]:void 0;return{point:v,side:A,range:_}},n=s("source"),l=s("target");if(!n||!l)continue;const c=r.filter(y=>y!==i),h=y=>c.flatMap(x=>[...x.source===y?[x.points[0]]:[],...x.target===y?[x.points[x.points.length-1]]:[]]),d=(y,x)=>x.x>=y.x&&x.x<=y.x+y.width&&x.y>=y.y&&x.y<=y.y+y.height,u=[...[...e.querySelectorAll("g.node")].filter(y=>![i.source,i.target].includes(Ir(y))),...e.querySelectorAll("g.cluster > .cluster-label"),...[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(y=>y!==i.label&&y.textContent?.trim())].map(y=>xr(y,o)).filter(y=>!!y);for(const y of e.querySelectorAll("g.cluster > rect")){const x=Qe(y,o);x&&!d(x,n.point)&&!d(x,l.point)&&u.push(x)}const f=c.flatMap(y=>or(y.points));let p=Q$(a,n,l,u,f,h(i.source),h(i.target));if(p===a&&o.dataset.nestedDecisionRoute==="secondary-retry"){const y=Je(e,i.source),x=Je(e,i.target),C=y&&Ke(y),k=x&&Ke(x),v=C&&Qe(C,o),M=k&&Qe(k,o);if(C?.tagName.toLowerCase()==="rect"&&k&&eo(k)&&v&&M){const A=Lt(v,.5,0),L=[];if(l.side==="bottom"&&A.y>M.y+M.height+8&&A.x>l.point.x){const D=(A.y+M.y+M.height)/2;L.push([A,{x:A.x,y:D},{x:l.point.x,y:D},l.point])}const T=zr(M,"left",24);A.x<T.x&&A.y>T.y&&L.push([A,{x:A.x,y:T.y},T]);const _=zr(M,"right",M.height*.32);A.x>_.x&&A.y>_.y&&L.push([A,{x:A.x,y:_.y},_]);const $=L.filter(D=>!h(i.source).some(F=>Math.hypot(F.x-A.x,F.y-A.y)<ti)&&!h(i.target).some(F=>Math.hypot(F.x-D.at(-1).x,F.y-D.at(-1).y)<ti)),P=i.label&&xr(i.label,o);p=J$(a,$,u,f,P?{bounds:P,obstacles:[v,M]}:void 0)}}if(p===a||!ro(i.label,o,p,void 0,{obstacles:u,occupied:f}))continue;i.points=p,o.dataset.manhattanPoints=p.map(({x:y,y:x})=>`${y},${x}`).join(" "),o.dataset.manhattanSegments=String(p.length-1);const g=p.at(-1),m=p.at(-2);o.dataset.terminalDirection=`${g.x-m.x},${g.y-m.y}`,o.dataset.nestedDecisionRoute==="secondary-retry"&&(o.dataset.diamondTargetSide=xa(g,m)),o.setAttribute("d",p.map(({x:y,y:x},C)=>`${C?"L":"M"}${y},${x}`).join(""))}}function A1(e,t,r){const i=e.map(o=>({...o}));if(t){const o=i[1],a=i[0];i[0]=t.point;const s=t.side==="top"||t.side==="bottom";if(i.length>2&&(s&&Math.abs(a.x-o.x)<.001?o.x=t.point.x:!s&&Math.abs(a.y-o.y)<.001&&(o.y=t.point.y)),!(s?Math.abs(o.x-t.point.x)<.001:Math.abs(o.y-t.point.y)<.001))if(t.lead){const l=s?{x:o.x,y:t.lead.y}:{x:t.lead.x,y:o.y};i.splice(1,0,t.lead,l)}else{const l=s?{x:t.point.x,y:o.y}:{x:o.x,y:t.point.y};i.splice(1,0,l)}}if(r){const o=i[i.length-2],a=i[i.length-1];i[i.length-1]=r.point;const s=r.side==="top"||r.side==="bottom";if(i.length>2&&(s&&Math.abs(a.x-o.x)<.001?o.x=r.point.x:!s&&Math.abs(a.y-o.y)<.001&&(o.y=r.point.y)),!(s?Math.abs(o.x-r.point.x)<.001:Math.abs(o.y-r.point.y)<.001))if(r.lead){const l=s?{x:o.x,y:r.lead.y}:{x:r.lead.x,y:o.y};i.splice(i.length-1,0,l,r.lead)}else{const l=s?{x:r.point.x,y:o.y}:{x:o.x,y:r.point.y};i.splice(i.length-1,0,l)}}return vr(i)}function zr(e,t,r=0){const i=Lt(e,.5,.5),o=e.width/2,a=e.height/2;if(t==="top"||t==="bottom"){const l=Math.max(-o*.7,Math.min(o*.7,r)),c=a*(1-Math.abs(l)/o);return{x:i.x+l,y:i.y+(t==="top"?-c:c)}}const s=Math.max(-a*.7,Math.min(a*.7,r)),n=o*(1-Math.abs(s)/a);return{x:i.x+(t==="left"?-n:n),y:i.y+s}}function eE(e,t,r=0){const i=zr(e,t,r),o={...i};return t==="top"?o.y-=12:t==="right"?o.x+=12:t==="bottom"?o.y+=12:o.x-=12,{point:i,side:t,lead:o}}function rE(e,t){const r=new Map(t.map(s=>[s,Cr(s)])),i=[];for(const s of t){const n=r.get(s),l=(s.dataset.manhattanPoints??"").trim().split(/\s+/).map(f=>f.split(",").map(Number)).filter(f=>f.length===2&&f.every(Number.isFinite)).map(([f,p])=>({x:f,y:p}));if(!n||l.length<2)continue;const c=Je(e,n.source),h=c&&Ke(c);if(h&&eo(h)){const f=Qe(h,s);if(f){const p=xa(Lt(f,.5,.5),l[1]);i.push({path:s,role:"source",nodeId:n.source,bounds:f,side:p,adjacent:l[1]})}}const d=Je(e,n.target),u=d&&Ke(d);if(u&&eo(u)){const f=Qe(u,s);if(f){const p=t.some(m=>{const y=r.get(m);return m!==s&&y?.source===n.target&&y.target===n.source}),g=s.dataset.decisionReturn&&s.dataset.compactFlowchart==="true"?"left":s.dataset.decisionReturn||p?"bottom":xa(Lt(f,.5,.5),l[l.length-2]);i.push({path:s,role:"target",nodeId:n.target,bounds:f,side:g,adjacent:l[l.length-2]})}}}const o=new Map;for(const s of i){const n=`${s.nodeId}\0${s.side}`;o.set(n,[...o.get(n)??[],s])}const a=new Map;for(const s of o.values()){const n=s[0].side,l=n==="top"||n==="bottom",c=s.toSorted((u,f)=>(l?u.adjacent.x-f.adjacent.x:u.adjacent.y-f.adjacent.y)||u.path.id.localeCompare(f.path.id)||u.role.localeCompare(f.role)),h=(l?s[0].bounds.width:s[0].bounds.height)*.5,d=Math.min(ti,h/Math.max(1,s.length-1));c.forEach((u,f)=>{const p=s.length===1?0:(f-(s.length-1)/2)*d,g=a.get(u.path)??{};g[u.role]=eE(u.bounds,n,p),a.set(u.path,g)})}return a}function iE(e){const t=new Map;for(const i of e.querySelectorAll(".edgePaths path")){if(i.dataset.feedbackLane||i.dataset.groupedReturnLane||i.dataset.clientRequestLane||i.dataset.compactGroupedRoute||i.dataset.decisionCycleRoute||i.dataset.nestedDecisionRoute)continue;const o=Cr(i),a=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(s=>s.split(",").map(Number)).filter(s=>s.length===2&&s.every(Number.isFinite)).map(([s,n])=>({x:s,y:n}));if(!(!o||a.length<2))for(const s of["source","target"]){if(s==="source"&&i.dataset.fanoutSource)continue;const n=o[s],l=Je(e,n),c=l&&Ke(l),h=c&&Qe(c,i);if(!c||!h||eo(c))continue;const d=s==="source"?a[0]:a[a.length-1],f=[["top",Math.abs(d.y-h.y)],["right",Math.abs(d.x-h.x-h.width)],["bottom",Math.abs(d.y-h.y-h.height)],["left",Math.abs(d.x-h.x)]].toSorted((g,m)=>g[1]-m[1])[0][0],p=`${n}\0${f}`;t.set(p,[...t.get(p)??[],{path:i,role:s,side:f,bounds:h,endpoint:d}])}}const r=new Map;for(const i of t.values()){if(i.length<2)continue;const o=i[0].side,a=o==="top"||o==="bottom",s=i.toSorted((c,h)=>(a?c.endpoint.x-h.endpoint.x:c.endpoint.y-h.endpoint.y)||c.path.id.localeCompare(h.path.id)||c.role.localeCompare(h.role)),n=(a?i[0].bounds.width:i[0].bounds.height)*.6,l=Math.min(ti,n/Math.max(1,i.length-1));s.forEach((c,h)=>{const d=(h-(i.length-1)/2)*l,u=Pi(c.bounds,o),f=a?{x:u.x+d,y:u.y}:{x:u.x,y:u.y+d},p=r.get(c.path)??{};p[c.role]={point:f,side:o},r.set(c.path,p)})}for(const[i,o]of r){const a=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(n=>n.split(",").map(Number)).filter(n=>n.length===2&&n.every(Number.isFinite)).map(([n,l])=>({x:n,y:l}));if(a.length<2)continue;const s=A1(a,o.source,o.target);i.dataset.manhattanPoints=s.map(({x:n,y:l})=>`${n},${l}`).join(" "),o.source&&(i.dataset.crowdedSourcePort=`${o.source.point.x},${o.source.point.y}`),o.target&&(i.dataset.crowdedTargetPort=`${o.target.point.x},${o.target.point.y}`),i.setAttribute("d",s.map(({x:n,y:l},c)=>`${c===0?"M":"L"}${n},${l}`).join(""))}}function oE(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;iE(e);const t=[...e.querySelectorAll(".edgePaths path")],r=rE(e,t);for(const i of t){if(i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)continue;const o=Cr(i),a=o&&Je(e,o.source),s=o&&Je(e,o.target),n=a&&Ke(a),l=s&&Ke(s),c=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(m=>m.split(",").map(Number)).filter(m=>m.length===2&&m.every(Number.isFinite)).map(([m,y])=>({x:m,y}));if(c.length<2)continue;let h,d;const u=vi(e,i)?.textContent?.trim().toLocaleLowerCase();if(n&&eo(n)){const m=Qe(n,i),y=r.get(i)?.source;if(m&&y){const x=Lt(m,.5,.5),C=xa(x,c[1]),{side:k}=y;if(u==="no"&&C!==k&&c.length>2){const M=c.slice(1).map((A,L)=>({index:L,length:Math.abs(c[L].y-A.y)<.001?Math.abs(c[L].x-A.x):0})).toSorted((A,L)=>L.length-A.length)[0];if(M?.length){const A=(c[M.index].y>=x.y?1:-1)*ti;c[M.index].y+=A,c[M.index+1].y+=A,i.dataset.decisionLane=String(c[M.index].y)}}const{point:v}=y;h=y,i.dataset.diamondSourcePort=`${v.x},${v.y}`,i.dataset.diamondSourceSide=k,i.dataset.decisionBranch&&(i.dataset.decisionPort=`${v.x},${v.y}`)}}if(l&&eo(l)){const m=r.get(i)?.target;if(m){const{side:y}=m,{point:x}=m;d=m,s&&(i.dataset.diamondTargetPort=`${x.x},${x.y}`,i.dataset.diamondTargetSide=y,i.dataset.terminalTarget=s.id)}}const f=A1(c,h,d),p=f[f.length-2],g=f[f.length-1];d&&(i.dataset.terminalDirection=`${g.x-p.x},${g.y-p.y}`),i.dataset.manhattanPoints=f.map(({x:m,y})=>`${m},${y}`).join(" "),i.dataset.manhattanSegments=String(f.length-1),i.setAttribute("d",f.map(({x:m,y},x)=>`${x===0?"M":"L"}${m},${y}`).join("")),i.dataset.compactFlowchart||ro(vi(e,i),i,f)}}function aE(e,t,r,i){const a=Pi(e,"right");if(t.length!==2||[e,...t.map(({bounds:d})=>d),...r,...i].some(d=>!Object.values(d).every(Number.isFinite)||d.width<0||d.height<0)||t.some(({bounds:d,port:u})=>!Number.isFinite(u.x)||!Number.isFinite(u.y)||d.y<e.y+e.height+32||!(Math.abs(u.x-d.x)<.001&&Math.abs(u.y-d.y-d.height/2)<.001)&&(u.x<=a.x+16||Math.abs(u.y-d.y)>.001||u.x<d.x+8||u.x>d.x+d.width-8)))return null;const s={x:a.x+16,y:a.y},n=[];for(const{bounds:d,port:u,tail:f}of t){const m=(Math.abs(u.x-d.x)<.001?[[a,s,{x:s.x,y:e.y+e.height+16},{x:d.x-16,y:e.y+e.height+16},{x:d.x-16,y:u.y},u]]:[...f?.length===2&&Math.abs(f[0].x-u.x)<.001&&f[0].y>=e.y+e.height+8&&f[0].y<=d.y-16?[[a,s,{x:s.x,y:f[0].y},f[0],u]]:[],[a,s,{x:s.x,y:d.y-32},{x:u.x,y:d.y-32},u]]).map(vr).find(y=>or(y).every((x,C)=>Math.abs(x.start.x-x.end.x)>=.001&&Math.abs(x.start.y-x.end.y)>=.001?!1:![...r,...i].some(k=>Sr(x,k,8))&&!Sr(x,e,C===0?0:8)&&!t.some(({bounds:k})=>Sr(x,k,k===d&&C===y.length-2?0:8))));if(!m)return null;n.push(m)}const[l,c]=n.map(or);let h=0;for(;h<Math.min(l.length,c.length);){const d=l[h],u=c[h];if(Math.hypot(d.start.x-u.start.x,d.start.y-u.start.y)>.001)break;if(Math.hypot(d.end.x-u.end.x,d.end.y-u.end.y)>.001){ds(d,u)&&((Math.hypot(d.end.x-d.start.x,d.end.y-d.start.y)<Math.hypot(u.end.x-u.start.x,u.end.y-u.start.y)?d:u)===d?c[h]={start:d.end,end:u.end}:l[h]={start:u.end,end:d.end});break}h++}for(const d of l.slice(h))for(const u of c.slice(h)){if(ds(d,u))return null;const f=Math.abs(d.start.y-d.end.y)<.001,p=Math.abs(u.start.y-u.end.y)<.001;if(f===p)continue;const g=f?d:u,m=f?u:d;if(m.start.x>Math.min(g.start.x,g.end.x)+.001&&m.start.x<Math.max(g.start.x,g.end.x)-.001&&g.start.y>Math.min(m.start.y,m.end.y)+.001&&g.start.y<Math.max(m.start.y,m.end.y)-.001)return null}return n}function sE(e,t,r){if(r.length!==2||e.querySelector("g.cluster")||r.some(({path:y})=>y.dataset.compactFlowchart||y.dataset.feedbackLane))return;const i=r[0].path,o=i.getScreenCTM();if(!o||o.a<=0||o.d<=0||Math.abs(o.b)>.001||Math.abs(o.c)>.001)return;const a=o.inverse(),s=[...e.querySelectorAll("g.node")].map(y=>{const x=Ke(y);return{id:Ir(y),shape:x,bounds:x&&Qe(x,i)}});if(s.some(({bounds:y})=>!y)||new Set(s.map(({id:y})=>y)).size!==s.length)return;const n=s.find(({id:y})=>y===t);if(!n?.bounds||n.shape?.tagName.toLowerCase()!=="rect")return;const c=[...e.querySelectorAll(".edgePaths path")].filter(y=>!r.some(x=>x.path===y)).map(y=>{const x=y.getScreenCTM(),C=y.getTotalLength();if(!x||!C||!Number.isFinite(C)||C>16384)return null;const k=Math.ceil(C/2);return{path:y,points:Array.from({length:k+1},(v,M)=>y.getPointAtLength(C*M/k).matrixTransform(x).matrixTransform(a))}});if(c.some(y=>!y))return;const h=c.flatMap(y=>or(y.points).map(({start:x,end:C})=>({x:Math.min(x.x,C.x),y:Math.min(x.y,C.y),width:Math.abs(C.x-x.x),height:Math.abs(C.y-x.y)}))),d=r.map(({path:y,target:x})=>{const C=s.find(({id:$})=>$===x),k=y.getScreenCTM();if(!C?.bounds||C.shape?.tagName.toLowerCase()!=="rect"||!k||["a","b","c","d","e","f"].some($=>Math.abs(k[$]-o[$])>.001))return null;const v=C.bounds,M=c.filter($=>Cr($.path)?.target===x);if(M.length>1||M.length&&v.width*.6<ti||M.some($=>{const P=$.points.at(-1);return Math.abs(P.y-v.y)>8||P.x<v.x+v.width/2}))return null;const A=v.x<=n.bounds.x+n.bounds.width+16?Pi(v,"left"):{x:v.x+v.width/2-(M.length?ti/2:0),y:v.y},L=y.dataset.manhattanPoints?.split(" ").map(($,P)=>`${P?"L":"M"}${$}`).join(""),_=Mu(L??y.getAttribute("d")??"")?.slice(-2);return{bounds:v,port:A,tail:_&&Math.abs(_[0].x-A.x)<.001&&Math.abs(_[1].y-A.y)<.001?[_[0],A]:void 0}});if(d.some(y=>!y))return;const u=r.map(({path:y})=>vi(e,y)),f=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(y=>y.textContent?.trim()&&!u.includes(y)).map(y=>xr(y,i));if(f.some(y=>!y))return;const p=[...s.filter(y=>y!==n&&!d.some(x=>x.bounds===y.bounds)).map(y=>y.bounds),...f],g=aE(n.bounds,d,p,h);if(!g)return;const m=[];for(const[y,x]of u.entries()){if(!x?.textContent?.trim())continue;const C=xr(x,i),k=x.parentElement?.getScreenCTM();if(!C||!k)return;const v=or(g[y]).find(T=>{const _={x:(T.start.x+T.end.x)/2,y:(T.start.y+T.end.y)/2},$={x:_.x-C.width/2,y:_.y-C.height/2,width:C.width,height:C.height},P=Math.abs(T.start.y-T.end.y)<.001;return Math.hypot(T.end.x-T.start.x,T.end.y-T.start.y)>=(P?C.width:C.height)+16&&![...s.map(D=>D.bounds),...f,...h,...m.map(D=>D.bounds)].some(D=>ki($,D,8))&&!g.filter((D,F)=>F!==y).some(D=>or(D).some(F=>Sr(F,$,8)))});if(!v)return;const M={x:(v.start.x+v.end.x)/2,y:(v.start.y+v.end.y)/2},A=x.getBBox(),L=new DOMPoint(M.x,M.y).matrixTransform(o).matrixTransform(k.inverse());m.push({label:x,center:M,segment:v,bounds:{x:M.x-C.width/2,y:M.y-C.height/2,width:C.width,height:C.height},transform:`translate(${L.x-A.x-A.width/2}, ${L.y-A.y-A.height/2})`})}g.forEach((y,x)=>{const{path:C,target:k}=r[x];C.setAttribute("d",y.map(({x:v,y:M},A)=>`${A?"L":"M"}${v},${M}`).join("")),delete C.dataset.terminalGapBasePath,C.dataset.fanoutSource=t,C.dataset.fanoutTarget=k,C.dataset.fanoutTrunk=y.slice(0,2).map(({x:v,y:M})=>`${v},${M}`).join(" "),C.dataset.manhattanPoints=y.map(({x:v,y:M})=>`${v},${M}`).join(" ")}),m.forEach(({label:y,transform:x,center:C,segment:k})=>{y.setAttribute("transform",x);const v=r[u.indexOf(y)].path;y.dataset.routePathId=v.id,y.dataset.finalPathCenter=`${C.x},${C.y}`,v.dataset.labelSegment=`${k.start.x},${k.start.y} ${k.end.x},${k.end.y}`})}function kp(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{const o=Cr(i);return o?[{path:i,...o}]:[]}),r=new Map;for(const i of t)r.set(i.source,[...r.get(i.source)??[],i]);for(const[i,o]of r){if(o.length<2)continue;const a=Je(e,i);if(!a||a.querySelector(":scope > polygon.label-container"))continue;const s=o.flatMap(f=>{const p=br(a),g=Je(e,f.target),m=g&&br(g);return p&&m?[{...f,targetId:f.target,source:p,target:m}]:[]});if(s.length!==o.length||new Set(s.map(({targetId:f})=>f)).size!==s.length)continue;const n=s[0].source.x+s[0].source.width,l=s[0].source.y+s[0].source.height;if(s.length===3&&s.every(f=>f.target.y>=l+16)&&Math.max(...s.map(f=>f.target.y))-Math.min(...s.map(f=>f.target.y))<=8){const f=s.toSorted((y,x)=>y.target.x+y.target.width/2-(x.target.x+x.target.width/2)),p=f[0].source,g=p.y+p.height/2,m=[{x:p.x,y:g},{x:p.x+p.width/2,y:l},{x:n,y:g}];f.forEach((y,x)=>{const C=m[x],k=x===0?{x:C.x-16,y:C.y}:x===1?{x:C.x,y:C.y+16}:{x:C.x+16,y:C.y},v=y.target.x+y.target.width/2,M=y.target.y,A=M-16,L=[k,{x:k.x,y:A},{x:v,y:A}];L.unshift(C),L.push({x:v,y:M}),y.path.setAttribute("d",L.map((T,_)=>`${_?"L":"M"}${T.x},${T.y}`).join("")),y.path.dataset.fanoutSource=i,y.path.dataset.fanoutTarget=y.targetId,y.path.dataset.fanoutPort=`${C.x},${C.y}`,y.path.dataset.fanoutTrunk=`${C.x},${C.y} ${k.x},${k.y}`,y.path.dataset.manhattanPoints=L.map(T=>`${T.x},${T.y}`).join(" "),ro(vi(e,y.path),y.path,L)});continue}if(s.some(f=>f.target.x<=n+16)){sE(e,i,o);continue}const h=Math.min(...s.map(f=>f.target.x)),d=n+Math.min(36,Math.max(16,(h-n)/2)),u=s[0].source.y+s[0].source.height/2;for(const f of s){const p=f.target.y+f.target.height/2,g=[{x:n,y:u},{x:d,y:u},{x:d,y:p},{x:f.target.x,y:p}];f.path.setAttribute("d",g.map((m,y)=>`${y?"L":"M"}${m.x},${m.y}`).join("")),f.path.dataset.fanoutSource=i,f.path.dataset.fanoutTarget=f.targetId,f.path.dataset.fanoutTrunk=`${n},${u} ${d},${u}`,f.path.dataset.manhattanPoints=g.map(m=>`${m.x},${m.y}`).join(" ")}}}function nE(e,t,r,i){if(!e.textContent?.trim())return;const o=e.getAttribute("transform");e.removeAttribute("transform");const a=e.getBBox();o&&e.setAttribute("transform",o);const s=t.getCTM(),n=e.parentElement?.getCTM();if(!s||!n)return;const l={x:r.x+(i.x-r.x)*.55,y:r.y+(i.y-r.y)*.55},c=new DOMPoint(l.x,l.y).matrixTransform(s).matrixTransform(n.inverse());e.setAttribute("transform",`translate(${c.x-a.x-a.width/2}, ${c.y-a.y-a.height/2})`),e.dataset.finalPathCenter=`${l.x},${l.y}`,e.dataset.routePathId=t.id,t.dataset.labelSegment=`${r.x},${r.y} ${i.x},${i.y}`}function F1(e,t,r){const i=Ke(e),o=i&&Qe(i,r),a=e.transform.baseVal.consolidate()?.matrix;!o||!a||(e.style.setProperty("transition-property","none","important"),e.setAttribute("transform",`translate(${a.e+t.x-o.x-o.width/2}, ${a.f+t.y-o.y-o.height/2})`))}function lE(e,t){const r=new Map;for(const i of e.toSorted((o,a)=>o.frame.width*o.frame.height-a.frame.width*a.frame.height)){const o=e.filter(f=>f!==i&&f.frame.x>=i.frame.x&&f.frame.y>=i.frame.y&&f.frame.x+f.frame.width<=i.frame.x+i.frame.width&&f.frame.y+f.frame.height<=i.frame.y+i.frame.height).flatMap(({cluster:f})=>{const p=r.get(f);return p?[p]:[]}),a=[...i.members.flatMap(f=>{const p=Ke(f),g=p&&Qe(p,t);return g?[g]:[]}),...o];if(!a.length)continue;const s=Number(i.cluster.dataset.headerHeight)||an(18),n=Math.min(...a.map(f=>f.x))-24,l=Math.min(...a.map(f=>f.y))-s,c=Math.max(...a.map(f=>f.x+f.width))+24,h=Math.max(...a.map(f=>f.y+f.height))+24,d={x:n,y:l,width:c-n,height:h-l};i.rect.style.setProperty("transition-property","none","important");for(const[f,p]of Object.entries(d))i.rect.setAttribute(f,String(p));const u=i.label.querySelector("foreignObject");if(u)u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(Math.max(24,d.width-Gr*2))),i.label.setAttribute("transform",`translate(${d.x+Gr}, ${d.y+Gr})`);else{const f=i.label.getBBox();i.label.setAttribute("transform",`translate(${d.x+d.width/2-f.x-f.width/2}, ${d.y+Gr-f.y})`)}r.set(i.cluster,d)}}function cE(e,t){if(e.querySelectorAll("g.cluster").length<2)return!1;const r=t[0]?.path;if(!r)return!1;const i=O=>{const R=O&&Ke(O);return R?Qe(R,r):null},o=[...e.querySelectorAll("g.node")].flatMap(O=>{const R=Ir(O),V=Ke(O);if(!V||!eo(V))return[];const j=t.filter(tt=>tt.source===R&&tt.target!==R),z=j.find(tt=>t.some(st=>st.source===tt.target&&st.target===R))?.target;if(!z)return[];const Q=j.find(tt=>tt.target!==z&&t.some(st=>st.source===z&&st.target===tt.target)&&t.some(st=>st.source===tt.target&&st.target===tt.target))?.target;if(!Q)return[];const rt=new Map;for(const tt of t.filter(st=>st.target===R&&st.source!==z))rt.set(tt.source,[...rt.get(tt.source)??[],tt]);const et=[...rt.values()].find(tt=>tt.length>=2),J=t.filter(tt=>tt.source===R&&tt.target===Q),at=t.find(tt=>tt.source===R&&tt.target===z),xt=t.find(tt=>tt.source===z&&tt.target===R),H=t.find(tt=>tt.source===z&&tt.target===Q),Y=t.find(tt=>tt.source===Q&&tt.target===Q),Z=t.find(tt=>tt.source===Q&&tt.target!==Q);return!et||J.length<2||!at||!xt||!H||!Y||!Z?[]:[{decisionId:R,secondary:z,merge:Q,ingress:et,branches:J,add:at,retry:xt,done:H,loop:Y,downstream:Z}]})[0];if(!o)return!1;const a=o.ingress[0].source,s=o.downstream.target,n=new Set([o.decisionId,o.secondary,o.merge,a,s]),l=[...e.querySelectorAll("g.node")],c=new Map(l.filter(O=>n.has(Ir(O))).map(O=>[Ir(O),O]));if(c.size!==n.size)return!1;const h=[...e.querySelectorAll("g.cluster")].flatMap(O=>{const R=O.querySelector(":scope > rect"),V=O.querySelector(":scope > g.cluster-label");if(!R||!V)return[];const j=Qe(R,r);if(!j)return[];const z=l.filter(Q=>{const rt=i(Q);if(!rt)return!1;const et=Lt(rt,.5,.5);return et.x>=j.x&&et.x<=j.x+j.width&&et.y>=j.y&&et.y<=j.y+j.height});return[{cluster:O,rect:R,label:V,frame:j,members:z}]}),d=h.filter(O=>O.members.some(R=>Ir(R)===o.decisionId)).toSorted((O,R)=>O.frame.width*O.frame.height-R.frame.width*R.frame.height)[0],u=d?h.filter(O=>O!==d&&d.frame.x>=O.frame.x&&d.frame.y>=O.frame.y&&d.frame.x+d.frame.width<=O.frame.x+O.frame.width&&d.frame.y+d.frame.height<=O.frame.y+O.frame.height).toSorted((O,R)=>O.frame.width*O.frame.height-R.frame.width*R.frame.height)[0]:void 0,f=(O,R)=>{const V=c.get(R);O&&V&&!O.members.includes(V)&&O.members.push(V)};f(d,o.decisionId),f(d,o.secondary),f(u,a),f(u,o.merge);const p=new Map([...c].flatMap(([O,R])=>{const V=i(R);return V?[[O,V]]:[]}));if(p.size!==c.size)return!1;const g=t.some(({path:O})=>O.dataset.compactFlowchart==="true"),m=g?"compact":"wide",y=e.dataset.nestedDecisionLayout!==m,x=p.get(a),C=p.get(o.decisionId),k=p.get(o.secondary),v=p.get(o.merge),M=p.get(s),A=g?(()=>{const O=Lt(C,.5,.5).x,R=Lt(x,.5,.5).y,V=Math.max(x.height,C.height,v.height,M.height)+94;return{intake:{x:O,y:R},decision:{x:O,y:R+V},secondary:{x:O+k.width/2,y:R+V*1.5},merge:{x:O,y:R+V*2},registry:{x:O,y:R+V*3}}})():(()=>{const O=Lt(C,.5,.5).y,R=Lt(x,.5,.5).x,V=R+x.width/2+C.width/2+116,j=V+C.width/2+v.width/2+184;return{intake:{x:R,y:O},decision:{x:V,y:O},secondary:{x:(V+j)/2+8,y:O+95},merge:{x:j,y:O},registry:{x:j+v.width/2+M.width/2+124,y:O}}})();if(y){for(const[O,R]of[[a,A.intake],[o.decisionId,A.decision],[o.secondary,A.secondary],[o.merge,A.merge],[s,A.registry]])F1(c.get(O),R,r);e.dataset.nestedDecisionLayout=m}lE(h,r);const L=O=>i(c.get(O)),T=L(a),_=L(o.decisionId),$=L(o.secondary),P=L(o.merge),D=L(s),[F,E]=o.ingress,[B,q]=o.branches,W=[];if(g){const O=Math.min(T.x,_.x,P.x,D.x)-16,R=Math.max(_.x+_.width,$.x+$.width)+12,V=R+20,j=zr(_,"top",-8),z=zr(_,"left",-8),Q=zr(_,"top",8),rt=zr(_,"bottom",-8),et=zr(_,"left",8);W.push({edge:F,role:"primary-ingress",points:[Lt(T,.5,1),{x:j.x,y:Lt(T,.5,1).y},j],targetSide:"top"},{edge:E,role:"metadata-return",points:[Lt(T,0,.55),{x:O-22,y:Lt(T,0,.55).y},{x:O-22,y:z.y},z],labelSegment:1,targetSide:"left"},{edge:o.add,role:"secondary-add",points:[zr(_,"right",-8),{x:R,y:zr(_,"right",-8).y},{x:R,y:Lt($,1,.35).y},Lt($,1,.35)],labelSegment:1,sourceSide:"right"},{edge:o.retry,role:"secondary-retry",points:[Lt($,1,.68),{x:V,y:Lt($,1,.68).y},{x:V,y:_.y-24},{x:Q.x,y:_.y-24},Q],labelSegment:1,targetSide:"top"},{edge:B,role:"primary-branch",points:[rt,{x:rt.x,y:_.y+_.height+12},{x:rt.x-16,y:_.y+_.height+12},{x:rt.x-16,y:P.y-12},{x:Lt(P,.42,0).x,y:P.y-12},Lt(P,.42,0)],labelSegment:2,sourceSide:"bottom"},{edge:q,role:"decision-return",points:[et,{x:O,y:et.y},{x:O,y:Lt(P,0,.65).y},Lt(P,0,.65)],labelSegment:1,sourceSide:"left"},{edge:o.done,role:"secondary-done",points:[Lt($,1,.65),{x:$.x+$.width,y:Lt(P,1,.65).y},Lt(P,1,.65)],labelSegment:0},{edge:o.downstream,role:"primary-save",points:[Lt(P,.5,1),Lt(D,.5,0)]})}else{const O=Math.min(T.y,_.y)-44,R=$.y+$.height+72,V=zr(_,"left",-8),j=zr(_,"top",-8),z=zr(_,"right",-8),Q=zr(_,"right",8),rt={x:P.x,y:Q.y},et=zr(_,"bottom",-10),J=zr(_,"bottom",10),at={x:P.x,y:z.y};W.push({edge:F,role:"primary-ingress",points:[{x:T.x+T.width,y:V.y},V],targetSide:"left"},{edge:E,role:"metadata-return",points:[Lt(T,.5,0),{x:Lt(T,.5,0).x,y:O},{x:j.x,y:O},j],labelSegment:1,targetSide:"top"},{edge:o.add,role:"secondary-add",points:[et,{x:et.x,y:Lt($,0,.38).y},Lt($,0,.38)],labelSegment:1,sourceSide:"bottom"},{edge:o.retry,role:"secondary-retry",points:[Lt($,.38,1),{x:Lt($,.38,1).x,y:R},{x:J.x,y:R},J],labelSegment:1,targetSide:"bottom"},{edge:B,role:"primary-branch",points:[z,at],sourceSide:"right"},{edge:q,role:"decision-return",points:[Q,rt],sourceSide:"right"},{edge:o.done,role:"secondary-done",points:[Lt($,1,.62),{x:Lt(P,.42,1).x,y:Lt($,1,.62).y},Lt(P,.42,1)]},{edge:o.downstream,role:"primary-save",points:[Lt(P,1,.64),{x:D.x,y:Lt(P,1,.64).y}]})}W.push({edge:o.loop,role:"compact-loop",points:[Lt(P,1,.16),{x:P.x+P.width+30,y:Lt(P,1,.16).y},{x:P.x+P.width+30,y:Lt(P,1,.4).y},Lt(P,1,.4)]});for(const{edge:O,role:R,points:V,labelSegment:j,sourceSide:z,targetSide:Q}of W){const rt=vr(V);for(const at of["feedbackLane","fanoutSource","groupedReturnLane","decisionBranch","decisionReturn","clusterHeaderClearance","compactGroupedRoute"])delete O.path.dataset[at];O.path.dataset.nestedDecisionRoute=R,R==="compact-loop"?O.path.dataset.selfLoop="right":delete O.path.dataset.selfLoop,z?O.path.dataset.diamondSourceSide=z:delete O.path.dataset.diamondSourceSide,Q?O.path.dataset.diamondTargetSide=Q:delete O.path.dataset.diamondTargetSide,O.path.dataset.manhattanPoints=rt.map(({x:at,y:xt})=>`${at},${xt}`).join(" "),O.path.dataset.manhattanSegments=String(rt.length-1),O.path.dataset.terminalTarget=c.get(O.target)?.id??"";const et=rt.at(-1),J=rt.at(-2);O.path.dataset.terminalDirection=`${et.x-J.x},${et.y-J.y}`,O.path.setAttribute("d",rt.map(({x:at,y:xt},H)=>`${H?"L":"M"}${at},${xt}`).join("")),ro(O.label,O.path,rt,j)}return tE(e,t),!0}function hE(e,t){if(t.length!==1)return null;const r=t[0],i=e.filter(c=>c.source===r);if(i.length!==2)return null;const o=i.filter(c=>e.some(h=>h.source===c.target&&h.target===r));if(o.length!==1)return null;const a=o[0].target;if(a===r||e.filter(c=>c.source===a||c.target===a).length!==2)return null;const s=e.filter(c=>c.source!==a&&c.target!==a),n=s.filter(c=>!s.some(h=>h.target===c.source));if(n.length!==1)return null;const l=[n[0].source];for(;;){const c=s.filter(h=>h.source===l.at(-1));if(!c.length)break;if(c.length!==1||l.includes(c[0].target))return null;l.push(c[0].target)}return l.length!==s.length+1||l.indexOf(r)<=0||l.at(-1)===r?null:{decision:r,retry:a,spine:l}}function dE(e,t){if(!["TD","TB"].includes(e.dataset.flowchartDirection??"")||e.querySelector("g.cluster"))return!1;const r=[...e.querySelectorAll("g.node")],i=hE(t,r.filter(p=>{const g=Ke(p);return g&&eo(g)}).map(Ir));if(!i||r.length!==i.spine.length+1)return!1;const o=t[0].path,a=new Map(r.flatMap(p=>{const g=Ke(p),m=g&&Qe(g,o);return m?[[Ir(p),m]]:[]}));if(a.size!==r.length)return!1;const s=t.find(p=>p.source===i.decision&&p.target===i.retry),n=s.label?.getBBox(),l=a.get(i.spine[0]),c=l.x+l.width/2;let h=l.y;const d=o.dataset.compactFlowchart==="true";for(const p of i.spine){const g=a.get(p);g.x=c-g.width/2,g.y=h,h+=g.height+(d?100:64)}const u=a.get(i.decision),f=a.get(i.retry);f.x=u.x+u.width+Math.max(80,(n?.width??0)+48),f.y=u.y+(u.height-f.height)/2;for(const p of r)F1(p,Lt(a.get(Ir(p)),.5,.5),o);for(const p of t){const g=a.get(p.source),m=a.get(p.target),y=p.source===i.retry,x=p===s;let C;if(y){const k=zr(m,"right",-Math.min(32,m.height/4)),v=Math.min(g.y,m.y)-32;C=[Lt(g,.5,0),{x:g.x+g.width/2,y:v},{x:m.x+m.width+24,y:v},{x:m.x+m.width+24,y:k.y},k]}else x?C=[Lt(g,1,.5),Lt(m,0,.5)]:C=[Lt(g,.5,1),Lt(m,.5,0)];for(const k of["feedbackLane","fanoutSource","fanoutPort","parallelLane","decisionBranch","decisionReturn"])delete p.path.dataset[k];p.path.dataset.decisionCycleRoute=y?"return":x?"branch":"spine",p.path.dataset.manhattanPoints=C.map(({x:k,y:v})=>`${k},${v}`).join(" "),p.path.dataset.manhattanSegments=String(C.length-1),p.path.setAttribute("d",C.map(({x:k,y:v},M)=>`${M?"L":"M"}${k},${v}`).join("")),ro(p.label,p.path,C)}return e.dataset.decisionCycleLayout="vertical",!0}function Nn(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],r=[...e.querySelectorAll(".edgePaths path")].flatMap((s,n)=>{const l=Cr(s);return l?[{path:s,label:t[n],...l}]:[]}),i=r[0]?.path;if(!i||cE(e,r)||dE(e,r))return;const o=s=>{const n=s&&Ke(s);return n?Qe(n,i):null},a=[...e.querySelectorAll("g.node")].flatMap(s=>{const n=o(s);return n?[n]:[]});for(const s of new Set(r.map(({source:n})=>n))){const n=Je(e,s),l=o(n),c=r.filter(({source:m})=>m===s).flatMap(m=>{const y=Je(e,m.target),x=o(y);return x?[{...m,targetBounds:x}]:[]});if(!n?.querySelector(":scope > polygon.label-container")||!l||c.length!==2||!a.length)continue;const h=c.toSorted((m,y)=>+(y.label?.textContent?.trim()==="Yes")-+(m.label?.textContent?.trim()==="Yes"));if(new Set(h.map(({label:m})=>m?.textContent?.trim())).size!==2||!h.some(({label:m})=>m?.textContent?.trim()==="Yes")||!h.some(({label:m})=>m?.textContent?.trim()==="No"))continue;h.forEach((m,y)=>{const x=y===0?"upper":"lower",C=m.path.dataset.compactFlowchart==="true",k=B$(l,m.targetBounds,x,a,C);if(m.path.setAttribute("d",k.map((v,M)=>`${M?"L":"M"}${v.x},${v.y}`).join("")),m.path.dataset.decisionBranch=x,m.path.dataset.decisionSource=s,m.path.dataset.decisionTarget=m.target,m.path.dataset.decisionPort=`${k[0].x},${k[0].y}`,m.path.dataset.decisionLane=String(k[1].x),m.path.dataset.manhattanPoints=k.map(v=>`${v.x},${v.y}`).join(" "),m.label){const v=Math.hypot(k[1].x-k[0].x,k[1].y-k[0].y)<=12;nE(m.label,m.path,v&&k[2]?k[1]:k[0],v&&k[2]?k[2]:k[1])}});const d=new Set(h.map(({target:m})=>m)),u=r.find(({source:m,target:y})=>d.has(m)&&y===s),f=u&&Je(e,u.source),p=o(f);if(!u||!p)continue;const g=L$(p,l,a,u.path.dataset.compactFlowchart==="true");u.path.setAttribute("d",g.map((m,y)=>`${y?"L":"M"}${m.x},${m.y}`).join("")),u.path.dataset.decisionReturn="outer",u.path.dataset.decisionSource=u.source,u.path.dataset.decisionTarget=s,u.path.dataset.decisionLane=String(Math.max(...g.map(({y:m})=>m))),u.path.dataset.manhattanPoints=g.map(m=>`${m.x},${m.y}`).join(" ")}}function uE(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2"||!e.querySelector("g.cluster"))return!1;const t=[...e.querySelectorAll("g.node")].map(Ir),r=new Set(t),i=new Map,o=new Set;for(const n of e.querySelectorAll(".edgePaths path")){const l=Cr(n);if(!l||!r.has(l.source)||!r.has(l.target)||i.has(l.source)||o.has(l.target))return!1;i.set(l.source,l.target),o.add(l.target)}const a=t.filter(n=>!o.has(n));if(a.length<2||a.some(n=>!i.has(n)))return!1;const s=new Set;for(const n of a){let l=n;for(;l!==void 0;){if(s.has(l))return!1;s.add(l),l=i.get(l)}}return s.size===t.length}function ih(e,t=!0,r){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return null;const i=[...e.querySelectorAll("g.node")];if(e.querySelector("g.cluster"))return t?yE(e):mE(e,r),t?fE(e,i):null;if(i.length<2)return null;if(!t){let x=0;for(const C of i){const v=Ke(C)?.getBBox()??C.getBBox();C.setAttribute("transform",`translate(${-v.x-v.width/2}, ${x-v.y})`),x+=v.height+100}return null}const o=[...e.querySelectorAll(".edgePaths path")],a=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],s=new Map(i.map((x,C)=>[Ir(x),C])),n=new Map,l=new Map;for(const x of o){const C=Cr(x);if(!C)continue;const k=[C.source,C.target].toSorted().join("\0");n.set(k,(n.get(k)??0)+1),l.set(C.source,(l.get(C.source)??0)+1)}const c={left:0,right:0},h=new Map,d=new Map,u=[],f=i.flatMap(x=>{const C=x.transform.baseVal.consolidate()?.matrix;if(!C)return[];const k=x.getBBox();return[{x:k.x+C.e,y:k.y+C.f,width:k.width,height:k.height}]});if(o.forEach((x,C)=>{const k=Cr(x),v=k&&Je(e,k.source),M=k&&Je(e,k.target),A=v&&br(v),L=M&&br(M);if(!k||!A||!L)return;f.push(A,L);const T=s.get(k.source)??0,_=s.get(k.target)??0,$=[k.source,k.target].toSorted().join("\0"),P=n.get($)??0,D=d.get($)??0;if(d.set($,D+1),P>1){const J=D-(P-1)/2;x.dataset.parallelLane=J<0?"before":J>0?"after":"center"}else delete x.dataset.parallelLane;let F;if(_===T+1&&n.get($)===1&&l.get(k.source)===1)F=[Lt(A,.5,1),Lt(L,.5,0)];else{const J=_<=T?"left":"right",at=c[J]++,xt=`${k.source}\0${J}`,H=h.get(xt)??0;h.set(xt,H+1);const Y=_>T,Z=Lt(A,.5,Y?1:0),tt=Lt(L,.5,Y?0:1),st=28+H*30,It=Z.y+(Y?st:-st),zt=tt.y+(Y?-28:28),Wt=42+at%2*6,Zt=J==="left"?Math.min(A.x,L.x)-Wt:Math.max(A.x+A.width,L.x+L.width)+Wt;F=[Z,{x:Z.x,y:It},{x:Zt,y:It},{x:Zt,y:zt},{x:tt.x,y:zt},tt]}F=vr(F);const E=Math.min(...F.map(J=>J.x)),B=Math.min(...F.map(J=>J.y)),q=Math.max(...F.map(J=>J.x)),W=Math.max(...F.map(J=>J.y));f.push({x:E,y:B,width:q-E,height:W-B}),x.setAttribute("d",F.map((J,at)=>`${at?"L":"M"}${J.x},${J.y}`).join("")),x.dataset.compactFlowchart="true",x.dataset.manhattanPoints=F.map(J=>`${J.x},${J.y}`).join(" ");const O=a[C];if(!O)return;const V=F.slice(1).map((J,at)=>({start:F[at],end:J})).toSorted((J,at)=>+(Math.abs(at.end.y-at.start.y)<.001)-+(Math.abs(J.end.y-J.start.y)<.001)||Math.hypot(at.end.x-at.start.x,at.end.y-at.start.y)-Math.hypot(J.end.x-J.start.x,J.end.y-J.start.y)),j=O.getBBox(),z=V.flatMap(J=>[.5,.35,.65,.2,.8].map(at=>({segment:J,midpoint:{x:J.start.x+(J.end.x-J.start.x)*at,y:J.start.y+(J.end.y-J.start.y)*at}}))),Q=z.find(({midpoint:J})=>{const at={x:J.x-j.width/2,y:J.y-j.height/2,width:j.width,height:j.height};return!u.some(xt=>ki(at,xt,4))})??z[0];if(!Q)return;const{midpoint:rt}=Q;O.setAttribute("transform",`translate(${rt.x-j.x-j.width/2}, ${rt.y-j.y-j.height/2})`);const et={x:rt.x-j.width/2,y:rt.y-j.height/2,width:j.width,height:j.height};u.push(et),f.push(et)}),!f.length)return null;const p=Math.min(...f.map(x=>x.x)),g=Math.min(...f.map(x=>x.y)),m=Math.max(...f.map(x=>x.x+x.width)),y=Math.max(...f.map(x=>x.y+x.height));return{x:p,y:g,width:m-p,height:y-g}}function fE(e,t){const r=t.map(br).filter(n=>!!n);for(const n of e.querySelectorAll(".edgePaths path")){const l=n.getBBox();r.push({x:l.x,y:l.y,width:l.width,height:l.height})}if(!r.length)return null;const i=Math.min(...r.map(n=>n.x)),o=Math.min(...r.map(n=>n.y)),a=Math.max(...r.map(n=>n.x+n.width)),s=Math.max(...r.map(n=>n.y+n.height));return{x:i-6,y:o-46,width:a-i+12,height:s-o+54}}function gE(e){const t=e.querySelector(".edgePaths path");if(!t)return null;const i=[...[...e.querySelectorAll("g.node")].flatMap(l=>{const c=Ke(l);return c?[c]:[]}),...e.querySelectorAll("g.cluster > rect"),...e.querySelectorAll(".edgePaths path")].flatMap(l=>{const c=Qe(l,t);return c?[c]:[]});if(!i.length)return null;const o=Math.min(...i.map(l=>l.x)),a=Math.min(...i.map(l=>l.y)),s=Math.max(...i.map(l=>l.x+l.width)),n=Math.max(...i.map(l=>l.y+l.height));return{x:o,y:a,width:s-o,height:n-a}}function Ir(e){return e.id.match(/flowchart-(.+?)-\d+$/)?.[1]??e.id}function br(e){const t=Ke(e),r=e.transform.baseVal.consolidate()?.matrix;if(!t||!r)return null;const i=t.getBBox();return{x:i.x+r.e,y:i.y+r.f,width:i.width,height:i.height}}function pE(e,t,r){if(!e.length)return null;const i=Math.min(...e.map(l=>l.x))-20,o=Math.min(...e.map(l=>l.y))-r,a=Math.max(...e.map(l=>l.x+l.width))+20,s=Math.max(...e.map(l=>l.y+l.height))+20,n={x:i,y:o,width:a-i,height:s-o};return t.some(l=>ki(n,l,4))?null:n}function mE(e,t){const r=[...e.querySelectorAll("g.node")],i=new Map(r.map(u=>[u,br(u)])),o=[...e.querySelectorAll("g.cluster")].flatMap(u=>{const f=u.querySelector(":scope > rect"),p=u.querySelector(":scope > g.cluster-label");if(!f||!p)return[];const g=f.getBBox(),m=t&&Su(u,t),y=m?t?.get(m):void 0;if(t&&!y)return[];const x=r.filter(C=>{if(y)return y.has(Ir(C));const k=i.get(C);if(!k)return!1;const v=Lt(k,.5,.5);return v.x>=g.x&&v.x<=g.x+g.width&&v.y>=g.y&&v.y<=g.y+g.height});return[{cluster:u,rect:f,label:p,originalRect:g,members:x,id:m,memberIds:y}]}),a=new Map,s=(u,f,p)=>{let g=p;for(const m of u){const y=m.getBBox();a.set(m,{x:f-y.x-y.width/2,y:g-y.y}),g+=y.height+100}},n=Math.max(...r.map(u=>u.getBBox().width)),l=uE(e);let c=l;if(c){const u=new Map([...e.querySelectorAll(".edgePaths path")].map(x=>{const C=Cr(x);return[C.source,C.target]})),f=new Set(u.values()),p=new Map(r.map(x=>[Ir(x),x])),g=r.filter(x=>!f.has(Ir(x))).map(x=>{const C=[x];let k=u.get(Ir(x));for(;k!==void 0;)C.push(p.get(k)),k=u.get(k);return C}),m=Array.from({length:Math.max(...g.map(x=>x.length))},(x,C)=>Math.max(...g.map(k=>k[C]?.getBBox().height??0)));let y=0;for(const x of g){const C=Math.max(...x.map(v=>v.getBBox().width));let k=48;x.forEach((v,M)=>{const A=v.getBBox();a.set(v,{x:y+C/2-A.x-A.width/2,y:k+m[M]/2-A.y-A.height/2}),k+=m[M]+100}),y+=C+24}}else s(r,n/2,48);const h=()=>{const u=new Map(r.flatMap(p=>{const g=Ke(p),m=a.get(p);if(!g||!m)return[];const y=g.getBBox();return[[p,{x:y.x+m.x,y:y.y+m.y,width:y.width,height:y.height}]]}));if(l&&(u.size!==r.length||o.length!==e.querySelectorAll("g.cluster").length||o.some(({members:p})=>!p.length)))return null;const f=new Map;for(const p of o.toSorted((g,m)=>(g.memberIds?.size??0)-(m.memberIds?.size??0)||g.originalRect.width*g.originalRect.height-m.originalRect.width*m.originalRect.height)){const g=p.members.flatMap(L=>{const T=u.get(L);return T?[T]:[]}),m=o.filter(L=>L!==p&&(p.memberIds?!!(L.id&&p.memberIds.has(L.id)):L.originalRect.x>=p.originalRect.x&&L.originalRect.y>=p.originalRect.y&&L.originalRect.x+L.originalRect.width<=p.originalRect.x+p.originalRect.width&&L.originalRect.y+L.originalRect.height<=p.originalRect.y+p.originalRect.height)).flatMap(({cluster:L})=>{const T=f.get(L);return T?[T.frame]:[]}),y=[...g,...m];if(!y.length)continue;const x=p.label.querySelector("foreignObject"),C=l&&x?x.cloneNode(!0):null;if(C){const L=Math.max(...y.map(_=>_.x+_.width))-Math.min(...y.map(_=>_.x));C.setAttribute("width",String(Math.max(24,L))),C.style.visibility="hidden";const T=C.querySelector("div");T&&(T.style.width="100%",T.style.whiteSpace="normal",T.style.overflowWrap="normal",T.style.wordBreak="normal"),p.label.append(C)}let k;try{const L=(C??x)?.querySelector("div");k=Math.ceil(Math.max(L?.getBoundingClientRect().height??0,L?.scrollHeight??0,18))}finally{C?.remove()}const v=an(k),M=l?r.filter(L=>!p.members.includes(L)).flatMap(L=>{const T=u.get(L);return T?[T]:[]}):[],A=pE(y,M,v);if(!A)return null;f.set(p.cluster,{frame:A,measuredTitleHeight:k,headerHeight:v})}return f};let d=h();if(c&&!d&&(c=!1,s(r,n/2,48),d=h()),e.dataset.compactGroupedLayout=d?c?"parallel":"column":"original",!!d){for(const[u,f]of a)u.setAttribute("transform",`translate(${f.x}, ${f.y})`);for(const u of o){const f=d.get(u.cluster);if(!f)continue;const{frame:p,measuredTitleHeight:g,headerHeight:m}=f,y=p.x,x=p.x+p.width,C=p.y,k=u.label.querySelector("foreignObject"),v=k?.querySelector("div");if(u.rect.setAttribute("x",String(p.x)),u.rect.setAttribute("y",String(p.y)),u.rect.setAttribute("width",String(p.width)),u.rect.setAttribute("height",String(p.height)),u.cluster.dataset.headerHeight=String(m),k)k.setAttribute("x","0"),k.setAttribute("y","0"),k.setAttribute("width",String(Math.max(24,p.width-40))),k.setAttribute("height",String(g)),k.style.overflow="hidden",v&&(v.style.width="100%",v.style.whiteSpace="normal",v.style.overflowWrap="normal",v.style.wordBreak="normal"),u.label.setAttribute("transform",`translate(${y+20}, ${C+20})`);else{const M=u.label.getBBox();u.label.setAttribute("transform",`translate(${(y+x)/2-M.x-M.width/2}, ${C+20-M.y})`)}}}}function yE(e){if(e.dataset.compactGroupedLayout==="original")return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll("g.node")],i=e.dataset.compactGroupedLayout==="parallel",o=new Map(r.map((g,m)=>[Ir(g),m])),a=t.flatMap(g=>{const m=Cr(g);return m?[{path:g,...m}]:[]}),s=new Map;for(const g of a){const m=[g.source,g.target].toSorted().join("\0");s.set(m,[...s.get(m)??[],g])}const n={left:0,right:0},l=a.flatMap(g=>{if(g.source===g.target)return[{...g,side:"right"}];const m=[g.source,g.target].toSorted().join("\0"),y=s.get(m)??[];if(y.length>1)return[{...g,side:y.indexOf(g)%2?"right":"left"}];const x=o.get(g.source)??0,C=o.get(g.target)??0;return[{...g,side:i||Math.abs(C-x)===1?null:C<x?"left":"right"}]}),c=new Map;for(const g of l)if(!(!g.side||g.source===g.target))for(const m of[g.source,g.target]){const y=`${m}\0${g.side}`;c.set(y,(c.get(y)??0)+1)}const h=new Map,d=(g,m)=>{const y=`${g}\0${m}`,x=c.get(y)??1,C=h.get(y)??0;return h.set(y,C+1),x===1?.5:.25+C*.5/(x-1)},u=r.map(br).filter(g=>!!g),f=Math.min(...u.map(g=>g.x))-24,p=Math.max(...u.map(g=>g.x+g.width))+24;for(const g of l){const{path:m,source:y,target:x,side:C}=g,k=Je(e,y),v=Je(e,x),M=k&&br(k),A=v&&br(v);if(!M||!A)continue;let L;if(y===x){const T=M.x+M.width+24;L=[Lt(M,1,.3),{x:T,y:M.y+M.height*.3},{x:T,y:M.y+M.height*.7},Lt(M,1,.7)],m.dataset.selfLoop="right"}else if(C){const T=Lt(M,C==="left"?0:1,d(y,C)),_=Lt(A,C==="left"?0:1,d(x,C)),$=n[C]++,P=(C==="left"?f:p)+(C==="left"?-1:1)*$*12;L=[T,{x:P,y:T.y},{x:P,y:_.y},_],m.dataset.compactGroupedSide=C,m.dataset.compactGroupedPort=`${T.x},${T.y} ${_.x},${_.y}`}else if(A.x>=M.x+M.width||M.x>=A.x+A.width){const _=A.x>=M.x,$=Lt(M,_?1:0,.5),P=Lt(A,_?0:1,.5),D=($.x+P.x)/2;L=vr([$,{x:D,y:$.y},{x:D,y:P.y},P])}else{const _=A.y>=M.y,$=Lt(M,.5,_?1:0),P=Lt(A,.5,_?0:1),D=($.y+P.y)/2;L=vr([$,{x:$.x,y:D},{x:P.x,y:D},P])}L=vr(L),m.setAttribute("d",L.map((T,_)=>`${_?"L":"M"}${T.x},${T.y}`).join("")),m.dataset.compactFlowchart="true",m.dataset.compactGroupedRoute="true",m.dataset.manhattanPoints=L.map(T=>`${T.x},${T.y}`).join(" ")}for(const g of e.querySelectorAll("g.cluster")){const m=g.querySelector(":scope > rect"),y=g.querySelector(":scope > g.cluster-label");if(!m||!y)continue;const x=m.getBBox(),C=y.getBBox();y.setAttribute("transform",`translate(${x.x+x.width/2-C.x-C.width/2}, ${x.y+20-C.y})`)}}function xE(e){if(e.dataset.nestedDecisionLayout)return;const t=[...e.querySelectorAll("g.node")],r=[...e.querySelectorAll("g.cluster")].flatMap(o=>{const a=o.querySelector(":scope > rect");return a?[{cluster:o,rect:a,frame:{x:Number(a.getAttribute("x")),y:Number(a.getAttribute("y")),width:Number(a.getAttribute("width")),height:Number(a.getAttribute("height"))}}]:[]}),i=(o,a)=>a.x>=o.x&&a.x+a.width<=o.x+o.width&&a.y>=o.y&&a.y+a.height<=o.y+o.height;for(const o of r){const a=r.filter(g=>g!==o&&i(g.frame,o.frame)).toSorted((g,m)=>g.frame.width*g.frame.height-m.frame.width*m.frame.height)[0];if(!a)continue;const s=[...e.querySelectorAll(".edgePaths path")].flatMap(g=>{const m=Cr(g),y=m&&Je(e,m.source),x=m&&Je(e,m.target),C=y&&br(y),k=x&&br(x),v=vi(e,g);return!C||!k||!i(o.frame,k)||i(o.frame,C)||!i(a.frame,C)||C.y+C.height>o.frame.y?[]:[{source:C,labelWidth:v?.getBBox().width??0}]});if(!s.length)continue;const n=24,l=Math.max(0,...s.map(({source:g})=>g.y+g.height+n-o.frame.y)),c=t.filter(g=>{const m=br(g);return m&&i(o.frame,m)}),h=t.filter(g=>!c.includes(g)).flatMap(g=>{const m=br(g);return m&&m.y>=o.frame.y+o.frame.height?[m.y]:[]}),d=Math.min(a.frame.y+a.frame.height,...h)-o.frame.y-o.frame.height-n,u=Math.min(l,Math.max(0,d));if(u>0){for(const g of c){const m=g.transform.baseVal.consolidate()?.matrix;m&&g.setAttribute("transform",`translate(${m.e}, ${m.f+u})`)}for(const g of r.filter(m=>i(o.frame,m.frame))){g.rect.setAttribute("y",String(g.frame.y+u));const m=g.cluster.querySelector(":scope > .cluster-label"),y=m?.transform.baseVal.consolidate()?.matrix;y&&m.setAttribute("transform",`translate(${y.e}, ${y.f+u})`)}}const f=Math.max(...s.map(({labelWidth:g})=>g+12)),p=Math.max(a.frame.x+a.frame.width,o.frame.x+o.frame.width+f);a.rect.setAttribute("width",String(p-a.frame.x))}}function oh(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll("g.cluster")];for(const r of e.querySelectorAll(".edgePaths path")){if(r.dataset.feedbackLane||r.dataset.nestedDecisionRoute)continue;const i=r.dataset.fanoutSource&&Cr(r),o=i&&Je(e,i.source),a=i&&Je(e,i.target),s=o&&br(o),n=a&&br(a),l=_=>t.flatMap($=>{const D=$.querySelector(":scope > rect")?.getBBox();return D?[{cluster:$,frame:D}]:[]}).filter(({frame:$})=>_.x+_.width/2>$.x&&_.x+_.width/2<$.x+$.width&&_.y+_.height/2>$.y&&_.y+_.height/2<$.y+$.height).toSorted(($,P)=>$.frame.width-P.frame.width)[0];if(s&&n){const _=l(s),$=l(n);if(_&&$&&_.cluster!==$.cluster){const P=Lt(s,1,.5),D=Lt(n,0,.5),F=(_.frame.x+_.frame.width+$.frame.x)/2,E=[P,{x:F,y:P.y},{x:F,y:D.y},D];r.setAttribute("d",E.map((B,q)=>`${q?"L":"M"}${B.x},${B.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.clusterHeaderTargetPort="left",r.dataset.manhattanPoints=E.map(B=>`${B.x},${B.y}`).join(" ");continue}}const c=r.getTotalLength();if(!c)continue;const h=r.getPointAtLength(0),d=r.getPointAtLength(c);if(Math.abs(d.y-h.y)<=Math.abs(d.x-h.x))continue;const u=Cr(r),f=u&&Je(e,u.source),p=u&&Je(e,u.target),g=f&&Ke(f),m=p&&Ke(p),y=g?Qe(g,r):null,x=m?Qe(m,r):null,C=_=>_?t.map($=>{const P=$.querySelector(":scope > rect"),D=P&&xr(P,r),F=Number($.dataset.headerHeight);return D?{bounds:D,protectedBottom:D.y+(Number.isFinite(F)?F:48)+8}:null}).filter($=>!!$).filter(({bounds:$})=>_.x+_.width/2>$.x&&_.x+_.width/2<$.x+$.width&&_.y+_.height/2>$.y&&_.y+_.height/2<$.y+$.height).toSorted(($,P)=>$.bounds.width-P.bounds.width)[0]:null,k=C(y),v=C(x);if(x&&v&&d.y<v.protectedBottom){const _=x.y+x.height/2,$=Math.abs(h.x-(v.bounds.x-8))<=Math.abs(h.x-(v.bounds.x+v.bounds.width+8)),P=$?v.bounds.x-8:v.bounds.x+v.bounds.width+8,D=$?x.x:x.x+x.width,F=y&&k&&(k.bounds.x!==v.bounds.x||k.bounds.y!==v.bounds.y),E=v.bounds.y-6,B=y?y.y+y.height/2:h.y,q=y?P<y.x+y.width/2?y.x:y.x+y.width:h.x,W=vr(F?[{x:q,y:B},{x:P,y:B},{x:P,y:_},{x:D,y:_}]:[{x:h.x,y:h.y},{x:h.x,y:E},{x:P,y:E},{x:P,y:_},{x:D,y:_}]);r.setAttribute("d",W.map((O,R)=>`${R?"L":"M"}${O.x},${O.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.clusterHeaderTargetPort=$?"left":"right",r.dataset.manhattanPoints=W.map(O=>`${O.x},${O.y}`).join(" ");continue}const M=t.flatMap(_=>{const $=_.querySelector(":scope > rect"),P=$&&xr($,r);if(!P)return[];const D=Number(_.dataset.headerHeight),F={...P,height:Math.min(P.height,(Number.isFinite(D)?D:48)+8)};return Array.from({length:101},(B,q)=>r.getPointAtLength(c*q/100)).some(B=>B.x>F.x-6&&B.x<F.x+F.width+6&&B.y>F.y-6&&B.y<F.y+F.height+6)?[F]:[]}).sort((_,$)=>d.y>=h.y?_.y-$.y:$.y+$.height-(_.y+_.height));if(!M.length)continue;const A=d.y>=h.y,L=[{x:h.x,y:h.y}];for(const _ of M){const $=A?_.y-6:_.y+_.height+6,P=A?_.y+_.height+6:_.y-6,D=_.x-8,F=_.x+_.width+8,E=Math.abs(h.x-D)<=Math.abs(h.x-F)?D:F;L.push({x:h.x,y:$},{x:E,y:$},{x:E,y:P},{x:h.x,y:P})}L.push({x:h.x,y:d.y},{x:d.x,y:d.y});const T=vr(L);r.setAttribute("d",T.map((_,$)=>`${$?"L":"M"}${_.x},${_.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.manhattanPoints=T.map(_=>`${_.x},${_.y}`).join(" ")}}function $a(e){if(!e.querySelector("g.cluster"))return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=[...e.querySelectorAll("g.cluster > g.cluster-label")],o=s=>{const n=s.getAttribute("transform");s.removeAttribute("transform");const l=s.getBBox();return n&&s.setAttribute("transform",n),l},a=[];t.forEach((s,n)=>{const l=r[n];if(s.dataset.nestedDecisionRoute&&l){const C=xr(l,s);C&&a.push(C);return}if(s.dataset.clientRequestLane==="downward"&&l){const C=xr(l,s);C&&a.push(C);return}const c=(s.dataset.manhattanPoints??"").trim().split(/\s+/).map(C=>C.split(",").map(Number)).filter(C=>C.length===2&&C.every(Number.isFinite)).map(([C,k])=>({x:C,y:k}));if(!l||c.length<2)return;const h=o(l),d=xr(l,s);if(!d)return;const u=[...[...e.querySelectorAll("g.node")].map(C=>xr(C,s)).filter(C=>!!C),...i.map(C=>xr(C,s)).filter(C=>!!C),...a],f=or(c);let g=f.flatMap(C=>{const k=Math.abs(C.start.y-C.end.y)<.001,v=Math.hypot(C.end.x-C.start.x,C.end.y-C.start.y),M=(k?d.width:d.height)+12;return v<M?[]:[.5,.35,.65,.2,.8].map(A=>{const L={x:C.start.x+(C.end.x-C.start.x)*A,y:C.start.y+(C.end.y-C.start.y)*A},T={x:L.x-d.width/2,y:L.y-d.height/2,width:d.width,height:d.height};return{center:L,bounds:T,horizontal:k,capacity:v}})}).filter(({bounds:C})=>u.every(k=>!ki(C,k,4))).sort((C,k)=>Number(k.horizontal)-Number(C.horizontal)||k.capacity-C.capacity)[0];if(!g){const C=f.map(L=>({...L,capacity:Math.hypot(L.end.x-L.start.x,L.end.y-L.start.y)})).sort((L,T)=>T.capacity-L.capacity)[0];if(!C)return;const k=Math.abs(C.end.y-C.start.y)>Math.abs(C.end.x-C.start.x),v={x:(C.start.x+C.end.x)/2,y:(C.start.y+C.end.y)/2},M=k?d.width/2:d.height/2,A=u.flatMap(L=>k?[{x:L.x-4-M,y:v.y},{x:L.x+L.width+4+M,y:v.y}]:[{x:v.x,y:L.y-4-M},{x:v.x,y:L.y+L.height+4+M}]);g=[k?{x:v.x+M+4,y:v.y}:{x:v.x,y:v.y+M+4},k?{x:v.x-M-4,y:v.y}:{x:v.x,y:v.y-M-4},...A].map(L=>({center:L,bounds:{x:L.x-d.width/2,y:L.y-d.height/2,width:d.width,height:d.height},horizontal:!k,capacity:C.capacity})).filter(({bounds:L})=>u.every(T=>!ki(L,T,4))&&a.every(T=>!ki(L,T,4))).toSorted((L,T)=>Math.hypot(L.center.x-v.x,L.center.y-v.y)-Math.hypot(T.center.x-v.x,T.center.y-v.y))[0]}if(!g)return;if(s.dataset.groupedReturnLane==="right"&&!g.horizontal){const C=h.width/2-6;g={...g,center:{...g.center,x:g.center.x-C},bounds:{...g.bounds,x:g.bounds.x-C}}}const m=s.getCTM(),y=l.parentElement?.getCTM(),x=m&&y?new DOMPoint(g.center.x,g.center.y).matrixTransform(m).matrixTransform(y.inverse()):g.center;l.setAttribute("transform",`translate(${x.x-h.x-h.width/2}, ${x.y-h.y-h.height/2})`),l.dataset.finalPathCenter=`${g.center.x},${g.center.y}`,a.push(g.bounds)}),t.forEach((s,n)=>{const l=r[n];if(s.dataset.nestedDecisionRoute||s.dataset.clientRequestLane==="downward")return;const c=l?.dataset.finalPathCenter,h=s.dataset.manhattanPoints;if(!l?.textContent?.trim()||!h)return;const d=xr(l,s);if(!d)return;const u=i.flatMap(_=>{const $=xr(_,s);return $?[$]:[]}),f=u.find(_=>ki(d,_,4));if(!f)return;const p=_=>{const[$,P]=_.split(",").map(Number);return{x:$,y:P}},g=h.split(" ").map(p),m=g.slice(1).map((_,$)=>({start:g[$],end:_})),y=c?p(c):null,x=y?m.find(({start:_,end:$})=>{const P=Math.min(_.x,$.x)-1,D=Math.max(_.x,$.x)+1,F=Math.min(_.y,$.y)-1,E=Math.max(_.y,$.y)+1;return y.x>=P&&y.x<=D&&y.y>=F&&y.y<=E}):m.slice().sort((_,$)=>Math.hypot($.end.x-$.start.x,$.end.y-$.start.y)-Math.hypot(_.end.x-_.start.x,_.end.y-_.start.y))[0];if(!x)return;const C=Math.abs(x.end.y-x.start.y)>Math.abs(x.end.x-x.start.x),k={x:(x.start.x+x.end.x)/2,y:(x.start.y+x.end.y)/2},v={...y??k};if(y)if(C){const _=d.height/2,$=f.y+f.height+4+_,P=f.y-4-_,D=Math.min(x.start.y,x.end.y)+_,F=Math.max(x.start.y,x.end.y)-_;v.y=$<=F?Math.max(D,$):Math.min(F,P)}else{const _=d.width/2,$=f.x+f.width+4+_,P=f.x-4-_,D=Math.min(x.start.x,x.end.x)+_,F=Math.max(x.start.x,x.end.x)-_;v.x=$<=F?Math.max(D,$):Math.min(F,P)}else{const _=C?d.width/2:d.height/2,$=[1,-1].map(P=>C?{x:k.x+P*(_+4),y:k.y}:{x:k.x,y:k.y+P*(_+4)}).find(P=>{const D={x:P.x-d.width/2,y:P.y-d.height/2,width:d.width,height:d.height};return u.every(F=>!ki(D,F,4))});if(!$)return;v.x=$.x,v.y=$.y}const M=o(l),A=s.getCTM(),L=l.parentElement?.getCTM();if(!A||!L)return;const T=new DOMPoint(v.x,v.y).matrixTransform(A).matrixTransform(L.inverse());l.setAttribute("transform",`translate(${T.x-M.x-M.width/2}, ${T.y-M.y-M.height/2})`),l.dataset.finalPathCenter=`${v.x},${v.y}`})}function Lt(e,t,r){return{x:e.x+e.width*t,y:e.y+e.height*r}}function bE(e,t,r,i,o=!1){const a=Math.min(...i.map(f=>f.x)),s=Math.max(...i.map(f=>f.x+f.width)),n=Math.min(...i.map(f=>f.y)),l=Lt(t,.5,1),c=Lt(r,.5,0);if(e===Te.userSendsMessage)return[l,c];if(e===Te.agentResponds){const f=Lt(t,.28,1),p=Lt(r,.28,0),g=f.y+(o?38:50);return[f,{x:f.x,y:g},{x:p.x,y:g},p]}if(e===Te.toolStarts){if(o){const y=Math.min(t.x+t.width,r.x+r.width)-16;return[{x:y,y:t.y+t.height},{x:y,y:r.y}]}const f=r.y>=t.y,p=Lt(t,.64,f?1:0),g=Lt(r,.5,f?0:1),m=(p.y+g.y)/2;return[p,{x:p.x,y:m},{x:g.x,y:m},g]}if(e===Te.toolCompletes){if(o){const x=Math.max(t.x,r.x);return[{x,y:t.y},{x,y:r.y+r.height}]}const f=r.y>=t.y,p=Lt(t,.72,f?1:0),g=Lt(r,.8,f?0:1),m=92,y=p.y+(f?m:-m);return[p,{x:p.x,y},{x:g.x,y},g]}if(e===Te.agentAsksUser){const f=Lt(t,0,o?.75:.35),p=Lt(r,0,o?.25:.35),g=Math.min(f.x,p.x)-(o?60:50);return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===Te.userReplies){const f=Lt(t,1,.65),p=Lt(r,1,o?.95:.65),g=Math.max(f.x,p.x)+(o?32:30);return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===Te.agentFinishes){const f=Lt(t,1,.35),p=Lt(r,1,.35),g=o?Math.max(f.x,p.x)+40:s+90;return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===Te.requestFails){const f=Lt(t,0,o?.9:.25),p=Lt(r,0,o?.75:.25),g=a-(o?88:40);return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===Te.streamFails){if(o){const y=Lt(t,0,.25),x=Lt(r,0,.25),C=a-60;return[y,{x:C,y:y.y},{x:C,y:x.y},x]}const f=Lt(t,.5,0),p=Lt(r,0,.5),g=a-80,m=n-40;return[f,{x:f.x,y:m},{x:g,y:m},{x:g,y:p.y},p]}if(o){const f=Lt(t,0,.9),p=Lt(r,0,.1),g=a-92;return[f,{x:g,y:f.y},{x:g,y:p.y},p]}const h=Lt(t,1,.75),d=Lt(r,0,.75),u=(h.x+d.x)/2;return[h,{x:u,y:h.y},{x:u,y:d.y},d]}function or(e){return e.slice(1).map((t,r)=>({start:e[r],end:t}))}function ds(e,t){const r=Math.abs(e.start.y-e.end.y)<.001,i=Math.abs(t.start.y-t.end.y)<.001;return r!==i?!1:r?Math.abs(e.start.y-t.start.y)>=.001?!1:Math.min(e.start.x,e.end.x)<Math.max(t.start.x,t.end.x)-.001&&Math.min(t.start.x,t.end.x)<Math.max(e.start.x,e.end.x)-.001:Math.abs(e.start.x-t.start.x)>=.001?!1:Math.min(e.start.y,e.end.y)<Math.max(t.start.y,t.end.y)-.001&&Math.min(t.start.y,t.end.y)<Math.max(e.start.y,e.end.y)-.001}function CE(e,t,r=[],i){return or(e).flatMap((o,a)=>{const s=Math.abs(o.start.y-o.end.y)<.001,n=Math.hypot(o.end.x-o.start.x,o.end.y-o.start.y),l=i?Tu(i,o.start,o.end):1,c=(s?t.width:t.height)+T1*2/l;return n>=c&&!r.some(h=>ds(o,h))?[{segment:o,index:a,horizontal:s,capacity:n,excess:n-c}]:[]}).sort((o,a)=>Number(a.horizontal)-Number(o.horizontal)||a.excess-o.excess)[0]}function wE(e,t){if(!t||t.direction!=="TB"||!e.id)return;const r=Object.entries(gp),i=new Set(["root_start",...Object.values(gp).flat()]);if(t.nodes.length!==i.size||new Set(t.nodes.map(d=>d.id)).size!==i.size||new Set(t.nodes.map(d=>d.domId)).size!==i.size||t.nodes.some(d=>!i.has(d.id)||!d.domId||d.isGroup||d.parentId||d.shape!==(d.id==="root_start"?"stateStart":"rect"))||t.edges.length!==r.length+1||new Set(t.edges.map(d=>d.id)).size!==t.edges.length||t.edges.filter(d=>d.start==="root_start"&&d.end==="Idle").length!==1)return;const o=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],a=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],s=[...e.querySelectorAll("g.node")];if(o.length!==t.edges.length||s.length!==t.nodes.length)return;const n=new Map;for(const d of o){const u=d.dataset.id;if(!u||n.has(u)||d.id!==`${e.id}-${u}`||!t.edges.some(f=>f.id===u))return;n.set(u,d)}const l=new Map;for(const d of a){const u=d.querySelector(":scope > .label[data-id]")?.getAttribute("data-id");if(!u||l.has(u)||!n.has(u))return;l.set(u,d)}const c=new Map;for(const d of t.nodes){const u=s.filter(f=>f.id===`${e.id}-${d.domId}`);if(u.length!==1)return;c.set(d.id,u[0])}const h=[];for(const[d,[u,f]]of r){const p=t.edges.filter(x=>x.start===u&&x.end===f);if(p.length!==1)return;const g=p[0],m=n.get(g.id),y=l.get(g.id);if(!m||!y)return;h.push({edge:g,path:m,label:y,kind:d})}return{paths:o,labels:a,nodesById:c,routes:h,diagram:t}}function kE(e,t=!1,r){if(!e.classList.contains("statediagram"))return;for(const C of e.querySelectorAll("g.statediagram-cluster")){const k=C.querySelector(":scope > g > rect.outer"),v=C.querySelector(":scope > rect.inner"),M=C.querySelector(":scope > .cluster-label");if(!k||!v||!M)continue;const A=Qe(M,C),L=M.transform.baseVal.consolidate()?.matrix;if(!A||!L)continue;const T=k.y.baseVal.value+6;M.setAttribute("transform",`translate(${L.e},${L.f+T-A.y})`);const _=Math.max(v.y.baseVal.value,T+A.height+6);v.setAttribute("height",String(Math.max(0,v.height.baseVal.value-(_-v.y.baseVal.value)))),v.setAttribute("y",String(_));for(const $ of e.querySelectorAll("path.transition[data-points]")){let P;try{P=JSON.parse(atob($.dataset.points))}catch{continue}if(P.length<4)continue;const[D,F,E]=P,B=Qe(k,$);if(!B||Math.abs(D.y-B.y)>.5||D.x<B.x||D.x>B.x+B.width||D.x!==F.x||F.y!==E.y||Math.abs(F.x-E.x)>8||E.x<B.x+8||E.x>B.x+B.width-8)continue;P[0]={x:E.x,y:D.y},P.splice(1,1),P=vr(P);const q=_u(P);$.setAttribute("d",q),$.dataset.terminalGapBasePath=q,$.dataset.manhattanPoints=P.map(({x:W,y:O})=>`${W},${O}`).join(" ")}}let i;try{i=wE(e,r??JSON.parse(e.dataset.stateRouteGraph??"null"))}catch{return}if(!i)return;const{paths:o,labels:a,nodesById:s,routes:n}=i,l=o[0];if(!l)return;const c=new Map,h=new Map;for(const[C,k]of s){const v=Ke(k),M=v&&Qe(v,l);if(!v||!M||!Object.values(M).every(Number.isFinite)||t&&!k.transform.baseVal.consolidate()?.matrix)return;c.set(C,M),h.set(C,{node:k,shape:v})}e.dataset.stateRouteGraph=JSON.stringify({direction:i.diagram.direction,nodes:i.diagram.nodes.map(({id:C,domId:k,shape:v})=>({id:C,domId:k,shape:v})),edges:i.diagram.edges.map(({id:C,start:k,end:v})=>({id:C,start:k,end:v}))});for(const C of[...o,...a])C.style.setProperty("transition-property","none","important");if(t){const C=c.get("Idle");if(!C)return;const k=C.x+C.width/2;[{name:"Starting",centerOffset:0,yOffset:138},{name:"Streaming",centerOffset:0,yOffset:258},{name:"RunningTool",centerOffset:0,yOffset:396},{name:"NeedsInput",centerOffset:0,yOffset:578},{name:"Complete",centerOffset:0,yOffset:738},{name:"Failed",centerOffset:0,yOffset:898}].forEach(({name:M,centerOffset:A,yOffset:L})=>{const T=h.get(M),_=c.get(M),$=T?.node.transform.baseVal.consolidate()?.matrix;if(!T||!_||!$)return;const P={x:k+A-_.width/2,y:C.y+L};T.node.style.setProperty("transition-property","none","important"),T.node.setAttribute("transform",`translate(${$.e+P.x-_.x}, ${$.f+P.y-_.y})`),c.set(M,{..._,...P})})}const d=[...c].flatMap(([C,k])=>C==="root_start"?[]:[k]),u=[],f=[],p=[];n.forEach(({edge:C,path:k,label:v,kind:M})=>{v.dataset.routePathId=k.id,k.dataset.routeLabel=M;const A=c.get(C.start),L=c.get(C.end);if(!A||!L)return;const T=vr(bE(M,A,L,d,t)),_=T[1]?Tu(k,T[0],T[1]):1,$=E$(T,d.filter(B=>B!==A&&B!==L),vu/_,f);p.push(...$);const P=v.getBBox(),D=M===Te.agentFinishes?$.slice(1,3):$,F=CE(D,P,u,k)??D.slice(0,-1).map((B,q)=>{const W=D[q+1];return{segment:{start:B,end:W},capacity:Math.hypot(W.x-B.x,W.y-B.y)}}).sort((B,q)=>q.capacity-B.capacity)[0];if(!F)return;k.setAttribute("d",$.map((B,q)=>`${q?"L":"M"}${B.x},${B.y}`).join(""));const E=M===Te.toolStarts&&$[1]&&$[2]?{start:$[1],end:$[2]}:M===Te.agentAsksUser&&$[1]&&$[2]?{start:$[1],end:$[2]}:M===Te.agentFinishes&&$[1]&&$[2]?{start:$[1],end:$[2]}:!t&&M===Te.userReplies&&$[1]&&$[2]?{start:$[1],end:$[2]}:M===Te.requestFails&&$[1]&&$[2]?{start:$[1],end:$[2]}:t&&M===Te.userRetries&&$[2]&&$[3]?{start:$[2],end:$[3]}:F.segment;k.dataset.routeLabel=M,k.dataset.labelSegment=`${E.start.x},${E.start.y} ${E.end.x},${E.end.y}`,k.dataset.labelCapacity=String(Math.hypot(E.end.x-E.start.x,E.end.y-E.start.y)),k.dataset.manhattanSegments=String($.length-1),k.dataset.manhattanPoints=$.map(B=>`${B.x},${B.y}`).join(" "),k.dataset.terminalTarget=h.get(C.end)?.node.id??C.end,v.dataset.routePathId=k.id,u.push(E),f.push(...or($))});const g=Math.min(...d.map(C=>C.x),...p.map(C=>C.x)),m=Math.min(2,...d.map(C=>C.y),...p.map(C=>C.y)),y=Math.max(...d.map(C=>C.x+C.width),...p.map(C=>C.x)),x=Math.max(...d.map(C=>C.y+C.height),...p.map(C=>C.y));return{x:g,y:m,width:y-g,height:x-m}}function SE(e,t,r,i,o=8){if(e.length<2)return e;const a=i.map(({start:f,end:p})=>({x:Math.min(f.x,p.x),y:Math.min(f.y,p.y),width:Math.abs(p.x-f.x),height:Math.abs(p.y-f.y)})),s=f=>or(f).every(p=>!Sr(p,t)&&[...r,...a].every(g=>!Sr(p,g,o)));if(s(e))return e;const n=e[0],l=xa(n,e[1]),c={...n},h=o*2;l==="top"&&(c.y-=h),l==="bottom"&&(c.y+=h),l==="left"&&(c.x-=h),l==="right"&&(c.x+=h);const d=[{point:Lt(t,.5,0),dx:0,dy:-h},{point:Lt(t,1,.5),dx:h,dy:0},{point:Lt(t,.5,1),dx:0,dy:h},{point:Lt(t,0,.5),dx:-h,dy:0}].flatMap(({point:f,dx:p,dy:g})=>{const m={x:f.x+p,y:f.y+g};return[[n,c,{x:c.x,y:m.y},m,f],[n,c,{x:m.x,y:c.y},m,f]].map(vr).filter(y=>{const x=y[1],C=y.at(-2);return(x.x-n.x)*(c.x-n.x)+(x.y-n.y)*(c.y-n.y)>0&&(C.x-f.x)*p+(C.y-f.y)*g>0&&s(y)})}),u=f=>or(f).reduce((p,{start:g,end:m})=>p+Math.hypot(m.x-g.x,m.y-g.y),0);return d.toSorted((f,p)=>u(f)-u(p))[0]??e}function vE(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=t[0];if(!r)return;const i=[...e.querySelectorAll("g.node")].flatMap(a=>{const s=Ke(a),n=s&&Qe(s,r);return s&&n?[{node:a,shape:s,bounds:n}]:[]}),o=t.flatMap(a=>{let s;try{s=a.dataset.manhattanPoints?a.dataset.manhattanPoints.split(" ").map(l=>{const[c,h]=l.split(",").map(Number);return{x:c,y:h}}):JSON.parse(atob(a.dataset.points??""))}catch{return[]}if(!Array.isArray(s)||s.length<2||s.some(l=>!l||!Number.isFinite(l.x)||!Number.isFinite(l.y)))return[];const n=l=>i.toSorted((c,h)=>Qi(l,c.bounds)-Qi(l,h.bounds))[0];return[{path:a,points:s,source:n(s[0]),target:n(s.at(-1))}]});for(const a of o){const{path:s,points:n,source:l,target:c}=a;if(!l||!c||l===c||l.shape.tagName!=="circle"||c.shape.tagName!=="rect"||o.some(g=>g.target===l))continue;const h=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].flatMap(g=>{if(!g.textContent?.trim())return[];const m=xr(g,s);return m?[m]:[]}),d=SE(n,c.bounds,[...i.filter(g=>g!==l&&g!==c).map(g=>g.bounds),...h],o.filter(g=>g!==a).flatMap(g=>or(g.points)));if(d===n)continue;const u=_u(d);s.setAttribute("d",u),s.dataset.terminalGapBasePath=u,s.dataset.manhattanPoints=d.map(({x:g,y:m})=>`${g},${m}`).join(" "),s.dataset.manhattanSegments=String(d.length-1),s.dataset.terminalTarget=c.node.id;const f=d.at(-1),p=d.at(-2);s.dataset.terminalDirection=`${f.x-p.x},${f.y-p.y}`,a.points=d}}function TE(e){const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=t[0];if(!i)return;const o=[...e.querySelectorAll("g.node")].flatMap(s=>{const n=Ke(s),l=n&&Qe(n,i);if(!n||!l)return[];const c=getComputedStyle(n);return[{...l,corner:{x:Math.min(l.width/2,Number.parseFloat(c.rx)||0),y:Math.min(l.height/2,Number.parseFloat(c.ry)||0)}}]}),a=t.flatMap(s=>{const n=(s.dataset.manhattanPoints??"").split(" ").map(c=>{const[h,d]=c.split(",").map(Number);return{x:h,y:d}});if(n.length<2||n.some(({x:c,y:h})=>!Number.isFinite(c)||!Number.isFinite(h)))return[];const l=c=>o.toSorted((h,d)=>Qi(c,h)-Qi(c,d))[0];return[{path:s,points:n,source:l(n[0]),target:l(n.at(-1))}]});for(const s of a){const{path:n,points:l,source:c,target:h}=s;if(!c||!h||h.y<=c.y||l[1].y>=Math.min(c.y,h.y)-Math.max(c.height,h.height))continue;const d=r.find(T=>T.dataset.routePathId===n.id),u=d&&xr(d,n);if(!d||!u)continue;const f=a.filter(T=>T!==s),p=f.flatMap(T=>or(T.points)),g=o.filter(T=>T!==c&&T!==h),m=r.filter(T=>T!==d).flatMap(T=>{const _=xr(T,n);return _?[_]:[]}),y=T=>f.flatMap(_=>[..._.source===T?[_.points[0]]:[],..._.target===T?[_.points.at(-1)]:[]]),x=L1(l,c,h,[...g,...m],p,y(c),y(h),{bounds:u,obstacles:m,occupied:p},!1,!0);if(x===l)continue;const C=Cn(x,u,[...o,...m],p);if(!C)continue;s.points=x,n.setAttribute("d",x.map(({x:T,y:_},$)=>`${$?"L":"M"}${T},${_}`).join("")),n.dataset.manhattanPoints=x.map(({x:T,y:_})=>`${T},${_}`).join(" "),n.dataset.manhattanSegments=String(x.length-1),n.dataset.labelSegment=`${C.start.x},${C.start.y} ${C.end.x},${C.end.y}`;const k=x.at(-1),v=x.at(-2);n.dataset.terminalDirection=`${k.x-v.x},${k.y-v.y}`,delete n.dataset.terminalGapBasePath;const M=d.getBBox(),A=d.parentElement?.getCTM(),L=n.getCTM();if(A&&L){const T=new DOMPoint(C.center.x,C.center.y).matrixTransform(L).matrixTransform(A.inverse());d.setAttribute("transform",`translate(${T.x-M.x-M.width/2},${T.y-M.y-M.height/2})`),d.dataset.finalPathCenter=`${C.center.x},${C.center.y}`}}}function ME(e,t){if(e.nativeId){const i=t.flatMap((o,a)=>o.nativeId===e.nativeId?[a]:[]);if(i.length)return i.length===1?i[0]:null}if(e.routePathId){const i=t.flatMap((o,a)=>o.id===e.routePathId?[a]:[]);if(i.length)return i.length===1?i[0]:null}const r=t.flatMap((i,o)=>i.intersectsLabel?[o]:[]);return r.length===1?r[0]:null}function _E(e,t){const r=xr(t,e),i=e.getTotalLength();if(!r||!i)return!1;const o=Math.max(1,Math.min(r.width,r.height)/4),a=Math.max(16,Math.min(2048,Math.ceil(i/o)));return Array.from({length:a+1},(s,n)=>e.getPointAtLength(i*n/a)).some(s=>Qi(s,r)<=.5)}function BE(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=new Set;r.forEach(o=>{if(o.textContent?.replace(/\s+/g," ").trim().toLowerCase()!=="fail")return;const a=o.querySelector(":scope > .label[data-id]")?.getAttribute("data-id"),s=ME({nativeId:a??void 0,routePathId:o.dataset.routePathId},t.map(L=>({id:L.id,nativeId:L.dataset.id,intersectsLabel:_E(L,o)}))),n=s===null?void 0:t[s];if(!n||i.has(n))return;const l=n.getTotalLength();if(!l)return;const c=n.getPointAtLength(0),h=n.getPointAtLength(l),d=[...e.querySelectorAll("g.node")].flatMap(L=>{const T=Ke(L),_=T&&Qe(T,n);return T&&_?[{node:L,shape:T,bounds:_}]:[]}),u=d.toSorted((L,T)=>Qi(c,L.bounds)-Qi(c,T.bounds))[0],f=d.toSorted((L,T)=>Qi(h,L.bounds)-Qi(h,T.bounds))[0];if(!u||!f||u===f||f.bounds.y>=u.bounds.y)return;const p=Math.max(u.bounds.x,f.bounds.x),g=Math.min(u.bounds.x+u.bounds.width,f.bounds.x+f.bounds.width);if(g<=p)return;const m=p+(g-p)*.75,y=getComputedStyle(u.shape),x=Math.min(u.bounds.width/2,Number.parseFloat(y.rx)||0),C=Math.min(u.bounds.height/2,Number.parseFloat(y.ry)||0),k=Math.max(u.bounds.x+x-m,m-(u.bounds.x+u.bounds.width-x),0),v=x>0?C*(1-Math.sqrt(Math.max(0,1-(k/x)**2))):0,M=[{x:m,y:u.bounds.y+v},{x:m,y:f.bounds.y+f.bounds.height}],A=`M${M[0].x},${M[0].y}L${M[1].x},${M[1].y}`;n.setAttribute("d",A),n.dataset.terminalGapBasePath=A,n.dataset.manhattanPoints=M.map(L=>`${L.x},${L.y}`).join(" "),n.dataset.manhattanSegments="1",n.dataset.labelSegment=`${M[0].x},${M[0].y} ${M[1].x},${M[1].y}`,n.dataset.routeLabel="fail",n.dataset.terminalTarget=f.node.id,n.dataset.terminalDirection="0,-1",o.dataset.routePathId=n.id,i.add(n)})}function LE(e,t=!1){if(!e.classList.contains("statediagram"))return null;const r=[],i=[...e.querySelectorAll("g.node")].flatMap(d=>{const u=d.transform.baseVal.consolidate()?.matrix,f=d.getBBox();return u?[{x:f.x+u.e,y:f.y+u.f,width:f.width,height:f.height}]:[]}),o=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')].map(d=>{const u=(d.dataset.manhattanPoints??"").split(" ").map(f=>f.split(",").map(Number)).filter(f=>f.length===2&&f.every(Number.isFinite)).map(([f,p])=>({x:f,y:p}));return{path:d,segments:u.slice(1).map((f,p)=>({start:u[p],end:f}))}}),a=(d,u,f=4)=>d.x<u.x+u.width+f&&d.x+d.width+f>u.x&&d.y<u.y+u.height+f&&d.y+d.height+f>u.y,s=(d,u)=>{if(Math.abs(d.start.x-d.end.x)<.5){const g=Math.min(d.start.y,d.end.y),m=Math.max(d.start.y,d.end.y);return d.start.x>u.x-3&&d.start.x<u.x+u.width+3&&m>u.y-3&&g<u.y+u.height+3}const f=Math.min(d.start.x,d.end.x),p=Math.max(d.start.x,d.end.x);return d.start.y>u.y-3&&d.start.y<u.y+u.height+3&&p>u.x-3&&f<u.x+u.width+3};for(const d of e.querySelectorAll(".edgeLabels > .edgeLabel")){const u=d.dataset.routePathId,f=u?e.querySelector(`#${CSS.escape(u)}`):null,p=f?.dataset.labelSegment?.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number);if(!f||!p||p.length!==4)continue;const g=d.getBBox(),m=t?f.dataset.routeLabel===Te.requestFails?[.03]:[.5,.25,.75,.15,.35,.65,.85]:[.5,.25,.75],y=o.find(F=>F.path===f)?.segments??[],x=t&&f.dataset.routeLabel===Te.userRetries?y.findLast(F=>Math.abs(F.start.y-F.end.y)<.5&&Math.abs(F.start.x-F.end.x)>=g.width):void 0,C=t&&(f.dataset.routeLabel===Te.agentAsksUser||f.dataset.routeLabel===Te.toolStarts||f.dataset.routeLabel===Te.requestFails||f.dataset.routeLabel===Te.userRetries)||!t&&(f.dataset.routeLabel===Te.agentAsksUser||f.dataset.routeLabel===Te.agentFinishes||f.dataset.routeLabel===Te.toolStarts||f.dataset.routeLabel===Te.userReplies||f.dataset.routeLabel===Te.requestFails),v=[x?{x1:x.start.x,y1:x.start.y,x2:x.end.x,y2:x.end.y}:{x1:p[0],y1:p[1],x2:p[2],y2:p[3]},...C?[]:y.map(({start:F,end:E})=>({x1:F.x,y1:F.y,x2:E.x,y2:E.y}))].filter((F,E,B)=>B.findIndex(q=>q.x1===F.x1&&q.y1===F.y1&&q.x2===F.x2&&q.y2===F.y2)===E).flatMap(F=>{const E={start:{x:F.x1,y:F.y1},end:{x:F.x2,y:F.y2}},B=Math.hypot(E.end.x-E.start.x,E.end.y-E.start.y),W=(Math.abs(E.start.y-E.end.y)<.5?g.width:g.height)/2,O=T1/Tu(f,E.start,E.end);return m.filter(R=>B*Math.max(R,1-R)>=W+O).map(R=>{const V={x:F.x1+(F.x2-F.x1)*R,y:F.y1+(F.y2-F.y1)*R};if(t&&Math.abs(F.x1-F.x2)<.5&&(f.dataset.routeLabel===Te.userReplies||f.dataset.routeLabel===Te.agentFinishes)&&(V.x-=g.width/2-(f.dataset.routeLabel===Te.userReplies?0:6)),t&&Math.abs(F.x1-F.x2)<.5&&f.dataset.routeLabel===Te.agentResponds&&(V.y+=6),Math.abs(F.x1-F.x2)<.5&&(t&&(f.dataset.routeLabel===Te.agentAsksUser||f.dataset.routeLabel===Te.requestFails||f.dataset.routeLabel===Te.streamFails)||!t&&f.dataset.routeLabel===Te.requestFails)){const Z=f.dataset.routeLabel===Te.agentAsksUser?0:f.dataset.routeLabel===Te.streamFails?-26:0;V.x+=g.width/2+Z}t&&Math.abs(F.y1-F.y2)<.5&&f.dataset.routeLabel===Te.userRetries&&(V.x+=12,V.y-=g.height/2-4),!t&&Math.abs(F.x1-F.x2)<.5&&f.dataset.routeLabel===Te.toolCompletes&&(V.x+=g.width/2-6);const J={x:V.x-g.width/2,y:V.y-g.height/2,width:g.width,height:g.height},at=r.filter(Z=>a(J,Z)).length,xt=i.filter(Z=>a(J,Z,5)).length,H=o.filter(Z=>Z.path!==f).flatMap(Z=>Z.segments).filter(Z=>s(Z,J)).length,Y=B*Math.min(R,1-R);return{midpoint:V,bounds:J,score:at*1e4+xt*1e4+H*1e3+(Y<W+O?100:0)+Math.abs(R-.5)}})});if(v.length===0)continue;const M=v;M.sort((F,E)=>{const B=Math.floor(F.score/1e3)-Math.floor(E.score/1e3);if(B!==0)return B;if(t&&f.dataset.routeLabel===Te.toolStarts){const q=p[1]+(p[3]-p[1])*.65;return Math.abs(F.midpoint.y-q)-Math.abs(E.midpoint.y-q)}if(t&&f.dataset.routeLabel===Te.agentAsksUser){const q=p[1]+(p[3]-p[1])*.65;return Math.abs(F.midpoint.y-q)-Math.abs(E.midpoint.y-q)}if(t&&f.dataset.routeLabel===Te.requestFails){const q=p[1]+(p[3]-p[1])*.04;return Math.abs(F.midpoint.y-q)-Math.abs(E.midpoint.y-q)}if(!t&&f.dataset.routeLabel===Te.agentAsksUser)return F.midpoint.x-E.midpoint.x;if(!t&&f.dataset.routeLabel===Te.agentFinishes){const q=(p[0]+p[2])/2;return Math.abs(F.midpoint.x-q)-Math.abs(E.midpoint.x-q)}return!t&&f.dataset.routeLabel===Te.toolStarts?E.midpoint.y-F.midpoint.y:!t&&f.dataset.routeLabel===Te.userReplies?E.midpoint.x-F.midpoint.x:F.score-E.score});const A=M[0].midpoint,L={x:A.x-g.width/2,y:A.y-g.height/2,width:g.width,height:g.height},T=f.getCTM(),_=d.parentElement?.getCTM(),$=T&&_?new DOMPoint(A.x,A.y).matrixTransform(T).matrixTransform(_.inverse()):A,P=$.x-(g.x+g.width/2),D=$.y-(g.y+g.height/2);d.setAttribute("transform",`translate(${P}, ${D})`),d.dataset.finalPathCenter=`${A.x},${A.y}`,r.push(L)}if(TE(e),!r.length)return null;const n=Math.min(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.x+d.width)),h=Math.max(...r.map(d=>d.y+d.height));return{x:n,y:l,width:c-n,height:h-l}}var AE=er('<div class="mermaid-error svelte-9cn23y"><div class="error-feedback svelte-9cn23y" role="alert"><strong class="svelte-9cn23y"> </strong> <p class="svelte-9cn23y"> </p></div> <details class="error-details svelte-9cn23y"><summary class="svelte-9cn23y"> </summary> <pre class="error-message svelte-9cn23y"> </pre> <strong class="svelte-9cn23y"> </strong> <pre class="error-source-code svelte-9cn23y"> </pre></details></div>'),FE=er('<div role="toolbar"><!> <!> <!></div>'),$E=er('<div class="mermaid-source svelte-9cn23y" role="region"><pre class="svelte-9cn23y"> </pre></div>'),EE=er('<div class="mermaid-svg-container svelte-9cn23y"><div><div class="mermaid-svg mermaid-presentation svelte-9cn23y"></div></div> <!></div> <!>',1),PE=er('<div class="mermaid-empty svelte-9cn23y" role="status"><strong class="svelte-9cn23y"> </strong> <span class="svelte-9cn23y"> </span></div>'),IE=er('<div class="mermaid-loading svelte-9cn23y" role="status"> </div>'),OE=er('<div class="fullscreen-diagram mermaid-presentation svelte-9cn23y" style="--mermaid-font-family: var(--font-ui)"></div>'),DE=er('<div class="fullscreen-surface h-[90vh] w-[90vw] overflow-hidden rounded-lg shadow-2xl svelte-9cn23y" data-media-lightbox-content=""><!></div>'),RE=er('<div style="--mermaid-font-family: var(--font-ui)"><span class="mermaid-actor-icon-template svelte-9cn23y" aria-hidden="true"><!></span> <!></div> <!>',1);function NE(e,t){if(new.target)return _o({component:NE,...e});Ao(t,!0);const r=dC("MermaidRenderer"),i=12,o=16,a=["--background","--foreground","--card","--card-foreground","--muted","--muted-foreground","--border","--accent","--accent-foreground","--diagram-canvas","--diagram-node-surface","--diagram-connector","--font-ui","--text-caption-size","--radius-small"],s={streamFails:"Stream fails"};let n=ze(t,"code",7),l=ze(t,"isStreaming",7,!1),c=ze(t,"className",7,""),h=ze(t,"showExpandButton",7,!0),d=ze(t,"showSourceButton",7,!0),u=ze(t,"showExportButton",7,!1),f=ze(t,"showSource",15,!1),p=ze(t,"onRenderStateChange",7),g=ce(""),m=ce(null),y=ce(!1),x=ce(!1),C=ce(""),k=ce(null),v=ce(void 0),M=ce(void 0),A=ce(void 0),L=ce(void 0),T,_=ce(0),$=ce(!1),P=ce(!1),D=0,F=ce(0),E=0,B=ce(0),q=Et(()=>z(R(n())));const W=uC(fC);function O(){const it=getComputedStyle(document.documentElement);return[it.fontSize,...a.map(dt=>it.getPropertyValue(dt).trim())].join("\0")}function R(it){try{return/^[A-Za-z0-9+/=]+$/.test(it.trim())?decodeURIComponent(escape(atob(it))):it}catch{return it}}function V(it){return!/^\s*stateDiagram(?:-v2)?\b/m.test(it)||/^\s*direction\s+(?:LR|RL|TB|BT)\b/m.test(it)?it:it.replace(/^(\s*stateDiagram(?:-v2)?\b[^\n]*)/m,`$1
316
+ direction TB`)}function j(it){return!S($)||!S(P)||!/^\s*sequenceDiagram\b/m.test(it)?it:`---
317
+ config:
318
+ sequence:
319
+ actorMargin: 0
320
+ diagramMarginX: 0
321
+ messageMargin: 24
322
+ noteMargin: 4
323
+ width: 96
324
+ wrap: true
325
+ ---
326
+ ${it}`}function z(it){return it.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/")}const Q=12,rt=10,et=6;function J(it){const dt=it.transform.baseVal.consolidate()?.matrix;return dt?{x:dt.e,y:dt.f}:null}function at(it){const dt=document.createTreeWalker(it,NodeFilter.SHOW_TEXT),Ct=[];for(;dt.nextNode();){if(!dt.currentNode.textContent?.trim())continue;const At=document.createRange();At.selectNodeContents(dt.currentNode),Ct.push(...Array.from(At.getClientRects()))}if(!Ct.length)return null;const Bt=Math.min(...Ct.map(At=>At.left)),wt=Math.min(...Ct.map(At=>At.top)),X=Math.max(...Ct.map(At=>At.right)),St=Math.max(...Ct.map(At=>At.bottom));return new DOMRect(Bt,wt,X-Bt,St-wt)}function xt(it){if(it.getAttribute("aria-roledescription")==="flowchart-v2")for(const dt of it.querySelectorAll("g.node .nodeLabel > p, g.cluster .nodeLabel > p")){if(dt.dataset.semanticBreaks==="true")continue;const Ct=dt.cloneNode(!0);Ct.querySelectorAll("br").forEach(wt=>wt.replaceWith(`
327
+ `));const Bt=Ct.textContent?.replace(/[^\S\n]+/g," ").trim();if(Bt){dt.replaceChildren();for(const wt of sc(Bt))dt.append(document.createTextNode(wt.text)),wt.hardBreak?dt.append(document.createElement("br")):wt.breakAfter&&dt.append(document.createElement("wbr"));dt.dataset.semanticBreaks="true"}}}function H(it){for(const dt of it.querySelectorAll("g.edgeLabel"))dt.textContent?.trim()||(dt.style.display="none")}function Y(it){if(it.getAttribute("aria-roledescription")==="flowchart-v2")for(const dt of it.querySelectorAll("g.node")){const Ct=dt.querySelector(":scope > .label"),Bt=Ct?.querySelector("foreignObject"),wt=Bt?.firstElementChild,X=dt.querySelector(":scope > .label-container, :scope > .outer-path, :scope > .basic.label-container");if(!Ct||!Bt||!(wt instanceof HTMLElement)||!X)continue;const St=Number.parseFloat(Bt.getAttribute("height")??"0"),At=at(Ct),Rt=Ct.getScreenCTM(),qt=Rt&&Math.hypot(Rt.c,Rt.d)||1,Ut=Math.max(wt.scrollHeight,At?At.height/qt:0);if(Ut>St+.5){const ie=Math.ceil(Ut+1);Bt.setAttribute("height",String(ie));const Pe=J(Ct);if(Pe&&Ct.setAttribute("transform",`translate(${Pe.x}, ${-ie/2})`),X instanceof SVGRectElement){const ke=Math.max(0,(Number(X.getAttribute("height"))-St)/2);X.setAttribute("y",String(-ie/2-ke)),X.setAttribute("height",String(ie+ke*2))}}const de=X.getBoundingClientRect(),Se=at(Ct),Dt=J(Ct),Ae=Ct.getScreenCTM();if(!Se||!Dt||!Ae)continue;const Ue=Math.hypot(Ae.a,Ae.b)||1,Be=Math.hypot(Ae.c,Ae.d)||1,ne=Se.x+Se.width/2-(de.x+de.width/2),Ft=Se.y+Se.height/2-(de.y+de.height/2);Ct.setAttribute("transform",`translate(${Dt.x-ne/Ue}, ${Dt.y-Ft/Be})`)}}function Z(it){if(it.classList.contains("statediagram"))for(const dt of it.querySelectorAll("g.statediagram-state")){const Ct=dt.querySelector(":scope > rect.basic.label-container"),Bt=dt.querySelector(":scope > g.label");if(!Ct||!Bt||!dt.textContent?.trim())continue;const wt=Ct.getBoundingClientRect(),X=at(Bt),St=J(Bt),At=Bt.getScreenCTM();if(!X||!St||!At)continue;const Rt=Math.hypot(At.a,At.b)||1,qt=X.x+X.width/2-(wt.x+wt.width/2);Bt.setAttribute("transform",`translate(${St.x-qt/Rt}, ${St.y})`)}}function tt(it){for(const dt of it.querySelectorAll("foreignObject:has(span.edgeLabel)")){if(dt.dataset.labelPadded==="true")continue;const Ct=dt.x.baseVal.value,Bt=dt.y.baseVal.value,wt=dt.width.baseVal.value,X=dt.height.baseVal.value,St=dt.querySelector("span.edgeLabel");if(!St?.textContent?.trim())continue;const At=St?.textContent?.trim()===s.streamFails;At&&St&&(St.style.display="inline-block",St.style.width="40px",St.style.whiteSpace="normal");const Rt=At?52:wt+12;dt.setAttribute("x",String(Ct+wt/2-Rt/2)),dt.setAttribute("y",String(Bt-4)),dt.setAttribute("width",String(Rt)),dt.setAttribute("height",String(At?Math.max(44,X+8):X+8)),dt.classList.add("edge-label-surface"),dt.dataset.labelPaddingX="6",dt.dataset.labelPaddingY="4",dt.dataset.labelPadded="true"}for(const dt of it.querySelectorAll(".edgeLabel rect.background:not([data-label-padded])")){const Ct=Number(dt.getAttribute("x")),Bt=Number(dt.getAttribute("y")),wt=Number(dt.getAttribute("width")),X=Number(dt.getAttribute("height"));[Ct,Bt,wt,X].every(Number.isFinite)&&(dt.setAttribute("x",String(Ct-6)),dt.setAttribute("y",String(Bt-5)),dt.setAttribute("width",String(wt+12)),dt.setAttribute("height",String(X+10)),dt.setAttribute("rx","2"),dt.dataset.labelPaddingX="6",dt.dataset.labelPaddingY="5",dt.dataset.labelPadded="true")}}function st(it){const dt=[...it.querySelectorAll(".edgeLabel rect.background[data-label-padded], .edge-label-knockout")];if(dt.length===0)return;const Ct=dt.map(X=>[X.getAttribute("x"),X.getAttribute("y"),X.getAttribute("width"),X.getAttribute("height"),X.dataset.labelPaddingX??"6",X.dataset.labelPaddingY??"4"].join(",")).join(";"),Bt=it.querySelector(":scope > defs.edge-label-feather-defs");if(Bt?.dataset.signature===Ct&&dt.every(X=>X.hasAttribute("mask")))return;Bt?.remove();const wt=document.createElementNS("http://www.w3.org/2000/svg","defs");wt.classList.add("edge-label-feather-defs"),wt.dataset.signature=Ct,it.prepend(wt),dt.forEach((X,St)=>{const At=Number(X.getAttribute("width")),Rt=Number(X.getAttribute("height")),qt=Number(X.dataset.labelPaddingX??6),Ut=Number(X.dataset.labelPaddingY??4);if(!Number.isFinite(At)||!Number.isFinite(Rt)||At<=0||Rt<=0)return;const de=`${it.id||"mermaid"}-edge-label-feather-${St}`,Se=`${de}-blur`,Dt=`${de}-mask`,Ae=Number(X.getAttribute("x")??0),Ue=Number(X.getAttribute("y")??0),Be=document.createElementNS("http://www.w3.org/2000/svg","filter");Be.id=Se,Be.setAttribute("filterUnits","userSpaceOnUse"),Be.setAttribute("x",String(Ae)),Be.setAttribute("y",String(Ue)),Be.setAttribute("width",String(At)),Be.setAttribute("height",String(Rt));const ne=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur");ne.setAttribute("stdDeviation",`${qt/6} ${Ut/6}`),Be.append(ne),wt.append(Be);const Ft=document.createElementNS("http://www.w3.org/2000/svg","mask");Ft.id=Dt,Ft.setAttribute("maskContentUnits","userSpaceOnUse"),Ft.setAttribute("maskUnits","userSpaceOnUse"),Ft.setAttribute("mask-type","alpha"),Ft.setAttribute("x",String(Ae)),Ft.setAttribute("y",String(Ue)),Ft.setAttribute("width",String(At)),Ft.setAttribute("height",String(Rt));const ie=document.createElementNS("http://www.w3.org/2000/svg","rect");ie.setAttribute("x",String(Ae+qt/2)),ie.setAttribute("y",String(Ue+Ut/2)),ie.setAttribute("width",String(Math.max(0,At-qt))),ie.setAttribute("height",String(Math.max(0,Rt-Ut))),ie.setAttribute("fill","hsl(var(--foreground))"),ie.setAttribute("filter",`url(#${Se})`),Ft.append(ie),wt.append(Ft),X.setAttribute("mask",`url(#${Dt})`),X.dataset.labelFeathered="true"})}function It(it){const Ct=document.createElement("canvas").getContext("2d");if(Ct)for(const Bt of it.querySelectorAll("span.edgeLabel")){const wt=Bt.querySelector("p");if(!wt)continue;const X=getComputedStyle(wt);Ct.font=X.font;const St=wt.innerText.split(`
328
+ `).filter(Ae=>Ae.length>0);if(St.length===0)continue;const At=Ct.measureText(St[0]),Rt=Ct.measureText(St.at(-1)),qt=At.fontBoundingBoxAscent||At.actualBoundingBoxAscent,Ut=Rt.fontBoundingBoxDescent||Rt.actualBoundingBoxDescent,de=qt-At.actualBoundingBoxAscent,Se=Ut-Rt.actualBoundingBoxDescent,Dt=(Se-de)/2;wt.style.transform=`translateY(${Dt}px)`,Bt.dataset.opticalTopGap=String(3+de+Dt),Bt.dataset.opticalBottomGap=String(3+Se-Dt)}}function zt(it){for(const dt of it.querySelectorAll("g.edgeLabel[data-route-path-id]")){const Ct=dt.dataset.finalPathCenter?.split(",").map(Number),wt=(dt.dataset.routePathId?it.querySelector(`#${CSS.escape(dt.dataset.routePathId)}`):null)?.getCTM(),X=dt.parentElement?.getCTM();if(!Ct||Ct.length!==2||!wt||!X)continue;const St=new DOMPoint(Ct[0],Ct[1]).matrixTransform(wt).matrixTransform(X.inverse()),At=dt.getBBox();dt.setAttribute("transform",`translate(${St.x-(At.x+At.width/2)}, ${St.y-(At.y+At.height/2)})`)}}function Wt(it){for(const dt of it.querySelectorAll("g.cluster")){const Ct=dt.querySelector(":scope > rect"),Bt=dt.querySelector(":scope > g.cluster-label"),wt=Bt?.querySelector("foreignObject");if(!Ct||!Bt||!wt)continue;const X=Number(Ct.getAttribute("x")),St=Number(Ct.getAttribute("y")),At=Number(Ct.getAttribute("width")),Rt=Number(Ct.getAttribute("height"));if(![X,St,At,Rt].every(Number.isFinite))continue;wt.setAttribute("x","0"),wt.setAttribute("y","0"),wt.setAttribute("width",String(Math.max(24,At-40)));const qt=wt.querySelector("div"),Ut=Math.ceil(Math.max(qt?.getBoundingClientRect().height??0,qt?.scrollHeight??0,18)),de=an(Ut),Se=Number(dt.dataset.headerHeight)||de,Dt=Math.max(0,de-Se),Ae=St-Dt;wt.setAttribute("height",String(Ut)),Ct.setAttribute("y",String(Ae)),Ct.setAttribute("height",String(Rt+Dt)),dt.dataset.headerHeight=String(Math.max(Se,de)),Bt.setAttribute("transform",`translate(${X+20}, ${Ae+20})`)}}function Zt(it){if(it.getAttribute("aria-roledescription")!=="sequence")return;const dt=S(A)?.querySelector("svg");if(dt)for(const Ct of it.querySelectorAll("g.actor-man")){const Bt=Ct.querySelector(":scope > circle"),wt=Ct.querySelector(":scope > text.actor-man");if(!Bt||!wt)continue;const X=Number(Bt.getAttribute("cx")),St=Number(Bt.getAttribute("cy"))-10,At=wt.getBBox().height;Ct.querySelectorAll(":scope > line, :scope > circle").forEach(qt=>qt.remove());const Rt=dt.cloneNode(!0);Rt.classList.add("mermaid-actor-user-icon"),Rt.setAttribute("x",String(X-15)),Rt.setAttribute("y",String(St+1)),Rt.setAttribute("width","30"),Rt.setAttribute("height","30"),Rt.setAttribute("aria-hidden","true"),Rt.setAttribute("focusable","false"),Rt.removeAttribute("role"),wt.setAttribute("y",String(St+37+At/2)),Ct.insertBefore(Rt,wt)}}function $t(it){const dt=it.toLowerCase();return/invalid|fail|error|denied|reject|unavailable/.test(dt)?"failure":/valid|success|accepted|ready|available|complete/.test(dt)?"success":"neutral"}function Nt(it,dt,Ct){const Bt=it.replace(/^\[|\]$/g,"").trim().split(/\s+/),wt=document.createElement("canvas").getContext("2d");if(!wt||Bt.length===0)return[it];const X=getComputedStyle(Ct);wt.font=`${X.fontWeight} ${X.fontSize} ${X.fontFamily}`;const St=[];for(const At of Bt){const Rt=St.length?`${St.at(-1)} ${At}`:At;St.length&&wt.measureText(Rt).width>dt?St.push(At):St.length?St[St.length-1]=Rt:St.push(At)}return St}function _e(it,dt,Ct){const Bt=it.trim().split(/\s+/),wt=document.createElement("canvas").getContext("2d");if(!wt||Bt.length===0)return[it];const X=getComputedStyle(Ct);wt.font=`${X.fontWeight} ${X.fontSize} ${X.fontFamily}`;const St=[];for(const At of Bt){const Rt=St.length?`${St.at(-1)} ${At}`:At;St.length&&wt.measureText(Rt).width>dt?St.push(At):St.length?St[St.length-1]=Rt:St.push(At)}return St}function Ot(it,dt,Ct){for(const wt of it.querySelectorAll("line"))for(const X of["y1","y2"]){const St=Number(wt.getAttribute(X));Number.isFinite(St)&&St>=dt&&wt.setAttribute(X,String(St+Ct))}for(const wt of it.querySelectorAll("text")){if(wt.closest("g.actor-man"))continue;const X=Number(wt.getAttribute("y"));Number.isFinite(X)&&X>=dt&&wt.setAttribute("y",String(X+Ct))}for(const wt of it.querySelectorAll("rect")){const X=Number(wt.getAttribute("y")),St=Number(wt.getAttribute("height"));[X,St].every(Number.isFinite)&&(X>=dt?wt.setAttribute("y",String(X+Ct)):X+St>=dt&&wt.setAttribute("height",String(St+Ct)))}const Bt=it.getScreenCTM();for(const wt of it.querySelectorAll("g.actor-man")){const X=wt.getScreenCTM(),St=wt.parentElement?.getScreenCTM();if(!Bt||!X||!St)continue;const At=wt.getBBox();if(new DOMPoint(At.x,At.y).matrixTransform(X).matrixTransform(Bt.inverse()).y<dt)continue;const qt=St.inverse().multiply(Bt),Ut=it.createSVGTransform();Ut.setTranslate(qt.c*Ct,qt.d*Ct),wt.transform.baseVal.insertItemBefore(Ut,0)}for(const wt of it.querySelectorAll("path, polygon, polyline")){if(wt.ownerSVGElement!==it||wt.closest("defs, marker"))continue;const X=wt.transform.baseVal.consolidate()?.matrix;if(wt.getBBox().y+(X?.f??0)<dt)continue;const At=it.createSVGTransform();At.setTranslate(0,Ct),wt.transform.baseVal.insertItemBefore(At,0)}}function ue(it,dt){const Ct=[...it.querySelectorAll(":scope > line.messageLine0, :scope > line.messageLine1")].filter(Bt=>Bt.y1.baseVal.value===Bt.y2.baseVal.value);if(Ct.length!==0)for(const Bt of dt){const wt=Bt.y.baseVal.value,X=Ct.filter(qt=>qt.y1.baseVal.value<wt).sort((qt,Ut)=>Ut.y1.baseVal.value-qt.y1.baseVal.value)[0];if(!X)continue;const St=Number.parseFloat(getComputedStyle(X).strokeWidth)||0;let At=St/2;for(const qt of["marker-start","marker-end"]){const Ut=X.getAttribute(qt)?.match(/#([^)'"\s]+)/)?.[1],de=Ut?it.querySelector(`marker[id="${CSS.escape(Ut)}"]`):null;if(!de)continue;const Se=de.viewBox.baseVal.height||de.markerHeight.baseVal.value,Dt=de.markerHeight.baseVal.value/Se,Ae=de.markerUnits.baseVal===SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH?St:1,Ue=de.refY.baseVal.value-de.viewBox.baseVal.y;At=Math.max(At,Math.max(Ue,Se-Ue)*Dt*Ae)}const Rt=X.y1.baseVal.value+At+i-wt;Rt>0&&Ot(it,wt,Rt)}}function $e(it,dt){const Ct=[];let Bt=[];for(const wt of it.children){if(wt.matches("text.messageText")&&Bt.push(wt),wt.matches("path.messageLine0, path.messageLine1")){Bt=[];continue}wt.matches("line.messageLine0, line.messageLine1")&&(Ct.push({labels:Bt,line:wt}),Bt=[])}for(const wt of Ct){if(wt.labels.length===0)continue;const X=Number(wt.line.getAttribute("x1")),St=Number(wt.line.getAttribute("x2")),At=dt.reduce((ne,Ft)=>Math.abs(Ft-X)<Math.abs(ne-X)?Ft:ne),Rt=dt.reduce((ne,Ft)=>Math.abs(Ft-St)<Math.abs(ne-St)?Ft:ne),qt=(At+Rt)/2,Ut=Math.abs(Rt-At)-i*2,de=wt.labels.map(ne=>ne.textContent?.trim()).join(" "),Se=_e(de,Ut,wt.labels[0]),Dt=(Se.length-wt.labels.length)*o,Ae=Number(wt.line.getAttribute("y1"));Dt>0&&Number.isFinite(Ae)&&Ot(it,Ae,Dt);const Ue=wt.labels[0],Be=Number(Ue.getAttribute("y"));for(const ne of wt.labels.slice(1))ne.remove();Se.forEach((ne,Ft)=>{const ie=Ft===0?Ue:Ue.cloneNode(!1);ie.textContent=ne,ie.setAttribute("x",String(qt)),ie.setAttribute("y",String(Be+Ft*o)),ie.setAttribute("text-anchor","middle"),Ft>0&&wt.line.before(ie)})}}async function Ce(it,dt){if(it.getAttribute("aria-roledescription")!=="sequence")return;const Ct={x:it.viewBox.baseVal.x,y:it.viewBox.baseVal.y,width:it.viewBox.baseVal.width,height:it.viewBox.baseVal.height},Bt=it.getBBox(),wt=Ct.y+Ct.height-(Bt.y+Bt.height),X=[...it.querySelectorAll(".actor-line")].map(Ft=>Number(Ft.getAttribute("x1")));$e(it,X);for(const Ft of it.querySelectorAll(":scope > line.messageLine0, :scope > line.messageLine1")){const ie=Number(Ft.getAttribute("x1")),Pe=Number(Ft.getAttribute("x2")),ke=Number(Ft.getAttribute("y1")),Ie=Number(Ft.getAttribute("y2")),Ve=Math.sign(Pe-ie);if(![ie,Pe,ke,Ie].every(Number.isFinite)||ke!==Ie||Ve===0)continue;const Oe=X.reduce((ve,me)=>Math.abs(me-Pe)<Math.abs(ve-Pe)?me:ve);Math.abs(Oe-Pe)>12||Ft.setAttribute("x2",String(Oe-Ve*5))}for(const Ft of it.querySelectorAll(":scope > g")){const ie=[...Ft.querySelectorAll(":scope > line.loopLine")],Pe=Ft.querySelector(":scope > text.labelText");if(ie.length<4||!Pe)continue;const ke=Pe.textContent?.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-")||"group";Ft.classList.add("sequence-construct",`sequence-construct-${ke}`),Pe.classList.add("sequence-construct-label-text"),Ft.querySelector(":scope > .labelBox")?.classList.add("sequence-construct-label");const Ie=ie.flatMap(fr=>[Number(fr.getAttribute("x1")),Number(fr.getAttribute("x2"))]),Ve=ie.flatMap(fr=>[Number(fr.getAttribute("y1")),Number(fr.getAttribute("y2"))]),Oe=Math.min(...Ie),ve=Math.max(...Ie),me=Math.min(...Ve),Ge=Math.max(...Ve);if(![Oe,ve,me,Ge].every(Number.isFinite))continue;const Jt=[];for(const fr of ie){const yi=Number(fr.getAttribute("x1")),ii=Number(fr.getAttribute("x2")),li=Number(fr.getAttribute("y1")),Ur=Number(fr.getAttribute("y2")),wa=yi===ii&&(yi===Oe||yi===ve)||li===Ur&&(li===me||li===Ge);fr.classList.add(wa?"sequence-frame-line":"sequence-branch-divider"),!wa&&li===Ur&&Jt.push(li)}const ir=[...Ft.querySelectorAll(":scope > text.loopText, :scope > text.sectionTitle")],mr=Ft.querySelector(":scope > .sequence-construct-label")?.getBBox(),sr=Math.max(Oe+12,(mr?.x??Oe)+(mr?.width??42)+12),mi=[me,...Jt.sort((fr,yi)=>fr-yi),Ge],Wi=mi.slice(0,-1).map(()=>[]);ir.forEach(fr=>{fr.classList.add("sequence-branch-condition"),fr.setAttribute("x",String(sr)),fr.setAttribute("text-anchor","start");const yi=Number(fr.getAttribute("y")),ii=Math.max(0,Math.min(Wi.length-1,mi.findIndex((li,Ur)=>Ur>0&&yi<li)-1));Wi[ii].push(fr)}),Wi.forEach((fr,yi)=>{if(fr.length===0)return;const ii=fr.map(Li=>Li.textContent??"").join(" ").replace(/-\s+/g,"").replace(/\[\s+/g,"[").replace(/\s+\]/g,"]").replace(/\]\s+\[/g," "),li=$t(ii),Ur=fr[0];for(const Li of fr)Li.previousElementSibling?.classList.contains("edge-label-knockout")&&Li.previousElementSibling.remove(),Li!==Ur&&Li.remove();Ur.replaceChildren();const wa=Nt(ii,Math.max(48,ve-sr-12),Ur);Ur.setAttribute("aria-label",ii.replace(/^\[|\]$/g,"").trim()),Ur.dataset.sequenceBranch=li;for(const[Li,lc]of wa.entries()){const ka=document.createElementNS("http://www.w3.org/2000/svg","tspan");ka.setAttribute("x",String(sr)),ka.setAttribute("dy",Li===0?"0":"1.15em"),ka.textContent=lc,Ur.append(ka)}S1(Ft,Ur,Ur.getBBox());const zi=mi[yi],Ko=mi[yi+1],Hi=document.createElementNS("http://www.w3.org/2000/svg","rect");Hi.classList.add("sequence-branch-surface"),Hi.setAttribute("x",String(Oe+4)),Hi.setAttribute("y",String(zi+4)),Hi.setAttribute("width",String(Math.max(0,ve-Oe-8))),Hi.setAttribute("height",String(Math.max(0,Ko-zi-8))),Hi.setAttribute("rx","6"),Hi.dataset.sequenceBranch="neutral";const Bi=document.createElementNS("http://www.w3.org/2000/svg","line");Bi.classList.add("sequence-branch-cue",`sequence-branch-${li}`),Bi.setAttribute("x1",String(Oe+8)),Bi.setAttribute("x2",String(Oe+8)),Bi.setAttribute("y1",String(zi+12)),Bi.setAttribute("y2",String(Ko-10)),Bi.dataset.sequenceBranch=li,Ft.insertBefore(Bi,Ft.firstElementChild),Ft.insertBefore(Hi,Ft.firstElementChild)})}const St=[...it.querySelectorAll(":scope > .sequence-construct")];St.sort((Ft,ie)=>{const Pe=Ft.getBBox(),ke=ie.getBBox();return ke.width*ke.height-Pe.width*Pe.height});const At=[...it.children].filter(Ft=>Ft.matches("rect.rect")||Ft.matches("g")&&Ft.querySelector(":scope > rect.rect"));it.prepend(...At,...St);const Rt=Ft=>Ft.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim(),qt=(Ft,ie)=>{const Pe=[];let ke=0;for(const Ie of ie){const Ve=Rt(Ie);let Oe="";for(;ke<Ft.length&&Rt(Oe)!==Ve;){const ve=[Oe,Ft[ke]].filter(Boolean).join(" ");if(!Ve.startsWith(Rt(ve)))return Ft;Oe=ve,ke+=1}if(Rt(Oe)!==Ve)return Ft;Pe.push(Oe)}return ke===Ft.length?Pe:Ft},Ut=dt.split(`
329
+ `).map(Ft=>/^\s*note\s+(?:left of|right of|over)\s+[^:]+:\s*(.*)$/i.exec(Ft)?.[1]).filter(Ft=>Ft!==void 0).map(Ft=>Ft.split(/<br\s*\/?>/i)),Se=[...it.querySelectorAll(":scope > g")].flatMap(Ft=>{const ie=Ft.querySelector(":scope > rect.note"),Pe=[...Ft.querySelectorAll(":scope > text.noteText")];return ie&&Pe.length?[{group:Ft,note:ie,lines:Pe}]:[]}).map(({group:Ft,note:ie,lines:Pe},ke)=>{const Ie=Pe.map(me=>me.textContent?.trim()).filter(Boolean),Ve=Ut[ke]??[],Oe=Ve.length>1?qt(Ie,Ve):[Ie.join(" ")];Oe.forEach((me,Ge)=>{const Jt=Pe[Ge],ir=Jt.querySelector("tspan")?.getAttribute("x")??Jt.getAttribute("x"),mr=document.createElementNS("http://www.w3.org/2000/svg","tspan");ir&&mr.setAttribute("x",ir),mr.textContent=me,Jt.replaceChildren(mr)}),Pe.slice(Oe.length).forEach(me=>me.remove());const ve=Pe.slice(0,Oe.length);return{group:Ft,note:ie,texts:ve}});for(const{group:Ft,texts:ie}of Se){Ft.classList.add("sequence-note");for(const Pe of ie)Pe.style.setProperty("transition-property","none","important"),Pe.classList.add("sequence-note-text")}Se.length&&await Promise.all(Se.flatMap(({texts:Ft})=>Ft.map(C$)));for(const{note:Ft,texts:ie}of Se){const Pe=ie.map(sr=>sr.getBBox()),ke=Math.min(...Pe.map(sr=>sr.x)),Ie=Math.min(...Pe.map(sr=>sr.y)),Ve=Math.max(...Pe.map(sr=>sr.x+sr.width)),Oe=Math.max(...Pe.map(sr=>sr.y+sr.height)),ve=document.createElement("canvas").getContext("2d"),Ge=Math.max(...ie.map((sr,mi)=>{const Wi=getComputedStyle(sr);return ve&&(ve.font=`${Wi.fontWeight} ${Wi.fontSize} ${Wi.fontFamily}`),ve?.measureText(sr.textContent??"").width??Pe[mi].width}))+20,Jt=Math.max(28,Oe-Ie+12),ir=Number(ie[0].getAttribute("x")),mr=Number.isFinite(ir)?ir:(ke+Ve)/2;Ft.style.setProperty("transition-property","none","important"),Ft.setAttribute("x",String(mr-Ge/2)),Ft.setAttribute("y",String(Ie-6)),Ft.setAttribute("width",String(Ge)),Ft.setAttribute("height",String(Jt)),Ft.setAttribute("rx","6")}ue(it,Se.map(({note:Ft})=>Ft));const Dt=it.getBBox(),Ae=Math.min(Ct.x,Math.floor(Dt.x)),Be=Math.max(Ct.x+Ct.width,Math.ceil(Dt.x+Dt.width))-Ae,ne=Math.ceil(Dt.y+Dt.height+wt-Ct.y);(Be>Ct.width||ne>Ct.height)&&(it.setAttribute("viewBox",`${Ae} ${Ct.y} ${Be} ${Math.max(Ct.height,ne)}`),it.setAttribute("width",String(Be)),it.setAttribute("height",String(Math.max(Ct.height,ne))))}function we(it){if(!it)return null;const dt=Array.from(it.children).filter(X=>X instanceof SVGGElement&&X.classList.contains("label")&&!!X.textContent?.trim());if(!dt.length)return it.style.display="none",null;it.style.removeProperty("display");let Ct=0,Bt=Number.POSITIVE_INFINITY,wt=Number.NEGATIVE_INFINITY;for(const[X,St]of dt.entries()){const At=St.getBBox();St.setAttribute("transform",`translate(0, ${Ct-At.y})`),Bt=Math.min(Bt,At.x),wt=Math.max(wt,At.x+At.width),Ct+=At.height,X<dt.length-1&&(Ct+=et)}return{element:it,bounds:new DOMRect(Bt,0,wt-Bt,Ct)}}function Tt(it){if(!it.classList.contains("classDiagram"))return null;const dt=Array.from(it.querySelectorAll("g.node")).flatMap(qt=>{const Ut=qt.querySelector(".outer-path"),de=J(qt);if(!Ut||!de)return[];const Se=Ut.getBBox();qt.querySelectorAll(":scope > .divider").forEach(Jt=>Jt.remove()),qt.querySelector(":scope > .class-box-outline")?.remove();const Dt=we(qt.querySelector(":scope > .annotation-group")),Ae=we(qt.querySelector(":scope > .label-group")),Ue=we(qt.querySelector(":scope > .members-group")),Be=we(qt.querySelector(":scope > .methods-group")),ne=[Dt,Ae].filter(Jt=>Jt!==null),Ft=[{groups:ne,centered:!0},...Ue?[{groups:[Ue],centered:!1}]:[],...Be?[{groups:[Be],centered:!1}]:[]];if(!ne.length)return[];const ie=Ft.map(({groups:Jt})=>Jt.reduce((ir,mr,sr)=>ir+mr.bounds.height+(sr?et:0),0)),Pe=Math.max(...Ft.flatMap(({groups:Jt})=>Jt.map(ir=>ir.bounds.width))),ke=Math.max(Se.width,Pe+Q*2),Ie=-ke/2,Ve=-(ie[0]+rt*2)/2;let Oe=Ve+rt;const ve=[];for(const[Jt,ir]of Ft.entries()){for(const[mr,sr]of ir.groups.entries()){mr&&(Oe+=et);const mi=ir.centered?-sr.bounds.width/2-sr.bounds.x:Ie+Q-sr.bounds.x;sr.element.setAttribute("transform",`translate(${mi}, ${Oe-sr.bounds.y})`),Oe+=sr.bounds.height}if(Oe+=rt,Jt<Ft.length-1){const mr=document.createElementNS("http://www.w3.org/2000/svg","line");mr.classList.add("class-box-divider"),mr.setAttribute("x1",String(Ie)),mr.setAttribute("x2",String(Ie+ke)),mr.setAttribute("y1",String(Oe)),mr.setAttribute("y2",String(Oe)),ve.push(mr),Oe+=rt}}const me=document.createElementNS("http://www.w3.org/2000/svg","rect");me.classList.add("class-box-outline"),me.setAttribute("x",String(Ie)),me.setAttribute("y",String(Ve)),me.setAttribute("width",String(ke)),me.setAttribute("height",String(Oe-Ve)),qt.insertBefore(me,Ut),Ut.style.display="none";const Ge=qt.querySelector(":scope > .annotation-group, :scope > .label-group, :scope > .members-group, :scope > .methods-group");for(const Jt of ve)qt.insertBefore(Jt,Ge);return[{element:qt,name:Ae.element.textContent?.trim()??"",...de,box:me.getBBox(),originalBox:Se,deltaX:0,deltaY:0}]}),Ct=()=>{const qt=Math.min(...dt.map(Dt=>Dt.x+Dt.deltaX+Dt.box.x)),Ut=Math.min(...dt.map(Dt=>Dt.y+Dt.deltaY+Dt.box.y)),de=Math.max(...dt.map(Dt=>Dt.x+Dt.deltaX+Dt.box.x+Dt.box.width)),Se=Math.max(...dt.map(Dt=>Dt.y+Dt.deltaY+Dt.box.y+Dt.box.height));return new DOMRect(qt,Ut,de-qt,Se-Ut)};if(dt.length<2)return dt.length?Ct():null;const Bt=Math.max(...dt.map(qt=>qt.x))-Math.min(...dt.map(qt=>qt.x)),X=Math.max(...dt.map(qt=>qt.y))-Math.min(...dt.map(qt=>qt.y))>=Bt,St=qt=>X?qt.y:qt.x,At=[];for(const qt of dt.toSorted((Ut,de)=>St(Ut)-St(de))){const Ut=At.at(-1);Ut&&Math.abs(St(Ut[0])-St(qt))<1?Ut.push(qt):At.push([qt])}let Rt=Number.NEGATIVE_INFINITY;for(const qt of At){const Ut=Math.min(...qt.map(Dt=>St(Dt)+(X?Dt.box.y:Dt.box.x))),de=Math.max(...qt.map(Dt=>St(Dt)+(X?Dt.box.y+Dt.box.height:Dt.box.x+Dt.box.width))),Se=Number.isFinite(Rt)?Math.max(0,Rt+24-Ut):0;for(const Dt of qt)X?Dt.deltaY=Se:Dt.deltaX=Se,Dt.element.setAttribute("transform",`translate(${Dt.x+Dt.deltaX}, ${Dt.y+Dt.deltaY})`);Rt=de+Se}for(const qt of it.querySelectorAll('.edgePaths path[data-edge="true"]')){const Ut=qt.getTotalLength();if(!Ut)continue;const de=qt.getPointAtLength(0),Se=qt.getPointAtLength(Ut),Dt=ke=>dt.toSorted((Ie,Ve)=>{const Oe=ve=>{const{originalBox:me}=ve,Ge=Math.max(ve.x+me.x-ke.x,0,ke.x-ve.x-me.x-me.width),Jt=Math.max(ve.y+me.y-ke.y,0,ke.y-ve.y-me.y-me.height);return Math.hypot(Ge,Jt)};return Oe(Ie)-Oe(Ve)})[0],Ae=qt.dataset.id??"",Ue=dt.flatMap(ke=>dt.filter(Ie=>Ie!==ke).map(Ie=>({source:ke,target:Ie}))).find(({source:ke,target:Ie})=>Ae.startsWith(`id_${ke.name}_${Ie.name}_`)),Be=Ue?.source??Dt(de),ne=Ue?.target??Dt(Se);if(!Be||!ne||Be===ne)continue;const Ft={x:Be.x+Be.deltaX+Be.box.x+Be.box.width/2,y:Be.y+Be.deltaY+Be.box.y+Be.box.height/2},ie={x:ne.x+ne.deltaX+ne.box.x+ne.box.width/2,y:ne.y+ne.deltaY+ne.box.y+ne.box.height/2};if(Math.abs(ie.x-Ft.x)>Math.abs(ie.y-Ft.y)){const ke=Math.sign(ie.x-Ft.x)||1,Ie=Be.x+Be.deltaX+(ke>0?Be.box.x+Be.box.width:Be.box.x),Ve=ne.x+ne.deltaX+(ke>0?ne.box.x:ne.box.x+ne.box.width),Oe=(Ie+Ve)/2,ve=[{x:Ie,y:Ft.y},{x:Oe,y:Ft.y},{x:Oe,y:ie.y},{x:Ve,y:ie.y}];qt.setAttribute("d",ve.map((me,Ge)=>`${Ge?"L":"M"}${me.x},${me.y}`).join("")),qt.dataset.manhattanPoints=ve.map(me=>`${me.x},${me.y}`).join(" ")}else{const ke=Math.sign(ie.y-Ft.y)||1,Ie=Be.y+Be.deltaY+(ke>0?Be.box.y+Be.box.height:Be.box.y),Ve=ne.y+ne.deltaY+(ke>0?ne.box.y:ne.box.y+ne.box.height),Oe=(Ie+Ve)/2,ve=[{x:Ft.x,y:Ie},{x:Ft.x,y:Oe},{x:ie.x,y:Oe},{x:ie.x,y:Ve}];qt.setAttribute("d",ve.map((me,Ge)=>`${Ge?"L":"M"}${me.x},${me.y}`).join("")),qt.dataset.manhattanPoints=ve.map(me=>`${me.x},${me.y}`).join(" ")}}return Ct()}function Yt(it,dt){const Ct=Number.parseFloat(getComputedStyle(it).fontSize),Bt=dt*(12/(Number.isFinite(Ct)?Ct:13));it.style.setProperty("--mermaid-readable-width",`${Bt.toFixed(3)}px`)}function w(it){const dt=it.getBBox(),Bt=it.querySelector(".edgePaths path, g.node")?.getScreenCTM()?.inverse();if(!Bt)return dt;const wt=[...it.querySelectorAll(".edgeLabels > .edgeLabel")].flatMap(Ut=>{if(!Ut.textContent?.trim())return[];const de=Ut.getBoundingClientRect(),Se=[new DOMPoint(de.left,de.top),new DOMPoint(de.right,de.top),new DOMPoint(de.right,de.bottom),new DOMPoint(de.left,de.bottom)].map(ne=>ne.matrixTransform(Bt)),Dt=Math.min(...Se.map(ne=>ne.x)),Ae=Math.min(...Se.map(ne=>ne.y)),Ue=Math.max(...Se.map(ne=>ne.x)),Be=Math.max(...Se.map(ne=>ne.y));return[{x:Dt,y:Ae,width:Ue-Dt,height:Be-Ae}]}),X=[dt,...wt],St=Math.min(...X.map(Ut=>Ut.x)),At=Math.min(...X.map(Ut=>Ut.y)),Rt=Math.max(...X.map(Ut=>Ut.x+Ut.width)),qt=Math.max(...X.map(Ut=>Ut.y+Ut.height));return{x:St,y:At,width:Rt-St,height:qt-At}}async function G(it,dt,Ct,Bt){const wt=++E;if(await hh(),await document.fonts?.ready,it!==D)return!1;const X=S(M)?.querySelector(".mermaid-svg svg");if(!X||(k$(X,Ct),typeof X.getBBox!="function"))return!1;if(delete X.dataset.layoutSettled,Zt(X),Fa(X),X.getAttribute("aria-roledescription")==="sequence")return await Ce(X,dt),it!==D||wt!==E?!1:(dp(X),st(X),Yt(X,X.viewBox.baseVal.width),X.dataset.layoutGeneration=String(it),X.dataset.layoutSettled="true",!0);xt(X),H(X),Y(X),Z(X),It(X),tt(X),dp(X),st(X),X.getAttribute("aria-roledescription")!=="flowchart-v2"&&G$(X,Ct),z$(X),q$(X),W$(X);const St=X.getAttribute("aria-roledescription")==="flowchart-v2";if(St&&(X.dataset.flowchartDirection=dt.match(/^\s*(?:flowchart|graph)\s+(\w+)\b/m)?.[1]??""),St){const Jt=X.getBBox(),ir=16,mr=Math.ceil(Jt.width+ir*2),sr=Math.ceil(Jt.height+ir*2);return X.setAttribute("viewBox",`${Jt.x-ir} ${Jt.y-ir} ${mr} ${sr}`),X.setAttribute("width",String(mr)),X.setAttribute("height",String(sr)),Yt(X,mr),Fs(X),Hs(X.ownerDocument)||await new Promise(mi=>setTimeout(mi,64)),it!==D||wt!==E?!1:(X.dataset.layoutGeneration=String(it),X.dataset.layoutSettled="true",!0)}const At=S(M)?.clientWidth??0,Rt=At>0?At<=620:S($);St&&!Rt&&X.querySelectorAll("g.cluster").length>=2&&Nn(X);const qt=X.dataset.nestedDecisionLayout==="wide"?gE(X)??X.getBBox():X.getBBox(),Ut=Number.parseFloat(getComputedStyle(X).fontSize),de=12/(Number.isFinite(Ut)?Ut:13),Dt=!/^\s*(?:flowchart|graph)\s+(?:LR|RL|BT)\b/m.test(dt)&&(Rt||St&&qt.width*de>At);if(Dt&&(ih(X,!1,Ct),ih(X,!0,Ct)),await new Promise(Jt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Jt()))),it!==D)return!1;X.getBoundingClientRect(),Dt&&Wt(X),St&&xE(X),rh(X),kp(X),Nn(X);let Ae=null;Dt?(ih(X,!0,Ct),rh(X,!0),kp(X),Nn(X),Wt(X),oh(X),$a(X),Ae=X.getBBox()):(oh(X),X.querySelector("g.cluster")&&$a(X));const Ue=X.classList.contains("statediagram"),Be=S(P)?"compact":"wide",Ft=(!Ue||X.dataset.stateRouteLayout!==Be)&&kE(X,S(P),Bt);BE(X),vE(X),Ue&&Ft&&(X.dataset.stateRouteLayout=Be);const ie=Tt(X);if(eh(X),Fa(X),mp(X),LE(X,S(P)),await new Promise(Jt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Jt()))),it!==D)return!1;zt(X),Nn(X),eh(X),Fa(X),X.querySelector("g.cluster")&&$a(X);const Pe=X.getBBox(),ke=[ie,Ae].filter(Jt=>!!Jt),Ie=Pe,Ve=ke.length?DOMRect.fromRect({x:Math.min(Ie.x,...ke.map(Jt=>Jt.x)),y:Math.min(Ie.y,...ke.map(Jt=>Jt.y)),width:Math.max(Ie.x+Ie.width,...ke.map(Jt=>Jt.x+Jt.width))-Math.min(Ie.x,...ke.map(Jt=>Jt.x)),height:Math.max(Ie.y+Ie.height,...ke.map(Jt=>Jt.y+Jt.height))-Math.min(Ie.y,...ke.map(Jt=>Jt.y))}):Ie;if(![Ve.x,Ve.y,Ve.width,Ve.height].every(Number.isFinite))return!1;const Oe=!!X.querySelector("g.cluster");let ve=St?Dt?X.querySelector("g.cluster")?14:20:28:Oe?24:S($)?Ue?10:8:10,me=Math.ceil(Ve.width+ve*2),Ge=Math.ceil(Ve.height+ve*2);if(X.setAttribute("viewBox",`${Ve.x-ve} ${Ve.y-ve} ${me} ${Ge}`),X.style.removeProperty("width"),X.setAttribute("width",String(me)),X.setAttribute("height",String(Ge)),Ue){if(await new Promise(ir=>requestAnimationFrame(()=>ir())),it!==D)return!1;const Jt=X.getBBox();me=Math.ceil(Jt.width+ve*2),Ge=Math.ceil(Jt.height+ve*2),X.setAttribute("viewBox",`${Jt.x-ve} ${Jt.y-ve} ${me} ${Ge}`),X.setAttribute("width",String(me)),X.setAttribute("height",String(Ge))}if(Yt(X,me),Hs(X.ownerDocument)||await new Promise(Jt=>setTimeout(Jt,64)),it!==D)return!1;if(!Dt&&X.getAttribute("aria-roledescription")==="flowchart-v2"){rh(X,!0),Fa(X);const Jt=w(X);me=Math.ceil(Jt.width+ve*2),Ge=Math.ceil(Jt.height+ve*2),X.setAttribute("viewBox",`${Jt.x-ve} ${Jt.y-ve} ${me} ${Ge}`),X.setAttribute("width",String(me)),X.setAttribute("height",String(Ge)),Yt(X,me)}if(X.getAttribute("aria-roledescription")==="flowchart-v2"){if(await new Promise(Jt=>requestAnimationFrame(()=>Jt())),it!==D)return!1;wp(X),Cp(X),bp(X),j$(X),Fa(X),Dt&&X.querySelector("g.cluster")&&$a(X)}if(Dt&&(Wt(X),oh(X),$a(X)),X.getAttribute("aria-roledescription")==="flowchart-v2"){wp(X),Cp(X),bp(X),H$(X),oE(X);const Jt=U$(X);eh(X),Oe&&$a(X),K$(X,Jt),Fa(X),Dt&&X.querySelector('path[data-grouped-return-lane="right"]')&&(ve=Math.max(ve,23));const ir=w(X);me=Math.ceil(ir.width+ve*2),Ge=Math.ceil(ir.height+ve*2),X.setAttribute("viewBox",`${ir.x-ve} ${ir.y-ve} ${me} ${Ge}`),X.setAttribute("width",String(me)),X.setAttribute("height",String(Ge)),Yt(X,me)}if((Ue||Dt&&St&&!Oe&&!X.dataset.decisionCycleLayout)&&(X.style.setProperty("--mermaid-readable-width","0px"),X.style.setProperty("max-width","100%")),Ue&&mp(X),Fs(X),Hs(X.ownerDocument)||await new Promise(Jt=>setTimeout(Jt,120)),it!==D||wt!==E)return!1;if(X.getAttribute("aria-roledescription")==="flowchart-v2"){const Jt=w(X);if(me=Math.ceil(Jt.width+ve*2),Ge=Math.ceil(Jt.height+ve*2),X.setAttribute("viewBox",`${Jt.x-ve} ${Jt.y-ve} ${me} ${Ge}`),X.setAttribute("width",String(me)),X.setAttribute("height",String(Ge)),Yt(X,me),await new Promise(ir=>requestAnimationFrame(()=>ir())),it!==D||wt!==E)return!1}return Fs(X),X.dataset.layoutGeneration=String(it),X.dataset.layoutSettled="true",!0}async function ht(it,dt,Ct){const Bt=++D;ft(F,Bt,!0),ft(B,0);const wt=R(it),X=z(wt);if(!X?.trim()){dt||ft(g,""),ft(m,null),ft(B,Bt,!0);return}try{const St=j(V(X)),At=/(?:^|\n)\s*(?:flowchart|graph)\s/i.test(St),Rt=g$(getComputedStyle(document.documentElement),At);Rt.suppressErrorRendering=!0;const qt=/^\s*stateDiagram(?:-v2)?\b/m.test(St),Ut=/^\s*erDiagram\b/m.test(St);if(Rt.layout=qt||Ut?"elk":"dagre",At&&(Rt.flowchart={...Rt.flowchart,curve:"basis",nodeSpacing:48,rankSpacing:64}),S($)&&(Rt.flowchart={...Rt.flowchart,nodeSpacing:48,padding:9,rankSpacing:48,wrappingWidth:S(P)&&/\bsubgraph\b/.test(St)?80:120},S(P)&&(Rt.sequence={...Rt.sequence,actorMargin:0,diagramMarginX:0,messageMargin:24,noteMargin:4,width:96,wrap:!0})),Rt.state={...Rt.state,wrappingWidth:Rt.flowchart?.wrappingWidth},await document.fonts?.load(`400 ${Rt.fontSize}px "${u$}"`),!Ct())return;const de=await p$(async()=>{th.initialize(Rt);const Dt=`mermaid-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,{svg:Ae}=await th.render(Dt,St);if(Bt!==D||!Ct())return;let Ue,Be;if(qt||At&&/class="[^"]*\bcluster\b/.test(Ae)){const ne=await th.mermaidAPI.getDiagramFromText(St);if(Bt!==D||!Ct())return;ne.type==="flowchart-v2"&&(Ue=b$(ne.db.getSubGraphs())),ne.type==="stateDiagram"&&(Be=P$(ne.db.getData()))}return{svg:Ae,clusterMembership:Ue,stateDiagram:Be}},()=>Bt===D&&Ct());if(!de||Bt!==D||!Ct())return;ft(g,de.svg,!0),ft(m,null),await G(Bt,St,de.clusterMembership,de.stateDiagram)&&Bt===D&&ft(B,Bt,!0)}catch(St){if(Bt!==D||!Ct())return;if(dt){ft(m,null),ft(B,Bt,!0);return}r.error("Failed to render mermaid diagram:",St),ft(m,St instanceof Error?St.message:Ye.markdown_mermaid_renderFailed_error(),!0),ft(g,""),ft(B,Bt,!0)}}const pt=r$((it,dt)=>ht(it.source,it.isStreaming,dt));function ut(it){it.stopPropagation(),it.preventDefault(),ft(k,it.currentTarget,!0),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),ft(C,S(M)?.querySelector(".mermaid-svg svg")?.outerHTML??S(g),!0),ft(x,!0)}function I(it){it.stopPropagation(),it.preventDefault(),f(!f())}function U(){ft(x,!1),ft(C,"")}function K(it){it.defaultPrevented||S(v)?.handleKeydown(it)}function ct(){T!==void 0&&cancelAnimationFrame(T),T=requestAnimationFrame(()=>{T=void 0;const it=S(L)?.querySelector("svg");it&&Fs(it)})}td(()=>{ft(y,!0);const it=S(M)?.closest(".node-mermaidBlock"),dt=it??S(M),Ct=()=>it?.clientWidth??S(M)?.clientWidth??0;let Bt,wt;const X=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>{const Rt=Ct();Rt!==Bt&&(Bt=Rt,ft($,Rt<=620),ft(P,S(P)?Rt<440:Rt<=420,!0));const qt=S(M)?.clientWidth;if(qt===wt)return;wt=qt;const Ut=S(M)?.querySelector(".mermaid-svg svg");Ut?.dataset.layoutSettled==="true"&&Fs(Ut)});dt&&X&&(Bt=Ct(),ft($,Bt<=620),ft(P,Bt<=420),X.observe(dt),S(M)&&S(M)!==dt&&X.observe(S(M)));let St=O();const At=new MutationObserver(()=>{const Rt=O();Rt!==St&&(St=Rt,ft(_,S(_)+1))});return At.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),()=>{At.disconnect(),X?.disconnect(),T!==void 0&&cancelAnimationFrame(T),pt.dispose(),D+=1}}),xo(()=>{const it={source:n(),isStreaming:l(),revision:`${S(_)}:${S($)}:${S(P)}`};S(y)&&S(M)&&il(()=>pt.update(it))});let yt=Et(()=>S(m)?"error":S(g)?"rendered":!n()?.trim()&&!l()?"empty":"pending");xo(()=>{p()?.(S(yt))});var vt={get code(){return n()},set code(it){n(it),Me()},get isStreaming(){return l()},set isStreaming(it=!1){l(it),Me()},get className(){return c()},set className(it=""){c(it),Me()},get showExpandButton(){return h()},set showExpandButton(it=!0){h(it),Me()},get showSourceButton(){return d()},set showSourceButton(it=!0){d(it),Me()},get showExportButton(){return u()},set showExportButton(it=!1){u(it),Me()},get showSource(){return f()},set showSource(it=!1){f(it),Me()},get onRenderStateChange(){return p()},set onRenderStateChange(it){p(it),Me()},$set:Bo,$on:(it,dt)=>Lo(t,it,dt)},ot=RE(),kt=Qr(ot);let Xt;var re=Ne(kt),Kt=Ne(re);W(Kt,{size:30,weight:"light"}),Fe(re),Ki(re,it=>ft(A,it),()=>S(A));var xe=qe(re,2);{var Ee=it=>{var dt=AE(),Ct=Ne(dt),Bt=Ne(Ct),wt=kr(Bt,!0),X=qe(Bt,2),St=kr(X,!0);Fe(Ct);var At=qe(Ct,2),Rt=Ne(At),qt=kr(Rt,!0),Ut=qe(Rt,2),de=kr(Ut,!0),Se=qe(Ut,2),Dt=kr(Se,!0),Ae=qe(Se,2),Ue=kr(Ae,!0);Fe(At),Fe(dt),ar((Be,ne,Ft,ie)=>{pr(wt,Be),pr(St,ne),pr(qt,Ft),pr(de,S(m)),pr(Dt,ie),pr(Ue,S(q))},[()=>Ye.markdown_mermaid_renderFailed_error(),()=>Ye.markdown_mermaid_invalid_description(),()=>Ye.markdown_mermaid_errorDetails_label(),()=>Ye.markdown_mermaid_viewSource_label()]),ge(it,dt)},ri=it=>{var dt=EE(),Ct=Qr(dt),Bt=Ne(Ct);let wt;var X=Ne(Bt);Ou(X,()=>S(g),!0),Fe(X),Fe(Bt);var St=qe(Bt,2);{var At=Ut=>{var de=FE();let Se;var Dt=Ne(de);{var Ae=ie=>{{let Pe=Et(()=>Ye.markdown_mermaid_viewSource_label()),ke=Et(()=>Ye.markdown_mermaid_viewSource_label());Na(ie,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button",onclick:I,get"aria-pressed"(){return f()},get"aria-label"(){return S(Pe)},get tooltip(){return S(ke)},children:(Ie,Ve)=>{Ks(Ie,{get icon(){return gC},size:"sm"})},$$slots:{default:!0}})}};ur(Dt,ie=>{d()&&ie(Ae)})}var Ue=qe(Dt,2);{var Be=ie=>{{let Pe=Et(()=>Ye.markdown_mermaid_expand_ariaLabel()),ke=Et(()=>Ye.markdown_mermaid_expand_tooltip());Na(ie,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button expand-button",onclick:ut,get"aria-label"(){return S(Pe)},get tooltip(){return S(ke)},children:(Ie,Ve)=>{Ks(Ie,{get icon(){return Dp},size:"sm"})},$$slots:{default:!0}})}};ur(Ue,ie=>{h()&&ie(Be)})}var ne=qe(Ue,2);{var Ft=ie=>{wu(ie,{get container(){return S(M)},compactTrigger:!0})};ur(ne,ie=>{u()&&ie(Ft)})}Fe(de),ar(ie=>{Se=Ji(de,1,"mermaid-actions svelte-9cn23y",null,Se,{"with-export":u()}),fe(de,"aria-label",ie)},[()=>Ye.markdown_mermaid_actions_ariaLabel()]),ge(Ut,de)};ur(St,Ut=>{(d()||h()||u())&&Ut(At)})}Fe(Ct);var Rt=qe(Ct,2);{var qt=Ut=>{var de=$E(),Se=Ne(de),Dt=kr(Se,!0);Fe(de),ar(Ae=>{fe(de,"aria-label",Ae),pr(Dt,S(q))},[()=>Ye.markdown_mermaid_viewSource_label()]),ge(Ut,de)};ur(Rt,Ut=>{f()&&Ut(qt)})}ar(()=>wt=Ji(Bt,1,"mermaid-svg-viewport svelte-9cn23y",null,wt,{"without-actions":!d()&&!h()&&!u()})),ge(it,dt)},lo=it=>{var dt=PE(),Ct=Ne(dt),Bt=kr(Ct,!0),wt=qe(Ct,2),X=kr(wt,!0);Fe(dt),ar((St,At)=>{pr(Bt,St),pr(X,At)},[()=>Ye.markdown_mermaid_noCode_label(),()=>Ye.markdown_mermaid_noCode_description()]),ge(it,dt)},co=Et(()=>!n()?.trim()&&!l()),xs=it=>{var dt=IE(),Ct=kr(dt,!0);ar(Bt=>pr(Ct,Bt),[()=>Ye.ui_spinner_loading_ariaLabel()]),ge(it,dt)};ur(xe,it=>{S(m)?it(Ee):S(g)?it(ri,1):S(co)?it(lo,2):it(xs,-1)})}Fe(kt),Ki(kt,it=>ft(M,it),()=>S(M));var bs=qe(kt,2);{let it=Et(()=>Ye.markdown_mermaid_fullscreenView_ariaLabel()),dt=Et(()=>Ye.markdown_mermaid_closeFullscreen_ariaLabel());IC(bs,{get ariaLabel(){return S(it)},get closeLabel(){return S(dt)},onClose:U,get openerElement(){return S(k)},onKeydown:K,get open(){return S(x)},set open(Ct){ft(x,Ct,!0)},children:(Ct,Bt)=>{var wt=DE(),X=Ne(wt);Ki(OC(X,{onScaleChange:ct,children:(St,At)=>{var Rt=OE();Ou(Rt,()=>S(C),!0),Fe(Rt),Ki(Rt,qt=>ft(L,qt),()=>S(L)),ge(St,Rt)},$$slots:{default:!0}}),St=>ft(v,St,!0),()=>S(v)),Fe(wt),ge(Ct,wt)},$$slots:{default:!0}})}return ar(it=>{Xt=Ji(kt,1,`mermaid-renderer ${c()??""}`,"svelte-9cn23y",Xt,{"has-diagram":it}),fe(kt,"data-render-generation",S(F)),fe(kt,"data-render-settled-generation",S(B)),fe(kt,"data-render-settled",S(F)>0&&S(B)===S(F))},[()=>!!S(g)]),ge(e,ot),Fo(vt)}const Di={labelFontSize:13,labelCharWidthRatio:.6,labelLineHeight:1.26,kindFontSize:11,kindCharWidthRatio:.88,kindLineHeight:1,paddingX:16,paddingY:12,gap:4,maxLines:3,maxWidth:250},Si=Object.freeze({fontSize:Di.kindFontSize,lineHeight:Di.labelLineHeight,paddingX:6,paddingY:4}),qE={architecture:{defaultNodeKinds:["service","db","queue","actor","ui_component"],defaultEdgeKinds:["request","response","event","data"],defaultLayout:{type:"layered",direction:"LR",spacing:30,edgeRouting:"orthogonal"},nodeDefaults:{width:80,height:40}},sequence:{defaultNodeKinds:["actor"],defaultEdgeKinds:["message","return"],defaultLayout:{type:"layered",direction:"TB",spacing:50,edgeRouting:"polyline"},nodeDefaults:{width:75,height:32}},state_machine:{defaultNodeKinds:["state","start","end"],defaultEdgeKinds:["transition"],defaultLayout:{type:"layered",direction:"LR",spacing:35,edgeRouting:"curved"},nodeDefaults:{width:75,height:38}},data_flow:{defaultNodeKinds:["process","data_store","external"],defaultEdgeKinds:["flow"],defaultLayout:{type:"layered",direction:"LR",spacing:30,edgeRouting:"polyline"},nodeDefaults:{width:80,height:40}},network:{defaultNodeKinds:["node","router","switch","server"],defaultEdgeKinds:["connection"],defaultLayout:{type:"force",spacing:60,edgeRouting:"polyline"},nodeDefaults:{width:60,height:60}},flowchart:{defaultNodeKinds:["process","decision","start","end","data"],defaultEdgeKinds:["flow"],defaultLayout:{type:"layered",direction:"TB",spacing:50,edgeRouting:"orthogonal"},nodeDefaults:{width:80,height:40}},timeline:{defaultNodeKinds:["event","milestone"],defaultEdgeKinds:["sequence"],defaultLayout:{type:"layered",direction:"LR",spacing:60,edgeRouting:"polyline"},nodeDefaults:{width:75,height:38}},dependency_graph:{defaultNodeKinds:["module","package","file"],defaultEdgeKinds:["depends_on","imports"],defaultLayout:{type:"layered",direction:"TB",spacing:40,edgeRouting:"polyline"},nodeDefaults:{width:75,height:38}}},WE=1.78,zE=900,HE=30,YE=300,Wo=6,XE=112,Sp=32,GE=Si.fontSize*Di.labelCharWidthRatio,Ra=Si.paddingX*2,jE=Si.paddingY*2,ah=0,UE=Si.fontSize*Si.lineHeight,VE=14,ZE=8,KE=32,Kh=500,QE=.84,No=16,ha=Object.freeze({centerY:24,headerHeight:68,horizontalPadding:24});function sn(e,t=Number.POSITIVE_INFINITY){if(e.length>=48)return 100;const r=Kr(e,60);return r.lines>=3&&t<r.height+16?80:60}let oa,sh;function da(e,t){return typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Dl(e,t,r,i,o=0,a=da("--font-ui","Inter, system-ui, sans-serif")){return oa===void 0&&(oa=typeof document<"u"&&typeof CanvasRenderingContext2D<"u"?document.createElement("canvas").getContext("2d"):null),oa?(oa.font=`${r} ${t}px ${a}`,oa.measureText(e).width+Math.max(0,e.length-1)*o):e.length*i}function Lu(e){const t=Si.fontSize,r=da("--text-caption-weight","500"),i=da("--text-caption-tracking","-0.01em"),o=Number.parseFloat(i),a=Number.isFinite(o)?i.endsWith("em")?o*t:o:t*-.01,s=Math.max(...e.split(`
330
+ `).map(n=>Dl(n,t,r,t*.5,a)));return Math.ceil(s)+ha.horizontalPadding*2}function Qh(e){const t=Lu(e.label)-ha.horizontalPadding*2,r=Si.fontSize;return{left:e.x+(e.width-t)/2-Wo,right:e.x+(e.width+t)/2+Wo,top:e.y+ha.centerY-r,bottom:e.y+ha.centerY+r}}function Kr(e,t=XE){const r=Si.fontSize,i=da("--text-body-weight","400"),o=da("--text-caption-tracking","-0.01em"),a=Number.parseFloat(o),s=Number.isFinite(a)?o.endsWith("em")?a*r:a:-.01*r;sh===void 0&&(sh=typeof document<"u"&&typeof CanvasRenderingContext2D<"u"?document.createElement("canvas").getContext("2d"):null);const n=sh;n&&(n.font=`${i} ${r}px ${da("--font-ui","Inter, system-ui, sans-serif")}`,n.letterSpacing=`${s}px`);const l=m=>n?.measureText(m).width??Dl(m,r,i,GE,s),c=e.split(`
331
+ `),h=Math.max(...c.map(l))+Ra+ah,d=Math.max(...e.split(/\s+/).map(l),Sp-Ra)+Ra+ah,u=Math.max(t,d),f=Math.ceil(Math.max(Sp,Math.min(h,u))),p=f-Ra-ah,g=c.reduce((m,y)=>{const x=y.trim().split(/\s+/).filter(Boolean);if(!x.length)return m+1;let C=1,k="";for(const v of x){const M=l(v);if(M>p){k&&(C+=1),C+=Math.max(1,Math.ceil(M/p))-1,k="";continue}const A=k?`${k} ${v}`:v;k&&l(A)>p?(C+=1,k=v):k=A}return m+C},0);return{width:f,height:Math.min(g,3)*UE+jE,lines:g}}function nh(e){return Kr(e).width}function nn(e,t=Wo){if(e.length===0)return"";const r=[`M ${e[0].x} ${e[0].y}`];for(let o=1;o<e.length-1;o+=1){const a=e[o-1],s=e[o],n=e[o+1],l=Math.hypot(s.x-a.x,s.y-a.y),c=Math.hypot(n.x-s.x,n.y-s.y),h=(s.x-a.x)*(n.y-s.y)-(s.y-a.y)*(n.x-s.x),d=Math.min(t,l/2,c/2);if(d<=0||Math.abs(h)<.001){r.push(`L ${s.x} ${s.y}`);continue}const u={x:s.x-(s.x-a.x)/l*d,y:s.y-(s.y-a.y)/l*d},f={x:s.x+(n.x-s.x)/c*d,y:s.y+(n.y-s.y)/c*d};r.push(`L ${u.x} ${u.y}`,`Q ${s.x} ${s.y} ${f.x} ${f.y}`)}const i=e[e.length-1];return r.push(`L ${i.x} ${i.y}`),r.join(" ")}function us(e,t=80){return Math.max(HE,Math.min(YE,e??t))}function JE(e,t,r,i=Di,o=zE){const a=new Set(e.nodes.map(p=>p.id)),s={...e,edges:e.edges.filter(p=>a.has(p.from)&&a.has(p.to))},n=qE[r],l=n?.nodeDefaults||{width:100,height:60},c=s.nodes.map(p=>({...p,size:p.size||E1(p,l,i)})),h={...n?.defaultLayout,...t.layout,edgeRouting:t.layout.edgeRouting||t.edgeRouting||n?.defaultLayout?.edgeRouting},d=t.layout.direction;if(!d&&["layered","tree"].includes(h.type)){const p={...h,direction:"LR"},g={...h,direction:"TB"},m=lh(c,s,p,l),y=lh(c,s,g,l),x=t4(m,y,o),C=x===m?p:g;return o<Kh||x.bounds.width>o?Tp(x,o,us(h.spacing,80),C,l,i):x}const u=lh(c,s,h,l);return d==="LR"||d==="RL"?u:o<Kh||!s.groups?.length&&(u.bounds.width>o||u.bounds.height>0&&u.bounds.width/u.bounds.height>WE)?Tp(u,o,us(h.spacing,80),h,l,i):u}function t4(e,t,r){if(r<Kh)return t;const i=vp(e,r),o=vp(t,r);return i.unreadable!==o.unreadable?i.unreadable?t:e:i.collisions!==o.collisions?i.collisions<o.collisions?e:t:i.overlaps!==o.overlaps?i.overlaps<o.overlaps?e:t:i.crossings>o.crossings+1||i.overflow>o.overflow+.1?t:e}function vp(e,t){const r=e.edges.flatMap(n=>$1(n.points??[]));let i=0,o=0,a=0;for(let n=0;n<r.length;n+=1){for(let l=n+1;l<r.length;l+=1){const c=e4(r[n],r[l]);c==="crossing"&&(i+=1),c==="overlap"&&(o+=1)}a+=e.nodes.filter(l=>r4(r[n],l)).length}const s=Math.min(1,t/Math.max(e.bounds.width,1));return{crossings:i,overlaps:o,collisions:a,unreadable:s<QE,overflow:Math.max(0,e.bounds.width/Math.max(t,1)-1)}}function $1(e){return e.slice(1).flatMap((t,r)=>{const i=e[r],o=Math.abs(i.y-t.y)<.001,a=Math.abs(i.x-t.x)<.001;return o||a?[{start:i,end:t,horizontal:o}]:[]})}function e4(e,t){const r=(c,h)=>[Math.min(c,h),Math.max(c,h)];if(e.horizontal===t.horizontal){const c=e.horizontal?e.start.y:e.start.x,h=t.horizontal?t.start.y:t.start.x;if(Math.abs(c-h)>=.001)return"none";const[d,u]=e.horizontal?r(e.start.x,e.end.x):r(e.start.y,e.end.y),[f,p]=t.horizontal?r(t.start.x,t.end.x):r(t.start.y,t.end.y);return Math.min(u,p)-Math.max(d,f)>.5?"overlap":"none"}const i=e.horizontal?e:t,o=e.horizontal?t:e,[a,s]=r(i.start.x,i.end.x),[n,l]=r(o.start.y,o.end.y);return o.start.x>a+.5&&o.start.x<s-.5&&i.start.y>n+.5&&i.start.y<l-.5?"crossing":"none"}function r4(e,t){if(e.horizontal){const o=Math.min(e.start.x,e.end.x),a=Math.max(e.start.x,e.end.x);return e.start.y>t.y+.5&&e.start.y<t.y+t.height-.5&&a>t.x+.5&&o<t.x+t.width-.5}const r=Math.min(e.start.y,e.end.y),i=Math.max(e.start.y,e.end.y);return e.start.x>t.x+.5&&e.start.x<t.x+t.width-.5&&i>t.y+.5&&r<t.y+t.height-.5}function Tp(e,t,r,i,o,a){const s=e.edges.some(x=>!!x.label)||e.nodes.some(x=>x.width>t),n=i.type==="manual"&&e.bounds.width>t;if(t<500&&s||n){const x=Math.max(150,Math.min(260,t)),C=e.nodes.map(_=>{const $=Math.min(_.width,x),P=E1(_,o,a,$).height;return{..._,width:$,height:_.size?Math.max(_.size.height,P):P}}),k=Math.max(...C.map(_=>_.width)),v=new Map;for(const _ of e.edges)_.label&&v.set(_.from,(v.get(_.from)??0)+1);let M=0;const A=C.map(_=>{const $={..._,x:(k-_.width)/2,y:M},P=v.get(_.id)??0;return M+=_.height+Math.max(140,P*62+60,r*.65),$}),L=e.groups?Mp(e.groups,A):void 0,T=f4(e.edges,A,L);return{nodes:A,groups:L,edges:T,bounds:_p(A,L,T)}}if(e.bounds.width<=t)return e;const l=[...e.nodes],c=Math.max(...l.map(x=>x.height))+r,h=[...l].sort((x,C)=>x.x-C.x),d=new Map;let u=0,f=0;h.forEach(x=>{const C=x.x-e.bounds.minX-f;C+x.width>t&&C>0&&(f=x.x-e.bounds.minX,u+=c+r),d.set(x.id,{dx:-f,dy:u})});const p=l.map(x=>{const C=d.get(x.id)||{dx:0,dy:0};return{...x,x:x.x+C.dx,y:x.y+C.dy}}),g=e.groups?Mp(e.groups,p):void 0,m=I1(e.edges,p,i,g),y=_p(p,g,m);return{nodes:p,edges:m,groups:g,bounds:y}}function Mp(e,t){return e.map(r=>{const i=new Set(r.nodeIds??[]),o=t.filter(p=>p.group===r.id||i.has(p.id));if(o.length===0)return r;const a=30,s=ha.headerHeight,n=30,l=Math.min(...o.map(p=>p.x)),c=Math.max(...o.map(p=>p.x+p.width)),h=Math.max(c-l+a*2,Lu(r.label)),d=(l+c-h)/2,u=Math.min(...o.map(p=>p.y))-s,f=Math.max(...o.map(p=>p.y+p.height))+n;return{...r,x:d,y:u,width:h,height:f-u}})}function _p(e,t,r){if(e.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let i=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y)),a=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));if(t&&t.length>0&&(i=Math.min(i,...t.map(n=>n.x)),o=Math.min(o,...t.map(n=>n.y)),a=Math.max(a,...t.map(n=>n.x+n.width)),s=Math.max(s,...t.map(n=>n.y+n.height))),r&&r.length>0){for(const n of r)if(n.points)for(const l of n.points)i=Math.min(i,l.x),o=Math.min(o,l.y),a=Math.max(a,l.x),s=Math.max(s,l.y)}return{minX:i,minY:o,maxX:a,maxY:s,width:a-i,height:s-o}}function lh(e,t,r,i){const o=i4(e,t.edges,r,i,t.groups);if((r.type==="layered"||r.type==="tree")&&r.direction==="RL"){const c=Math.min(...o.map(({x:d})=>d)),h=Math.max(...o.map(({x:d,width:u})=>d+u));for(const d of o)d.x=c+h-d.x-d.width}if((r.type==="layered"||r.type==="tree")&&r.direction==="BT"){const c=Math.min(...o.map(({y:d})=>d)),h=Math.max(...o.map(({y:d,height:u})=>d+u));for(const d of o)d.y=c+h-d.y-d.height}const a=t.groups?m4(t.groups,o):void 0,s=c4(t.edges,o,r,a),n=new Map;for(const c of s){const h=c.id,d=n.get(h)??0;d>0&&(c.id=`${h}-${d}`),n.set(h,d+1)}const l=y4(o,a,s);return{nodes:o,edges:s,groups:a,bounds:l}}function E1(e,t,r,i=r.maxWidth){const o=r===Di,a=["db","store","data_store"].includes(e.kind??""),s=(o?10:r.paddingX)+(a?8:0),n=o?7:r.paddingY,l=o?2:r.gap,c=o?11:r.kindFontSize,h=VE+ZE,d=0,u=Math.min(r.maxWidth,i),f=/[^\x00-\x7f]/.test(e.label)?10:8,p=.6,g=r.labelFontSize*(o?p:r.labelCharWidthRatio),m=c*(o?p:r.kindCharWidthRatio),y=e.label.split(/\r\n?|\n/),C=cp(e.label).length<=2&&e.label.length<=20,k="600",v=da("--font-editorial","Georgia, Times New Roman, serif"),M=rt=>Dl(rt,r.labelFontSize,k,g,-.01*r.labelFontSize,v)+(oa?(rt.length-Vh(rt).length)*.01*r.labelFontSize:0),A=rt=>Dl(rt,c,"500",m,.015*c)-(oa?(rt.length-Vh(rt).length)*.015*c:0),L=y.map(M),T=Math.max(...L),_=Math.max(...y$(e.label).map(M),0),$=_>u,P=Math.max(1,u-s*2-h-d-f,$?0:_);let D,F=1;if(C&&!$)D=T,F=y.length;else{const rt=Math.min(T,P),et=Math.min(P,Math.max(rt,_));D=et,F=y.reduce((at,xt)=>{const H=ku(xt);if(_>P||/[^\x00-\x7f]/.test(xt))return at+hp(H??sc(xt).map(({text:st})=>st),et,M,H!==null);const Y=H??cp(xt);if(!Y.length)return at+1;let Z=1,tt="";for(const st of Y){const It=M(st);if(It>et+.5){tt&&(Z+=1),Z+=Math.max(1,Math.ceil((It-.5)/et))-1,tt="";continue}const zt=tt?`${tt}${H?"":" "}${st}`:st;tt&&M(zt)>et+.5?(Z+=1,tt=st):tt=zt}return at+Z},0)}const E=r.labelFontSize*r.labelLineHeight*F;let B=0,q=0;if(e.kind){const rt=e.kind.split(`
332
+ `);B=Math.min(P,Math.max(...rt.map(A))),q=c*r.kindLineHeight*rt.reduce((et,J)=>et+hp(J.match(/\S+[\t ]*|[\t ]+/g)??[],P,A),0)}const W=e.kind?1:0,O=Math.max(D+f,B+W)+h,R=E+(e.kind?l+q:0),V=Math.max(C?72:t.width*.6,a?112:0),j=h+s*2+d,z=Math.max(Math.min(Math.max(O+s*2+d,V),u),Math.min(_,P)+j+f),Q=Math.max(R+n*2+d,KE,a?90:0);return{width:z,height:Q}}function i4(e,t,r,i,o){if(e.some(s=>s.position)||r.type==="manual"){const s=[],n=[];for(const u of e){const f=u.size?.width??i.width,p=u.size?.height??i.height;if(u.position){const g={...u,x:u.position.x,y:u.position.y,width:f,height:p};n.push(g),s.push(g)}else n.push({...u,x:0,y:0,width:f,height:p})}const l=us(r.spacing,80);for(let u=0;u<n.length;u++){if(e[u].position)continue;const p=n[u].width,g=n[u].height;let m=0,y=0,x=!1;for(let C=0;C<20&&!x;C++)for(let k=0;k<20&&!x;k++){const v=k*(p+l),M=C*(g+l);s.some(L=>!(v+p+l*.3<L.x||v>L.x+L.width+l*.3||M+g+l*.3<L.y||M>L.y+L.height+l*.3))||(m=v,y=M,x=!0)}n[u]={...n[u],x:m,y},s.push({x:m,y,width:p,height:g})}const c=new Map;for(const u of n){const f=e.find(({id:m})=>m===u.id)?.position;if(!f)continue;const p=[...c.keys()].find(m=>Math.abs(m-f.x)<=8),g=c.get(p??f.x)??[];g.push(u),c.set(p??f.x,g)}const h=Math.min(...n.map(u=>u.x)),d=new Set;for(const[u,f]of c){if(f.length<2)continue;const p=Math.max(...f.map(m=>m.width)),g=h+(u+p/2-h)*.89;for(const m of f)m.x=g-m.width/2,d.add(m.id)}for(const u of n)d.has(u.id)||(u.x=h+(u.x-h)*.89);return n}switch(r.type){case"layered":return Bp(e,t,r,i,o);case"force":return s4(e,t,r,i,o);case"circular":return n4(e,r,i);case"tree":return l4(e,t,r,i);default:return Bp(e,t,r,i,o)}}function Bp(e,t,r,i,o){const a=us(r.spacing,80),s=r.direction??"LR",n=s==="LR"||s==="RL",l=new Map;o&&(o.forEach(u=>{Array.isArray(u.nodeIds)&&u.nodeIds.forEach(f=>l.set(f,u.id))}),e.forEach(u=>{u.group&&l.set(u.id,u.group)}));const c=new Map,h=new Map;e.forEach(u=>{c.set(u.id,[]),h.set(u.id,[])}),t.forEach(u=>{c.get(u.from)?.push(u.to),h.get(u.to)?.push(u.from)});const d=new Map;return e.forEach(u=>{d.set(u.id,{width:u.size?.width??i.width,height:u.size?.height??i.height})}),o&&o.length>0?o4(e,t,o,d,l,c,h,a,n):a4(e,t,d,a,n)}function o4(e,t,r,i,o,a,s,n,l){const c="__ungrouped__",d=n<=40,u=Math.max(d?35:48,n*.75),f=Math.max(20,n*.32),p=new Map;r.forEach(F=>p.set(F.id,[])),p.set(c,[]),e.forEach(F=>{const E=o.get(F.id)||c;let B=p.get(E);B||(B=[],p.set(E,B)),B.push(F.id)});const g=new Map,m=new Map,y=[...r.map(F=>F.id),c];y.forEach(F=>{g.set(F,new Set),m.set(F,new Set)}),t.forEach(F=>{const E=o.get(F.from)||c,B=o.get(F.to)||c;E!==B&&(g.get(E)?.add(B),m.get(B)?.add(E))});const x=new Map,C=new Set;function k(F){const E=x.get(F);if(E!==void 0)return E;if(C.has(F))return 0;C.add(F);const B=y.indexOf(F),q=[...m.get(F)||new Set].filter(R=>!(g.get(F)?.has(R)??!1)||y.indexOf(R)<B);let W=-1;q.forEach(R=>{W=Math.max(W,k(R))});const O=W+1;return x.set(F,O),O}y.forEach(F=>{(p.get(F)?.length??0)>0&&k(F)});const v=Math.max(...Array.from(x.values()),0),M=Array.from({length:v+1},()=>[]);x.forEach((F,E)=>{(p.get(E)?.length??0)>0&&M[F].push(E)});const A=new Map,L=new Map,T=new Map,_=new Map;e.forEach(F=>{T.set(F.id,[]),_.set(F.id,[])}),t.forEach(F=>{const E=o.get(F.from)||c,B=o.get(F.to)||c;E===B&&(T.get(F.from)?.push(F.to),_.get(F.to)?.push(F.from))}),y.forEach(F=>{const E=p.get(F)||[];if(E.length===0){L.set(F,{width:0,height:0}),A.set(F,{layers:[],nodeLayer:new Map,layerSpacing:[]});return}const B=new Set(E),q=new Map,W=new Set;function O(J){const at=q.get(J);if(at!==void 0)return at;if(W.has(J))return 0;W.add(J);const xt=(_.get(J)||[]).filter(Z=>B.has(Z));let H=-1;xt.forEach(Z=>{H=Math.max(H,O(Z))});const Y=H+1;return q.set(J,Y),Y}E.forEach(J=>O(J));const R=Math.max(...Array.from(q.values()),0),V=Array.from({length:R+1},()=>[]);q.forEach((J,at)=>{B.has(at)&&V[J].push(at)});for(let J=0;J<4;J++){for(let at=1;at<V.length;at++){const xt=V[at],H=V[at-1],Y=new Map;xt.forEach(Z=>{const st=(_.get(Z)||[]).filter(It=>B.has(It)).map(It=>H.indexOf(It)).filter(It=>It!==-1);st.length>0?Y.set(Z,st.reduce((It,zt)=>It+zt,0)/st.length):Y.set(Z,xt.indexOf(Z))}),xt.sort((Z,tt)=>(Y.get(Z)??0)-(Y.get(tt)??0))}for(let at=V.length-2;at>=0;at--){const xt=V[at],H=V[at+1],Y=new Map;xt.forEach(Z=>{const st=(T.get(Z)||[]).filter(It=>B.has(It)).map(It=>H.indexOf(It)).filter(It=>It!==-1);st.length>0?Y.set(Z,st.reduce((It,zt)=>It+zt,0)/st.length):Y.set(Z,xt.indexOf(Z))}),xt.sort((Z,tt)=>(Y.get(Z)??0)-(Y.get(tt)??0))}}const j=V.slice(0,-1).map((J,at)=>{const xt=t.reduce((H,Y)=>{if(!Y.label||o.get(Y.from)!==F||o.get(Y.to)!==F||q.get(Y.from)!==at||q.get(Y.to)!==at+1)return H;const Z=Kr(Y.label);return Math.max(H,(l?Z.width:Z.height)+(d?18:24))},0);return Math.max(n*.5,xt)});A.set(F,{layers:V,nodeLayer:q,layerSpacing:j});let z=0,Q=0;V.forEach((J,at)=>{let xt=0,H=0;J.forEach(Y=>{const Z=i.get(Y);Z&&(l?(H+=Z.height+f,xt=Math.max(xt,Z.width)):(H+=Z.width+f,xt=Math.max(xt,Z.height)))}),H-=f,Q=Math.max(Q,H),z+=xt,at>0&&(z+=j[at-1]??n*.5)});const rt=l?z+64:Q+64,et=l?Q+64:z+64;L.set(F,{width:rt,height:et})});for(let F=0;F<4;F++){for(let E=1;E<M.length;E++){const B=M[E],q=M[E-1],W=new Map;B.forEach(O=>{const V=Array.from(m.get(O)||[]).map(j=>q.indexOf(j)).filter(j=>j!==-1);V.length>0?W.set(O,V.reduce((j,z)=>j+z,0)/V.length):W.set(O,B.indexOf(O))}),B.sort((O,R)=>(W.get(O)??0)-(W.get(R)??0))}for(let E=M.length-2;E>=0;E--){const B=M[E],q=M[E+1],W=new Map;B.forEach(O=>{const V=Array.from(g.get(O)||[]).map(j=>q.indexOf(j)).filter(j=>j!==-1);V.length>0?W.set(O,V.reduce((j,z)=>j+z,0)/V.length):W.set(O,B.indexOf(O))}),B.sort((O,R)=>(W.get(O)??0)-(W.get(R)??0))}}const $=new Map;let P=0;if(M.forEach(F=>{let E=0,B=0;F.forEach(q=>{const W=L.get(q);W&&(l?($.set(q,{x:P,y:E}),E+=W.height+u,B=Math.max(B,W.width)):($.set(q,{x:E,y:P}),E+=W.width+u,B=Math.max(B,W.height)))}),P+=B+u}),!l){const F=[];for(const[E,B]of $){const q=F.find(W=>Math.abs(W.x-B.x)<.5);q?q.groupIds.push(E):F.push({x:B.x,groupIds:[E]})}for(const E of F){const B=Math.max(...E.groupIds.map(q=>L.get(q)?.width??0));for(const q of E.groupIds){const W=$.get(q),O=L.get(q)?.width;!W||O===void 0||$.set(q,{...W,x:W.x+(B-O)/2})}}}const D=[];return y.forEach(F=>{const E=p.get(F)||[],B=$.get(F),q=A.get(F);if(!B||E.length===0||!q)return;const{layers:W,layerSpacing:O}=q;let R=32;W.forEach((V,j)=>{let z=0;V.forEach(at=>{const xt=i.get(at);xt&&(z+=(l?xt.height:xt.width)+f)}),z-=f;const Q=L.get(F);if(!Q)return;let et=32+((l?Q.height:Q.width)-64-z)/2,J=0;V.forEach(at=>{const xt=e.find(tt=>tt.id===at),H=i.get(at);if(!xt||!H)return;let Y,Z;l?(Y=B.x+R,Z=B.y+et,et+=H.height+f,J=Math.max(J,H.width)):(Y=B.x+et,Z=B.y+R,et+=H.width+f,J=Math.max(J,H.height)),D.push({...xt,x:Y,y:Z,width:H.width,height:H.height})}),R+=J+(O[j]??n*.5)})}),D}function a4(e,t,r,i,o){const a=new Map(e.map((k,v)=>[k.id,v])),s=new Set,n=new Map;for(const k of t){const v=n.get(k.from)??[];v.push(k),n.set(k.from,v)}const l=(k,v,M)=>{const A=[k],L=new Set;for(;A.length;){const T=A.pop();if(T){if(T===v)return!0;if(!L.has(T)){L.add(T);for(const _ of n.get(T)??[])_.id!==M&&A.push(_.to)}}}return!1};for(const k of t){const v=a.get(k.from)??0,M=a.get(k.to)??0;v>M&&l(k.to,k.from,k.id)&&s.add(k.id)}const c=new Map,h=new Map;for(const k of t)s.has(k.id)||(c.set(k.to,[...c.get(k.to)??[],k.from]),h.set(k.from,[...h.get(k.from)??[],k.to]));const d=new Map,u=new Set;function f(k){const v=d.get(k);if(v!==void 0)return v;if(u.has(k))return 0;u.add(k);const M=c.get(k)||[];let A=-1;M.forEach(T=>{A=Math.max(A,f(T))});const L=A+1;return d.set(k,L),L}e.forEach(k=>f(k.id));const p=Math.max(...Array.from(d.values()),0),g=Array.from({length:p+1},()=>[]);d.forEach((k,v)=>{g[k].push(v)});for(let k=0;k<4;k++){for(let v=1;v<g.length;v++){const M=g[v],A=g[v-1],L=new Map;M.forEach(T=>{const $=(c.get(T)||[]).map(P=>A.indexOf(P)).filter(P=>P!==-1);$.length>0?L.set(T,$.reduce((P,D)=>P+D,0)/$.length):L.set(T,M.indexOf(T))}),M.sort((T,_)=>(L.get(T)??0)-(L.get(_)??0))}for(let v=g.length-2;v>=0;v--){const M=g[v],A=g[v+1],L=new Map;M.forEach(T=>{const $=(h.get(T)||[]).map(P=>A.indexOf(P)).filter(P=>P!==-1);$.length>0?L.set(T,$.reduce((P,D)=>P+D,0)/$.length):L.set(T,M.indexOf(T))}),M.sort((T,_)=>(L.get(T)??0)-(L.get(_)??0))}}const m=[],y=i*.4,x=g.slice(0,-1).map((k,v)=>{const M=t.reduce((A,L)=>{const T=d.get(L.from),_=d.get(L.to);if(!L.label||s.has(L.id)||T!==v||_!==v+1)return A;const $=Kr(L.label);return Math.max(A,(o?$.width:$.height)+36)},0);return Math.max(i*.65,M)});let C=0;return g.forEach((k,v)=>{let M=0,A=0;A=-k.reduce((T,_)=>{const $=r.get(_);return $?T+(o?$.height:$.width)+y:T},-y)/2,k.forEach(T=>{const _=e.find(F=>F.id===T),$=r.get(T);if(!_||!$)return;let P,D;o?(P=C,D=A,A+=$.height+y,M=Math.max(M,$.width)):(P=A,D=C,A+=$.width+y,M=Math.max(M,$.height)),m.push({..._,x:P,y:D,width:$.width,height:$.height})}),C+=M+(x[v]??i*.8)}),m}function s4(e,t,r,i,o){const a=us(r.spacing,100),s=r.direction??"LR",n=s==="LR"||s==="RL",l=150,c=a*a*8,h=.04,d=1.5,u=.7,f=new Map;o&&(o.forEach(E=>{Array.isArray(E.nodeIds)&&E.nodeIds.forEach(B=>{f.set(B,E.id)})}),e.forEach(E=>{E.group&&f.set(E.id,E.group)}));const p=new Map,g=new Map;e.forEach(E=>{p.set(E.id,[]),g.set(E.id,[])}),t.forEach(E=>{p.get(E.from)?.push(E.to),g.get(E.to)?.push(E.from)});const m=new Map,y=new Set,x=e.filter(E=>(g.get(E.id)?.length??0)===0),k=(x.length>0?x:[e[0]]).map(E=>({id:E.id,depth:0}));let v=0;for(;k.length>0;){const E=k.shift();if(!E)break;const{id:B,depth:q}=E;if(y.has(B))continue;y.add(B),m.set(B,q),v=Math.max(v,q),(p.get(B)??[]).forEach(O=>{y.has(O)||k.push({id:O,depth:q+1})})}e.forEach(E=>{m.has(E.id)||m.set(E.id,0)});const M=new Map;m.forEach(E=>{M.set(E,(M.get(E)??0)+1)});const A=new Map,L=new Map;if(o&&o.length>0){const E=o.length;let B,q;n?(B=E,q=1):(B=1,q=E);const W=a*.8;o.forEach((O,R)=>{const V=R%B,j=Math.floor(R/B),z=(V-(B-1)/2)*W,Q=(j-(q-1)/2)*W;L.set(O.id,{x:n?z:Q,y:n?Q:z,vx:0,vy:0})})}const T=e.map(E=>{const B=m.get(E.id)??0,q=M.get(B)??1,W=A.get(B)??0;A.set(B,W+1);const O=n?2:1.5,R=n?1:1.2,V=B/Math.max(v,1)*a*O;let j=(W-q/2)/Math.max(q,1)*a*R;const z=f.get(E.id),Q=z?L.get(z):void 0;Q&&(n?j=Q.y+j*.2:j=Q.x+j*.2);const rt=E.id.split("").reduce((at,xt)=>at+xt.charCodeAt(0),0),et=(rt%100/100-.5)*a*.1,J=(rt*7%100/100-.5)*a*.1;return{node:E,x:(n?V:j)+et,y:(n?j:V)+J,vx:0,vy:0,width:E.size?.width??i.width,height:E.size?.height??i.height}}),_=E=>T.find(B=>B.node.id===E);for(let E=0;E<l;E++){T.forEach(B=>{B.vx=0,B.vy=0});for(let B=0;B<T.length;B++)for(let q=B+1;q<T.length;q++){const W=T[q].x-T[B].x,O=T[q].y-T[B].y,R=W*W+O*O+.01,V=Math.sqrt(R),j=(T[B].width+T[q].width)/2+a*.25,z=(T[B].height+T[q].height)/2+a*.25,Q=Math.sqrt(j*j+z*z),rt=V<Q?c*3/R:c*1/R;let et=W/V*rt,J=O/V*rt;n?(et*=1.5,J*=.6):(et*=.6,J*=1.5),T[B].vx-=et,T[B].vy-=J,T[q].vx+=et,T[q].vy+=J}t.forEach(B=>{const q=_(B.from),W=_(B.to);if(!q||!W)return;const O=W.x-q.x,R=W.y-q.y,V=Math.sqrt(O*O+R*R+.01),j=h*V,z=O/V*j,Q=R/V*j;q.vx+=z,q.vy+=Q,W.vx-=z,W.vy-=Q}),T.forEach(B=>{t.forEach(q=>{if(q.from===B.node.id||q.to===B.node.id)return;const W=_(q.from),O=_(q.to);if(!W||!O)return;const R=O.x-W.x,V=O.y-W.y,j=R*R+V*V;if(j<.01)return;const z=Math.max(0,Math.min(1,((B.x-W.x)*R+(B.y-W.y)*V)/j));if(z<.1||z>.9)return;const Q=W.x+z*R,rt=W.y+z*V,et=B.x-Q,J=B.y-rt,at=et*et+J*J+.01,xt=Math.sqrt(at),Y=Math.max(B.width,B.height)/2+a*.1;if(xt<Y){const Z=xt/Y,tt=d*(1-Z)*(1-Z)*a;B.vx+=et/xt*tt,B.vy+=J/xt*tt}})});for(let B=0;B<t.length;B++)for(let q=B+1;q<t.length;q++){const W=t[B],O=t[q];if(W.from===O.from||W.from===O.to||W.to===O.from||W.to===O.to)continue;const R=_(W.from),V=_(W.to),j=_(O.from),z=_(O.to);if(!R||!V||!j||!z)continue;const Q=(V.x-R.x)*(z.y-j.y)-(V.y-R.y)*(z.x-j.x);if(Math.abs(Q)<.01)continue;const rt=((j.x-R.x)*(z.y-j.y)-(j.y-R.y)*(z.x-j.x))/Q,et=((j.x-R.x)*(V.y-R.y)-(j.y-R.y)*(V.x-R.x))/Q;if(rt>.1&&rt<.9&&et>.1&&et<.9){const J=d*a*.15,at=z.x-j.x,xt=z.y-j.y,H=Math.sqrt(at*at+xt*xt),Y=-xt/H,Z=at/H,st=(z.x-j.x)*(R.y-j.y)-(z.y-j.y)*(R.x-j.x)>0?1:-1;R.vx+=Y*J*st,R.vy+=Z*J*st,V.vx+=Y*J*st,V.vy+=Z*J*st,j.vx-=Y*J*st,j.vy-=Z*J*st,z.vx-=Y*J*st,z.vy-=Z*J*st}}if(o&&o.length>0&&L.size>0){L.forEach(R=>{R.vx=0,R.vy=0});const B=a*a*5,q=Array.from(L.entries());for(let R=0;R<q.length;R++)for(let V=R+1;V<q.length;V++){const[,j]=q[R],[,z]=q[V],Q=z.x-j.x,rt=z.y-j.y,et=Q*Q+rt*rt+.01,J=Math.sqrt(et),at=B/et,xt=Q/J*at,H=rt/J*at;j.vx-=xt,j.vy-=H,z.vx+=xt,z.vy+=H}const W=.05;T.forEach(R=>{const V=f.get(R.node.id),j=V?L.get(V):void 0;if(j){const z=j.x-R.x,Q=j.y-R.y;R.vx+=z*W,R.vy+=Q*W,j.vx-=z*W*.1,j.vy-=Q*W*.1}});const O=a*2;for(let R=0;R<T.length;R++)for(let V=R+1;V<T.length;V++){const j=f.get(T[R].node.id),z=f.get(T[V].node.id);if(j&&z&&j!==z||(j&&!z||!j&&z)){const et=T[V].x-T[R].x,J=T[V].y-T[R].y,at=Math.sqrt(et*et+J*J+.01),xt=O/(at*1+a*.5),H=et/at*xt,Y=J/at*xt;T[R].vx-=H,T[R].vy-=Y,T[V].vx+=H,T[V].vy+=Y}}L.forEach(R=>{R.x+=R.vx*u,R.y+=R.vy*u})}T.forEach(B=>{B.x+=B.vx*u,B.y+=B.vy*u})}for(let E=0;E<10;E++){let B=!1;for(let q=0;q<T.length;q++)for(let W=q+1;W<T.length;W++){const O=(T[q].width+T[W].width)/2+a*.15-Math.abs(T[W].x-T[q].x),R=(T[q].height+T[W].height)/2+a*.15-Math.abs(T[W].y-T[q].y);if(O>0&&R>0)if(B=!0,O<R){const V=O/2+1;T[W].x>=T[q].x?(T[q].x-=V,T[W].x+=V):(T[q].x+=V,T[W].x-=V)}else{const V=R/2+1;T[W].y>=T[q].y?(T[q].y-=V,T[W].y+=V):(T[q].y+=V,T[W].y-=V)}}if(!B)break}const $=60,P=new Map;T.forEach(E=>P.set(E.node.id,new Set)),t.forEach(E=>{P.get(E.from)?.add(E.to),P.get(E.to)?.add(E.from)});const D=new Map;let F=0;if(T.forEach(E=>{if(D.has(E.node.id))return;const B=F++,q=[E.node.id];for(;q.length>0;){const W=q.pop();if(W===void 0)break;D.has(W)||(D.set(W,B),P.get(W)?.forEach(O=>{D.has(O)||q.push(O)}))}}),F>1){const E=new Map;T.forEach(j=>{const z=D.get(j.node.id);if(z===void 0)return;const Q=E.get(z);Q?(Q.minX=Math.min(Q.minX,j.x),Q.minY=Math.min(Q.minY,j.y),Q.maxX=Math.max(Q.maxX,j.x+j.width),Q.maxY=Math.max(Q.maxY,j.y+j.height)):E.set(z,{minX:j.x,minY:j.y,maxX:j.x+j.width,maxY:j.y+j.height})});const B=Array.from(E.keys()).sort((j,z)=>{const Q=E.get(j),rt=E.get(z);return!Q||!rt?0:(rt.maxX-rt.minX)*(rt.maxY-rt.minY)-(Q.maxX-Q.minX)*(Q.maxY-Q.minY)}),q=Math.ceil(Math.sqrt(B.length));let W=0,O=0,R=0,V=0;for(const j of B){const z=E.get(j);if(!z)continue;const Q=z.maxX-z.minX,rt=z.maxY-z.minY,et=W-z.minX,J=O-z.minY;T.forEach(at=>{D.get(at.node.id)===j&&(at.x+=et,at.y+=J)}),W+=Q+$,R=Math.max(R,rt),V++,V>=q&&(V=0,W=0,O+=R+$,R=0)}}return T.map(E=>({...E.node,x:E.x,y:E.y,width:E.width,height:E.height}))}function n4(e,t,r){const o=2*Math.PI/e.length;return e.map((a,s)=>{const n=s*o,l=200*Math.cos(n),c=200*Math.sin(n),h=a.size?.width??r.width,d=a.size?.height??r.height;return{...a,x:l,y:c,width:h,height:d}})}function l4(e,t,r,i){const o=us(r.spacing,60),a=r.direction??"TB",s=a==="TB"||a==="BT",n=new Map,l=new Map;t.forEach(f=>{let p=n.get(f.from);p||(p=[],n.set(f.from,p)),p.push(f.to),l.set(f.to,f.from)});const c=e.filter(f=>!l.has(f.id));c.length===0&&e.length>0&&c.push(e[0]);const h=new Map;let d=0;function u(f,p){const g=e.find(T=>T.id===f);if(!g)return{width:0,height:0};const m=g.size?.width??i.width,y=g.size?.height??i.height,x=n.get(f)||[];if(x.length===0){const T=s?d:p*(m+o),_=s?p*(y+o):d;return h.set(f,{x:T,y:_,width:m,height:y}),d+=(s?m:y)+o,{width:m,height:y}}const C=[];x.forEach(T=>{const _=u(T,p+1);C.push(s?_.width:_.height)});const M=(d-C.reduce((T,_)=>T+_,0)-o*(C.length-1)+d)/2,A=s?M:p*(m+o),L=s?p*(y+o):M;return h.set(f,{x:A,y:L,width:m,height:y}),{width:m,height:y}}return c.forEach(f=>{u(f.id,0)}),e.map(f=>{const p=h.get(f.id)||{x:0,y:0,width:i.width,height:i.height};return{...f,x:p.x,y:p.y,width:p.width,height:p.height}})}function c4(e,t,r,i){const o=r.edgeRouting||"polyline";return r.type==="circular"?Ap(e,t):o==="orthogonal"||o==="curved"?I1(e,t,r,i):Ap(e,t)}const h4=32,d4=6;function u4(e,t){return Math.max(h4,(e+t)/4+d4/2)}function P1(e,t){const r=new Map,i=new Map(t.map(s=>[s.id,s])),o=new Map;for(const s of e){if(s.from===s.to)continue;const n=`${s.from}::${s.to}`;let l=o.get(n);l||(l=[],o.set(n,l)),l.push(s)}const a=new Set;for(const[s]of o){const[n,l]=s.split("::"),c=`${l}::${n}`,h=[n,l].sort().join("::");if(a.has(h)||!o.has(c))continue;a.add(h);const d=o.get(s),u=o.get(c);if(!d||!u)continue;const f=i.get(n),p=i.get(l),g=f&&p?Math.abs(p.x+p.width/2-(f.x+f.width/2))>=Math.abs(p.y+p.height/2-(f.y+f.height/2)):!1,m=x=>Math.max(0,...x.map(C=>{if(!C.label)return 0;const k=Kr(C.label);return g?k.height:k.width})),y=u4(m(d),m(u));for(const x of d)r.set(x.id,y);for(const x of u)r.set(x.id,y)}return r}function Lp(e,t,r,i){const o=r.x-t.x,a=r.y-t.y,s=Math.sqrt(o*o+a*a);if(s===0)return e;const n=-a/s,l=o/s;return{x:e.x+n*i,y:e.y+l*i}}function Ap(e,t){const r=new Map(t.map(a=>[a.id,a])),i=P1(e,t),o=new Map;return e.map(a=>{const s=r.get(a.from),n=r.get(a.to);if(!s||!n)return{...a,path:"",points:[]};if(s.id===n.id){const T=o.get(a.from)??0;o.set(a.from,T+1);const{path:_,points:$}=O1(s,T);return{...a,path:_,points:$}}const l=s.x+s.width/2,c=s.y+s.height/2,h=n.x+n.width/2,d=n.y+n.height/2,u=h-l,f=d-c;let p,g;const m=Math.atan2(f,u),y=Math.abs(m);y<Math.PI/4?(p={x:s.x+s.width,y:c},g={x:n.x,y:d}):y>3*Math.PI/4?(p={x:s.x,y:c},g={x:n.x+n.width,y:d}):m>0?(p={x:l,y:s.y+s.height},g={x:h,y:n.y}):(p={x:l,y:s.y},g={x:h,y:n.y+n.height});const x=2,C=g.x-p.x,k=g.y-p.y,v=Math.sqrt(C*C+k*k);if(v>x*2){const T=C/v,_=k/v;p={x:p.x+T*x,y:p.y+_*x}}const M=i.get(a.id);if(M){const T={x:l,y:c},_={x:h,y:d};p=Lp(p,T,_,M),g=Lp(g,T,_,M)}const A=`M ${p.x} ${p.y} L ${g.x} ${g.y}`,L=[p,{x:(p.x+g.x)/2,y:(p.y+g.y)/2},g];return{...a,path:A,points:L}})}function I1(e,t,r,i){const o=new Map(t.map(H=>[H.id,H])),a=new Map(t.flatMap(H=>H.group?[[H.id,H.group]]:[]));i?.forEach(H=>H.nodeIds?.forEach(Y=>a.set(Y,H.id)));const s=P1(e,t),n=r.direction||"TB",l=n==="TB"||n==="BT",c=16,h=24,d=32,u=10,f=12,p=10,g=12;let m=1/0,y=-1/0,x=-1/0;for(const H of t)m=Math.min(m,H.x),y=Math.max(y,H.x+H.width),x=Math.max(x,H.y+H.height);const C=[],k=[],v=new Map;for(const[H,Y]of e.entries()){const Z=o.get(Y.from),tt=o.get(Y.to);if(!Z||!tt)continue;if(Z.id===tt.id){const Zt=v.get(Y.from)??0;v.set(Y.from,Zt+1);const{path:$t,points:Nt}=O1(Z,Zt);k.push({...Y,path:$t,points:Nt});continue}const{fromSide:st,toSide:It}=p4(Z,tt,l),Wt=(r.type==="layered"||r.type==="tree")&&(l?Z.y+Z.height/2>tt.y+tt.height/2:Z.x+Z.width/2>tt.x+tt.width/2);C.push({index:H,edge:Y,fromNode:Z,toNode:tt,fromSide:st,toSide:It,goesBackward:Wt})}const M=xt(C),A=new Map;C.forEach(H=>{const{fromNode:Y,toNode:Z,fromSide:tt,toSide:st}=H,It=tt==="top"||tt==="bottom",zt=st==="top"||st==="bottom",Wt=Y.x+Y.width/2,Zt=Y.y+Y.height/2,$t=Z.x+Z.width/2,Nt=Z.y+Z.height/2;let _e=!1,Ot=!1,ue;if(tt==="bottom"&&st==="top"){const Ce=Y.y+Y.height,we=Z.y;ue=(Ce+we)/2,ue=Math.max(ue,Ce+h),ue=Math.min(ue,we-h)}else if(tt==="top"&&st==="bottom"){const Ce=Y.y,we=Z.y+Z.height;ue=(Ce+we)/2,ue=Math.min(ue,Ce-h),ue=Math.max(ue,we+h)}else ue=(Zt+Nt)/2;let $e;if(tt==="right"&&st==="left"){const Ce=Y.x+Y.width,we=Z.x;$e=(Ce+we)/2}else if(tt==="left"&&st==="right"){const Ce=Y.x,we=Z.x+Z.width;$e=(Ce+we)/2}else $e=(Wt+$t)/2;It&&zt&&Math.abs(Wt-$t)>5?_e=!0:!It&&!zt&&(Ot=!0),A.set(H.edge.id,{needsHorizontalChannel:_e,needsVerticalChannel:Ot,horizontalY:ue,verticalX:$e})});const L=C.filter(H=>A.get(H.edge.id)?.needsHorizontalChannel),T=C.filter(H=>A.get(H.edge.id)?.needsVerticalChannel);L.sort((H,Y)=>{const Z=A.get(H.edge.id),tt=A.get(Y.edge.id);return!Z||!tt?0:Z.horizontalY-tt.horizontalY}),T.sort((H,Y)=>{const Z=A.get(H.edge.id),tt=A.get(Y.edge.id);return!Z||!tt?0:Z.verticalX-tt.verticalX});const _=new Map,$=new Map,P=()=>{const H=[];L.forEach(Y=>{const{fromNode:Z,toNode:tt}=Y,st=A.get(Y.edge.id);if(!st)return;const It=st.horizontalY,zt=Math.min(Z.x,tt.x),Wt=Math.max(Z.x+Z.width,tt.x+tt.width),Zt=H.filter(Nt=>!(Wt<Nt.minX-10||zt>Nt.maxX+10)&&(Nt.sourceId!==Y.edge.from||Nt.targetId===Y.edge.to));let $t=It;if(Zt.length>0){const Nt=Zt.map(Ot=>Ot.y).sort((Ot,ue)=>Ot-ue);let _e=!1;for(let Ot=0;Ot<=Zt.length;Ot++){const ue=It+Ot*c;if(!Nt.some(Tt=>Math.abs(Tt-ue)<c-1)){$t=ue,_e=!0;break}const Ce=It-Ot*c;if(!Nt.some(Tt=>Math.abs(Tt-Ce)<c-1)&&Ot>0){$t=Ce,_e=!0;break}}_e||($t=It+Zt.length*c)}H.push({minX:zt,maxX:Wt,y:$t,edgeId:Y.edge.id,sourceId:Y.edge.from,targetId:Y.edge.to}),_.set(Y.edge.id,$t)})},D=()=>{const H=[];T.forEach(Y=>{const{fromNode:Z,toNode:tt}=Y,st=A.get(Y.edge.id);if(!st)return;const It=st.verticalX,zt=Math.min(Z.y,tt.y),Wt=Math.max(Z.y+Z.height,tt.y+tt.height),Zt=H.filter(Nt=>!(Wt<Nt.minY-10||zt>Nt.maxY+10));let $t=It;if(Zt.length>0){const Nt=Zt.map(Ot=>Ot.x).sort((Ot,ue)=>Ot-ue);let _e=!1;for(let Ot=0;Ot<=Zt.length;Ot++){const ue=It+Ot*c;if(!Nt.some(Tt=>Math.abs(Tt-ue)<c-1)){$t=ue,_e=!0;break}const Ce=It-Ot*c;if(!Nt.some(Tt=>Math.abs(Tt-Ce)<c-1)&&Ot>0){$t=Ce,_e=!0;break}}_e||($t=It+Zt.length*c)}H.push({minY:zt,maxY:Wt,x:$t,edgeId:Y.edge.id}),$.set(Y.edge.id,$t)})};P(),D();const F=C.filter(H=>H.goesBackward);F.sort((H,Y)=>{const Z=Math.abs(l?H.fromNode.y-H.toNode.y:H.fromNode.x-H.toNode.x);return Math.abs(l?Y.fromNode.y-Y.toNode.y:Y.fromNode.x-Y.toNode.x)-Z});const E=new Map;F.forEach((H,Y)=>{E.set(H.edge.id,Y)});const B=xt(l?F.map(H=>({...H,fromSide:"left",toSide:"left"})):[]),q=new Map;if(l)for(const H of F){const Y=Math.max(i?.length?0:32,H.edge.label?nh(H.edge.label)/2+4:0),Z=Math.min(H.fromNode.y,H.toNode.y),tt=Math.max(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height),st=Math.min(...[...t,...i??[]].filter(Wt=>Wt.y<tt&&Wt.y+Wt.height>Z).map(Wt=>Wt.x));let It=i?.length?m-h-Y-((E.get(H.edge.id)??0)+1)*c:st-h-Y-c;const zt=F.filter(Wt=>{const Zt=Math.min(Wt.fromNode.y,Wt.toNode.y),$t=Math.max(Wt.fromNode.y+Wt.fromNode.height,Wt.toNode.y+Wt.toNode.height);return Zt<=tt&&$t>=Z}).flatMap(Wt=>q.has(Wt.edge.id)?[q.get(Wt.edge.id)]:[]).sort((Wt,Zt)=>Zt-Wt);for(const Wt of zt)Math.abs(It-Wt)<c&&(It=Wt-c);q.set(H.edge.id,It)}const W=new Map,O=new Map;for(const H of C){const Y=`${H.edge.from}->${H.edge.to}`,Z=O.get(Y)??[];Z.push(H),O.set(Y,Z)}for(const H of O.values())H.forEach((Y,Z)=>W.set(Y.edge.id,{index:Z,count:H.length}));const R=H=>{const Y=(H.fromNode.x+H.fromNode.width/2+H.toNode.x+H.toNode.width/2)/2,Z=Math.min(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height),tt=Math.max(H.fromNode.y,H.toNode.y);return tt<=Z?!1:t.some(st=>st.id!==H.fromNode.id&&st.id!==H.toNode.id&&Y>=st.x-d&&Y<=st.x+st.width+d&&st.y<tt&&st.y+st.height>Z)},V=H=>{if(!H.edge.label)return!1;const Y=Math.max(0,Math.max(H.fromNode.y,H.toNode.y)-Math.min(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height)),Z=Kr(H.edge.label,sn(H.edge.label,Y));return Z.lines>=3&&Y<Z.height+16},j=(H,Y,Z)=>Math.abs(H.x-Y.x)<.001?H.x>Z.left&&H.x<Z.right&&Math.max(H.y,Y.y)>Z.top&&Math.min(H.y,Y.y)<Z.bottom:H.y>Z.top&&H.y<Z.bottom&&Math.max(H.x,Y.x)>Z.left&&Math.min(H.x,Y.x)<Z.right,z=(H,Y)=>H.slice(1).some((Z,tt)=>Y.some(st=>j(H[tt],Z,st))),Q=(H,Y)=>Math.abs(Y.x-H.x)>=Math.abs(Y.y-H.y)?{x:H.x+Math.sign(Y.x-H.x)*d,y:H.y}:{x:H.x,y:H.y+Math.sign(Y.y-H.y)*d},rt=H=>H.slice(1).reduce((Y,Z,tt)=>Y+Math.abs(Z.x-H[tt].x)+Math.abs(Z.y-H[tt].y),0),et=(H,Y)=>{const Z=(U,K)=>Math.abs(K.x-U.x)>=Math.abs(K.y-U.y)?`${Math.sign(K.x-U.x)},0`:`0,${Math.sign(K.y-U.y)}`,tt=new Set([a.get(H.fromNode.id),a.get(H.toNode.id)].filter(U=>U!==void 0)),st=t.map(U=>{const K=U.id===H.fromNode.id||U.id===H.toNode.id?0:u;return{left:U.x-K,right:U.x+U.width+K,top:U.y-K,bottom:U.y+U.height+K}}),It=(i??[]).filter(U=>!tt.has(U.id)&&U.width>0&&U.height>0).map(U=>({left:U.x-f,right:U.x+U.width+f,top:U.y-f,bottom:U.y+U.height+f})),zt=(i??[]).map(Qh),Wt=[...st,...It,...zt],Zt=Ws(Y);if(!z(Zt,Wt))return Zt;const $t=H.edge.label?Kr(H.edge.label):void 0,Nt=[...zt,...t.map(U=>({left:U.x,right:U.x+U.width,top:U.y,bottom:U.y+U.height})),...(i??[]).filter(U=>!tt.has(U.id)&&U.width>0&&U.height>0).map(U=>({left:U.x,right:U.x+U.width,top:U.y,bottom:U.y+U.height}))],_e=U=>{if(!$t)return Number.POSITIVE_INFINITY;const K=[.5,.25,.75,.125,.875];return U.slice(1).reduce((ct,yt,vt)=>{const ot=U[vt];return ct+K.filter(kt=>{const Xt=ot.x+(yt.x-ot.x)*kt,re=ot.y+(yt.y-ot.y)*kt,Kt={left:Xt-$t.width/2-p,right:Xt+$t.width/2+p,top:re-$t.height/2-p,bottom:re+$t.height/2+p};return!Nt.some(xe=>Kt.left<xe.right&&Kt.right>xe.left&&Kt.top<xe.bottom&&Kt.bottom>xe.top)}).length},0)},Ot=U=>_e(U)>=3,ue=Zt[0],$e=Zt[Zt.length-1],Ce=Z(ue,Y[1]),we=Z(Y[Y.length-2],$e),Tt=Q(ue,Zt[1]),Yt=Q($e,Zt[Zt.length-2]),w=U=>[...new Set(U)].sort((K,ct)=>K-ct),G=w([...Wt.flatMap(({left:U,right:K})=>[U,K]),...$t?Nt.flatMap(({left:U,right:K})=>[U-$t.width/2-g,K+$t.width/2+g]):[]]),ht=w([...Wt.flatMap(({top:U,bottom:K})=>[U,K]),...$t?Nt.flatMap(({top:U,bottom:K})=>[U-$t.height/2-g,K+$t.height/2+g]):[]]),pt=[...G.map(U=>Ws([ue,Tt,{x:U,y:Tt.y},{x:U,y:Yt.y},Yt,$e])),...ht.map(U=>Ws([ue,Tt,{x:Tt.x,y:U},{x:Yt.x,y:U},Yt,$e]))].filter(U=>!z(U,Wt)&&Z(U[0],U[1])===Ce&&Z(U[U.length-2],U[U.length-1])===we),ut=pt.filter(Ot);return(ut.length>0?ut:pt).toSorted((U,K)=>{const ct=yt=>rt(yt)+yt.length*c;return ct(U)-ct(K)||JSON.stringify(U).localeCompare(JSON.stringify(K))})[0]??Zt},J=C.map(H=>{const{index:Y,edge:Z,fromNode:tt,toNode:st,fromSide:It,toSide:zt,goesBackward:Wt}=H,Zt=(Tt,Yt)=>{switch(Yt){case"top":return{x:Tt.x+Tt.width/2,y:Tt.y};case"bottom":return{x:Tt.x+Tt.width/2,y:Tt.y+Tt.height};case"left":return{x:Tt.x,y:Tt.y+Tt.height/2};case"right":return{x:Tt.x+Tt.width,y:Tt.y+Tt.height/2}}},$t=M.get(`${Y}:from`)??Zt(tt,It);let Nt=M.get(`${Y}:to`)??Zt(st,zt);const _e=s.get(Z.id),Ot=[$t],ue=It==="top"||It==="bottom",$e=zt==="top"||zt==="bottom",Ce=(()=>{if(ue||$e||_e||M.has(`${Y}:from`)||M.has(`${Y}:to`))return null;const Tt=ot=>Math.min(ot.height/4,["db","store","data_store"].includes(ot.kind??"")?10:6),Yt=Math.max(tt.y+Tt(tt),st.y+Tt(st)),w=Math.min(tt.y+tt.height-Tt(tt),st.y+st.height-Tt(st));if(Yt>w)return null;const G=Math.max(Yt,Math.min(w,(tt.y+tt.height/2+st.y+st.height/2)/2)),ht={x:It==="right"?tt.x+tt.width:tt.x,y:G},pt={x:zt==="left"?st.x:st.x+st.width,y:G},ut=Math.min(ht.x,pt.x),I=Math.max(ht.x,pt.x),U=new Set([a.get(tt.id),a.get(st.id)].filter(ot=>ot!==void 0)),K=t.some(ot=>ot.id!==tt.id&&ot.id!==st.id&&ot.x<I&&ot.x+ot.width>ut&&G>ot.y-u&&G<ot.y+ot.height+u),ct=(i??[]).some(ot=>!U.has(ot.id)&&ot.x<I&&ot.x+ot.width>ut&&G>ot.y-f&&G<ot.y+ot.height+f),yt=Z.label?Kr(Z.label).width:0,vt=I-ut>=yt+p*2;return K||ct||!vt?null:{source:ht,target:pt}})();if(tt.id===st.id){const Tt={x:tt.x+tt.width,y:tt.y+tt.height/2},Yt={x:tt.x+tt.width/2,y:tt.y+tt.height},w=Tt.x+h+c+80,G=Yt.y+h+c;Ot[0]=Tt,Ot.push({x:w,y:Tt.y},{x:w,y:G},{x:Yt.x,y:G}),Nt=Yt}else if(t.length<=6&&Z.dashed&&e.some(Tt=>Tt.id!==Z.id&&Tt.from===Z.from&&Tt.to===Z.to)){const Tt={x:tt.x+tt.width,y:tt.y+tt.height/2},Yt={x:st.x+st.width,y:st.y+st.height/2},w=Math.max(Tt.x,Yt.x)+h+c;Ot[0]=Tt,Ot.push({x:w,y:Tt.y},{x:w,y:Yt.y}),Nt=Yt}else if(Wt){const Tt=E.get(Z.id)??0;if(l){const Yt=q.get(Z.id),w=B.get(`${Y}:from`)??{x:tt.x,y:tt.y+tt.height/2},G=B.get(`${Y}:to`)??{x:st.x,y:st.y+st.height/2};Ot[0]=w,Ot.push({x:Yt,y:w.y},{x:Yt,y:G.y}),Nt=G}else{const Yt=x+h+(Tt+1)*c,w=d+Tt*c,G=It==="right"?$t.x+w:$t.x-w,ht=zt==="left"?Nt.x-w:Nt.x+w;Ot.push({x:G,y:$t.y}),Ot.push({x:G,y:Yt}),Ot.push({x:ht,y:Yt}),Ot.push({x:ht,y:Nt.y})}}else if(l&&ue&&$e&&a.has(tt.id)&&a.has(st.id)&&a.get(tt.id)!==a.get(st.id)){const Tt=Z.label?nh(Z.label):0,Yt=new Set([a.get(tt.id),a.get(st.id)].filter(ct=>ct!==void 0)),w=(i??[]).filter(ct=>Yt.has(ct.id)),G=Math.max(tt.x+tt.width,st.x+st.width,...w.map(ct=>ct.x+ct.width)),ht=Math.min(tt.y,st.y),pt=Math.max(tt.y+tt.height,st.y+st.height),ut=(i??[]).some(ct=>!Yt.has(ct.id)&&ct.x>=G&&ct.y<pt&&ct.y+ct.height>ht),I=tt.x+tt.width/2,U=st.x+st.width/2;if((i?.length??0)>=3&&Math.abs(I-U)<12&&!R(H)&&!ut){const ct=Zt(tt,It),yt=Zt(st,zt);if(Ot[0]=ct,Math.abs(ct.x-yt.x)>=.5){const vt=(ct.y+yt.y)/2;Ot.push({x:ct.x,y:vt},{x:yt.x,y:vt})}Nt=yt}else if(ut){const ct={x:tt.x,y:tt.y+tt.height/2},yt={x:st.x,y:st.y+st.height/2},ot=Math.min(ct.x,yt.x,...w.map(kt=>kt.x))-h-Tt/2-p;Ot[0]=ct,Ot.push({x:ot,y:ct.y},{x:ot,y:yt.y}),Nt=yt}else{const ct={x:tt.x+tt.width,y:tt.y+tt.height/2},yt={x:st.x+st.width,y:st.y+st.height/2},vt=Math.max(y+h+d,ct.x+d,yt.x+d);Ot[0]=ct,Ot.push({x:vt,y:ct.y},{x:vt,y:yt.y}),Nt=yt}}else if(l&&ue&&$e&&(R(H)||V(H))){const Tt=Z.label?nh(Z.label):0,Yt={x:tt.x+tt.width,y:tt.y+tt.height/2},w={x:st.x+st.width,y:st.y+st.height/2},G=Math.max(y+h+Tt/2+c,Yt.x+Math.max(Tt+Ra,d),w.x+Math.max(Tt+Ra,d));Ot[0]=Yt,Ot.push({x:G,y:Yt.y},{x:G,y:w.y}),Nt=w}else if(ue&&$e){const Tt=tt.x+tt.width/2,Yt=st.x+st.width/2,w=Math.abs($t.x-Nt.x)<1;if(Math.abs(Tt-Yt)<5&&!_e&&w){const G=(Tt+Yt)/2;Ot[0]={x:G,y:$t.y},Nt={x:G,y:Nt.y}}else if(Math.abs(Tt-Yt)<5&&!_e){const G=(Tt+Yt)/2;Ot[0]={x:G,y:$t.y},Nt={x:G,y:Nt.y}}else if(Math.abs(Tt-Yt)<5){const G=$t.y<=Nt.y?1:-1,ht=(Tt+Yt)/2+G*Math.abs(_e??0);Ot[0]={x:ht,y:$t.y},Nt={x:ht,y:Nt.y}}else{const G=_.get(Z.id)??($t.y+Nt.y)/2,ht=It==="bottom"?Math.max($t.y+d,G):Math.min($t.y-d,G),pt=zt==="top"?Math.min(Nt.y-d,G):Math.max(Nt.y+d,G);Math.abs(ht-G)>2&&Ot.push({x:$t.x,y:ht}),Ot.push({x:$t.x,y:G}),Ot.push({x:Nt.x,y:G}),Math.abs(pt-G)>2&&Ot.push({x:Nt.x,y:pt})}}else if(!ue&&!$e&&_e){const Tt=$t.x<Nt.x,Yt=Tt?Math.max(tt.y+tt.height,st.y+st.height)+h+Math.abs(_e)/2+(Z.dashed?28:0):Math.min(tt.y,st.y)-h-Math.abs(_e)/2-(Z.dashed?28:0);if(Tt){const w={x:tt.x+tt.width*.65,y:tt.y+tt.height},G={x:st.x+st.width*.35,y:st.y+st.height};Ot[0]=w,Ot.push({x:w.x,y:Yt},{x:G.x,y:Yt}),Nt=G}else{const w=Zt(tt,It),G=Zt(st,zt),ht=It==="right"?w.x+d:w.x-d,pt=zt==="left"?G.x-d:G.x+d;Ot[0]=w,Ot.push({x:ht,y:w.y},{x:ht,y:Yt},{x:pt,y:Yt},{x:pt,y:G.y}),Nt=G}}else if(Ce)Ot[0]=Ce.source,Nt=Ce.target;else if(!ue&&!$e){const Tt=$.get(Z.id)??($t.x+Nt.x)/2,Yt=It==="right"?Math.max($t.x+d,Tt):Math.min($t.x-d,Tt),w=zt==="left"?Math.min(Nt.x-d,Tt):Math.max(Nt.x+d,Tt);Math.abs(Yt-Tt)>2&&Ot.push({x:Yt,y:$t.y}),Ot.push({x:Tt,y:$t.y}),Ot.push({x:Tt,y:Nt.y}),Math.abs(w-Tt)>2&&Ot.push({x:w,y:Nt.y})}else if(ue){const Tt=It==="bottom"?$t.y+d:$t.y-d;Math.abs(Tt-Nt.y)>5?(Ot.push({x:$t.x,y:Tt}),Ot.push({x:Nt.x,y:Tt})):Ot.push({x:$t.x,y:Nt.y})}else{const Tt=It==="right"?$t.x+d:$t.x-d;Math.abs(Tt-Nt.x)>5?(Ot.push({x:Tt,y:$t.y}),Ot.push({x:Tt,y:Nt.y})):Ot.push({x:Nt.x,y:$t.y})}Ot.push(Nt);const we=et(H,Ot);return{...Z,path:nn(we),points:we}}),at=C.map((H,Y)=>({info:H,route:J[Y]})).toSorted((H,Y)=>+(H.info.fromNode.x<H.info.toNode.x)-+(Y.info.fromNode.x<Y.info.toNode.x)||H.info.fromNode.x-Y.info.fromNode.x||H.info.fromNode.y-Y.info.fromNode.y||H.info.toNode.x-Y.info.toNode.x||H.info.toNode.y-Y.info.toNode.y);for(const{info:H,route:Y}of at){const{fromNode:Z,toNode:tt,fromSide:st,toSide:It}=H;if(l||!["left","right"].includes(st)||!["left","right"].includes(It)||(W.get(Y.id)?.count??1)>1||!Y.points||Y.points.length<=2)continue;const zt=Z.x<tt.x,Wt=zt?Z.x+Z.width:Z.x,Zt=zt?tt.x:tt.x+tt.width;if((Zt-Wt)*(zt?1:-1)<=0)continue;const $t=Y.label?Kr(Y.label):void 0,Nt=new Set([a.get(Z.id),a.get(tt.id)]),_e=[...t.map(K=>({node:K,clearance:K.id===Z.id||K.id===tt.id?0:u})),...(i??[]).filter(K=>!Nt.has(K.id)).map(K=>({node:K,clearance:f}))].map(({node:K,clearance:ct})=>({left:K.x-ct,right:K.x+K.width+ct,top:K.y-ct,bottom:K.y+K.height+ct}));_e.push(...(i??[]).map(Qh));const Ot=[...t.map(K=>({left:K.x,right:K.x+K.width,top:K.y,bottom:K.y+K.height})),..._e.slice(t.length)],ue=[...k,...J].filter(K=>K!==Y).flatMap(K=>{const ct=K.label?Kr(K.label):void 0,yt=(K.points??[]).slice(1).map((ot,kt)=>({start:K.points[kt],end:ot})),vt=ct&&yt.some(({start:ot,end:kt})=>{if(ot.y!==kt.y||Math.abs(kt.x-ot.x)<ct.width+16||yt.some(Kt=>Math.abs(Kt.end.y-Kt.start.y)>Math.abs(kt.x-ot.x)))return!1;const Xt=(ot.x+kt.x)/2,re={left:Xt-ct.width/2-8,right:Xt+ct.width/2+8,top:ot.y-ct.height/2-8,bottom:ot.y+ct.height/2+8};return!Ot.some(Kt=>re.left<Kt.right&&re.right>Kt.left&&re.top<Kt.bottom&&re.bottom>Kt.top)&&![...k,...J].some(Kt=>Kt!==K&&Kt!==Y&&z(Kt.points??[],[re]))});return yt.map(({start:ot,end:kt})=>{const Xt=Math.abs(ot.y-kt.y)<.001,re=ct&&(Xt||!vt)&&Math.hypot(kt.x-ot.x,kt.y-ot.y)>=(Xt?ct.width:ct.height)+16,Kt=Math.max(c,re&&!Xt?ct.width/2+2:0),xe=Math.max(c,re&&Xt?ct.height/2+2:0);return{left:Math.min(ot.x,kt.x)-Kt,right:Math.max(ot.x,kt.x)+Kt,top:Math.min(ot.y,kt.y)-xe,bottom:Math.max(ot.y,kt.y)+xe}})}),$e=[..._e,...ue],Ce=[...Ot,...ue],we=[],Tt=K=>Math.min(K.height/4,["db","store","data_store"].includes(K.kind??"")?10:6),Yt=Math.max(Z.y+Tt(Z),tt.y+Tt(tt)),w=Math.min(Z.y+Z.height-Tt(Z),tt.y+tt.height-Tt(tt));if(Yt<=w)for(const K of[(Yt+w)/2,Yt,w])we.push([{x:Wt,y:K},{x:Zt,y:K}]);const G=K=>[K.y+K.height/2,K.y+Tt(K),K.y+K.height-Tt(K)],ht=zt?1:-1;if(Math.abs(Zt-Wt)>=c*2){const K=[(Wt+Zt)/2,Wt+ht*d,Zt-ht*d,Wt+ht*c,Zt-ht*c].filter(ct=>(ct-Wt)*ht>=c&&(Zt-ct)*ht>=c);for(const ct of G(Z))for(const yt of G(tt))for(const vt of K)we.push([{x:Wt,y:ct},{x:vt,y:ct},{x:vt,y:yt},{x:Zt,y:yt}])}for(const K of[!1,!0]){const ct={x:Z.x+Z.width/2,y:Z.y+(K?Z.height:0)},yt={x:tt.x+tt.width/2,y:tt.y+(K?tt.height:0)},vt=Math.max(d,($t?.height??0)/2+p),ot=K?Math.max(ct.y,yt.y)+vt:Math.min(ct.y,yt.y)-vt;we.push([ct,{x:ct.x,y:ot},{x:yt.x,y:ot},yt])}const pt=(K,ct=!1)=>{if(!$t)return!0;const yt=$1(K);return(ct?yt.filter(({horizontal:ot})=>ot).toSorted((ot,kt)=>Math.abs(kt.end.x-kt.start.x)-Math.abs(ot.end.x-ot.start.x)).slice(0,1):yt).some(({start:ot,end:kt})=>{const Xt=ot.y===kt.y?$t.width:$t.height;return Math.hypot(kt.x-ot.x,kt.y-ot.y)<Xt+16?!1:(ct?[.5]:[.5,.25,.75]).some(re=>{const Kt=ot.x+(kt.x-ot.x)*re,xe=ot.y+(kt.y-ot.y)*re;return!Ce.some(Ee=>Kt-$t.width/2-8<Ee.right&&Kt+$t.width/2+8>Ee.left&&xe-$t.height/2-8<Ee.bottom&&xe+$t.height/2+8>Ee.top)})})},ut=z(Y.points,_e),I=pt(Y.points,!0),U=we.map(Ws).map(K=>({points:K,centeredLabel:pt(K,!0)})).filter(({points:K,centeredLabel:ct})=>(ut||K.length<Y.points.length||K.length===Y.points.length&&(ct&&!I||ct===I&&rt(K)<rt(Y.points)))&&!z(K,$e)&&pt(K)).toSorted((K,ct)=>K.points.length-ct.points.length||Number(ct.centeredLabel)-Number(K.centeredLabel)||rt(K.points)-rt(ct.points))[0]?.points;U&&(Y.points=U,Y.path=nn(U))}return[...k,...J];function xt(H){const Y=new Map,Z=st=>{const It=`${st.node.id}:${st.side}`;Y.set(It,[...Y.get(It)??[],st])};for(const st of H){const It=st.fromSide==="top"||st.fromSide==="bottom",zt=st.toSide==="top"||st.toSide==="bottom";Z({key:`${st.index}:from`,node:st.fromNode,side:st.fromSide,desired:It?st.toNode.x+st.toNode.width/2:st.toNode.y+st.toNode.height/2,role:"from",edgeId:st.edge.id}),Z({key:`${st.index}:to`,node:st.toNode,side:st.toSide,desired:zt?st.fromNode.x+st.fromNode.width/2:st.fromNode.y+st.fromNode.height/2,role:"to",edgeId:st.edge.id})}const tt=new Map;for(const st of Y.values()){const It=new Set(st.map(({role:w})=>w)),zt=new Set(st.map(w=>{const G=H.find(ht=>ht.index===Number(w.key.split(":")[0]));return w.role==="from"?G?.toNode.id:G?.fromNode.id}));if(!(st.length>=2&&(It.size>1||zt.size>1)))continue;const Zt=st.toSorted((w,G)=>w.desired-G.desired||w.role.localeCompare(G.role)||w.edgeId.localeCompare(G.edgeId)||w.key.localeCompare(G.key)),{node:$t,side:Nt}=Zt[0],_e=Nt==="top"||Nt==="bottom",Ot=_e?$t.width:$t.height,ue=_e?$t.x+$t.width/2:$t.y+$t.height/2,$e=Math.max(0,Ot-Math.min(32,Ot*.4)),Ce=Zt.map(w=>{const G=H.find(pt=>pt.edge.id===w.edgeId)?.edge,ht=G?.label?Kr(G.label):void 0;return ht?_e?ht.width:ht.height:0}),we=It.size===1?Math.max(No,...Ce.slice(1).map((w,G)=>(w+Ce[G])/2+p)):No,Tt=Zt.length>1?Math.min(we,$e/(Zt.length-1)):0,Yt=ue-Tt*(Zt.length-1)/2;Zt.forEach((w,G)=>{const ht=Yt+G*Tt;tt.set(w.key,_e?{x:ht,y:Nt==="top"?$t.y:$t.y+$t.height}:{x:Nt==="left"?$t.x:$t.x+$t.width,y:ht})})}return tt}}function f4(e,t,r){const i=new Map(t.map((u,f)=>[u.id,{node:u,index:f}])),o=new Map,a=[],s=(r??[]).map(Qh),n=Math.max(...t.map(u=>u.x+u.width)),l=(e.length>=t.length*1.5?24:32)+Wo,c=u=>{const f=i.get(u.from),p=i.get(u.to);if(!f||!p||f.index===p.index)return!1;if(p.index!==f.index+1)return!0;const g=u.label?Kr(u.label,sn(u.label)):null,m=f.node.x+f.node.width/2;return!!(g&&g.height+16>p.node.y-(f.node.y+f.node.height))||s.some(y=>m>y.left&&m<y.right&&f.node.y+f.node.height<y.bottom&&p.node.y>y.top)},h=e.filter(c),d=(u,f,p)=>{const g=h.flatMap(x=>{const C=i.get(x.from),k=i.get(x.to);return!C||!k?[]:k.index>C.index!==p?[]:x.from===u.id?[{edge:x,opposite:k.index,role:"from"}]:x.to===u.id?[{edge:x,opposite:C.index,role:"to"}]:[]}).sort((x,C)=>x.opposite-C.opposite||x.role.localeCompare(C.role)||x.edge.id.localeCompare(C.edge.id)),m=g.findIndex(x=>x.edge.id===f.id),y=g.length>1?Math.min(No,u.height*.6/(g.length-1)):0;return u.y+u.height/2+(m-(g.length-1)/2)*y};return e.flatMap(u=>{const f=i.get(u.from),p=i.get(u.to);if(!f||!p)return[];const{node:g,index:m}=f,{node:y,index:x}=p,C=o.get(u.from)??0;o.set(u.from,C+1);const k=u.label?Kr(u.label,sn(u.label)):null,v=c(u);let M;if(u.from===u.to){const L=u.label?64:28,T={x:g.x+g.width/2,y:g.y},_={x:g.x+g.width,y:g.y+g.height/2},$=n+L,P=g.y-32-C*26;M=[T,{x:T.x,y:P},{x:$,y:P},{x:$,y:_.y},_]}else if(x===m+1&&!v)M=[{x:g.x+g.width/2,y:g.y+g.height},{x:y.x+y.width/2,y:y.y}];else{const L=x>m,T={x:L?g.x+g.width:g.x,y:d(g,u,L)},_={x:L?y.x+y.width:y.x,y:d(y,u,L)},$=Math.max(l,(k?.width??0)/2+10),P=Math.min(T.y,_.y),D=Math.max(T.y,_.y),F=t.filter(R=>R.id!==g.id&&R.id!==y.id&&R.y<D&&R.y+R.height>P),E=Math.max(g.x+g.width+l,y.x+y.width+l,...F.map(R=>R.x+R.width+(k?.width??0)/2+10),...s.filter(R=>R.top<D&&R.bottom>P).map(R=>R.right+$)),B=Math.min(g.x,y.x,...F.map(R=>R.x),...s.filter(R=>R.top<D&&R.bottom>P).map(R=>R.left))-$,q=(k?.width??0)/2,W=a.filter(R=>R.downward===L&&R.top<D&&R.bottom>P);let O=L?Math.max(E,...W.map(R=>R.x+R.halfWidth+q+Wo)):Math.min(B,...W.map(R=>R.x-R.halfWidth-q-Wo));if(!L){const R=a.filter(j=>!j.downward&&(j.from===u.to||j.to===u.from)).toSorted((j,z)=>z.x-j.x),V=j=>{if(W.length||Math.min(T.x,_.x)-j<No+Wo||D-P<(k?.height??0)+No)return!1;const z=(Y,Z)=>({left:Math.min(Y.x,Z.x),right:Math.max(Y.x,Z.x),top:Math.min(Y.y,Z.y),bottom:Math.max(Y.y,Z.y)}),Q=(Y,Z,tt)=>Y.left<Z.right+tt&&Y.right>Z.left-tt&&Y.top<Z.bottom+tt&&Y.bottom>Z.top-tt,rt=(Y,Z,tt)=>[z(Z,{x:Y,y:Z.y}),z({x:Y,y:Z.y},{x:Y,y:tt.y}),z({x:Y,y:tt.y},tt)],et=t.map(Y=>({...z(Y,{x:Y.x+Y.width,y:Y.y+Y.height}),id:Y.id})),J=(r??[]).map(Y=>z(Y,{x:Y.x+Y.width,y:Y.y+Y.height})),at=rt(j,T,_),xt=[...et.filter(Y=>Y.id!==g.id&&Y.id!==y.id),...J,...s];if(at.some(Y=>xt.some(Z=>Q(Y,Z,10))))return!1;const H={left:j-q,right:j+q,top:(P+D-(k?.height??0))/2,bottom:(P+D+(k?.height??0))/2};return[...et,...J,...s].some(Y=>Q(H,Y,8))||H.right+10>Math.min(...t.map(Y=>Y.x+Y.width/2))?!1:a.every(Y=>{const Z=rt(Y.x,Y.start,Y.end),tt={left:Y.x-Y.halfWidth,right:Y.x+Y.halfWidth,top:(Y.top+Y.bottom)/2-Y.halfHeight,bottom:(Y.top+Y.bottom)/2+Y.halfHeight};return at.every(st=>Z.every(It=>!Q(st,It,10)))&&(!k||Z.every(st=>!Q(H,st,10)))&&(!Y.halfWidth||at.every(st=>!Q(tt,st,10)))&&(!k||!Y.halfWidth||!Q(H,tt,6))})};for(const j of R)if(Math.abs(O-j.x)<No){const z=j.x+No;O=V(z)?z:j.x-No}}a.push({x:O,top:P,bottom:D,halfWidth:q,downward:L,from:u.from,to:u.to,start:T,end:_,halfHeight:(k?.height??0)/2}),M=[T,{x:T.x+(L?l:-l),y:T.y},{x:O,y:T.y},{x:O,y:_.y},{x:_.x+(L?l:-l),y:_.y},_]}const A=Ws(M);return[{...u,path:g4(A),points:A}]})}function g4(e,t=Wo){if(e.length===0)return"";const r=[`M ${e[0].x} ${e[0].y}`];let i=e[0],o=!1;const a=s=>{o?Math.abs(s.y-i.y)<.001?r.push(`H ${s.x}`):r.push(`V ${s.y}`):(r.push(`L ${s.x} ${s.y}`),o=!0),i=s};for(let s=1;s<e.length-1;s+=1){const n=e[s-1],l=e[s],c=e[s+1],h=Math.hypot(l.x-n.x,l.y-n.y),d=Math.hypot(c.x-l.x,c.y-l.y),u=Math.min(t,h/2,d/2),f={x:l.x-(l.x-n.x)/h*u,y:l.y-(l.y-n.y)/h*u},p={x:l.x+(c.x-l.x)/d*u,y:l.y+(c.y-l.y)/d*u};a(f),r.push(`Q ${l.x} ${l.y} ${p.x} ${p.y}`),i=p}return a(e[e.length-1]),r.join(" ")}function Ws(e){const t=[],r=(i,o)=>Math.abs(i-o)<.001;for(const i of e){const o=t[t.length-1];if(!(o&&r(o.x,i.x)&&r(o.y,i.y))){for(;t.length>=2;){const a=t[t.length-2],s=t[t.length-1];if(!(r(a.x,s.x)&&r(s.x,i.x)||r(a.y,s.y)&&r(s.y,i.y)))break;t.pop()}t.push(i)}}return t}function p4(e,t,r){const i=e.x+e.width/2,o=e.y+e.height/2,a=t.x+t.width/2,s=t.y+t.height/2,n=a-i,l=s-o;return r?e.y+e.height<=t.y?{fromSide:"bottom",toSide:"top"}:t.y+t.height<=e.y?{fromSide:"top",toSide:"bottom"}:n>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:Math.abs(n)>10?n>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:l>0?{fromSide:"bottom",toSide:"top"}:{fromSide:"top",toSide:"bottom"}}function O1(e,t=0){const r=e.y,i=Math.max(Math.min(e.width,e.height)*.4,28),o=t*12,a=r-i-o,s=e.x+e.width+i+o,n={x:e.x+e.width/2,y:r},l={x:e.x+e.width,y:e.y+e.height/2},c=[n,{x:n.x,y:a},{x:s,y:a},{x:s,y:l.y},l];return{path:nn(c),points:c}}function m4(e,t){const r=new Map(t.map(i=>[i.id,i]));return e.map(i=>{const o=Array.isArray(i.nodeIds)?[...i.nodeIds]:[];t.forEach(g=>{g.group===i.id&&!o.includes(g.id)&&o.push(g.id)});const a=o.map(g=>r.get(g)).filter(Boolean);if(a.length===0)return{...i,x:0,y:0,width:0,height:0};const s=Math.min(...a.map(g=>g.x)),n=Math.min(...a.map(g=>g.y)),l=Math.max(...a.map(g=>g.x+g.width)),c=Math.max(...a.map(g=>g.y+g.height)),h=30,d=ha.headerHeight,u=30,f=Math.max(l-s+h*2,Lu(i.label)),p=(s+l-f)/2;return{...i,x:p,y:n-d,width:f,height:c-n+d+u}})}function y4(e,t,r){if(e.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let i=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y)),a=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));if(t&&t.length>0&&(i=Math.min(i,...t.map(n=>n.x)),o=Math.min(o,...t.map(n=>n.y)),a=Math.max(a,...t.map(n=>n.x+n.width)),s=Math.max(s,...t.map(n=>n.y+n.height))),r&&r.length>0){for(const n of r)if(n.points)for(const l of n.points)i=Math.min(i,l.x),o=Math.min(o,l.y),a=Math.max(a,l.x),s=Math.max(s,l.y)}return{minX:i,minY:o,maxX:a,maxY:s,width:a-i,height:s-o}}var x4=new Set(["$$slots","$$events","$$legacy","children"]),b4=ei('<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"></path>'),C4=ei('<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"></path><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>',1),w4=ei('<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>'),k4=ei('<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"></path>'),S4=ei('<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>'),v4=ei('<path d="M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"></path>'),T4=ei('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');function D1(e,t){if(new.target)return _o({component:D1,...e});Ao(t,!0);const r=pC();let i=ze(t,"children",7),o=oC(t,x4),a=Et(()=>t.weight??r.weight??"regular"),s=Et(()=>t.color??r.color??"currentColor"),n=Et(()=>t.size??r.size??"1em"),l=Et(()=>t.mirrored??r.mirrored??!1);function c(M){let{weight:A,color:L,size:T,mirrored:_,...$}=M;return $}var h={get children(){return i()},set children(M){i(M),Me()},$set:Bo,$on:(M,A)=>Lo(t,M,A)},d=T4();Ip(d,(M,A)=>({xmlns:"http://www.w3.org/2000/svg",role:"img",width:S(n),height:S(n),fill:S(s),transform:S(l)?"scale(-1, 1)":void 0,viewBox:"0 0 256 256",...M,...A}),[()=>c(r),()=>c(o)]);var u=Ne(d);{var f=M=>{var A=zo(),L=Qr(A);Hn(L,i),ge(M,A)};ur(u,M=>{i()&&M(f)})}var p=qe(u,2);{var g=M=>{var A=b4();ge(M,A)},m=M=>{var A=C4();zs(),ge(M,A)},y=M=>{var A=w4();ge(M,A)},x=M=>{var A=k4();ge(M,A)},C=M=>{var A=S4();ge(M,A)},k=M=>{var A=v4();ge(M,A)},v=M=>{var A=zn();A.nodeValue=(console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'),""),ge(M,A)};ur(p,M=>{S(a)==="bold"?M(g):S(a)==="duotone"?M(m,1):S(a)==="fill"?M(y,2):S(a)==="light"?M(x,3):S(a)==="regular"?M(C,4):S(a)==="thin"?M(k,5):M(v,-1)})}return Fe(d),ge(e,d),Fo(h)}const Lr=(e,t)=>({name:e,component:t}),Jh=Lr("cube",mC),M4={actor:Lr("user",AC),data:Lr("database",qu),data_store:Lr("hard-drive",LC),db:Lr("database",qu),decision:Lr("code-branch",Nu),end:Lr("stop",BC),event:Lr("clock",_C),external:Lr("globe",D1),file:Lr("file-lines",MC),interface:Lr("plug",TC),milestone:Lr("flag",vC),module:Jh,node:Jh,package:Lr("box",SC),process:Lr("gear",kC),queue:Lr("message",wC),router:Lr("code-branch",Nu),server:Lr("server",Ru),service:Lr("server",Ru),start:Lr("play",CC),state:Lr("circle",bC),switch:Lr("right-left",xC),ui_component:Lr("desktop",yC)};function _4(e){return e&&M4[e]||Jh}var Fp=er("<wbr/>"),B4=er('<span class="semantic-filename-unit svelte-u4m0nr"> </span><!>',1),L4=er("<br/>"),A4=er(" <!>",1),F4=er('<div class="node-kind-label svelte-u4m0nr"> </div>'),$4=er('<div class="node-content svelte-u4m0nr"><div class="node-row svelte-u4m0nr"><span class="node-icon svelte-u4m0nr" data-node-icon="" aria-hidden="true"><!></span> <div class="node-copy svelte-u4m0nr"><div class="node-label svelte-u4m0nr"><!></div> <!></div></div></div>');function R1(e,t){if(new.target)return _o({component:R1,...e});Ao(t,!0);let r=ze(t,"node",7),i=ze(t,"editable",7,!1),o=ze(t,"dimmed",7,!1),a=ze(t,"highlighted",7,!1),s=ze(t,"styleConfig",7,Di),n=ze(t,"onMove",7),l=ze(t,"onHover",7),c=ze(t,"onBindingClick",7),h=ce(!1),d=ce(0),u=ce(0),f=ce(void 0);function p(O,R){const V=S(f)?.closest("svg");if(V){const j=V.getScreenCTM();if(j){const z=j.inverse();return{x:z.a*O+z.c*R+z.e,y:z.b*O+z.d*R+z.f}}}return{x:O,y:R}}function g(O){if(!i())return;ft(h,!0);const R=p(O.clientX,O.clientY);ft(d,R.x-r().x),ft(u,R.y-r().y)}function m(O){if(!S(h)||!i())return;const R=p(O.clientX,O.clientY),V=R.x-S(d),j=R.y-S(u);n()?.(V,j)}function y(){ft(h,!1)}function x(){return r().binding?r().binding:r().bindings&&r().bindings.length>0?r().bindings[0]:null}let C=Et(()=>!!x()),k=Et(()=>s()===Di),v=Et(()=>_4(r().kind)),M=Et(()=>S(v).component),A=Et(()=>S(k)?10:s().paddingX),L=Et(()=>S(k)?7:s().paddingY),T=Et(()=>S(k)?2:s().gap),_=Et(()=>S(k)?11:s().kindFontSize),$=Et(()=>["db","store","data_store"].includes(r().kind??"")),P=Et(()=>ku(r().label)),D=Et(()=>{const O=x();if(O)return Ye.diagram_node_openBinding_ariaLabel({label:r().label,type:O.type})});function F(O){const R=x();R&&c()&&c()(O,R)}let E=Et(()=>{const O=["diagram-node-html"];return r().semanticStyle&&O.push(`node-${r().semanticStyle}`),r().kind&&O.push(`node-kind-${r().kind}`),S(C)&&O.push("node-clickable"),i()&&O.push("node-editable"),o()&&O.push("node-dimmed"),a()&&O.push("node-state-highlighted"),O.join(" ")});var B={get node(){return r()},set node(O){r(O),Me()},get editable(){return i()},set editable(O=!1){i(O),Me()},get dimmed(){return o()},set dimmed(O=!1){o(O),Me()},get highlighted(){return a()},set highlighted(O=!1){a(O),Me()},get styleConfig(){return s()},set styleConfig(O=Di){s(O),Me()},get onMove(){return n()},set onMove(O){n(O),Me()},get onHover(){return l()},set onHover(O){l(O),Me()},get onBindingClick(){return c()},set onBindingClick(O){c(O),Me()},$set:Bo,$on:(O,R)=>Lo(t,O,R)},q=zo();ol("mousemove",Iu,m),ol("mouseup",Iu,y);var W=Qr(q);return NC(W,()=>S(C)?"button":"div",!1,(O,R)=>{Ki(O,zt=>ft(f,zt,!0),()=>S(f));var V=()=>l()?.(r().id),j=()=>l()?.(null),z=()=>l()?.(r().id),Q=()=>l()?.(null);Ip(O,()=>({type:S(C)?"button":void 0,role:S(C)?"button":void 0,class:S(E),"data-semantic-style":r().semanticStyle??"default","data-default-style":S(k),"data-state-highlighted":a(),"data-dimmed":o(),"data-store-node":S($),"aria-label":S(D),style:`
333
+ --label-font-size: ${s().labelFontSize??""}px;
334
+ --label-line-height: ${s().labelLineHeight??""};
335
+ --kind-font-size: ${S(_)??""}px;
336
+ --kind-line-height: ${s().kindLineHeight??""};
337
+ --padding-x: ${S(A)??""}px;
338
+ --padding-y: ${S(L)??""}px;
339
+ --gap: ${S(T)??""}px;
340
+ `,onmousedown:g,onclick:F,onmouseenter:V,onmouseleave:j,onfocus:z,onblur:Q}),void 0,void 0,void 0,"svelte-u4m0nr");var rt=$4(),et=Ne(rt),J=Ne(et),at=Ne(J);ea(at,()=>S(M),(zt,Wt)=>{Wt(zt,{size:14,weight:"regular",get"data-icon"(){return S(v).name},"data-weight":"regular","aria-hidden":"true"})}),Fe(J);var xt=qe(J,2),H=Ne(xt),Y=Ne(H);{var Z=zt=>{var Wt=zo(),Zt=Qr(Wt);aa(Zt,17,()=>S(P),Du,($t,Nt,_e)=>{var Ot=B4(),ue=Qr(Ot),$e=kr(ue,!0),Ce=qe(ue);{var we=Tt=>{var Yt=Fp();ge(Tt,Yt)};ur(Ce,Tt=>{_e<S(P).length-1&&Tt(we)})}ar(()=>pr($e,S(Nt))),ge($t,Ot)}),ge(zt,Wt)},tt=zt=>{var Wt=zo(),Zt=Qr(Wt);aa(Zt,17,()=>sc(r().label),Du,($t,Nt)=>{zs();var _e=A4(),Ot=Qr(_e,!0),ue=qe(Ot);{var $e=we=>{var Tt=L4();ge(we,Tt)},Ce=we=>{var Tt=Fp();ge(we,Tt)};ur(ue,we=>{S(Nt).hardBreak?we($e):S(Nt).breakAfter&&we(Ce,1)})}ar(()=>pr(Ot,S(Nt).text)),ge($t,_e)}),ge(zt,Wt)};ur(Y,zt=>{S(P)?zt(Z):zt(tt,-1)})}Fe(H),hC(H,(zt,Wt)=>qC?.(zt,Wt),()=>r().label);var st=qe(H,2);{var It=zt=>{var Wt=F4(),Zt=kr(Wt,!0);ar(()=>pr(Zt,r().kind)),ge(zt,Wt)};ur(st,zt=>{r().kind&&zt(It)})}Fe(xt),Fe(et),Fe(rt),ge(R,rt)}),ge(e,q),Fo(B)}var E4=ei('<circle class="edge-origin" r="1.5" aria-hidden="true"></circle>'),P4=ei('<g><defs><mask maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse" style="mask-type: alpha;"><path class="edge-reveal-mask-path" pathLength="1" fill="none" stroke="white" stroke-linecap="round" stroke-linejoin="round"></path></mask></defs><g><path class="edge-path" vector-effect="non-scaling-stroke"></path><!></g></g>');function N1(e,t){if(new.target)return _o({component:N1,...e});Ao(t,!0);let r=ze(t,"edge",7),i=ze(t,"dimmed",7,!1),o=ze(t,"highlighted",7,!1),a=ze(t,"markerScope",7,""),s=ze(t,"terminalGap",7,0),n=ze(t,"motionDelay",7,0),l=ze(t,"onmotionchange",7),c=ce(""),h=ce(1),d=[],u="",f,p="",g,m=Et(()=>`edge-reveal-${a()}-${r().id}`),y=Et(()=>{S(c);const z=[...r().points??[],...d],Q=Math.max(16,s()*3),rt=z.map(Y=>Y.x),et=z.map(Y=>Y.y),J=rt.length>0?Math.min(...rt):0,at=et.length>0?Math.min(...et):0,xt=rt.length>0?Math.max(...rt):1,H=et.length>0?Math.max(...et):1;return{x:J-Q,y:at-Q,width:Math.max(1,xt-J)+Q*2,height:Math.max(1,H-at)+Q*2}});function x(z,Q){if(z.length<2||Q<=0)return z;const rt=z.map(xt=>({...xt})),et=rt.at(-1),J=rt.at(-2),at=Math.hypot(et.x-J.x,et.y-J.y);return at<=Q?z:(et.x-=(et.x-J.x)/at*Q,et.y-=(et.y-J.y)/at*Q,rt)}function C(z){il(()=>l()?.(r().id,z))}function k(z){return g?.ownerSVGElement?.querySelector(`[data-node-id="${CSS.escape(z)}"]`)}function v(z){if(!z)return null;const Q=getComputedStyle(z),rt=(et,J)=>{const at=Number.parseFloat(Q.getPropertyValue(et));return Number.isFinite(at)?at:J};return{x:rt("x",z.x.baseVal.value),y:rt("y",z.y.baseVal.value),width:rt("width",z.width.baseVal.value),height:rt("height",z.height.baseVal.value)}}function M(z,Q,rt=0){if(!Q)return z;const et=Q.x+Q.width/2,J=Q.y+Q.height/2,at=Q.width/2,xt=Q.height/2,H=z.x-et,Y=z.y-J;if(Math.hypot(H,Y)<.001)return z;const tt=Math.abs(H)<.001?1/0:at/Math.abs(H),st=Math.abs(Y)<.001?1/0:xt/Math.abs(Y);return tt<=st?{x:et+Math.sign(H)*(at+rt),y:J+Y*tt}:{x:et+H*st,y:J+Math.sign(Y)*(xt+rt)}}function A(z,Q,rt){const et=1-rt;return 3*et*et*rt*z+3*et*rt*rt*Q+rt**3}function L(z){let Q=0,rt=1,et=z;for(let J=0;J<12;J+=1)A(.16,.3,et)<z?Q=et:rt=et,et=(Q+rt)/2;return A(1,1,et)}function T(z,Q){if(z.length<2)return Array.from({length:Q},()=>z[0]??{x:0,y:0});const rt=z.slice(1).map((J,at)=>Math.hypot(J.x-z[at].x,J.y-z[at].y)),et=rt.reduce((J,at)=>J+at,0);return Array.from({length:Q},(J,at)=>{let xt=et*at/(Q-1),H=0;for(;H<rt.length-1&&xt>rt[H];)xt-=rt[H],H+=1;const Y=z[H],Z=z[H+1],tt=rt[H]?xt/rt[H]:0;return{x:Y.x+(Z.x-Y.x)*tt,y:Y.y+(Z.y-Y.y)*tt}})}xo(()=>{const z=x(r().points??[],s()),Q=s()>0?nn(z):r().path;if(Hs()||u===Q&&f===r()||d.length<2||z.length<2){ft(c,Q,!0),d=z,u=Q,f=r(),p=r().id,ft(h,1),C(!1);return}const et=T(d,24),J=T(z,24),at=p===r().id,xt=d[0],H=d[d.length-1],Y=z[0],Z=z[z.length-1],tt=k(r().from),st=k(r().to),It=at&&Math.abs(Y.x-xt.x-(Z.x-H.x))<1&&Math.abs(Y.y-xt.y-(Z.y-H.y))<1;u=Q,f=r(),p=r().id;let zt=0,Wt;ft(h,0),C(!0);const Zt=_e=>{const ue=Math.max(0,Math.min(1,(_e-$t)/220)),$e=L(ue),Ce=et.map((we,Tt)=>({x:we.x+(J[Tt].x-we.x)*$e,y:we.y+(J[Tt].y-we.y)*$e}));It&&(Ce[0]=z[0],Ce[Ce.length-1]=z[z.length-1]),Ce[0]=M(Ce[0],v(tt)),Ce[Ce.length-1]=M(Ce[Ce.length-1],v(st),s()),d=Ce,ft(h,ue,!0),ft(c,nn(Ce),!0),ue<1?zt=requestAnimationFrame(Zt):(ft(c,Q,!0),d=z,ft(h,1),C(!1))};let $t;const Nt=()=>{$t=performance.now(),zt=requestAnimationFrame(Zt)};return n()>0?Wt=window.setTimeout(Nt,n()):Nt(),()=>{Wt!==void 0&&window.clearTimeout(Wt),cancelAnimationFrame(zt),C(!1)}});let _=Et(()=>{const z=["diagram-edge"];return r().semanticStyle&&z.push(`edge-${r().semanticStyle}`),r().animated&&z.push("edge-animated"),r().dashed&&z.push("edge-dashed"),i()&&z.push("edge-dimmed"),o()&&z.push("edge-state-highlighted"),z.join(" ")});const $=new Set(["danger","success","warning","muted","inactive","highlighted","active"]);let P=Et(()=>a()?`-${a()}`:""),D=Et(()=>r().semanticStyle&&$.has(r().semanticStyle)?`url(#arrowhead-${r().semanticStyle}${S(P)})`:`url(#arrowhead${S(P)})`);var F={get edge(){return r()},set edge(z){r(z),Me()},get dimmed(){return i()},set dimmed(z=!1){i(z),Me()},get highlighted(){return o()},set highlighted(z=!1){o(z),Me()},get markerScope(){return a()},set markerScope(z=""){a(z),Me()},get terminalGap(){return s()},set terminalGap(z=0){s(z),Me()},get motionDelay(){return n()},set motionDelay(z=0){n(z),Me()},get onmotionchange(){return l()},set onmotionchange(z){l(z),Me()},$set:Bo,$on:(z,Q)=>Lo(t,z,Q)},E=P4(),B=Ne(E),q=Ne(B),W=kr(q);Fe(B);var O=qe(B),R=Ne(O),V=qe(R);{var j=z=>{var Q=E4();ar(()=>{fe(Q,"cx",r().points[0].x),fe(Q,"cy",r().points[0].y)}),ge(z,Q)};ur(V,z=>{(r().animated||r().dashed)&&r().points?.[0]&&z(j)})}return Fe(O),Fe(E),Ki(E,z=>g=z,()=>g),ar(z=>{Ji(E,0,Op(S(_))),fe(E,"data-edge-id",r().id),fe(E,"data-edge-from",r().from),fe(E,"data-edge-to",r().to),fe(E,"data-edge-motion-progress",S(h)),fe(q,"id",S(m)),fe(q,"x",S(y).x),fe(q,"y",S(y).y),fe(q,"width",S(y).width),fe(q,"height",S(y).height),fe(W,"d",S(c)),fe(W,"stroke-width",z),fe(O,"mask",`url(#${S(m)})`),fe(R,"d",S(c)),fe(R,"marker-end",S(D))},[()=>Math.max(12,s()*3)]),ge(e,E),Fo(F)}var I4=ei('<g><rect class="group-bg"></rect><text text-anchor="middle" dominant-baseline="middle" class="group-label"> </text></g>');function q1(e,t){if(new.target)return _o({component:q1,...e});Ao(t,!0);let r=ze(t,"group",7),i=ze(t,"dimmed",7,!1),o=ze(t,"onHover",7),a=Et(()=>{const f=["diagram-group"];return r().semanticStyle&&f.push(`group-${r().semanticStyle}`),i()&&f.push("group-dimmed"),f.join(" ")});function s(){o()?.(r().id)}function n(){o()?.(null)}var l={get group(){return r()},set group(f){r(f),Me()},get dimmed(){return i()},set dimmed(f=!1){i(f),Me()},get onHover(){return o()},set onHover(f){o(f),Me()},$set:Bo,$on:(f,p)=>Lo(t,f,p)},c=I4(),h=Ne(c),d=qe(h),u=kr(d,!0);return Fe(c),ar(()=>{Ji(c,0,Op(S(a))),fe(c,"data-group-id",r().id),fe(h,"x",r().x),fe(h,"y",r().y),fe(h,"width",r().width),fe(h,"height",r().height),fe(d,"x",r().x+r().width/2),fe(d,"y",r().y+ha.centerY),pr(u,r().label)}),ol("mouseenter",c,s),ol("mouseleave",c,n),ge(e,c),Fo(l)}var O4=er('<div class="narrative-title svelte-1v8paz2"> </div>'),D4=er('<div class="narrative-text svelte-1v8paz2"> </div>'),R4=er('<div class="narrative svelte-1v8paz2"><!> <!></div>'),N4=er('<div class="text-xs font-medium mb-0.5"> </div>'),q4=er('<div class="text-ui text-subtle leading-snug"> </div>'),W4=er('<div class="p-2.5"><!> <!></div>'),z4=er("<!> <!>",1),H4=er('<div class="navigation-buttons svelte-1v8paz2"><!> <!></div>'),Y4=er('<div class="diagram-controls svelte-1v8paz2"><div class="controls-inner svelte-1v8paz2"><div class="narrative-region svelte-1v8paz2" aria-live="polite" aria-atomic="true"><!></div> <div class="state-navigation svelte-1v8paz2" role="group"><div class="stepper svelte-1v8paz2"></div> <span class="step-counter svelte-1v8paz2"> </span> <!></div></div></div>');function W1(e,t){if(new.target)return _o({component:W1,...e});Ao(t,!0);let r=ze(t,"states",7),i=ze(t,"currentStateId",7),o=ze(t,"onStateChange",7);function a(F){return F?typeof F=="string"?{text:F}:F:null}let s=Et(()=>i()?r().findIndex(F=>F.id===i()):-1),n=Et(()=>S(s)>=0?r()[S(s)]:null),l=ce(-1),c=Et(()=>S(l)<S(s)?"left":"right"),h=ce(null),d=ce(null),u;function f(){ft(l,S(s),!0),S(s)>0&&o()(r()[S(s)-1].id)}function p(){ft(l,S(s),!0),S(s)<r().length-1&&o()(r()[S(s)+1].id)}function g(F){ft(l,S(s),!0),ft(h,null),o()(r()[F].id)}function m(F){u!==void 0&&cancelAnimationFrame(u);const E=r()[F]?.id,B=r(),q=S(d);u=requestAnimationFrame(()=>{u=void 0,!(q!==S(d)||E!==i()||B!==r())&&S(d)?.querySelector(`[data-diagram-step-index="${F}"]`)?.focus({preventScroll:!0})})}function y(F,E){if(r().length<=1)return;let B=E;if(F.key==="ArrowLeft")B=Math.max(0,E-1);else if(F.key==="ArrowRight")B=Math.min(r().length-1,E+1);else if(F.key==="Home")B=0;else if(F.key==="End")B=r().length-1;else return;F.preventDefault(),B!==E&&(g(B),m(B))}Pp(()=>{u!==void 0&&cancelAnimationFrame(u)});var x={get states(){return r()},set states(F){r(F),Me()},get currentStateId(){return i()},set currentStateId(F){i(F),Me()},get onStateChange(){return o()},set onStateChange(F){o(F),Me()},$set:Bo,$on:(F,E)=>Lo(t,F,E)},C=Y4(),k=Ne(C),v=Ne(k),M=Ne(v);{var A=F=>{const E=Et(()=>a(S(n).narrative));var B=zo(),q=Qr(B);Rp(q,()=>S(s),W=>{var O=R4(),R=Ne(O);{var V=Q=>{var rt=O4(),et=kr(rt,!0);ar(()=>pr(et,S(E).title)),ge(Q,rt)};ur(R,Q=>{S(E)?.title&&Q(V)})}var j=qe(R,2);{var z=Q=>{var rt=D4(),et=kr(rt,!0);ar(()=>pr(et,S(E).text)),ge(Q,rt)};ur(j,Q=>{S(E)?.text&&Q(z)})}Fe(O),yo(1,O,()=>Wu,()=>({axis:"x",distance:S(c)==="left"?8:-8,tier:"fast"})),yo(2,O,()=>Wu,()=>({axis:"x",distance:S(c)==="left"?-8:8,tier:"fast"})),ge(W,O)}),ge(F,B)};ur(M,F=>{S(n)?.narrative&&F(A)})}Fe(v);var L=qe(v,2),T=Ne(L);aa(T,23,r,F=>F.id,(F,E,B)=>{const q=Et(()=>a(S(E).narrative));var W=z4(),O=Qr(W);{let j=Et(()=>S(B)===S(s)?"active":""),z=Et(()=>S(B)<S(s)?"completed":""),Q=Et(()=>S(B)===S(s)?"step":void 0),rt=Et(()=>S(B)===S(s)?0:-1),et=Et(()=>Ye.diagram_controls_state_ariaLabel({number:S(B)+1,title:S(q)?.title||Ye.diagram_controls_stateNumber_label({number:S(B)+1})}));Na(O,{variant:"ghost",size:"icon-compact",iconOnly:!0,get class(){return`stepper-dot ${S(j)??""} ${S(z)??""}`},get"data-diagram-step-index"(){return S(B)},get style(){return`anchor-name: --segment-${S(B)??""};`},onclick:()=>g(S(B)),onkeydown:J=>y(J,S(B)),onmouseenter:()=>ft(h,S(B),!0),onmouseleave:()=>ft(h,null),get"aria-current"(){return S(Q)},get tabindex(){return S(rt)},get"aria-label"(){return S(et)}})}var R=qe(O,2);{var V=j=>{RC(j,{get anchor(){return`--segment-${S(B)??""}`},position:"top",class:"rounded-md !pointer-events-none",children:(z,Q)=>{var rt=W4(),et=Ne(rt);{var J=H=>{var Y=N4(),Z=kr(Y,!0);ar(()=>pr(Z,S(q).title)),ge(H,Y)};ur(et,H=>{S(q).title&&H(J)})}var at=qe(et,2);{var xt=H=>{var Y=q4(),Z=kr(Y,!0);ar(()=>pr(Z,S(q).text)),ge(H,Y)};ur(at,H=>{S(q).text&&H(xt)})}Fe(rt),ge(z,rt)},$$slots:{default:!0}})};ur(R,j=>{S(h)===S(B)&&S(q)&&j(V)})}ge(F,W)}),Fe(T);var _=qe(T,2),$=kr(_),P=qe(_,2);{var D=F=>{var E=H4(),B=Ne(E);{let W=Et(()=>S(s)<=0),O=Et(()=>Ye.diagram_controls_previousStep_ariaLabel());Na(B,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:f,get disabled(){return S(W)},get"aria-label"(){return S(O)},children:(R,V)=>{Ks(R,{get icon(){return FC},class:"text-ui"})},$$slots:{default:!0}})}var q=qe(B,2);{let W=Et(()=>S(s)>=r().length-1),O=Et(()=>Ye.diagram_controls_nextStep_ariaLabel());Na(q,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:p,get disabled(){return S(W)},get"aria-label"(){return S(O)},children:(R,V)=>{Ks(R,{get icon(){return $C},class:"text-ui"})},$$slots:{default:!0}})}Fe(E),ge(F,E)};ur(P,F=>{r().length>1&&F(D)})}return Fe(L),Ki(L,F=>ft(d,F),()=>S(d)),Fe(k),Fe(C),ar((F,E)=>{fe(L,"aria-label",F),fe(_,"aria-label",E),pr($,`${S(s)+1}/${r().length??""}`)},[()=>Ye.diagram_controls_walkthrough_ariaLabel(),()=>Ye.diagram_controls_stepCounter_ariaLabel({current:S(s)+1,total:r().length})]),ge(e,C),Fo(x)}function ch(e,t){const r=new Set(e),i=new Set(t);return{shared:t.filter(o=>r.has(o)),departing:e.filter(o=>!i.has(o)),entering:t.filter(o=>!r.has(o))}}function $p(e){const t=e.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number);return t?.every(Number.isFinite)?t:null}function X4(e,t){if(e===t)return!0;const r=$p(e),i=$p(t);return r!==null&&i!==null&&r.length===i.length&&r.every((o,a)=>Math.abs(o-i[a])<.001)}function G4(e,t){return X4(e,t)?[]:[{transform:e},{transform:t}]}function j4(e,t,r,i,o){const a=t.x-e.x,s=t.y-e.y,n=Math.hypot(a,s),l=Math.abs(a)>=Math.abs(s)?r.width:r.height;if(n<=l+2*o)return[];const c=(l/2+o)/n,h=1-c,d=[];for(const p of i){const g=p.padding??0,m=[[e.x,a,p.x-r.width/2-g,p.x+p.width+r.width/2+g],[e.y,s,p.y-r.height/2-g,p.y+p.height+r.height/2+g]];let y=c,x=h;for(const[C,k,v,M]of m)if(k===0)(C<v||C>M)&&(x=-1);else{const A=(v-C)/k,L=(M-C)/k;y=Math.max(y,Math.min(A,L)),x=Math.min(x,Math.max(A,L))}y<=x&&d.push([y,x])}d.sort((p,g)=>p[0]-g[0]);const u=[];let f=c;for(const[p,g]of d)p>f&&u.push((f+p)/2),f=Math.max(f,g);return f<h&&u.push((f+h)/2),u}function U4(e,t){return(e===null||typeof e!="object"&&typeof e!="function")&&Object.is(e,t)}function ta(e,t,r=[]){const i=Reflect.ownKeys(e);return i.length===Reflect.ownKeys(t).length&&i.every(o=>Object.hasOwn(t,o)&&(r.includes(o)||U4(Reflect.get(e,o),Reflect.get(t,o))))}function qn(e,t,r){return e===void 0&&t===void 0||!!e&&!!t&&e.length===t.length&&e.every((i,o)=>r(i,t[o]))}function V4(e,t){return e!==null&&ta(e,t,["nodes","edges","groups","bounds"])&&ta(e.bounds,t.bounds)&&qn(e.nodes,t.nodes,(r,i)=>ta(r,i,["size"])&&(r.size===void 0&&i.size===void 0||!!r.size&&!!i.size&&ta(r.size,i.size)))&&qn(e.edges,t.edges,(r,i)=>ta(r,i,["points"])&&qn(r.points,i.points,ta))&&qn(e.groups,t.groups,ta)}var Z4=er('<div class="diagram-actions svelte-10vg205" role="toolbar"><!></div>'),K4=er('<div class="diagram-feedback svelte-10vg205" role="alert"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),Q4=er('<div class="diagram-feedback svelte-10vg205" role="status"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),J4=ei("<g><!></g>"),tP=ei('<g class="edge-reveal"><!></g>'),Ep=er('<div class="edge-label-html"><span class="edge-label-text"> </span></div>'),eP=ei("<foreignObject><!></foreignObject>"),rP=ei('<foreignObject class="diagram-geometry-motion svelte-10vg205"><!></foreignObject>'),iP=ei('<g class="diagram-geometry-motion svelte-10vg205"><!><!><!><!></g>'),oP=er('<div class="diagram-content svelte-10vg205"><svg class="diagram-svg-layer svelte-10vg205"><defs><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker></defs><!></svg></div>'),aP=er('<div class="diagram-footer svelte-10vg205"><!></div>'),sP=er("<div><!> <div><!></div> <!></div>");function nP(e,t){if(new.target)return _o({component:nP,...e});Ao(t,!0);let r=ze(t,"diagram",7),i=ze(t,"onUpdate",7),o=ze(t,"editable",7,!1),a=ze(t,"styleConfig",7,Di),s=ze(t,"onBindingClick",7),n=ze(t,"viewResetKey",7);const l=32,c=12,h=10,d=5,u=.5;let f=ce(!1),p=ce(0),g,m;function y(nt){return S(f)||Hs(S(T)?.ownerDocument)?0:nt}let x=ce(null),C=null,k=ce(!1),v=ce(!1),M=ce(1),A=ce(900),L=ce(900),T=ce(null),_=ce(null),$=ce(null),P=ce(void 0),D=ce(!1),F,E,B=ce(0);td(()=>{let nt=!1;return document.fonts?.ready.then(()=>{nt||ft(B,S(B)+1)}),()=>{nt=!0}});let q=ce(hi(r().currentStateId??(r().states&&r().states.length>0?r().states[0].id:void 0))),W=Et(()=>r().states?.find(nt=>nt.id===S(q))??null),O=ce(hi(S(q))),R,V=Et(()=>r().states?.find(nt=>nt.id===S(O))??S(W)),j=Et(()=>S(W)?.camera?.zoom??1),z=Et(()=>S(W)!==null),Q=Et(()=>S(_)!==null&&S(_)>0?S(_):S(T)?.clientWidth??null),rt=Et(()=>S(L)<500||S(z)&&(S($)??S(Q)??0)>0&&(S($)??S(Q)??0)<500),et=Et(()=>S(rt)?4:l),J=Et(()=>S(rt)?{...a(),maxWidth:Math.min(a().maxWidth,150),maxLines:Math.max(a().maxLines,5),paddingX:Math.min(a().paddingX,10)}:a()),at=Et(()=>S(j)*(S(v)||S(z)?S(M):1)),xt=Et(()=>Math.max(c/S(J).labelFontSize,h/(a()===Di?11:S(J).kindFontSize))),H=Et(()=>(d+u)/S(at)),Y=Et(()=>8/S(at)),Z=ce(!1),tt=ce(hi([])),st=ce(hi([])),It=ce(hi([])),zt=ce(hi([])),Wt=ce(hi([])),Zt=ce(hi([])),$t=ce(hi(new Map)),Nt=ce(hi([])),_e=ce(hi([])),Ot=ce(hi([])),ue=ce(hi(new Map)),$e=ce(!1),Ce=ce(!1),we=ce(!0);const Tt=new Set;let Yt=ce(void 0),w=ce(!0),G=0,ht,pt=0,ut=ce("settled"),I=[];const U=180,K="cubic-bezier(0.65, 0, 0.35, 1)",ct=220,yt=160,vt=180,ot=180,kt=60,Xt=ot-kt;function re(){const nt=S(Yt)?.querySelector(".diagram-svg-layer"),Pt=S(Yt)?.querySelector(".diagram-geometry-motion")?.getScreenCTM?.();return{camera:nt?getComputedStyle(nt).transform:null,screenMatrix:Pt?new DOMMatrix([Pt.a,Pt.b,Pt.c,Pt.d,Pt.e,Pt.f]):null}}function Kt(nt){if(y(1)===0||!S(Yt))return[];const bt=S(Yt).querySelector(".diagram-svg-layer"),Pt=S(Yt).querySelector(".diagram-svg-layer > g");if(!bt||!Pt||!nt.camera)return[];for(const ae of bt.getAnimations({subtree:!1}))ae.cancel();const Qt=getComputedStyle(bt).transform;let te=nt.camera;const _t=nt.screenMatrix?bt.getScreenCTM():null;if(_t&&nt.screenMatrix){const ae=new DOMMatrix([_t.a,_t.b,_t.c,_t.d,_t.e,_t.f]),pe=new DOMMatrix(getComputedStyle(Pt).transform);te=new DOMMatrix(Qt).multiply(ae.inverse()).multiply(nt.screenMatrix).multiply(pe.inverse()).toString()}const le=G4(te,Qt);if(le.length===0)return[];const oe=bt.animate(le,{duration:U,easing:K});return oe.finished.catch(()=>{}),[oe]}function xe(nt,{delay:bt=0,duration:Pt}){return{delay:bt,duration:y(Pt),easing:zu,css:Qt=>`--edge-reveal-progress: ${Qt};`}}function Ee(){return S(Yt)?.getAnimations?S(Yt).getAnimations({subtree:!0}).filter(nt=>{const bt=Number(nt.effect?.getComputedTiming().endTime);return Number.isFinite(bt)&&nt.playState!=="finished"&&nt.playState!=="idle"}):[]}async function ri(nt){if(await hh(),await new Promise(Pt=>requestAnimationFrame(()=>Pt())),nt!==pt)return!1;const bt=Ee();return await Promise.allSettled(bt.map(Pt=>Pt.finished)),nt===pt}async function lo(nt,bt,Pt){if(Pt.length>0&&(await Promise.allSettled(Pt.map(te=>te.finished)),nt!==pt)||S(Nt).length===0&&S(Dt).length>0&&(ft(ut,"scene"),ft(we,!0),Me(),!await ri(nt))||(ft(ut,"exit"),ft($e,!1),ft(Ce,!1),ft(O,bt,!0),Me(),!await ri(nt)))return;const Qt=re();ft(zt,[],!0),ft(Wt,[],!0),ft(Zt,[],!0),ft($t,new Map,!0),ft(Nt,[],!0),ft(_e,[],!0),ft(Ot,[],!0),ft(ue,new Map,!0),ft(ut,"camera"),Me(),I=Kt(Qt),await ri(nt)&&(ft(ut,"scene"),ft(we,!0),Me())}function co(){if(!S(Yt))return"";const nt=S(Yt).getBoundingClientRect(),bt=[".diagram-content",".diagram-svg-layer",".diagram-geometry-motion","[data-group-id]",".group-bg",".group-label",".diagram-edge",".edge-path",".edge-label-container","[data-node-id]",".diagram-node-html"].join(",");return[...S(Yt).querySelectorAll(bt)].map(Pt=>{const Qt=Pt.getBoundingClientRect(),te=getComputedStyle(Pt);return[Pt.tagName,Pt.getAttribute("data-node-id"),Pt.getAttribute("data-edge-id"),Pt.getAttribute("data-group-id"),Pt.getAttribute("class"),Pt.getAttribute("d"),(Qt.x-nt.x).toFixed(3),(Qt.y-nt.y).toFixed(3),Qt.width.toFixed(3),Qt.height.toFixed(3),te.opacity,te.transform].join("|")}).join(`
341
+ `)}function xs(nt,bt){ht=requestAnimationFrame(()=>{if(nt!==G)return;E?.();const Pt=co(),Qt=S(ut)==="camera"||S(ut)==="exit"||Tt.size>0||Ee().length>0;if(!Qt&&bt!==void 0&&Pt===bt){if(S(Z)){ft(Z,!1),ht=void 0,hh().then(()=>{nt===G&&xs(nt)});return}ft(w,!0),ft(ut,"settled"),ii(),ht=void 0;return}xs(nt,Qt?void 0:Pt)})}function bs(){G+=1;const nt=G;ht!==void 0&&cancelAnimationFrame(ht),ht=void 0,y(1)===0&&ft(Z,!1),ft(w,!1),queueMicrotask(()=>{nt===G&&xs(nt)})}Pp(()=>{ii(),pt+=1,G+=1,ht!==void 0&&cancelAnimationFrame(ht),g!==void 0&&cancelAnimationFrame(g),Ko();for(const nt of I)nt.cancel();I=[],Tt.clear()});let it=ce(null),dt=ce(null),Ct=Et(()=>{if(!S(it))return new Set;const nt=new Set;return nt.add(S(it)),r().model.edges.forEach(bt=>{bt.from===S(it)&&nt.add(bt.to),bt.to===S(it)&&nt.add(bt.from)}),nt}),Bt=Et(()=>{if(!S(it))return new Set;const nt=new Set;return r().model.edges.forEach(bt=>{(bt.from===S(it)||bt.to===S(it))&&nt.add(bt.id)}),nt}),wt=Et(()=>{if(!S(dt))return new Set;const nt=new Set;if(r().model.groups){const bt=r().model.groups.find(Pt=>Pt.id===S(dt));bt?.nodeIds&&bt.nodeIds.forEach(Pt=>nt.add(Pt))}return r().model.nodes.forEach(bt=>{bt.group===S(dt)&&nt.add(bt.id)}),nt}),X=Et(()=>{if(!S(dt))return new Set;const nt=S(wt),bt=new Set;return r().model.edges.forEach(Pt=>{(nt.has(Pt.from)||nt.has(Pt.to))&&bt.add(Pt.id)}),bt}),St=Et(()=>S(V)?.highlightedNodes&&S(V).highlightedNodes.length>0?new Set(S(V).highlightedNodes):null),At=Et(()=>S(V)?.highlightedEdges&&S(V).highlightedEdges.length>0?new Set(S(V).highlightedEdges):null),Rt=Et(()=>S(St)!==null||S(At)!==null),qt=Et(()=>S(W)?.visibleNodes??r().model.nodes.map(nt=>nt.id)),Ut=Et(()=>new Set(S(qt))),de=Et(()=>S(W)?.visibleEdges??r().model.edges.map(nt=>nt.id)),Se=Et(()=>S(de).filter(nt=>{const bt=r().model.edges.find(Pt=>Pt.id===nt);return bt&&S(Ut).has(bt.from)&&S(Ut).has(bt.to)})),Dt=Et(()=>S(x)?.nodes.filter(nt=>S(qt).includes(nt.id))??[]),Ae=Et(()=>S(x)?.edges.filter(nt=>S(Se).includes(nt.id))??[]),Ue=Et(()=>{S(B);const nt=new Map,bt=[],Pt=(le,oe,ae,pe,be=0)=>S(Dt).some(ye=>!(le+ae+be<ye.x||le-be>ye.x+ye.width||oe+pe+be<ye.y||oe-be>ye.y+ye.height)),Qt=(le,oe,ae,pe,be=6)=>bt.some(ye=>!(le+ae+be<ye.x||le-be>ye.x+ye.width||oe+pe+be<ye.y||oe-be>ye.y+ye.height)),te=(le,oe,ae,pe)=>(S(x)?.groups??[]).some(be=>le<be.x+be.width&&le+ae>be.x&&oe<be.y+34&&oe+pe>be.y),_t=(le,oe,ae,pe,be,ye=2)=>S(Ae).some(Fr=>Fr.id!==be&&(Fr.points??[]).slice(0,-1).some((xi,Eo)=>{const ci=Fr.points[Eo+1],Vr=Math.max(1,Math.ceil(Math.hypot(ci.x-xi.x,ci.y-xi.y)/4));for(let bi=0;bi<=Vr;bi+=1){const Po=xi.x+(ci.x-xi.x)*bi/Vr,yr=xi.y+(ci.y-xi.y)*bi/Vr;if(Po>le-ye&&Po<le+ae+ye&&yr>oe-ye&&yr<oe+pe+ye)return!0}return!1}));for(const le of S(Ae)){if(!le.label||!le.points||le.points.length<2)continue;const oe=le.points,ae=oe.length===2&&Math.abs(oe[0].x-oe[1].x)<.5?Math.abs(oe[0].y-oe[1].y):void 0,{width:pe,height:be,lines:ye}=Kr(le.label,S(rt)?sn(le.label??"",ae):void 0),Fr=ye>3,xi=r().model.edges.find(({id:yr})=>yr===le.id),Eo=xi&&r().model.edges.find(yr=>yr.from===xi.to&&yr.to===xi.from);if(Eo&&oe.length===2){const yr=Kr(Eo.label??"",S(rt)?sn(Eo.label??""):void 0),Ze=Math.abs(oe[1].x-oe[0].x),nr=Math.abs(oe[1].y-oe[0].y),_r=Math.max(Ze,nr),tr=Ze>=nr?(pe+yr.width)/2:(be+yr.height)/2,Le=S(Se).includes(Eo.id)?Math.max(.05,Math.min(.35,(1-(tr+6)/_r)/2)):.35,wr=Ze>=nr?pe:be,$r=Math.min(.5,(wr/2+4/S(at))/_r),hr=Math.max($r,Math.min(1-$r,Le)),dr=oe[0].x+(oe[1].x-oe[0].x)*hr-pe/2,Rr=oe[0].y+(oe[1].y-oe[0].y)*hr-be/2;if(!Pt(dr,Rr,pe,be,8)&&!te(dr,Rr,pe,be)&&!_t(dr,Rr,pe,be,le.id)&&!Qt(dr,Rr,pe,be,1)){nt.set(le.id,{x:dr,y:Rr,width:pe,height:be,truncated:Fr}),bt.push({x:dr,y:Rr,width:pe,height:be});continue}}const ci=[],Vr=[],bi=[],Po=(yr,Ze,nr,_r=ci)=>{const tr=yr-pe/2,Le=Ze-be/2;if(Pt(tr,Le,pe,be,8)||te(tr,Le,pe,be)||_t(tr,Le,pe,be,le.id))return;const wr={x:tr,y:Le,score:nr};if(Qt(tr,Le,pe,be)){Qt(tr,Le,pe,be,1)||Vr.push(wr);return}_r.push(wr)};for(let yr=0;yr<oe.length-1;yr++){const Ze=oe[yr],nr=oe[yr+1],_r=Math.abs(nr.x-Ze.x),tr=Math.abs(nr.y-Ze.y),Le=Math.hypot(_r,tr);if(Le<8)continue;const wr=_r>=tr,$r=wr?pe:be,hr=[.5,.25,.75,.2,.3,.4,.6,.7,.8,.125,.875,.05,.1,.15,.85,.9,.95];for(const dr of hr){const Rr=Le*Math.min(dr,1-dr);if(Le*Math.max(dr,1-dr)<$r/2+S(Y))continue;const Cs=Ze.x+(nr.x-Ze.x)*dr,oi=Ze.y+(nr.y-Ze.y)*dr;Po(Cs,oi,Le+(wr?1e3:0)-Math.abs(dr-.5)*16,Rr>=$r/2+S(Y)?ci:bi)}}if(!ci.length&&!Vr.length&&!bi.length){const yr=[...S(Dt).map(Ze=>({...Ze,padding:8})),...(S(x)?.groups??[]).map(Ze=>({...Ze,height:34,padding:0})),...bt.map(Ze=>({...Ze,padding:1})),...S(Ae).filter(Ze=>Ze.id!==le.id).flatMap(Ze=>(Ze.points??[]).slice(1).map((nr,_r)=>{const tr=Ze.points[_r];return{x:Math.min(tr.x,nr.x),y:Math.min(tr.y,nr.y),width:Math.abs(nr.x-tr.x),height:Math.abs(nr.y-tr.y),padding:2}}))];for(let Ze=1;Ze<oe.length;Ze+=1){const nr=oe[Ze-1],_r=oe[Ze],tr=Math.hypot(_r.x-nr.x,_r.y-nr.y),Le=Math.abs(_r.x-nr.x)>=Math.abs(_r.y-nr.y)?1e3:0;for(const wr of j4(nr,_r,{width:pe,height:be},yr,S(Y)))Po(nr.x+(_r.x-nr.x)*wr,nr.y+(_r.y-nr.y)*wr,tr+Le-Math.abs(wr-.5)*16)}}if(ci.length>0||Vr.length>0||bi.length>0){const yr=ci.length>0?ci:Vr.length>0?Vr:bi;yr.sort((nr,_r)=>_r.score-nr.score);const Ze=yr[0];nt.set(le.id,{x:Ze.x,y:Ze.y,width:pe,height:be,truncated:Fr}),bt.push({x:Ze.x,y:Ze.y,width:pe,height:be})}else if(oe.length>=2){const[yr,Ze]=oe.slice(0,-1).map((wr,$r)=>[wr,oe[$r+1]]).toSorted(([wr,$r],[hr,dr])=>Math.hypot(dr.x-hr.x,dr.y-hr.y)-Math.hypot($r.x-wr.x,$r.y-wr.y))[0],nr=(yr.x+Ze.x)/2,_r=(yr.y+Ze.y)/2,tr=nr-pe/2,Le=_r-be/2;nt.set(le.id,{x:tr,y:Le,width:pe,height:be,truncated:Fr}),bt.push({x:tr,y:Le,width:pe,height:be})}}return nt}),Be=Et(()=>{const nt=new Set(S(tt)),bt=S(we)?S(Dt):S(Dt).filter(_t=>!nt.has(_t.id)),Pt=new Map(S(Nt).map(_t=>[_t.id,_t])),Qt=S($e)?bt.map(_t=>Pt.get(_t.id)??_t):bt;if(!S(Ce))return Qt;const te=new Set(Qt.map(_t=>_t.id));return[...Qt,...S(zt).filter(_t=>!te.has(_t.id))]}),ne=Et(()=>{const nt=new Set(S(st)),bt=S(we)?S(Pe):S(Pe).filter(_t=>!nt.has(_t.id)),Pt=new Map(S(_e).map(_t=>[_t.id,_t])),Qt=S($e)?bt.map(_t=>Pt.get(_t.id)??_t):bt;if(!S(Ce))return Qt;const te=new Set(Qt.map(_t=>_t.id));return[...Qt,...S(Wt).filter(_t=>!te.has(_t.id))]}),Ft=Et(()=>{const nt=new Set(S(It)),bt=S(we)?S(Ae):S(Ae).filter(_t=>!nt.has(_t.id)),Pt=new Map(S(Ot).map(_t=>[_t.id,_t])),Qt=S($e)?bt.map(_t=>Pt.get(_t.id)??_t):bt;if(!S(Ce))return Qt;const te=new Set(Qt.map(_t=>_t.id));return[...Qt,...S(Zt).filter(_t=>!te.has(_t.id))]}),ie=Et(()=>{const nt=S(Ce)?new Map(S($t)):new Map;for(const[bt,Pt]of S(Ue))nt.set(bt,Pt);if(S($e))for(const[bt,Pt]of S(ue))nt.set(bt,Pt);return nt}),Pe=Et(()=>{if(!S(x)?.groups)return[];if(S(W)?.visibleGroups)return S(x).groups.filter(nt=>S(W).visibleGroups.includes(nt.id));if(S(W)?.highlightedNodes&&S(W).highlightedNodes.length>0){const nt=new Set(S(W).highlightedNodes);return S(x).groups.filter(bt=>Array.isArray(bt.nodeIds)&&bt.nodeIds.some(Pt=>nt.has(Pt)))}return S(x).groups.filter(nt=>Array.isArray(nt.nodeIds)&&nt.nodeIds.some(bt=>S(qt).includes(bt)))});xo(()=>{S(B);try{const nt=S(W)?r().model.groups?.filter(te=>{if(S(W).visibleGroups)return S(W).visibleGroups.includes(te.id);const _t=S(W).highlightedNodes?.length?S(W).highlightedNodes:S(qt);return te.nodeIds?.some(le=>_t.includes(le)&&S(Ut).has(le))}).map(te=>({...te,nodeIds:te.nodeIds?.filter(_t=>S(Ut).has(_t))})):r().model.groups,bt=new Set(nt?.map(te=>te.id)),Pt=S(W)?{...r().model,nodes:r().model.nodes.filter(te=>S(Ut).has(te.id)).map(te=>te.group&&!bt.has(te.group)?{...te,group:void 0}:te),edges:r().model.edges.filter(te=>S(Se).includes(te.id)),groups:nt}:r().model,Qt=JE(Pt,S(W)?{...r().baseView,layout:{...r().baseView.layout,spacing:Math.min(r().baseView.layout.spacing??80,S(rt)?40:56)}}:r().baseView,r().grammar,S(J),S(A));V4(C,Qt)||(C=Qt,ft(x,Qt,!0)),ft(k,!1),bs()}catch{C=null,ft(x,null),ft(k,!0)}});let ke=Et(()=>S(W)?.camera?.pan??null),Ie=Et(()=>S(W)?.camera?.focus??null),Ve=ce(!1);function Oe(){ft(Z,!1),ft(ut,"scene"),ft($e,!1),ft(Ce,!1),ft(we,!0),ft(tt,[],!0),ft(st,[],!0),ft(It,[],!0),ft(zt,[],!0),ft(Wt,[],!0),ft(Zt,[],!0),ft($t,new Map,!0),ft(Nt,[],!0),ft(_e,[],!0),ft(Ot,[],!0),ft(ue,new Map,!0),ft(O,S(q),!0)}lC(()=>{const nt=r().id,bt=r().states?.map(Qt=>Qt.id)??[],Pt=r().currentStateId;il(()=>{if(R===void 0){R=nt;return}const Qt=_t=>_t===void 0?bt.length===0:bt.includes(_t);if(nt===R&&Qt(S(q))&&Qt(S(O)))return;const te=nt===R&&Qt(S(q));R=nt,pt+=1;for(const _t of I)_t.cancel();I=[],Ko(),ii(),Tt.clear(),te||ft(q,bt.find(_t=>_t===Pt)??bt[0],!0),Oe(),ft(p,S(p)+1)})}),xo(()=>{if(!S(T))return;const nt=S(T).closest(".node-diagram_block"),bt=nt??S(Yt)??S(T);let Pt=bt.clientWidth;il(()=>{ft($,nt?.clientWidth??null,!0),ft(_,S(T).clientWidth,!0),zi()});const Qt=new ResizeObserver(()=>{if(S(z)&&S(_)!==null&&Math.abs(bt.clientWidth-Pt)>.5){ft(f,!0),ii(),pt+=1;for(const te of I)te.cancel();I=[],Tt.clear(),Oe()}if(Pt=bt.clientWidth,ft($,nt?.clientWidth??null,!0),ft(_,S(T).clientWidth,!0),zi(),Me(),S(f)){ft(p,S(p)+1),Me();for(const te of Ee())te.finish();g!==void 0&&cancelAnimationFrame(g),g=requestAnimationFrame(()=>{ft(f,!1),g=void 0})}});return Qt.observe(S(T)),bt!==S(T)&&Qt.observe(bt),()=>Qt.disconnect()});let ve=Et(()=>{const nt=S(ke)?.x??0,bt=S(ke)?.y??0;if(S(z))return`scale(${S(at)}) translate(calc(-50% + ${nt/S(at)}px), calc(-50% + ${bt/S(at)}px))`;const Pt=[];return S(ke)&&Pt.push(`translate(${nt}px, ${bt}px)`),S(at)!==1&&Pt.push(`scale(${S(at)})`),Pt.length>0?Pt.join(" "):void 0});xo(()=>{if(!S(Ie)||!S(x)||!S(T))return;const nt=S(x).nodes.find(be=>be.id===S(Ie));if(!nt)return;const bt=S(Ge)??S(x).bounds,Pt=nt.x+nt.width/2-(bt.minX-S(et)),Qt=nt.y+nt.height/2-(bt.minY-S(et)),te=Pt*S(j),_t=Qt*S(j),le=S(T).clientWidth,oe=S(T).clientHeight,ae=S(ke)?.x??0,pe=S(ke)?.y??0;S(T).scrollTo({left:Math.max(0,te+ae*S(j)-le/2),top:Math.max(0,_t+pe*S(j)-oe/2),behavior:y(1)===0?"auto":"smooth"})});function me(nt=!0){if(!S(x))return null;if(!S(W)){let{minX:ae,minY:pe,maxX:be,maxY:ye}=S(x).bounds;for(const Fr of S(Ue).values())ae=Math.min(ae,Fr.x),pe=Math.min(pe,Fr.y),be=Math.max(be,Fr.x+Fr.width),ye=Math.max(ye,Fr.y+Fr.height);return{minX:ae,minY:pe,maxX:be,maxY:ye,width:be-ae,height:ye-pe}}const bt=nt?[...S(Dt),...S(zt),...S(Nt)]:S(Dt),Pt=nt?[...S(Ae),...S(Zt),...S(Ot)]:S(Ae),Qt=nt?[...S(Pe),...S(Wt),...S(_e)]:S(Pe);if(bt.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let te=Math.min(...bt.map(ae=>ae.x)),_t=Math.min(...bt.map(ae=>ae.y)),le=Math.max(...bt.map(ae=>ae.x+ae.width)),oe=Math.max(...bt.map(ae=>ae.y+ae.height));for(const ae of Qt)te=Math.min(te,ae.x),_t=Math.min(_t,ae.y),le=Math.max(le,ae.x+ae.width),oe=Math.max(oe,ae.y+ae.height);for(const ae of Pt)if(ae.points)for(const pe of ae.points)te=Math.min(te,pe.x-4),_t=Math.min(_t,pe.y-4),le=Math.max(le,pe.x+4),oe=Math.max(oe,pe.y+4);for(const ae of[...S(Ue).values(),...nt?S($t).values():[],...nt?S(ue).values():[]])te=Math.min(te,ae.x),_t=Math.min(_t,ae.y),le=Math.max(le,ae.x+ae.width),oe=Math.max(oe,ae.y+ae.height);return{minX:te,minY:_t,maxX:le,maxY:oe,width:le-te,height:oe-_t}}let Ge=Et(()=>me(!0)),Jt=Et(()=>S(Ge)?S(Ge).width+S(et)*2:800),ir=Et(()=>S(Ge)?S(Ge).height+S(et)*2:600),mr=Et(()=>S(Jt)*S(at)),sr=Et(()=>(S(x)?S(Jt)*S(j)*Math.max(1,S(xt)):0)+16),mi=Et(()=>(S(ir)+6)*S(at)),Wi=Et(()=>Math.ceil((S(ir)+6)*S(at)+20)),fr=Et(()=>S(Wi)),yi=Et(()=>S(z)&&(S(P)!==void 0&&S(fr)>S(P)*.9+1||S(Q)!==null&&S(mr)+16>S(Q)+1));function ii(){ft(D,!1),E=void 0,F?.(),F=void 0}function li(){if(ii(),!S(Yt))return;ft(D,!0);const nt=S(Yt),bt=[];for(let _t=nt.parentElement;_t;_t=_t.parentElement)/(auto|scroll)/.test(getComputedStyle(_t).overflowY)&&bt.push(_t);const Pt=document.scrollingElement;Pt&&!bt.includes(Pt)&&bt.push(Pt);const Qt=bt.map(_t=>({element:_t,value:_t.style.getPropertyValue("overflow-anchor"),priority:_t.style.getPropertyPriority("overflow-anchor")}));for(const{element:_t}of Qt)_t.style.setProperty("overflow-anchor","none");const te=()=>{E=void 0};for(const _t of["wheel","touchstart","keydown"])window.addEventListener(_t,te,{capture:!0,passive:!0});F=()=>{for(const{element:_t,value:le,priority:oe}of Qt)le?_t.style.setProperty("overflow-anchor",le,oe):_t.style.removeProperty("overflow-anchor");for(const _t of["wheel","touchstart","keydown"])window.removeEventListener(_t,te,!0)},E=()=>{const _t=nt.querySelector(".diagram-footer");if(_t)for(const le of bt){const oe=le.getBoundingClientRect(),ae=le===Pt?0:Math.max(0,oe.top+le.clientTop),pe=le===Pt?window.innerHeight:Math.min(window.innerHeight,oe.top+le.clientTop+le.clientHeight);if(pe<=ae)continue;const be=_t.getBoundingClientRect(),ye=be.height<=pe-ae?be:_t.querySelector(".state-navigation").getBoundingClientRect(),Fr=ye.bottom>pe?ye.bottom-pe:ye.top<ae?ye.top-ae:0;Math.abs(Fr)>.5&&le.scrollBy({top:Fr,behavior:"instant"})}}}let Ur=Et(()=>S(Ge)?`translate(${-S(Ge).minX+S(et)}px, ${-S(Ge).minY+S(et)}px)`:"translate(0, 0)"),wa=Et(()=>S(Ge)?`translate(${-S(Ge).minX+S(et)}, ${-S(Ge).minY+S(et)})`:"translate(0, 0)");function zi(){if(!S(v)&&!S(z)||!S(T)){ft(M,1);return}const nt=Math.max(1,S(T).clientWidth-16),bt=Math.max(1,(S($)??S(T).clientWidth)-16),Pt=S(z)?Number.POSITIVE_INFINITY:Math.max(1,S(T).clientHeight-16),Qt=Math.max(1,S(Jt)*S(j)),te=Math.max(1,S(ir)*S(j)),_t=S(z)&&bt>=500&&["TB","BT"].includes(r().baseView.layout.direction??"")?500:160;ft(L,Math.max(_t,bt/S(xt)-l*2),!0),ft(A,Math.max(_t,bt/S(xt)-S(et)*2),!0),ft(M,Math.min(S($)===null?1.25:Math.max(1,S(xt)),Math.max(S(xt),Math.min(nt/Qt,Pt/te))),!0)}function Ko(){m!==void 0&&cancelAnimationFrame(m),m=void 0}function Hi(){Ko(),ft(v,!S(v)),zi(),m=requestAnimationFrame(()=>{m=void 0,zi(),S(T)?.scrollTo({left:0,top:0,behavior:y(1)===0?"auto":"smooth"})})}xo(()=>{S(Jt),S(ir),S(j),(S(v)||S(z))&&zi()}),xo(()=>{if(S(Ve)||!S(x)||!S(T))return;const nt=S(T).clientWidth-16;nt<=0||(S(Jt)*S(j)>nt&&(ft(v,!0),zi()),ft(Ve,!0))});let Bi=ce(void 0),Li=ce(!1);xo(()=>{const nt=n();if(!S(Li)){ft(Bi,nt,!0),ft(Li,!0);return}nt!==S(Bi)&&(ft(Bi,nt,!0),Ko(),ii(),ft(v,!1),ft(M,1),S(T)?.scrollTo({left:0,top:0,behavior:"auto"}))});function lc(nt){if(nt===S(q))return;li();const bt=re();pt+=1;const Pt=pt,Qt=S(Be),te=S(ne),_t=S(Ft),le=new Map(S(ie)),oe=y(1)>0;if(ft(Z,oe),ft(ut,oe?"camera":"scene",!0),bs(),oe&&(ft($e,!0),ft(we,!1),ft(Ce,!0),ft(Nt,Qt,!0),ft(_e,te,!0),ft(Ot,_t,!0),ft(ue,le,!0),ft(tt,r().model.nodes.map(ae=>ae.id).filter(ae=>!Qt.some(pe=>pe.id===ae)),!0),ft(st,(r().model.groups??[]).map(ae=>ae.id).filter(ae=>!te.some(pe=>pe.id===ae)),!0),ft(It,r().model.edges.map(ae=>ae.id).filter(ae=>!_t.some(pe=>pe.id===ae)),!0),ft(zt,Qt,!0),ft(Wt,te,!0),ft(Zt,_t,!0),ft($t,le,!0)),ft(q,nt,!0),Me(),oe){const ae=ch(Qt.map(ye=>ye.id),S(Dt).map(ye=>ye.id)),pe=ch(te.map(ye=>ye.id),S(Pe).map(ye=>ye.id)),be=ch(_t.map(ye=>ye.id),S(Ae).map(ye=>ye.id));ft(tt,ae.entering,!0),ft(st,pe.entering,!0),ft(It,be.entering,!0),ft(Nt,Qt.filter(ye=>ae.shared.includes(ye.id)),!0),ft(_e,te.filter(ye=>pe.shared.includes(ye.id)),!0),ft(Ot,_t.filter(ye=>be.shared.includes(ye.id)),!0),ft(ue,new Map([...le].filter(([ye])=>be.shared.includes(ye))),!0),ft(zt,Qt.filter(ye=>ae.departing.includes(ye.id)),!0),ft(Wt,te.filter(ye=>pe.departing.includes(ye.id)),!0),ft(Zt,_t.filter(ye=>be.departing.includes(ye.id)),!0),ft($t,new Map([...le].filter(([ye])=>be.departing.includes(ye))),!0),Me()}else Oe();I=Kt(bt),oe&&(I.length===0&&ft(ut,"exit"),lo(Pt,nt,I)),i()?.({currentStateId:nt}),E?.()}function ka(nt,bt){(bt?!Tt.has(nt):Tt.has(nt))&&(bt?Tt.add(nt):Tt.delete(nt),bt&&bs())}function z1(nt,bt,Pt){if(!o()||!i())return;const Qt=r().model.nodes.map(te=>te.id===nt?{...te,position:{x:bt,y:Pt}}:te);i()({model:{...r().model,nodes:Qt}})}var H1={get diagram(){return r()},set diagram(nt){r(nt),Me()},get onUpdate(){return i()},set onUpdate(nt){i(nt),Me()},get editable(){return o()},set editable(nt=!1){o(nt),Me()},get styleConfig(){return a()},set styleConfig(nt=Di){a(nt),Me()},get onBindingClick(){return s()},set onBindingClick(nt){s(nt),Me()},get viewResetKey(){return n()},set viewResetKey(nt){n(nt),Me()},$set:Bo,$on:(nt,bt)=>Lo(t,nt,bt)},Yi=sP();let Au,Fu;var $u=Ne(Yi);{var Y1=nt=>{var bt=Z4(),Pt=Ne(bt);{let Qt=Et(()=>S(v)?Ye.diagram_renderer_actualSize_ariaLabel():Ye.diagram_renderer_fitToWidth_ariaLabel()),te=Et(()=>S(v)?Ye.diagram_renderer_actualSize_ariaLabel():Ye.diagram_renderer_fitToWidth_ariaLabel());Na(Pt,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-fit-button",onclick:Hi,get"aria-pressed"(){return S(v)},get"aria-label"(){return S(Qt)},get tooltip(){return S(te)},children:(_t,le)=>{{let oe=Et(()=>S(v)?Dp:EC);Ks(_t,{get icon(){return S(oe)},size:"sm"})}},$$slots:{default:!0}})}Fe(bt),ar(Qt=>fe(bt,"aria-label",Qt),[()=>Ye.diagram_renderer_actions_ariaLabel()]),ge(nt,bt)};ur($u,nt=>{S(x)&&r().model.nodes.length>0&&nt(Y1)})}var ho=qe($u,2);let Eu,Pu;var X1=Ne(ho);{var G1=nt=>{var bt=K4(),Pt=Ne(bt),Qt=kr(Pt,!0),te=qe(Pt,2),_t=kr(te,!0);Fe(bt),ar((le,oe)=>{pr(Qt,le),pr(_t,oe)},[()=>Ye.markdown_mermaid_renderFailed_error(),()=>Ye.diagram_renderer_error_description()]),ge(nt,bt)},j1=nt=>{var bt=Q4(),Pt=Ne(bt),Qt=kr(Pt,!0),te=qe(Pt,2),_t=kr(te,!0);Fe(bt),ar((le,oe)=>{pr(Qt,le),pr(_t,oe)},[()=>Ye.diagram_validator_noNodes_warning(),()=>Ye.diagram_renderer_empty_description()]),ge(nt,bt)},U1=nt=>{var bt=oP();let Pt;var Qt=Ne(bt);let te;var _t=Ne(Qt),le=Ne(_t),oe=qe(le),ae=qe(oe),pe=qe(ae),be=qe(pe),ye=qe(be),Fr=qe(ye),xi=qe(Fr);Fe(_t);var Eo=qe(_t);Rp(Eo,()=>S(p),ci=>{var Vr=iP();let bi;var Po=Ne(Vr);{var yr=tr=>{var Le=zo(),wr=Qr(Le);aa(wr,17,()=>S(ne),$r=>$r.id,($r,hr)=>{var dr=J4(),Rr=Ne(dr);{let Ai=Et(()=>S(dt)!==null&&S(dt)!==S(hr).id);q1(Rr,{get group(){return S(hr)},get dimmed(){return S(Ai)},onHover:Cs=>ft(dt,Cs,!0)})}Fe(dr),yo(1,dr,()=>ws,()=>({delay:0,duration:y(ot)})),yo(2,dr,()=>ws,()=>({duration:y(yt)})),ge($r,dr)}),ge(tr,Le)};ur(Po,tr=>{S(ne)&&tr(yr)})}var Ze=qe(Po);aa(Ze,17,()=>S(Ft),tr=>tr.id,(tr,Le)=>{const wr=Et(()=>S(it)!==null&&!S(Bt).has(S(Le).id)||S(dt)!==null&&!S(X).has(S(Le).id)||S(Rt)&&S(At)!==null&&!S(At).has(S(Le).id)),$r=Et(()=>S(At)!==null&&S(At).has(S(Le).id));var hr=tP(),dr=Ne(hr);N1(dr,{get edge(){return S(Le)},get dimmed(){return S(wr)},get highlighted(){return S($r)},get markerScope(){return r().id},get terminalGap(){return S(H)},motionDelay:0,onmotionchange:ka}),Fe(hr),yo(1,hr,()=>xe,()=>({duration:ot})),yo(2,hr,()=>xe,()=>({duration:vt})),ge(tr,hr)});var nr=qe(Ze);aa(nr,17,()=>S(Ft),tr=>tr.id,(tr,Le)=>{var wr=zo(),$r=Qr(wr);{var hr=Rr=>{const Ai=Et(()=>S(ie).get(S(Le).id)),Cs=Et(()=>S(it)!==null&&!S(Bt).has(S(Le).id)||S(dt)!==null&&!S(X).has(S(Le).id)||S(Rt)&&S(At)!==null&&!S(At).has(S(Le).id));var oi=eP();let cc;var K1=Ne(oi);{var Q1=Io=>{PC(Io,{get content(){return S(Le).label},side:"top",class:"edge-label-tooltip",trigger:hc=>{var Sa=Ep(),tC=Ne(Sa),eC=kr(tC,!0);Fe(Sa),ar(()=>{fe(Sa,"aria-label",S(Le).label),pr(eC,S(Le).label)}),ge(hc,Sa)},$$slots:{trigger:!0}})},J1=Io=>{var wn=Ep(),hc=Ne(wn),Sa=kr(hc,!0);Fe(wn),ar(()=>pr(Sa,S(Le).label)),ge(Io,wn)};ur(K1,Io=>{S(Ai).truncated?Io(Q1):Io(J1,-1)})}Fe(oi),ar(Io=>{fe(oi,"x",S(Ai).x),fe(oi,"y",S(Ai).y),fe(oi,"width",S(Ai).width),fe(oi,"height",S(Ai).height),cc=Ji(oi,0,`edge-label-container diagram-geometry-motion ${S(Cs)?"edge-label-dimmed":""}`,null,cc,{"edge-label-entry":Io}),fe(oi,"data-edge-id",S(Le).id),fe(oi,"data-semantic-style",S(Le).semanticStyle??"default"),fe(oi,"data-truncated",S(Ai).truncated)},[()=>S(Z)&&S(It).includes(S(Le).id)]),yo(2,oi,()=>ws,()=>({duration:y(yt/2)})),ge(Rr,oi)},dr=Et(()=>S(Le).label&&S(ie).has(S(Le).id));ur($r,Rr=>{S(dr)&&Rr(hr)})}ge(tr,wr)});var _r=qe(nr);aa(_r,17,()=>S(Be),tr=>tr.id,(tr,Le)=>{const wr=Et(()=>S(it)!==null&&!S(Ct).has(S(Le).id)||S(dt)!==null&&!S(wt).has(S(Le).id)||S(Rt)&&S(St)!==null&&!S(St).has(S(Le).id)),$r=Et(()=>S(St)!==null&&S(St).has(S(Le).id));var hr=rP(),dr=Ne(hr);R1(dr,{get node(){return S(Le)},get editable(){return o()},get styleConfig(){return S(J)},get dimmed(){return S(wr)},get highlighted(){return S($r)},onMove:(Rr,Ai)=>z1(S(Le).id,Rr,Ai),onHover:Rr=>ft(it,Rr,!0),get onBindingClick(){return s()}}),Fe(hr),ar(()=>{fe(hr,"data-node-id",S(Le).id),fe(hr,"x",S(Le).x),fe(hr,"y",S(Le).y),fe(hr,"width",S(Le).width),fe(hr,"height",S(Le).height)}),yo(1,hr,()=>ws,()=>({delay:0,duration:S(Z)?y(ot):0,easing:zu})),yo(2,hr,()=>ws,()=>({duration:y(yt)})),ge(tr,hr)}),Fe(Vr),ar(()=>{fe(Vr,"transform",S(wa)),bi=Ea(Vr,"",bi,{transform:S(Ur)})}),ge(ci,Vr)}),Fe(Qt),Fe(bt),ar(()=>{Pt=Ea(bt,"",Pt,{width:S(z)?`max(100%, ${S(mr)+16}px)`:`${S(mr)}px`,height:S(z)?`max(100%, ${S(fr)}px)`:`${S(mi)}px`}),fe(Qt,"width",S(Jt)),fe(Qt,"height",S(ir)+6),te=Ea(Qt,"",te,{top:S(z)?`${S(Wi)/2}px`:void 0,transform:S(ve)}),fe(le,"id",`arrowhead-${r().id??""}`),fe(oe,"id",`arrowhead-danger-${r().id??""}`),fe(ae,"id",`arrowhead-success-${r().id??""}`),fe(pe,"id",`arrowhead-warning-${r().id??""}`),fe(be,"id",`arrowhead-muted-${r().id??""}`),fe(ye,"id",`arrowhead-inactive-${r().id??""}`),fe(Fr,"id",`arrowhead-highlighted-${r().id??""}`),fe(xi,"id",`arrowhead-active-${r().id??""}`)}),ge(nt,bt)};ur(X1,nt=>{S(k)?nt(G1):r().model.nodes.length===0?nt(j1,1):nt(U1,-1)})}Fe(ho),Ki(ho,nt=>ft(T,nt),()=>S(T));var V1=qe(ho,2);{var Z1=nt=>{var bt=aP(),Pt=Ne(bt);W1(Pt,{get states(){return r().states},get currentStateId(){return S(q)},onStateChange:lc}),Fe(bt),ge(nt,bt)};ur(V1,nt=>{!S(k)&&r().model.nodes.length>0&&r().states&&r().states.length>0&&nt(Z1)})}return Fe(Yi),Ki(Yi,nt=>ft(Yt,nt),()=>S(Yt)),ar((nt,bt,Pt,Qt,te,_t,le,oe)=>{Au=Ji(Yi,1,"diagram-renderer svelte-10vg205",null,Au,{"has-content":nt,"compact-diagram":S(rt),"fitted-diagram":S(v),"stateful-diagram":bt,"camera-stage":S(ut)==="camera",resizing:S(f)}),fe(Yi,"data-diagram-intrinsic-width",S(sr)),Fu=Ea(Yi,`--diagram-edge-label-font-size: ${Si.fontSize}px;
342
+ --diagram-edge-label-line-height: ${Si.lineHeight};
343
+ --diagram-edge-label-padding-x: ${Si.paddingX}px;
344
+ --diagram-edge-label-padding-y: ${Si.paddingY}px;`,Fu,{"--diagram-camera-duration":Pt,"--diagram-camera-easing":K,"--diagram-move-exit-duration":Qt,"--diagram-label-entry-delay":te,"--diagram-label-entry-duration":_t}),fe(Yi,"data-diagram-settled",S(w)),fe(Yi,"data-diagram-state",S(q)),fe(Yi,"data-diagram-motion-phase",S(ut)),Eu=Ji(ho,1,"diagram-scroll-container svelte-10vg205",null,Eu,{"stepping-viewport":S(D)}),fe(ho,"role",S(z)?"region":void 0),fe(ho,"aria-label",le),fe(ho,"tabindex",S(yi)?0:void 0),Pu=Ea(ho,"",Pu,{height:oe})},[()=>!!(S(x)&&r().model.nodes.length>0),()=>!!r().states?.length,()=>`${y(U)}ms`,()=>`${y(ct)}ms`,()=>`${y(kt)}ms`,()=>`${y(Xt)}ms`,()=>S(z)?Ye.diagram_controls_walkthrough_ariaLabel():void 0,()=>S(z)?`${Math.min(S(fr),(S(P)??1/0)*.9)}px`:void 0]),jC("innerHeight",nt=>ft(P,nt,!0)),ge(e,Yi),Fo(H1)}var lP=er('<header class="diagram-presentation-header svelte-1rsrotk" data-diagram-presentation-header=""><!></header>'),cP=er('<div data-diagram-presentation-actions=""><!> <!></div>'),hP=er('<section data-diagram-presentation=""><!> <!> <div class="diagram-presentation-content svelte-1rsrotk" data-diagram-presentation-content=""><!></div></section>');function dP(e,t){if(new.target)return _o({component:dP,...e});Ao(t,!0);let r=ze(t,"kind",7),i=ze(t,"children",7),o=ze(t,"header",7),a=ze(t,"actions",7),s=ze(t,"actionsInTopMargin",7,!1),n=ze(t,"rendererOwnsActions",7,!1),l=ze(t,"selected",7,!1),c=ze(t,"exportable",7,!0),h=ze(t,"fileName",7),d=ce(void 0),u=ce(void 0),f=ce(void 0),p=ce(!1),g=ce(!1);td(()=>{const _=S(d)?.closest(".node-mermaidBlock, .node-diagram_block"),$=_?.parentElement;if(!_||!$?.matches(".tiptap-editor.ProseMirror")||!S(d)){ft(p,!0);return}const P=S(d);ft(g,!0);let D=0,F=0,E=!1,B,q;const W=()=>{B=void 0;const j=F,z=P.querySelector("[data-diagram-intrinsic-width]"),Q=P.querySelector(".mermaid-svg > svg");z?.dataset.diagramSettled==="true"?D=Number(z.dataset.diagramIntrinsicWidth):Q?.dataset.layoutSettled==="true"?D=Q.viewBox.baseVal.width+16:!z&&!Q&&(D=0);const rt=_.clientWidth,et=$.clientWidth,J=Math.min(rt,Math.max(et,D)),at=Math.min(rt,et),xt=z?z.dataset.diagramSettled==="true":Q?Q.dataset.layoutSettled==="true":!P.querySelector('[data-render-settled="false"]');q=WC(()=>{if(E||F!==j)return;q=void 0;const H=S(u)!==J;ft(u,J,!0),ft(f,at,!0),ft(p,xt,!0),S(g)&&xt&&rt>0&&et>0&&(H?B??=Hu(W):ft(g,!1))})},O=()=>{F+=1,ft(p,!1),q?.(),q=void 0,B??=Hu(W)},R=new ResizeObserver(O);R.observe(_),R.observe($);const V=new MutationObserver(O);return V.observe(P,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-diagram-settled","data-diagram-intrinsic-width","data-layout-settled","data-render-settled"]}),O(),()=>{E=!0,R.disconnect(),V.disconnect(),B?.(),q?.()}});var m={get kind(){return r()},set kind(_){r(_),Me()},get children(){return i()},set children(_){i(_),Me()},get header(){return o()},set header(_){o(_),Me()},get actions(){return a()},set actions(_){a(_),Me()},get actionsInTopMargin(){return s()},set actionsInTopMargin(_=!1){s(_),Me()},get rendererOwnsActions(){return n()},set rendererOwnsActions(_=!1){n(_),Me()},get selected(){return l()},set selected(_=!1){l(_),Me()},get exportable(){return c()},set exportable(_=!0){c(_),Me()},get fileName(){return h()},set fileName(_){h(_),Me()},$set:Bo,$on:(_,$)=>Lo(t,_,$)},y=hP();let x,C;var k=Ne(y);{var v=_=>{var $=lP(),P=Ne($);Hn(P,o),Fe($),ge(_,$)};ur(k,_=>{o()&&_(v)})}var M=qe(k,2);{var A=_=>{var $=cP();let P;var D=Ne($);Hn(D,()=>a()??cC);var F=qe(D,2);{var E=B=>{wu(B,{get container(){return S(d)},get fileName(){return h()},get compactTrigger(){return s()}})};ur(F,B=>{c()&&B(E)})}Fe($),ar(()=>P=Ji($,1,"diagram-presentation-actions svelte-1rsrotk",null,P,{"actions-in-top-margin":s()})),ge(_,$)};ur(M,_=>{!n()&&(a()||c())&&_(A)})}var L=qe(M,2),T=Ne(L);return Hn(T,i),Fe(L),Ki(L,_=>ft(d,_),()=>S(d)),Fe(y),ar(()=>{x=Ji(y,1,"diagram-presentation svelte-1rsrotk",null,x,{selected:l(),initializing:S(g),"renderer-owns-actions":n()}),y.inert=S(g),fe(y,"data-diagram-presentation-settled",S(p)),fe(y,"data-diagram-presentation-initializing",S(g)),fe(y,"data-diagram-kind",r()),C=Ea(y,S(f)===void 0?void 0:`--diagram-controls-width: ${S(f)}px`,C,{width:S(u)===void 0?void 0:`${S(u)}px`,"min-width":S(u)===void 0?void 0:"0"})}),ge(e,y),Fo(m)}export{Pl as $,TI as A,ss as B,m_ as C,dP as D,wI as E,lm as F,cn as G,p_ as H,nm as I,KC as J,va as K,Ad as L,NE as M,rI as N,gi as O,Us as P,mt as Q,si as R,zT as S,OT as T,i2 as U,QP as V,bd as W,Ld as X,rk as Y,lM as Z,UC as _,dn as a,Pd as a$,Xf as a0,_m as a1,ZT as a2,KT as a3,mM as a4,kw as a5,Cw as a6,Mr as a7,Xe as a8,vw as a9,Ht as aA,b_ as aB,ni as aC,cm as aD,Wd as aE,gu as aF,Kn as aG,PB as aH,he as aI,gt as aJ,vT as aK,ln as aL,QC as aM,Mt as aN,DT as aO,Ny as aP,Nr as aQ,Hg as aR,gA as aS,iI as aT,oI as aU,Am as aV,dy as aW,WT as aX,Zy as aY,Gl as aZ,Cf as a_,hI as aa,ba as ab,AI as ac,VB as ad,Cy as ae,bn as af,Nd as ag,C2 as ah,sw as ai,VP as aj,Gf as ak,BI as al,Qs as am,au as an,JP as ao,jB as ap,qL as aq,$L as ar,JC as as,K0 as at,UT as au,VT as av,jT as aw,Ro as ax,Nf as ay,tv as az,nP as b,PL as b0,vI as b1,yM as b2,PT as b3,dm as b4,LI as b5,sm as b6,EL as b7,jS as b8,Ho as b9,Qw as bA,ee as bB,ui as bC,CT as bD,CM as bE,CI as ba,Ti as bb,He as bc,bA as bd,FI as be,ww as bf,bw as bg,KP as bh,Sw as bi,kI as bj,RT as bk,gw as bl,Mw as bm,Z0 as bn,aI as bo,sI as bp,_i as bq,hy as br,jt as bs,IT as bt,nI as bu,Hr as bv,XT as bw,GT as bx,HT as by,YT as bz,b as c,tI as d,lI as e,Gp as f,fy as g,wT as h,qT as i,NT as j,cI as k,Pr as l,Vt as m,eI as n,jC as o,uy as p,ZP as q,Gd as r,ky as s,To as t,l2 as u,Ud as v,xw as w,SI as x,_I as y,MI as z};